/* ============================================================
   镜子 · 共享外观层 skin.css
   - 4 套配色（paper / graphite / cool / dusk）
   - 通用 H5 (移动端) 容器
   - 提交后"图片分享卡"样式（commission share card）
   - 类别 / 命题类型徽章
   ============================================================ */

/* ===== 主题：默认 Paper 已在每个页面 :root 里定义，此处覆盖其它 ===== */
:root[data-theme="graphite"] {
  --paper: #1f1d1b;
  --paper-2: #29262338;
  --paper-3: #2a2724;
  --white: #2b2825;
  --ink: #f3eee5;
  --ink2: #d9d2c5;
  --muted: #8a8580;
  --faint: #5a544c;
  --rule: #3a3530;
  --accent: #d97757;
  --green: #6fbf8f;
  --red: #e76d6d;
  --amber: #e0a456;
  --blue: #7faed4;
}
:root[data-theme="cool"] {
  --paper: #eef2ee;
  --paper-2: #e3eae3;
  --paper-3: #d6e0d6;
  --white: #fafcfa;
  --ink: #1d2725;
  --ink2: #2d3a37;
  --muted: #6c7a76;
  --faint: #b5beb9;
  --rule: #d3dad6;
  --accent: #2c5f8a;
  --green: #2d6a4f;
  --red: #be3a3a;
  --amber: #b87333;
}
:root[data-theme="dusk"] {
  --paper: #f5edf2;
  --paper-2: #ece2e6;
  --paper-3: #e0d4da;
  --white: #fefcfd;
  --ink: #2a212a;
  --ink2: #3d2f3a;
  --muted: #8a7e84;
  --faint: #c4b6bd;
  --rule: #e0d3da;
  --accent: #8a3b65;
  --green: #4a7a5f;
  --red: #be3a3a;
  --amber: #b87333;
}

/* graphite tweaks for paper-grain dots (lighter than light) */
:root[data-theme="graphite"] body {
  background-image:
    radial-gradient(rgba(220, 200, 170, 0.025) 1px, transparent 1px),
    radial-gradient(rgba(220, 200, 170, 0.02) 1px, transparent 1px) !important;
}

/* ============================================================
   主题切换控件（皮肤选择器）
   ============================================================ */
