@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@500&family=Fraunces:opsz,wght@9..144,500;9..144,700&display=swap');

/* 本番アプリ（prototype/question.css・writing.css）の配色と部品をもとにした、デモ専用のスタイル */
:root {
  --ink: #102a43; --muted: #526d82; --paper: #f5f9ff; --surface: #fff; --line: #d7e3f0;
  --accent: #2563eb; --deep: #123a6d; --soft: #e1efff; --good: #177245; --bad: #b42318;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif; line-height: 1.6; }
a { color: #245c96; }

.site-header { min-height: 64px; padding: 0 max(5vw, 16px); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: .9rem; text-decoration: none; }
.brand-mark { display: block; width: 30px; height: 30px; flex: none; border-radius: 8px; }
.brand small { display: block; color: var(--muted); font-size: .7rem; font-weight: 500; }
.header-link { color: #245c96; font-size: .84rem; font-weight: 700; text-decoration: none; white-space: nowrap; }

.demo-notice { padding: 10px max(5vw, 16px); background: #fdf8ec; border-bottom: 1px solid #eadcb4; color: #6b5317; font-size: .82rem; text-align: center; }
.demo-notice strong { margin-right: .4em; }

.shell { width: min(800px, 100% - 32px); margin: 0 auto; padding: 44px 0 72px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font: 500 .72rem "DM Mono", monospace; letter-spacing: .12em; text-align: center; }
h1 { margin: 0; text-align: center; font: 700 clamp(1.7rem, 5vw, 2.6rem)/1.3 Fraunces, "Yu Mincho", serif; }
.lead { margin: 14px 0 28px; color: var(--muted); text-align: center; }

.steps { display: flex; justify-content: center; gap: 6px; margin: 0 0 28px; padding: 0; list-style: none; font-size: .78rem; }
.steps li { padding: 5px 12px; border-radius: 999px; background: var(--soft); color: #245c96; }
.steps li[aria-current="step"] { background: var(--deep); color: #fff; font-weight: 700; }
.steps a { color: inherit; text-decoration: none; }

.card { margin: 0; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.stack { display: grid; gap: 18px; }

/* 案内ページ */
.intro p { margin: 0; }
.intro p + p { margin-top: 10px; }
.menu { display: grid; gap: 12px; margin-top: 24px; padding: 0; list-style: none; }
.menu a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; }
.menu a:hover { border-color: #adc9e5; background: #fafcff; }
.menu strong { display: block; font-size: 1rem; }
.menu span { color: var(--muted); font-size: .84rem; }
.menu .arrow { color: var(--accent); font-weight: 700; }
.notes { margin-top: 28px; color: var(--muted); font-size: .84rem; }
.notes ul { margin: 8px 0 0; padding-left: 1.2em; }
.notes li + li { margin-top: 4px; }

/* 選択問題 */
.question-number { display: block; margin-bottom: 8px; color: var(--accent); font: 500 .7rem "DM Mono", monospace; letter-spacing: .08em; }
.question-text { margin: 0; font-weight: 700; line-height: 1.75; }
.choices { display: grid; gap: 9px; margin: 18px 0 0; padding: 0; border: 0; }
.choice { position: relative; display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.choice:hover { background: #f5faff; }
.choice input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.choice:has(input:checked) { border-color: var(--accent); background: #eaf3ff; box-shadow: inset 3px 0 0 var(--accent); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.choice-number { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; background: var(--soft); color: #245c96; font: 500 .7rem "DM Mono", monospace; }
.feedback { margin: 16px 0 0; }
.feedback-verdict { display: block; font-weight: 700; }
.feedback-note { display: block; margin-top: 4px; color: var(--ink); font-size: .9rem; }
.is-correct { border-color: #80c99d; background: #f3fcf6; }
.is-correct .feedback-verdict { color: var(--good); }
.is-incorrect { border-color: #f0b4af; background: #fff8f7; }
.is-incorrect .feedback-verdict { color: var(--bad); }
.is-answer { border-color: #80c99d; }

.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.primary, .secondary { display: inline-block; border: 0; border-radius: 8px; padding: 12px 18px; cursor: pointer; font: 700 .95rem inherit; text-align: center; text-decoration: none; }
.primary { background: var(--accent); color: #fff; }
.secondary { background: var(--soft); color: var(--ink); }
.result { margin: 18px 0 0; text-align: right; }
.result strong { font-size: 1.1rem; }
.result small { display: block; color: var(--muted); }

.page-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 32px; }

/* 読解 */
.passage h2 { margin: 0 0 6px; text-align: center; font: 700 1.35rem Fraunces, "Yu Mincho", serif; }
.passage p { margin: 14px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.04rem; line-height: 1.85; }

/* 英作文 */
.instructions { background: #f5faff; color: #24527d; font-weight: 700; }
.instructions p { margin: 0; }
.instructions p + p { margin-top: 6px; }
.writing-question p { margin: 0; }
.writing-question .label { color: var(--accent); font: 500 .72rem "DM Mono", monospace; letter-spacing: .1em; }
.writing-question .en { margin-top: 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1.12rem; font-weight: 700; line-height: 1.6; }
.writing-question .ja { margin-top: 8px; color: var(--muted); font-size: .88rem; }
.editor-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.editor-heading h2, .card h2 { margin: 0; font: 700 1.3rem Fraunces, "Yu Mincho", serif; }
.editor-heading output { color: var(--muted); font: 500 .82rem "DM Mono", monospace; }
textarea { width: 100%; min-height: 220px; margin-top: 14px; padding: 14px; border: 1px solid #adc9e5; border-radius: 9px; color: var(--ink); font: 1rem/1.8 "Hiragino Sans", "Yu Gothic", sans-serif; resize: vertical; }
textarea:focus { outline: 3px solid #c6ddf8; border-color: var(--accent); }
.hint { margin: 8px 0 0; color: var(--muted); font-size: .84rem; }
.hint.is-ready { color: var(--good); font-weight: 700; }
.hint.is-over { color: var(--bad); font-weight: 700; }
.editor-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; font-size: .8rem; color: var(--muted); }
.text-button { padding: 0; border: 0; background: none; color: #245c96; font: 700 .8rem inherit; cursor: pointer; }

.site-footer { padding: 24px max(5vw, 16px) 36px; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .76rem; text-align: center; }
.site-footer p { margin: 0; }
.site-footer p + p { margin-top: 6px; }

@media (max-width: 600px) {
  .shell { padding-top: 32px; }
  .card { padding: 18px; }
  .brand > span > small { display: none; }
  .actions { flex-direction: column-reverse; }
  .actions button { width: 100%; }
  .page-nav { display: grid; }
  .page-nav a { width: 100%; }
  .result { text-align: left; }
}
.quiz-after-passage { margin-top: 18px; }

/* 1問ずつの採点 */
.question-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.question-grade { font-size: .84rem; }


/* 単語調べ・文章解説（授業用アプリと同じ見た目。デモ版では調べる操作は使えない） */
.word-button { -webkit-user-select: text; user-select: text; display: inline; padding: 0 1px; border: 0; border-radius: 3px; background: transparent; color: inherit; font: inherit; line-height: inherit; cursor: pointer; }
.word-button:hover, .word-button:focus-visible { background: var(--soft); color: var(--accent); outline: none; }
.word-button.is-selected { background: #dbeafe; color: #17477d; }
.lookup-sentence.is-selected { background: #fff3c4; border-radius: 3px; }
.word-lookup { padding: 18px 20px; border: 1px solid #c9dcf2; border-radius: 12px; background: #f9fcff; }
.word-lookup--drawer { position: fixed; z-index: 20; right: 24px; bottom: 82px; width: min(460px, calc(100vw - 32px)); max-height: min(70vh, 600px); overflow: auto; box-shadow: 0 18px 48px #123a6d33; }
.word-lookup h3 { margin: 0; font-size: 1.05rem; }
.lookup-tabs { display: flex; gap: 6px; margin-bottom: 12px; border-bottom: 1px solid #c9dcf2; }
.lookup-tab { margin-bottom: -1px; padding: 8px 12px; border: 1px solid transparent; border-radius: 7px 7px 0 0; background: transparent; color: var(--muted); font: 700 .88rem inherit; cursor: pointer; }
.lookup-tab.is-active { border-color: #c9dcf2; border-bottom-color: #f9fcff; background: #f9fcff; color: #17477d; }
.word-lookup-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.word-lookup-heading .text-button { color: var(--muted); font-weight: 500; text-decoration: underline; }
.word-lookup-body { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.7; }
.word-queue { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.word-queue:empty { display: none; }
.word-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 6px 8px 6px 12px; border: 1px solid #b8d2ed; border-radius: 999px; background: #fff; color: #17477d; font-weight: 700; font-size: .9rem; overflow-wrap: anywhere; }
.word-chip-remove { flex: 0 0 20px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: #dceafb; color: #17477d; line-height: 1; cursor: pointer; }
.word-lookup-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.word-lookup-actions button:disabled { opacity: .52; cursor: not-allowed; }
.word-lookup-results:empty { display: none; }
.word-lookup-results { margin-top: 14px; }
.word-lookup-demo { padding: 12px 14px; border: 1px solid #eadcb4; border-radius: 8px; background: #fdf8ec; color: #6b5317; font-size: .88rem; }
.word-lookup-demo p { margin: 4px 0 0; }
.word-lookup-toggle { position: fixed; z-index: 21; right: 24px; bottom: 24px; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; box-shadow: 0 6px 18px #123a6d44; font: 700 .9rem inherit; cursor: pointer; }
.word-lookup-badge { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #fff; color: var(--accent); font: 500 .72rem "DM Mono", monospace; }
.word-lookup-badge[hidden] { display: none; }
body { padding-bottom: 64px; }
@media (max-width: 600px) {
  .word-lookup--drawer { right: 12px; bottom: 72px; width: calc(100vw - 24px); max-height: 68vh; padding: 14px; }
  .word-lookup-toggle { right: 16px; bottom: 16px; }
  .lookup-tab { flex: 1; text-align: center; }
  .word-lookup-actions button { width: 100%; }
}
