/* ============================================
   5000言 CMS - 主题样式变量（后台专用）
   设计法则：零下划线、零边框、纯背景色分层
   深色默认（:root），浅色覆盖（html.light）
   ============================================ */

/* ===== 深色主题（默认）— 夜读暖棕，与浅色米黄纸张同色温 ===== */
:root {
    /* 页面底色层级 */
    --bg-primary: #171410;
    --bg-secondary: #201c17;
    --bg-tertiary: #2b261f;
    --bg-surface: #1c1814;

    /* 卡片 */
    --bg-card: #1e1a15;
    --bg-card-hover: #221d18;

    /* 交互态 */
    --bg-hover: rgba(232, 228, 220, 0.06);
    --bg-active: rgba(61, 165, 94, 0.14);

    /* 文字 */
    --text-primary: #e8e4dc;
    --text-secondary: #c6c1b5;
    --text-muted: #928c7e;
    --text-dim: #6e685c;

    /* 强调色（翠绿系） */
    --accent: #3da55e;
    --accent-hover: #4fb572;
    --accent-rgb: 61, 165, 94;
    --accent-bg: rgba(61, 165, 94, 0.14);
    --accent-bg-hover: rgba(61, 165, 94, 0.22);

    /* 成功/点赞高亮色 */
    --success: #3da55e;
    --success-rgb: 61, 165, 94;

    /* 危险色 */
    --danger: #ef4444;
    --danger-hover: #f87171;
    --danger-bg: rgba(239, 68, 68, 0.12);

    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.4);

    /* 圆角 */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* 特殊区域 */
    --sidebar-bg: #12100b;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: rgba(255, 255, 255, 0.1);
    --footer-bg: #0e0c08;
    --header-bg: rgba(23, 20, 16, 0.85);

    /* 表单 */
    --input-bg: #100e0b;
    --input-focus-bg: #131110;

    /* 过渡 */
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 浅色主题 ===== */
html.light {
    --bg-primary: #f5f2ed;
    --bg-secondary: #eeebe4;
    --bg-tertiary: #e5e0d8;
    --bg-surface: #f1ede7;

    --bg-card: #ffffff;
    --bg-card-hover: #f7f5f0;

    --bg-hover: rgba(0, 0, 0, 0.05);
    --bg-active: rgba(27, 107, 58, 0.10);

    --text-primary: #1e2024;
    --text-secondary: #3d4148;
    --text-muted: #7a8089;
    --text-dim: #9ca3af;

    --accent: #1b6b3a;
    --accent-hover: #238b4a;
    --accent-rgb: 27, 107, 58;
    --accent-bg: rgba(27, 107, 58, 0.08);
    --accent-bg-hover: rgba(27, 107, 58, 0.15);

    /* 成功/点赞高亮色 */
    --success: #27ae60;
    --success-rgb: 39, 174, 96;

    --danger: #dc2626;
    --danger-hover: #ef4444;
    --danger-bg: rgba(220, 38, 38, 0.08);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.10);

    --sidebar-bg: #1e293b;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(255, 255, 255, 0.14);
    --footer-bg: #e8e0d6;
    --header-bg: rgba(245, 242, 237, 0.92);

    --input-bg: #ffffff;
    --input-focus-bg: #f5f2ed;
}

/* ===== 全局基础 ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* 日夜主题切换平滑过渡：仅背景/文字/边框色（可合成属性，开销小）；尊重系统减弱动效 */
@media (prefers-reduced-motion: no-preference) {
    *,
    *::before,
    *::after {
        transition: background-color 0.28s ease, color 0.28s ease, border-color 0.28s ease;
    }
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 全局链接：禁止下划线 */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--accent-hover);
}

/* 全局选中 */
::selection {
    background: var(--accent-bg);
    color: var(--accent);
}

/* 无边框输入框基础 */
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
    background: var(--input-bg);
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.875rem;
    outline: none;
    transition: background var(--transition), box-shadow var(--transition);
}
input:focus,
textarea:focus,
select:focus {
    background: var(--input-focus-bg);
}
input::placeholder,
textarea::placeholder {
    color: var(--text-dim);
}

/* 无边框按钮基础 */
button {
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}

/* 表格无边框基础 */
table {
    border-collapse: collapse;
    width: 100%;
}
th {
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 16px;
    background: var(--bg-tertiary);
}
td {
    padding: 10px 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
