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

.gz-hero { margin: 18px 0 14px; padding: 8px 4px 0; }
.gz-hero h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.12; }

.gz-ref { margin-top: 16px; }

.gz-section-head { margin: 4px 0 10px; }
.gz-section-head h2 {
  margin: 0 0 4px;
  font-family: "ZCOOL KuaiLe", "PingFang SC", sans-serif;
  font-size: 1.3rem;
}
.gz-section-head p { margin: 0; color: var(--bark); font-size: 0.86rem; line-height: 1.65; }
.gz-section-head + .gz-section-head { margin-top: 18px; }

.gz-grid {
  display: grid;
  gap: 8px;
  margin: 8px 0 4px;
}
.gz-grid.stems { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.gz-grid.branches { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.gz-card {
  position: relative;
  min-width: 0;
  height: 128px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  perspective: 900px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.gz-grid.branches .gz-card { height: 150px; }

.gz-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.38s ease;
}
.gz-card.flipped .gz-inner { transform: rotateY(180deg); }

.gz-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 5px;
  border: 2px solid var(--gold);
  border-radius: 14px;
  background: #fffdf8;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.gz-front .gz-char {
  display: block;
  font-family: "ZCOOL KuaiLe", "PingFang SC", sans-serif;
  font-size: 2.35rem;
  line-height: 1.05;
}
.gz-front .gz-front-hint {
  display: block;
  margin-top: 2px;
  color: #9a7a52;
  font-size: 0.66rem;
}

.gz-back { transform: rotateY(180deg); }
.gz-back .gz-back-char {
  font-family: "ZCOOL KuaiLe", "PingFang SC", sans-serif;
  font-size: 1.55rem;
  line-height: 1;
}
.gz-back .gz-el {
  display: inline-block;
  min-width: 3.2em;
  margin-top: 2px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(216, 181, 106, 0.22);
  color: #5a3a20;
  font-size: 0.72rem;
  font-weight: 700;
}
.gz-back .gz-yin { color: var(--bark); font-size: 0.68rem; }
.gz-back .gz-extra {
  color: #7a5a3a;
  font-size: 0.62rem;
  line-height: 1.4;
  text-align: center;
}

.gz-card.is-focus .gz-face {
  border-color: #b9862b;
  background: #fff0c7;
  box-shadow: 0 0 0 3px rgba(216, 181, 106, 0.35);
}

.gz-flip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}
.gz-flip-actions button {
  min-height: 38px;
  padding: 6px 12px;
  border: 2px solid var(--gold);
  border-radius: 12px;
  background: #fffdf8;
  font-size: 0.8rem;
}
.gz-flip-actions button:hover { background: #fff1cc; filter: none; }

.gz-legend { margin: 12px 0 0; color: var(--bark); font-size: 0.78rem; }
.gz-legend .el-木, .el-木 { color: #2f6b3d; }
.gz-legend .el-火, .el-火 { color: #a3341f; }
.gz-legend .el-土, .el-土 { color: #7b5320; }
.gz-legend .el-金, .el-金 { color: #8a6b12; }
.gz-legend .el-水, .el-水 { color: #1f4f76; }

.gz-drill { margin-top: 16px; }

.gz-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 4px 0 10px; }
.gz-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 50px;
  padding: 8px 12px;
  border: 2px solid var(--gold);
  border-radius: 12px;
  background: #fffdf8;
  color: var(--ink);
  text-align: left;
}
.gz-tab b { font-family: "ZCOOL KuaiLe", sans-serif; font-size: 0.98rem; }
.gz-tab span { color: var(--bark); font-size: 0.72rem; }
.gz-tab.on { background: var(--moss); color: #f7eed4; }
.gz-tab.on span { color: #ffe6a8; }
.gz-tab.passed { border-color: #3a6b45; }

.gz-progressline { display: flex; justify-content: space-between; gap: 10px; color: var(--bark); font-size: 0.82rem; }
.gz-progressline p { margin: 0; }

.gz-question h2 {
  margin: 8px 0 10px;
  font-family: "ZCOOL KuaiLe", "PingFang SC", sans-serif;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  line-height: 1.45;
}

.gz-target {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin: 8px 0 12px;
  padding: 10px;
  border: 2px dashed var(--gold);
  border-radius: 14px;
  background: #fffdf8;
}
.gz-target .gz-kind { color: var(--bark); font-size: 0.78rem; }
.gz-target .gz-big { font-family: "ZCOOL KuaiLe", sans-serif; font-size: 2.8rem; line-height: 1; }

.gz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gz-option {
  min-height: 46px;
  padding: 9px 12px;
  border: 2px solid var(--gold);
  border-radius: 12px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 0.95rem;
  text-align: left;
}
.gz-option:hover:not(:disabled) { background: #fff1cc; filter: none; }
.gz-option:disabled { cursor: default; opacity: 0.86; }
.gz-option.correct { background: #d9ead6; border-color: #3a6b45; }
.gz-option.wrong { background: #f3d4cc; border-color: #a3341f; }

.gz-feedback { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: #fbf3df; line-height: 1.7; font-size: 0.9rem; }
.gz-feedback.ok { background: #e3efdf; }
.gz-feedback.bad { background: #f6e0da; }
.gz-feedback b { color: #5a3a20; }

.gz-next { margin-top: 12px; min-height: 44px; padding: 8px 18px; border: 2px solid var(--gold); border-radius: 12px; background: var(--moss); color: #f7eed4; }

.gz-result { margin: 8px 0 0; padding: 14px; border: 2px solid #3a6b45; border-radius: 14px; background: #e3efdf; }
.gz-result h2 { margin: 0 0 6px; font-family: "ZCOOL KuaiLe", sans-serif; font-size: 1.2rem; }
.gz-result p { margin: 6px 0; line-height: 1.65; }
.gz-result .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gz-result .actions a, .gz-result .actions button {
  min-height: 42px;
  padding: 8px 14px;
  border: 2px solid var(--gold);
  border-radius: 12px;
  background: var(--moss);
  color: #f7eed4;
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
}
.gz-result .actions .ghost { background: #fffdf8; color: var(--ink); }

.gz-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.gz-actions button, .gz-actions .pill { min-height: 40px; padding: 7px 12px; border-width: 2px; border-radius: 12px; font-size: 0.84rem; }
.gz-actions .ghost { background: #fffdf8; }

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

@media (max-width: 760px) {
  .gz-grid.stems { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .gz-grid.branches { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gz-card { height: 122px; }
  .gz-grid.branches .gz-card { height: 146px; }
  .gz-front .gz-char { font-size: 2rem; }
  .gz-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 430px) {
  .gz-wrap { width: calc(100% - 20px); }
  .gz-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gz-grid.stems { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .gz-grid.branches { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .gz-card { height: 116px; }
  .gz-grid.branches .gz-card { height: 140px; }
  .gz-front .gz-char { font-size: 1.85rem; }
  .gz-back .gz-extra { font-size: 0.58rem; }
  .gz-options { grid-template-columns: 1fr; }
}


.gz-front-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
}
.gz-front-picker span { color: var(--bark); font-size: 0.78rem; }
.gz-front-picker button {
  min-height: 32px;
  padding: 4px 10px;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 0.76rem;
}
.gz-front-picker button.on { background: var(--moss); color: #f7eed4; }
.gz-front-picker button:hover:not(.on) { background: #fff1cc; filter: none; }

.gz-front-label {
  display: block;
  color: #9a7a52;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}
.gz-front-value {
  display: block;
  margin-top: 1px;
  font-family: "ZCOOL KuaiLe", "PingFang SC", sans-serif;
  font-size: 1.9rem;
  line-height: 1.08;
}


.gz-front-value.small { font-size: 1.05rem; letter-spacing: 0; }


.gz-cycle {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px dashed var(--gold);
  border-radius: 12px;
  background: #fffdf8;
}
.gz-cycle h3 {
  margin: 0 0 4px;
  font-family: "ZCOOL KuaiLe", sans-serif;
  font-size: 1rem;
}
.gz-cycle p { margin: 3px 0; color: #5a3a20; font-size: 0.82rem; line-height: 1.6; }
.gz-cycle b { color: #8a5a12; }

.gz-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 8px 0 12px;
}
.gz-pair-card {
  min-width: 96px;
  padding: 10px 12px;
  border: 2px solid var(--gold);
  border-radius: 14px;
  background: #fffdf8;
  text-align: center;
}
.gz-pair-card .gz-kind { display: block; color: var(--bark); font-size: 0.7rem; }
.gz-pair-card .gz-big { display: block; font-family: "ZCOOL KuaiLe", sans-serif; font-size: 2.4rem; line-height: 1.1; }
.gz-pair-vs { color: var(--bark); font-size: 0.78rem; }
.gz-pair.correct .gz-pair-card { border-color: #3a6b45; }
.gz-pair.wrong .gz-pair-card { border-color: #a3341f; }

.gz-options.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 620px) {
  .gz-options.five { grid-template-columns: 1fr 1fr; }
  .gz-pair-card { min-width: 78px; }
  .gz-pair-card .gz-big { font-size: 2rem; }
}


.gz-color-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 10px;
  color: var(--bark);
  font-size: 0.78rem;
}
.gz-color-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 3px 9px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: #fffdf8;
  color: #5a3a20;
  font-size: 0.76rem;
  cursor: pointer;
}
.gz-color-toggle input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--moss);
}

body.no-el-color .el-木,
body.no-el-color .el-火,
body.no-el-color .el-土,
body.no-el-color .el-金,
body.no-el-color .el-水 { color: var(--ink); }
