/* ==========================================================================
   方舟量化投研 · 主题皮肤（2026-10-26）
   --------------------------------------------------------------------------
   深色为默认（不加任何属性即为深色，与现状完全一致）；
   浅色由 <html data-theme="light"> 激活，仅重定义 CSS 变量 + 少量硬编码覆盖。

   为什么不重写样式：首页/report.css/复盘内联三套样式均以 CSS 变量为主
   （分别 17/31/12 个），变量覆盖即可整体换肤，风险远低于改写规则。

   变量特异性说明：
     html[data-theme="light"] = (0,1,1)，高于样式里的 :root = (0,1,0)，
     因此即使 theme.css 先于页面内联 <style> 加载，浅色变量仍然生效。
   ========================================================================== */

/* ---------- 1. 浅色主题：基础变量 ---------- */
html[data-theme="light"] {
  color-scheme: light;

  /* 底色：近白微灰，避免纯白刺眼 */
  --bg: #f5f7fa;
  --bg2: #ffffff;
  --panel: #ffffff;
  --panel2: #f7f9fc;

  /* 边框 */
  --border: #e4e9f0;
  --border2: #cdd6e2;

  /* 文字：深灰蓝，非纯黑（纯黑在白底上偏硬） */
  --text: #1a2332;
  --muted: #5a6b7d;
  --muted2: #8b98a8;

  /* 品牌色：金色/青色在白底上需压深才可读 */
  --gold: #9a7415;
  --gold2: #7d5e10;
  --cyan: #0b7fc4;
  --cyan2: #07679e;

  /* 涨跌（A 股惯例：红涨绿跌），浅底需加深 */
  --up: #d6342c;
  --down: #0a7d4f;
  --warn: #b45309;
  --purple: #6d3fd4;

  /* 阴影：深色下是黑雾，浅色下改为淡蓝灰 */
  --shadow: 0 6px 22px rgba(20, 30, 50, .08);

  /* 复盘报告内联样式使用另一组变量名，一并覆盖 */
  --card: #ffffff;
  --card2: #f7f9fc;
  --line: #e4e9f0;
  --txt: #1a2332;
  --txt2: #47576a;
  --txt3: #6b7a8c;
}

/* ---------- 2. 浅色主题：硬编码覆盖 ---------- */

/* 浅色下 body 的径向渐变写死了深色 #13202e，浅色下换成极淡的天光 */
html[data-theme="light"] body {
  background: radial-gradient(1400px 720px at 82% -12%, #eaf2fb 0%, var(--bg) 58%);
}

/* ★导航栏：原为 rgba(10,14,20,.84) 深色毛玻璃，浅色下必须换成白毛玻璃，
   否则页面顶部会是一块突兀的黑条 */
html[data-theme="light"] nav {
  background: rgba(255, 255, 255, .88);
  border-bottom-color: var(--border);
}
html[data-theme="light"] nav a,
html[data-theme="light"] nav .logo {
  color: var(--text);
}
html[data-theme="light"] nav a:hover {
  color: var(--gold2);
}

/* 深色下靠白色微光做分隔/高光的地方，浅色下改为极淡的灰蓝 */
html[data-theme="light"] .wrap,
html[data-theme="light"] section {
  border-color: var(--border);
}

/* 卡片/面板阴影统一走变量，这里兜住直接写死黑色的地方 */
html[data-theme="light"] .card,
html[data-theme="light"] .panel,
html[data-theme="light"] .box,
html[data-theme="light"] .rp-card,
html[data-theme="light"] table {
  box-shadow: 0 1px 2px rgba(20, 30, 50, .04);
}

/* 表格：浅色下需要更明确的分隔线，避免一片白糊在一起 */
html[data-theme="light"] th {
  background: #f0f4f9;
  color: var(--text);
}
html[data-theme="light"] td,
html[data-theme="light"] th {
  border-color: var(--border);
}
html[data-theme="light"] tr:nth-child(even) td {
  background: #fafbfd;
}

/* 代码块 / 行内代码 */
html[data-theme="light"] code,
html[data-theme="light"] pre {
  background: #eef2f7;
  color: #0f3d5c;
  border-color: var(--border);
}

/* 引用块 */
html[data-theme="light"] blockquote {
  background: #f7f9fc;
  border-left-color: var(--gold);
  color: var(--muted);
}

/* 输入框（会员弹窗、搜索） */
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  background: #ffffff;
  color: var(--text);
  border-color: var(--border2);
}

/* 半透明遮罩保持深色，否则弹窗背后一片惨白 */
html[data-theme="light"] #arkMemMask,
html[data-theme="light"] .mask {
  background: rgba(20, 28, 40, .45);
}