.mo-skin-bar {
  position: fixed;
  right: 18px;
  top: 80px;
  z-index: 999;
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  box-shadow: 4px 4px 0 var(--rule);
  transition: transform 0.25s ease;
}
.mo-skin-bar.collapsed {
  transform: translateX(calc(100% - 38px));
}
.mo-skin-toggle {
  position: absolute;
  left: -1px;
  top: -1px;
  bottom: -1px;
  width: 38px;
  background: var(--accent);
  color: var(--paper);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mo-skin-row {
  display: flex;
  gap: 6px;
  padding-left: 42px;
}
.mo-skin-swatch {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--rule);
  cursor: pointer;
  position: relative;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease;
}
.mo-skin-swatch:hover {
  transform: translate(-1px, -1px);
}
.mo-skin-swatch.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent);
}
.mo-skin-swatch[data-skin="paper"] {
  background: linear-gradient(135deg, #f7f4ef 50%, #b54e2c 50%);
}
.mo-skin-swatch[data-skin="graphite"] {
  background: linear-gradient(135deg, #1f1d1b 50%, #d97757 50%);
}
.mo-skin-swatch[data-skin="cool"] {
  background: linear-gradient(135deg, #eef2ee 50%, #2c5f8a 50%);
}
.mo-skin-swatch[data-skin="dusk"] {
  background: linear-gradient(135deg, #f5edf2 50%, #8a3b65 50%);
}
.mo-skin-label {
  padding-left: 42px;
  color: var(--muted);
  font-size: 9px;
}

/* ============================================================
   命题类型徽章 / 类别徽章 — 注入到报告 hero 区
   ============================================================ */
.mo-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.mo-chip {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  color: var(--ink2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mo-chip-q {
  color: var(--accent);
  border-color: var(--accent);
}
.mo-chip-q::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.mo-chip-cat {
  background: var(--paper-2);
}

/* ============================================================
   Commission Share-Card（提交后导出图片用）
   1080 × 1350 卡片，html2canvas 截图分享
   ============================================================ */
.mo-share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: mo-fade 0.25s ease;
}
.mo-share-overlay.on {
  display: flex;
}
@keyframes mo-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.mo-share-shell {
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-height: 100%;
  width: min(540px, 100%);
}
.mo-share-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.mo-share-actions button,
.mo-share-actions a {
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  letter-spacing: inherit;
  text-transform: inherit;
}
.mo-share-actions .alt {
  background: transparent;
  color: var(--paper);
  border-color: rgba(255, 255, 255, 0.4);
}
.mo-share-close {
  background: transparent !important;
  color: rgba(255, 255, 255, 0.7) !important;
  border-color: transparent !important;
}

/* === The actual card (html2canvas target) === */
.mo-share-card {
  width: 540px;
  aspect-ratio: 4 / 5;
  background: var(--paper);
  background-image:
    radial-gradient(rgba(180, 165, 140, 0.05) 1px, transparent 1px),
    radial-gradient(rgba(180, 165, 140, 0.035) 1px, transparent 1px);
  background-size:
    14px 14px,
    28px 28px;
  background-position:
    0 0,
    7px 7px;
  border: 1.5px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.18);
  padding: 38px 38px 32px;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  position: relative;
  font-family: "Lora", "Noto Serif SC", serif;
}
.mo-share-card::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 36px;
  width: 84px;
  height: 6px;
  background: var(--accent);
}
.sc-hd {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: 26px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.sc-hd .brand {
  color: var(--accent);
  font-weight: 600;
}
.sc-eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}
.sc-statement {
  font-family: "Crimson Pro", "Noto Serif SC", serif;
  font-style: italic;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.32;
  color: var(--ink);
  letter-spacing: -0.012em;
  padding-left: 18px;
  border-left: 3px solid var(--accent);
  margin: 0 0 24px;
}
.sc-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 24px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 18px;
}
.sc-meta-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sc-meta-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.sc-meta-val {
  font-family: "Crimson Pro", "Noto Serif SC", serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}
.sc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.sc-tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  padding: 3px 8px;
  border: 1px solid var(--ink);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.sc-tag.accent {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}
.sc-foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1.5px solid var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.sc-foot-left {
  font-family: "Caveat", cursive;
  font-size: 19px;
  color: var(--accent);
  transform: rotate(-1.2deg);
  line-height: 1.25;
  max-width: 60%;
}
.sc-foot-right {
  text-align: right;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.6;
}
.sc-foot-right .price {
  font-family: "Crimson Pro", serif;
  font-style: italic;
  font-size: 28px;
  color: var(--accent);
  letter-spacing: -0.01em;
  text-transform: none;
}

/* ============================================================
   §05 命题拆解表格修复 — 全局兜底
   症状：结论列复用 .chip(white-space:nowrap)，长句不可断 → 撑爆该列、
   原子命题列塌缩到 1 字宽竖排。按属性级联覆盖各报告内联样式（本文件在
   内联 <style> 之前加载，但 table-layout 内联未声明、.claims-table .chip
   特异度高于 .chip，故此处生效）。
   ============================================================ */
.claims-table {
  table-layout: fixed;
}
.claims-table td {
  overflow-wrap: anywhere;
}
.claims-table .chip {
  white-space: normal;
  line-height: 1.5;
}
/* 移动端：4 列挤进 390px 会再次塌缩竖排，改为按行堆叠成卡片 */
@media (max-width: 640px) {
  .claims-table,
  .claims-table tbody,
  .claims-table tr,
  .claims-table td {
    display: block;
    width: auto !important;
  }
  .claims-table thead {
    display: none;
  }
  .claims-table tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
  }
  .claims-table tr:last-child {
    border-bottom: none;
  }
  .claims-table td {
    padding: 4px 0 !important;
    border: none !important;
  }
  .claims-table .ct-main {
    font-weight: 500;
  }
}

/* ============================================================
   通用 H5 (mobile) — 全局兜底
   ============================================================ */
@media (max-width: 640px) {
  .mo-skin-bar {
    right: 8px;
    top: 60px;
    padding: 6px 8px;
    font-size: 9px;
  }
  .mo-skin-bar .mo-skin-label {
    display: none;
  }
  .mo-skin-toggle {
    width: 28px;
    font-size: 11px;
  }
  .mo-skin-row {
    padding-left: 32px;
    gap: 4px;
  }
  .mo-skin-swatch {
    width: 18px;
    height: 18px;
  }
  .mo-share-card {
    width: 100%;
    padding: 28px 24px 22px;
  }
  .sc-statement {
    font-size: 22px;
  }
  .sc-meta-val {
    font-size: 14px;
  }
  .sc-foot-right .price {
    font-size: 22px;
  }
}

/* ============================================================
   2026-06-11 三版式（debate/dossier/spread）移动端修复 — 全局兜底
   依据：美学 QA 双评审。修法沿用 21db26c 的卡片化思路。
   ============================================================ */

/* 1. 窄表竖排崩溃：dossier 裁定表 table.findings / spread 来源表 table.src */
table.findings { table-layout: fixed; }
table.findings td, table.src td { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  table.findings, table.findings tbody, table.findings tr, table.findings td,
  table.src, table.src tbody, table.src tr, table.src td {
    display: block;
    width: auto !important;
  }
  table.findings thead, table.src thead { display: none; }
  table.findings tr, table.src tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--rule, #d8d2c6);
  }
  table.findings td, table.src td {
    padding: 4px 0 !important;
    border: none !important;
    text-align: left !important;
    white-space: normal !important;
  }
}

