/* 升学页（v5，2026-11-01；site_design\网站_v5要求.md 第四节）。只在 guides.html 引入，类名都以 gd- 开头，site.css 不动。
   颜色、字号、间距只用 tokens.css 的变量（二维码底色除外，见最后一节）。
   动画：轻、慢，每段不超过 5 秒，播完停在终态，不循环。
   - 元素的基础样式就是终态；动画只写「从哪里来」（keyframes 只写 from 或前半段）。
   - 进入视口再播：<html> 有 .gd-js 时，没进视口的 .gd-anim 里的动画先暂停（停在开头那一帧），脚本加上 .is-in 再播。
   - 系统设了「减少动态效果」：site.css 统一关掉动画，这里的动画也只写在 no-preference 里，页面直接是终态。 */

/* ===== 1. 页面骨架 ===== */
.gd { padding-bottom: var(--sp-6); }
.gd .section { scroll-margin-top: calc(var(--header-h) + var(--sp-3)); }
.gd .section__head { justify-content: flex-start; align-items: center; gap: var(--sp-2) var(--sp-3); }
.gd-year {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--r-pill);
  background: var(--night-tint); color: var(--night); font-size: var(--fs-14); font-weight: 600; line-height: 1.6; white-space: nowrap;
}

/* 窄屏上一句话只在标点后折行（make_preview 的 gd_nb()，同课程页的 .c5-nb） */
.gd-nb { display: inline-block; }

/* 页内跳转 */
.gd-jump { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); margin-top: var(--sp-2); }
.gd-jump a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 4px; white-space: nowrap;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface);
  font-size: var(--fs-15); font-weight: 600; color: var(--night); transition: border-color var(--t-fast);
}
.gd-jump a:hover { border-color: var(--night); }
@media (max-width: 359px) { .gd-jump a { padding: 0 2px; font-size: var(--fs-14); } }
@media (min-width: 640px) {
  .gd-jump { display: flex; flex-wrap: wrap; }
  .gd-jump a { padding: 0 16px; }
}

/* 白卡、图标格 */
.gd-card { padding: var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); }
@media (min-width: 1024px) { .gd-card { padding: var(--sp-5); } }
.gd-icon { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--r-m); background: var(--night-tint); }
.gd-icon svg { width: 52px; height: 52px; overflow: visible; }
.gd-ico__stroke { fill: none; stroke: var(--night); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.gd-ico__thin { fill: none; stroke: var(--line-strong); stroke-width: 1.6; stroke-linecap: round; }
.gd-ico__line { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; }
.gd-ico__fill { fill: var(--night); }
.gd-ico__me { fill: var(--star); }
.gd-ico__box { fill: var(--surface); stroke: var(--ink-3); stroke-width: 1.6; }

/* 「即将开放」：和课程页同一个样子（☆ + 灰字） */
.gd-state { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.gd-state .star { width: 14px; height: 14px; }

/* ===== 2. 怎么算分（2027 年起） ===== */
.gd-score { display: grid; gap: var(--sp-4); }
.gd-changes { display: grid; gap: var(--sp-3); }
@media (min-width: 1024px) {
  .gd-score { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--sp-5); }
  .gd-changes { grid-auto-rows: 1fr; }   /* 三张小卡平分高度，和右边的分值卡一样高 */
}
.gd-change { display: flex; align-items: center; gap: var(--sp-4); }
.gd-change h3 { font-size: var(--fs-18); font-weight: 700; line-height: var(--lh-title); }
.gd-change p { margin-top: 2px; font-size: var(--fs-15); color: var(--ink-2); }

/* 总分翻牌：740 → 700 */
.gd-flip { position: relative; display: block; height: 1.3em; overflow: hidden; font-size: var(--fs-22); font-weight: 800; line-height: 1.3; color: var(--night); }
.gd-flip__new { display: block; }
.gd-flip__old { position: absolute; left: 0; top: 0; color: var(--ink-3); opacity: 0; transform: translateY(-100%); }

/* 化学：液面从 100 降到 60 */
.gd-flask__liquid { fill: var(--star); }
.gd-flask__was { fill: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-dasharray: 3 3; opacity: .7; }

/* 实验：理化两管有液体，生物学那管空着、虚线 */
.gd-tube__liq { fill: var(--night); }
.gd-tube__liq--3 { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); }
.gd-tube__off { fill: none; stroke: var(--line-strong); stroke-width: 2.4; stroke-dasharray: 4 3; stroke-linecap: round; }

