/* ==========================================================================
   十三直播助手 · 工具导航
   视觉语言：黑金（暗色为默认，金色 #d4af37 点缀 / 玻璃拟态 / 金渐变文字）
   ========================================================================== */

/* ---------- 设计变量 ---------- */
:root {
    --maxw: 1200px;
    --header-h: 68px;

    --gold: #d4af37;
    --gold-hi: #ecd486;
    --gold-deep: #b8941f;
    --gold-grad: linear-gradient(135deg, #ecd486 0%, #d4af37 45%, #b8941f 100%);

    --bg: #080a0f;
    --bg-soft: #0b0f16;
    --panel: rgba(255, 255, 255, 0.035);
    --panel-2: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --border-soft: rgba(255, 255, 255, 0.05);
    --text: #f4f5f7;
    --muted: #9aa3b2;
    --muted-2: #6f7887;

    --shadow: 0 22px 48px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.35);
    --glow: 0 0 40px rgba(212, 175, 55, 0.18);
    --radius: 18px;
    --ease: cubic-bezier(0.22, 0.68, 0.26, 1);
}

html[data-theme="light"] {
    --bg: #fbf8f1;
    --bg-soft: #fffdf8;
    --panel: #ffffff;
    --panel-2: #fffaf0;
    --border: rgba(17, 24, 39, 0.09);
    --border-soft: rgba(17, 24, 39, 0.06);
    --text: #16191f;
    --muted: #5c6573;
    --muted-2: #8b93a1;

    --shadow: 0 22px 44px rgba(41, 37, 20, 0.12);
    --shadow-sm: 0 10px 22px rgba(41, 37, 20, 0.08);
    --glow: 0 0 40px rgba(212, 175, 55, 0.16);
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    color-scheme: dark;
}
html[data-theme="light"] { color-scheme: light; }

