/* =====================================================================
   कालिन्द Kālinda · 设计令牌
   方向：辞书体。纸是纸，墨是墨，界面上没有一处假装有厚度。

   两套主题是同一张纸的白天与夜晚：
     浅 · 书页（printed paper）
     深 · 夜读（灯关掉之后的同一种纸墨逻辑）
   ===================================================================== */

:root {
  /* ---------- 纸 ---------- */
  --bg:            #FAF7F0;   /* 书页 */
  --bg-deep:       #F3EDE0;   /* 稍深，用于分区 */
  --surface:       #FFFDF9;   /* 词条纸 */
  --surface-1:     #F4EFE3;
  --surface-2:     #E9E1D0;

  /* ---------- 墨 ---------- */
  --text:          #191510;   /* 浓墨 */
  --text-2:        #4E4638;   /* 淡墨 */
  --text-3:        #8B806C;   /* 枯墨 */

  /* ---------- 印 ---------- */
  --primary:       #A32B26;   /* 印泥 */
  --primary-soft:  #F6E7E2;
  --primary-ink:   #7C1D19;

  --accent:        #274A63;   /* 靛 —— 学习中 / 次级操作 */
  --accent-soft:   #E4EBF1;

  --gold:          #96661A;   /* 鎏金 —— 只给成就与完成 */
  --gold-soft:     #F6EBD3;

  /* ---------- 语义色 ----------
     全部降饱和：这一版里颜色只做「标签」，不做「填充」。 */
  --male:          #274A63;
  --male-soft:     #E4EBF1;
  --female:        #8A3B5C;
  --female-soft:   #F4E6EC;
  --common:        #5B4A7E;
  --common-soft:   #ECE8F4;
  --neuter:        #4B5563;
  --neuter-soft:   #EAEDF0;

  --trans:         #2F5D4E;
  --trans-soft:    #E3EDE8;
  --intrans:       #6B6656;
  --intrans-soft:  #EDEAE1;
  --both:          #96661A;
  --both-soft:     #F6EBD3;

  --ok:            #2F5D4E;
  --err:           #A32B26;
  --warn:          #8A5A14;

  /* ---------- 线 ----------
     全站只有三种线：hairline（分隔）、rule（刻线，1.5px 墨）、strong（选中）。 */
  --line:          #DCD3C0;
  --line-soft:     #E9E2D3;
  --line-strong:   #C3B79E;
  --rule-ink:      #2A241C;   /* 刻线：比正文略浅的墨 */

  /* ---------- 阴影 ----------
     纸张是平的。只在浮层上用极淡的投影托一下。 */
  --shadow-sm:     0 1px 0 rgba(42, 36, 28, .04);
  --shadow:        0 1px 2px rgba(42, 36, 28, .06);
  --shadow-lg:     0 18px 48px rgba(42, 36, 28, .14), 0 2px 6px rgba(42, 36, 28, .06);
  --shadow-brand:  none;

  /* ---------- 圆角 ----------
     印刷品不圆。2–6px 只用来软化像素锯齿。 */
  --r-xs: 2px;
  --r-sm: 3px;
  --r:    4px;
  --r-lg: 6px;
  --r-xl: 8px;
  --r-pill: 999px;

  /* ---------- 间距 ---------- */
  --sp-1: 4px;   --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 22px;  --sp-6: 30px;  --sp-7: 44px;  --sp-8: 64px;

  /* ---------- 字体 ----------
     天城体与 IAST 用衬线（自托管，见 fonts.css）；
     中文交给系统 —— 不下载几 MB 的 CJK 字体，也不再依赖 Google。 */
  --font-deva: 'Noto Serif Devanagari', 'Nirmala UI', 'Kohinoor Devanagari', serif;
  --font-en:   'Spectral', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-ui:   -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei',
               'Hiragino Sans GB', 'Segoe UI', Roboto, sans-serif;
  --font-zh:   'Songti SC', 'Noto Serif CJK SC', 'Source Han Serif SC', 'STSong',
               'SimSun', serif;          /* 只给引语、书名、启动页 */
  --font-body: var(--font-ui);
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;

  /* ---------- 字阶 ---------- */
  --t-display: clamp(40px, 7vw, 68px);   /* 天城体词头 */
  --t-h1:      26px;
  --t-h2:      19px;
  --t-h3:      15.5px;
  --t-body:    15.5px;
  --t-small:   13.5px;
  --t-meta:    11px;                     /* 小字距的全大写标签 */
  --lh-body:   1.72;
  --lh-deva:   1.78;                     /* 天城体要留出顶线与元音的余量 */
  --track-meta: .16em;

  /* ---------- 动效 ---------- */
  --ease-out:   cubic-bezier(.22, .61, .36, 1);
  --ease-in-out: cubic-bezier(.65, .05, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --dur-fast:   130ms;
  --dur:        240ms;
  --dur-slow:   440ms;
  --dur-ritual: 900ms;   /* 仪式感动效 */

  /* ---------- 布局 ---------- */
  --sidebar-w: 208px;
  --topbar-h:  58px;
  --content-max: 1120px;
  --measure:    780px;     /* 正文栏宽：超过这个宽度，读起来眼睛会累 */

  /* ---------- 纹理 ---------- */
  --paper-noise: .022;
  --glow: 0;
}

/* =====================================================================
   深色 · 夜读
   同一张纸，灯关了。暖炭黑而不是夜蓝 —— 靛蓝+金的「夜色」太容易撞款。
   ===================================================================== */
:root[data-theme='dark'] {
  --bg:            #141210;
  --bg-deep:       #0D0B0A;
  --surface:       #1B1815;
  --surface-1:     #221E19;
  --surface-2:     #2A251E;

  --text:          #EDE4D4;
  --text-2:        #A79C87;
  --text-3:        #6F6555;

  --primary:       #D9584A;
  --primary-soft:  #33201C;
  --primary-ink:   #F0A196;

  --accent:        #8FB0C9;
  --accent-soft:   #1B2733;

  --gold:          #D9B36A;
  --gold-soft:     #2C2418;

  --male:          #8FB0C9;
  --male-soft:     #1B2733;
  --female:        #D49AB4;
  --female-soft:   #2E2029;
  --common:        #B2A0D8;
  --common-soft:   #241F33;
  --neuter:        #9AA3B0;
  --neuter-soft:   #1E2024;

  --trans:         #7FC3A6;
  --trans-soft:    #16241F;
  --intrans:       #A69C88;
  --intrans-soft:  #221F1A;
  --both:          #D9B36A;
  --both-soft:     #2C2418;

  --ok:            #7FC3A6;
  --err:           #E57C70;
  --warn:          #D9B36A;

  --line:          #2E2822;
  --line-soft:     #241F1A;
  --line-strong:   #443B30;
  --rule-ink:      #C9BFAE;

  --shadow-sm:     0 1px 0 rgba(0, 0, 0, .3);
  --shadow:        0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg:     0 20px 52px rgba(0, 0, 0, .6), 0 2px 8px rgba(0, 0, 0, .4);

  --paper-noise: .045;
  --glow: 1;
}