/* 各科分值：横条，一种颜色，变了的化学用金色；条粗 10px，数据端 4px 圆角 */
.gd-bars__title { margin-bottom: var(--sp-3); font-size: var(--fs-17); font-weight: 700; }
.gd-bars { display: grid; gap: var(--sp-2); }
.gd-bars li { display: grid; grid-template-columns: 5.5em minmax(0, 1fr) 4.5em; align-items: center; gap: var(--sp-3); min-height: 28px; font-size: var(--fs-15); color: var(--ink-2); }
.gd-bars__track { position: relative; height: 10px; }
.gd-bars__bar, .gd-bars__was { position: absolute; left: 0; top: 0; height: 100%; border-radius: 0 4px 4px 0; }
.gd-bars__bar { width: calc(var(--v) / 120 * 100%); background: var(--night); opacity: .38; transform-origin: left center; }
.gd-bars__was { width: calc(100% * 100 / 120); background: var(--star); opacity: .22; }
.gd-bars .is-key { color: var(--ink); font-weight: 700; }
.gd-bars .is-key .gd-bars__bar { background: var(--star); opacity: 1; }
.gd-bars__val { justify-self: end; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gd-bars__val s, .gd-total s { margin-right: 6px; font-weight: 400; color: var(--ink-3); }
.gd-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); font-size: var(--fs-17); font-weight: 700; }
.gd-total b { font-size: var(--fs-22); color: var(--night); }
.gd-note { margin-top: var(--sp-2); font-size: var(--fs-14); color: var(--ink-3); }

/* ===== 3. 怎么录取（以 2026 年为例） ===== */
.gd-rules { display: grid; gap: var(--sp-3); }
@media (min-width: 768px) { .gd-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); } }
.gd-rule { display: flex; align-items: flex-start; gap: var(--sp-4); }
.gd-rule h3 { font-size: var(--fs-18); font-weight: 700; line-height: var(--lh-title); }
.gd-rule h3 + * { margin-top: 4px; }
.gd-rule p, .gd-rule li { font-size: var(--fs-15); line-height: var(--lh-body); color: var(--ink-2); }
.gd-list li { position: relative; padding-left: 14px; }
.gd-list li::before { content: ""; position: absolute; left: 2px; top: .78em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); }
.gd-film { margin-top: var(--sp-4); max-width: 520px; }

/* 普通批次图标：灰条是分数，前 4 条进线变夜蓝，金色虚线是分数线 */
.gd-q__base { fill: var(--line-strong); }
.gd-q__in { fill: var(--night); }
.gd-q__cut { fill: none; stroke: var(--star); stroke-width: 2; stroke-dasharray: 4 3; stroke-linecap: round; }
/* 综评图标：绿勾（绿 = 达标，和判题一致） */
.gd-check { fill: none; stroke: var(--ok); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }

/* ===== 4. 时间节点：手机竖排，桌面横排；每个节点往下一个节点画一段线，线停在最后一个节点上 ===== */
.gd-time { display: grid; padding-left: 30px; }
.gd-time li { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 4px 0 var(--sp-4); }
.gd-time li:last-child { padding-bottom: 4px; }
.gd-time li::before, .gd-time li::after { content: ""; position: absolute; left: -22px; top: 14px; bottom: -14px; width: 2px; }
.gd-time li::before { background: var(--line); }
.gd-time li::after { background: var(--night); transform-origin: center top; }
.gd-time li:last-child::before, .gd-time li:last-child::after { content: none; }
.gd-time__dot { position: absolute; z-index: 1; left: -29px; top: 6px; width: 16px; height: 16px; border: 2px solid var(--night); border-radius: 50%; background: var(--surface); }
.gd-time .is-key .gd-time__dot { border-color: var(--star); background: var(--star); box-shadow: 0 0 0 4px var(--star-glow); }
.gd-time__date { font-size: var(--fs-14); font-weight: 600; color: var(--ink-3); }
.gd-time__what { font-size: var(--fs-16); font-weight: 700; color: var(--ink); }
.gd-time .is-key .gd-time__what { color: var(--night); }
@media (min-width: 1024px) {
  .gd-time { grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 30px 0 0; }
  .gd-time li { align-items: center; padding: 0 4px; text-align: center; }
  .gd-time li::before, .gd-time li::after { left: 50%; top: -23px; bottom: auto; width: 100%; height: 2px; }
  .gd-time li::after { transform-origin: left center; }
  .gd-time__dot { left: 50%; top: -30px; margin-left: -8px; }
}

