/* 设计 page */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.center-cta { display: flex; justify-content: center; margin-top: 32px; }

/* ---- 24 h dial ---- */
.dial-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.dial-box { position: relative; width: min(100%, 520px); aspect-ratio: 1; justify-self: center; }
.dial { width: 100%; height: 100%; overflow: visible; touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none; }
.dial .knob-hit { fill: transparent; touch-action: none; }
.dial:active { cursor: grabbing; }
.dial:focus-visible { outline: none; }
.dial:focus-visible .knob { stroke: var(--accent); stroke-width: 4; }
.dial .tick { stroke: var(--text-3); stroke-width: 1.2; }
.dial .tick.major { stroke: var(--text-2); stroke-width: 2; }
.dial .hl { fill: var(--text-2); font: 500 12px var(--sans); }
.dial .ev { stroke: var(--text); stroke-width: 2; }
.dial .ev.flip { stroke: var(--accent); stroke-dasharray: 3 3; }
.dial .evl { fill: var(--text-2); font: 11px var(--sans); }
.dial .knob { fill: var(--raised); stroke: var(--text); stroke-width: 2.5; filter: drop-shadow(0 6px 10px rgb(0 0 0 / .25)); }
.dial .knob-dot { fill: var(--accent); }
.dial .now { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 2 3; }
.dial-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.dial-center b { font: 700 clamp(44px, 6vw, 72px)/1 var(--serif); font-variant-numeric: tabular-nums; }
.dial-center span { margin-top: 10px; font: 700 20px/1.2 var(--serif); color: var(--accent); }
.dial-center small { margin-top: 6px; font-size: 13px; color: var(--text-2); }
.dial-side .h2 { margin-top: 14px; }
.dial-side .lede { margin-top: 18px; }
.tokens { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; margin: 28px 0 24px; }
.tok { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.tok i { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); }
.tok span { color: var(--text-2); }
.tok code { font-size: 12px; color: var(--text); }
.tok-cr { grid-column: 1 / -1; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---- sun chart ---- */
.sun-card { margin-top: 40px; padding: clamp(18px, 3vw, 32px); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.sun-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sun-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.sun-presets button { height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line); font-size: 14px; color: var(--text-2); background: var(--bg); transition: all .2s; }
.sun-presets button[aria-pressed='true'] { background: var(--text); color: var(--bg); border-color: var(--text); }
.sun-range { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--text-2); flex: 1; min-width: 260px; max-width: 460px; }
.sun-range span { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; min-width: 6.5em; }
input[type='range'] { -webkit-appearance: none; appearance: none; flex: 1; height: 28px; background: transparent; cursor: pointer; }
input[type='range']::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line); }
input[type='range']::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: var(--accent); border: 3px solid var(--raised); box-shadow: 0 2px 8px rgb(0 0 0 / .25); }
input[type='range']::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid var(--raised); }
.sun-chart { width: 100%; height: clamp(220px, 30vw, 330px); display: block; overflow: visible; }
.sun-chart .grid { stroke: var(--line); stroke-width: 1; }
.sun-chart .zero { stroke: var(--text); stroke-width: 1.4; }
.sun-chart .curve { fill: none; stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.sun-chart .area { fill: var(--accent); opacity: .08; }
.sun-chart .ev { stroke: var(--text-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sun-chart .ev.flip { stroke: var(--accent); stroke-dasharray: 4 4; }
.sun-chart text { fill: var(--text-2); font: 11px var(--sans); }
.sun-chart .now { stroke: var(--text); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.strip-wrap { position: relative; margin-top: 14px; cursor: crosshair; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.strip { height: 34px; border-radius: 10px; border: 1px solid var(--line); }
.strip.thin { height: 10px; margin-top: 6px; border-radius: 5px; }
.strip-cursor { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: var(--text); opacity: 0; pointer-events: none; transition: opacity .2s; }
.strip-cursor span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px; padding: 3px 8px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.strip-wrap:hover .strip-cursor, .strip-wrap.active .strip-cursor { opacity: 1; }
.sun-facts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin: 26px 0 0; }
.sun-facts div { display: grid; gap: 2px; }
.sun-facts dt { font-size: 12px; color: var(--text-3); }
.sun-facts dd { margin: 0; font: 700 20px/1.3 var(--serif); font-variant-numeric: tabular-nums; }

/* ---- keyframes ---- */
.keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
.key { border-radius: var(--r); padding: 20px 18px 18px; background: var(--bg); color: var(--text); border: 1px solid var(--line); display: grid; gap: 12px; transition: transform .5s var(--spring); }
.key:hover { transform: translateY(-4px); }
.key h3 { font: 700 26px/1 var(--serif); display: flex; align-items: baseline; justify-content: space-between; }
.key h3 small { font: 600 12px var(--sans); color: var(--text-3); letter-spacing: .1em; }
.key .anchor { font-size: 12px; color: var(--text-2); min-height: 2.6em; line-height: 1.5; }
.key .mini { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); padding: 12px 12px 13px; }
.key .mini small { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--accent); font-weight: 600; }
.key .mini small::before { content: ''; width: 5px; height: 5px; border-radius: 3px; background: var(--accent); }
.key .mini b { display: block; font: 700 17px/1.4 var(--serif); margin-top: 4px; }
.key .mini span { font-size: 11px; color: var(--text-2); }
.key .chips { display: flex; gap: 6px; }
.key .chips i { flex: 1; height: 22px; border-radius: 6px; border: 1px solid var(--line); }
.key .hex { font: 11px/1.5 var(--mono); color: var(--text-2); display: grid; grid-template-columns: 1fr 1fr; }
.contrast { margin-top: 28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 24px; border-radius: var(--r); border: 1px dashed var(--text-3); }
.contrast div { display: grid; gap: 4px; }
.contrast b { font: 700 32px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.contrast span { font-size: 13px; color: var(--text-2); }
.contrast p { grid-column: 1 / -1; font-size: 13px; color: var(--text-3); }

/* ---- OKLab ramps ---- */
.ramps { display: grid; gap: 22px; padding: 26px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.ramp-set h3 { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.ramp { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px; font-size: 12px; color: var(--text-3); }
.ramp + .ramp { margin-top: 8px; }
.ramp i { height: 40px; border-radius: 10px; }
.ramp-l { margin-top: 8px; height: 60px; }
.ramp-l path { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.ramp-l .srgb { stroke: var(--text-3); stroke-dasharray: 4 4; }
.ramp-l .oklab { stroke: var(--accent); }
.ramp-legend { display: flex; gap: 18px; font-size: 12px; color: var(--text-3); margin-top: 6px; }
.ramp-legend span::before { content: ''; display: inline-block; width: 18px; height: 2px; margin-right: 6px; vertical-align: middle; background: var(--accent); }
.ramp-legend span.s::before { background: repeating-linear-gradient(90deg, var(--text-3) 0 4px, transparent 4px 8px); }

/* ---- springs ---- */
.springs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
.spring { min-width: 0; grid-template-columns: minmax(0, 1fr); padding: 22px 22px 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 14px; }
.spring header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.spring h3 { font: 700 22px/1.2 var(--serif); }
.spring header span { font-size: 13px; color: var(--text-2); }
.spring .use { font-size: 14px; color: var(--text-2); }
.spring .plot { height: 92px; width: 100%; overflow: visible; }
.spring .plot .ax { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spring .plot .one { stroke: var(--text-3); stroke-dasharray: 3 4; stroke-width: 1; vector-effect: non-scaling-stroke; }
.spring .plot .c { fill: none; stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.spring .plot .dot { fill: var(--accent); }
.lane { -webkit-user-select: none; user-select: none; position: relative; height: 44px; border-radius: 22px; background: var(--bg); border: 1px solid var(--line); cursor: pointer; }
.lane i { position: absolute; left: 6px; top: 5px; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); box-shadow: 0 4px 12px color-mix(in oklab, var(--accent) 40%, transparent); }
.lane::after { content: '点按'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-3); }
.spring code { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.spring .row { display: flex; align-items: center; gap: 10px; }
.spring .row code { flex: 1; min-width: 0; }

/* ---- live demos ---- */
.demos { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 3vw, 40px); margin-top: 48px; }
.demo { margin: 0; display: grid; gap: 18px; justify-items: center; }
.demo-phone { width: min(100%, 300px); }
.demo-phone .phone { width: 100%; }
.demo figcaption { font-size: 14px; color: var(--text-2); max-width: 300px; }
.demo figcaption b { display: block; font: 700 18px/1.4 var(--serif); color: var(--text); margin-bottom: 4px; }
.demo-phone .p-row[data-row='1'] { cursor: pointer; border-radius: 14px; }
.demo-phone .p-row[data-row='1']:hover { background: color-mix(in oklab, var(--text) 5%, transparent); }
.demo-phone .p-bb .fab { cursor: pointer; transition: transform var(--d-fast) var(--spring-fast); }
.plus-open .p-bb .fab { transform: rotate(45deg); }
.p-detail { position: absolute; left: 12px; right: 12px; top: 210px; bottom: 96px; border-radius: 28px; background: var(--raised); border: 1px solid var(--line); box-shadow: 0 30px 60px -20px rgb(0 0 0 / .35); padding: 24px 22px; z-index: 18; display: none; cursor: pointer; }
.detail-open .p-detail { display: block; }
.detail-open .p-row[data-row='1'] { visibility: hidden; }
.p-detail .sw { width: 44px; height: 6px; border-radius: 3px; background: var(--cf3); }
.p-detail h4 { font: 700 30px/1.25 var(--serif); margin-top: 16px; }
.p-detail .meta { font-size: 14px; color: var(--text-2); margin-top: 6px; }
.p-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; margin: 22px 0 0; font-size: 14px; }
.p-detail dt { color: var(--text-2); }
.p-detail dd { margin: 0; }
.p-detail .acts { position: absolute; left: 22px; right: 22px; bottom: 22px; display: flex; gap: 10px; }
.p-detail .acts span { flex: 1; height: 46px; border-radius: 23px; border: 1px solid var(--text-3); display: grid; place-items: center; font-size: 14px; }
.p-detail .acts span:last-child { background: var(--accent); color: var(--on-accent); border: 0; font-weight: 600; }
.p-newsheet .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.p-newsheet .act { height: 104px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); padding: 14px; display: grid; align-content: space-between; opacity: 0; transform: translateY(16px); transition: opacity .3s, transform var(--d-std) var(--spring); }
.p-newsheet .act i { width: 34px; height: 34px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-style: normal; font-size: 18px; }
.p-newsheet .act b { font-size: 15px; }
.p-newsheet .act small { display: block; font-size: 11px; color: var(--text-2); font-weight: 400; margin-top: 2px; }
.plus-open .p-newsheet .act { opacity: 1; transform: none; }
.plus-open .p-newsheet .act:nth-child(2) { transition-delay: 40ms; } .plus-open .p-newsheet .act:nth-child(3) { transition-delay: 80ms; } .plus-open .p-newsheet .act:nth-child(4) { transition-delay: 120ms; }
.plus-open .p-scrim { opacity: 1; pointer-events: auto; cursor: pointer; }
.plus-open .p-newsheet { transform: none; }
.p-newsheet { padding-bottom: 104px; z-index: 14; }
.back-stage .layer[data-screen='campus'] { transform-origin: 50% 50%; }
.back-top { position: absolute; inset: 0; z-index: 5; touch-action: pan-y; cursor: grab; overflow: hidden; background: var(--bg); will-change: transform; }
.back-top:active { cursor: grabbing; }
.back-hint { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 6; padding: 8px 16px; border-radius: 20px; background: var(--text); color: var(--bg); font-size: 14px; white-space: nowrap; pointer-events: none; animation: nudge 2.4s ease-in-out infinite; }
.back-edge { position: absolute; left: 8px; top: 50%; width: 22px; height: 70px; margin-top: -35px; border-radius: 11px; background: var(--text); opacity: 0; z-index: 7; pointer-events: none; display: grid; place-items: center; color: var(--bg); font-size: 16px; }
@keyframes nudge { 50% { transform: translateX(calc(-50% + 14px)); } }
html.vt-local::view-transition-old(root), html.vt-local::view-transition-new(root) { animation: none; }
::view-transition-group(course-card) { animation-duration: var(--d-std); animation-timing-function: var(--spring); }

/* ---- type ---- */
.specimen { padding: clamp(24px, 4vw, 44px); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 14px; }
.specimen b { font: 700 clamp(96px, 13vw, 180px)/1 var(--serif); letter-spacing: .04em; }
.specimen .nums { font: 700 clamp(22px, 2.6vw, 32px)/1.2 var(--serif); font-variant-numeric: tabular-nums; color: var(--accent); }
.specimen .serif { font: 700 22px/1.6 var(--serif); }
.specimen .sans { font-size: 15px; color: var(--text-2); }

/* ---- course colours ---- */
.courses { display: grid; gap: 14px; margin-top: 36px; }
.courses .row { display: grid; grid-template-columns: 56px repeat(6, 1fr); gap: 10px; align-items: stretch; padding: 14px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.courses .row > span { display: grid; place-items: center; font-size: 13px; color: var(--text-2); }
.courses .c { border-radius: 10px; padding: 10px 10px 12px; background: var(--cb); color: var(--cf); min-height: 72px; }
.courses .c b { display: block; font-size: 13px; }
.courses .c small { font-size: 11px; opacity: .8; }

@media (max-width: 1040px) {
  .keys { grid-template-columns: repeat(2, 1fr); }
  .sun-facts { grid-template-columns: repeat(3, 1fr); }
  .demos { grid-template-columns: 1fr; gap: 48px; }
}
@media (max-width: 760px) {
  .dial-grid, .split { grid-template-columns: 1fr; }
  .tokens { grid-template-columns: 1fr; }
  .contrast { grid-template-columns: repeat(2, 1fr); }
  .springs { grid-template-columns: 1fr; }
  .keys { grid-template-columns: 1fr 1fr; gap: 10px; }
  .key { padding: 16px 14px; }
  .key .hex { display: none; }
  .courses .row { grid-template-columns: repeat(3, 1fr); }
  .courses .row > span { grid-column: 1 / -1; justify-content: start; }
  .demo-phone { width: min(78vw, 300px); }
}
