/* Layout: one calm phone-width column, read half-asleep at 3 a.m.; feed and post detail swap in place */
:root {
  --bg: #f4f5f9;
  --card: #ffffff;
  --ink: #1d2233;
  --muted: #5b6275;
  --line: #dfe2ec;
  --accent: #26706a;
  --accent-soft: #e2f0ee;
  --same: #f3d27a;
  --same-ink: #6b4d00;
  --warn-bg: #fff4e0;
  --warn-ink: #7a4b00;
  --hl-a: #fff3a8;  /* hover: light yellow ... */
  --hl-b: #ffd60a;  /* ... to bright yellow (明黄) */
  --hl-ink: #1d2233;
  --s1: #ffe3ea; --s1-ink: #9b2c4c;  /* stage cards: baby pink, sky, mint, lilac */
  --s2: #e3f1ff; --s2-ink: #1f5a96;
  --s3: #e4f6e6; --s3-ink: #2f6b3a;
  --s4: #f0e8ff; --s4-ink: #5b3c96;
  --display: "Nunito", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #12151f; --card: #1b2030; --ink: #e8eaf2; --muted: #a2a9bc; --line: #2c3346;
  --accent: #6cc4bb; --accent-soft: #1d3634; --same: #5c4a14; --same-ink: #f6dd93;
  --warn-bg: #3a2d14; --warn-ink: #f2cf8f; color-scheme: dark;
  --s1: #4a2633; --s1-ink: #ffc2d1; --s2: #1f3550; --s2-ink: #b9dcff;
  --s3: #213d27; --s3-ink: #bfe8c6; --s4: #352a52; --s4-ink: #dccbff;
} }
:root[data-theme="dark"] {
  --bg: #12151f; --card: #1b2030; --ink: #e8eaf2; --muted: #a2a9bc; --line: #2c3346;
  --accent: #6cc4bb; --accent-soft: #1d3634; --same: #5c4a14; --same-ink: #f6dd93;
  --warn-bg: #3a2d14; --warn-ink: #f2cf8f; color-scheme: dark;
  --s1: #4a2633; --s1-ink: #ffc2d1; --s2: #1f3550; --s2-ink: #b9dcff;
  --s3: #213d27; --s3-ink: #bfe8c6; --s4: #352a52; --s4-ink: #dccbff;
}
* { box-sizing: border-box }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 20px 40px }
.wrap { max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; line-height: 1.25 }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.01em }
h2 { font-size: 21px; font-weight: 800 }
h3 { font-size: 17px; font-weight: 700 }
p { margin: 0 }
.muted { color: var(--muted) }
.small { font-size: 14px }
header { display: flex; flex-direction: column; gap: 6px }
.brandrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap }
.pill { display: inline-block; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; letter-spacing: .02em }
.filters { display: flex; flex-direction: column; gap: 8px }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none }
.chip { flex: none; font: inherit; font-size: 14px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink) }
button { font: inherit; cursor: pointer }
button:focus-visible, .chip:focus-visible, textarea:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.primary { background: var(--accent); color: var(--card); border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; width: 100% }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); border-radius: 10px; padding: 8px 12px }
.link { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 700 }
.feed { display: flex; flex-direction: column; gap: 10px }
.post { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; text-align: left; color: var(--ink); width: 100% }
.post:hover { border-color: var(--muted) }
.meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted) }
.tag { font-size: 12.5px; font-weight: 700; color: var(--accent) }
.ex { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border: 1px dashed var(--muted); border-radius: 6px; padding: 0 6px }
.excerpt { color: var(--muted); font-size: 15px }
.counts { display: flex; gap: 14px; font-size: 13.5px; color: var(--muted) }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px }
label { font-size: 14px; font-weight: 700; display: flex; flex-direction: column; gap: 6px }
textarea, input[type=text], input[type=email], input[type=password], select { font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100% }
textarea { min-height: 110px; resize: vertical }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px }
.scale { display: flex; gap: 6px }
.scale button { flex: 1; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 10px; padding: 8px 0; font-weight: 700 }
.scale button[aria-pressed="true"] { background: var(--accent); color: var(--card); border-color: var(--accent) }
.scale-labels { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-weight: 400 }
.err { color: #c0392b; font-size: 13.5px; font-weight: 400 }
.note { background: var(--warn-bg); color: var(--warn-ink); border-radius: 12px; padding: 12px 14px; font-size: 14px }
.same { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 8px 14px; font-weight: 700 }
.same[aria-pressed="true"] { background: var(--same); color: var(--same-ink); border-color: var(--same) }
.reply { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 4px }
.kind { font-size: 12.5px; font-weight: 700 }
.summary { background: var(--accent-soft); border-radius: 12px; padding: 14px; white-space: pre-wrap; font-size: 15px }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px }
.stat b { display: block; font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums }
.empty { text-align: center; padding: 28px 16px; color: var(--muted) }
.rolebadge { font-size: 12.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent) }
.rolebar { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; font-size: 14px; color: var(--muted) }
.rolebar strong { color: var(--ink) }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.msgbtn { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px }
.badge { display: inline-block; min-width: 19px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--accent); color: var(--card); font-size: 12px; text-align: center; line-height: 19px }
.bubbles { display: flex; flex-direction: column; gap: 8px; min-height: 60px }
.bubble { max-width: 85%; padding: 8px 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 2px }
.bubble.me { align-self: flex-end; background: var(--accent-soft); border-color: transparent }
.bubble time { font-size: 11.5px; color: var(--muted) }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-right: 6px }
.lock { font-size: 13px; color: var(--muted) }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap }
.btnrow > button { flex: 1 1 140px }
footer { font-size: 13.5px; color: var(--muted); display: flex; flex-direction: column; gap: 6px }
@media (prefers-reduced-motion: no-preference) { .post { transition: border-color .15s } }
.header-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.langsel { width: auto; padding: 6px 10px; border-radius: 999px; font-size: 14px }
.auth { max-width: 440px; width: 100%; margin: 0 auto }
.linkrow { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap }
.notice { background: var(--accent-soft); color: var(--ink); border-radius: 12px; padding: 12px 14px; font-size: 14px }
.danger { color: #c0392b }
a.link { color: var(--accent); font-weight: 700; text-decoration: none; font-size: 14px }
a.link:hover { text-decoration: underline }
.actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center }
[hidden] { display: none !important }
html { -webkit-text-size-adjust: 100% }
body { margin: 0 }
.wrap > *, .filters > *, .panel > * { min-width: 0 }
.wrap, .panel, .post { max-width: 100% }
.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 14px; line-height: 1.45 }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent) }
.check.inline { display: inline-flex; align-items: center; font-size: 14px; color: var(--muted) }
.check.inline input { margin-top: 0 }
.sep { color: var(--line) }

