:root {
  --paper: #f3f1ea;
  --paper-deep: #e9e6dc;
  --ink: #171918;
  --ink-soft: #5b605d;
  --line: #b9bcb6;
  --blue: #1546d8;
  --blue-deep: #0b2d98;
  --white: #fffefa;
  --danger: #a72e2e;
  --success: #137353;
  --header-h: 76px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(23,25,24,.08) 50%, transparent calc(50% + .5px)),
    var(--paper);
  font-family: "Noto Sans TC", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
  line-height: 1.65;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(21,70,216,.35);
  outline-offset: 3px;
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 20; opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}
.page-reveal { position: fixed; inset: 0; z-index: 100; pointer-events: none; display: grid; grid-template-columns: repeat(3, 1fr); }
.page-reveal span { background: var(--ink); transform-origin: top; animation: curtain-out .9s var(--ease-out) forwards; }
.page-reveal span:nth-child(2) { animation-delay: .08s; }
.page-reveal span:nth-child(3) { animation-delay: .16s; }
@keyframes curtain-out { to { transform: scaleY(0); } }

.site-header {
  height: var(--header-h); position: sticky; top: 0; z-index: 30;
  display: flex; align-items: stretch; justify-content: space-between;
  border-bottom: 1px solid var(--ink); background: rgba(243,241,234,.94); backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 290px; color: inherit; padding: 0 28px; border-right: 1px solid var(--ink); cursor: default; user-select: none; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: var(--white); background: var(--ink); font-weight: 800; transform: rotate(45deg); }
.brand-mark::first-letter { display: inline-block; transform: rotate(-45deg); }
.brand-copy { display: grid; line-height: 1.1; }
.brand-copy strong { font-size: 13px; letter-spacing: .11em; }
.brand-copy small { color: var(--ink-soft); margin-top: 6px; }
.experiment-stamp { display: flex; align-items: center; min-width: 185px; border-left: 1px solid var(--ink); }
.language-picker { align-self: stretch; display: grid; place-items: center; background: var(--blue); color: white; }
.language-picker { width: 68px; }
.language-picker select { width: 68px; height: 100%; padding: 0 8px; border: 0; border-radius: 0; color: white; background: var(--blue); font: inherit; font-size: 11px; font-weight: 800; letter-spacing: .08em; cursor: pointer; text-align: center; }
.language-picker select:disabled { opacity: .72; cursor: not-allowed; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.experiment-stamp strong { padding: 0 22px; letter-spacing: .08em; }

.evaluation-shell { min-height: calc(100vh - var(--header-h)); display: grid; grid-template-columns: minmax(260px, 24vw) 1fr; }
.study-rail { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); padding: clamp(30px, 4vw, 62px) clamp(24px, 3vw, 50px); border-right: 1px solid var(--ink); display: flex; flex-direction: column; background: var(--paper-deep); }
.rail-heading { display: grid; font-size: clamp(28px, 3vw, 46px); font-weight: 800; line-height: .93; letter-spacing: -.055em; }
.rail-heading span:last-child { color: var(--blue); }
.mask-line { overflow: hidden; }
.mask-line > span { display: block; animation: mask-rise .8s .45s var(--ease-out) both; }
.mask-line > span:nth-child(2) { animation-delay: .53s; }
@keyframes mask-rise { from { transform: translateY(120%); filter: blur(5px); } }
.rail-summary { max-width: 30ch; margin: 30px 0 42px; color: var(--ink-soft); font-size: 14px; }
.step-nav { display: grid; border-top: 1px solid var(--line); }
.step-link { width: 100%; display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 10px; min-height: 55px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: default; opacity: .48; }
.step-link b { font-size: 12px; }
.step-link span { font-weight: 700; }
.step-link.is-current, .step-link.is-complete { opacity: 1; }
.step-link.is-current { color: var(--blue); }
.step-link.is-current b { width: 28px; height: 28px; display: grid; place-items: center; background: var(--blue); color: white; border-radius: 50%; }
.rail-progress { margin-top: auto; }
.progress-copy { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; letter-spacing: .12em; }
.progress-copy strong { font-size: 22px; letter-spacing: -.03em; }
.progress-track { height: 3px; margin: 10px 0 12px; background: var(--line); overflow: hidden; }
.progress-track i { display: block; width: 100%; height: 100%; background: var(--blue); transform: scaleX(0); transform-origin: left center; transition: transform .65s var(--ease-out); }
.rail-progress p, .privacy-note { margin: 0; color: var(--ink-soft); font-size: 12px; }
.privacy-note { margin-top: 18px; }
.privacy-note span { color: var(--success); margin-right: 6px; }

