/* ========== 前台专用样式 ==========
   复用 style.css 的统一设计 token（--brand-1 / --bg-page 等），
   从而与前台、后台、安装三端共享同一套明/暗主题色板。
   此处仅补充前台专属的局部变量。 */
:root {
    --primary: var(--brand-1);
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --bg: var(--bg-page);
    --bg-card: var(--bg-surface);
    --text: var(--text-1);
    --text-muted: var(--text-3);
    --border: var(--border);
    --shadow: var(--shadow-sm);
    --shadow-lg: var(--shadow-lg);
    --radius: var(--radius-lg);
    --header-h: 64px;
}

/* 暗色主题：复用 style.css 的统一 token 即可，此处做前台专属微调 */
html[data-theme="dark"] {
    --primary-light: #a5b4fc;
    --bg: var(--bg-page);
    --bg-card: var(--bg-surface);
}

.frontend-body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent;
    transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.96);
    border-bottom-color: var(--border);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: var(--header-h);
    max-width: 1400px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text) !important;
    flex-shrink: 0;
    min-width: 0;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
    border-radius: 12px;
    font-size: 20px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    flex-shrink: 0;
}

.logo-text-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.logo-text {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo-tagline {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.2;
    margin-top: 2px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.2);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted) !important;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary) !important;
    background: rgba(99, 102, 241, 0.08);
}

.nav-link.active {
    color: var(--primary) !important;
    background: rgba(99, 102, 241, 0.12);
    font-weight: 600;
}

.nav-icon {
    font-size: 15px;
    line-height: 1;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.25s, opacity 0.25s;
}

.nav-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 220px;
    padding: 0 12px 0 14px;
    height: 40px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: width 0.25s, border-color 0.2s, box-shadow 0.2s;
}

.header-search:focus-within {
    width: 260px;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.header-search-icon {
    flex-shrink: 0;
    color: var(--text-muted);
}

.header-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--text);
}

.header-search-input::placeholder {
    color: var(--text-muted);
}

.header-search-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 11px;
    font-family: inherit;
    line-height: 1;
    flex-shrink: 0;
}

.theme-toggle {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: rotate(12deg);
}

.header-admin {
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-muted) !important;
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: all 0.2s;
}

.header-admin:hover {
    color: var(--primary) !important;
    border-color: var(--primary-light);
}

.site-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* legacy aliases */
.site-search { display: none; }
.logo-mark { display: none; }

/* Hero */
.hero {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    padding: 48px 20px 56px;
    text-align: center;
}

.hero-inner { max-width: 720px; margin: 0 auto; }

.hero-title {
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.hero-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 28px;
    line-height: 1.6;
}

.search-box {
    position: relative;
    max-width: 520px;
    margin: 0 auto 20px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 14px 44px 14px 48px;
    border: none;
    border-radius: 999px;
    font-size: 15px;
    background: #fff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.2s;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.18);
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.hero-stats strong { font-weight: 700; }
.stat-divider { opacity: 0.5; }

.hero-compact {
    padding: 28px 20px 32px;
    text-align: left;
}

.hero-compact .hero-inner {
    max-width: 1400px;
}

.hero-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.hero-compact .hero-desc {
    margin-bottom: 0;
}

.hero-compact .hero-stats {
    justify-content: flex-end;
    flex-shrink: 0;
}

.hero-compact .search-box {
    margin: 0;
    max-width: none;
}

/* 首页左右布局 */
.home-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    padding: 24px 20px 48px;
    align-items: start;
    max-width: 1400px;
}

.home-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    max-height: calc(100vh - var(--header-h) - 32px);
    display: flex;
    flex-direction: column;
}

.sidebar-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}

.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    padding: 8px;
    overflow-y: auto;
    flex: 1;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 4px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.sidebar-item:hover {
    background: var(--bg-subtle);
    color: var(--primary);
}

.sidebar-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.12));
    color: var(--primary);
    font-weight: 600;
}

