:root {
  --green-950: #0b261b;
  --green-900: #103325;
  --green-850: #143c2b;
  --green-800: #174a35;
  --green-700: #1f5c42;
  --green-600: #2b7555;
  --green-500: #3b8b68;
  --green-100: #e6efe9;
  --green-50: #f0f6f2;
  --gold: #c7a25a;
  --gold-bright: #dfbe7b;
  --gold-light: #f0e3c4;
  --cream: #f5f1e7;
  --paper: #fffdf8;
  --ink: #22322b;
  --ink-soft: #40544a;
  --muted: #75827b;
  --line: rgba(20, 60, 43, 0.13);
  --line-strong: rgba(20, 60, 43, 0.24);
  --red: #b24a44;
  --red-bg: #fbefed;
  --amber: #a76e1f;
  --amber-bg: #fbf3e2;
  --shadow-sm: 0 6px 20px rgba(16, 51, 37, 0.06);
  --shadow-md: 0 18px 50px rgba(16, 51, 37, 0.11);
  --shadow-lg: 0 34px 80px rgba(8, 30, 20, 0.2);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --font-sans: "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
svg { display: block; }

::selection { background: var(--gold-light); color: var(--green-950); }

.app-shell { min-height: 100vh; }

.noscript {
  padding: 14px 20px;
  background: var(--red-bg);
  color: var(--red);
  text-align: center;
}

/* ---------------------------------------------------------------- Auth */

.auth-view {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: #f7f1e2;
  background:
    radial-gradient(circle at 8% 8%, rgba(199, 162, 90, 0.17), transparent 34%),
    radial-gradient(circle at 88% 78%, rgba(87, 149, 111, 0.18), transparent 40%),
    linear-gradient(132deg, #0a2419 0%, #103526 46%, #174a35 100%);
}

.auth-view::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(240, 227, 196, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 227, 196, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}

.auth-backdrop { position: absolute; inset: 0; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(1px); }
.orb-a {
  width: 430px; height: 430px; left: -170px; top: 22%;
  border: 1px solid rgba(199, 162, 90, 0.2);
  box-shadow: inset 0 0 90px rgba(199, 162, 90, 0.06);
}
.orb-b {
  width: 260px; height: 260px; right: 41%; top: -90px;
  border: 1px solid rgba(240, 227, 196, 0.12);
}
.mountain-line {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 280px; color: rgba(199, 162, 90, 0.25);
}

.auth-grid {
  position: relative;
  z-index: 2;
  width: min(1320px, calc(100% - 80px));
  min-height: calc(100vh - 82px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(400px, 0.72fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
  padding: 54px 0 40px;
}

.auth-grid > * { min-width: 0; }
.auth-intro { max-width: 690px; animation: rise 0.65s ease both; }
.auth-panel { max-width: 100%; }

.brand-lockup { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(32px, 5vh, 58px); }
.seal {
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold);
  color: var(--gold-light);
  background: rgba(199, 162, 90, 0.08);
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  box-shadow: inset 0 0 0 4px rgba(199, 162, 90, 0.06);
}
.seal-sm { width: 38px; height: 38px; font-size: 20px; flex: 0 0 auto; }
.brand-org { margin: 0; font-size: 13px; letter-spacing: 0.14em; color: var(--gold-light); }
.brand-sub { margin: 1px 0 0; font-size: 12px; letter-spacing: 0.08em; color: rgba(247, 241, 226, 0.55); }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 18px;
  color: var(--gold-bright);
  font-size: 12px;
  letter-spacing: 0.22em;
  font-weight: 600;
}
.eyebrow span { width: 28px; height: 1px; background: var(--gold); }

.auth-intro h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(38px, 4.4vw, 62px);
  line-height: 1.22;
  letter-spacing: 0.02em;
  font-weight: 700;
  color: #fffaf0;
}
.auth-intro h1 em {
  display: inline-block;
  margin-top: 2px;
  font-style: normal;
  color: var(--gold-light);
  border-bottom: 2px solid rgba(199, 162, 90, 0.55);
  padding-bottom: 3px;
}

.auth-lead {
  max-width: 580px;
  margin: 24px 0 0;
  font-size: 15px;
  line-height: 1.95;
  color: rgba(247, 241, 226, 0.7);
}

.auth-badges { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; }
.auth-badges span {
  padding: 9px 14px;
  border: 1px solid rgba(240, 227, 196, 0.18);
  background: rgba(255, 253, 248, 0.04);
  border-radius: 999px;
  font-size: 12px;
  color: rgba(247, 241, 226, 0.72);
}
.auth-badges b { color: var(--gold-light); font-size: 17px; margin-right: 2px; }

.flow-card {
  margin-top: 36px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(240, 227, 196, 0.14);
  background: rgba(255, 253, 248, 0.045);
  backdrop-filter: blur(8px);
  border-radius: 14px;
}
.flow-step { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.flow-step > span {
  flex: 0 0 auto;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 13px;
  border-bottom: 1px solid rgba(199, 162, 90, 0.4);
  line-height: 1.4;
}
.flow-step b { display: block; font-size: 13px; color: #fbf6e9; white-space: nowrap; }
.flow-step p { margin: 2px 0 0; font-size: 11px; color: rgba(247, 241, 226, 0.48); white-space: nowrap; }
.flow-card > i { width: 1px; height: 30px; background: rgba(240, 227, 196, 0.13); flex: 0 0 auto; }
.auth-quote {
  margin: 28px 0 0;
  font-family: var(--font-serif);
  color: rgba(240, 227, 196, 0.55);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.auth-panel {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border-radius: 22px;
  padding: clamp(28px, 3.2vw, 42px);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 253, 248, 0.4);
  animation: rise 0.72s 0.08s ease both;
}
.auth-panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(199, 162, 90, 0.2);
  border-radius: 15px;
  pointer-events: none;
}
.panel-head { position: relative; }
.panel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--amber);
  font-weight: 700;
  letter-spacing: 0.16em;
}
.panel-kicker::before { content: ""; width: 18px; height: 1px; background: var(--gold); }
.panel-head h2 {
  margin: 10px 0 4px;
  font-family: var(--font-serif);
  font-size: clamp(24px, 2.5vw, 30px);
  color: var(--green-900);
  letter-spacing: 0.02em;
}
.panel-head p { margin: 0; color: var(--muted); font-size: 13px; }

