/* ==========================================================================
   上海世佳特科技有限公司 — Light theme
   theme-light.css : 浅色主题覆盖层
   --------------------------------------------------------------------------
   结构：
     1. 调色板与语义令牌（:root[data-theme="light"]）
     2. 浏览器级外观（滚动条 / 选中 / 扫描线）
     3. 背景层（网格 / 光晕 / 聚光）
     4. 按钮 / 标签 / 图标块
     5. 页头与抽屉
     6. 实时看板（卡片 / 图表 / 指标 / 日志）
     7. 成效对比条 / 基准线
     8. 表单与状态
     9. 表格 / 矩阵 / 层级条 / 地图占位
    10. 内联 SVG（品牌标记 / 曲线 / 面积渐变）

   设计意图：浅色不等于「降对比的白底」——保留发丝描边、等宽标签、编号
   体系与仪器质感，用「白面板 + 冷灰底 + 深青主色 + 琥珀/蓝辅助 + 柔和投影」
   替代深色主题的发光与暗面。主色在浅底上下调到 #0f766e 以满足正文级对比度。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root[data-theme="light"] {
  color-scheme: light;

  /* Surfaces — 冷白 / 冷灰，避免发黄 */
  --bg:            #f6f7f9;
  --bg-soft:       #eef1f5;
  --panel:         #ffffff;
  --panel-2:       #f8fafc;
  --panel-3:       #eef1f6;

  /* Hairlines — 深色底用白描边，浅色底用墨描边 */
  --line:          rgba(13, 18, 28, 0.10);
  --line-strong:   rgba(13, 18, 28, 0.17);
  --line-accent:   rgba(15, 118, 110, 0.34);

  /* Ink */
  --ink:           #0c1118;
  --ink-2:         #47505f;
  --ink-3:         #6b7484;
  --ink-4:         #98a1af;

  /* Accents — 浅底需要更深的色阶才能承载文字级对比 */
  --teal:          #0f766e;
  --teal-soft:     #14b8a6;
  --teal-dim:      #115e59;
  --amber:         #b45309;
  --blue:          #1d4ed8;
  --violet:        #6d28d9;

  --teal-a08:      rgba(15, 118, 110, 0.06);
  --teal-a14:      rgba(15, 118, 110, 0.10);
  --amber-a12:     rgba(180, 83, 9, 0.08);
  --blue-a12:      rgba(29, 78, 216, 0.07);
  --red:           #b42318;
  --red-a10:       rgba(180, 35, 24, 0.07);

  /* Component surfaces that the dark theme hardcodes */
  --chrome-bg:     rgba(255, 255, 255, 0.84);
  --drawer-bg:     rgba(255, 255, 255, 0.97);
  --wash:          rgba(13, 18, 28, 0.035);
  --tint:          rgba(13, 18, 28, 0.028);
  --tint-2:        rgba(13, 18, 28, 0.05);
  --hatch-a:       rgba(13, 18, 28, 0.10);
  --hatch-b:       rgba(13, 18, 28, 0.045);
  --grid-line:     rgba(13, 18, 28, 0.05);
  --scan-line:     rgba(13, 18, 28, 0.022);
  --glow-teal:     rgba(20, 184, 166, 0.16);
  --glow-blue:     rgba(29, 78, 216, 0.10);
  --glow-violet:   rgba(109, 40, 217, 0.09);
  --spot-a:        rgba(15, 118, 110, 0.07);
  --spot-b:        rgba(29, 78, 216, 0.06);
  --dash-a:        #ffffff;
  --dash-b:        #f7f9fb;
  --bar-after-a:   rgba(15, 118, 110, 0.34);
  --bar-after-b:   rgba(15, 118, 110, 0.12);
  --ref-line:      rgba(71, 80, 95, 0.42);
  --on-accent:     #ffffff;
  --sel-ink:       #ffffff;
  --tip-bg:        rgba(255, 255, 255, 0.95);
  --shadow-card:   0 1px 2px rgba(16, 24, 40, 0.05), 0 12px 28px -20px rgba(16, 24, 40, 0.22);
  --shadow-dash:
    0 1px 2px rgba(16, 24, 40, 0.06),
    0 28px 60px -36px rgba(16, 24, 40, 0.32),
    0 0 0 1px rgba(16, 24, 40, 0.03);
  --shadow-pop:    0 18px 40px -20px rgba(16, 24, 40, 0.28);
}

/* --------------------------------------------------------------------------
   2. Browser-level surfaces
   -------------------------------------------------------------------------- */:root[data-theme="light"] ::selection { color: var(--sel-ink); }

