/* ============================================================
   石川研究室 人工数字学習実験システム — デモ用スタイル
   仕様書の指示に合わせ、PC専用・装飾を抑えた白黒ベースのUI。
   ============================================================ */

:root {
  --ink: #17181c;
  --ink-soft: #4b4e57;
  --line: #d8d9dd;
  --line-soft: #eceded;
  --paper: #ffffff;
  --paper-soft: #f6f6f4;
  --accent: #22314f;
  --accent-soft: #eef0f5;
  --good: #24603f;
  --bad: #8a2a2a;
  --radius: 3px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.05);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  min-width: 1180px;
  background: var(--paper-soft);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  font-feature-settings: "palt";
}
h1, h2, h3 {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Georgia", serif;
  font-weight: 600;
  margin: 0 0 .5em;
  letter-spacing: .02em;
}
p { line-height: 1.9; color: var(--ink-soft); margin: 0 0 1em; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; }

/* ---------- Top bar (全ページ共通) ---------- */
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 16px; font-weight: 700; color: var(--ink); text-decoration: none;
}
.brand .mark {
  width: 28px; height: 28px; border: 1.5px solid var(--ink);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: serif; font-size: 13px;
}
.brand .sub { font-size: 11px; color: var(--ink-soft); font-family: system-ui, sans-serif; font-weight: 400; letter-spacing: .04em; }
.topnav { display: flex; align-items: center; gap: 28px; font-size: 13px; }
.topnav a { color: var(--ink-soft); text-decoration: none; }
.topnav a:hover { color: var(--ink); }
.topnav .pid {
  background: var(--accent-soft); color: var(--accent);
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.topnav .role-admin {
  background: #2c2c2c; color: #fff; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
}

/* ---------- Hero (トップページ等のみ写真使用) ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
}
.hero img { width: 100%; height: 420px; object-fit: cover; filter: grayscale(35%) brightness(.55); }
.hero-text {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start;
}
.hero-text .wrap { width: 100%; }
.hero-eyebrow { font-size: 12px; letter-spacing: .18em; color: #d9dce6; margin-bottom: 14px; }
.hero-text h1 { font-size: 34px; color: #fff; max-width: 720px; line-height: 1.6; }
.hero-text p { color: #e4e5ea; max-width: 560px; }

.band {
  display: flex; align-items: stretch; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.band img { width: 42%; height: 280px; object-fit: cover; filter: grayscale(20%); }
.band .band-text { flex: 1; padding: 40px 48px; display: flex; flex-direction: column; justify-content: center; }
.band.reverse { flex-direction: row-reverse; }

/* ---------- Section / cards ---------- */
section { padding: 56px 0; }
.section-title { font-size: 22px; margin-bottom: 6px; }
.section-lead { color: var(--ink-soft); font-size: 13px; margin-bottom: 32px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px;
}
.card h3 { font-size: 15px; margin-bottom: 8px; }
.card p { font-size: 13px; margin-bottom: 0; }
.card .num { font-size: 11px; color: var(--ink-soft); letter-spacing: .1em; margin-bottom: 10px; display: block; }

/* ---------- Phase table (トップページ：実験設計の要約) ---------- */
.phase-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.phase-table th, .phase-table td { border: 1px solid var(--line); padding: 12px 14px; text-align: left; vertical-align: top; }
.phase-table th { background: var(--paper-soft); font-weight: 600; width: 110px; }
.phase-table td.weeks { width: 90px; color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: var(--radius); font-size: 14px; font-weight: 600;
  border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer;
  text-decoration: none; transition: opacity .15s;
}
.btn:hover { opacity: .82; }
.btn.outline { background: transparent; color: var(--ink); }
.btn.ghost { border-color: var(--line); color: var(--ink-soft); }
.btn.lg { padding: 15px 40px; font-size: 15px; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; align-items: center; }

/* ---------- Auth panel ---------- */
.auth-shell { display: flex; min-height: calc(100vh - 64px); }
.auth-side { width: 42%; position: relative; }
.auth-side img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(45%); position: absolute; inset: 0; }
.auth-side .overlay {
  position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,22,28,.15), rgba(20,22,28,.75));
  color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px;
}
.auth-side .overlay .quote { font-size: 15px; line-height: 2; max-width: 380px; }
.auth-side .overlay .who { margin-top: 18px; font-size: 12px; color: #cfd2dc; letter-spacing: .06em; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-box { width: 380px; }
.auth-box h1 { font-size: 22px; margin-bottom: 6px; }
.auth-box .lead { font-size: 13px; color: var(--ink-soft); margin-bottom: 32px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; letter-spacing: .03em; }
.field input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 14px; background: var(--paper); color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--ink); }
.hint { font-size: 12px; color: #9a9da6; margin-top: 22px; line-height: 1.8; }
.error-msg { font-size: 12px; color: var(--bad); margin: -6px 0 14px; display: none; }
.error-msg.show { display: block; }

/* ---------- Dashboard ---------- */
.page-head { padding: 40px 0 8px; }
.page-head .eyebrow { font-size: 11px; letter-spacing: .12em; color: var(--ink-soft); margin-bottom: 8px; }
.page-head h1 { font-size: 24px; }

.progress-summary { display: flex; gap: 16px; margin: 28px 0 36px; }
.stat {
  flex: 1; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
}
.stat .label { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; }
.stat .value { font-size: 28px; font-weight: 700; font-family: "Hiragino Mincho ProN", serif; }
.stat .value small { font-size: 13px; font-weight: 400; color: var(--ink-soft); }

.progressbar { height: 6px; background: var(--line-soft); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.progressbar > i { display: block; height: 100%; background: var(--ink); }

.day-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 48px; }
.day-row {
  display: flex; align-items: center; gap: 18px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 20px;
}
.day-row .day-idx {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; border: 1px solid var(--line); color: var(--ink-soft); flex-shrink: 0;
}
.day-row.done .day-idx { background: var(--ink); border-color: var(--ink); color: #fff; }
.day-row.active .day-idx { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.day-row .day-body { flex: 1; }
.day-row .day-title { font-size: 14px; font-weight: 600; }
.day-row .day-desc { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.day-row .day-score { font-size: 13px; color: var(--ink-soft); width: 90px; text-align: right; }
.tag {
  font-size: 11px; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--line); color: var(--ink-soft);
}
.tag.locked { color: #b7b9c0; }

/* ---------- Exercise chrome (フラッシュカード/クイズ/並替/書字/結果 共通) ---------- */
.ex-shell { min-height: calc(100vh - 64px); display: flex; flex-direction: column; }
.ex-top { border-bottom: 1px solid var(--line); background: var(--paper); }
.ex-top .wrap { display: flex; align-items: center; justify-content: space-between; padding: 16px 32px; }
.ex-top .ex-name { font-size: 13px; font-weight: 600; }
.ex-top .ex-meta { font-size: 12px; color: var(--ink-soft); }
.ex-progress { height: 3px; background: var(--line-soft); }
.ex-progress > i { display: block; height: 100%; background: var(--ink); transition: width .25s; }
.ex-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; }

.ex-instruction { font-size: 13px; color: var(--ink-soft); margin-bottom: 26px; text-align: center; }

.flash-card {
  width: 320px; height: 320px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: var(--shadow);
  cursor: pointer; user-select: none; position: relative;
}
.flash-card .symbol-svg { margin-bottom: 20px; }
.flash-card .meaning { font-size: 22px; font-weight: 700; letter-spacing: .04em; opacity: 0; transition: opacity .15s; }
.flash-card.revealed .meaning { opacity: 1; }
.flash-card .flip-hint { position: absolute; bottom: 18px; font-size: 11px; color: #b0b2ba; letter-spacing: .04em; }

.quiz-symbol { margin-bottom: 34px; }
.quiz-question { font-size: 14px; color: var(--ink-soft); margin-bottom: 24px; }
.quiz-options { display: grid; grid-template-columns: repeat(2, 200px); gap: 14px; }
.quiz-opt {
  padding: 18px 10px; border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius);
  font-size: 16px; font-weight: 600; cursor: pointer; text-align: center; transition: border-color .12s, background .12s;
}
.quiz-opt:hover { border-color: var(--ink); }
.quiz-opt.correct { border-color: var(--good); background: #eef4f0; color: var(--good); }
.quiz-opt.wrong { border-color: var(--bad); background: #f6ecec; color: var(--bad); }
.quiz-opt.disabled { pointer-events: none; }

.order-row { display: flex; gap: 14px; margin-bottom: 30px; }
.order-slot {
  width: 84px; height: 84px; border: 1.5px dashed var(--line); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: #c3c5cc;
}
.order-slot.filled { border-style: solid; background: var(--paper); color: var(--ink); }
.order-pool { display: flex; gap: 14px; padding-top: 26px; border-top: 1px solid var(--line-soft); }
.order-chip {
  width: 84px; height: 84px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  display: flex; align-items: center; justify-content: center; cursor: grab; box-shadow: var(--shadow);
}
.order-chip.used { opacity: .25; pointer-events: none; }
.order-chip .symbol-svg { width: 52px; height: 52px; }

.hw-photo { width: 420px; border-radius: var(--radius); margin-bottom: 26px; filter: grayscale(60%); }
.hw-target { display: flex; align-items: center; gap: 22px; margin-bottom: 30px; }
.hw-target .symbol-svg { width: 120px; height: 120px; }
.hw-target .hw-name { font-size: 20px; font-weight: 700; }

.result-score {
  width: 220px; height: 220px; border-radius: 50%; border: 10px solid var(--line-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center; margin-bottom: 30px; position: relative;
}
.result-score .pct { font-size: 40px; font-weight: 700; font-family: "Hiragino Mincho ProN", serif; }
.result-score .lbl { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }
.result-detail { display: flex; gap: 40px; margin-bottom: 34px; }
.result-detail .d { text-align: center; }
.result-detail .d .n { font-size: 20px; font-weight: 700; }
.result-detail .d .t { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Admin ---------- */
.admin-band { background: #1c1d22; color: #fff; padding: 28px 0; }
.admin-band .wrap { display: flex; align-items: center; justify-content: space-between; }
.admin-band h1 { color: #fff; font-size: 20px; margin: 0; }
.admin-band p { color: #b7b9c4; margin: 4px 0 0; font-size: 12px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 16px; }
.toolbar .search { display: flex; gap: 10px; }
.toolbar input[type=text] {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; width: 220px;
}

table.admin-table { width: 100%; border-collapse: collapse; background: var(--paper); font-size: 13px; }
table.admin-table th, table.admin-table td { border-bottom: 1px solid var(--line); padding: 12px 14px; text-align: left; }
table.admin-table thead th { background: var(--paper-soft); font-size: 11px; color: var(--ink-soft); font-weight: 600; letter-spacing: .04em; }
table.admin-table tbody tr:hover { background: var(--paper-soft); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; }
.badge { font-size: 11px; padding: 3px 9px; border-radius: 20px; }
.badge.active { background: #eaf3ee; color: var(--good); }
.badge.done { background: var(--accent-soft); color: var(--accent); }
.badge.new { background: #f2f2ee; color: #7c7d6e; }
.acc-bar { width: 90px; height: 5px; background: var(--line-soft); border-radius: 4px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
.acc-bar > i { display: block; height: 100%; background: var(--ink); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,16,20,.5); display: none; align-items: center; justify-content: center; z-index: 50;
}
.modal-backdrop.show { display: flex; }
.modal { width: 420px; background: var(--paper); border-radius: var(--radius); padding: 28px; }
.modal h3 { font-size: 16px; margin-bottom: 4px; }
.modal .lead { font-size: 12px; color: var(--ink-soft); margin-bottom: 22px; }

footer { border-top: 1px solid var(--line); padding: 26px 0; }
footer .wrap { display: flex; justify-content: space-between; font-size: 11px; color: #a5a7af; }