.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 26px 0 22px;
  padding: 4px;
  background: var(--green-50);
  border-radius: 12px;
  border: 1px solid var(--line);
}
.auth-tab {
  border: 0;
  padding: 10px 8px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: 0.2s ease;
}
.auth-tab.is-active { background: var(--paper); color: var(--green-800); box-shadow: 0 4px 14px rgba(16, 51, 37, 0.09); }

.auth-form { position: relative; }
.field { display: block; margin-bottom: 15px; }
.field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.field input, .field select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field input::placeholder { color: #a5aea8; }
.field input:focus, .field select:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(43, 117, 85, 0.1);
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.field-row { display: grid; grid-template-columns: 1fr 1.12fr; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { cursor: not-allowed; opacity: 0.5; transform: none; }
.btn-primary {
  color: #fffaf0;
  background: linear-gradient(135deg, var(--green-800), var(--green-700));
  box-shadow: 0 10px 24px rgba(23, 74, 53, 0.22);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--green-700), var(--green-600)); box-shadow: 0 12px 28px rgba(23, 74, 53, 0.26); }
.btn-ghost { color: var(--green-800); border-color: var(--line-strong); background: transparent; }
.btn-ghost:hover { background: var(--green-50); }
.btn-light { color: var(--green-900); background: #fffaf0; }
.btn-block { width: 100%; margin-top: 6px; }
.btn-wide { min-width: 190px; }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: 12px; border-radius: 8px; }
.text-link { color: var(--green-700); text-decoration: none; font-weight: 600; }
.text-link:hover { text-decoration: underline; }
.form-hint { margin: 12px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.panel-foot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}
.auth-footer {
  position: relative;
  z-index: 2;
  width: min(1320px, calc(100% - 80px));
  margin: 0 auto;
  padding: 0 0 24px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: rgba(247, 241, 226, 0.34);
  font-size: 11px;
  letter-spacing: 0.05em;
}

/* ---------------------------------------------------------------- App shell */