/* ===== 5. 按区择校：四个区用单选切换（纯 CSS，不靠脚本） ===== */
.gd-areas { position: relative; }
.gd-areas__q { margin-bottom: var(--sp-2); font-size: var(--fs-16); font-weight: 700; color: var(--ink); }
.gd-radio { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.gd-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
@media (min-width: 640px) { .gd-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gd-pick label {
  display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 var(--sp-3);
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface);
  font-size: var(--fs-16); font-weight: 600; color: var(--ink-2); text-align: center; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.gd-pick label:hover { border-color: var(--night); color: var(--night); }
#ga-nh:checked ~ .gd-pick [for="ga-nh"], #ga-cc:checked ~ .gd-pick [for="ga-cc"],
#ga-sd:checked ~ .gd-pick [for="ga-sd"], #ga-gs:checked ~ .gd-pick [for="ga-gs"] { background: var(--night); border-color: var(--night); color: var(--surface); }
#ga-nh:focus-visible ~ .gd-pick [for="ga-nh"], #ga-cc:focus-visible ~ .gd-pick [for="ga-cc"],
#ga-sd:focus-visible ~ .gd-pick [for="ga-sd"], #ga-gs:focus-visible ~ .gd-pick [for="ga-gs"] { outline: 2px solid var(--focus); outline-offset: 2px; }
.gd-area { display: none; margin-top: var(--sp-3); }
#ga-nh:checked ~ #gp-nh, #ga-cc:checked ~ #gp-cc, #ga-sd:checked ~ #gp-sd, #ga-gs:checked ~ #gp-gs { display: block; }

.gd-area__head { display: flex; flex-direction: column; gap: var(--sp-3); }
@media (min-width: 768px) { .gd-area__head { flex-direction: row; align-items: center; justify-content: space-between; } }
.gd-area__title { font-size: var(--fs-22); font-weight: 700; line-height: var(--lh-tight); color: var(--night); }
/* 区的择校思路视频：还没有，虚线框 + 即将开放 */
.gd-areavideo { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; padding: var(--sp-2) var(--sp-4) var(--sp-2) var(--sp-2); border: 1px dashed var(--line-strong); border-radius: var(--r-m); }
.gd-areavideo__media { flex: none; display: grid; place-items: center; width: 96px; aspect-ratio: 16 / 9; border-radius: var(--r-s); background: var(--surface-2); color: var(--ink-3); }
.gd-areavideo__media svg, .gd-school__play svg { width: 16px; height: 16px; fill: currentColor; }
.gd-areavideo__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gd-areavideo__text b { font-size: var(--fs-16); color: var(--ink); }
.gd-areavideo__text > span { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: var(--fs-14); color: var(--ink-3); }

.gd-sub { margin-top: var(--sp-4); }
.gd-sub + .gd-sub { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.gd-sub__title { margin-bottom: 4px; font-size: var(--fs-18); font-weight: 700; color: var(--night); }
.gd-sub__lead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--sp-2); margin-bottom: var(--sp-3); font-size: var(--fs-17); font-weight: 600; color: var(--ink); }
.gd-group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: var(--sp-4) 0 var(--sp-2); font-size: var(--fs-15); font-weight: 700; color: var(--ink-2); }
.gd-schools { display: grid; gap: var(--sp-2); }
@media (min-width: 640px) { .gd-schools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .gd-schools { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* 每所学校：视频分析的位置，虚线框 + 即将开放（data-video 是以后接视频的键） */
.gd-school { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; column-gap: var(--sp-3); row-gap: 2px; min-width: 0; padding: 10px var(--sp-3); border: 1px dashed var(--line-strong); border-radius: var(--r-m); }
.gd-school__play { grid-row: 1 / span 2; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); color: var(--ink-3); }
.gd-school__name { font-size: var(--fs-16); font-weight: 600; line-height: var(--lh-title); color: var(--ink); overflow-wrap: anywhere; }
.gd-school__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: var(--fs-14); color: var(--ink-3); }
.gd-tag { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: var(--r-pill); background: var(--night-tint); color: var(--night); font-size: var(--fs-14); font-weight: 600; line-height: 1.6; vertical-align: 1px; white-space: nowrap; }