/* 2. 移动端 sticky header 叠压：topbar/variant-nav 回归文档流、允许换行 */
@media (max-width: 640px) {
  .topbar {
    position: static !important;
    display: flex !important;
    flex-wrap: wrap;
    gap: 4px 12px;
    height: auto !important;
    padding: 10px 16px !important;
    backdrop-filter: none !important;
  }
  .variant-nav {
    position: static !important;
    flex-wrap: wrap;
    height: auto !important;
  }
}

/* 3. dossier 竖排大标题：移动端横排+缩字号，禁止与 RULING 叠压 */
@media (max-width: 640px) {
  .case-head { display: block !important; }
  .case-q {
    writing-mode: horizontal-tb !important;
    font-size: 30px !important;
    line-height: 1.25 !important;
    max-height: none !important;
    height: auto !important;
    margin-bottom: 20px;
  }
}

/* 5. 右缘 ◐ 收纳条：收起态把手完整可见、加圆角避免"被切坏"观感 */
.mo-skin-bar.collapsed { transform: translateX(calc(100% - 42px)); }
.mo-skin-bar { border-radius: 10px 0 0 10px; overflow: hidden; }

/* 2026-06-11 第二轮移动端补丁（实测截图复查发现） */
@media (max-width: 640px) {
  /* dossier 证据陈列双列 → 堆叠 */
  .exhibits { display: block !important; }
  .exhibits .ex-col { width: auto !important; border-right: none !important; }
  /* spread 大标题超框 */
  .hero-q h1 { font-size: 44px !important; line-height: 1.15 !important; word-break: break-word; }
  /* spread 结论 ribbon 竖排崩溃 → 堆叠 */
  .verdict-ribbon { display: block !important; padding: 24px 20px !important; }
  .ribbon-text { font-size: 22px !important; line-height: 1.4 !important; margin-bottom: 16px; }
}

/* spread two-col 移动端堆叠（第三轮） */
@media (max-width: 640px) {
  .two-col { display: block !important; }
  .two-col article { width: auto !important; }
}

/* debate 发言时间线移动端堆叠（第四轮，最后一处双列） */
@media (max-width: 640px) {
  .turn-inner { display: block !important; }
  .turn-inner .bubble { width: auto !important; margin-bottom: 8px; }
}