body {
    margin: 0;
    font-family: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(900px 520px at 10% -10%, rgba(212, 175, 55, 0.16), transparent 62%),
        radial-gradient(760px 500px at 94% 2%, rgba(212, 175, 55, 0.09), transparent 60%),
        radial-gradient(700px 700px at 50% 110%, rgba(212, 175, 55, 0.06), transparent 70%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}
html[data-theme="light"] body {
    background-image:
        radial-gradient(900px 520px at 8% -10%, rgba(212, 175, 55, 0.22), transparent 62%),
        radial-gradient(760px 520px at 96% 0%, rgba(212, 175, 55, 0.14), transparent 58%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }

::selection { background: rgba(212, 175, 55, 0.35); color: #fff; }
html[data-theme="light"] ::selection { background: rgba(212, 175, 55, 0.3); color: #16191f; }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 6px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.3); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(212, 175, 55, 0.55); background-clip: padding-box; }
html[data-theme="light"] ::-webkit-scrollbar-track { background: #efe9da; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(120, 113, 95, 0.35); background-clip: padding-box; }

.container {
    width: min(100% - 48px, var(--maxw));
    margin-inline: auto;
}

.skip-link {
    position: fixed;
    left: 16px;
    top: -80px;
    z-index: 200;
    padding: 10px 18px;
    border-radius: 10px;
    background: var(--gold);
    color: #14110a;
    font-weight: 600;
    transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 16px; }

/* ---------- 顶部导航 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(8, 10, 15, 0.72);
    -webkit-backdrop-filter: saturate(140%) blur(20px);
    backdrop-filter: saturate(140%) blur(20px);
    border-bottom: 1px solid var(--border-soft);
    transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
html[data-theme="light"] .site-header { background: rgba(255, 253, 248, 0.82); }
.site-header.is-scrolled {
    background: rgba(8, 10, 15, 0.92);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    border-bottom-color: var(--border);
}
html[data-theme="light"] .site-header.is-scrolled {
    background: rgba(255, 253, 248, 0.96);
    box-shadow: 0 12px 30px rgba(41, 37, 20, 0.08);
}

.header-inner {
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}
.brand-logo {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 10px;
    object-fit: contain;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15.5px; font-weight: 650; letter-spacing: 0.01em; }
.brand-text small {
    font-size: 10.5px;
    letter-spacing: 0.22em;
    color: var(--muted-2);
    text-transform: uppercase;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.main-nav a {
    position: relative;
    padding: 8px 12px;
    font-size: 13.5px;
    color: var(--muted);
    border-radius: 9px;
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.main-nav a::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: var(--gold-grad);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.28s var(--ease);
}
.main-nav a:hover { color: var(--text); }
.main-nav a:hover::after,
.main-nav a.is-active::after { transform: scaleX(1); }
.main-nav a.is-active { color: var(--gold-hi); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 550;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    transition: all 0.25s var(--ease);
}
.ghost-btn svg { width: 14px; height: 14px; }
.ghost-btn:hover {
    color: var(--gold-hi);
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(212, 175, 55, 0.08);
    transform: translateY(-1px);
}
html[data-theme="light"] .ghost-btn:hover { color: var(--gold-deep); }

.icon-btn {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    color: var(--muted);
    transition: all 0.25s var(--ease);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover {
    color: var(--gold-hi);
    border-color: rgba(212, 175, 55, 0.45);
    background: rgba(212, 175, 55, 0.08);
    transform: translateY(-1px);
}
html[data-theme="light"] .icon-btn:hover { color: var(--gold-deep); }

.icon-sun { display: none; }
html[data-theme="light"] .icon-sun { display: block; }
html[data-theme="light"] .icon-moon { display: none; }

.menu-btn, .mobile-nav { display: none; }
.icon-close { display: none; }
.menu-btn[aria-expanded="true"] .icon-burger { display: none; }
.menu-btn[aria-expanded="true"] .icon-close { display: block; }

/* ---------- 首屏 ---------- */
.hero {
    position: relative;
    padding: clamp(52px, 7vw, 88px) 0 clamp(32px, 4vw, 52px);
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 72px 72px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 78%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 78%);
    pointer-events: none;
}
html[data-theme="light"] .hero::before {
    background-image:
        linear-gradient(to right, rgba(17, 24, 39, 0.055) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(17, 24, 39, 0.055) 1px, transparent 1px);
}

.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) 372px;
    gap: clamp(32px, 5vw, 64px);
    align-items: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 15px 7px 13px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--gold-hi);
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.07);
}
html[data-theme="light"] .eyebrow { color: var(--gold-deep); background: rgba(212, 175, 55, 0.1); }
.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.6);
    animation: pulse 2.4s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.hero h1 {
    margin: 22px 0 0;
    font-size: clamp(2.1rem, 4.4vw, 3.35rem);
    line-height: 1.14;
    font-weight: 700;
    letter-spacing: -0.025em;
}
.hero h1 .grad {
    display: block;
    margin-top: 6px;
    background: linear-gradient(96deg, #f4e4bc 0%, #d4af37 42%, #b8941f 78%, #ecd486 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: goldFlow 9s linear infinite;
    filter: drop-shadow(0 6px 24px rgba(212, 175, 55, 0.22));
}
@keyframes goldFlow {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.lede {
    margin-top: 20px;
    max-width: 56ch;
    font-size: 15.5px;
    line-height: 1.8;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 46px;
    padding: 0 24px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    overflow: hidden;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
        background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.btn svg { width: 17px; height: 17px; }
.btn-gold {
    color: #17130a;
    background: var(--gold-grad);
    box-shadow: 0 12px 26px rgba(212, 175, 55, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-gold::after {
    content: "";
    position: absolute;
    top: 0;
    left: -130%;
    width: 55%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: skewX(-20deg);
    transition: left 0.65s var(--ease);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 18px 34px rgba(212, 175, 55, 0.36); }
.btn-gold:hover::after { left: 150%; }
.btn-ghost {
    color: var(--text);
    border-color: var(--border);
    background: var(--panel);
}
.btn-ghost:hover {
    color: var(--gold-hi);
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(212, 175, 55, 0.08);
    transform: translateY(-2px);
}
html[data-theme="light"] .btn-ghost:hover { color: var(--gold-deep); }

.hero-stats {
    display: flex;
    align-items: center;
    gap: clamp(22px, 4vw, 46px);
    margin-top: 42px;
    padding-top: 26px;
    border-top: 1px solid var(--border-soft);
}
.hero-stats > div { position: relative; }
.hero-stats > div + div { padding-left: clamp(22px, 4vw, 46px); }
.hero-stats > div + div::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: var(--border);
}
.stat-num {
    font-size: clamp(24px, 2.6vw, 30px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(160deg, #f6e9c4, #d4af37 60%, #b8941f);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.stat-num span { font-size: 0.6em; }
.stat-label {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--muted-2);
    letter-spacing: 0.04em;
}

/* 首屏右侧面板 */
.hero-panel {
    position: relative;
    padding: 24px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    overflow: hidden;
}
html[data-theme="light"] .hero-panel {
    background: linear-gradient(180deg, #ffffff, #fffaf0);
}
.hero-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.75), transparent);
}
.hero-panel::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -80px;
    top: -90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.22), transparent 68%);
    pointer-events: none;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.panel-kicker {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--muted);
}
.panel-badge {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.16em;
    padding: 4px 8px;
    border-radius: 6px;
    color: #17130a;
    background: var(--gold-grad);
}

.hot-list li + li { border-top: 1px solid var(--border-soft); }
.hot-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 8px;
    margin-inline: -8px;
    border-radius: 12px;
    transition: background-color 0.22s var(--ease), transform 0.22s var(--ease);
}
.hot-link:hover { background: rgba(212, 175, 55, 0.08); transform: translateX(2px); }
.hot-icon {
    position: relative;
    overflow: hidden;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--grad, rgba(255, 255, 255, 0.1));
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.hot-icon img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
}
.hot-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; min-width: 0; }
.hot-name { font-size: 13.5px; font-weight: 550; line-height: 1.35; }
.hot-desc {
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--muted-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hot-arrow {
    margin-left: auto;
    width: 15px;
    height: 15px;
    color: var(--muted-2);
    transition: transform 0.22s var(--ease), color 0.22s var(--ease);
}
.hot-link:hover .hot-arrow { color: var(--gold); transform: translate(2px, -2px); }

.panel-note {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
    font-size: 11.5px;
    color: var(--muted-2);
}
kbd {
    display: inline-block;
    min-width: 20px;
    padding: 1px 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10.5px;
    line-height: 1.6;
    text-align: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px;
}
html[data-theme="light"] kbd { background: #fff; }

/* ---------- 搜索 / 筛选条 ---------- */
.toolbar {
    position: sticky;
    top: var(--header-h);
    z-index: 50;
    padding: 14px 0;
    background: rgba(8, 10, 15, 0.82);
    -webkit-backdrop-filter: saturate(140%) blur(18px);
    backdrop-filter: saturate(140%) blur(18px);
    border-bottom: 1px solid var(--border-soft);
}
html[data-theme="light"] .toolbar { background: rgba(255, 253, 248, 0.88); }

.toolbar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search {
    position: relative;
    flex: 0 1 340px;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 10px 0 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s var(--ease);
}
.search:focus-within {
    border-color: rgba(212, 175, 55, 0.55);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
    background: rgba(212, 175, 55, 0.05);
}
.search > svg { width: 17px; height: 17px; color: var(--muted-2); flex: 0 0 auto; }
.search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    font-size: 13.5px;
    color: var(--text);
    outline: none;
    -webkit-appearance: none;
}
.search input::placeholder { color: var(--muted-2); }
.search input::-webkit-search-cancel-button { display: none; }
.search-kbd { flex: 0 0 auto; }
.search-clear {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}
.search-clear svg { width: 12px; height: 12px; }
.search-clear:hover { color: var(--text); background: rgba(255, 255, 255, 0.14); }
.search-clear[hidden] { display: none; }

.filters {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-mask-image: linear-gradient(90deg, #000 94%, transparent);
    mask-image: linear-gradient(90deg, #000 94%, transparent);
}
.filters::-webkit-scrollbar { display: none; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    height: 34px;
    padding: 0 12px;
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    transition: all 0.22s var(--ease);
}
.chip em {
    font-style: normal;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    opacity: 0.6;
}
.chip:hover { color: var(--text); border-color: rgba(212, 175, 55, 0.4); background: rgba(212, 175, 55, 0.07); }
.chip.is-active {
    color: #17130a;
    font-weight: 600;
    border-color: transparent;
    background: var(--gold-grad);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.24);
}
.chip.is-active em { opacity: 0.75; }

/* ---------- 列表 ---------- */
.list-wrap { padding-top: 34px; }

.list-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
    font-size: 12.5px;
    color: var(--muted-2);
}
.list-meta p:first-child { color: var(--muted); }
.list-hint { letter-spacing: 0.02em; }

.tools-section {
    padding: 30px 0 10px;
    scroll-margin-top: calc(var(--header-h) + 76px);
}
.tools-section[hidden] { display: none; }

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-soft);
}
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.24em;
    color: var(--gold);
    text-transform: uppercase;
}
.section-kicker::after,
.section-kicker::before {
    content: "";
    height: 1px;
    width: 22px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.6));
}
.section-kicker::after { background: linear-gradient(90deg, rgba(212, 175, 55, 0.6), transparent); }
.section-head h2 {
    margin-top: 10px;
    font-size: clamp(1.28rem, 2vw, 1.6rem);
    font-weight: 650;
    letter-spacing: -0.01em;
}
.section-head p {
    margin-top: 7px;
    font-size: 13px;
    color: var(--muted-2);
}
.section-count {
    flex: 0 0 auto;
    padding: 6px 12px;
    font-size: 11.5px;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(296px, 1fr));
    gap: 14px;
}

