/* ============================================================
   TuTu工具箱 — 高级黑金设计系统 v7
   色调：暖白底 / 深灰文字 / 低饱和金色点缀 / 顶部黑金导航
   核心原则：浅底金缀、黑金导航、克制留白、沉稳高级
   ============================================================ */

/* 字体使用操作系统原生字体栈，不加载外部字体资源。 */

/* ---------- 设计变量 ---------- */
:root {
    /* 背景色 — 暖白浅灰系 */
    --bg-base:      #f5f3f0;   /* 暖白底 */
    --bg-surface:   #efece7;  /* 面板/侧边栏 */
    --bg-card:      #ffffff;  /* 卡片纯白 */
    --bg-elevated:  #faf9f7;  /* 略微抬升层 */
    --bg-hover:     #f0ede8;   /* 行/项 hover */
    --bg-input:     #f5f3f0;  /* 输入框底 */

    /* 文字色 — 深暖灰阶 */
    --text-primary:    #1a1815;   /* 主文字深暖黑 */
    --text-secondary:  #4a4640;   /* 次级文字 */
    --text-muted:      #7a756b;   /* 辅助文字 */
    --text-faint:      #a8a299;   /* 最弱文字 */

    /* 品牌色 — 低饱和金（沉稳不刺眼） */
    --gold:        #b8860b;
    --gold-light:  #d4a017;
    --gold-dim:    #8b6508;
    --gold-dark:   #8b6508;
    --gold-glow:   rgba(184,134,11,0.06);
    --gold-border: rgba(184,134,11,0.20);

    /* 辅助色 */
    --indigo:      #6366f1;
    --emerald:     #22c55e;
    --crimson:     #ef4444;
    --amber:       #f59e0b;

    /* 边框 — 暖灰通透 */
    --border:        rgba(0,0,0,0.06);
    --border-light:  rgba(0,0,0,0.04);
    --border-strong: rgba(0,0,0,0.10);

    /* 圆角 */
    --radius-sm:  8px;
    --radius-md:  10px;
    --radius-lg:  14px;
    --radius-xl:  18px;
    --radius-full: 999px;

    /* 阴影 — 轻柔 */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.04);
    --shadow-md:  0 2px 12px rgba(0,0,0,0.06);
    --shadow-lg:  0 8px 40px rgba(0,0,0,0.08);
    --shadow-gold: 0 0 24px rgba(184,134,11,0.06);

    /* 系统字体栈：不引入外部字体文件。 */
    --font-sans:   -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
    --font-display:var(--font-sans);
    --font-mono:   "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

    /* 过渡 */
    --transition:       all 0.3s cubic-bezier(0.4,0,0.2,1);
    --transition-fast:  all 0.15s ease;
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;           /* 固定根字号，禁止缩放膨胀 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景纹理 — 极淡金色光晕 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212,175,55,0.05), transparent 60%),
        radial-gradient(ellipse 60% 40% at 90% 100%, rgba(212,175,55,0.03), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--gold-dim); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--gold); }

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ============================================================
   导航栏 — 白色毛玻璃 + 底部细线
   ============================================================ */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mobile-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}
.mobile-menu-btn span { display: block; height: 2px; margin: 4px 0; border-radius: 2px; background: var(--text-primary); transition: var(--transition-fast); }
body.sidebar-open .mobile-menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.sidebar-open .mobile-menu-btn span:nth-child(2) { opacity: 0; }
body.sidebar-open .mobile-menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-logo {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-logo:hover { color: var(--text-primary); }
.nav-logo .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 12px var(--gold-glow);
}
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.01em;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-user {
    display: flex;
    align-items: center;
    gap: 20px;
}
.nav-user .user-email {
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.nav-user .user-badge {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: var(--gold-glow);
    color: var(--gold-dim);
    border: 1px solid var(--gold-border);
    font-weight: 500;
    letter-spacing: 0.05em;
}
.nav-user .btn-logout {
    font-size: 13px;
    color: var(--text-muted);
    transition: var(--transition-fast);
}
.nav-user .btn-logout:hover { color: var(--crimson); }

/* ============================================================
   通用容器 — 严格宽度约束
   ============================================================ */
.container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 32px;
    position: relative;
    z-index: 1;
}

/* ============================================================
   认证页面 — 纯白卡片 + 轻阴影
   ============================================================ */
.auth-page {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    position: relative;
    z-index: 1;
}
.auth-card {
    width: 420px;
    max-width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 48px 40px;
    animation: cardIn 0.5s cubic-bezier(0.4,0,0.2,1);
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.auth-card .auth-logo {
    width: 48px; height: 48px;
    margin: 0 auto 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    box-shadow: var(--shadow-gold);
}
.auth-card h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-bottom: 6px;
    text-align: center;
    color: var(--text-primary);
}
.auth-card .subtitle {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 32px;
    letter-spacing: 0.01em;
}

/* ============================================================
   表单
   ============================================================ */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 15px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    outline: none;
}
.form-input:focus {
    background: var(--bg-elevated);
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.form-input::placeholder { color: var(--text-faint); }

/* 验证码输入框 */
.code-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 8px;
}
.code-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    outline: none;
}
.code-input:focus {
    background: var(--bg-elevated);
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.code-input.filled { border-color: var(--gold-dim); }

/* ============================================================
   复选框
   ============================================================ */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 24px 0;
    cursor: pointer;
    user-select: none;
}
.checkbox-group input[type="checkbox"] {
    appearance: none;
    width: 18px; height: 18px;
    min-width: 18px;
    border: 1.5px solid var(--border-strong);
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
    margin-top: 1px;
    background: var(--bg-input);
}
.checkbox-group input[type="checkbox"]:checked {
    background: var(--gold);
    border-color: var(--gold);
}
.checkbox-group input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px; top: 1px;
    width: 5px; height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.checkbox-group .label-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}
.checkbox-group .label-text strong { color: var(--text-secondary); font-weight: 500; }