.workspace { min-width: 0; padding: 0 clamp(26px, 5vw, 88px) 70px; }
.workspace-topline { height: 58px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }
.screen { max-width: 1060px; margin: 0 auto; animation: screen-in .62s var(--ease-out) both; }
.screen[hidden] { display: none; }
@keyframes screen-in { from { transform: translateX(42px); filter: blur(7px); opacity: 0; } }

[data-screen="intro"] { min-height: calc(100vh - var(--header-h) - 58px); display: grid; grid-template-columns: minmax(120px, .42fr) minmax(0, 1fr); align-items: center; gap: clamp(30px, 6vw, 100px); }
.intro-number { writing-mode: vertical-rl; font-size: clamp(68px, 10vw, 150px); font-weight: 900; letter-spacing: -.1em; line-height: .78; color: transparent; -webkit-text-stroke: 1px var(--line); }
.intro-copy h1 { margin: 0; font-size: clamp(48px, 7vw, 104px); line-height: .94; letter-spacing: -.065em; }
.intro-copy h1 span:last-child { color: var(--blue); }
.lead { max-width: 650px; margin: 38px 0; font-size: clamp(17px, 1.5vw, 21px); color: #343836; }
.brief-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.brief-grid div { padding: 18px 18px 18px 0; display: grid; gap: 5px; }
.brief-grid div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.brief-grid strong { font-size: 15px; }
.brief-grid span { color: var(--ink-soft); font-size: 12px; }
.consent-check { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; margin: 32px 0; cursor: pointer; }
.intro-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.consent-check input, .tie-check input { width: 20px; height: 20px; accent-color: var(--blue); }

.primary-action, .secondary-action, .text-action { border: 0; cursor: pointer; }
.primary-action { min-height: 58px; display: inline-flex; align-items: stretch; background: var(--ink); color: white; padding: 0; transition: background .2s, transform .3s var(--ease-out); }
.primary-action span { display: grid; place-items: center; padding: 0 24px; font-weight: 750; }
.primary-action b { width: 58px; display: grid; place-items: center; border-left: 1px solid rgba(255,255,255,.3); font-size: 22px; }
.primary-action:hover:not(:disabled) { background: var(--blue); transform: translateY(-2px); }
.primary-action:disabled { cursor: not-allowed; opacity: .38; }
.secondary-action { min-height: 58px; padding: 0 24px; border: 1px solid var(--ink); background: transparent; font-weight: 750; }
.text-action { padding: 12px 0; background: transparent; text-decoration: underline; text-underline-offset: 5px; }

.section-heading { padding: clamp(42px, 7vw, 92px) 0 34px; border-bottom: 1px solid var(--ink); }
.section-heading > span { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.section-heading h2 { max-width: 820px; margin: 14px 0 18px; font-size: clamp(34px, 4.4vw, 66px); line-height: 1.06; letter-spacing: -.05em; }
.section-heading p { max-width: 680px; margin: 0; color: var(--ink-soft); }
.profile-form { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 34px; padding-top: 40px; }
.field { display: grid; gap: 9px; }
.field-wide { grid-column: 1 / -1; }
.field > span, .field legend, .field-title span { font-weight: 800; }
.field small, .field-title small { color: var(--ink-soft); }
.field input[type="text"], .field input:not([type]), .field select {
  width: 100%; min-height: 56px; border: 0; border-bottom: 2px solid var(--ink); background: rgba(255,255,255,.46); padding: 0 16px; border-radius: 0;
}
fieldset { margin: 0; padding: 0; border: 0; }
.segmented { display: flex; gap: 8px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { min-width: 92px; min-height: 48px; display: grid; place-items: center; border: 1px solid var(--line); background: rgba(255,255,255,.4); }
.segmented input:checked + span { border-color: var(--blue); background: var(--blue); color: white; }
.field-title { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-bottom: 12px; }
.familiarity-list { display: grid; border-top: 1px solid var(--line); }
.familiarity-row { display: grid; grid-template-columns: minmax(140px, 1fr) auto; align-items: center; gap: 20px; min-height: 70px; border-bottom: 1px solid var(--line); }
.familiarity-row strong { font-size: 15px; }
.likert-compact { display: flex; gap: 6px; }
.likert-compact label { cursor: pointer; }
.likert-compact input { position: absolute; opacity: 0; }
.likert-compact span { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--paper); }
.likert-compact input:checked + span { background: var(--ink); color: white; border-color: var(--ink); }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 34px 0; border-top: 1px solid var(--line); }
.form-error { min-height: 1.5em; margin: 0; color: var(--danger); font-weight: 700; }

.trial-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: clamp(38px, 5vw, 70px) 0 22px; border-bottom: 1px solid var(--ink); }
.trial-head > div:first-child > span { color: var(--blue); font-weight: 800; }
.trial-task { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.trial-head h2 { margin: 4px 0 0; font-size: clamp(30px, 4vw, 54px); line-height: 1; letter-spacing: -.045em; }
.trial-count { display: flex; align-items: baseline; gap: 8px; color: var(--ink-soft); }
.trial-count strong { font-size: 42px; color: var(--ink); }
.reference-card { margin-top: 24px; border: 1px solid var(--ink); background: rgba(255,255,255,.55); }
.reference-card summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 18px; cursor: pointer; font-size: 12px; font-weight: 800; letter-spacing: .08em; list-style: none; }
.reference-card summary::-webkit-details-marker { display: none; }
.reference-card summary b { color: var(--blue); font-size: 20px; transition: transform .25s var(--ease-out); }
.reference-card[open] summary b { transform: rotate(45deg); }
.reference-card > div { padding: 18px; border-top: 1px solid var(--line); animation: panel-wipe .35s var(--ease-out) both; }
.reference-card p { max-width: 760px; margin: 8px 0 0; color: var(--ink-soft); line-height: 1.75; }
.prompt-block { display: grid; grid-template-columns: 74px 1fr; gap: 18px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.prompt-block > span { color: var(--blue); font-size: 11px; letter-spacing: .16em; font-weight: 800; }
.prompt-block blockquote { grid-column: 2; margin: 0; font-size: clamp(19px, 2vw, 26px); font-weight: 650; overflow-wrap: anywhere; }
.trial-context { grid-column: 2; margin: 0 0 8px; color: var(--ink-soft); }
.answer-stage { margin: 38px 0 46px; }
.answer-switcher { display: flex; border-bottom: 1px solid var(--ink); }
.answer-tab { min-height: 52px; min-width: 120px; padding: 0 20px; border: 0; border-right: 1px solid var(--line); background: transparent; font-weight: 800; cursor: pointer; }
.answer-tab[aria-selected="true"] { background: var(--ink); color: white; }
.answer-panel { min-height: 190px; padding: clamp(24px, 4vw, 48px); background: var(--white); border-bottom: 1px solid var(--ink); font-size: clamp(17px, 1.7vw, 22px); white-space: pre-wrap; animation: panel-wipe .45s var(--ease-out) both; }
.answer-panel[hidden] { display: none; }
.stimulus-original { white-space: pre-wrap; }
.translation-aid { margin-top: 28px; padding: 16px 18px; display: grid; grid-template-columns: auto 1fr; gap: 5px 16px; border-left: 3px solid var(--blue); background: var(--paper-deep); font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.translation-aid strong { color: var(--blue); font-size: 11px; letter-spacing: .08em; }
.translation-aid small { grid-column: 2; color: var(--ink-soft); font-size: 11px; }
@keyframes panel-wipe { from { clip-path: inset(0 100% 0 0); filter: blur(4px); } to { clip-path: inset(0); } }
.ranking-fieldset, .ratings-section, .sequence-section { padding: 30px 0; border-top: 1px solid var(--ink); }
.ranking-fieldset legend, .ratings-heading h3 { font-size: 22px; font-weight: 800; }
.ranking-fieldset > p, .ratings-heading p { margin: 4px 0 22px; color: var(--ink-soft); }
.ranking-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ranking-grid label { display: grid; gap: 7px; }
.ranking-grid span { font-size: 12px; font-weight: 800; }
.ranking-grid select { min-height: 52px; border: 1px solid var(--line); border-radius: 0; background: var(--white); padding: 0 14px; }
.tie-check { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.ratings-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; }
.ratings-heading h3, .ratings-heading p { margin-top: 0; }
.rating-panel { border-top: 1px solid var(--line); }
.rating-panel:last-child { border-bottom: 1px solid var(--line); }
.rating-panel > summary { min-height: 76px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 18px; padding: 14px 2px; cursor: pointer; list-style: none; }
.rating-panel > summary::-webkit-details-marker { display: none; }
.rating-panel-title { display: grid; gap: 3px; }
.rating-panel-title small { color: var(--blue); font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.rating-panel-title strong { font-size: 18px; }
.rating-status { min-width: 64px; color: var(--ink-soft); font-size: 12px; font-weight: 800; text-align: right; }
.rating-panel.is-complete .rating-status { color: #087d54; }
.rating-toggle { width: 34px; height: 34px; display: grid; place-items: center; background: var(--ink); color: white; font-size: 20px; font-weight: 400; transition: transform .25s var(--ease-out), background .25s ease; }
.rating-panel[open] .rating-toggle { transform: rotate(45deg); background: var(--blue); }
.rating-panel-body { padding: 0 0 28px; animation: panel-wipe .35s var(--ease-out) both; }
.metric-row { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(320px, 1.5fr); align-items: center; gap: 24px; min-height: 66px; border-top: 1px solid rgba(185,188,182,.7); }
.metric-copy { display: grid; }
.metric-copy strong { font-size: 14px; }
.metric-copy small { color: var(--ink-soft); }
.metric-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.metric-control { min-width: 0; }
.scale-legend { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--ink-soft); font-size: 10px; letter-spacing: .04em; }
.metric-scale label { cursor: pointer; }
.metric-scale input { position: absolute; opacity: 0; }
.metric-scale span { min-height: 38px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--paper); }
.metric-scale input:checked + span { background: var(--blue); color: white; border-color: var(--blue); }
.ooc-row { align-items: start; padding: 18px 0; }
.ooc-reasons { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; padding: 18px; background: var(--paper-deep); }
.ooc-reasons[hidden] { display: none; }
.ooc-reasons label { display: flex; gap: 8px; align-items: start; font-size: 13px; }
.sequence-section { background: var(--paper-deep); padding-inline: 24px; }

.review-summary { margin: 34px 0; border-top: 1px solid var(--ink); }
.review-line { display: flex; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.review-line span { color: var(--ink-soft); }
.final-confirm { margin-top: 28px; }
.completion-copy { padding-top: clamp(56px, 8vw, 110px); }
.completion-copy > span { color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .18em; }
.completion-copy h2 { margin: 14px 0 12px; font-size: clamp(42px, 6vw, 82px); letter-spacing: -.045em; }
.completion-copy p { color: var(--ink-soft); font-size: 16px; }
.completion-figure { width: min(1080px, 100%); margin: 42px 0 80px; border: 1px solid var(--ink); background: var(--ink); overflow: hidden; }
.completion-figure img { display: block; width: 100%; height: auto; }
.export-actions { display: flex; gap: 14px; padding: 34px 0; }
.study-feedback { display: grid; gap: 9px; margin-block: 28px 8px; max-width: 760px; }
.study-feedback > span { font-weight: 800; }
.study-feedback textarea { width: 100%; min-height: 104px; resize: vertical; border: 1px solid var(--line); border-radius: 0; padding: 14px 16px; background: rgba(255,255,255,.72); color: var(--ink); font: inherit; line-height: 1.65; }
.study-feedback textarea:focus { outline: 3px solid color-mix(in srgb, var(--blue) 28%, transparent); outline-offset: 2px; border-color: var(--blue); }
.study-feedback small { color: var(--muted); line-height: 1.55; }

@media (max-width: 900px) {
  :root { --header-h: 66px; }
  .brand { min-width: 0; padding: 0 18px; border-right: 0; }
  .brand-copy small { display: none; }
  .experiment-stamp { min-width: 0; }
  .experiment-stamp strong { padding: 0 15px; }
  .evaluation-shell { display: block; }
  .study-rail { position: sticky; top: var(--header-h); z-index: 25; width: 100%; height: auto; padding: 12px 18px; border-right: 0; border-bottom: 1px solid var(--ink); display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .rail-heading { font-size: 20px; display: flex; gap: 6px; }
  .rail-summary, .step-nav, .privacy-note { display: none; }
  .rail-progress { margin: 0; width: 150px; }
  .rail-progress p { display: none; }
  .workspace { padding-inline: 20px; }
  [data-screen="intro"] { display: block; padding: 58px 0; min-height: auto; }
  .intro-number { writing-mode: initial; font-size: 74px; margin-bottom: 36px; }
  .brief-grid { grid-template-columns: 1fr; }
  .brief-grid div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .familiarity-row { grid-template-columns: 1fr; gap: 10px; padding: 14px 0; }
  .likert-compact { width: 100%; }
  .likert-compact label { flex: 1; }
  .likert-compact span { width: 100%; }
  .metric-row { grid-template-columns: 1fr; gap: 10px; padding: 14px 0; }
  .metric-row > * { min-width: 0; }
  .metric-row .segmented { flex-wrap: wrap; }
  .metric-row .segmented label { flex: 1 1 calc(50% - 4px); }
  .metric-row .segmented span { width: 100%; min-width: 0; }
  .ooc-reasons { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 580px) {
  .brand-copy strong { font-size: 11px; }
  .language-picker, .language-picker select { width: 58px; min-width: 58px; padding: 0 5px; }
  .study-rail { grid-template-columns: 1fr 112px; }
  .rail-progress { width: 112px; }
  .workspace-topline { height: 48px; }
  .intro-copy h1 { font-size: 48px; }
  .lead { margin: 28px 0; }
  .profile-form { grid-template-columns: 1fr; }
  .field-title { display: grid; gap: 3px; }
  .trial-head { align-items: start; }
  .trial-count strong { font-size: 32px; }
  .prompt-block { grid-template-columns: 1fr; }
  .trial-context,
  .prompt-block blockquote { grid-column: 1; }
  .answer-switcher { display: grid; grid-template-columns: repeat(3, 1fr); }
  .answer-tab { min-width: 0; padding: 0 8px; }
  .translation-aid { grid-template-columns: 1fr; margin-top: 20px; }
  .translation-aid small { grid-column: 1; }
  .ranking-grid { grid-template-columns: 1fr; }
  .ratings-heading { display: block; }
  .ooc-reasons { grid-template-columns: 1fr; }
  .action-row, .export-actions { align-items: stretch; flex-direction: column-reverse; }
  .action-row .primary-action, .export-actions .primary-action, .export-actions .secondary-action { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .page-reveal { display: none; }
}
.human-verification {
  margin-top: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line, #c7c7c0);
}
.human-verification > strong { display: block; margin-bottom: .35rem; }
.human-verification > p { margin: 0 0 .8rem; color: var(--muted, #62645f); }
