/* =============================================================================
 *  07-wiki.css — 中国百科（China Wiki）专用样式
 *  ---------------------------------------------------------------------------
 *  只依赖 00-tokens.css 里的变量，不引入任何框架、不写死颜色。
 *  改配色请改 tokens；改百科版式改这里。
 * ========================================================================== */

/* ---------------------------------------------------------------- 百科总页头部 */
.wiki-hero {
  position: relative;
  margin: 0 0 30px;
  padding: 30px 28px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-soft) 0%, transparent 58%),
    var(--paper-2);
  overflow: hidden;
}
.wiki-hero::after {
  content: "百";
  position: absolute;
  inset-inline-end: -14px;
  bottom: -46px;
  font-family: var(--font-display);
  font-size: 190px;
  line-height: 1;
  color: var(--pattern);
  pointer-events: none;
}
.wiki-hero h1 {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  font-size: clamp(25px, 4vw, 38px);
}
.wiki-hero p {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0;
  color: var(--ink-2);
  font-size: 16px;
}
.wiki-hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--muted);
}
.wiki-hero-stats b {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--accent-2);
  margin-inline-end: 4px;
}

/* ---------------------------------------------------------------- 分类卡片网格 */
.wiki-group { margin-bottom: 34px; }
.wiki-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.wiki-group-head h2 { margin: 0; font-size: 19px; }
.wiki-group-head .wiki-group-sub { font-size: 13.5px; color: var(--muted); }

.wiki-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
}

.wiki-card {
  display: block;
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  text-decoration: none;
  color: inherit;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.wiki-card:hover,
.wiki-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-s);
  text-decoration: none;
}
.wiki-card-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 20px;
  line-height: 1;
}
.wiki-card h3 {
  margin: 0 0 5px;
  font-size: 16.5px;
  color: var(--ink);
}
.wiki-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}
.wiki-card-meta {
  display: block;
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--accent-2);
  font-weight: 600;
}
.wiki-card.is-tool .wiki-card-emoji { background: rgba(184, 139, 47, .14); }

/* ---------------------------------------------------------------- 类目页头部 */
.wiki-cat-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 6px;
}
.wiki-cat-emoji {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--accent-soft);
  font-size: 27px;
  line-height: 1;
}
.wiki-cat-head h1 { margin: 0 0 4px; }
.wiki-cat-head p { margin: 0; color: var(--muted); font-size: 15px; }

/* 本页小节快捷导航（类目页顶部） */
.wiki-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 4px;
  padding: 0;
  list-style: none;
}
.wiki-quick a {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
}
.wiki-quick a:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  text-decoration: none;
}

/* 类目页底部：其他类目卡片流 */
.wiki-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin-top: 12px;
}
.wiki-strip a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--paper-2);
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
}
.wiki-strip a:hover { border-color: var(--accent); color: var(--accent-2); text-decoration: none; }
.wiki-strip .wiki-strip-emoji { font-size: 16px; }

/* 返回百科总页 */
.back-link-wrap { margin: 8px 0 0; }
.back-link { font-size: 14px; color: var(--accent-2); text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- 词条小卡片 */
.wiki-entry {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--radius-s);
  background: var(--paper-2);
  margin-bottom: 12px;
}
.wiki-entry h4 {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--ink);
}
.wiki-entry .wiki-entry-sub {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 400;
  margin-inline-start: 8px;
}
.wiki-entry p { margin: 6px 0 0; font-size: 15px; color: var(--ink-2); }
.wiki-entry p:last-child { margin-bottom: 0; }

/* 语种提示：默认隐藏，只有非中文读者才由 JS 打开（避免中文用户看到一闪而过的提示） */
#wiki-hint { display: none; }
#wiki-hint.show { display: block; }

/* ---------------------------------------------------------------- 六爻工具 */
.liuyao-wrap { margin-top: 8px; }

.liuyao-step {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  margin-bottom: 14px;
}
.liuyao-step > h3 {
  margin: 0 0 10px;
  font-size: 16px;
}
.liuyao-step .step-no {
  display: inline-block;
  min-width: 22px;
  height: 22px;
  margin-inline-end: 8px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  line-height: 22px;
  text-align: center;
  font-family: var(--font-body);
}

/* 场景选择 */
.liuyao-scenes {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.liuyao-scene {
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--paper);
  color: var(--ink);
  font-size: 14.5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.liuyao-scene:hover { border-color: var(--accent); }
.liuyao-scene.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-2);
  font-weight: 600;
}
.liuyao-scene .scene-emoji { display: block; font-size: 20px; margin-bottom: 4px; }

/* 摇卦按钮 */
.liuyao-cast {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.liuyao-hint { font-size: 13.5px; color: var(--muted); }
.liuyao-progress {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 13.5px;
  color: var(--muted);
}
.liuyao-progress i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--line);
  display: inline-block;
}
.liuyao-progress i.on { background: var(--accent); }