:root[data-theme="light"] * { scrollbar-color: #c4cad4 transparent; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c9cfd9; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #b1b9c6; }

:root[data-theme="light"] body::before {
  background: repeating-linear-gradient(0deg, var(--scan-line) 0 1px, transparent 1px 3px);
}

/* --------------------------------------------------------------------------
   3. Background layers
   -------------------------------------------------------------------------- */
:root[data-theme="light"] .bg-grid {
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
}
:root[data-theme="light"] .glow--teal   { background: var(--glow-teal); }
:root[data-theme="light"] .glow--blue   { background: var(--glow-blue); }
:root[data-theme="light"] .glow--violet { background: var(--glow-violet); }
:root[data-theme="light"] .spot {
  background:
    radial-gradient(60% 50% at 50% 0%, var(--spot-a), transparent 70%),
    radial-gradient(40% 40% at 82% 12%, var(--spot-b), transparent 70%);
}

/* --------------------------------------------------------------------------
   4. Buttons / pills / tiles
   -------------------------------------------------------------------------- */
:root[data-theme="light"] .btn--primary {
  color: var(--on-accent);
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.4);
}
:root[data-theme="light"] .btn--primary:hover {
  background: var(--teal-soft);
  color: #05231f;
  box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.55);
}
:root[data-theme="light"] .btn--ghost { background: var(--tint); }
:root[data-theme="light"] .btn--ghost:hover {
  border-color: rgba(13, 18, 28, 0.3);
  background: var(--tint-2);
}
:root[data-theme="light"] .skip { color: var(--on-accent); }
:root[data-theme="light"] .pill { background: var(--tint); }
:root[data-theme="light"] .tag--amber,
:root[data-theme="light"] .pill--amber { border-color: rgba(180, 83, 9, 0.3); }
:root[data-theme="light"] .tag--blue { border-color: rgba(29, 78, 216, 0.25); color: var(--blue); }
:root[data-theme="light"] .itile {
  background: linear-gradient(180deg, #ffffff, #f1f4f8);
  box-shadow: var(--shadow-card);
}
:root[data-theme="light"] .itile--blue { color: var(--blue); }
:root[data-theme="light"] .card { box-shadow: var(--shadow-card); }
:root[data-theme="light"] .card--hover:hover { background: var(--panel-2); }
:root[data-theme="light"] .nav a:hover { background: var(--tint); }
:root[data-theme="light"] .eyebrow::before { box-shadow: none; }
:root[data-theme="light"] .eyebrow--amber::before { box-shadow: none; }
:root[data-theme="light"] .cta-band {
  background:
    radial-gradient(90% 130% at 12% 0%, rgba(15, 118, 110, 0.07), transparent 62%),
    radial-gradient(70% 120% at 95% 100%, rgba(29, 78, 216, 0.06), transparent 60%),
    var(--panel);
}

/* --------------------------------------------------------------------------
   5. Header & drawer
   -------------------------------------------------------------------------- */
:root[data-theme="light"] .header.is-stuck { background: var(--chrome-bg); }
:root[data-theme="light"] .drawer { background: var(--drawer-bg); }
:root[data-theme="light"] .progress { box-shadow: 0 0 10px rgba(15, 118, 110, 0.4); }

/* --------------------------------------------------------------------------
   6. Live dashboard
   -------------------------------------------------------------------------- */
:root[data-theme="light"] .dash {
  background: linear-gradient(180deg, var(--dash-a), var(--dash-b));
  box-shadow: var(--shadow-dash);
}
:root[data-theme="light"] .dash__bar { background: rgba(13, 18, 28, 0.025); }
:root[data-theme="light"] .dash__float {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-pop);
}
:root[data-theme="light"] .mtile { background: rgba(13, 18, 28, 0.022); }
:root[data-theme="light"] .mtile.bump { animation-name: mtile-pulse-light; }
:root[data-theme="light"] .chart {
  background:
    linear-gradient(to bottom, rgba(15, 118, 110, 0.05), transparent 70%),
    rgba(13, 18, 28, 0.02);
}
:root[data-theme="light"] .chart__scan { box-shadow: 0 0 12px 1px rgba(15, 118, 110, 0.35); }
:root[data-theme="light"] .chart__tip {
  background: var(--tip-bg);
  box-shadow: 0 10px 26px -14px rgba(16, 24, 40, 0.45);
}
:root[data-theme="light"] .log { background: var(--wash); }
:root[data-theme="light"] .log__dev { background: rgba(13, 18, 28, 0.05); }
:root[data-theme="light"] .log__tag--info { color: var(--blue); }
:root[data-theme="light"] .chart .cross-dot { stroke: #ffffff; }
@keyframes mtile-pulse-light {
  0%   { box-shadow: 0 0 0 1px var(--line-accent), 0 0 18px -6px rgba(15, 118, 110, 0.35); }
  100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0); }
}