/* 滚动条 */
html[data-theme="light"] ::-webkit-scrollbar-track { background: #eef2f7; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c3cedb; }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #a8b6c6; }

/* 语音播报卡 / 图表容器在浅色下的边框 */
html[data-theme="light"] #arkVoice,
html[data-theme="light"] .chart {
  border-color: var(--border);
  background: var(--panel);
}

/* ---------- 3. 复盘报告组件（内联样式里的硬编码深色在此统一接管） ---------- */
/* 这些类名是复盘/深度报告模板的公共组件，55 篇复盘基本一致；
   内联 CSS 把背景写死成深色渐变，变量覆盖管不到，只能按类覆盖。 */

html[data-theme="light"] .rp-tldr,
html[data-theme="light"] .tldr {
  /* 原规则：linear-gradient(160deg, rgba(212,175,55,.07), rgba(18,24,33,.92)) —— 第二层近乎纯深色 */
  background: linear-gradient(160deg, rgba(212, 175, 55, .10) 0%, #eef3fa 100%);
  border-color: #e2d9bf;
}

html[data-theme="light"] .framework {
  background: linear-gradient(135deg, #fdf9ee 0%, #f9f2e0 100%);
  border-color: #e9d9b2;
}

html[data-theme="light"] th {
  background: #edf2f8;
  color: #33414f;
}

html[data-theme="light"] tr:hover td { background: #f6f9fc; }

/* 提示块：note 蓝、warn 红、disc 灰 */
html[data-theme="light"] .note {
  background: #f1f7ff;
  border-color: #d8e6f6;
}
html[data-theme="light"] .warn {
  background: #fff6f5;
  border-color: #f6d9d6;
}
html[data-theme="light"] .disc,
html[data-theme="light"] .disclaimer {
  background: #f7f9fc;
  border-color: #e4e9f0;
}

/* 评级/标签胶囊：半透明底在浅色下会发灰，改为浅底深字 */
html[data-theme="light"] .t-a {
  background: rgba(214, 52, 44, .09);
  color: #b3261e;
  border-color: rgba(214, 52, 44, .26);
}
html[data-theme="light"] .t-b {
  background: rgba(154, 116, 21, .10);
  color: #7d5e10;
  border-color: rgba(154, 116, 21, .26);
}
html[data-theme="light"] .t-c {
  background: rgba(90, 107, 125, .09);
  color: #4a5768;
  border-color: rgba(90, 107, 125, .22);
}
html[data-theme="light"] .t-g {
  background: rgba(11, 127, 196, .09);
  color: #0b6394;
  border-color: rgba(11, 127, 196, .24);
}

/* 代码/等宽块与分隔线 */
html[data-theme="light"] hr { border-color: var(--border); }

/* ★首页大标题（2026-10-26 强哥令：浅色下改为**纯深金色**，取消渐变）
   深色下保持原渐变（#fff→--gold2→--cyan2）不动。
   浅色下：
     - background:none 清掉渐变
     - ⚠ 必须把 -webkit-text-fill-color 重置为实色：原规则设了 transparent，
       不重置的话文字会完全不可见（这是覆盖文字渐变的必做动作）
     - 深金 #8a6a12：白底对比度约 5.2:1，54px 大标题下清晰且不失品牌感
   选择器限定 header h1：文章页标题在 .wrap > .meta > h1，不受影响。 */
html[data-theme="light"] header h1 {
  background: none;
  -webkit-text-fill-color: #8a6a12;
  color: #8a6a12;
}

/* ---------- 3b. 元素级硬编码文字色（复盘模板把 p/td/li 写成浅色，浅底上会看不见） ---------- */
/* 这些是元素选择器（特异性低），html[data-theme] 前缀足以稳定胜出，无需 !important */
html[data-theme="light"] p { color: #2b3a4a; }
html[data-theme="light"] li { color: #2b3a4a; }
html[data-theme="light"] td { color: #33414f; border-color: var(--border); }
html[data-theme="light"] strong,
html[data-theme="light"] b { color: inherit; }

/* TLDR 内文字：原为 #d3dde6（浅灰白） */
html[data-theme="light"] .rp-tldr p,
html[data-theme="light"] .rp-tldr li { color: #26364a; }

/* 核心看点卡：原为 #d6c9a8 / 加粗 #f5d78a（金色系，浅底需压深） */
html[data-theme="light"] .framework p { color: #5b4a24; }
html[data-theme="light"] .framework b,
html[data-theme="light"] .framework strong { color: #7d5e10; }

/* 表格表头文字 */
html[data-theme="light"] th { color: #33414f; }

/* 标题：金色标题在白底上需要更深 */
html[data-theme="light"] h1,
html[data-theme="light"] h2 { color: var(--text); }
html[data-theme="light"] h3,
html[data-theme="light"] h4 { color: var(--gold2); }

/* 涨跌色（浅底加深，保持红涨绿跌惯例） */
html[data-theme="light"] .up,
html[data-theme="light"] .red { color: #c62828; }
html[data-theme="light"] .down,
html[data-theme="light"] .green { color: #0a7d4f; }

/* ---------- 4. 主题切换按钮（深/浅通用样式） ---------- */
.ark-theme-li {
  list-style: none;
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
}

.ark-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border2, #2c3846);
  background: var(--panel2, #161d28);
  color: var(--text, #e6edf3);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .18s, color .18s, background .18s, transform .1s;
}

.ark-theme-btn:hover {
  border-color: var(--gold, #d4af37);
  color: var(--gold2, #f0c75e);
}

.ark-theme-btn:active { transform: scale(.95); }

.ark-theme-btn .ico {
  font-size: 13px;
  line-height: 1;
}

/* 小屏：只留图标，省空间 */
@media (max-width: 720px) {
  .ark-theme-btn .lbl { display: none; }
  .ark-theme-btn { padding: 6px 10px; }
}

/* 打印时隐藏切换按钮 */
@media print {
  .ark-theme-li, .ark-theme-btn { display: none !important; }
}
