/* ============================================================
   TuTu工具箱 — 纯净白金设计系统 v5
   色调：苹果白 / 近黑文字 / 香槟金点缀
   字体：SF Pro Display/Text 全系仿苹果字体栈
   核心原则：留白充足、圆角适中、克制的金色会员尊贵感
   ============================================================ */

/* 仿苹果字体 — Inter 作为非苹果设备的 SF Pro 替代 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ---------- 设计变量 ---------- */
:root {
    /* 背景色 — 苹果白系 */
    --bg-base:      #f5f5f7;   /* Apple 标志性浅灰背景 */
    --bg-surface:   #f5f5f7;   /* 侧边栏背景 */
    --bg-card:      #ffffff;   /* 卡片纯白 */
    --bg-elevated:  #fafafa;   /* 略微抬升层 */
    --bg-hover:     #f5f5f7;   /* 行/项 hover */
    --bg-input:     #f5f5f7;   /* 输入框浅灰背景 */

    /* 文字色 — Apple 灰阶 */
    --text-primary:    #1d1d1f;   /* Apple 主文字色 */
    --text-secondary:  #424245;   /* 次级文字 */
    --text-muted:      #6e6e73;   /* 辅助文字 */
    --text-faint:      #86868b;   /* 最弱文字 */

    /* 品牌色 — 香槟金（会员尊贵点缀） */
    --gold:        #d4af37;
    --gold-light:  #e8c75a;
    --gold-dim:    #c9a227;
    --gold-glow:   rgba(212,175,55,0.10);
    --gold-border: rgba(212,175,55,0.35);

    /* 辅助色 */
    --indigo:      #6366f1;
    --emerald:     #22c55e;
    --crimson:     #ef4444;
    --amber:       #f59e0b;

    /* 边框 — 浅灰通透 */
    --border:        rgba(0,0,0,0.08);
    --border-light:  rgba(0,0,0,0.05);
    --border-strong: rgba(0,0,0,0.12);

    /* 圆角 */
    --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.10);
    --shadow-gold: 0 0 24px rgba(212,175,55,0.12);

    /* 字体栈 — 全系仿苹果 SF Pro */
    --font-sans:   -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
                   "Helvetica Neue", "Inter", "PingFang SC", "Hiragino Sans GB",
                   "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display",
                    "Helvetica Neue", "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-mono:   "SF Mono", "JetBrains Mono", SFMono-Regular, Menlo, Consolas, 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); }

/* ============================================================
   导航栏 — 白色毛玻璃 + 底部细线
   ============================================================ */
.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: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.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: #ffffff;
    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: #ffffff;
    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: #1d1d1f;
    color: #ffffff;
    width: 100%;
    font-weight: 500;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}
.btn-primary:hover {
    background: #000000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
    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;
    min-height: calc(100vh - 60px);
    position: relative;
    z-index: 1;
}

/* ---------- 侧边栏 ---------- */
.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(0,0,0,0.04);
    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;
    padding: 36px 40px;
    min-width: 0;
    max-width: 1040px;
}
.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: #ffffff;
    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) {
    .app-layout { flex-direction: column; }
    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 16px;
        display: flex;
        gap: 8px;
        overflow-x: auto;
    }
    .sidebar-section { margin-bottom: 0; margin-right: 16px; }
    .sidebar-title { display: none; }
    .sidebar-link { white-space: nowrap; }
    .main-content { padding: 24px 20px; max-width: 100%; }
    .hero h1 { font-size: 42px; }
    .hero .hero-sub { font-size: 20px; }
}

@media (max-width: 600px) {
    .nav-inner { padding: 0 20px; }
    .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; }
}