.sidebar-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-subtle);
    border-radius: 8px;
    font-size: 13px;
    flex-shrink: 0;
}

.sidebar-item.active .sidebar-icon {
    background: var(--primary);
    color: #fff;
}

.sidebar-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-subtle);
    padding: 2px 8px;
    border-radius: 999px;
    flex-shrink: 0;
}

.home-main {
    min-width: 0;
}

/* Category Nav (legacy) */
.category-nav-wrap {
    position: sticky;
    top: var(--header-h);
    z-index: 90;
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.category-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-nav::-webkit-scrollbar { display: none; }

.cat-pill {
    flex-shrink: 0;
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.cat-pill:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.cat-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Main */
.main-content { padding: 32px 20px 48px; }

.category-section {
    margin-bottom: 36px;
    scroll-margin-top: calc(var(--header-h) + 16px);
}

.category-section.is-hidden { display: none; }

.category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.category-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    padding-left: 12px;
    border-left: 4px solid var(--primary);
}

.category-count {
    font-size: 13px;
    color: var(--text-muted);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.tools-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 12px;
    min-height: 120px;
    transition: all 0.25s ease;
    color: inherit !important;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
}

.tool-card.is-hidden { display: none; }

.tool-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    min-width: 0;
}

.tool-card-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.tool-card-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    width: 44px;
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-icon {
    flex-shrink: 0;
    font-size: 22px;
    line-height: 1;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.tool-views {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 999px;
}

.tool-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.tool-arrow {
    display: none;
}

/* Search empty */
.search-empty {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon { font-size: 48px; margin-bottom: 12px; }
.search-empty p { color: var(--text-muted); margin-bottom: 16px; }

/* Form controls（前台，使用统一 token，支持暗色） */
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Tool page */
.tool-layout {
    align-items: start;
}

.tool-layout .tool-page {
    max-width: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.tool-page {
    max-width: 880px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumb a { color: var(--primary) !important; }
.breadcrumb .sep { opacity: 0.4; }
.breadcrumb .current { color: var(--text); }

.tool-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}

.tool-header-main {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.tool-header-icon { font-size: 40px; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }

.tool-header-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.tool-header-desc {
    font-size: 14px;
    color: var(--text-muted);
}

.tool-body {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.form-textarea {
    min-height: 160px;
    font-family: "JetBrains Mono", "Consolas", monospace;
    font-size: 13px;
    line-height: 1.6;
    border-radius: 8px;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 8px;
    font-weight: 500;
    min-width: 100px;
}

.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-default {
    border-radius: 8px;
    background: var(--bg);
}

.result-wrap {
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.result-box {
    padding: 16px;
    background: #fafbfc;
    font-family: "JetBrains Mono", "Consolas", monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 480px;
    overflow: auto;
    margin: 0;
    border: none;
    display: block;
}

.result-box.result-error { color: #dc2626; }

/* H5 页面生成器 */
.h5-gen-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.h5-gen-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 16px;
}

.h5-gen-section-title {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
}

.h5-gen-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.h5-gen-section-head .h5-gen-section-title {
    margin-bottom: 0;
}

.h5-color-input {
    height: 42px;
    padding: 4px;
    cursor: pointer;
}

.h5-features-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.h5-feature-item {
    display: grid;
    grid-template-columns: 52px 1fr 1fr auto;
    gap: 8px;
    align-items: center;
}

.h5-feature-icon {
    text-align: center;
}

.h5-gen-preview-wrap {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.h5-phone-frame {
    width: 280px;
    height: 560px;
    padding: 12px 10px 16px;
    border-radius: 32px;
    background: #1a1a1a;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.h5-phone-notch {
    width: 80px;
    height: 6px;
    margin: 0 auto 10px;
    border-radius: 999px;
    background: #333;
}

.h5-preview-frame {
    width: 100%;
    height: calc(100% - 16px);
    border: none;
    border-radius: 20px;
    background: #fff;
}

.h5-preview-tip {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.h5-code-wrap {
    margin-top: 24px;
}

.h5-code-out {
    max-height: 360px;
}

@media (max-width: 1024px) {
    .h5-gen-layout {
        grid-template-columns: 1fr;
    }

    .h5-gen-preview-wrap {
        position: static;
        order: -1;
    }
}

@media (max-width: 640px) {
    .h5-feature-item {
        grid-template-columns: 1fr;
    }
}

.ref-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-family: inherit;
    white-space: normal;
}

.ref-table th,
.ref-table td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
}

.ref-table th {
    background: var(--bg);
    font-weight: 600;
}

.ref-table tr:hover td { background: rgba(99, 102, 241, 0.04); }

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-row .form-group { flex: 1; min-width: 180px; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    padding: 48px 20px 24px;
    margin-top: 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
    gap: 32px 24px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text) !important;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

.footer-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-grad, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.footer-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 320px;
}

.footer-contact {
    font-size: 13px;
    color: var(--primary) !important;
}

.footer-col-title {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-nav a {
    font-size: 13px;
    color: var(--text-muted) !important;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: var(--primary) !important;
}

.footer-donate-desc {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
}

.footer-donate-btn {
    margin-bottom: 14px;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.footer-donate-list-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.footer-donate-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.footer-donate-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 20px;
}

.footer-copy {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.footer-copy a {
    color: var(--text-muted) !important;
}

.footer-copy a:hover {
    color: var(--primary) !important;
}

.footer-bottom-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-powered {
    font-size: 12px;
    color: var(--text-muted);
}

.product-copyright {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.product-copyright a {
    color: var(--text-muted) !important;
}

.product-copyright a:hover {
    color: var(--primary) !important;
}

.product-copyright-sep {
    margin: 0 4px;
    opacity: 0.6;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-links {
    display: flex;
    gap: 16px;
    font-size: 13px;
    margin: 0;
}

.footer-links a { color: var(--text-muted) !important; }
.footer-links a:hover { color: var(--primary) !important; }

.back-top {
    position: fixed;
    right: 24px;
    bottom: 32px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
    z-index: 850;
}

body:has(.donate-float-btn) .back-top {
    bottom: 88px;
}

.back-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-top:hover { background: var(--primary-dark); }

/* ========== 资讯 / 新闻（大气版） ========== */
.news-hero {
    position: relative;
    overflow: hidden;
    padding: 56px 20px 64px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    text-align: center;
}

.news-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.12) 0%, transparent 40%);
    pointer-events: none;
}

.news-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
}

.news-hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    margin-bottom: 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
}

.news-hero-title {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.news-hero-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.7;
    margin-bottom: 24px;
}

.news-hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.news-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.92);
}

.news-stat-pill strong {
    font-weight: 700;
    color: #fff;
}

.news-page {
    padding: 40px 20px 56px;
}

.news-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 32px;
    align-items: start;
}

.news-main {
    min-width: 0;
}

.news-grid--list {
    grid-template-columns: 1fr;
}

.news-grid--list .news-grid-card-link {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
}

.news-grid--list .news-grid-card-cover {
    aspect-ratio: auto;
    min-height: 130px;
}

.news-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.news-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}

