/* 设计令牌：色板、圆角、字体与动效变量。取值与桌面版 EsprinNemo 的 styles/tokens.css 一致，
   浅色主题由 :root.light 覆盖 */

/* 字体随仓库分发：断网、file://、局域网内都照常显示，不依赖任何外链。
   Material Symbols 是图标字形（按 ligature 取字，见 base.css 的 .ms-icon），
   Mohave 是左上角应用名用的可变字重字体。更新时从 npm 包 material-symbols 与与 Mohave 官方包
   取同名文件覆盖即可。 */
@font-face {
    font-family: 'Material Symbols Rounded';
    font-style: normal;
    font-weight: 100 700;
    font-display: block;
    src: url('../fonts/material-symbols/material-symbols-rounded.woff2') format('woff2');
}

@font-face {
    font-family: 'Mohave';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/Mohave/Mohave-VariableFont_wght.ttf') format('truetype-variations'),
         url('../fonts/Mohave/Mohave-VariableFont_wght.ttf') format('truetype');
}

:root {
    --bg-body: #0d1117;
    --bg-titlebar: #161b22;
    --bg-sidebar: #0d1117;
    --bg-list: #161b22;
    --bg-editor: #0d1117;
    /* 浮起表面：比所在容器亮一档，用于当前标签页与分段控件选中项 */
    --bg-elevated: #21262d;
    --border-color: #30363d;
    --border-light: rgba(255, 255, 255, 0.08);

    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;

    --accent: #58a6ff;
    --accent-bg: rgba(56, 139, 253, 0.15);
    /* 强调色底面上的文字色：按主题色亮度自动换算，见 scripts/app.js 的 applyAccentColor */
    --accent-fg: #ffffff;
    --danger: #f85149;
    --danger-bg: rgba(248, 81, 73, 0.15);
    --warning: #d29922;

    --brand: #E6E8F3;
    --brand-fg: var(--brand);

    --item-hover: rgba(255, 255, 255, 0.04);
    --item-active: rgba(255, 255, 255, 0.08);

    /* 圆角基础值：最终生效的 --radius-sm / --radius-md 由 styles/radius.css 按
       用户选择的「圆角尺度」换算（默认风格 6px / 8px，Alom 风格在 alom.css 中放大一档） */
    --radius-base-sm: 6px;
    --radius-base-md: 8px;

    /* 动效：时长与缓动曲线。styles/motion.css 里的进场动画与换肤交叉淡入统一引用这几个令牌 */
    --motion-fast: 0.12s;
    --motion-base: 0.18s;
    --motion-slow: 0.26s;
    /* 换肤时的整屏颜色过渡时长，与 scripts/app.js 的 APPEARANCE_FADE_MS 对齐 */
    --motion-crossfade: 0.25s;
    --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-standard: cubic-bezier(0.2, 0, 0, 1);

    /* 字体族：西文与 CJK 分开配置，浏览器按字符逐个回退 */
    --font-ui-latin: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Ubuntu", "Roboto", "Helvetica Neue", Arial;
    --font-ui-cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei";
    --font-doc-latin: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Ubuntu", "Roboto", "Helvetica Neue", Arial;
    --font-doc-cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei";

    --font-sans: var(--font-ui-latin), var(--font-ui-cjk), sans-serif;
    --font-doc: var(--font-doc-latin), var(--font-doc-cjk), var(--font-ui-cjk), sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", Consolas, "Fira Code", monospace;
}

:root.light {
    --bg-body: #ffffff;
    --bg-titlebar: #f6f8fa;
    --bg-sidebar: #f6f8fa;
    --bg-list: #ffffff;
    --bg-editor: #ffffff;
    --bg-elevated: #ffffff;
    --border-color: #d0d7de;
    --border-light: rgba(0, 0, 0, 0.06);

    --text-primary: #1f2328;
    --text-secondary: #656d76;
    --text-muted: #8c959f;

    --accent: #0969da;
    --accent-bg: rgba(9, 105, 218, 0.1);
    --danger: #cf222e;
    --danger-bg: rgba(207, 34, 46, 0.1);
    --warning: #bf8700;

    --brand: #280C7D;

    --item-hover: rgba(0, 0, 0, 0.04);
    --item-active: rgba(0, 0, 0, 0.08);
}

/* 应用名文字颜色模式：由设置页写入 <html data-brand-color>（brand / mono / accent） */
:root[data-brand-color="mono"] {
    --brand-fg: #ffffff;
}
:root.light[data-brand-color="mono"] {
    --brand-fg: #000000;
}
:root[data-brand-color="accent"] {
    --brand-fg: var(--accent);
}

/* 圆角尺度（方 / 微圆角 / 默认 / 大）写在 <html data-radius> 上，
   换算规则见 styles/radius.css——那里要排在 alom.css 之后，才能与主题风格叠加生效 */
