/* assets/css/common.css - 专业版核心样式 (含夜间模式) */

:root {
    /* --- 亮色模式 (默认) --- */
    --bg-page: #F5F7F8;       /* 网页全局浅灰底色 */
    --bg-card: #FFFFFF;       /* 内容卡片纯白底色 */
    --bg-code: #1E1E1E;       /* 代码块深色背景 (保持不变) */
    --bg-sidebar: #FFFFFF;    /* 侧边栏背景 */
    --bg-hover: #F3F4F6;      /* 悬停背景 */
    --bg-active: #EFF6FF;     /* 选中背景 */

    /* --- 核心主色 (Coursera Blue) --- */
    --accent-color: #0056D2;

    /* --- 文字颜色 --- */
    --text-primary: #1F1F1F;  /* 标题黑 */
    --text-secondary: #636363;/* 正文灰 */
    --text-dim: #8892b0;      /* 弱化文字 */
    --border-color: #E5E7EB;  /* 边框灰 */

    /* --- 布局变量 --- */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --border-width: 1px;

    /* --- 字体 --- */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* --- 状态色 --- */
    --success: #1f883d;
    --warning: #9a6700;
    --danger: #d1242f;

    /* --- 阴影 --- */
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* --- 暗色模式 (Night Mode) --- */
[data-theme="dark"] {
    --bg-page: #0f172a;       /* 深蓝灰底色 */
    --bg-card: #1e293b;       /* 卡片深色 */
    --bg-code: #020617;       /* 代码块更深 */
    --bg-sidebar: #1e293b;    /* 侧边栏深色 */
    --bg-hover: #334155;      /* 悬停亮一点 */
    --bg-active: #1e3a8a;     /* 选中深蓝 */

    --accent-color: #60a5fa;  /* 亮蓝色，在黑底更清晰 */

    --text-primary: #f1f5f9;  /* 亮白 */
    --text-secondary: #94a3b8;/* 灰蓝 */
    --text-dim: #64748b;
    --border-color: #334155;  /* 深灰边框 */

    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;

    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-page);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
a:hover { color: var(--accent-color); }

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #C1C1C1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-color); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #475569; }
