/* =========================================
   全局样式 - 简洁明亮主题
   SuperDHT - 磁力搜索引擎
   ========================================= */

/* CSS 变量 - 明亮配色 */
:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #6366f1;
    --primary-bg: rgba(79, 70, 229, 0.08);
    --primary-bg-hover: rgba(79, 70, 229, 0.12);

    --accent: #0ea5e9;
    --success: #10b981;
    --success-dark: #059669;
    --warning: #f59e0b;
    --danger: #ef4444;

    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --text-light: #9ca3af;

    --bg-root: #f8fafc;
    --bg-body: #f1f5f9;
    --bg-white: #ffffff;
    --bg-surface: #f8fafc;
    --bg-hover: #f1f5f9;

    --border-light: #e5e7eb;
    --border-default: #d1d5db;
    --border-focus: #4f46e5;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.07), 0 4px 6px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.08), 0 10px 10px rgba(0,0,0,0.03);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    --transition-fast: 0.15s ease;
    --transition: 0.2s ease;
}

/* =========================================
   首页头部
   ========================================= */
.header {
    margin-bottom: 36px;
}

.logo {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--primary);
    display: inline-block;
    margin-bottom: 8px;
    transition: color var(--transition-fast);
}

.logo:hover {
    color: var(--primary-dark);
}

.site-tagline {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 400;
}

/* =========================================
   搜索框
   ========================================= */
.search-form { position: relative; width: 100%; }

.search-box {
    display: flex;
    max-width: 720px;
    margin: 0 auto 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1.5px solid var(--border-default);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1), var(--shadow-md);
}

.search-input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: var(--font-sans);
    background: var(--bg-white);
    color: var(--text-primary);
}

.search-input::placeholder { color: var(--text-light); }

.search-button {
    padding: 14px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-button:hover { background: var(--primary-dark); }
.search-button:active { background: var(--primary-dark); opacity: 0.9; }
.recent-menu {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e4e7ee;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12);
    overflow: hidden;
}
.recent-menu[hidden] { display: none; }
.recent-row { display: flex; align-items: stretch; }
.recent-row + .recent-row { border-top: 1px solid #f0f2f6; }
.recent-pick, .recent-del {
    border: none;
    background: transparent;
    color: #4b5563;
    cursor: pointer;
}
.recent-pick {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 4px 0 14px;
    font: inherit;
    font-size: 14px;
    text-align: left;
}
.recent-pick span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.recent-pick svg, .recent-del svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #9aa3b2;
}
.recent-del {
    width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.recent-pick:hover, .recent-del:hover { background: #f4f6fb; }

/* 导航栏搜索框样式 */
.navbar-search .search-box {
    margin: 0;
    box-shadow: none;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-default);
    max-width: none;
}

.navbar-search .search-input {
    padding: 9px 14px;
    font-size: 16px;
}

.navbar-search .search-button {
    padding: 9px 18px;
    font-size: 0.88rem;
}

/* =========================================
   热门关键词
   ========================================= */
.hot-keywords {
    margin-top: 32px;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-white) 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition);
}

.hot-keywords:hover {
    border-color: var(--border-default);
}

.hot-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.hot-title::before {
    content: '🔥';
    font-size: 0.9rem;
    letter-spacing: 0;
    text-transform: none;
}

.keywords {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    color-scheme: light;
    accent-color: #4f46e5;
    scrollbar-width: thin;
    scrollbar-color: #c5cad3 transparent;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
}

body:not(.page-list) .container {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 56px 24px 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1050px;
    margin: 0 auto;
}

a { color: inherit; text-decoration: none; }

/* =========================================
   首页布局
   ========================================= */
body:not(.page-list) {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background: #ffffff;
    min-height: 100vh;
}

/* =========================================
   主容器
   ========================================= */
.container {
    width: 92%;
    max-width: 1050px;
    margin: 40px auto;
    padding: 56px 48px;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xl);
    text-align: center;
    animation: fadeInUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* 首页容器样式由上方 body:not(.page-list) .container 覆盖 */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

body.page-list {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f4f6fb;
}

body.page-list .container {
    max-width: 1050px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    text-align: left;
    margin: 0 auto;
    animation: none;
    border-radius: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

body.page-list .page-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
}
body.page-list .stats-info,
body.page-list .filter-bar,
body.page-list .result-list,
body.page-list .no-results {
    width: 100%;
    box-sizing: border-box;
}

/* =========================================
   顶部导航栏（列表页/详情页）
   ========================================= */
.site-navbar {
    background: rgba(244, 246, 251, 0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(228, 231, 238, 0.95);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    max-width: 1050px;
    margin: 0 auto;
    padding: 0 28px;
    height: 56px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 420px) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}

.navbar-logo {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e1b4b;
    white-space: nowrap;
    letter-spacing: -0.03em;
    flex-shrink: 0;
}

.navbar-logo span {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85rem;
    margin-left: 6px;
}

.navbar-search {
    width: 100%;
    max-width: none;
    margin: 0;
    min-width: 0;
    justify-self: center;
}
.nav-tools { justify-self: end; }