/* --------------------------------------------------------------------------
   7. Benchmark bars
   -------------------------------------------------------------------------- */
:root[data-theme="light"] .bar { background: rgba(13, 18, 28, 0.03); }
:root[data-theme="light"] .bar--before .bar__fill {
  background: repeating-linear-gradient(-45deg, var(--hatch-a) 0 5px, var(--hatch-b) 5px 10px);
}
:root[data-theme="light"] .bar--after .bar__fill {
  background: linear-gradient(90deg, var(--bar-after-a), var(--bar-after-b));
}
:root[data-theme="light"] .bar--after.bar--amber-accent .bar__fill {
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.30), rgba(180, 83, 9, 0.10));
}
:root[data-theme="light"] .bench__ref { border-left-color: var(--ref-line); }

/* --------------------------------------------------------------------------
   8. Forms & states
   -------------------------------------------------------------------------- */
:root[data-theme="light"] .input:hover,
:root[data-theme="light"] .select:hover,
:root[data-theme="light"] .textarea:hover { border-color: rgba(13, 18, 28, 0.3); }
:root[data-theme="light"] .chip span:hover { border-color: rgba(13, 18, 28, 0.32); }
:root[data-theme="light"] .field__err { color: #b42318; }
:root[data-theme="light"] .form-note--err { border-color: rgba(180, 35, 24, 0.28); background: rgba(180, 35, 24, 0.06); }
:root[data-theme="light"] .form-note--err strong { color: #b42318; }
:root[data-theme="light"] .range input[type="range"] {
  background: linear-gradient(90deg, var(--teal) var(--pct, 50%), rgba(13, 18, 28, 0.12) var(--pct, 50%));
}
:root[data-theme="light"] .range input[type="range"]::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}
:root[data-theme="light"] .range input[type="range"]::-moz-range-thumb {
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

/* --------------------------------------------------------------------------
   9. Tables / matrix / level bars / map placeholder
   -------------------------------------------------------------------------- */
:root[data-theme="light"] .kpi { background: var(--tint); }
:root[data-theme="light"] .calc__out { background: rgba(13, 18, 28, 0.028); }
:root[data-theme="light"] .trl i { background: rgba(13, 18, 28, 0.13); }
:root[data-theme="light"] .matrix thead th { background: rgba(13, 18, 28, 0.03); }
:root[data-theme="light"] .lvl i { background: rgba(13, 18, 28, 0.13); }
:root[data-theme="light"] .ctable tbody tr:hover td { background: rgba(13, 18, 28, 0.02); }
:root[data-theme="light"] .info__ico { background: rgba(13, 18, 28, 0.03); }
:root[data-theme="light"] .map__grid {
  background-image:
    linear-gradient(to right, rgba(13, 18, 28, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(13, 18, 28, 0.06) 1px, transparent 1px);
}
:root[data-theme="light"] .checks li::before {
  background-color: rgba(15, 118, 110, 0.08);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.2 2.2L9.5 3.6' fill='none' stroke='%230f766e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
:root[data-theme="light"] .checks--amber li::before {
  background-color: rgba(180, 83, 9, 0.08);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.2 2.2L9.5 3.6' fill='none' stroke='%23b45309' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   10. Inline SVG — tokens instead of hardcoded strokes
   (CSS 覆盖 presentation attribute；深色主题下 token 值不变，视觉零变化)
   -------------------------------------------------------------------------- */
#dashLineA { stroke: var(--teal); }
#dashLineB { stroke: var(--amber); }
#dashDotA  { fill: var(--teal); }
#dashRingA { stroke: var(--teal); }
#areaA stop { stop-color: var(--teal); }
.brand__mark path   { stroke: var(--teal); }
.brand__mark circle { fill: var(--amber); }
.brand__mark rect   { stroke: var(--line-accent); }
:root[data-theme="light"] .chart .target-line { stroke: rgba(180, 83, 9, 0.45); }
:root[data-theme="light"] .chart .target-label { fill: rgba(180, 83, 9, 0.85); }
:root[data-theme="light"] .chart .cross-line { stroke: rgba(12, 17, 24, 0.35); }