.tool-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 16px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--panel);
    overflow: hidden;
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
        background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.tool-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(320px circle at 0% 0%, rgba(212, 175, 55, 0.12), transparent 62%);
    opacity: 0;
    transition: opacity 0.35s var(--ease);
    pointer-events: none;
}
.tool-card:hover {
    transform: translateY(-3px);
    border-color: rgba(212, 175, 55, 0.42);
    background: var(--panel-2);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(212, 175, 55, 0.08);
}
html[data-theme="light"] .tool-card:hover { box-shadow: 0 18px 30px rgba(41, 37, 20, 0.12), 0 0 0 1px rgba(212, 175, 55, 0.14); }
.tool-card:hover::before { opacity: 1; }
.tool-card[hidden] { display: none; }

.tool-icon {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 6px 14px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}
.tool-badge {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}
.tool-badge[data-len="2"] { font-size: 12.5px; letter-spacing: 0.01em; }
.tool-badge[data-len="3"] { font-size: 10.5px; letter-spacing: 0.02em; }
.tool-icon img {
    width: 84%;
    height: 84%;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
}
.tool-icon svg {
    width: 84%;
    height: 84%;
}

.tool-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}
.tool-name {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.005em;
    color: var(--text);
    line-height: 1.45;
}
.tool-tag {
    flex: 0 0 auto;
    padding: 2px 6px;
    font-size: 9.5px;
    font-style: normal;
    font-weight: 600;
    line-height: 1.5;
    color: var(--gold-hi);
    border: 1px solid rgba(212, 175, 55, 0.32);
    border-radius: 5px;
    background: rgba(212, 175, 55, 0.1);
    white-space: nowrap;
}
html[data-theme="light"] .tool-tag { color: var(--gold-deep); }
.tool-desc {
    font-size: 12px;
    line-height: 1.55;
    color: var(--muted-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-go {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--muted-2);
    opacity: 0.5;
    transition: all 0.28s var(--ease);
}
.tool-go svg { width: 13px; height: 13px; }
.tool-card:hover .tool-go {
    opacity: 1;
    color: #17130a;
    border-color: transparent;
    background: var(--gold-grad);
    transform: translate(2px, -2px) rotate(0deg);
    box-shadow: 0 6px 14px rgba(212, 175, 55, 0.3);
}
.tool-card[data-action]:hover .tool-go { transform: translateX(2px); }

/* 空状态 */
.empty-state {
    padding: 64px 20px 80px;
    text-align: center;
}
.empty-state h3 { font-size: 17px; font-weight: 650; }
.empty-state p { margin: 8px 0 20px; font-size: 13.5px; color: var(--muted-2); }
.empty-state .btn { height: 42px; }

/* 卡片作为按钮时（如「N 卡旧版本下载」） */
button.tool-card {
    width: 100%;
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

/* ---------- N 卡历史驱动弹窗 ---------- */
body.is-locked { overflow: hidden; }

.modal { position: fixed; inset: 0; z-index: 120; display: none; }
.modal.is-open { display: block; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 5, 9, 0.72);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    backdrop-filter: blur(8px) saturate(120%);
}
html[data-theme="light"] .modal-backdrop { background: rgba(41, 37, 20, 0.44); }

.modal-panel {
    position: relative;
    width: min(780px, calc(100% - 32px));
    max-height: min(86vh, 920px);
    margin: 6vh auto 0;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.26);
    background: linear-gradient(180deg, #0f131b, #0a0d13);
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    outline: none;
    animation: modalIn 0.3s var(--ease);
}
html[data-theme="light"] .modal-panel {
    background: linear-gradient(180deg, #fffdf8, #fbf6ea);
    border-color: rgba(184, 148, 31, 0.3);
    box-shadow: 0 40px 80px rgba(41, 37, 20, 0.25);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(14px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

.modal-head { display: flex; align-items: flex-start; gap: 18px; padding: 24px 26px 0; }
.modal-heading { flex: 1; min-width: 0; }
.modal-kicker {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: var(--gold);
}
.modal-title {
    margin-top: 8px;
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    font-weight: 650;
    letter-spacing: -0.01em;
}
.modal-desc {
    margin-top: 8px;
    max-width: 58ch;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--muted);
}
.modal-close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    color: var(--muted);
    transition: all 0.22s var(--ease);
}
.modal-close:hover {
    color: var(--gold-hi);
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(212, 175, 55, 0.08);
}
.modal-close svg { width: 16px; height: 16px; }

.modal-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding: 18px 26px 0;
}
.modal-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.m-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    font-size: 12.5px;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 9px;
    background: transparent;
    transition: all 0.22s var(--ease);
}
.m-chip em { font-style: normal; font-size: 10.5px; opacity: 0.6; }
.m-chip:hover {
    color: var(--text);
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.07);
}
.m-chip.is-active {
    color: #17130a;
    font-weight: 600;
    border-color: transparent;
    background: var(--gold-grad);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.22);
}
.m-chip.is-active em { opacity: 0.7; }