/* 卦象盘面（自下而上：初爻在最下） */
.liuyao-lines { margin-top: 14px; }
.liuyao-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
}
.liuyao-line .line-name {
  flex: 0 0 62px;
  font-size: 13px;
  color: var(--muted);
  text-align: inline-end;
}
.liuyao-line .line-bar {
  flex: 1 1 auto;
  height: 14px;
  display: flex;
  gap: 10px;
}
.liuyao-line .bar {
  flex: 1 1 0;
  height: 14px;
  border-radius: 3px;
  background: var(--ink);
}
/* 阴爻：断开的两段 */
.liuyao-line.is-yin .line-bar { background: transparent; }
.liuyao-line.is-yin .bar { background: var(--ink); }
.liuyao-line.is-yin .line-bar::after {
  content: "";
  position: absolute;
  width: 22%;
  height: 14px;
  background: var(--paper-2);
}
.liuyao-line .line-tag {
  flex: 0 0 auto;
  min-width: 74px;
  font-size: 12.5px;
  font-weight: 600;
}
.liuyao-line.is-move .line-tag { color: var(--accent-2); }
.liuyao-line.is-move .bar { box-shadow: 0 0 0 2px var(--accent) inset; }

/* 本卦 / 变卦 */
.liuyao-result {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 10px;
}
.liuyao-gua {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.liuyao-gua .gua-label {
  font-size: 12.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.liuyao-gua .gua-symbol {
  font-size: 46px;
  line-height: 1.1;
  color: var(--accent-2);
  margin: 2px 0;
}
.liuyao-gua .gua-name {
  font-family: var(--font-display);
  font-size: 21px;
  margin: 0 0 2px;
}
.liuyao-gua .gua-wuxing { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.liuyao-gua .gua-ci {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--ink);
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
}
.liuyao-gua .gua-xiang { font-size: 14.5px; color: var(--ink-2); margin: 8px 0 0; }
.liuyao-gua .gua-yi { font-size: 14.5px; color: var(--ink-2); margin: 6px 0 0; }

/* ------------------------------------------------------- 动爻爻辞（经文原文） */
.liuyao-yaoci {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.liuyao-yaoci h4 { margin: 0 0 8px; font-size: 15px; }
.liuyao-yaoci .yaoci-list { list-style: none; margin: 0; padding: 0; }
.liuyao-yaoci .yaoci-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px dashed var(--line);
  font-size: 14.5px;
  line-height: 1.75;
}
.liuyao-yaoci .yaoci-list li:first-child { border-top: 0; }
.liuyao-yaoci .yaoci-name { font-weight: 700; color: var(--ink); flex: 0 0 auto; }
.liuyao-yaoci .yaoci-tag {
  flex: 0 0 auto;
  font-size: 12px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong, var(--accent));
}
.liuyao-yaoci .yaoci-text {
  flex: 1 1 260px;
  font-family: var(--font-display);
  color: var(--ink-2);
}

.liuyao-verdict {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border-inline-start: 4px solid var(--accent);
  background: var(--accent-soft);
}
.liuyao-verdict.is-good { border-inline-start-color: var(--ok); background: rgba(47,122,79,.08); }
.liuyao-verdict.is-bad { border-inline-start-color: var(--danger); background: rgba(179,38,30,.08); }
.liuyao-verdict.is-flat { border-inline-start-color: var(--warn); background: rgba(179,112,26,.09); }
.liuyao-verdict h4 { margin: 0 0 6px; font-size: 16px; }
.liuyao-verdict p { margin: 0 0 8px; font-size: 15px; color: var(--ink-2); }
.liuyao-verdict p:last-child { margin-bottom: 0; }
.liuyao-verdict .v-ci {
  font-family: var(--font-display);
  font-size: 14.5px;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed var(--line);
}
.liuyao-verdict .v-main { font-size: 15.5px; line-height: 1.85; color: var(--ink); }
.liuyao-verdict .v-trend {
  font-size: 15px;
  line-height: 1.85;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.liuyao-reset { margin-top: 14px; }

/* ---------------------------------------------------------------- 白话总说 */
/* 结果区最下面的一整块：把结论、卦象、爻辞、体用、应期、建议综合成大白话 */
.ly-plain {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2, var(--paper));
}
.ly-plain-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--ink);
}
.ly-plain-lead {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-2);
}
.ly-plain-sec { margin: 0 0 15px; }
.ly-plain-sec:last-child { margin-bottom: 0; }
.ly-plain-sec h5 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--accent-strong, var(--accent));
}
.ly-plain-sec h5::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.ly-plain-sec p {
  margin: 0;
  font-size: 15px;
  line-height: 1.95;
  color: var(--ink);
}

