_base.scss 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* 基底令牌(原型 :root / midnight)+ 明暗模式 + 布局/动效/阴影
  2. 真源 styles.css:2-73 | 依据《设计令牌.md》v3.0 §三·§六·§七·§八·§九
  3. 说明:语义色跨配色固定,故在此定义(palette 只覆盖表面/导航/主色族)。
  4. 命名一律用 ui-kit 词汇(--canvas/--ink/--edge/--primary…),禁止自有前缀。*/
  5. :root {
  6. /* 表面与文字 */
  7. --canvas: #edf1f6; --surface: #ffffff; --surface-2: #f5f7fa; --surface-hover: #eaf0f7;
  8. --surface-active: #dfe6f0; --rail-surface: #f0f3f8;
  9. --edge: #dce3ed; --edge-strong: #c5d0df;
  10. --ink: #172337; --ink-2: #495b74; --muted: #61728a; --inverse: #ffffff;
  11. /* 语义色(跨配色固定)—— info 取原型值,非底座 #0369a1(评审 S2)
  12. --on-danger:danger 底上的文字色。暗色下 --danger 是浅粉,故文字须用深色 */
  13. --success: #207550; --success-subtle: #edf7f1;
  14. --warning: #91600e; --warning-subtle: #fff7e8;
  15. --danger: #c33f42; --danger-subtle: #fff0f0; --on-danger: #ffffff;
  16. --info: #315fa8; --info-subtle: #edf3fd;
  17. /* 主色(基底;4 套配色整体覆盖)—— --primary-ring 为推导值(原型未定义 focus 环) */
  18. --primary: #315acb; --primary-hover: #2548aa; --primary-active: #2548aa;
  19. --primary-subtle: #eaf0ff; --primary-content: #ffffff; --primary-ring: rgb(49 90 203 / .35);
  20. /* 导航族(随配色整套变化) */
  21. --nav-surface: #18243a; --nav-ink: #f3f6fc; --nav-text: #c4cfdf; --nav-muted: #9aadc8;
  22. --nav-line: #30405a; --nav-hover: #24334d; --nav-active: #2c4167;
  23. --nav-accent: #b4ccff; --nav-brand: #4269d8; --nav-on-brand: #ffffff;
  24. /* 辅助族 */
  25. --metric-fill: #5476ca;
  26. --avatar-ink: #46618c; --avatar-bg: #eaf0fa; --avatar-ink-alt: #596780; --avatar-bg-alt: #edf0f5;
  27. --neutral: #687385; --neutral-soft: #eff1f5;
  28. --overlay: #18223966; --overlay-strong: #182239d9;
  29. /* 深色遮罩上的前景色:明暗主题下都保持浅色(灯箱/全屏预览用) */
  30. --on-overlay: #ffffff;
  31. --on-overlay-soft: rgb(255 255 255 / .14);
  32. --on-overlay-hover: rgb(255 255 255 / .24);
  33. /* 字号:锁定 8 档(名称 = 底座,数值 = 原型) */
  34. --fs-11: 11px; --fs-12: 12px; --fs-13: 13px; --fs-14: 14px;
  35. --fs-15: 14px; --fs-17: 16px; --fs-20: 20px; --fs-26: 28px; --fs-42: 36px;
  36. /* 圆角:锁定 4 档 */
  37. --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-tag: 999px;
  38. /* 动效(底座无此层,由原型引入) */
  39. --motion-fast: 120ms; --motion-page: 160ms; --motion-detail: 200ms;
  40. --motion-panel: 240ms; --motion-exit: 160ms;
  41. --ease-standard: cubic-bezier(.2, 0, 0, 1);
  42. /* 阴影四级(色基取原型,结构沿用底座;修复底座暗色不可见缺陷) */
  43. --shadow-soft: 0 1px 2px rgb(23 36 60 / .04), 0 4px 12px rgb(23 36 60 / .06);
  44. --shadow-card: 0 1px 2px rgb(23 36 60 / .05), 0 8px 24px rgb(23 36 60 / .07);
  45. --shadow-pop: 0 4px 8px rgb(23 36 60 / .08), 0 16px 32px rgb(23 36 60 / .12);
  46. --shadow-overlay: 0 8px 16px rgb(23 36 60 / .1), 0 24px 48px rgb(23 36 60 / .18);
  47. /* 布局令牌 —— 前缀用 --desk-/--mob-(--dk- 是存量禁用前缀);--desk-nav-w* 已随竖栏废弃 */
  48. --desk-topbar-h: 56px; --desk-tree-w: 280px; --desk-nav-w: 200px; --desk-nav-w-compact: 176px; --desk-nav-w-icon: 72px;
  49. --desk-list-w: 274px; --desk-list-w-compact: 244px; --desk-list-w-narrow: 250px;
  50. --desk-main-min-w: 480px; --desk-aside-w: 320px; --desk-aside-w-compact: 300px;
  51. /*
  52. * 2026-11-23 移动端空间优化:
  53. * navbar 60 → 52。44px 是无障碍最小触摸区(--touch-min),
  54. * 52 = 44 按钮 + 上下各 4 呼吸,仍满足可点性,只砍掉纯装饰性留白。
  55. * tabbar 不动(底部还要塞安全区,64 是底线)。
  56. */
  57. --mob-navbar-h: 52px; --mob-tabbar-h: 64px; --mob-gutter: 16px;
  58. --mob-safe-top: env(safe-area-inset-top, 0px);
  59. --mob-safe-bottom: env(safe-area-inset-bottom, 0px);
  60. --touch-min: 44px; /* 无障碍硬约束,非设计偏好 */
  61. /* 页面最大宽度(《双端布局规范》v2.1 §2.4)—— 窗口更宽时居中留白,避免超宽屏内容拉散 */
  62. --page-max-w: 1440px; /* 通用/仪表盘类 */
  63. --page-max-w-narrow: 980px; /* 阅读型(事件流) */
  64. --page-max-w-settings: 1240px; /* 设置页 */
  65. }
  66. /* 暗色:--inverse 与 --primary-content 同源统一(评审 A5) */
  67. .dark {
  68. --canvas: #11151c; --surface: #191f29; --surface-2: #1e2531; --surface-hover: #2a3342;
  69. --surface-active: #333c4c; --rail-surface: #141b26;
  70. --edge: #2d3747; --edge-strong: #414f65;
  71. --ink: #edf1f8; --ink-2: #b8c2d2; --muted: #98a6bc; --inverse: #14203b;
  72. --success: #8ed2ac; --success-subtle: #1d352c;
  73. --warning: #e8bf77; --warning-subtle: #382f22;
  74. --danger: #f2a0a5; --danger-subtle: #3b272f; --on-danger: #3b272f;
  75. --info: #acc9fa; --info-subtle: #273a55;
  76. --primary: #93b5ff; --primary-hover: #b0c9ff; --primary-active: #93b5ff;
  77. --primary-subtle: #253451; --primary-content: #14203b; --primary-ring: rgb(147 181 255 / .4);
  78. --nav-surface: #0c1320; --nav-hover: #1a2940; --nav-active: #243957; --nav-line: #25324a;
  79. --metric-fill: #a8c2ff;
  80. --avatar-ink: #b7cdf2; --avatar-bg: #2b3b56; --avatar-ink-alt: #bac7db; --avatar-bg-alt: #2d3748;
  81. --neutral: #acb7c9; --neutral-soft: #2b3341;
  82. --overlay: #070b12a6; --overlay-strong: #070b12e6;
  83. --on-overlay: #ffffff; --on-overlay-soft: rgb(255 255 255 / .14); --on-overlay-hover: rgb(255 255 255 / .24);
  84. --shadow-soft: 0 1px 2px rgb(0 0 0 / .3), 0 4px 12px rgb(0 0 0 / .28); --shadow-card: 0 1px 2px rgb(0 0 0 / .34), 0 8px 24px rgb(0 0 0 / .32);
  85. --shadow-pop: 0 4px 8px rgb(0 0 0 / .38), 0 16px 32px rgb(0 0 0 / .34); --shadow-overlay: 0 8px 16px rgb(0 0 0 / .42), 0 24px 48px rgb(0 0 0 / .4);
  86. }