.news-sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.news-sidebar-more {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

.news-sidebar-list,
.news-sidebar-tools {
    list-style: none;
    margin: 0;
    padding: 8px;
}

.news-sidebar-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text) !important;
    transition: background 0.2s, color 0.2s;
}

.news-sidebar-item:hover {
    background: var(--bg-subtle);
    color: var(--primary) !important;
}

.news-sidebar-item-date {
    font-size: 12px;
    color: var(--text-muted);
}

.news-sidebar-item-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-sidebar-tool {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text) !important;
    transition: background 0.2s;
}

.news-sidebar-tool:hover {
    background: var(--bg-subtle);
}

.news-sidebar-tool-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-subtle);
    border-radius: 8px;
    font-size: 16px;
    flex-shrink: 0;
}

.news-sidebar-tool-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.news-sidebar-tool-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.2s;
}

.news-sidebar-tool:hover .news-sidebar-tool-name {
    color: var(--primary);
}

.news-sidebar-tool-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-featured {
    margin-bottom: 40px;
}

.news-featured-link {
    position: relative;
    display: block;
    min-height: 320px;
    border-radius: calc(var(--radius) + 4px);
    overflow: hidden;
    color: #fff !important;
    box-shadow: 0 20px 50px rgba(99, 102, 241, 0.22);
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-featured-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 60px rgba(99, 102, 241, 0.3);
}