/* ============================================================
   按钮 — Apple 黑为主，金色为辅
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 28px;
    font-size: 15px;
    font-weight: 500;
    font-family: var(--font-sans);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
/* 主按钮：深黑背景 + 白字（Apple 风格） */
.btn-primary {
    background: linear-gradient(135deg, #2a2620, #1a1815);
    color: var(--gold-light);
    width: 100%;
    font-weight: 500;
    border: 1px solid var(--gold-border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #38332a, #252220);
    border-color: var(--gold);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* 次按钮：金色描边强调（会员尊贵感） */
.btn-secondary {
    background: transparent;
    color: var(--gold-dim);
    border: 1px solid var(--gold-border);
}
.btn-secondary:hover {
    background: var(--gold-glow);
    border-color: var(--gold);
    color: var(--gold);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-danger {
    background: transparent;
    color: var(--crimson);
    border: 1px solid rgba(239,68,68,0.30);
}
.btn-danger:hover {
    background: rgba(239,68,68,0.08);
    border-color: var(--crimson);
}

.btn-large { height: 54px; font-size: 16px; padding: 0 36px; }
.btn-sm { height: 36px; font-size: 13px; padding: 0 16px; }
.btn-form { width: auto; padding: 0 32px; }

/* ============================================================
   提示消息
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 8px;
    animation: alertIn 0.3s ease;
}
@keyframes alertIn { from { opacity:0; transform: translateY(-6px); } to { opacity:1; transform: translateY(0); } }
.alert.show { display: flex; }
.alert-error   { background: rgba(239,68,68,0.06); color: var(--crimson); border: 1px solid rgba(239,68,68,0.20); }
.alert-success { background: rgba(34,197,94,0.06); color: #16a34a; border: 1px solid rgba(34,197,94,0.20); }
.alert-info    { background: var(--gold-glow); color: var(--gold-dim); border: 1px solid var(--gold-border); }

/* ============================================================
   链接区
   ============================================================ */
.auth-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 14px;
    color: var(--text-muted);
}
.auth-footer a { font-weight: 500; }

/* ============================================================
   首页 Hero
   ============================================================ */
.hero {
    text-align: center;
    padding: 120px 32px 80px;
    position: relative;
    z-index: 1;
}
.hero h1 {
    font-family: var(--font-display);
    font-size: 56px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.15;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--gold-dim) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero .hero-sub {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--gold-dim);
    font-style: italic;
    font-weight: 400;
    margin-bottom: 16px;
    letter-spacing: 0.03em;
}
.hero p {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 40px;
    line-height: 1.6;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* 分隔线装饰 */
.divider-ornate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 0 auto 40px;
    max-width: 200px;
}
.divider-ornate::before,
.divider-ornate::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
}
.divider-ornate .diamond {
    width: 6px; height: 6px;
    background: var(--gold);
    transform: rotate(45deg);
    box-shadow: 0 0 8px var(--gold-glow);
}

/* ============================================================
   应用布局 — 侧边栏 + 主内容
   ============================================================ */
.app-layout {
    display: flex;
    width: 100%;
    max-width: 1440px;
    min-height: calc(100vh - 60px);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.sidebar-backdrop { display: none; }

/* ---------- 侧边栏 ---------- */
.sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    padding: 28px 16px;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}
.sidebar-section { margin-bottom: 28px; }
.sidebar-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 12px;
    margin-bottom: 10px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    transition: var(--transition-fast);
    margin-bottom: 2px;
    letter-spacing: 0.01em;
}
.sidebar-link:hover {
    background: rgba(201,162,39,0.06);
    color: var(--text-primary);
}
.sidebar-link.active {
    background: var(--gold-glow);
    color: var(--gold-dim);
    font-weight: 500;
    border-left: 2px solid var(--gold);
    padding-left: 10px;
}
.sidebar-link .icon {
    width: 18px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
    opacity: 0.8;
}

/* ---------- 主内容区 ---------- */
.main-content {
    flex: 1;
    width: 100%;
    padding: 36px clamp(24px, 3vw, 48px) 48px;
    min-width: 0;
    max-width: 1200px;
    margin: 0 auto;
}
.page-header {
    margin-bottom: 28px;
}
.page-header h1 {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-primary);
}
.page-header .page-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ============================================================
   欢迎横幅
   ============================================================ */
.welcome-banner {
    background: linear-gradient(135deg, rgba(212,175,55,0.06) 0%, rgba(212,175,55,0.02) 100%);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-xl);
    padding: 32px 36px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--gold-glow), transparent 70%);
    pointer-events: none;
}
.welcome-banner h2 {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
    position: relative;
}
.welcome-banner p {
    font-size: 14px;
    color: var(--text-secondary);
    position: relative;
}

/* ============================================================
   统计卡片
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    transition: var(--transition-fast);
}
.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.stat-card .stat-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 16px;
    background: var(--gold-glow);
}
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; letter-spacing: 0.03em; }
.stat-card .stat-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-primary);
}

/* ============================================================
   通用内容卡片
   ============================================================ */
.content-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}
.content-card h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--text-primary);
}

/* ============================================================
   脚本工具箱 — 表格形式
   ============================================================ */
.toolbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}
.search-box input {
    width: 100%;
    height: 42px;
    padding: 0 16px 0 42px;
    font-size: 14px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    outline: none;
}
.search-box input:focus {
    background: var(--bg-elevated);
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.search-box input::placeholder { color: var(--text-faint); }
.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 15px;
    pointer-events: none;
}

/* 分类标签 */
.category-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.category-tab {
    padding: 7px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition-fast);
    letter-spacing: 0.02em;
}
.category-tab:hover {
    border-color: var(--gold-border);
    color: var(--gold-dim);
}
.category-tab.active {
    background: #1d1d1f;
    color: #ffffff;
    border-color: #1d1d1f;
}

