/* ==========================================================================
   豆师傅 CMS — 设计令牌
   --------------------------------------------------------------------------
   这是全站配色的唯一来源。后台「主题管理」修改的
   primary_color / accent_color 会覆盖本文件顶部的两个变量,
   其余色值保持稳定 —— 这是"上一版改主题不用改组件"的实现基础。
   ========================================================================== */

:root {
  /* --- 品牌主色(可由后台覆盖)--- */
  --ds-primary: #8b5a2b;
  --ds-primary-hover: #9e672f;
  --ds-primary-active: #7a4e23;
  --ds-primary-fg: #ffffff;
  --ds-accent: #b5793c;
  --ds-primary-rgb: 139, 90, 43;
  --ds-accent-rgb: 181, 121, 60;

  /* --- 前台暗色表面 --- */
  --ds-canvas: #171721;
  --ds-surface: #1e1e2a;
  --ds-surface-raised: #272735;
  --ds-surface-hover: #22222f;
  --ds-footer: #14141d;

  /* --- 文字 --- */
  --ds-text: #ededf3;
  --ds-text-muted: #c3c3cc;
  --ds-text-bright: #ffffff;
  --ds-text-on-primary: #ffffff;

  /* --- 边框 --- */
  --ds-border: rgba(226, 227, 237, 0.1);
  --ds-border-strong: rgba(226, 227, 237, 0.22);

  /* --- 状态色 --- */
  --ds-success: #4fb37c;
  --ds-success-soft: rgba(79, 179, 124, 0.14);
  --ds-warning: #d9a13f;
  --ds-warning-soft: rgba(217, 161, 63, 0.14);
  --ds-danger: #e0705f;
  --ds-danger-soft: rgba(224, 112, 95, 0.14);
  --ds-info: #6f95e8;
  --ds-info-soft: rgba(111, 149, 232, 0.14);

  /* --- 排版 --- */
  --ds-font: 'Inter', "PingFang SC", "HarmonyOS Sans SC", "MiSans",
             "Noto Sans SC", "Source Han Sans SC",
             "Microsoft YaHei UI", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
  --ds-font-display: var(--ds-font);

  /* 中文排版:字重仅 400/500(中文字体没有中间档,强行用会触发合成加粗) */
  --ds-weight-regular: 400;
  --ds-weight-medium: 500;

  --ds-text-caption: 12px;
  --ds-text-sm: 14px;
  --ds-text-base: 16px;
  --ds-text-lg: 17px;
  --ds-text-xl: 20px;
  --ds-text-h3: 26px;
  --ds-text-h2: 32px;
  --ds-text-h1: 42px;
  --ds-text-display: 58px;

  /* 行高:中文需要比拉丁更宽松 */
  --ds-leading-tight: 1.25;
  --ds-leading-snug: 1.35;
  --ds-leading-normal: 1.7;

  /* --- 间距(4px 基数)--- */
  --ds-space-1: 4px;
  --ds-space-2: 8px;
  --ds-space-3: 12px;
  --ds-space-4: 16px;
  --ds-space-5: 20px;
  --ds-space-6: 24px;
  --ds-space-8: 32px;
  --ds-space-10: 40px;
  --ds-space-14: 56px;
  --ds-space-18: 72px;

  /* --- 圆角 --- */
  --ds-radius-sm: 6px;
  --ds-radius: 12px;
  --ds-radius-lg: 16px;
  --ds-radius-pill: 999px;

  /* --- 布局 --- */
  --ds-container: 1200px;
  --ds-container-narrow: 760px;
  --ds-header-height: 68px;
  /* 前台导航是 position: fixed 的,首屏之外的内页必须自己让出这段高度。
     约等于导航高度(≈76px)+ 首屏下沿的留白。 */
  --ds-nav-offset: 132px;

  /* --- 动效 --- */
  --ds-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ds-duration: 180ms;
  --ds-duration-slow: 320ms;
}

/* 全站变灰(国家公祭日等场合) */
.is-grayscale {
  filter: grayscale(1) contrast(0.95);
}

/* 尊重用户的动效偏好 */
@media (prefers-reduced-motion: reduce) {
  :root {
    --ds-duration: 1ms;
    --ds-duration-slow: 1ms;
  }
}