.news-featured-cover {
    position: absolute;
    inset: 0;
    background: center/cover no-repeat;
    transform: scale(1);
    transition: transform 0.5s;
}

.news-featured-cover--placeholder {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.news-featured-link:hover .news-featured-cover {
    transform: scale(1.04);
}

.news-featured-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.82) 100%);
}

.news-featured-body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 320px;
    padding: 32px;
}

.news-featured-tag {
    display: inline-flex;
    align-self: flex-start;
    padding: 4px 12px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 12px;
    font-weight: 600;
}

.news-featured-title {
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 10px;
    max-width: 720px;
}

.news-featured-summary {
    max-width: 640px;
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-featured-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 16px;
}

.news-featured-cta {
    display: inline-flex;
    align-self: flex-start;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(8px);
    transition: background 0.2s;
}

.news-featured-link:hover .news-featured-cta {
    background: rgba(255, 255, 255, 0.24);
}

.news-section-head {
    margin-bottom: 20px;
}

.news-section-title {
    font-size: 22px;
    font-weight: 700;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.news-grid-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
}

.news-grid-card:hover {
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.news-grid-card-link {
    display: block;
    color: var(--text) !important;
}

.news-grid-card-cover {
    aspect-ratio: 16 / 9;
    background: center/cover no-repeat;
}

.news-grid-card-cover--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.18) 100%);
}

.news-grid-card-icon {
    font-size: 36px;
    opacity: 0.7;
}

.news-grid-card-body {
    padding: 20px 22px 22px;
}

.news-grid-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.news-grid-card-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.news-grid-card:hover .news-grid-card-title {
    color: var(--primary);
}

.news-grid-card-summary {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-grid-card-more {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.news-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 72px 20px;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.news-pagination {
    margin-top: 36px;
}

.news-detail-hero {
    position: relative;
    height: clamp(220px, 36vw, 380px);
    background: center/cover no-repeat;
}

.news-detail-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(56, 102, 173, 0.3) 55%, rgba(169, 197, 255, 0.95) 100%);
}

.news-detail-bg {
    width: 100%;
    background: linear-gradient(180deg, #a4bff2 0%, #8aa9e8 40%, #9bbaef 100%);
    position: relative;
    z-index: 2;
}

.news-detail-bg--has-hero {
    margin-top: -56px;
}

.news-detail-page {
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 56px;
    max-width: 1200px;
}

.news-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 32px;
    align-items: start;
}

.news-detail-main {
    min-width: 0;
}

.news-detail-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.news-detail-page--has-hero {
    position: relative;
    z-index: 2;
}

.news-detail-page--has-hero .breadcrumb {
    color: rgba(255, 255, 255, 0.88);
}

.news-detail-page--has-hero .breadcrumb a {
    color: rgba(255, 255, 255, 0.92) !important;
}

.news-detail-page--has-hero .breadcrumb .current {
    color: rgba(255, 255, 255, 0.72);
}

.news-article {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    padding: 32px;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
}

.news-article-premium {
    padding: 36px 40px;
}

.news-article-title {
    font-size: clamp(24px, 4vw, 34px);
    line-height: 1.35;
    margin-bottom: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.news-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.news-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

.news-article-summary {
    font-size: 17px;
    color: var(--text-muted);
    line-height: 1.75;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
}

.news-article-content {
    font-size: 16px;
    line-height: 1.95;
    color: var(--text);
    margin-top: 28px;
}

.news-article-content p + p {
    margin-top: 1em;
}

.news-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 12px 0;
}