/* 表格容器 */
.table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table thead {
    background: var(--bg-elevated);
}
.data-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 16px 20px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.data-table tbody tr {
    transition: var(--transition-fast);
}
.data-table tbody tr:hover {
    background: var(--bg-hover);
}
.data-table tbody tr:last-child td {
    border-bottom: none;
}
.data-table .script-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}
.data-table .script-desc {
    color: var(--text-muted);
    font-size: 13px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.data-table .script-date {
    color: var(--text-faint);
    font-size: 13px;
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* 表格标签 */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.tag-gold    { background: var(--gold-glow); color: var(--gold-dim); border: 1px solid var(--gold-border); }
.tag-indigo  { background: rgba(99,102,241,0.08); color: #4f46e5; border: 1px solid rgba(99,102,241,0.20); }
.tag-emerald { background: rgba(34,197,94,0.08); color: #16a34a; border: 1px solid rgba(34,197,94,0.20); }
.tag-amber   { background: rgba(245,158,11,0.08); color: #d97706; border: 1px solid rgba(245,158,11,0.20); }
.tag-muted   { background: var(--bg-hover); color: var(--text-muted); border: 1px solid var(--border); }

/* 表格操作按钮 */
.table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.table-btn {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: var(--font-sans);
    white-space: nowrap;
}
.table-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.table-btn.btn-download { color: var(--gold-dim); border-color: var(--gold-border); }
.table-btn.btn-download:hover { background: var(--gold-glow); }
.table-btn.btn-edit { color: var(--indigo); border-color: rgba(99,102,241,0.25); }
.table-btn.btn-edit:hover { background: rgba(99,102,241,0.06); }
.table-btn.btn-delete { color: var(--crimson); border-color: rgba(239,68,68,0.25); }
.table-btn.btn-delete:hover { background: rgba(239,68,68,0.06); }
.table-btn.btn-toggle { color: var(--amber); border-color: rgba(245,158,11,0.25); }
.table-btn.btn-toggle:hover { background: rgba(245,158,11,0.06); }

/* ============================================================
   空状态
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 64px 24px;
}
.empty-state .empty-icon {
    font-size: 40px;
    margin-bottom: 16px;
    opacity: 0.25;
}
.empty-state h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
    max-width: 360px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================================
   设置区块
   ============================================================ */
.settings-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 24px;
}
.settings-section .section-header {
    padding: 18px 28px;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-elevated);
}
.settings-section .section-body { padding: 28px; }

/* 设置行 */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}
.setting-row:last-child { border-bottom: none; }
.setting-row .setting-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.setting-row .setting-desc {
    font-size: 13px;
    color: var(--text-muted);
}
.setting-row .setting-value {
    font-size: 13px;
    font-weight: 500;
}
.setting-value.enabled { color: #16a34a; }
.setting-value.disabled { color: var(--text-faint); }

/* ============================================================
   表单行
   ============================================================ */
.form-row { margin-bottom: 20px; }
.form-row label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.form-row .form-hint {
    font-size: 12px;
    color: var(--text-faint);
    margin-top: 6px;
}
.form-row input.form-input { max-width: 420px; }

/* ============================================================
   文件上传区域
   ============================================================ */
.file-upload-area {
    position: relative;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--bg-input);
    padding: 36px 24px;
    text-align: center;
    transition: var(--transition-fast);
    cursor: pointer;
}
.file-upload-area:hover {
    border-color: var(--gold);
    background: var(--gold-glow);
}
.file-upload-area.dragover {
    border-color: var(--gold);
    background: var(--gold-glow);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.file-upload-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.file-upload-label {
    display: block;
    cursor: pointer;
    transition: var(--transition-fast);
}
.file-upload-icon {
    font-size: 32px;
    color: var(--gold-dim);
    margin-bottom: 12px;
    display: block;
}
.file-upload-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.file-upload-hint {
    font-size: 12px;
    color: var(--text-faint);
}
.file-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-md);
}
.file-name-text {
    color: var(--text-primary);
    font-weight: 500;
}
.file-name-remove {
    background: none;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    transition: var(--transition-fast);
}
.file-name-remove:hover { color: var(--crimson); }

/* ============================================================
   模态框
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal-overlay.show { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
    width: 480px;
    max-width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s cubic-bezier(0.4,0,0.2,1);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
    padding: 24px 28px 16px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}
.modal-body { padding: 28px; }
.modal-footer {
    padding: 16px 28px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============================================================
   加载动画
   ============================================================ */
.spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
/* 浅色背景上的 spinner 使用深色 */
.btn-ghost .spinner,
.btn-secondary .spinner,
.btn-danger .spinner,
.btn-sm .spinner,
.table-btn .spinner {
    border: 2px solid rgba(0,0,0,0.1);
    border-top-color: var(--text-primary);
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn .spinner { margin-right: 8px; }

/* ============================================================
   倒计时
   ============================================================ */
.resend-timer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-faint);
}
.resend-timer a { color: var(--gold-dim); cursor: pointer; font-weight: 500; }
.resend-timer a.disabled { color: var(--text-faint); pointer-events: none; }

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
    text-align: center;
    padding: 32px 24px;
    font-size: 13px;
    color: var(--text-faint);
    position: relative;
    z-index: 1;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--gold-dim); }

/* ============================================================
   帮助/FAQ
   ============================================================ */