.modal-search {
    position: relative;
    flex: 1 1 200px;
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 10px 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
        background-color 0.25s var(--ease);
}
.modal-search:focus-within {
    border-color: rgba(212, 175, 55, 0.55);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
    background: rgba(212, 175, 55, 0.05);
}
.modal-search > svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--muted-2); }
.modal-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 13px;
    color: var(--text);
}
.modal-search input::placeholder { color: var(--muted-2); }
.modal-search input::-webkit-search-cancel-button { display: none; }

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 16px;
    padding: 11px 26px;
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    font-size: 11.5px;
    color: var(--muted-2);
}
.modal-source a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.modal-source a:hover { color: var(--gold-hi); }
html[data-theme="light"] .modal-source a:hover { color: var(--gold-deep); }

.modal-list { overflow-y: auto; padding: 8px 16px 18px; overscroll-behavior: contain; }
.modal-list::-webkit-scrollbar { width: 8px; }
.modal-list::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.28); border-radius: 8px; }
.modal-list::-webkit-scrollbar-thumb:hover { background: rgba(212, 175, 55, 0.5); }

.drv-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 11px;
    border-bottom: 1px solid var(--border-soft);
    transition: background-color 0.2s var(--ease);
}
.drv-row:last-child { border-bottom: 0; }
.drv-row:hover { background: rgba(212, 175, 55, 0.055); }
.drv-row[hidden] { display: none; }