.navbar-search .search-box {
    margin: 0;
    box-shadow: none;
    border-radius: 12px;
    border: 1px solid #e4e7ee;
    background: #fff;
    max-width: none;
    overflow: hidden;
}

.navbar-search .search-box:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.navbar-search .search-input {
    padding: 9px 14px;
    font-size: 15px;
}

.navbar-search .search-button {
    padding: 9px 18px;
    font-size: 0.88rem;
}


.keyword {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.keyword:hover {
    background: var(--primary-bg);
    border-color: var(--primary-light);
    color: var(--primary);
}

/* =========================================
   页面（列表/详情）
   ========================================= */
.page-body {
    max-width: 1050px;
    margin: 0 auto;
    padding: 20px 28px 32px;
}

/* =========================================
   搜索结果统计信息
   ========================================= */
.stats-info {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0 16px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border-light);
    background: none;
    border-radius: 0;
    box-shadow: none;
    font-size: 0.9rem;
    color: var(--text-muted);
    animation: none;
}

.stats-info .stats-icon { display: none; }

.stats-info .stats-label {
    color: var(--text-muted);
}

.stats-info .stats-keyword {
    display: inline;
    padding: 0;
    background: none;
    color: var(--text-primary);
    border-radius: 0;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0;
}

.stats-info .stats-sep {
    color: var(--text-light);
    margin: 0 2px;
}

.stats-info .stats-count {
    display: inline;
    padding: 0;
    background: none;
    color: var(--text-primary);
    border-radius: 0;
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 0;
}

.stats-info .stats-unit {
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .stats-info {
        padding: 4px 0 14px;
        font-size: 0.85rem;
        gap: 4px;
    }
    .stats-info .stats-keyword,
    .stats-info .stats-count {
        font-size: 0.9rem;
        padding: 0;
    }
}

/* =========================================
   搜索结果
   ========================================= */
.result-list {
    display: flex;
    flex-direction: column;
}

.result-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-light);
    border-radius: 0;
    padding: 18px 0;
    margin-bottom: 0;
    transition: background var(--transition-fast);
    box-shadow: none;
}

.result-item:hover {
    border-color: var(--border-light);
    box-shadow: none;
    transform: none;
}

.result-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.45;
}

.result-title a {
    color: var(--primary);
    word-break: break-word;
    transition: color var(--transition-fast);
}

.result-title a:hover { color: var(--primary-dark); text-decoration: underline; }

.result-title mark,
.file-item mark {
    background: #fef3c7;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.result-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    line-height: 22px;
    color: var(--text-muted);
    margin-bottom: 0;
}

.result-info span {
    display: inline-flex;
    align-items: center;
    height: 22px;
    line-height: 22px;
    gap: 4px;
}

.result-info span + span::before {
    content: "";
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-light);
    margin-right: 2px;
}

.result-files {
    margin-top: 10px;
    padding-top: 0;
    border-top: none;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.result-files > div:first-child {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.file-list {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.file-item {
    background: none;
    padding: 2px 0;
    border-radius: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    border: none;
    transition: color var(--transition-fast);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item:hover {
    background: none;
    border-color: transparent;
    color: var(--text-secondary);
}

.file-item.file-more {
    color: var(--text-light);
    font-style: italic;
}

/* =========================================
   分页
   ========================================= */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    min-width: 38px;
    text-align: center;
    box-shadow: none;
}

.pagination a:hover {
    background: var(--bg-surface);
    border-color: var(--border-default);
    color: var(--text-primary);
}

.pagination .current {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: #fff;
    font-weight: 700;
}

.app-ads {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    margin-top: 22px;
}

.app-ads-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.app-ads-list {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

.app-ads-list .keyword {
    justify-content: center;
    width: 100%;
    min-width: 0;
    padding: 7px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .app-ads-list {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
    .app-ads-list .keyword {
        padding: 6px 4px;
        font-size: 12px;
        line-height: 1.35;
    }
}

/* =========================================
   无结果
   ========================================= */
.no-results {
    text-align: left;
    padding: 48px 0 24px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.no-results h2 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 600;
}

.no-results p { color: var(--text-muted); font-size: 0.93rem; margin-top: 6px; }

/* =========================================
   磁力详情页
   ========================================= */
.magnet-detail {
    animation: fadeInUp 0.4s cubic-bezier(0.22,1,0.36,1) both;
}

.detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.45;
    word-break: break-word;
    font-feature-settings: "calt" 0, "rclt" 0;
}

.detail-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 22px;
}

.detail-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.detail-meta strong {
    color: var(--text-primary);
    font-weight: 600;
}

.magnet-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 28px;
}

.magnet-input {
    flex: 1;
    min-width: 260px;
    padding: 11px 14px;
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    outline: none;
    background: var(--bg-surface);
    color: var(--text-muted);
    transition: border-color var(--transition);
}

.magnet-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow); }
.btn-primary:active { opacity: 0.9; transform: scale(0.98); }