.faq-item {
    border-bottom: 1px solid var(--border-light);
    padding: 18px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item .faq-q {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.faq-item .faq-a {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================================
   关于页面
   ============================================================ */
.about-hero {
    text-align: center;
    padding: 48px 24px;
}
.about-hero .about-logo {
    width: 72px; height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    box-shadow: var(--shadow-gold);
}
.about-hero h2 {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.about-hero .version { font-size: 13px; color: var(--text-faint); margin-bottom: 16px; font-family: var(--font-mono); }
.about-hero p { font-size: 16px; color: var(--text-secondary); max-width: 480px; margin: 0 auto; line-height: 1.6; }

/* ============================================================
   响应式 — 严格断点控制
   ============================================================ */
@media (max-width: 900px) {
    .mobile-menu-btn { display: block; }
    .app-layout { display: block; }
    .sidebar {
        position: fixed;
        z-index: 1200;
        top: 60px;
        bottom: 0;
        left: 0;
        width: min(82vw, 300px);
        min-width: 0;
        height: auto;
        padding: 22px 14px;
        border-right: 1px solid var(--border);
        background: rgba(255,255,255,.98);
        box-shadow: 16px 0 40px rgba(0,0,0,.12);
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform .25s cubic-bezier(.4,0,.2,1);
    }
    body.sidebar-open { overflow: hidden; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop {
        position: fixed;
        z-index: 1100;
        inset: 60px 0 0;
        display: block;
        border: 0;
        background: rgba(15,15,16,.35);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s ease;
    }
    body.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }
    .sidebar-section { margin-bottom: 24px; }
    .sidebar-title { display: block; }
    .sidebar-link { white-space: normal; }
    .main-content { padding: 24px 20px 40px; max-width: 100%; }
    .hero h1 { font-size: 42px; }
    .hero .hero-sub { font-size: 20px; }
}

@media (max-width: 600px) {
    .nav-inner { padding: 0 14px; }
    .nav-logo { font-size: 18px; gap: 7px; }
    .nav-user { gap: 10px; }
    .nav-user .user-email, .nav-user .user-badge { display: none; }
    .nav-user .btn-logout { padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; }
    .main-content { padding: 16px 12px 30px; }
    .auth-card { padding: 36px 24px; }
    .auth-card h2 { font-size: 24px; }
    .code-input { width: 40px; height: 50px; font-size: 20px; }
    .code-input-group { gap: 8px; }
    .nav-links { gap: 20px; }
    .nav-links a { font-size: 13px; }
    .hero { padding: 80px 20px 60px; }
    .hero h1 { font-size: 34px; }
    .hero p { font-size: 15px; }
    .toolbox-header { flex-direction: column; align-items: stretch; }
    .search-box { max-width: 100%; }
    .data-table { font-size: 13px; }
    .data-table th, .data-table td { padding: 12px 14px; }
    .data-table .script-desc { max-width: 160px; }
    .welcome-banner { padding: 24px 20px; }
    .welcome-banner h2 { font-size: 22px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 18px; }
    .stat-card .stat-value { font-size: 24px; }
}

/* ============================================================
   应用双层顶部导航 — 全宽黑金主题
   保留 .sidebar/.sidebar-link/.app-layout/.main-content 以兼容 main.js
   ============================================================ */
.app-header {
    position: sticky;
    z-index: 1000;
    top: 0;
    width: 100%;
    transition: top .26s cubic-bezier(.4,0,.2,1), width .26s cubic-bezier(.4,0,.2,1), margin .26s cubic-bezier(.4,0,.2,1), transform .26s cubic-bezier(.4,0,.2,1), box-shadow .26s ease;
}
.app-header.is-floating {
    top: 10px;
    width: calc(100% - 24px);
    margin-right: 12px;
    margin-left: 12px;
    border-radius: 16px;
    box-shadow: 0 14px 32px rgba(0,0,0,.16);
}
.app-header.is-floating .nav-bar {
    border-radius: 16px 16px 0 0;
}
.app-header.is-floating .app-subnav {
    border-radius: 0 0 16px 16px;
}
.app-header.is-hidden {
    transform: translateY(calc(-100% - 20px));
}
.app-header .nav-bar {
    position: relative;
    color: #f7e7b2;
    background: #080808;
    border-bottom: 1px solid rgba(212,175,55,.38);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.app-header .nav-inner { max-width: none; height: 58px; padding: 0 clamp(18px,3vw,52px); }
.app-header .nav-brand-group,.app-header .nav-user{position:relative;z-index:1;flex:0 0 auto}
.nav-campaign{min-width:0;flex:1 1 auto;padding:0 clamp(18px,4vw,72px);overflow:hidden;color:#e7deca;font-size:12px;font-weight:650;letter-spacing:.075em;text-align:center;white-space:nowrap;pointer-events:none}
.nav-campaign-text{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;transition:opacity .26s ease,transform .26s ease}
.nav-campaign-text.is-leaving{opacity:0;transform:translateY(-9px)}
.nav-campaign-text.is-entering{opacity:0;transform:translateY(9px)}
.app-header .nav-logo,
.app-header .nav-logo:hover { color: #fff4cc; }
.app-header .nav-logo .dot { background: var(--gold); box-shadow: 0 0 16px rgba(212,175,55,.55); }
.app-header .nav-user .user-email { color: #c7c1b2; }
.app-header .nav-user .user-badge { color: #f0d278; background: rgba(212,175,55,.12); border-color: rgba(212,175,55,.45); }
.app-header .nav-user .btn-logout { color: #d8cfae; }
.app-header .nav-user .btn-logout:hover { color: #fff1bb; }

.app-subnav.sidebar {
    position: relative;
    top: auto;
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 clamp(18px,3vw,52px);
    overflow: visible;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff 0%, #faf9f7 100%);
}
.app-subnav .subnav-inner {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: stretch;
    gap: 22px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-border) transparent;
}
.app-subnav .sidebar-section { display: flex; flex: 0 0 auto; align-items: center; gap: 3px; margin: 0; }
.app-subnav .sidebar-section + .sidebar-section { padding-left: 22px; border-left: 1px solid var(--border-light); }
.app-subnav .sidebar-title {
    margin: 0 6px 0 0;
    padding: 0;
    color: var(--text-faint);
    font-size: 9px;
    line-height: 46px;
    white-space: nowrap;
}
.app-subnav .sidebar-link {
    position: relative;
    height: 46px;
    margin: 0;
    padding: 0 10px;
    border-radius: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 46px;
    white-space: nowrap;
}
.app-subnav .sidebar-link:hover { color: var(--gold-dim); background: var(--gold-glow); }
.app-subnav .sidebar-link.active { padding: 0 10px; border: 0; color: var(--gold-dim); background: var(--gold-glow); }
.app-subnav .sidebar-link.active::after { content: ''; position: absolute; right: 9px; bottom: 0; left: 9px; height: 2px; background: var(--gold); }
.app-subnav .sidebar-link .icon { display: none; }

.app-layout { display: block; max-width: none; min-height: calc(100vh - 104px); margin: 0; }
.app-layout .main-content { width: 100%; max-width: none; margin: 0; padding: 30px clamp(20px,3.5vw,64px) 48px; }
.app-header + .app-layout { position: relative; z-index: 1; }
body.ai-doc-open .app-layout { z-index: 2000; }

@media (prefers-reduced-motion: reduce) {
    .app-header,.nav-campaign-text { transition: none; }
}

@media (max-width: 1040px) {
    .nav-campaign{display:none}
}

@media (max-width: 900px) {
    .app-header.is-floating {
        width: calc(100% - 16px);
        margin-right: 8px;
        margin-left: 8px;
        border-radius: 14px;
    }
    .app-header.is-floating .nav-bar { border-radius: 14px; }
    .app-header.is-floating .app-subnav { border-radius: 0 14px 14px 0; }
    .app-header .mobile-menu-btn { display: block; border-color: rgba(184,134,11,.42); background: rgba(255,255,255,.08); }
    .app-header .mobile-menu-btn span { background: #f0d278; }
    .app-subnav.sidebar {
        position: fixed;
        z-index: 1200;
        top: 58px;
        bottom: 0;
        left: 0;
        width: min(86vw,340px);
        height: auto;
        padding: 18px 14px;
        overflow-y: auto;
        border-right: 1px solid var(--border);
        background: var(--bg-card);
        box-shadow: 18px 0 48px rgba(0,0,0,.12);
        transform: translateX(-105%);
    }
    .app-subnav .subnav-inner { display: block; height: auto; overflow: visible; }
    .app-subnav .sidebar-section { display: block; margin-bottom: 20px; }
    .app-subnav .sidebar-section + .sidebar-section { padding: 18px 0 0; border-top: 1px solid var(--border-light); border-left: 0; }
    .app-subnav .sidebar-title { display: block; margin: 0 0 7px; padding: 0 10px; line-height: 24px; }
    .app-subnav .sidebar-link { display: block; height: 40px; padding: 0 10px; border-radius: 8px; line-height: 40px; }
    .app-subnav .sidebar-link.active { padding: 0 10px; }
    .app-subnav .sidebar-link.active::after { top: 9px; right: auto; bottom: 9px; left: 0; width: 2px; height: auto; }
    body.sidebar-open .app-subnav.sidebar { transform: translateX(0); }
    .app-header .sidebar-backdrop { inset: 58px 0 0; }
    .app-layout { min-height: calc(100vh - 58px); }
    .app-layout .main-content { padding: 24px 20px 40px; }
}

@media (max-width: 600px) {
    .app-header .nav-inner { padding: 0 14px; }
    .app-layout .main-content { padding: 16px 12px 30px; }
}

/* 高级黑金全局组件 */
:where(.content-card,.stat-card,.quick-link-card) {
    border-color: var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
}
:where(.content-card,.stat-card,.quick-link-card):hover {
    border-color: var(--gold-border);
    box-shadow: 0 16px 38px rgba(0,0,0,0.08);
}
.stat-icon,.empty-icon,.empty-state-mark {
    display: inline-grid;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    place-items: center;
    border: 1px solid var(--gold-border);
    border-radius: 11px;
    background: linear-gradient(145deg, var(--bg-elevated), var(--bg-surface))!important;
    color: var(--gold-dim)!important;
    font: 800 9px/1 var(--font-sans);
    letter-spacing: .08em;
    box-shadow: var(--shadow-sm);
}
.empty-state-mark { width: max-content; margin: 0 auto 14px; }
.quick-link-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; }
.quick-link { color:inherit; text-decoration:none; }
.quick-link-card { height:100%; padding:20px; border:1px solid var(--border); border-radius:var(--radius-md); transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease; }
.quick-link:hover .quick-link-card { transform:translateY(-2px); border-color:var(--gold-border); }
.quick-link-card > :first-child { display:inline-grid; min-width:38px; height:30px; margin-bottom:10px!important; padding:0 8px; place-items:center; border:1px solid var(--gold-border); border-radius:9px; background:var(--bg-surface); color:var(--gold-dim)!important; font-size:9px!important; font-weight:800; letter-spacing:.08em; }
.status-dot { display:inline-block; width:8px; height:8px; margin-right:7px; border-radius:50%; background:#a1a1aa; box-shadow:0 0 0 4px rgba(161,161,170,.12); vertical-align:1px; }
.status-dot.is-ready { background:#22a85a; box-shadow:0 0 0 4px rgba(34,168,90,.12); }
.status-dot.is-busy { background:#d39419; box-shadow:0 0 0 4px rgba(211,148,25,.14); }
:where(a,button,input,textarea,select,[tabindex]):focus-visible { outline:2px solid var(--gold); outline-offset:3px; }

@media (max-width:900px) {
    body.sidebar-open { overflow:hidden; }
    .app-subnav.sidebar { padding-bottom:calc(18px + env(safe-area-inset-bottom)); overscroll-behavior:contain; }
    .app-header .sidebar-backdrop { background:rgba(0,0,0,.25); backdrop-filter:blur(2px); }
}
@media (max-width:600px) {
    .app-header .nav-logo { max-width:42vw; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .quick-link-grid { grid-template-columns:1fr; }
}

/* ============================================================
   高级黑金浅底主题 — 全局组件覆盖
   顶部导航黑金、内容区暖白底 + 金色点缀
   ============================================================ */

/* 认证页面 */
.auth-card { background: var(--bg-card); border-color: var(--border); }
.auth-card .auth-logo { background: linear-gradient(135deg, var(--gold), var(--gold-dim)); box-shadow: var(--shadow-gold); }

/* 导航 — 顶部黑金导航保持暗色，其他上下文使用浅色 */
.nav-bar { background: rgba(8,8,8,0.92); backdrop-filter: saturate(180%) blur(20px); border-bottom-color: var(--gold-border); }
.mobile-menu-btn { background: rgba(255,255,255,0.08); border-color: var(--gold-border); }
.mobile-menu-btn span { background: var(--gold-light); }
.nav-user .user-badge { background: var(--gold-glow); color: var(--gold-light); border-color: var(--gold-border); }

/* 分类标签 */
.category-tab { background: var(--bg-card); border-color: var(--border); color: var(--text-muted); }
.category-tab.active { background: linear-gradient(135deg, #1d1d1f, #050505); border-color: #1d1d1f; color: #ffffff; }

/* 表格容器和表头 */
.table-wrapper { background: var(--bg-card); border-color: var(--border-light); }
.data-table thead { background: var(--bg-elevated); }
.data-table th { color: var(--text-muted); border-bottom-color: var(--border); }
.data-table td { color: var(--text-secondary); border-bottom-color: var(--border-light); }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table .script-name { color: var(--text-primary); }
.data-table .script-desc { color: var(--text-muted); }

/* 表格按钮 */
.table-btn { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.table-btn:hover { border-color: var(--border-strong); color: var(--text-primary); background: var(--bg-hover); }

/* 标签 */
.tag-gold { background: var(--gold-glow); color: var(--gold-dim); border-color: var(--gold-border); }
.tag-muted { background: var(--bg-hover); color: var(--text-muted); border-color: var(--border); }

/* 空状态 */
.empty-state .empty-icon { opacity: 0.5; }

/* 设置区块 */
.settings-section { background: var(--bg-card); border-color: var(--border-light); }
.settings-section .section-header { background: var(--bg-elevated); color: var(--text-primary); border-bottom-color: var(--border); }

/* 文件上传 */
.file-upload-area { background: var(--bg-input); border-color: var(--border-strong); }
.file-upload-area:hover, .file-upload-area.dragover { border-color: var(--gold); background: var(--gold-glow); }
.file-name { background: var(--bg-card); border-color: var(--gold-border); }
.file-name-text { color: var(--text-primary); }

/* 模态框 */
.modal-overlay { background: rgba(0,0,0,0.35); backdrop-filter: blur(4px); }
.modal-card { background: var(--bg-card); border-color: var(--border); }
.modal-header { border-bottom-color: var(--border); }
.modal-header h3 { color: var(--text-primary); }
.modal-footer { border-top-color: var(--border-light); }

/* 欢迎横幅 */
.welcome-banner { background: linear-gradient(135deg, rgba(184,134,11,0.04) 0%, rgba(184,134,11,0.01) 100%); border-color: var(--gold-border); }
.welcome-banner::before { background: radial-gradient(circle, rgba(184,134,11,0.03), transparent 70%); }
.welcome-banner h2 { color: var(--text-primary); }

/* 统计卡片 */
.stat-card .stat-label { color: var(--text-muted); }
.stat-card .stat-value { color: var(--text-primary); }

/* 内容卡片标题 */
.content-card h3 { color: var(--text-primary); }

/* Hero 渐变文字 */
.hero h1 { background: linear-gradient(135deg, var(--text-primary) 0%, var(--gold-dim) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero .hero-sub { color: var(--gold-dim); }
.hero p { color: var(--text-secondary); }

/* 页面标题 */
.page-header h1 { color: var(--text-primary); }
.page-header .page-desc { color: var(--text-muted); }

/* 关于页面 */
.about-hero h2 { color: var(--text-primary); }
.about-hero p { color: var(--text-secondary); }
.about-hero .about-logo { background: linear-gradient(135deg, var(--gold), var(--gold-dim)); box-shadow: var(--shadow-gold); }

/* 提示消息 */
.alert-info { background: var(--gold-glow); color: var(--gold-dim); border-color: var(--gold-border); }

/* 分隔线装饰 */
.divider-ornate::before, .divider-ornate::after { background: linear-gradient(90deg, transparent, var(--gold-border), transparent); }

/* 页脚 */
.site-footer { color: var(--text-faint); }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--gold-dim); }

/* 倒计时 */
.resend-timer { color: var(--text-faint); }
.resend-timer a { color: var(--gold-dim); }

/* FAQ */
.faq-item { border-bottom-color: var(--border-light); }
.faq-item .faq-q { color: var(--text-primary); }
.faq-item .faq-a { color: var(--text-secondary); }

/* 响应式 — 移动端侧边栏背景 */
@media (max-width: 900px) {
    .sidebar { background: var(--bg-surface); border-right-color: var(--border); box-shadow: 16px 0 40px rgba(0,0,0,0.08); }
    .sidebar-backdrop { background: rgba(0,0,0,0.25); }
}

/* spinner 边框修正 */
.btn-ghost .spinner, .btn-secondary .spinner, .btn-danger .spinner, .btn-sm .spinner, .table-btn .spinner {
    border-color: rgba(0,0,0,0.08);
    border-top-color: var(--gold-dim);
}

/* ============================================================
   2026 灰白简约视觉系统
   Apple 式轻导航 + NewMax 式留白、细边框和低阴影
   ============================================================ */
:root {
    --bg-base: #f5f5f7;
    --bg-surface: #f0f1f3;
    --bg-card: #ffffff;
    --bg-elevated: #fafafa;
    --bg-hover: #f2f3f5;
    --bg-input: #f7f7f8;
    --text-primary: #1d1d1f;
    --text-secondary: #424245;
    --text-muted: #6e6e73;
    --text-faint: #98989d;
    --gold: #1d1d1f;
    --gold-light: #3a3a3c;
    --gold-dim: #1d1d1f;
    --gold-dark: #000000;
    --gold-glow: rgba(0,0,0,.045);
    --gold-border: rgba(0,0,0,.13);
    --border: rgba(0,0,0,.10);
    --border-light: rgba(0,0,0,.065);
    --border-strong: rgba(0,0,0,.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.025);
    --shadow-md: 0 4px 18px rgba(0,0,0,.045);
    --shadow-lg: 0 14px 42px rgba(0,0,0,.075);
    --shadow-gold: 0 8px 24px rgba(0,0,0,.08);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
    --font-display: var(--font-sans);
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

html, body, button, input, textarea, select { font-family: var(--font-sans); }
body { background: var(--bg-base); color: var(--text-primary); letter-spacing: -.005em; }
body::before { display: none; }

/* 双层 Apple 式导航：轻、薄、清晰，不强制居中 */
.app-header { background: rgba(250,250,252,.82); }
.app-header.is-floating {
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 18px;
    background: rgba(250,250,252,.84);
    box-shadow: 0 12px 36px rgba(0,0,0,.10);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    overflow: hidden;
}
.app-header .nav-bar,
.nav-bar {
    color: var(--text-primary);
    background: rgba(255,255,255,.88);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: saturate(180%) blur(22px);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
}
.app-header .nav-inner {
    height: 52px;
    padding: 0 clamp(20px,3.2vw,56px);
}
.app-header .nav-logo,
.app-header .nav-logo:hover {
    color: #111113;
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -.02em;
}
.app-header .nav-logo .dot {
    width: 7px;
    height: 7px;
    background: #1d1d1f;
    box-shadow: none;
}
.app-header .nav-user { gap: 14px; }
.app-header .nav-user .user-email { color: var(--text-muted); font-family: var(--font-sans); font-size: 12px; }
.app-header .nav-user .user-badge {
    padding: 3px 8px;
    color: var(--text-secondary);
    background: #f1f1f3;
    border-color: var(--border-light);
    letter-spacing: .02em;
}
.app-header .nav-user .btn-logout {
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--text-secondary);
}
.app-header .nav-user .btn-logout:hover { color: #111; background: #eeeef0; }

.app-subnav.sidebar {
    height: 44px;
    padding: 0 clamp(14px,3.2vw,50px);
    background: rgba(247,247,249,.94);
    border-bottom: 1px solid var(--border-light);
}
.app-subnav .subnav-inner { gap: 14px; scrollbar-width: none; }
.app-subnav .subnav-inner::-webkit-scrollbar { display: none; }
.app-subnav .sidebar-section { gap: 2px; }
.app-subnav .sidebar-section + .sidebar-section { padding-left: 14px; border-left-color: var(--border-light); }
.app-subnav .sidebar-title { display: none; }
.app-subnav .sidebar-link {
    height: 44px;
    padding: 0 11px;
    color: #57575c;
    font-size: 12px;
    font-weight: 450;
    line-height: 44px;
    border-radius: 8px;
    transition: color .16s ease, background .16s ease;
}
.app-subnav .sidebar-link:hover { color: #111113; background: rgba(0,0,0,.045); }
.app-subnav .sidebar-link.active {
    padding: 0 11px;
    color: #111113;
    background: rgba(0,0,0,.065);
    font-weight: 600;
}
.app-subnav .sidebar-link.active::after { display: none; }
.app-layout { min-height: calc(100vh - 96px); }
.app-layout .main-content { padding: 28px clamp(20px,3.5vw,56px) 52px; }

/* 灰白内容层：减少装饰，提高信息清晰度 */
.welcome-banner {
    padding: 28px 30px;
    border-color: var(--border-light);
    background: linear-gradient(135deg,#fff 0%,#f7f7f8 100%);
    box-shadow: var(--shadow-sm);
}
.welcome-banner::before { display: none; }
.welcome-banner h2 { font-size: 25px; font-weight: 650; letter-spacing: -.025em; }
:where(.content-card,.stat-card,.quick-link-card) {
    border: 1px solid var(--border-light);
    background: #fff;
    box-shadow: var(--shadow-sm);
}
:where(.content-card,.stat-card,.quick-link-card):hover {
    border-color: var(--border);
    box-shadow: var(--shadow-md);
}
.stat-card { padding: 22px; }
.stat-card:hover { transform: translateY(-1px); }
.content-card { padding: 26px; }
.quick-link-card { border-radius: 13px; }
.quick-link:hover .quick-link-card { transform: translateY(-1px); border-color: var(--border); }

/* 全站统一的简约线条图标 */
.line-icon {
    display: inline-grid;
    width: 38px;
    height: 38px;
    margin-bottom: 14px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f7f7f8;
    color: #3a3a3c;
}
.line-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.stat-icon.line-icon { min-width: 38px; padding: 0; font: inherit; letter-spacing: 0; box-shadow: none; }
.quick-link-card > .line-icon:first-child { display: inline-grid; width: 38px; min-width: 38px; height: 38px; padding: 0; color: #3a3a3c!important; font: inherit!important; letter-spacing: 0; }
.stat-icon,.empty-icon,.empty-state-mark { border-color: var(--border); background: #f7f7f8!important; color: var(--text-secondary)!important; box-shadow: none; }

/* 表单和按钮保持单色 */
.btn-primary { border-color: #1d1d1f; background: #1d1d1f; color: #fff; box-shadow: none; }
.btn-primary:hover { border-color: #000; background: #000; color: #fff; box-shadow: 0 5px 16px rgba(0,0,0,.14); }
.btn-secondary,.table-btn { border-color: var(--border); background: #fff; color: var(--text-secondary); }
.form-input:focus { border-color: #77777c; box-shadow: 0 0 0 3px rgba(0,0,0,.07); }
:where(a,button,input,textarea,select,[tabindex]):focus-visible { outline-color: #4b4b50; }

@media (max-width:900px) {
    .app-header .mobile-menu-btn { border-color: var(--border); background: #f4f4f5; }
    .app-header .mobile-menu-btn span { background: #333336; }
    .app-subnav.sidebar {
        top: 52px;
        padding: 18px 12px calc(18px + env(safe-area-inset-bottom));
        background: rgba(250,250,252,.98);
    }
    .app-subnav .sidebar-title { display: block; color: var(--text-faint); }
    .app-subnav .sidebar-link { height: 42px; line-height: 42px; border-radius: 10px; }
    .app-header .sidebar-backdrop { inset: 52px 0 0; }
    .app-layout { min-height: calc(100vh - 52px); }
}

@media (max-width:600px) {
    .app-header .nav-inner { height: 50px; }
    .app-header .nav-logo { font-size: 16px; }
    .app-header .nav-user .btn-logout { border-color: var(--border); background: #f5f5f6; }
    .welcome-banner { padding: 22px 20px; }
    .stats-grid { grid-template-columns: 1fr; }
}



/* 编辑部用户功能页：与热点看板统一的米白底、砖红强调和 16/12/8 卡片层级。 */
.editorial-page{--ed-paper:#f4efe6;--ed-card:#fffdf8;--ed-card-soft:#f8f3ea;--ed-ink:#171914;--ed-muted:#67695f;--ed-accent:#c33b2f;--ed-accent-deep:#9f3028;--ed-green:#536b5b;--ed-border:rgba(23,25,20,.1);--ed-shadow:0 12px 34px rgba(47,41,31,.08);display:grid;gap:16px;color:var(--ed-ink)}
.editorial-hero{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:24px 28px;border:1px solid var(--ed-border);border-radius:16px;background:linear-gradient(135deg,#fffdf8,#f3ecdf);box-shadow:var(--ed-shadow)}
.editorial-hero h1{margin:5px 0 6px;font-size:clamp(25px,3vw,38px);line-height:1.08;letter-spacing:-.035em}.editorial-hero p{margin:0;color:var(--ed-muted);line-height:1.65}.editorial-kicker{color:var(--ed-accent);font-size:11px;font-weight:800;letter-spacing:.16em}.editorial-stamp{display:grid;min-width:88px;min-height:88px;padding:12px;place-items:center;border:1px solid rgba(195,59,47,.32);border-radius:50%;color:var(--ed-accent);font-weight:800;transform:rotate(-6deg)}
.editorial-panel{padding:22px 24px;border:1px solid var(--ed-border);border-radius:16px;background:var(--ed-card);box-shadow:var(--ed-shadow)}.editorial-panel>header,.editorial-section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px;padding-bottom:13px;border-bottom:1px solid var(--ed-border)}.editorial-panel>header>div,.editorial-section-head>div{display:flex;align-items:center;gap:10px}.editorial-panel>header>div>span,.editorial-section-index{display:grid;width:30px;height:30px;place-items:center;border-radius:8px;background:rgba(195,59,47,.1);color:var(--ed-accent);font-size:11px;font-weight:800}.editorial-panel h2,.editorial-panel h3,.editorial-section-head h2,.editorial-section-head h3{margin:0;color:var(--ed-ink)}.editorial-panel>header>p,.editorial-section-head>p{margin:0;color:var(--ed-muted);font-size:12px}
.hot-topic-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.editorial-kpi{display:grid;gap:4px;padding:18px 20px;border:1px solid var(--ed-border);border-radius:12px;background:rgba(255,253,248,.86);box-shadow:0 6px 18px rgba(47,41,31,.05)}.editorial-kpi>span,.editorial-kpi small{color:var(--ed-muted);font-size:12px}.editorial-kpi strong{font-size:28px;line-height:1.15}.editorial-kpi .service-state{display:flex;align-items:center;gap:8px;font-size:18px}.status-dot{width:9px;height:9px;border-radius:50%;background:#b78b3a}.status-dot.is-ready{background:#4d7c5d;box-shadow:0 0 0 4px rgba(77,124,93,.12)}.status-dot.is-busy{background:var(--ed-accent);box-shadow:0 0 0 4px rgba(195,59,47,.12)}
.platform-list{display:flex;flex-wrap:wrap;gap:9px}.platform-list span{padding:8px 12px;border:1px solid var(--ed-border);border-radius:8px;background:var(--ed-card-soft);color:var(--ed-green);font-size:13px;font-weight:700}.scrape-panel-body{min-height:142px;display:grid;place-items:center;text-align:center}.scrape-panel-body>div{width:100%}.scrape-panel-body p{margin:0 0 16px;color:var(--ed-muted)}#hot-topic-default .btn{min-width:190px}.scrape-panel-body [hidden]{display:none!important}#hot-topic-loading{display:grid;place-items:center;gap:10px}.editorial-note{display:flex;align-items:flex-start;gap:12px;padding:15px 18px;border-left:4px solid var(--ed-accent);border-radius:8px;background:#eee5d7;color:var(--ed-muted);font-size:13px}.editorial-note strong{flex:none;color:var(--ed-ink)}
.editorial-page .btn-primary{border-color:var(--ed-accent-deep);background:linear-gradient(135deg,var(--ed-accent),var(--ed-accent-deep))}.editorial-page .form-input,.editorial-page input,.editorial-page textarea{border:1px solid var(--ed-border);background:#fffefa;color:var(--ed-ink);box-shadow:none}.editorial-page .form-input:focus,.editorial-page input:focus,.editorial-page textarea:focus{border-color:rgba(195,59,47,.4);box-shadow:0 0 0 3px rgba(195,59,47,.09)}
@media(max-width:800px){.hot-topic-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.editorial-hero{align-items:flex-start}.editorial-stamp{min-width:70px;min-height:70px;font-size:12px}}
@media(max-width:560px){.editorial-page{gap:12px}.editorial-hero,.editorial-panel{padding:19px 17px;border-radius:14px}.editorial-hero{display:block}.editorial-stamp{display:none}.hot-topic-kpis{grid-template-columns:1fr 1fr;gap:8px}.editorial-kpi{padding:14px}.editorial-kpi strong{font-size:23px}.editorial-panel>header{align-items:flex-start}.editorial-note{display:grid}}