.app-view { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 70px;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  background: rgba(255, 253, 248, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand-button { display: flex; align-items: center; gap: 11px; border: 0; background: transparent; padding: 0; color: inherit; text-align: left; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text b { font-family: var(--font-serif); font-size: 17px; color: var(--green-900); letter-spacing: 0.04em; }
.brand-text small { color: var(--muted); font-size: 10px; letter-spacing: 0.1em; }
.topbar .seal { color: var(--green-800); border-color: rgba(199, 162, 90, 0.7); background: var(--green-50); }

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.nav-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: 0.18s ease;
}
.nav-btn:hover { color: var(--green-800); background: var(--green-50); }
.nav-btn.is-active { color: var(--green-800); background: var(--green-100); }

.user-area { position: relative; margin-left: auto; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  background: transparent;
  padding: 5px 8px 5px 5px;
  border-radius: 10px;
  color: inherit;
}
.user-chip:hover { background: var(--green-50); border-color: var(--line); }
.avatar {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--green-800);
  color: var(--gold-light);
  font-family: var(--font-serif);
  font-size: 16px;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.user-meta b { font-size: 12.5px; color: var(--ink); }
.user-meta small { font-size: 10px; color: var(--muted); }
.user-chip svg { width: 16px; height: 16px; color: var(--muted); }
.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 210px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow-md);
}
.user-menu-head { padding: 10px 10px 9px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.user-menu-head b { display: block; font-size: 13px; }
.user-menu-head span { color: var(--muted); font-size: 11px; }
.user-menu button { display: block; width: 100%; border: 0; background: transparent; text-align: left; padding: 9px 10px; border-radius: 7px; font-size: 12px; color: var(--ink-soft); }
.user-menu button:hover { background: var(--green-50); }
.user-menu .danger-text { color: var(--red); }

.main-content { flex: 1; width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 30px 0 48px; }
.page-view { animation: fadeUp 0.32s ease both; }

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 20px 0 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

/* ---------------------------------------------------------------- Dashboard */

.campaign-banner {
  margin-bottom: 18px;
  padding: 11px 16px;
  border: 1px solid rgba(199, 162, 90, 0.35);
  background: linear-gradient(90deg, #fbf5e7, #fffdf8);
  border-radius: 10px;
  color: #77551f;
  font-size: 12.5px;
}

.hero-dashboard {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: center;
  padding: clamp(26px, 4vw, 42px);
  color: #f8f3e7;
  background:
    radial-gradient(circle at 82% 30%, rgba(199, 162, 90, 0.2), transparent 30%),
    linear-gradient(120deg, #0e2d20 0%, #174a35 68%, #1d563e 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.hero-dashboard::after {
  content: "";
  position: absolute;
  right: -40px; bottom: -95px;
  width: 330px; height: 330px;
  border: 1px solid rgba(240, 227, 196, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 32px rgba(240, 227, 196, 0.025), 0 0 0 68px rgba(240, 227, 196, 0.02);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(240, 227, 196, 0.22);
  background: rgba(255, 253, 248, 0.08);
  color: var(--gold-light);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 0 3px rgba(223, 190, 123, 0.14); }
.status-pill.is-warn { color: #ffe0b3; border-color: rgba(255, 208, 137, 0.3); }
.status-pill.is-done { color: #c6efd5; border-color: rgba(151, 225, 178, 0.3); }
.status-pill.is-done::before { background: #8fdbaf; }
.hero-date { color: rgba(247, 241, 226, 0.5); font-size: 11.5px; }
.hero-copy h2 {
  margin: 16px 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.7vw, 42px);
  letter-spacing: 0.03em;
  font-weight: 700;
  color: #fffaf0;
}
.hero-copy p { max-width: 680px; margin: 0; color: rgba(247, 241, 226, 0.62); font-size: 13.5px; line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-actions .btn-primary { background: #f8f1df; color: var(--green-900); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); }
.hero-actions .btn-primary:hover { background: #fffaf0; }
.hero-actions .btn-ghost { color: rgba(247, 241, 226, 0.8); border-color: rgba(247, 241, 226, 0.25); }
.hero-actions .btn-ghost:hover { background: rgba(255, 255, 255, 0.07); }

.hero-progress { position: relative; z-index: 1; display: flex; align-items: center; gap: 24px; }
.progress-ring {
  --p: 0;
  width: 136px; height: 136px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--gold-bright) calc(var(--p) * 1%), rgba(255, 253, 248, 0.13) 0);
  position: relative;
  transition: background 0.35s ease;
}
.progress-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #143c2b; }
.ring-inner { position: relative; z-index: 1; text-align: center; }
.ring-inner b { display: block; font-family: var(--font-serif); font-size: 31px; line-height: 1.1; color: #fffaf0; }
.ring-inner span { font-size: 10px; color: rgba(247, 241, 226, 0.55); letter-spacing: 0.08em; }
.hero-progress-meta { display: flex; flex-direction: column; gap: 14px; }
.hero-progress-meta div { display: flex; align-items: baseline; gap: 6px; }
.hero-progress-meta b { font-family: var(--font-serif); font-size: 23px; color: var(--gold-light); }
.hero-progress-meta span { color: rgba(247, 241, 226, 0.5); font-size: 10.5px; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.stat-cell { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-right: 1px solid var(--line); }
.stat-cell:last-child { border-right: 0; }
.stat-icon {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: var(--green-50);
  border: 1px solid rgba(43, 117, 85, 0.13);
  color: var(--green-700);
  font-family: var(--font-serif);
  font-size: 15px;
  flex: 0 0 auto;
}
.stat-cell b { display: block; font-family: var(--font-serif); font-size: 23px; line-height: 1.1; color: var(--green-900); }
.stat-cell small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.section-kicker { margin: 0 0 3px; color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: 0.2em; }
.section-heading h3 { margin: 0; font-family: var(--font-serif); font-size: 21px; color: var(--green-900); letter-spacing: 0.02em; }
.section-note { color: var(--muted); font-size: 11px; }
.day-section { margin-top: 30px; }

.day-tabs { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; }
.day-tab {
  position: relative;
  padding: 11px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--muted);
  text-align: center;
  transition: 0.18s ease;
}
.day-tab:hover { border-color: var(--line-strong); background: #fff; }
.day-tab b { display: block; font-family: var(--font-serif); font-size: 15px; color: var(--ink-soft); line-height: 1.2; }
.day-tab span { display: block; margin-top: 2px; font-size: 9.5px; }
.day-tab i {
  display: inline-block;
  width: 5px; height: 5px;
  margin-top: 6px;
  border-radius: 50%;
  background: #d6dcd7;
}
.day-tab.is-today,
.day-tab.is-today.is-done { border-color: var(--green-600); background: var(--green-800); color: rgba(255, 253, 248, 0.65); box-shadow: 0 6px 16px rgba(23, 74, 53, 0.2); }
.day-tab.is-today b,
.day-tab.is-today.is-done b { color: #fffaf0; }
.day-tab.is-today i,
.day-tab.is-today.is-done i { background: var(--gold-bright); }
.day-tab.is-done { background: #edf5ef; border-color: rgba(43, 117, 85, 0.2); }
.day-tab.is-done i { background: var(--green-600); }
.day-tab.is-selected { outline: 2px solid rgba(199, 162, 90, 0.65); outline-offset: 2px; }
.day-tab.is-future { opacity: 0.55; }
.day-tab.is-future i { background: transparent; border: 1px solid #cfd6d0; }

.task-section { margin-top: 32px; }
.task-progress-inline { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11.5px; }
.mini-bar { width: 110px; height: 5px; border-radius: 99px; background: #e5eae6; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-600), var(--gold)); border-radius: inherit; transition: width 0.4s ease; }
.task-callout {
  margin-bottom: 14px;
  padding: 11px 15px;
  border-radius: 9px;
  background: var(--amber-bg);
  border: 1px solid rgba(167, 110, 31, 0.22);
  color: #7d571e;
  font-size: 12px;
}
.task-callout.is-info { background: var(--green-50); border-color: rgba(43, 117, 85, 0.2); color: var(--green-700); }

.module-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.module-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 154px;
  padding: 17px 17px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  text-align: left;
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}
.module-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
}
.module-card.is-available { border-color: rgba(43, 117, 85, 0.42); box-shadow: 0 8px 24px rgba(23, 74, 53, 0.08); }
.module-card.is-available::before { background: var(--green-600); }
.module-card.is-available:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(23, 74, 53, 0.13); }
.module-card.is-locked { opacity: 0.54; background: #f9f7f1; }
.module-card.is-done { background: linear-gradient(160deg, #f0f7f2, #fffdf8 70%); border-color: rgba(43, 117, 85, 0.2); }
.module-card.is-done::before { background: var(--green-500); }
.module-card.is-done:hover { transform: translateY(-1px); }
.module-card.is-active { box-shadow: 0 0 0 2px var(--gold), 0 14px 30px rgba(23, 74, 53, 0.13); }
.module-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.module-index { color: var(--gold); font-family: var(--font-serif); font-size: 12px; letter-spacing: 0.05em; }
.module-badge { padding: 3px 8px; border-radius: 999px; background: var(--green-50); color: var(--green-700); font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; }
.module-card.is-done .module-badge { background: var(--green-100); }
.module-card h4, .module-title { display: block; margin: 0 0 5px; font-size: 14px; line-height: 1.45; color: var(--green-900); font-weight: 700; }
.module-card p, .module-desc { display: -webkit-box; margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.6; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.module-bottom { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.module-state { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10.5px; font-weight: 600; }
.module-state .dot { width: 5px; height: 5px; border-radius: 50%; background: #c8d0ca; }
.module-card.is-available .module-state { color: var(--green-700); }
.module-card.is-available .module-state .dot { background: var(--green-600); }
.module-card.is-done .module-state { color: var(--green-600); }
.module-card.is-done .module-state .dot { background: var(--green-500); }
.module-score { font-family: var(--font-serif); font-size: 15px; color: var(--green-700); font-weight: 700; }
.module-score small { font-family: var(--font-sans); font-size: 9px; color: var(--muted); font-weight: 400; }
.module-arrow { color: var(--green-600); font-size: 15px; }
.module-card.is-locked .module-arrow { color: #b8c1bb; }

.guide-section { margin-top: 34px; }
.guide-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbf8f0;
  padding: 22px 24px;
  display: flex;
  gap: 26px;
  align-items: flex-start;
}
.guide-index { flex: 0 0 auto; font-family: var(--font-serif); color: var(--gold); font-size: 12px; letter-spacing: 0.1em; border-right: 1px solid var(--line); padding-right: 22px; }
.guide-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; flex: 1; }
.guide-steps b { display: block; font-size: 11.5px; color: var(--green-800); }
.guide-steps p { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.65; }

/* ---------------------------------------------------------------- Study */

.subpage-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.back-btn { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--muted); font-size: 12.5px; padding: 6px 0; }
.back-btn:hover { color: var(--green-800); }
.back-btn svg { width: 17px; height: 17px; }
.subpage-step { color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: 0.15em; }

.study-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 44px);
  border-radius: var(--radius-lg);
  background: linear-gradient(125deg, #113526, #1c513a);
  color: #f8f3e7;
  box-shadow: var(--shadow-md);
}
.study-hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -70px; top: -110px; border: 1px solid rgba(240, 227, 196, 0.12); border-radius: 50%; box-shadow: 0 0 0 32px rgba(240, 227, 196, 0.025); }
.study-hero-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.study-number { display: inline-flex; align-items: baseline; gap: 3px; color: var(--gold-bright); font-family: var(--font-serif); }
.study-number b { font-size: 32px; line-height: 1; }
.study-number span { font-size: 11px; color: rgba(247, 241, 226, 0.45); }
.study-tag { padding: 3px 9px; border: 1px solid rgba(240, 227, 196, 0.22); border-radius: 999px; color: var(--gold-light); font-size: 9.5px; letter-spacing: 0.08em; }
.study-hero h2 { position: relative; z-index: 1; margin: 18px 0 8px; font-family: var(--font-serif); font-size: clamp(27px, 3.6vw, 40px); line-height: 1.3; color: #fffaf0; }
.study-kicker { position: relative; z-index: 1; margin: 0; color: rgba(247, 241, 226, 0.55); font-size: 12.5px; }
.study-source { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(240, 227, 196, 0.14); color: rgba(240, 227, 196, 0.5); font-size: 10.5px; }

.study-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.fact-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow-sm); }
.fact-card small { display: block; color: var(--muted); font-size: 10px; letter-spacing: 0.03em; }
.fact-card b { display: block; margin: 5px 0 2px; font-family: var(--font-serif); font-size: 19px; line-height: 1.3; color: var(--green-800); }
.fact-card p { margin: 0; color: #8a958e; font-size: 9.5px; line-height: 1.55; }

.study-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; margin-top: 20px; align-items: start; }
.study-main, .study-side { display: flex; flex-direction: column; gap: 14px; }
.study-section { padding: clamp(20px, 2.7vw, 30px); border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-sm); }
.study-section h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-family: var(--font-serif); font-size: 18px; color: var(--green-900); }
.study-section h3::before { content: ""; width: 4px; height: 17px; background: var(--gold); border-radius: 2px; }
.study-section ul { margin: 0; padding: 0; list-style: none; }
.study-section li { position: relative; padding: 7px 0 7px 18px; color: var(--ink-soft); font-size: 13.5px; line-height: 1.8; border-bottom: 1px dashed rgba(20, 60, 43, 0.08); }
.study-section li:last-child { border-bottom: 0; padding-bottom: 0; }
.study-section li::before { content: ""; position: absolute; left: 1px; top: 17px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.study-tips { padding: 21px 23px; border-radius: 14px; background: linear-gradient(150deg, #fbf5e7, #fffdf8); border: 1px solid rgba(199, 162, 90, 0.28); }
.study-tips h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: 12px; color: #7d571e; letter-spacing: 0.06em; }
.study-tips h4::before { content: "！"; display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; background: rgba(199, 162, 90, 0.18); color: #8b6121; font-size: 10px; }
.study-tips ul { margin: 0; padding: 0; list-style: none; }
.study-tips li { position: relative; padding: 5px 0 5px 14px; color: #6f5a33; font-size: 11.5px; line-height: 1.75; }
.study-tips li::before { content: "·"; position: absolute; left: 0; color: var(--gold); font-weight: 700; }
.study-side-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.study-side-card h4 { margin: 0 0 10px; font-family: var(--font-serif); color: var(--green-900); font-size: 14px; }
.study-side-card p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.8; }
.study-side-card .rule-list { margin: 0; padding: 0; list-style: none; }
.study-side-card .rule-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 11.5px; }
.study-side-card .rule-list li:last-child { border-bottom: 0; }
.study-side-card .rule-list b { color: var(--green-700); }
.study-action-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 -8px 30px rgba(16, 51, 37, 0.08);
}
.study-action-info b { display: block; font-size: 12.5px; color: var(--green-900); }
.study-action-info span { display: block; color: var(--muted); font-size: 10.5px; }

/* ---------------------------------------------------------------- Quiz */

.quiz-view { max-width: 920px; margin: 0 auto; width: 100%; }
.quiz-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 4px 0 18px; }
.quiz-head h2 { margin: 4px 0 5px; font-family: var(--font-serif); font-size: 29px; color: var(--green-900); }
.quiz-head p { margin: 0; color: var(--muted); font-size: 12px; }
.quiz-score-rule { flex: 0 0 auto; text-align: center; min-width: 72px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.quiz-score-rule b { display: block; font-family: var(--font-serif); font-size: 23px; line-height: 1.1; color: var(--green-700); }
.quiz-score-rule span { color: var(--muted); font-size: 9.5px; }
.quiz-form { display: flex; flex-direction: column; gap: 13px; }
.quiz-card { padding: 22px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-sm); }
.quiz-card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 15px; }
.quiz-qno { flex: 0 0 auto; width: 27px; height: 27px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--green-800); color: var(--gold-light); font-family: var(--font-serif); font-size: 13px; }
.quiz-stem { flex: 1; margin: 2px 0 0; font-size: 14.5px; line-height: 1.75; color: var(--ink); font-weight: 600; }
.quiz-type { flex: 0 0 auto; padding: 3px 7px; border-radius: 5px; font-size: 9px; font-weight: 700; letter-spacing: 0.06em; background: var(--green-50); color: var(--green-700); }
.quiz-type.is-multiple { background: var(--amber-bg); color: var(--amber); }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quiz-option { position: relative; }
.quiz-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.quiz-option label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffdfa;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.6;
  cursor: pointer;
  transition: 0.16s ease;
  min-height: 46px;
}
.quiz-option label:hover { border-color: rgba(43, 117, 85, 0.42); background: var(--green-50); }
.quiz-option input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 2px; }
.quiz-option input:checked + label { border-color: var(--green-600); background: #eef6f1; color: var(--green-900); box-shadow: inset 0 0 0 1px rgba(43, 117, 85, 0.18); }
.option-letter {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: #fff;
}
.quiz-option input:checked + label .option-letter { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.quiz-submit-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 -8px 30px rgba(16, 51, 37, 0.08);
}
.quiz-submit-bar > span { color: var(--muted); font-size: 11.5px; }
.quiz-submit-bar .btn { margin-left: auto; }

/* ---------------------------------------------------------------- Result */

.result-wrap { max-width: 900px; margin: 0 auto; }
.result-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: clamp(22px, 4vw, 46px);
  padding: clamp(26px, 4vw, 42px);
  border-radius: var(--radius-lg);
  color: #f8f3e7;
  background: linear-gradient(125deg, #113526, #1d573e);
  box-shadow: var(--shadow-md);
}
.result-hero.is-fail { background: linear-gradient(125deg, #3e2a1d, #6d4a2e); }
.result-hero::after { content: ""; position: absolute; right: -60px; top: -100px; width: 280px; height: 280px; border-radius: 50%; border: 1px solid rgba(240, 227, 196, 0.12); box-shadow: 0 0 0 36px rgba(240, 227, 196, 0.025); }
.result-score-ring { position: relative; z-index: 1; flex: 0 0 auto; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold-bright) calc(var(--p) * 1%), rgba(255, 253, 248, 0.14) 0); }
.result-score-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #174a35; }
.result-hero.is-fail .result-score-ring::before { background: #543e2a; }
.result-score-ring div { position: relative; z-index: 1; text-align: center; }
.result-score-ring b { display: block; font-family: var(--font-serif); font-size: 39px; line-height: 1; color: #fffaf0; }
.result-score-ring span { font-size: 9.5px; color: rgba(247, 241, 226, 0.55); }
.result-copy { position: relative; z-index: 1; flex: 1; }
.result-copy .eyebrow { margin-bottom: 8px; }
.result-copy h2 { margin: 0 0 5px; font-family: var(--font-serif); font-size: clamp(25px, 3vw, 34px); color: #fffaf0; }
.result-copy p { margin: 0; color: rgba(247, 241, 226, 0.62); font-size: 12.5px; line-height: 1.8; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.result-actions .btn-primary { background: #f8f1df; color: var(--green-900); }
.result-actions .btn-primary:hover { background: #fffaf0; }
.result-actions .btn-ghost { color: rgba(247, 241, 226, 0.82); border-color: rgba(247, 241, 226, 0.26); }
.result-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.result-summary div { padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.result-summary small { display: block; color: var(--muted); font-size: 9.5px; }
.result-summary b { display: block; margin-top: 2px; font-family: var(--font-serif); font-size: 19px; color: var(--green-800); }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 26px 0 12px; }
.review-head h3 { margin: 0; font-family: var(--font-serif); font-size: 19px; color: var(--green-900); }
.review-head span { color: var(--muted); font-size: 10.5px; }
.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-card { padding: 20px 22px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: var(--shadow-sm); }
.review-card.is-wrong { border-color: rgba(178, 74, 68, 0.25); background: #fffdfb; }
.review-card-head { display: flex; align-items: flex-start; gap: 10px; }
.review-status { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 9.5px; font-weight: 700; }
.review-status.is-right { background: var(--green-100); color: var(--green-700); }
.review-status.is-wrong { background: var(--red-bg); color: var(--red); }
.review-stem { flex: 1; margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.7; color: var(--ink); }
.review-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 12px 0 0; }
.review-option { display: flex; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 11.5px; color: var(--ink-soft); background: #fffdfa; }
.review-option.is-correct { border-color: rgba(43, 117, 85, 0.4); background: #eef6f1; color: var(--green-800); }
.review-option.is-selected-wrong { border-color: rgba(178, 74, 68, 0.35); background: var(--red-bg); color: var(--red); }
.review-option .option-letter { width: 18px; height: 18px; font-size: 9px; }
.review-explain { margin: 12px 0 0; padding: 11px 13px; border-left: 3px solid var(--gold); background: #fbf8f0; color: #5f543d; font-size: 11.5px; line-height: 1.75; }
.review-explain b { color: #7d571e; }
.review-source { margin: 7px 0 0; color: #99a29c; font-size: 9.5px; }

/* ---------------------------------------------------------------- Ranking */

.ranking-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.ranking-head h2 { margin: 2px 0 5px; font-family: var(--font-serif); font-size: 32px; color: var(--green-900); }
.ranking-head p { margin: 0; color: var(--muted); font-size: 12px; }
.ranking-updated { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.rank-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 20px; }
.rank-tab { border: 0; background: transparent; border-radius: 7px; padding: 8px 17px; color: var(--muted); font-size: 12px; font-weight: 600; }
.rank-tab.is-active { background: var(--green-800); color: #fffaf0; box-shadow: 0 4px 12px rgba(23, 74, 53, 0.18); }
.rank-note { margin: -8px 0 16px; color: var(--muted); font-size: 10.5px; }

.podium { display: grid; grid-template-columns: 1.1fr 0.9fr 0.9fr; gap: 12px; align-items: end; margin-bottom: 18px; }
.podium-card { position: relative; padding: 20px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); text-align: center; box-shadow: var(--shadow-sm); }
.podium-card.is-first { padding-top: 27px; padding-bottom: 27px; border-color: rgba(199, 162, 90, 0.45); background: linear-gradient(160deg, #fffaf0, #fffdf8); }
.podium-crown { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: 2px 10px; border-radius: 999px; background: var(--gold); color: #fffaf0; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; white-space: nowrap; }
.podium-rank { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--green-50); color: var(--green-700); font-family: var(--font-serif); font-size: 14px; margin-bottom: 8px; }
.podium-card.is-first .podium-rank { background: var(--green-800); color: var(--gold-light); width: 36px; height: 36px; font-size: 17px; }
.podium-card h4 { margin: 0; font-size: 14px; color: var(--ink); }
.podium-card p { margin: 2px 0 9px; color: var(--muted); font-size: 10px; }
.podium-metrics { display: flex; justify-content: center; gap: 14px; }
.podium-metrics b { display: block; font-family: var(--font-serif); font-size: 17px; color: var(--green-700); }
.podium-metrics span { color: var(--muted); font-size: 9px; }
.podium-card.is-me { box-shadow: 0 0 0 2px rgba(199, 162, 90, 0.5), var(--shadow-sm); }

.rank-table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.rank-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rank-table th { text-align: left; padding: 12px 14px; background: #f7f5ed; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: 0.05em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rank-table td { padding: 12px 14px; border-bottom: 1px solid rgba(20, 60, 43, 0.07); color: var(--ink-soft); vertical-align: middle; }
.rank-table tr:last-child td { border-bottom: 0; }
.rank-table tr.is-me td { background: #fbf4e3; }
.rank-table tr:hover td { background: #fbf9f2; }
.rank-table tr.is-me:hover td { background: #f8efd9; }
.rank-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: #f1f4f1; color: var(--muted); font-family: var(--font-serif); font-size: 11px; }
.rank-num.top-1 { background: #c7a25a; color: #fff; }
.rank-num.top-2 { background: #aeb9b2; color: #fff; }
.rank-num.top-3 { background: #b98757; color: #fff; }
.rank-name { font-weight: 700; color: var(--ink); }
.rank-sub { display: block; color: var(--muted); font-size: 9.5px; font-weight: 400; }
.rank-person { display: flex; align-items: center; gap: 8px; }
.rank-avatar { width: 27px; height: 27px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--green-50); color: var(--green-700); font-family: var(--font-serif); font-size: 12px; flex: 0 0 auto; }
.rank-score { font-family: var(--font-serif); font-size: 15px; color: var(--green-700); font-weight: 700; }
.rank-bar { width: 72px; height: 4px; border-radius: 99px; background: #e8ece8; overflow: hidden; margin-top: 4px; }
.rank-bar i { display: block; height: 100%; background: var(--green-500); border-radius: inherit; }
.rank-unit-card { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-sm); }
.rank-unit-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.rank-unit-head b { font-size: 14px; color: var(--ink); }
.rank-unit-head span { color: var(--muted); font-size: 10px; }
.rank-unit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.rank-unit-metric { background: #f8f6ef; border-radius: 8px; padding: 9px 10px; }
.rank-unit-metric b { display: block; font-family: var(--font-serif); font-size: 17px; color: var(--green-700); }
.rank-unit-metric span { color: var(--muted); font-size: 9px; }
.empty-state { padding: 54px 20px; text-align: center; color: var(--muted); background: var(--paper); border: 1px dashed var(--line-strong); border-radius: 14px; }
.empty-state b { display: block; font-family: var(--font-serif); font-size: 19px; color: var(--ink-soft); margin-bottom: 4px; }
.empty-state p { margin: 0; font-size: 11.5px; }

/* ---------------------------------------------------------------- Toast / loading */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  transform: translateX(-50%);
  max-width: min(520px, calc(100% - 32px));
  padding: 11px 18px;
  border-radius: 10px;
  background: rgba(16, 51, 37, 0.96);
  color: #f8f3e7;
  font-size: 12.5px;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.24s ease both;
}
.toast.is-error { background: rgba(126, 48, 42, 0.97); }
.toast.is-success { background: rgba(23, 74, 53, 0.97); }
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(10, 36, 25, 0.25);
  backdrop-filter: blur(3px);
}
.loading-card { display: flex; align-items: center; gap: 11px; padding: 14px 20px; border-radius: 12px; background: var(--paper); box-shadow: var(--shadow-md); color: var(--ink-soft); font-size: 12px; }
.spinner { width: 17px; height: 17px; border: 2px solid rgba(43, 117, 85, 0.2); border-top-color: var(--green-600); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* ---------------------------------------------------------------- Responsive */

@media (max-width: 1100px) {
  .auth-grid { grid-template-columns: minmax(0, 1fr) minmax(370px, 0.8fr); gap: 44px; width: min(100% - 56px, 1080px); }
  .flow-step p { white-space: normal; }
  .study-layout { grid-template-columns: minmax(0, 1fr) 270px; }
  .module-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .auth-grid { grid-template-columns: 1fr; width: min(100% - 40px, 640px); padding: 34px 0 30px; gap: 28px; }
  .auth-intro { max-width: none; }
  .brand-lockup { margin-bottom: 26px; }
  .auth-intro h1 { font-size: clamp(32px, 6.4vw, 46px); }
  .auth-lead { margin-top: 16px; font-size: 13.5px; }
  .flow-card { margin-top: 22px; flex-wrap: wrap; gap: 12px 16px; }
  .flow-card > i { display: none; }
  .flow-step { flex: 1 1 28%; }
  .auth-quote { display: none; }
  .auth-panel { padding: 26px 24px; }
  .auth-footer { width: calc(100% - 40px); flex-direction: column; gap: 3px; }
  .main-content { width: calc(100% - 32px); padding-top: 20px; }
  .topbar { height: 62px; padding: 0 16px; gap: 12px; }
  .brand-text b { font-size: 15px; }
  .brand-text small { display: none; }
  .main-nav { margin-left: 4px; }
  .nav-btn { padding: 7px 10px; font-size: 12px; }
  .user-meta { display: none; }
  .user-chip { padding: 4px; }
  .hero-dashboard { grid-template-columns: 1fr; gap: 22px; padding: 26px 22px; }
  .hero-progress { justify-content: flex-start; }
  .progress-ring { width: 112px; height: 112px; }
  .ring-inner b { font-size: 26px; }
  .hero-progress-meta { flex-direction: row; gap: 22px; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-cell:nth-child(2) { border-right: 0; }
  .stat-cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .day-tabs { display: flex; overflow-x: auto; padding-bottom: 5px; scrollbar-width: thin; }
  .day-tab { flex: 0 0 72px; }
  .module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .guide-card { flex-direction: column; gap: 14px; }
  .guide-index { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
  .guide-steps { grid-template-columns: 1fr 1fr; gap: 14px; }
  .study-layout { grid-template-columns: 1fr; }
  .study-side { display: grid; grid-template-columns: 1fr 1fr; }
  .study-facts { grid-template-columns: 1fr 1fr; }
  .rank-unit-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  body { font-size: 14px; }
  .auth-view { min-height: 100svh; }
  .auth-grid { width: calc(100% - 28px); padding-top: 24px; }
  .brand-lockup { gap: 11px; margin-bottom: 22px; }
  .seal { width: 42px; height: 42px; font-size: 23px; }
  .auth-intro h1 { font-size: clamp(29px, 8.6vw, 38px); }
  .auth-intro h1 em { border-bottom-width: 1px; }
  .eyebrow { font-size: 10px; letter-spacing: 0.14em; }
  .auth-badges { gap: 7px; margin-top: 20px; }
  .auth-badges span { padding: 7px 10px; font-size: 10.5px; }
  .auth-badges b { font-size: 14px; }
  .flow-card { display: none; }
  .auth-lead { margin-top: 14px; }
  .auth-intro h1, .auth-lead { overflow-wrap: anywhere; }
  .auth-panel { border-radius: 17px; padding: 23px 19px; width: 100%; }
  .auth-panel::before { inset: 7px; border-radius: 12px; }
  .auth-tabs { margin: 20px 0 18px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .field { margin-bottom: 13px; }
  .field input, .field select { height: 44px; }
  .panel-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
  .auth-footer { width: calc(100% - 28px); font-size: 9.5px; }
  .main-content { width: calc(100% - 24px); padding-bottom: 30px; }
  .topbar { height: 58px; gap: 6px; padding: 0 12px; }
  .seal-sm { width: 32px; height: 32px; font-size: 18px; }
  .brand-text b { font-size: 13px; }
  .main-nav { gap: 0; margin-left: 2px; }
  .nav-btn { font-size: 11px; padding: 6px 7px; }
  .user-chip svg { display: none; }
  .avatar { width: 30px; height: 30px; font-size: 14px; }
  .app-footer { width: calc(100% - 24px); flex-direction: column; gap: 3px; font-size: 9px; }
  .hero-dashboard { border-radius: 17px; padding: 24px 19px; }
  .hero-copy h2 { font-size: 27px; }
  .hero-copy p { font-size: 12px; }
  .hero-progress { gap: 18px; }
  .progress-ring { width: 100px; height: 100px; }
  .progress-ring::before { inset: 7px; }
  .ring-inner b { font-size: 23px; }
  .hero-progress-meta b { font-size: 20px; }
  .stat-cell { padding: 14px; gap: 9px; }
  .stat-icon { width: 31px; height: 31px; font-size: 13px; }
  .stat-cell b { font-size: 20px; }
  .section-heading { align-items: flex-start; }
  .section-heading h3 { font-size: 18px; }
  .section-note { display: none; }
  .task-progress-inline { margin-top: 4px; }
  .mini-bar { width: 72px; }
  .module-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .module-card { min-height: 142px; padding: 14px 13px 12px; border-radius: 11px; }
  .module-card h4, .module-title { font-size: 12.5px; }
  .module-card p, .module-desc { font-size: 9.5px; -webkit-line-clamp: 2; }
  .module-badge { font-size: 8.5px; padding: 2px 6px; }
  .module-index { font-size: 10px; }
  .module-state { font-size: 9.5px; }
  .module-score { font-size: 13px; }
  .guide-card { padding: 17px; }
  .guide-steps { gap: 11px; }
  .guide-steps b { font-size: 10.5px; }
  .guide-steps p { font-size: 9.5px; }
  .study-hero { padding: 24px 19px; border-radius: 17px; }
  .study-hero h2 { font-size: 27px; }
  .study-facts { gap: 7px; }
  .fact-card { padding: 12px; }
  .fact-card b { font-size: 16px; }
  .study-section { padding: 19px 17px; }
  .study-section h3 { font-size: 16px; }
  .study-section li { font-size: 12.5px; line-height: 1.75; }
  .study-side { grid-template-columns: 1fr; }
  .study-action-bar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  .study-action-info { text-align: center; }
  .study-action-bar .btn { width: 100%; }
  .quiz-head { gap: 12px; }
  .quiz-head h2 { font-size: 23px; }
  .quiz-score-rule { min-width: 60px; padding: 6px 9px; }
  .quiz-score-rule b { font-size: 19px; }
  .quiz-card { padding: 17px 15px; }
  .quiz-stem { font-size: 13.5px; }
  .quiz-options { grid-template-columns: 1fr; }
  .quiz-submit-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .quiz-submit-bar > span { text-align: center; }
  .quiz-submit-bar .btn { width: 100%; }
  .result-hero { flex-direction: column; align-items: flex-start; gap: 18px; padding: 24px 19px; border-radius: 17px; }
  .result-score-ring { width: 105px; height: 105px; }
  .result-score-ring b { font-size: 31px; }
  .result-summary { grid-template-columns: 1fr; }
  .review-card { padding: 16px 15px; }
  .review-options { grid-template-columns: 1fr; }
  .ranking-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .ranking-head h2 { font-size: 26px; }
  .rank-tabs { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .rank-tab { padding: 8px 4px; font-size: 11px; }
  .podium { grid-template-columns: 1fr 1fr; }
  .podium-card.is-first { grid-column: 1 / -1; }
  .rank-table-wrap { overflow-x: auto; }
  .rank-table { min-width: 620px; }
  .rank-unit-grid { grid-template-columns: 1fr 1fr; }
  .toast { bottom: 20px; }
}

@media (max-width: 380px) {
  .module-grid { grid-template-columns: 1fr; }
  .auth-badges span { flex: 1 1 40%; }
  .hero-progress { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
