:root {
  --gua-ink: #2d2a26;
  --gua-paper: #f7f0df;
  --gua-card: #fffaf0;
  --gua-line: rgba(45, 42, 38, .18);
  --gua-gold: #d8b56a;
}

.gua-wrap { width: min(1120px, calc(100% - 32px)); }

.gua-hero { margin: 18px 0 14px; padding: 8px 4px 0; }
.gua-hero h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.12; }
.gua-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.gua-stats span {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 6px 11px; border: 2px solid rgba(216,181,106,.65);
  border-radius: 999px; color: #f7eed4; background: rgba(42,64,48,.42);
  font-size: .82rem;
}
.gua-stats b { font-family: "ZCOOL KuaiLe", sans-serif; font-size: 1.1rem; color: #ffe6a8; }

.gua-section { margin-top: 16px; padding: 20px 22px; }
.gua-section-head {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  justify-content: space-between; gap: 10px; margin-bottom: 10px;
}
.gua-section-head h2 {
  margin: 0 0 4px; font-family: "ZCOOL KuaiLe", "PingFang SC", sans-serif;
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
}
.gua-section-head p { margin: 0; color: var(--bark); font-size: .86rem; line-height: 1.65; max-width: 48rem; }
.gua-matrix-hint { white-space: nowrap; font-size: .78rem !important; }

.gua-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.gua-filters button {
  min-height: 34px; padding: 5px 11px; border: 2px solid var(--gold);
  border-radius: 999px; background: #fffdf8; color: var(--ink); font-size: .78rem;
}
.gua-filters button.on { background: var(--moss); color: #f7eed4; }
.gua-learned { margin: 0 0 10px; color: var(--bark); font-size: .8rem; }

.gua-core-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
}

.gua-card {
  display: block; width: 100%; min-width: 0; padding: 10px 11px 9px;
  border: 2px solid var(--gold); border-radius: 14px;
  background: var(--gua-card); color: var(--ink);
  text-align: left; box-shadow: 3px 4px 0 rgba(45,42,38,.08);
  cursor: pointer;
}
.gua-card:hover { background: #fff3cf; filter: none; }
.gua-card.is-selected { border-color: #b9862b; box-shadow: 0 0 0 3px rgba(216,181,106,.35); }
.gua-card.is-learned .gc-no::after { content: " · 已看"; color: #3a6b45; font-size: .64rem; }
.gua-card .gc-top { display: flex; justify-content: space-between; gap: 6px; color: var(--bark); font-size: .68rem; }
.gua-card .gc-top b { font-family: "ZCOOL KuaiLe", sans-serif; font-size: .9rem; font-weight: 400; }
.gua-card .gc-main { display: flex; align-items: baseline; gap: 8px; margin: 3px 0 1px; }
.gua-card .gc-char { font-family: "ZCOOL KuaiLe", sans-serif; font-size: 2rem; line-height: 1.05; }
.gua-card .gc-full { color: #6a4a2a; font-size: .72rem; }
.gua-card .gc-lines { margin: 6px 0 5px; }
.gua-card .gc-meaning {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  background: #f2e3bd; color: #5a3a20; font-size: .7rem;
}

.yao-stack { display: flex; flex-direction: column; gap: 3px; }
.yao-row { display: flex; align-items: center; gap: 6px; min-height: 11px; }
.yao-label { width: 1.4em; color: #8a6a4a; font-size: .6rem; text-align: right; }
.yao {
  display: flex; gap: 8px; width: 64px; height: 6px;
}
.yao span { flex: 1; background: var(--gua-ink); border-radius: 2px; }
.yao.yang span:last-child { display: none; }
.yao.small { width: 48px; height: 5px; gap: 6px; }
.yao.big { width: 130px; height: 9px; gap: 12px; }

.gua-detail { min-height: 260px; }
.gua-empty { color: var(--bark); padding: 18px 0; }
.gd-card {
  border: 3px solid var(--gold); border-radius: 18px; background: #fffaf0;
  padding: 16px 18px; box-shadow: 4px 5px 0 rgba(45,42,38,.08);
}
.gd-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.gd-no { color: var(--bark); font-size: .78rem; padding-top: 5px; }
.gd-char {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 76px; min-height: 76px; border: 2px solid var(--gua-ink);
  border-radius: 14px; background: #fff3cf;
  font-family: "ZCOOL KuaiLe", sans-serif; font-size: 2.6rem; line-height: 1;
}
.gd-title { flex: 1 1 260px; min-width: 0; }
.gd-title h2 { margin: 0; font-family: "ZCOOL KuaiLe", sans-serif; font-size: 1.7rem; }
.gd-title p { margin: 4px 0 0; color: #5a3a20; font-size: .84rem; line-height: 1.6; }
.gd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.gd-tag { padding: 2px 8px; border-radius: 999px; background: #f2e3bd; color: #5a3a20; font-size: .72rem; }

.gd-body { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 18px; margin-top: 14px; }
.gd-lines { padding: 10px; border: 1px dashed var(--gua-line); border-radius: 12px; text-align: center; }
.gd-lines .yao-stack { align-items: center; }
.gd-lines .yao-row { justify-content: center; }
.gd-lines .yao-label { width: 1.2em; }
.gd-lines .gd-formula { margin-top: 8px; color: #6a4a2a; font-size: .76rem; }

.gd-copy h3 { margin: 0 0 6px; font-family: "ZCOOL KuaiLe", sans-serif; font-size: 1.15rem; }
.gd-copy p { margin: 6px 0; line-height: 1.7; font-size: .9rem; }
.gd-quote {
  margin: 10px 0; padding: 10px 12px; border-left: 4px solid var(--gold);
  border-radius: 0 10px 10px 0; background: #fff3cf;
  font-size: .9rem; line-height: 1.7;
}
.gd-quote b { color: #8a5a12; }
.gd-misread { color: #7a2a1c; font-size: .84rem; line-height: 1.65; }
.gd-contrast { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.gd-contrast button {
  min-height: 30px; padding: 3px 9px; border: 1px solid var(--gold);
  border-radius: 999px; background: #fffdf8; font-size: .74rem;
}
.gd-formula-box {
  margin-top: 12px; padding: 10px 12px; border: 2px dashed #8a6a4a;
  border-radius: 12px; background: #fff3cf;
  font-family: "ZCOOL KuaiLe", sans-serif; font-size: 1.05rem;
  text-align: center;
}
.gd-note { margin-top: 10px; color: var(--bark); font-size: .78rem; line-height: 1.6; }
.gd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.gd-actions button { min-height: 38px; padding: 6px 12px; border: 2px solid var(--gold); border-radius: 10px; background: var(--moss); color: #f7eed4; font-size: .82rem; }
.gd-actions .ghost { background: #fffdf8; color: var(--ink); }

.gua-matrix-scroll { overflow-x: auto; padding-bottom: 4px; }
.gua-matrix {
  display: grid; grid-template-columns: 34px repeat(8, minmax(54px, 1fr));
  gap: 4px; min-width: 620px;
}
.gua-matrix .mx-head {
  display: flex; align-items: center; justify-content: center;
  color: var(--bark); font-size: .72rem; font-weight: 700;
}
.gua-matrix .mx-corner { font-size: .6rem; color: #9a7a52; }
.mx-tile {
  min-width: 0; min-height: 58px; padding: 4px 3px;
  border: 1px solid rgba(216,181,106,.8); border-radius: 8px;
  background: #fffdf8; color: var(--ink); text-align: center;
  cursor: pointer;
}
.mx-tile:hover { background: #fff3cf; filter: none; }
.mx-tile.is-core { border-color: #b9862b; background: #fffaf0; }
.mx-tile.is-selected { outline: 3px solid rgba(58,107,69,.45); }
.mx-tile .mx-name { display: block; font-family: "ZCOOL KuaiLe", sans-serif; font-size: .78rem; line-height: 1.2; }
.mx-tile .yao-stack { align-items: center; margin-bottom: 2px; }
.mx-tile .yao-row { min-height: 7px; justify-content: center; }
.mx-tile .yao { width: 30px; height: 3px; gap: 4px; }
.mx-tile .yao-label { display: none; }

.gua-quiz-section { margin-bottom: 0; }
.gua-primary {
  min-height: 42px; padding: 8px 16px; border: 2px solid var(--gold);
  border-radius: 12px; background: var(--moss); color: #f7eed4;
  font-family: "ZCOOL KuaiLe", sans-serif; font-size: .9rem;
}
.gua-quiz-panel { margin-top: 12px; }
.gq-progress { display: flex; justify-content: space-between; gap: 10px; color: var(--bark); font-size: .82rem; }
.gq-question { margin: 8px 0 10px; font-family: "ZCOOL KuaiLe", sans-serif; font-size: clamp(1.1rem, 2.3vw, 1.4rem); line-height: 1.5; }
.gq-target {
  margin: 8px 0 12px; padding: 12px; border: 2px dashed var(--gold);
  border-radius: 14px; background: #fffdf8; text-align: center;
}
.gq-target .gq-big { font-family: "ZCOOL KuaiLe", sans-serif; font-size: 2rem; }
.gq-target .gq-quote { font-size: .92rem; line-height: 1.7; }
.gq-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gq-option {
  min-height: 46px; padding: 8px 11px; border: 2px solid var(--gold);
  border-radius: 11px; background: #fffdf8; color: var(--ink);
  font-size: .9rem; text-align: left;
}
.gq-option:hover:not(:disabled) { background: #fff3cf; filter: none; }
.gq-option:disabled { cursor: default; opacity: .88; }
.gq-option.correct { background: #d9ead6; border-color: #3a6b45; }
.gq-option.wrong { background: #f3d4cc; border-color: #a3341f; }
.gq-feedback { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #fbf3df; line-height: 1.7; font-size: .88rem; }
.gq-feedback.ok { background: #e3efdf; }
.gq-feedback.bad { background: #f6e0da; }
.gq-feedback b { color: #5a3a20; }
.gq-next { margin-top: 10px; min-height: 40px; padding: 7px 14px; border: 2px solid var(--gold); border-radius: 11px; background: var(--moss); color: #f7eed4; }
.gq-result { margin-top: 10px; padding: 14px; border: 2px solid #3a6b45; border-radius: 14px; background: #e3efdf; }
.gq-result h3 { margin: 0 0 6px; font-family: "ZCOOL KuaiLe", sans-serif; font-size: 1.2rem; }
.gq-result p { margin: 5px 0; line-height: 1.65; }
.gq-result .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gq-result .actions button { min-height: 40px; padding: 7px 14px; border: 2px solid var(--gold); border-radius: 11px; background: var(--moss); color: #f7eed4; }
.gq-result .actions .ghost { background: #fffdf8; color: var(--ink); }

.gua-note { margin-top: 16px; padding: 18px 20px; }
.gua-note h2 { margin: 0 0 8px; font-family: "ZCOOL KuaiLe", sans-serif; font-size: 1.25rem; }
.gua-note p, .gua-note li { line-height: 1.75; }
.gua-note ol { padding-left: 22px; }
.gua-note b { color: #5a3a20; }

@media (max-width: 900px) {
  .gua-core-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gd-body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .gua-wrap { width: calc(100% - 20px); }
  .gua-section { padding: 15px 14px; }
  .gua-core-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .gua-card .gc-char { font-size: 1.75rem; }
  .gq-options { grid-template-columns: 1fr; }
  .gd-char { min-width: 64px; min-height: 64px; font-size: 2.2rem; }
}


.gua-card .gc-char.long { font-size: 1.55rem; letter-spacing: -0.04em; }
.gd-char.long { font-size: 1.95rem; padding: 0 8px; letter-spacing: -0.05em; }


.gua-hero .kb-kicker {
  margin: 0 0 6px;
  color: #f2d99a;
  font-size: .82rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.gua-hero .kb-sub {
  max-width: 48rem;
  margin: 10px 0 0;
  color: #f7eed4;
  opacity: .94;
  line-height: 1.7;
}