.news-article-content a {
    color: var(--primary);
    text-decoration: underline;
}

.news-article-content blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 4px solid var(--primary);
    background: var(--bg-subtle);
    color: var(--text-muted);
}

.news-article-content pre,
.news-article-content code {
    font-family: Consolas, Monaco, monospace;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
}

.news-article-content pre {
    padding: 12px 14px;
    overflow-x: auto;
}

.news-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.news-article-content th,
.news-article-content td {
    border: 1px solid var(--border);
    padding: 8px 10px;
}

.news-article-footer {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.news-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary) !important;
}

.news-related {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
}

.news-related-head {
    margin-bottom: 16px;
}

.news-related-title {
    font-size: 18px;
    font-weight: 700;
}

.news-related-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.news-related-card {
    display: block;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text) !important;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.news-related-card:hover {
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.news-related-date {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.news-related-card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
}

.home-news {
    padding: 0 20px 48px;
}

.home-news-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.home-news-title {
    font-size: 22px;
}

.home-news-more {
    font-size: 14px;
    font-weight: 600;
}

.home-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.home-news-card {
    display: block;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: all 0.25s;
}

.home-news-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.home-news-date {
    font-size: 12px;
    color: var(--text-muted);
}

.home-news-card-title {
    font-size: 16px;
    margin: 8px 0;
    line-height: 1.5;
}

.home-news-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

html[data-theme="dark"] .site-header {
    background: rgba(31, 35, 41, 0.88);
}

html[data-theme="dark"] .site-header.is-scrolled {
    background: rgba(31, 35, 41, 0.96);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .news-detail-bg {
    background: linear-gradient(180deg, #14203d 0%, #1a2b52 40%, #1f3460 100%);
}

html[data-theme="dark"] .header-search-kbd {
    background: var(--bg-subtle);
}

/* Responsive */
@media (max-width: 1400px) {
    .tools-grid-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
    .home-layout { grid-template-columns: 200px minmax(0, 1fr); }
    .tools-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    .header-search-kbd { display: none; }
    .header-search { width: 180px; }
    .header-search:focus-within { width: 200px; }
    .header-admin { display: none; }
    .logo-tagline { display: none; }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand,
    .footer-donate-col {
        grid-column: 1 / -1;
    }

    .news-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .news-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .news-detail-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .news-detail-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .home-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .home-sidebar {
        position: static;
        max-height: none;
    }

    .sidebar-menu {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .sidebar-item {
        flex: 0 0 auto;
        width: auto;
        min-width: 120px;
    }

    .tools-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .hero-top { flex-direction: column; align-items: flex-start; }
    .hero-compact .hero-stats { justify-content: flex-start; }
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .header-search {
        display: none;
    }

    .site-nav {
        position: fixed;
        top: var(--header-h);
        left: 12px;
        right: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: var(--shadow-lg);
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s, transform 0.25s;
        z-index: 99;
    }

    .site-nav.is-open {
        transform: translateY(8px);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 14px;
    }

    .header-inner {
        gap: 12px;
    }

    .logo-text {
        font-size: 16px;
        max-width: 140px;
    }

    .tools-grid,
    .tools-grid-5 {
        grid-template-columns: 1fr;
    }

    .hero { padding: 36px 16px 44px; }

    .hero-compact { padding: 24px 16px; }

    .footer-inner { flex-direction: column; text-align: center; }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-brand,
    .footer-donate-col {
        grid-column: auto;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .tool-header-main { flex-direction: column; }

    .news-hero { padding: 40px 16px 48px; }

    .news-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .news-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr;
    }

    .news-detail-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .news-detail-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .news-grid--list .news-grid-card-link {
        grid-template-columns: 1fr;
    }

    .news-grid--list .news-grid-card-cover {
        aspect-ratio: 16 / 9;
        min-height: auto;
    }

    .news-featured-body { padding: 24px; min-height: 280px; }

    .news-featured-link { min-height: 280px; }

    .news-grid { grid-template-columns: 1fr; }

    .news-detail-bg--has-hero { margin-top: -40px; }

    .news-article,
    .news-article-premium { padding: 20px; }

    .news-article-title { font-size: 22px; }

    .news-related-grid { grid-template-columns: 1fr; }

    .home-news-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* 网站公告 */
.site-notice {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(118, 75, 162, 0.08));
    border-bottom: 1px solid var(--border);
}

.site-notice-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text);
}

.site-notice-icon { flex-shrink: 0; }

/* 赞助打赏 */
.footer-donate-link {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    color: var(--primary) !important;
    cursor: pointer;
}

.footer-donate-link:hover { opacity: 0.85; }

.donate-float-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 900;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: var(--primary-grad, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.donate-float-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
}

.donate-modal[hidden] { display: none !important; }

.donate-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.donate-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.donate-modal-dialog {
    position: relative;
    width: min(520px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px 24px;
    box-shadow: var(--shadow-pop);
}

.donate-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.donate-modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    padding-right: 36px;
}

.donate-modal-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.donate-qrcode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.donate-qrcode-item {
    text-align: center;
    padding: 12px;
    background: var(--bg-subtle);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.donate-qrcode-item img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 8px;
}

.donate-qrcode-item span {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.donate-qrcode-item small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
}

.donate-bank {
    padding: 14px 16px;
    background: var(--bg-subtle);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
    font-size: 13px;
    line-height: 1.6;
}

.donate-bank-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.donate-empty-tip {
    margin: 0;
    padding: 16px;
    border-radius: 10px;
    background: var(--bg-subtle);
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

.donate-list-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.donate-list-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.donate-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.donate-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.donate-list-name {
    flex: 1;
    font-weight: 600;
    color: var(--text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.donate-list-amount {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.12);
    color: var(--primary, #667eea);
    font-size: 12px;
    font-weight: 600;
}

.donate-list-date {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-muted);
}

/* 赞助弹窗底部入口 */
.donate-modal-footer {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.donate-list-link {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none !important;
}

.donate-modal-footer-tip {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-donate-page-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--primary) !important;
    font-weight: 600;
}

.footer-donate-page-link:hover {
    opacity: 0.85;
}

/* 赞助专页 */
.donate-hero {
    padding: 48px 20px 40px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-bottom: 1px solid var(--border);
}

.donate-hero-inner {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.donate-hero-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.15);
    color: var(--primary, #667eea);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

.donate-hero-title {
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 800;
    margin: 0 0 10px;
}

.donate-hero-desc {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-muted);
}

.donate-page {
    padding: 32px 20px 48px;
}

.donate-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.donate-page-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.donate-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.donate-card-title {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 700;
}

.donate-card-desc {
    margin: -6px 0 16px;
    font-size: 14px;
    color: var(--text-muted);
}

.donate-guide-list {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-2, var(--text-muted));
}

.donate-thanks-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06) 0%, rgba(118, 75, 162, 0.04) 100%);
}

.donate-thanks-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
}

.donate-page-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.donate-page-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.donate-page-list-name {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.donate-page-list-amount {
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.12);
    color: var(--primary, #667eea);
    font-size: 12px;
    font-weight: 600;
}

.donate-page-list-date {
    font-size: 12px;
    color: var(--text-muted);
}

.donate-page-aside {
    position: sticky;
    top: calc(var(--header-h, 64px) + 16px);
}

.donate-pay-card .donate-qrcode-grid--page {
    margin-bottom: 14px;
}

.donate-pay-card .btn-block {
    width: 100%;
    margin-top: 14px;
}

@media (max-width: 900px) {
    .donate-page-grid {
        grid-template-columns: 1fr;
    }

    .donate-page-aside {
        position: static;
    }
}
