/* 模块 08 · 动手练习 */

/* shared: you give / it does / you check */
.tri { margin-top: 22px; display: grid; gap: 0; }
.tri li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line-2); }
.tri li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--text); }
.tri li.you { border-left-color: transparent; }
.tri li.you::before { background: var(--mark); }
.tri span { display: block; font-size: .78rem; letter-spacing: .04em; color: var(--muted); }
.tri p { font-size: .93rem; line-height: 1.65; }
.tri small { display: block; margin-top: 4px; font-size: .82rem; color: var(--muted); }
.tri-who { margin-top: 2px; }

/* ===== practice 1 ===== */
.p1 { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(0, 1.1fr); column-gap: clamp(28px, 4vw, 60px); align-items: start; }
.p1-back { margin-top: 14px; }
.p1-lab { padding: 26px 28px; border-radius: 26px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 40px 70px -40px rgba(0, 0, 0, .4); display: grid; gap: 16px; }
.p1-h { font-size: .86rem; color: var(--muted); }
.p1-demo .mean output { font-size: 3.6rem; }
.p1-demo .mean-bars { height: 190px; }
.p1-insight { min-height: 3em; font-weight: 600; color: #8a5a00; }
.p1-checks { display: grid; gap: 10px; font-size: .95rem; }
.p1-checks button.tick { text-align: left; font-size: inherit; }
.p1-lab .note { font-size: .78rem; }

/* ===== practice 2 ===== */
.p2 { display: grid; grid-template-columns: minmax(300px, .82fr) minmax(0, 1.18fr); column-gap: clamp(28px, 4vw, 60px); align-items: start; }
.p2-lab { display: grid; grid-template-columns: minmax(180px, .8fr) auto minmax(220px, 1fr); gap: 16px; align-items: start; }
.p2-sheet { border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 24px 50px -34px rgba(0, 0, 0, .4); overflow: hidden; }
.p2-file { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: #f3f5f0; font: .8rem/1.2 var(--mono); }
.p2-file small { margin-left: auto; font-family: var(--sans); color: var(--muted); }
.p2-sheet table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.p2-sheet th { text-align: left; font-size: .76rem; color: var(--muted); font-weight: 500; padding: 6px 12px; border-bottom: 1px solid #ececef; }
.p2-sheet td { padding: 8px 12px; border-bottom: 1px solid #f3f3f5; font-variant-numeric: tabular-nums; }
.p2-sheet tr { cursor: pointer; transition: background-color .2s; }
.p2-sheet tbody tr:hover { background: #fafafa; }
.p2-sheet tr.pick { background: #fff3c4; }
.p2-sheet tr.dup td { color: #a75f00; }
.p2-sheet tr.miss td em { color: var(--bad); font-style: normal; }
.p2-toggles { display: grid; gap: 4px; padding: 10px 12px; font-size: .8rem; color: var(--text-2); }
.p2-toggles label { display: flex; gap: 6px; align-items: center; }
.p2-mid { display: grid; gap: 8px; align-self: center; justify-items: center; }
.p2-out { display: grid; gap: 12px; }
.p2-buckets { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; min-height: 92px; }
.p2-wait { grid-column: 1 / -1; display: grid; place-items: center; min-height: 92px; border-radius: 14px; border: 1.5px dashed var(--line-2); color: var(--muted); font-size: .86rem; }
.p2-b { padding: 14px; border-radius: 14px; background: var(--ink); color: var(--on-ink); display: grid; gap: 2px; animation: log-in .5s var(--ease); transition: box-shadow .3s; }
.p2-b span { font-size: .8rem; color: var(--on-ink-muted); }
.p2-b b { font-family: var(--display); font-size: 2rem; letter-spacing: -.02em; color: var(--mark); font-variant-numeric: tabular-nums; }
.p2-b.pick { box-shadow: 0 0 0 3px var(--mark); }
.p2-code { margin: 0; padding: 14px 16px; border-radius: 14px; background: #16161a; color: #e9e7e1; font: .78rem/1.75 var(--mono); white-space: pre-wrap; }
.p2-code .c { color: #85827a; }
.p2-say { font-size: .9rem; font-weight: 600; min-height: 3em; }

/* ===== practice 3 ===== */
.p3 { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(0, 1.1fr); column-gap: clamp(28px, 4vw, 60px); align-items: start; }
.p3-lab { display: grid; gap: 14px; }
.p3-tools { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.p3-frame { margin: 0 auto; width: 100%; max-width: 100%; transition: max-width .5s var(--ease); }
.p3-frame[data-pw="phone"] { max-width: 320px; }
.p3-site { padding: 26px 30px 30px; border-radius: 22px; background: #fffaf0; color: #2a2620; box-shadow: 0 0 0 1px var(--line), 0 30px 60px -36px rgba(0, 0, 0, .45); display: grid; gap: 14px; transition: background-color .6s var(--ease), color .6s var(--ease); }
.p3-nav { display: flex; gap: 16px; font-size: .84rem; color: inherit; opacity: .8; }
.p3-nav b { margin-right: auto; }
.p3-site h3 { font-size: clamp(1.4rem, 2.4vw, 2.1rem); line-height: 1.25; letter-spacing: -.02em; }
.p3-p { font-size: .92rem; line-height: 1.7; }
.p3-a { font-weight: 600; color: #b5541b; transition: color .6s; }
.p3-btn { justify-self: start; padding: 10px 18px; border-radius: 999px; background: #2a2620; color: #fffaf0; font-weight: 600; transition: background-color .6s, color .6s; }
.p3[data-mode="night"] .p3-site { background: #15161c; color: #e8e4da; }
.p3[data-mode="night"] .p3-a { color: #ffb37a; }
.p3[data-mode="night"][data-fixed="0"] .p3-btn { background: #fffaf0; color: #fffaf0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); cursor: pointer; }
.p3[data-mode="night"][data-fixed="1"] .p3-btn { background: #ffb37a; color: #15161c; }
.p3-h { font-size: .86rem; color: var(--muted); }
.p3-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .9rem; }
.p3-say { font-size: .92rem; min-height: 3em; line-height: 1.65; }
.p3-say b { display: block; }

/* ===== github ===== */
.gh { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); grid-template-areas: "copy repo" "src repo"; column-gap: clamp(28px, 4vw, 60px); align-items: start; }
.gh-copy { grid-area: copy; }
.gh-detail { margin-top: 22px; min-height: 10em; padding: 18px 20px; border-radius: 18px; background: var(--white); box-shadow: 0 0 0 1px var(--line); }
.gh-n { font: 600 .78rem/1 var(--mono); color: var(--muted); }
.gh-detail .sub { margin-top: 6px; }
.gh-detail p:last-child { margin-top: 6px; color: var(--text-2); font-size: .94rem; }
.gh-take { margin-top: 16px; font-weight: 600; }
.gh .src { grid-area: src; }
.gh-repo { grid-area: repo; border-radius: 14px; background: #fff; color: #1f2328; box-shadow: 0 0 0 1px #d0d7de, 0 30px 60px -36px rgba(0, 0, 0, .4); overflow: visible; font-size: 13px; }
.gh-top { padding: 14px 18px 0; border-bottom: 1px solid #d0d7de; }
.gh-name { position: relative; display: inline-flex; gap: 4px; font-size: 16px; color: #0969da; padding-right: 40px; }
.gh-name b { font-weight: 600; }
.gh-tabs { display: flex; gap: 18px; margin-top: 12px; }
.gh-tabs span { position: relative; padding: 8px 2px 10px; color: #59636e; padding-right: 30px; }
.gh-tabs span.on { color: #1f2328; font-weight: 600; box-shadow: inset 0 -2px 0 #fd8c73; padding-right: 2px; }
.gh-tabs i { font-style: normal; font-size: 11px; padding: 0 6px; border-radius: 999px; background: #eff2f5; margin-left: 4px; }
.gh-body { display: grid; grid-template-columns: .9fr 1.1fr; gap: 14px; padding: 14px 18px; }
.gh-files { border: 1px solid #d0d7de; border-radius: 8px; overflow: hidden; }
.gh-commit { position: relative; padding: 8px 12px; background: #f6f8fa; border-bottom: 1px solid #d0d7de; color: #59636e; font-size: 12px; }
.gh-f { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid #eff2f5; transition: background-color .3s; }
.gh-f .ic { color: #59636e; }
.gh-f.lit { background: #fff3c4; box-shadow: inset 3px 0 0 #f0c419; font-weight: 600; }
.gh-readme { position: relative; border: 1px solid #d0d7de; border-radius: 8px; padding: 0 14px 12px; display: grid; gap: 8px; align-content: start; }
.gh-rh { position: relative; margin: 0 -14px; padding: 8px 14px; border-bottom: 1px solid #d0d7de; font-weight: 600; }
.gh-readme h4 { font-size: 18px; border-bottom: 1px solid #eff2f5; padding-bottom: 6px; }
.gh-readme p { position: relative; line-height: 1.6; }
.gh-readme p b { margin-right: 6px; }
.gh-repo .spot { position: absolute; right: 2px; top: 50%; margin: -15px 0 0; }
.gh-tabs .spot { right: -4px; }
.gh-trace { margin: 0 18px 16px; padding: 12px 14px; border-radius: 10px; background: #f6f8fa; display: grid; gap: 8px; }
.gh-th { font-size: 12.5px; color: #59636e; }
.gh-th code { background: #fff3c4; color: #111; }
.gh-mini .mean { color: #1f2328; }
.gh-mini .mean output { font-size: 1.4rem; }
.gh-mini .mean-bars { height: 70px; }
.gh-mini .mean-eq, .gh-mini .mean-range { font-size: .7rem; }

/* ===== resources: a shelf ===== */
.rs8 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); grid-template-areas: "top card" "shelf card"; column-gap: clamp(28px, 4vw, 60px); align-items: start; }
.rs8-top { grid-area: top; }
.rs8-shelf { grid-area: shelf; margin-top: 22px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 22px 14px; }
.rs8-g { display: grid; gap: 8px; }
.rs8-gl { font-size: .72rem; color: var(--on-ink-muted); max-width: 9em; line-height: 1.35; }
.rs8-books { display: flex; align-items: flex-end; gap: 4px; height: 230px; padding-bottom: 6px; border-bottom: 3px solid rgba(241, 239, 233, .25); }
.rs8-b { position: relative; width: 44px; height: var(--h); border-radius: 4px 4px 2px 2px; padding: 12px 0; display: flex; justify-content: center; background: hsl(calc(var(--g, 0) * 41 + 20) 32% 26%); box-shadow: inset 4px 0 0 rgba(255, 255, 255, .06), inset -3px 0 0 rgba(0, 0, 0, .25); transition: transform .35s var(--spring), background-color .3s; }
.rs8-g:nth-child(1) .rs8-b { --g: 0; } .rs8-g:nth-child(2) .rs8-b { --g: 1; } .rs8-g:nth-child(3) .rs8-b { --g: 2; } .rs8-g:nth-child(4) .rs8-b { --g: 3; } .rs8-g:nth-child(5) .rs8-b { --g: 4; } .rs8-g:nth-child(6) .rs8-b { --g: 5; } .rs8-g:nth-child(7) .rs8-b { --g: 6; } .rs8-g:nth-child(8) .rs8-b { --g: 7; }
.rs8-b span { writing-mode: vertical-rl; font-size: .8rem; font-weight: 600; color: rgba(241, 239, 233, .92); letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs8-b:hover { transform: translateY(-8px); }
.rs8-b[aria-pressed="true"] { transform: translateY(-16px); background: var(--mark); }
.rs8-b[aria-pressed="true"] span { color: var(--ink); }
.rs8-card { grid-area: card; margin-top: 40px; padding: 22px 24px; border-radius: 22px; background: var(--on-ink); color: var(--ink); min-height: 320px; display: grid; gap: 12px; align-content: start; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7); }
.rs8-cg { font-size: .76rem; color: #6f6c64; }
.rs8-cn { font-family: var(--display); font-size: 1.6rem; line-height: 1.2; letter-spacing: -.02em; }
.rs8-card dl { display: grid; gap: 10px; }
.rs8-card dl div { display: grid; gap: 2px; }
.rs8-card dt { font-size: .74rem; color: #6f6c64; letter-spacing: .04em; }
.rs8-card dd { font-size: .92rem; line-height: 1.6; }
.rs8-card .out { justify-self: start; }
.rs8-card .out[href^="ai-sources.html"]::after { content: '→'; }

/* ===== resource check ===== */
.ev8 { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(0, 1.1fr); column-gap: clamp(28px, 4vw, 60px); align-items: start; }
.ev8-judge { margin-top: 22px; display: grid; gap: 8px; }
.ev8-judge button { width: 100%; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "dot b" "dot s"; column-gap: 12px; text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--white); box-shadow: 0 0 0 1px var(--line); }
.ev8-judge button::before { grid-area: dot; align-self: start; }
.ev8-judge b { grid-area: b; font-size: .98rem; }
.ev8-judge span { grid-area: s; font-size: .86rem; color: var(--text-2); line-height: 1.6; }
.ev8-lab { display: grid; gap: 14px; }
.ev8-claim { font-family: var(--display); font-size: clamp(1.6rem, 2.6vw, 2.4rem); line-height: 1.25; letter-spacing: -.02em; padding: 22px 26px; border-radius: 22px; background: var(--ink); color: var(--on-ink); }
.ev8-h { font-size: .86rem; color: var(--muted); }
.ev8-ladder { display: grid; gap: 8px; }
.ev8-e { display: grid; gap: 6px; text-align: left; padding: 16px 18px; border-radius: 16px; background: var(--white); box-shadow: 0 0 0 1px var(--line); transition: background-color .3s, transform .3s var(--ease); }
.ev8-e:nth-child(1) { margin-right: 0; } .ev8-e:nth-child(2) { margin-right: 6%; } .ev8-e:nth-child(3) { margin-right: 12%; }
.ev8-e b { font-size: 1.05rem; }
.ev8-can, .ev8-cant { font-size: .88rem; line-height: 1.55; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .4s var(--ease), opacity .3s; }
.ev8-can { color: var(--ok); }
.ev8-cant { color: var(--bad); }
.ev8-e[aria-expanded="true"] .ev8-can, .ev8-e[aria-expanded="true"] .ev8-cant { max-height: 4em; opacity: 1; }
.ev8-take { font-weight: 600; }

/* ===== explore: the letter you send ===== */
.xp { position: relative; display: flex; flex-direction: column; gap: 18px; }
.xp-idea { margin: 0; font-family: var(--display); font-size: clamp(3rem, 7vw, 6.4rem); font-weight: 700; line-height: 1; letter-spacing: -.04em; color: var(--mark); min-height: 1em; transition: color .6s; }
body.field-on .page.is-now .xp-idea { color: transparent; }
.xp-head .t { margin-top: 6px; }
.xp-seg { align-self: flex-start; }
.xp-letter { padding: 24px 28px; border-radius: 22px; background: var(--on-ink); color: var(--ink); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .8); }
.xp-text { font-size: 1.05rem; line-height: 2; white-space: pre-wrap; }
.xp-blank { display: inline; padding: 2px 8px; margin: 0 2px; border-radius: 6px; background: #fff3c4; box-shadow: inset 0 -2px 0 #e0b400; outline: none; min-width: 3em; }
.xp-blank:empty::before { content: attr(data-ph); color: #8a7a3a; opacity: .75; }
.xp-blank:focus { background: #ffe680; }
.xp-letter .prompt-foot button { height: 40px; padding: 0 18px; }
.xp-end { font-size: .95rem; color: var(--on-ink-2); max-width: 46em; }
.xp-end a { margin-left: 10px; color: var(--mark); font-weight: 600; }

@media (max-width: 1100px) {
  .p1, .p2, .p3, .ev8, .gh, .rs8 { grid-template-columns: 1fr; grid-template-areas: none; }
  .gh > *, .rs8 > * { grid-area: auto !important; }
  .p2-lab { grid-template-columns: 1fr; }
  .rs8-card { margin-top: 10px; }
}
@media (max-width: 760px) {
  .gh-body { grid-template-columns: 1fr; }
  .rs8-books { height: 180px; }
  .rs8-b { width: 36px; }
}