/* Role step: one card per role; only the chosen role's questions appear below */
#roleView { max-width: 520px }
.roleopts { display: flex; flex-direction: column; gap: 8px }
.roleopt { display: flex; flex-direction: column; gap: 2px; text-align: left; width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink) }
.roleopt-title { font-family: var(--display); font-weight: 700; font-size: 16px }
.roleopt-desc { font-size: 13.5px; color: var(--muted) }
.roleopt[aria-checked="true"] { border: 2px solid var(--accent); padding: 11px 13px; background: var(--accent-soft) }
.roleopt[aria-checked="true"] .roleopt-title::before { content: "✓ "; color: var(--accent) }
.roledetails { display: flex; flex-direction: column; gap: 12px; border-left: 3px solid var(--accent); padding-left: 12px }
.field { display: flex; flex-direction: column; gap: 6px }
.field .q { font-size: 14px; font-weight: 700 }
.wrapchips { flex-wrap: wrap; overflow: visible }
.chip[aria-checked="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink) }
/* Chips reserve their bold width so hovering doesn't make the row jump */
.chip { display: inline-grid; justify-items: center }
.chip::after { content: attr(data-label); font-weight: 700; height: 0; overflow: hidden; visibility: hidden }

/* Hover: a light-to-bright yellow sweep and bold text on everything you can tap */
@media (hover: hover) {
  .post, .chip, .ghost, .same, .msgbtn, .roleopt, .scale button, .primary {
    background-image: linear-gradient(90deg, var(--hl-a), var(--hl-b));
    background-repeat: no-repeat; background-size: 0% 100% }
  :is(.post, .chip, .ghost, .same, .msgbtn, .roleopt, .scale button, .primary):hover:not([aria-pressed="true"], [aria-checked="true"], :disabled) {
    background-size: 100% 100%; border-color: var(--hl-b); color: var(--hl-ink); font-weight: 700 }
  :is(.post, .roleopt):hover:not([aria-checked="true"]) :is(.excerpt, .meta, .counts, .tag, .roleopt-desc, h3) { color: var(--hl-ink); font-weight: 700 }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .post, .chip, .ghost, .same, .msgbtn, .roleopt, .scale button, .primary {
    transition: background-size .7s ease, border-color .5s, color .5s }
}
.filterlbl { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: -2px }
.subchips { padding-left: 14px; border-left: 3px solid var(--line) }
.subchips .chip { font-size: 13px; padding: 5px 11px }

/* Stage and issue steps: big friendly picture cards, one tap each */
.stepview { max-width: 480px }
.stepbox { display: flex; flex-direction: column; gap: 12px; text-align: center }
.stepbox h2 { font-size: 23px }
.stepdots { display: flex; justify-content: center; gap: 6px }
.stepdots i { width: 26px; height: 6px; border-radius: 3px; background: var(--line) }
.stepdots i.on { background: var(--accent) }
.stepbox .back { align-self: flex-start; font-size: 14px }
.stepbox .skip { align-self: center; font-size: 14px; margin-top: 4px }
.stagegrid, .issuegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.stagecard { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px 14px; border-radius: 22px; border: 2px solid transparent;
  background-color: var(--c); color: var(--ci);
  background-image: linear-gradient(135deg, var(--hl-a), var(--hl-b)); background-repeat: no-repeat; background-size: 0% 100% }
.stagecard.s1 { --c: var(--s1); --ci: var(--s1-ink) }
.stagecard.s2 { --c: var(--s2); --ci: var(--s2-ink) }
.stagecard.s3 { --c: var(--s3); --ci: var(--s3-ink) }
.stagecard.s4 { --c: var(--s4); --ci: var(--s4-ink) }
.stagecard .kid { width: 84px; height: 78px }
.stagecard .t { font-family: var(--display); font-weight: 800; font-size: 17px; line-height: 1.15 }
.stagecard .a { font-size: 14px }
.stagecard[aria-pressed="true"] { border-color: var(--ci) }
.issuegrid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) }
.issuecard { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 92px; padding: 12px 8px; border-radius: 18px;
  border: 1px solid var(--line); background-color: var(--card); color: var(--ink); font-size: 14.5px; line-height: 1.25;
  background-image: linear-gradient(135deg, var(--hl-a), var(--hl-b)); background-repeat: no-repeat; background-size: 0% 100% }