.drv-rank {
    flex: 0 0 26px;
    font-size: 11px;
    color: var(--muted-2);
    font-variant-numeric: tabular-nums;
    text-align: center;
}
.drv-rank.is-top { color: var(--gold); }

.drv-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; }
.drv-ver {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.005em;
    font-variant-numeric: tabular-nums;
}
.drv-tag {
    flex: 0 0 auto;
    padding: 2px 7px;
    border: 1px solid transparent;
    border-radius: 5px;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 1.6;
}
.drv-tag--head { color: var(--gold-hi); border-color: rgba(212, 175, 55, 0.32); background: rgba(212, 175, 55, 0.1); }
.drv-tag--hotfix { color: #ffb36b; border-color: rgba(255, 159, 80, 0.35); background: rgba(255, 150, 60, 0.1); }
.drv-tag--pro { color: #c4b5fd; border-color: rgba(167, 139, 250, 0.35); background: rgba(167, 139, 250, 0.12); }
html[data-theme="light"] .drv-tag--head { color: var(--gold-deep); }
html[data-theme="light"] .drv-tag--hotfix { color: #b45309; }
html[data-theme="light"] .drv-tag--pro { color: #6d28d9; }

.drv-actions { flex: 0 0 auto; display: flex; gap: 6px; }
.drv-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 10px;
    font-size: 11.5px;
    font-weight: 550;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    white-space: nowrap;
    transition: all 0.2s var(--ease);
}
.drv-btn svg { width: 13px; height: 13px; }
.drv-btn:hover {
    color: var(--gold-hi);
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(212, 175, 55, 0.08);
    transform: translateY(-1px);
}
html[data-theme="light"] .drv-btn:hover { color: var(--gold-deep); }
.drv-btn--gold {
    color: var(--gold-hi);
    border-color: rgba(212, 175, 55, 0.38);
    background: rgba(212, 175, 55, 0.1);
}
.drv-btn--gold:hover {
    color: #17130a;
    border-color: transparent;
    background: var(--gold-grad);
    box-shadow: 0 8px 18px rgba(212, 175, 55, 0.28);
}
html[data-theme="light"] .drv-btn--gold { color: var(--gold-deep); }
html[data-theme="light"] .drv-btn--gold:hover { color: #17130a; }

.modal-empty { padding: 44px 12px; text-align: center; font-size: 13px; color: var(--muted-2); }

@media (max-width: 640px) {
    .modal-panel {
        width: 100%;
        height: 100%;
        max-height: none;
        margin: 0;
        border: 0;
        border-radius: 0;
    }
    .modal-head { padding: 18px 18px 0; }
    .modal-tools { padding: 14px 18px 0; gap: 10px; }
    .modal-meta { margin-top: 12px; padding: 10px 18px; }
    .modal-list { padding: 6px 10px 16px; }
    .drv-row { flex-wrap: wrap; gap: 8px 10px; padding: 10px; }
    .drv-main { flex: 1 1 calc(100% - 40px); }
    .drv-actions { flex: 1 1 100%; margin-left: 38px; }
    .drv-btn { flex: 1; justify-content: center; }
}

/* ---------- 底部行动区 ---------- */
.cta-wrap { padding: 56px 0 72px; }
.cta {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    padding: clamp(26px, 4vw, 40px);
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 22px;
    background:
        radial-gradient(600px 260px at 0% 0%, rgba(212, 175, 55, 0.16), transparent 65%),
        linear-gradient(120deg, rgba(212, 175, 55, 0.07), rgba(255, 255, 255, 0.02));
    overflow: hidden;
}
html[data-theme="light"] .cta {
    background:
        radial-gradient(600px 260px at 0% 0%, rgba(212, 175, 55, 0.22), transparent 65%),
        linear-gradient(120deg, rgba(212, 175, 55, 0.1), #fffdf8);
}
.cta::after {
    content: "";
    position: absolute;
    right: -60px;
    bottom: -80px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.18);
    box-shadow: 0 0 0 30px rgba(212, 175, 55, 0.05), 0 0 0 60px rgba(212, 175, 55, 0.03);
    pointer-events: none;
}
.cta-copy { position: relative; max-width: 560px; }
.cta h2 {
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    font-weight: 680;
    letter-spacing: -0.015em;
}
.cta p { margin-top: 8px; font-size: 13.5px; color: var(--muted); line-height: 1.75; }
.cta-actions { position: relative; display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- 页脚 ---------- */
.site-footer {
    border-top: 1px solid rgba(212, 175, 55, 0.14);
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.035), rgba(0, 0, 0, 0.32));
}
html[data-theme="light"] .site-footer {
    border-top-color: rgba(184, 148, 31, 0.2);
    background: linear-gradient(180deg, #f8f3e8, #f2ecdd);
}
.footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr) minmax(0, 1fr);
    gap: clamp(28px, 5vw, 72px);
    padding: 52px 0 40px;
}
.footer-brand p {
    margin: 16px 0 18px;
    max-width: 46ch;
    font-size: 13px;
    line-height: 1.85;
    color: var(--muted-2);
}
.footer-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-tags span {
    padding: 4px 10px;
    font-size: 11px;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel);
}
.footer-col { display: flex; flex-direction: column; gap: 11px; }
.footer-col h3 {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--muted-2);
    text-transform: uppercase;
}
.footer-col a, .footer-plain {
    font-size: 13px;
    color: var(--muted);
    transition: color 0.2s var(--ease);
}
.footer-col a:hover { color: var(--gold-hi); }
html[data-theme="light"] .footer-col a:hover { color: var(--gold-deep); }
.footer-plain { color: var(--muted-2); }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 0 26px;
    border-top: 1px solid var(--border-soft);
    font-size: 11.5px;
    color: var(--muted-2);
}
.footer-bottom a { color: var(--muted-2); transition: color 0.2s var(--ease); }
.footer-bottom a:hover { color: var(--gold); }

