:root {
    --bg-gradient: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 48%, #eef2ff 100%);
    --card-bg: rgba(255, 255, 255, 0.72);
    --card-border: rgba(255, 255, 255, 0.85);
    --card-hover: rgba(255, 255, 255, 0.94);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.12);
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

body.dark-mode {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    --card-bg: rgba(30, 41, 59, 0.72);
    --card-border: rgba(255, 255, 255, 0.09);
    --card-hover: rgba(51, 65, 85, 0.88);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent: #60a5fa;
    --accent-soft: rgba(96, 165, 250, 0.18);
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    transition: color .25s ease;
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    pointer-events: none;
}
.orb-1 { width: 380px; height: 380px; background: rgba(56, 189, 248, 0.25); top: -80px; left: -80px; }
.orb-2 { width: 420px; height: 420px; background: rgba(129, 140, 248, 0.2); bottom: -100px; right: -80px; }

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.45);
    border-bottom: 1px solid var(--card-border);
}
body.dark-mode .topbar { background: rgba(15, 23, 42, 0.65); }

.topbar-inner {
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 18px;
}
.brand-logo { font-size: 22px; }

.brand-logo-img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Search Section：上方留足空余 */
.search-section {
    padding: 64px 0 18px;
}
.search-panel {
    max-width: 680px;
    margin: 0 auto;
    border-radius: 20px;
    padding: 14px;
}
.engine-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.engine-tab {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 9px;
    cursor: pointer;
    transition: all .2s;
}
.engine-tab.active {
    background: var(--accent);
    color: #fff;
}
.search-box {
    display: flex;
    gap: 10px;
}
.search-box input {
    flex: 1;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.7);
    color: #0f172a;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 16px;
    outline: none;
}
body.dark-mode .search-box input {
    background: rgba(15, 23, 42, 0.75);
    color: #f8fafc;
}
.search-btn {
    border: none;
    background: var(--accent);
    color: #fff;
    padding: 0 22px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

/* 响应式显隐控制 */
.mobile-only { display: none; }

/* Grid：默认一行三个（3列） */
main.container { flex: 1; }
.links-wrapper { margin-top: 22px; }

.links-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
    min-width: 0;
}
.link-card:hover {
    transform: translateY(-3px);
    background: var(--card-hover);
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.12);
}

.link-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.link-icon-wrap img {
    width: 25px;
    height: 25px;
    object-fit: contain;
}
.fallback-avatar {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 17px;
    color: var(--accent);
}

.link-meta { min-width: 0; flex: 1; }
.link-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.link-title {
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.badge-hot {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.16);
    color: #d97706;
    font-weight: 600;
    flex-shrink: 0;
}
.link-desc {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-notice {
    text-align: center;
    padding: 36px 20px;
    border-radius: 18px;
    margin-top: 24px;
    color: var(--text-secondary);
}

.site-footer {
    margin-top: 48px;
    padding: 22px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--card-border);
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.record-sep { margin: 0 6px; }

/* 手机端样式：去除搜索框，展示轮播图 + 滚动公告条，网站保持一行三个 */
@media (max-width: 768px) {
    html,
    body {
        touch-action: pan-y;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    a,
    button,
    input,
    .link-card,
    .carousel-card,
    .announcement-bar {
        touch-action: manipulation;
    }

    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }

    .container { padding: 0 12px; }
    .brand-name { font-size: 16px; }

    .mobile-hero {
        padding-top: 14px;
    }

    .carousel-card {
        position: relative;
        border-radius: 16px;
        overflow: hidden;
        aspect-ratio: 16 / 7;
        margin-bottom: 12px;
    }
    .carousel-track {
        display: flex;
        height: 100%;
        transition: transform .35s ease;
    }
    .carousel-slide {
        min-width: 100%;
        height: 100%;
        position: relative;
    }
    .carousel-slide a,
    .carousel-slide img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .carousel-caption {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 18px 12px 8px;
        background: linear-gradient(to top, rgba(15, 23, 42, 0.72), transparent);
        color: #fff;
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .carousel-dots {
        position: absolute;
        right: 10px;
        bottom: 8px;
        display: flex;
        gap: 5px;
        z-index: 5;
    }
    .carousel-dot {
        width: 6px;
        height: 6px;
        border-radius: 999px;
        border: none;
        padding: 0;
        background: rgba(255, 255, 255, 0.55);
        cursor: pointer;
    }
    .carousel-dot.active {
        width: 16px;
        background: #fff;
    }

    /* 滚动公告条 */
    .announcement-bar {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 9px 12px;
        border-radius: 12px;
        margin-bottom: 12px;
    }
    .ann-badge {
        font-size: 12px;
        font-weight: 700;
        color: var(--accent);
        background: var(--accent-soft);
        padding: 3px 8px;
        border-radius: 8px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .ann-marquee {
        flex: 1;
        overflow: hidden;
        white-space: nowrap;
        position: relative;
    }
    .ann-track {
        display: inline-flex;
        align-items: center;
        animation: marqueeScroll 16s linear infinite;
    }
    .ann-marquee:hover .ann-track {
        animation-play-state: paused;
    }
    .ann-item {
        font-size: 13px;
        color: var(--text-primary);
        margin-right: 28px;
    }
    .ann-item a {
        color: inherit;
        text-decoration: none;
    }
    @keyframes marqueeScroll {
        0% { transform: translateX(0); }
        100% { transform: translateX(-50%); }
    }

    /* 手机端保持一行三个 */
    .links-wrapper { margin-top: 8px; }
    .links-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
    .link-card {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 6px;
        padding: 12px 6px;
        border-radius: 14px;
    }
    .link-icon-wrap {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }
    .link-icon-wrap img {
        width: 21px;
        height: 21px;
    }
    .link-title-row {
        justify-content: center;
        margin-bottom: 2px;
        gap: 3px;
    }
    .link-title {
        font-size: 12.5px;
    }
    .badge-hot {
        display: none;
    }
    .link-desc {
        font-size: 11px;
    }
}


/* 电脑版右下角快捷入口：上移并停靠在页脚上方 */
.desktop-float-dock {
    position: fixed;
    right: 24px;
    bottom: 132px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.float-dock-btn {
    width: 66px;
    padding: 10px 6px;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-primary);
    text-decoration: none;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.float-dock-btn:hover {
    transform: translateY(-3px);
    background: var(--card-hover);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.16);
}
.float-dock-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.float-dock-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}
.float-dock-text {
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.2;
}

/* 二维码弹窗 */
.qr-modal-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(4px);
    z-index: 120;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.qr-modal-mask.show {
    display: flex;
}
.qr-modal-card {
    width: 100%;
    max-width: 320px;
    border-radius: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
}
body.dark-mode .qr-modal-card {
    background: rgba(30, 41, 59, 0.96);
    color: #f8fafc;
}
.qr-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.qr-modal-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}
.qr-modal-close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.qr-modal-body {
    text-align: center;
}
.qr-modal-img {
    width: 208px;
    height: 208px;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    display: block;
    margin: 0 auto 12px;
}
.qr-modal-desc {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .desktop-float-dock { display: none !important; }
}