/* ======================================================== 综合结论卡（置顶） */
.ly-final {
  margin: 0 0 18px;
  padding: 18px 20px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-inline-start: 4px solid var(--muted);
  background: var(--paper-2, var(--paper));
}
.ly-final.is-good { border-inline-start-color: var(--ok); background: rgba(47,122,79,.09); }
.ly-final.is-flat { border-inline-start-color: var(--warn); background: rgba(179,112,26,.10); }
.ly-final.is-bad { border-inline-start-color: var(--danger); background: rgba(179,38,30,.09); }

.ly-final-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ly-badge {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 6px 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--muted);
}
.is-good .ly-badge { background: #2f7a4f; }
.is-flat .ly-badge { background: #b3701a; }
.is-bad  .ly-badge { background: #b3261e; }
.ly-final-sub { font-size: 13px; color: var(--ink-2); }

.ly-final-title {
  margin: 14px 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .08em;
}
.ly-head {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.95;
  color: var(--ink);
}

/* 三项指标 */
.ly-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}
.ly-metric { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.ly-metric .m-label { color: var(--muted); font-weight: 700; }
.ly-metric .m-bar {
  display: inline-block;
  width: 120px;
  height: 8px;
  border-radius: 999px;
  background: rgba(120,120,120,.22);
  overflow: hidden;
}
.ly-metric .m-bar i { display: block; height: 100%; border-radius: 999px; background: var(--muted); }
.is-good .ly-metric .m-bar i { background: #2f7a4f; }
.is-flat .ly-metric .m-bar i { background: #b3701a; }
.is-bad  .ly-metric .m-bar i { background: #b3261e; }
.ly-metric .m-val { font-weight: 700; color: var(--ink); min-width: 38px; }
.ly-metric .m-chip {
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--paper-3, rgba(128,128,128,.12));
  color: var(--ink);
  font-weight: 700;
}

.ly-speed, .ly-yq {
  margin: 10px 0 0;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-2);
}
.ly-speed b, .ly-yq b { color: var(--ink); }

/* 行动建议 */
.ly-advice { margin-top: 14px; }
.ly-advice h5, .ly-var h5, .ly-lei h5 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.ly-advice ul { list-style: none; margin: 0 0 10px; padding: 0; }
.ly-advice li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink);
  padding: 5px 0;
}
.ad-mark {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}
.ad-mark.do { background: #2f7a4f; }
.ad-mark.no { background: #b3261e; }
.ly-avoid li { color: var(--ink-2); }

/* 变数所在 */
.ly-var { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ly-var .var-list { list-style: none; margin: 0; padding: 0; }
.ly-var .var-list li {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink-2);
  padding: 4px 0;
}
.ly-var .var-list b { color: var(--ink); }
.ly-var p { margin: 0; font-size: 14.5px; line-height: 1.8; color: var(--ink-2); }

/* 类象提示 */
.ly-lei { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ly-lei .lei-list { margin: 0; display: grid; gap: 6px; }
.ly-lei .lei-row { display: flex; gap: 10px; font-size: 14.5px; line-height: 1.75; }
.ly-lei dt { flex: 0 0 48px; font-weight: 700; color: var(--muted); margin: 0; }
.ly-lei dd { margin: 0; color: var(--ink-2); }

/* 评分明细 */
.ly-score {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2, var(--paper));
}
.ly-score summary { cursor: pointer; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.ly-score .score-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 8px;
  font-size: 13.5px;
}
.ly-score .score-table th {
  text-align: start;
  padding: 6px 8px;
  font-size: 12.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.ly-score .score-table td { padding: 7px 8px; border-bottom: 1px dashed var(--line); vertical-align: top; }
.ly-score .s-name { font-weight: 700; color: var(--ink); white-space: nowrap; }
.ly-score .s-src { color: var(--ink-2); line-height: 1.7; }
.ly-score .s-num { font-weight: 700; text-align: center; white-space: nowrap; }
.ly-score .s-num.up { color: #2f7a4f; }
.ly-score .s-num.down { color: #b3261e; }
.ly-score .s-num.zero { color: var(--muted); }
.ly-score .s-w { color: var(--muted); text-align: center; white-space: nowrap; }
.ly-score .score-note {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 700px) {
  .wiki-hero { padding: 22px 18px 20px; }
  .wiki-hero::after { font-size: 130px; bottom: -32px; }
  .wiki-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .wiki-cat-emoji { width: 44px; height: 44px; font-size: 22px; }
  .liuyao-line .line-name { flex-basis: 52px; font-size: 12px; }
  .liuyao-line .line-tag { min-width: 60px; font-size: 12px; }
  .ly-final { padding: 14px 15px 12px; }
  .ly-badge { font-size: 16px; padding: 5px 12px; }
  .ly-head { font-size: 15px; }
  .ly-metric .m-bar { width: 84px; }
  .ly-lei .lei-row { flex-direction: column; gap: 2px; }
  .ly-lei dt { flex: none; }
  .ly-score .score-table { font-size: 12.5px; }
  .ly-score .s-src { line-height: 1.6; }
}