.btn-success {
    background: var(--success);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover { background: var(--success-dark); box-shadow: var(--shadow); }
.btn-success:active { opacity: 0.9; transform: scale(0.98); }

.detail-files { margin-top: 4px; }

.detail-files h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.detail-file-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.detail-file-item:hover {
    background: var(--primary-bg);
    border-color: #c7d2fe;
}

.detail-file-item .file-name {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 14px;
    font-size: 0.86rem;
    line-height: 1.5;
}

.detail-file-item .file-icon {
    display: inline-block;
    width: 1.3em;
    text-align: center;
    flex-shrink: 0;
    font-size: inherit;
}

.detail-file-item .file-size {
    color: var(--text-light);
    font-size: 0.8rem;
    white-space: nowrap;
    font-family: var(--font-mono);
}

/* =========================================
   文件树状目录结构
   ========================================= */
.detail-file-tree {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.86rem;
    color: var(--text-secondary);
    border-radius: 4px;
    transition: background var(--transition-fast);
    cursor: default;
}

.tree-item:hover {
    background: var(--bg-hover);
}

.tree-dir {
    margin-top: 2px;
    cursor: pointer;
}

.tree-dir > .tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 0.7rem;
    color: var(--text-light);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.tree-dir.expanded > .tree-toggle .tree-toggle-icon {
    transform: rotate(0deg);
}

.tree-toggle-icon {
    display: inline-block;
    font-size: 0.65rem;
    transition: transform var(--transition-fast);
}

.tree-dir-icon {
    flex-shrink: 0;
    font-size: 0.9rem;
}

.tree-dir-name {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-dir-size {
    color: var(--text-light);
    font-size: 0.78rem;
    font-family: var(--font-mono);
    flex-shrink: 0;
    margin-left: auto;
}

.tree-file {
    padding-left: 40px;
}

.tree-file-icon {
    flex-shrink: 0;
    font-size: 0.85rem;
    width: 1.2em;
    text-align: center;
}

.tree-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

.tree-file-size {
    color: var(--text-light);
    font-size: 0.78rem;
    font-family: var(--font-mono);
    flex-shrink: 0;
    margin-left: auto;
}

.tree-children {
    display: none;
}

.tree-children.expanded {
    display: block;
}

/* =========================================
    友情链接
    ========================================= */
.friend-links {
    margin-top: 36px;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--bg-white) 0%, var(--bg-surface) 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: border-color var(--transition);
}

.friend-links:hover {
    border-color: var(--border-default);
}

.friend-links-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.friend-links-title::before {
    content: '🤝';
    font-size: 0.9rem;
    letter-spacing: 0;
    text-transform: none;
}

.friend-links-title::after {
    content: '🤝';
    font-size: 0.9rem;
    letter-spacing: 0;
    text-transform: none;
    transform: scaleX(-1);
}

.friend-links-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.friend-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background: var(--bg-white);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.83rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.friend-link:hover {
    background: var(--primary-bg);
    border-color: var(--primary-light);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* =========================================
    底部
    ========================================= */
.stats {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
    color: var(--text-light);
    font-size: 0.8rem;
    text-align: center;
    width: 100%;
}

body:not(.page-list) .stats {
    margin-top: auto;
    padding-bottom: 8px;
}

body.page-list .stats {
    margin-top: auto;
    padding-bottom: 8px;
}

.stats p { margin: 3px 0; line-height: 1.8; }

/* =========================================
    横幅广告
   ========================================= */
.banner-section {
    width: 100%;
    max-width: 1050px;
    margin: 0 auto;
    padding: 0;
}

.banner-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.banner-item {
    display: block;
    width: 100%;
    line-height: 0;
    overflow: hidden;
    border-radius: 0;
}

.banner-item img {
    display: block;
    width: 100%;
    height: calc(var(--banner-pc-base, 80px) * var(--banner-scale, 100) / 100);
    object-fit: fill;
    border-radius: 0;
}

.slot-board {
    width: 100%;
    max-width: 1050px;
    margin: 12px auto 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
body.page-list .slot-board {
    width: min(1050px, 100%);
    margin: 16px auto 0;
    padding: 0 28px;
    box-sizing: border-box;
}
.slot-pics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.slot-pic {
    display: block;
    line-height: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #e8eef5;
}
.slot-pic img { display: block; width: 100%; height: auto; object-fit: contain; background: transparent; }
.slot-icos { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.slot-ico {
    width: 76px;
    text-align: center;
    color: #334155;
    text-decoration: none;
    font-size: 12px;
    line-height: 1.3;
}
.slot-ico img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
    margin: 0 auto 4px;
    background: #fff;
    border-radius: 10px;
}
.slot-txts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.slot-txt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 100%;
    min-height: 36px;
    padding: 6px 16px;
    border: 1px solid #e4e7ee;
    border-radius: 10px;
    background: #fff;
    color: #312e81;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.slot-txt:hover { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.slot-txt strong { font-weight: 600; }
.slot-txt em { color: #6b7280; font-style: normal; font-weight: 500; font-size: 12px; }
.slot-txt:hover em { color: rgba(255, 255, 255, 0.86); }

/* =========================================
    响应式
   ========================================= */
@media (max-width: 768px) {
    .container {
        padding: 28px 24px;
        width: 95%;
        margin: 10px auto 20px;
        border-radius: var(--radius-lg);
    }

    body:not(.page-list) .container {
        padding: 36px 16px 28px;
        margin: 0 auto 20px;
        border-radius: 0;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .logo { font-size: 2.2rem; }

    .search-box { flex-direction: column; border-radius: var(--radius); overflow: visible; border: none; box-shadow: none; gap: 8px; }
    .search-box:focus-within { border: none; box-shadow: none; }
    .search-input { border: 1.5px solid var(--border-default); border-radius: var(--radius); padding: 13px 16px; }
    .search-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); outline: none; }
    .search-button { border-radius: var(--radius); width: 100%; justify-content: center; }

    /* 导航栏移动端适配 - 限制搜索框宽度不溢出 */
    .navbar-inner,
    .site-footer .friend-links { padding-left: 16px; padding-right: 16px; }
    .navbar-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "logo tools" "search search";
        align-items: center;
        height: auto;
        gap: 10px 12px;
        max-width: 100%;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .navbar-logo { grid-area: logo; }
    .navbar-logo span { display: none; }
    .nav-tools { grid-area: tools; justify-self: end; }
    .navbar-search { grid-area: search; width: 100%; max-width: none; min-width: 0; margin: 0; }
    .navbar-search .search-form { width: 100%; min-width: 0; }
    .navbar-search .search-box { max-width: 100%; margin: 0; box-shadow: none; border-radius: var(--radius-sm); border: 1.5px solid var(--border-default); overflow: hidden; min-width: 0; flex-direction: row; }
    .navbar-search .search-input { border: none; font-size: 16px; min-width: 0; width: 0; flex: 1 1 0%; }
    .navbar-search .search-button { border-radius: 0; width: auto; flex-shrink: 0; white-space: nowrap; }

    .page-body { padding: 16px 16px 32px; }
    body.page-list .slot-board { padding: 0 16px; }

    .detail-title { font-size: 1.2rem; }
    .detail-meta { gap: 14px; padding: 14px 16px; }

    .magnet-actions { flex-direction: column; }
    .magnet-input { min-width: 0; width: 100%; }
    .btn { width: 100%; justify-content: center; }

    .result-item { padding: 16px 0; }
    .result-info { gap: 10px; }
}

@media (max-width: 480px) {
    .container { padding: 28px 18px; }
    .logo { font-size: 1.9rem; }
    .detail-meta { flex-direction: column; gap: 10px; }
}

/* 横幅广告移动端适配 */
@media (max-width: 768px) {
    .banner-item img {
        height: calc(var(--banner-mobile-base, 60px) * var(--banner-scale, 100) / 100);
    }
    .slot-pics { grid-template-columns: 1fr; }
}

/* =========================================
   搜索筛选、结果卡片、页脚
   ========================================= */
.nav-appeal {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 500;
    white-space: nowrap;
}
.nav-appeal:hover { color: var(--primary); }

.addr-bar {
    max-width: 720px;
    margin: -8px auto 22px;
    padding: 10px 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    color: #92400e;
    font-size: 0.86rem;
    text-align: center;
}
.addr-bar span { margin: 0 6px; font-weight: 600; }

.hot-title { text-transform: none; letter-spacing: 0; }
.hot-title::before, .friend-links-title::before, .friend-links-title::after { content: none; }

.keyword.kw-0 { background: #dbeafe; color: #1d4ed8; border-color: transparent; }
.keyword.kw-1 { background: #dcfce7; color: #15803d; border-color: transparent; }
.keyword.kw-2 { background: #fce7f3; color: #be185d; border-color: transparent; }
.keyword.kw-3 { background: #ffedd5; color: #c2410c; border-color: transparent; }
.keyword.kw-4 { background: #ede9fe; color: #6d28d9; border-color: transparent; }
.keyword.kw-5 { background: #cffafe; color: #0e7490; border-color: transparent; }
.keyword.kw-6 { background: #fef9c3; color: #a16207; border-color: transparent; }
.keyword.kw-7 { background: #fee2e2; color: #b91c1c; border-color: transparent; }

.home-contact { margin-top: 18px; color: var(--text-muted); font-size: 0.86rem; }
.home-contact a { color: var(--primary); }

.stats-info { justify-content: space-between; align-items: center; }
.stats-right { margin-left: auto; color: var(--text-muted); }
.stats-right strong { color: var(--text-primary); }

.filter-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
    align-items: end;
    margin: 0 0 16px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
}
.filter-bar label {
    display: block;
    min-width: 0;
    font-size: 0.86rem;
    color: var(--text-primary);
}
.filter-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}
.filter-bar select,
.filter-bar input {
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: #fff;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.86rem;
}
.filter-bar input { min-width: 140px; }
.filter-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-apply, .filter-reset, .filter-files {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 600;
}
.filter-apply { background: var(--primary); color: #fff; border: none; cursor: pointer; }
.filter-reset, .filter-files { background: #fff; color: var(--text-secondary); border: 1px solid var(--border-default); }
.filter-files { color: var(--primary); }

.result-list { gap: 10px; }
.result-item {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 16px 18px;
}
.result-item:hover { border-color: #c7d2fe; }
.size-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.78rem;
}
.result-info .size-pill {
    height: 22px;
    padding: 0 8px;
    font-size: inherit;
    line-height: 22px;
    box-sizing: border-box;
}
.size-s { background: #dcfce7; color: #15803d; }
.size-m { background: #ffedd5; color: #c2410c; }
.size-l { background: #fee2e2; color: #b91c1c; }
.size-xl { background: #ede9fe; color: #6d28d9; }
.result-info span + span::before { display: none; }

.pagination .page-total, .pagination .page-next { border: none; background: transparent; min-width: 0; }
.pagination .page-total { color: var(--text-muted); }

.site-footer { margin-top: auto; width: 100%; background: transparent; }
.site-footer .friend-links {
    width: min(1050px, 100%);
    max-width: 1050px;
    margin: 16px auto 12px;
    padding: 0 28px;
    border: none;
    border-radius: 0;
    background: transparent;
    text-align: left;
    box-sizing: border-box;
}
.site-footer .friend-links-title {
    justify-content: flex-start;
    margin-bottom: 4px;
    padding: 0;
    border: none;
    text-transform: none;
    letter-spacing: 0;
    color: #c0c5ce;
    font-size: 11px;
    font-weight: 500;
}
.site-footer .friend-links-title::before,
.site-footer .friend-links-title::after { content: none; }
.site-footer .friend-links-list { justify-content: flex-start; gap: 2px 14px; }
.site-footer .friend-link {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    color: #a8aeb8;
    font-size: 13px;
    font-weight: 400;
}
.site-footer .friend-link:hover {
    background: transparent;
    border: none;
    color: #6b7280;
    transform: none;
    box-shadow: none;
}
.copyright-bar {
    width: 100%;
    background: transparent;
    border-top: 1px solid #e4e7ee;
    color: #8b93a1;
    text-align: center;
    padding: 16px 20px 22px;
    font-size: 12px;
}
.copyright-bar p { margin: 2px 0; }
.copyright-bar .runtime-info { color: #a1a8b3; }

/* 首页：搜索、热词与导航、友情链接共用 1050 内容栏 */
body.home {
    --home-col: min(1050px, 100%);
    position: relative;
    background:
        radial-gradient(880px 380px at 50% -120px, rgba(79, 70, 229, 0.12), transparent 68%),
        #f4f6fb;
    align-items: center;
}
body.home .container {
    width: var(--home-col);
    max-width: 1050px;
}
body.home .home-nav {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(244, 246, 251, 0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(228, 231, 238, 0.95);
}
body.home .home-nav-inner {
    max-width: 1050px;
    margin: 0 auto;
    height: 56px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
body.home .home-nav-logo {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #1e1b4b;
}
body.home .home-nav-link {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
}
body.home .home-nav-link:hover { color: #4f46e5; }
body.home .container {
    flex: 1 0 auto;
    min-height: calc(100vh - 56px);
    justify-content: flex-start;
    padding: 12vh 28px 140px;
    box-sizing: border-box;
    animation: none;
}
html:has(body.home) { scroll-behavior: auto; }
body.home .addr-bar {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}
body.home .header { margin-bottom: 26px; }
body.home .logo {
    font-size: 2.65rem;
    letter-spacing: -0.045em;
    color: #1e1b4b;
}
body.home .site-tagline {
    margin-top: 8px;
    font-size: 15px;
    color: #6b7280;
}
body.home .search-box {
    max-width: none;
    width: 100%;
    margin: 0;
    border: 1px solid #e4e7ee;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(17, 24, 39, 0.06);
}
body.home .search-box:focus-within {
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12), 0 12px 32px rgba(17, 24, 39, 0.06);
}
body.home .search-input { padding: 16px 18px; font-size: 16px; }
body.home .search-button { padding: 16px 26px; }
body.home .hot-keywords {
    width: 100%;
    margin: 18px 0 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    text-align: left;
}
body.home .hot-title {
    justify-content: flex-start;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}
body.home .keywords {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}
body.home .keyword {
    justify-content: center;
    text-align: center;
    min-width: 0;
    padding: 7px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-color: transparent;
    box-shadow: 0 1px 1px rgba(17, 24, 39, 0.03);
}
body.home .keyword:hover { transform: translateY(-1px); }
body.home .site-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    margin-top: 0;
    padding: 0 0 28px;
    background: transparent;
    border: none;
    text-align: center;
}
body.home .site-footer .friend-links {
    width: min(1050px, 100%);
    max-width: 1050px;
    margin: 16px auto 12px;
    padding: 0 28px;
    border: none;
    border-radius: 0;
    background: transparent;
    text-align: left;
    box-sizing: border-box;
}
body.home .site-footer .friend-links-title {
    justify-content: flex-start;
    margin-bottom: 4px;
    padding: 0;
    border: none;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    color: #c0c5ce;
}
body.home .site-footer .friend-links-list {
    justify-content: flex-start;
    gap: 2px 14px;
}
body.home .site-footer .friend-link {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    color: #a8aeb8;
    font-size: 13px;
    font-weight: 400;
}
body.home .site-footer .friend-link:hover {
    background: transparent;
    border: none;
    color: #6b7280;
    transform: none;
    box-shadow: none;
}
body.home .copyright-bar {
    width: 100%;
    background: transparent;
    border-top: 1px solid #e4e7ee;
    color: #8b93a1;
    text-align: center;
    padding: 16px 20px 0;
    font-size: 12px;
}
body.home .copyright-bar .runtime-info { color: #a1a8b3; }
@media (max-width: 768px) {
    body.home { --home-col: 100%; }
    body.home .home-nav-inner,
    body.home .site-footer .friend-links { padding-left: 16px; padding-right: 16px; }
    body.home .home-nav-inner { height: 52px; }
    body.home .container { min-height: calc(100vh - 52px); padding: 10vh 16px 140px; }
    body.home .header { margin-bottom: 18px; }
    body.home .logo { font-size: 1.85rem; }
    body.home .search-box {
        flex-direction: row;
        align-items: stretch;
        gap: 0;
        border: 1px solid #e4e7ee;
        border-radius: 14px;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 8px 24px rgba(17, 24, 39, 0.05);
    }
    body.home .search-box:focus-within {
        border: 1px solid #818cf8;
        box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12), 0 8px 24px rgba(17, 24, 39, 0.05);
    }
    body.home .search-input {
        width: 0;
        min-width: 0;
        flex: 1 1 auto;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 14px 14px;
        font-size: 16px;
    }
    body.home .search-button {
        width: auto;
        flex-shrink: 0;
        border-radius: 0;
        padding: 14px 16px;
    }
    body.home .keywords {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
    }
    body.home .keyword {
        max-width: none;
        padding: 6px 4px;
        font-size: 12px;
        line-height: 1.35;
    }
}

.notice-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 28px 24px;
    margin-top: 12px;
}
.notice-card h1 { font-size: 1.25rem; margin-bottom: 12px; }
.notice-card p { color: var(--text-secondary); margin: 8px 0; }
.notice-card a { color: var(--primary); }

@media (max-width: 768px) {
    .stats-info { align-items: flex-start; }
    .stats-right { margin-left: 0; width: 100%; }
    .filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 12px;
    }
    .filter-bar label, .filter-bar input { min-width: 0; width: 100%; }
    .filter-bar .ui-select-btn { padding-right: 30px; }
    .filter-bar .ui-select-btn::after { right: 8px; }
    .nav-appeal { display: none; }
    .nav-tool { width: 32px; height: 32px; }
}

.nav-tools {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.nav-tool {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #374151;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.nav-tool:hover { background: rgba(17, 24, 39, 0.06); }
.nav-tool svg { width: 20px; height: 20px; display: block; overflow: visible; }
.nav-tool .icon-moon { display: none; }
html[data-theme="dark"] .nav-tool .icon-sun { display: none; }
html[data-theme="dark"] .nav-tool .icon-moon { display: block; }
.lang-wrap { position: relative; }
.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 148px;
    padding: 6px;
    background: #fff;
    border: 1px solid #e4e7ee;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(17, 24, 39, 0.12);
    z-index: 40;
}
.lang-menu[hidden] { display: none; }
.lang-menu button {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    font-size: 14px;
    color: #1f2937;
    cursor: pointer;
}
.lang-menu button:hover { background: #f4f6fb; }
.lang-menu button.on { color: #4f46e5; font-weight: 700; }
button.keyword { font: inherit; cursor: pointer; }

.settings-mask {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(17, 24, 39, 0.42);
    backdrop-filter: blur(8px);
}
.settings-mask[hidden] { display: none; }
.settings-dialog {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 16px;
    padding: 18px 20px 16px;
    box-shadow: 0 24px 60px rgba(17, 24, 39, 0.2);
    animation: ui-pop 0.18s ease;
}
@keyframes ui-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .settings-dialog { animation: none; }
}
.settings-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.settings-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: #111827; }
.settings-x {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 22px;
    line-height: 1;
    border-radius: 8px;
    cursor: pointer;
}
.settings-x:hover { background: #f3f4f6; }
.settings-field, .settings-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
    color: #374151;
    font-size: 14px;
}
.settings-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}
.ui-select { position: relative; width: 100%; min-width: 0; }
.ui-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.ui-select-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ui-select-btn {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 40px;
    padding: 0 36px 0 12px;
    border: 1px solid #e4e7ee;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
}
.ui-select-btn::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    background: currentColor;
    opacity: 0.55;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='black' d='M5.2 7.4a.9.9 0 0 1 1.3 0L10 10.9l3.5-3.5a.9.9 0 1 1 1.3 1.3l-4.2 4.1a.9.9 0 0 1-1.2 0L5.2 8.7a.9.9 0 0 1 0-1.3z'/></svg>") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='black' d='M5.2 7.4a.9.9 0 0 1 1.3 0L10 10.9l3.5-3.5a.9.9 0 1 1 1.3 1.3l-4.2 4.1a.9.9 0 0 1-1.2 0L5.2 8.7a.9.9 0 0 1 0-1.3z'/></svg>") center / contain no-repeat;
}
.ui-select-btn[aria-expanded="true"] {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.ui-select-btn:focus-visible,
.settings-close:focus-visible,
.settings-x:focus-visible,
.nav-tool:focus-visible,
.switch:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}
.filter-bar .ui-select-btn {
    height: 36px;
    font-size: 0.86rem;
}
.ui-select-menu {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid #e4e7ee;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(17, 24, 39, 0.14);
    scrollbar-width: thin;
}
.ui-select-menu.up { top: auto; bottom: calc(100% + 6px); }
.ui-select-menu[hidden] { display: none; }
.ui-select-title {
    padding: 4px 10px 6px;
    font-size: 12px;
    font-weight: 600;
    color: #9aa3b2;
    pointer-events: none;
}
.ui-select-opt {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 8px;
    padding: 8px 10px;
    text-align: left;
    font: inherit;
    font-size: 14px;
    color: #1f2937;
    cursor: pointer;
}
.ui-select-opt:hover { background: #f4f6fb; }
.ui-select-opt.on { color: #4f46e5; font-weight: 700; background: #eef2ff; }
input:-webkit-autofill {
    -webkit-text-fill-color: #111827;
    box-shadow: 0 0 0 1000px #fff inset;
    transition: background-color 9999s ease-out;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #c5cad3; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }
.switch {
    width: 44px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: #d1d5db;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}
.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease;
}
.switch.on { background: #2563eb; }
.switch.on::after { transform: translateX(18px); }
.settings-actions { display: flex; justify-content: flex-end; }
.settings-close {
    height: 36px;
    padding: 0 18px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.settings-close:hover { background: #1d4ed8; }

html[data-theme="dark"] {
    color-scheme: dark;
    --text-primary: #e7e9ee;
    --text-secondary: #c5cad3;
    --text-muted: #9aa3b2;
    --text-light: #7b8494;
    --bg-root: #0f1115;
    --bg-body: #0f1115;
    --bg-white: #1a1d24;
    --bg-surface: #151820;
    --bg-hover: #262b34;
    --border-light: #2a2f3a;
    --border-default: #3a4252;
    --primary-bg: rgba(129, 140, 248, 0.16);
    --primary-bg-hover: rgba(129, 140, 248, 0.24);
    scrollbar-color: #3a4252 transparent;
}
html[data-theme="dark"] body,
html[data-theme="dark"] body.page-list { background: #0f1115; color: #e7e9ee; }
html[data-theme="dark"] body.home {
    background:
        radial-gradient(880px 380px at 50% -120px, rgba(129, 140, 248, 0.16), transparent 68%),
        #0f1115;
    color: #e7e9ee;
}
html[data-theme="dark"] body.home .home-nav,
html[data-theme="dark"] .site-navbar {
    background: rgba(15, 17, 21, 0.9);
    border-bottom-color: #2a2f3a;
}
html[data-theme="dark"] body.home .home-nav-logo,
html[data-theme="dark"] .navbar-logo,
html[data-theme="dark"] body.home .logo { color: #f4f5f7; }
html[data-theme="dark"] .nav-tool { color: #d1d5db; }
html[data-theme="dark"] .nav-tool:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] body.home .search-box,
html[data-theme="dark"] .navbar-search .search-box,
html[data-theme="dark"] .filter-bar,
html[data-theme="dark"] .result-item,
html[data-theme="dark"] .settings-dialog,
html[data-theme="dark"] .lang-menu,
html[data-theme="dark"] .notice-card,
html[data-theme="dark"] .magnet-input,
html[data-theme="dark"] .filter-bar select,
html[data-theme="dark"] .filter-reset,
html[data-theme="dark"] .filter-files,
html[data-theme="dark"] .search-input,
html[data-theme="dark"] .settings-field select {
    background: #1a1d24;
    color: #e7e9ee;
    border-color: #2e3440;
}
html[data-theme="dark"] body.home .search-input,
html[data-theme="dark"] .navbar-search .search-input { background: transparent; }
html[data-theme="dark"] .recent-menu {
    background: #1a1d24;
    border-color: #2e3440;
}
html[data-theme="dark"] .recent-row + .recent-row { border-top-color: #2e3440; }
html[data-theme="dark"] .recent-pick { color: #e7e9ee; }
html[data-theme="dark"] .recent-pick:hover,
html[data-theme="dark"] .recent-del:hover { background: #262b34; }
html[data-theme="dark"] .copyright-bar,
html[data-theme="dark"] body.home .copyright-bar { border-top-color: #2a2f3a; color: #9aa3b2; }
html[data-theme="dark"] .stats-info { border-bottom-color: #2a2f3a; color: #9aa3b2; }
html[data-theme="dark"] .stats-right,
html[data-theme="dark"] .stats-right strong,
html[data-theme="dark"] .hot-title,
html[data-theme="dark"] .settings-head h2,
html[data-theme="dark"] .settings-field,
html[data-theme="dark"] .settings-row,
html[data-theme="dark"] .lang-menu button,
html[data-theme="dark"] .result-title a { color: #e7e9ee; }
html[data-theme="dark"] .lang-menu button:hover,
html[data-theme="dark"] .settings-x:hover { background: #262b34; }
html[data-theme="dark"] .lang-menu button.on { color: #a5b4fc; }
html[data-theme="dark"] .detail-title,
html[data-theme="dark"] .result-info { color: #c5cad3; }
html[data-theme="dark"] { scrollbar-color: #3a4252 transparent; }
html[data-theme="dark"] .ui-select-btn,
html[data-theme="dark"] .ui-select-menu {
    background: #1a1d24;
    color: #e7e9ee;
    border-color: #2e3440;
}
html[data-theme="dark"] .ui-select-title { color: #9aa3b2; }
html[data-theme="dark"] .ui-select-opt { color: #e7e9ee; }
html[data-theme="dark"] .ui-select-opt:hover { background: #262b34; }
html[data-theme="dark"] .ui-select-opt.on { color: #a5b4fc; background: #23283a; }
html[data-theme="dark"] input:-webkit-autofill {
    -webkit-text-fill-color: #e7e9ee;
    box-shadow: 0 0 0 1000px #1a1d24 inset;
}
html[data-theme="dark"] *::-webkit-scrollbar-thumb { background: #3a4252; }
html[data-theme="dark"] .search-input::placeholder { color: #7b8494; }
html[data-theme="dark"] .logo:hover,
html[data-theme="dark"] .result-title a:hover,
html[data-theme="dark"] .no-results a:hover,
html[data-theme="dark"] .nav-appeal:hover,
html[data-theme="dark"] .keyword:hover,
html[data-theme="dark"] .home-nav-link:hover { color: #c7d2fe; }
html[data-theme="dark"] .pagination a:hover {
    background: #262b34;
    border-color: #3a4252;
    color: #e7e9ee;
}
html[data-theme="dark"] .pagination .current {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}
html[data-theme="dark"] .result-title mark,
html[data-theme="dark"] .file-item mark {
    background: rgba(250, 204, 21, 0.18);
    color: #fde68a;
}
html[data-theme="dark"] .result-item:hover,
html[data-theme="dark"] .detail-file-item:hover { border-color: #6366f1; }
html[data-theme="dark"] .keyword.kw-0 { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
html[data-theme="dark"] .keyword.kw-1 { background: rgba(34, 197, 94, 0.16); color: #86efac; }
html[data-theme="dark"] .keyword.kw-2 { background: rgba(236, 72, 153, 0.16); color: #f9a8d4; }
html[data-theme="dark"] .keyword.kw-3 { background: rgba(249, 115, 22, 0.16); color: #fdba74; }
html[data-theme="dark"] .keyword.kw-4 { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }
html[data-theme="dark"] .keyword.kw-5 { background: rgba(6, 182, 212, 0.16); color: #67e8f9; }
html[data-theme="dark"] .keyword.kw-6 { background: rgba(234, 179, 8, 0.16); color: #fde68a; }
html[data-theme="dark"] .keyword.kw-7 { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
html[data-theme="dark"] .size-s { background: rgba(34, 197, 94, 0.16); color: #86efac; }
html[data-theme="dark"] .size-m { background: rgba(249, 115, 22, 0.16); color: #fdba74; }
html[data-theme="dark"] .size-l { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
html[data-theme="dark"] .size-xl { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }
html[data-theme="dark"] .addr-bar {
    background: rgba(250, 204, 21, 0.1);
    border-color: rgba(250, 204, 21, 0.28);
    color: #fde68a;
}
html[data-theme="dark"] .slot-pic,
html[data-theme="dark"] .slot-ico img { background: #1a1d24; }
html[data-theme="dark"] .slot-ico { color: #c5cad3; }
html[data-theme="dark"] .slot-txt {
    background: rgba(129, 140, 248, 0.14);
    border-color: #6366f1;
    color: #c7d2fe;
}
html[data-theme="dark"] .slot-txt em { color: #a5b4fc; }
html[data-theme="dark"] .slot-txt:hover {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}
html[data-theme="dark"] .slot-txt:hover em { color: rgba(255, 255, 255, 0.86); }
html[data-theme="dark"] .site-footer .friend-link:hover,
html[data-theme="dark"] body.home .site-footer .friend-link:hover { color: #d1d5db; }
html[data-theme="dark"] .settings-x { color: #9aa3b2; }
html[data-theme="dark"] .notice-card h1,
html[data-theme="dark"] .notice-card p,
html[data-theme="dark"] .detail-files h3,
html[data-theme="dark"] .detail-meta strong { color: #e7e9ee; }
html[data-theme="dark"] .filter-files { color: #a5b4fc; }
html[data-theme="dark"] .home-contact a,
html[data-theme="dark"] .notice-card a,
html[data-theme="dark"] .no-results a { color: #a5b4fc; }