/* ===== 6. 联系入口（默认关闭；开关在 tools/make_preview.py 的 GD_CONTACT） ===== */
.gd-contact__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.gd-contact__title { font-size: var(--fs-18); font-weight: 700; }
.gd-contact__id { margin-top: 4px; font-size: var(--fs-16); color: var(--ink-2); }
.gd-contact__id b { color: var(--ink); -webkit-user-select: all; user-select: all; }
/* 二维码要白底才扫得出来，深色模式也一样，所以这里用 #fff */
.gd-contact__qr { width: 132px; height: 132px; padding: 6px; border-radius: var(--r-s); background: #fff; }

/* ===== 7. 动画 ===== */
.gd-js .gd-anim:not(.is-in) *, .gd-js .gd-anim:not(.is-in) *::before, .gd-js .gd-anim:not(.is-in) *::after { animation-play-state: paused; }

@media (prefers-reduced-motion: no-preference) {
  /* 总分翻牌 */
  .gd-flip__old { animation: gd-flip-out 2.6s cubic-bezier(.5, 0, .2, 1) .2s both; }
  .gd-flip__new { animation: gd-flip-in 2.6s cubic-bezier(.5, 0, .2, 1) .2s both; }
  /* 化学液面下降，旧液面留一条虚线 */
  .gd-flask__liquid { animation: gd-flask 2.6s cubic-bezier(.45, 0, .2, 1) .3s both; }
  .gd-flask__was { animation: gd-ghost 2.6s ease .3s both; }
  /* 理化两管灌满，生物学那管倒空 */
  .gd-tube__liq--1, .gd-tube__liq--2 { transform-box: fill-box; transform-origin: 50% 100%; animation: gd-fill 1.4s cubic-bezier(.3, .7, .3, 1) .2s both; }
  .gd-tube__liq--2 { animation-delay: .5s; }
  .gd-tube__liq--3 { animation: gd-drain 2.8s ease-in-out .3s both; }
  /* 各科分值：条依次长出来，化学先长到 100 再降到 60 */
  .gd-bars__bar { animation: gd-bar 1s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 70ms); }
  .gd-bars .is-key .gd-bars__bar { animation: gd-chem 3.4s cubic-bezier(.45, 0, .25, 1) .5s both; }
  .gd-bars__was { animation: gd-was 3.4s ease .5s both; }
  /* 两道门：金点先到名额分配那道门，满了，转去普通批次那道门 */
  .gd-doors__me { animation: gd-me 4.4s cubic-bezier(.45, 0, .25, 1) .3s both; }
  /* 名额分配：名额从高中落进各初中 */
  .gd-quota__lines { animation: gd-appear .6s ease both; }
  .gd-quota__seat { animation: gd-drop .9s cubic-bezier(.3, .7, .3, 1) both; animation-delay: calc(.3s + var(--i) * .22s); }
  /* 普通批次：分数条按高低长出来，分数线落下，线上的录取 */
  .gd-q__bar { transform-box: fill-box; transform-origin: 50% 100%; animation: gd-fill .7s cubic-bezier(.3, .7, .3, 1) both; animation-delay: calc(var(--i) * .12s); }
  .gd-q__cut { animation: gd-cut 1s cubic-bezier(.3, .7, .3, 1) 1.1s both; }
  .gd-q__in { animation: gd-appear .6s ease 2.1s both; }
  /* 综评：打勾 */
  .gd-check { animation: gd-draw 1s cubic-bezier(.4, 0, .2, 1) .4s both; }
  /* 时间线：从报名走到补录，一段一段画过去，走到哪个节点哪个亮 */
  .gd-time li::after { animation: gd-rail-y .68s linear both; animation-delay: calc(.3s + var(--i) * .68s); }
  .gd-time__dot { animation: gd-dot .5s ease-out both; animation-delay: calc(.3s + var(--i) * .68s); }
  /* 换区：淡入 */
  .gd-area { animation: gd-in .35s ease-out both; }
}
@media (prefers-reduced-motion: no-preference) and (min-width: 1024px) {
  .gd-time li::after { animation-name: gd-rail-x; }
}

@keyframes gd-flip-out { 0%, 40% { opacity: 1; transform: none; } }
@keyframes gd-flip-in { 0%, 40% { opacity: 0; transform: translateY(100%); } }
@keyframes gd-flask { 0%, 30% { transform: translateY(-11px); } }
@keyframes gd-ghost { 0%, 45% { opacity: 0; } }
@keyframes gd-fill { from { transform: scaleY(0); } }
@keyframes gd-drain { 0%, 40% { transform: scaleY(1); } }
@keyframes gd-bar { from { transform: scaleX(0); } }
@keyframes gd-chem { 0% { transform: scaleX(0); } 28%, 55% { transform: scaleX(1.6667); } }
@keyframes gd-was { 0%, 55% { opacity: 0; } }
@keyframes gd-me {
  0% { transform: translate(-14px, 22px); }
  28%, 46% { transform: translate(-28px, 19px); }
  62% { transform: translate(-14px, 20px); }
  78% { transform: translate(0, 19px); }
}
@keyframes gd-appear { from { opacity: 0; } }
@keyframes gd-drop { from { transform: none; opacity: 0; } 25% { opacity: 1; } }
@keyframes gd-cut { from { transform: translateY(-20px); opacity: 0; } }
@keyframes gd-draw { from { stroke-dashoffset: 1; } }
@keyframes gd-rail-y { from { transform: scaleY(0); } }
@keyframes gd-rail-x { from { transform: scaleX(0); } }
@keyframes gd-dot { from { border-color: var(--line-strong); background: var(--surface); box-shadow: 0 0 0 0 transparent; } }
@keyframes gd-in { from { opacity: 0; transform: translateY(6px); } }