.issuecard .icon { width: 34px; height: 34px }
.issuecard[aria-pressed="true"] { border: 2px solid var(--accent); padding: 11px 7px }
.issuecard.everything { background-color: var(--accent-soft) }
.crumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap }
.crumbbtn { border: 1px solid var(--line); background-color: var(--card); color: var(--ink); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 14px;
  background-image: linear-gradient(90deg, var(--hl-a), var(--hl-b)); background-repeat: no-repeat; background-size: 0% 100% }
.crumbbtn::after { content: " ✎"; color: var(--muted); font-weight: 400 }
.crumbsep { color: var(--muted); font-weight: 700 }
@media (hover: hover) {
  .stagecard:hover, .issuecard:hover, .crumbbtn:hover { background-size: 100% 100%; color: var(--hl-ink); border-color: var(--hl-b); font-weight: 700 }
  .stagecard:hover .a { font-weight: 700 }
}
@media (prefers-reduced-motion: no-preference) {
  .stagecard, .issuecard { transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), background-size .7s ease, color .4s, border-color .4s }
  .crumbbtn { transition: background-size .7s ease, border-color .4s }
  @media (hover: hover) {
    .stagecard:hover { transform: translateY(-8px) rotate(-1.5deg) }
    .stagecard:nth-child(even):hover { transform: translateY(-8px) rotate(1.5deg) }
    .issuecard:hover { transform: translateY(-5px) }
    .stagecard:hover .kid, .issuecard:hover .icon { animation: wiggle .9s ease-in-out infinite }
  }
  .stagecard:focus-visible .kid { animation: wiggle .9s ease-in-out infinite }
  .stepbox { animation: rise .4s ease }
  .pressed { animation: pop .25s ease }
}
@keyframes wiggle { 0%, 100% { transform: rotate(0) } 25% { transform: rotate(-6deg) } 75% { transform: rotate(6deg) } }
@keyframes pop { 0% { transform: scale(1) } 45% { transform: scale(.93) } 100% { transform: scale(1) } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