/* ---------- 回到顶部 ---------- */
.to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 55;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(14, 17, 23, 0.85);
    color: var(--muted);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s var(--ease);
}
html[data-theme="light"] .to-top { background: rgba(255, 253, 248, 0.9); }
.to-top svg { width: 17px; height: 17px; }
.to-top:hover { color: var(--gold-hi); border-color: rgba(212, 175, 55, 0.5); transform: translateY(-2px); }
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
html[data-theme="light"] .to-top:hover { color: var(--gold-deep); }

/* ---------- 入场动画 ---------- */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

.tools-section .tool-card { opacity: 0; }
.tools-section.is-visible .tool-card {
    animation: cardIn 0.5s var(--ease) forwards;
    animation-delay: calc(var(--i, 0) * 28ms);
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- 深色 / 浅色细节修正 ---------- */
html[data-theme="light"] .main-nav a.is-active { color: var(--gold-deep); }
html[data-theme="light"] .main-nav a:hover { color: var(--gold-deep); }
html[data-theme="light"] .section-kicker { color: var(--gold-deep); }
html[data-theme="light"] .hero h1 .grad {
    background-image: linear-gradient(96deg, #9c7b1a 0%, #b8941f 38%, #8a6a12 72%, #c9a531 100%);
    filter: none;
}
html[data-theme="light"] .stat-num {
    background-image: linear-gradient(160deg, #9c7b1a, #b8941f 55%, #7d6214);
}
html[data-theme="light"] .panel-kicker { color: #6f6244; }
html[data-theme="light"] .hot-desc,
html[data-theme="light"] .tool-desc { color: #71798a; }
html[data-theme="light"] .tool-icon,
html[data-theme="light"] .hot-icon {
    box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.08), 0 4px 10px rgba(41, 37, 20, 0.06);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
    .hero-grid { grid-template-columns: 1fr; gap: 34px; }
    .hero-panel { max-width: 560px; }
    .main-nav a { padding: 8px 9px; font-size: 13px; }
    .header-site { display: none; }
}

@media (max-width: 860px) {
    :root { --header-h: 62px; }
    .main-nav { display: none; }
    .menu-btn { display: grid; }
    .mobile-nav {
        display: none;
        flex-direction: column;
        gap: 2px;
        padding: 10px 24px 16px;
        border-bottom: 1px solid var(--border);
        background: rgba(8, 10, 15, 0.97);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
    }
    html[data-theme="light"] .mobile-nav { background: rgba(255, 253, 248, 0.98); }
    .site-header.is-open .mobile-nav { display: flex; }
    .mobile-nav a {
        padding: 11px 12px;
        font-size: 14px;
        color: var(--muted);
        border-radius: 10px;
    }
    .mobile-nav a:hover { color: var(--gold-hi); background: rgba(212, 175, 55, 0.08); }
    .mobile-nav .mobile-site { color: var(--gold-hi); font-weight: 600; }
    .header-inner { gap: 12px; }
    .tools-section { scroll-margin-top: calc(var(--header-h) + 132px); }
    .toolbar-inner { flex-direction: column; align-items: stretch; gap: 10px; }
    .search { flex: 1 1 auto; }
    .list-meta { flex-direction: column; gap: 4px; }
    .section-head { position: relative; flex-wrap: wrap; }
    .section-head > div { padding-right: 92px; }
    .section-count { position: absolute; top: 2px; right: 0; }
    .footer-inner { grid-template-columns: 1fr; }
    .list-wrap { padding-top: 24px; }
    .cta { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
    .container { width: calc(100% - 32px); }
    .hero { padding-top: 40px; }
    .hero-stats { gap: 16px; }
    .hero-stats > div + div { padding-left: 16px; }
    .brand-text strong { font-size: 14.5px; }
    .tool-grid { grid-template-columns: 1fr; }
    .hero-actions .btn { flex: 1 1 100%; }
    .hero-actions { gap: 10px; }
    .list-hint { display: none; }
    .search-kbd { display: none; }
    .search { flex: 1 1 auto; }
    .to-top { right: 14px; bottom: 14px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .reveal { opacity: 1; transform: none; }
    .tools-section .tool-card { opacity: 1; }
}
