:root {
  color-scheme: light;
  --ink: #24352e;
  --muted: #68736d;
  --paper: #f6efe2;
  --card: #fffaf1;
  --leaf: #2d6a4f;
  --leaf-dark: #1e4d39;
  --sun: #f2b84b;
  --line: rgba(36, 53, 46, 0.15);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 12%, rgba(242, 184, 75, 0.22), transparent 26rem),
    linear-gradient(135deg, #f8f1e4 0%, #edf2e5 100%);
}

button, input { font: inherit; }

.shell { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 56px 0 90px; }
.hero { padding: 32px 4px 56px; }
.topline { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.city-clock { color: var(--muted); font-size: 13px; font-weight: 700; }
.eyebrow, .kicker { color: var(--leaf); font-size: 12px; font-weight: 800; letter-spacing: 0.16em; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; }
h1 { margin: 12px 0 10px; font-family: Georgia, "Songti SC", serif; font-size: clamp(52px, 8vw, 96px); line-height: 0.95; font-weight: 500; }
.hero p { max-width: 640px; margin: 20px 0 0; color: var(--muted); font-size: 18px; line-height: 1.8; }
.sun { display: grid; place-items: center; width: 112px; height: 112px; border-radius: 50%; background: var(--sun); box-shadow: 0 16px 50px rgba(160, 105, 23, 0.2); }
.sun span { font-family: Georgia, "Songti SC", serif; font-size: 38px; }

.panel { display: grid; grid-template-columns: 92px 1fr; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 28px; overflow: hidden; background: rgba(255, 250, 241, 0.84); box-shadow: 0 22px 70px rgba(50, 63, 54, 0.08); backdrop-filter: blur(12px); }
.section-number { padding: 34px 24px; border-right: 1px solid var(--line); color: var(--leaf); font-family: Georgia, serif; font-size: 18px; }
.section-content { padding: 42px 48px 48px; }
h2 { margin: 8px 0 12px; font-family: Georgia, "Songti SC", serif; font-size: clamp(30px, 5vw, 46px); font-weight: 500; }
.muted { color: var(--muted); line-height: 1.7; }
form { margin-top: 34px; }
label { display: grid; gap: 12px; font-weight: 700; line-height: 1.5; }
input[type="text"], input:not([type]) { width: 100%; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: white; outline: none; }
input:focus { border-color: var(--leaf); box-shadow: 0 0 0 4px rgba(45, 106, 79, 0.12); }
.question-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 26px 0 32px; }
.question-grid label { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.52); font-size: 14px; }
input[type="range"] { width: 100%; accent-color: var(--leaf); }
.range-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 500; }
.range-label i { font-style: normal; }
button { border: 0; border-radius: 999px; padding: 14px 22px; cursor: pointer; font-weight: 800; transition: transform .15s ease, background .15s ease; }
button:hover { transform: translateY(-1px); }
button:disabled { cursor: wait; opacity: .55; transform: none; }
.primary { color: white; background: var(--leaf); }
.primary:hover { background: var(--leaf-dark); }
.secondary { color: var(--leaf); background: #e5efe7; }
.family-title { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.family-title h2 { margin-top: 0; }
.tag { display: inline-flex; padding: 7px 11px; border-radius: 999px; color: var(--leaf); background: #e5efe7; font-size: 12px; font-weight: 800; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 26px 0; }
.stat { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.58); }
.stat small { display: block; margin-bottom: 8px; color: var(--muted); }
.stat strong { font-size: 17px; }
.invite-box { margin-top: 24px; padding: 24px; border-radius: 20px; background: var(--ink); color: white; }
.invite-box p { color: rgba(255,255,255,.72); line-height: 1.65; }
.invite-code { margin: 20px 0; color: #ffe29a; font-family: ui-monospace, monospace; font-size: clamp(25px, 5vw, 42px); letter-spacing: .08em; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.stage-note { margin-top: 22px; padding: 18px 20px; border-left: 4px solid var(--sun); background: rgba(242,184,75,.12); line-height: 1.7; }
.dashboard-section { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
.dashboard-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 18px; }
.dashboard-heading h3 { margin: 4px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 28px; font-weight: 500; }
.dashboard-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.growth-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.growth-item { padding: 16px; border-radius: 15px; background: #eef3e9; }
.growth-item small { display: block; margin-bottom: 5px; color: var(--muted); }
.growth-item strong { font-size: 22px; font-family: Georgia, serif; }
.activity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.activity-card { display: flex; flex-direction: column; min-height: 190px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.62); }
.activity-card h4, .school-card h4 { margin: 0 0 8px; font-size: 17px; }
.activity-card p { flex: 1; margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.activity-meta { display: flex; justify-content: space-between; margin-bottom: 14px; color: var(--leaf); font-size: 12px; font-weight: 800; }
.activity-card button { align-self: start; padding: 10px 15px; font-size: 13px; }
.history-list { display: grid; gap: 9px; }
.history-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 15px 17px; border-radius: 14px; background: rgba(255,255,255,.58); }
.history-row small { display: block; margin-top: 4px; color: var(--muted); }
.status-awaiting_ai { color: #9a6714; }
.status-completed { color: var(--leaf); }
.status-declined, .status-expired { color: var(--muted); }
.school-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.school-card { position: relative; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.58); }
.school-card.local { border-color: rgba(45,106,79,.45); box-shadow: inset 0 0 0 1px rgba(45,106,79,.1); }
.school-card .tag { margin-bottom: 13px; }
.school-card p { margin: 10px 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.school-facts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.school-facts span { padding: 6px 9px; border-radius: 999px; background: var(--paper); font-size: 11px; font-weight: 700; }
.empty-state { padding: 22px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); text-align: center; }
.loading { color: var(--muted); font-size: 14px; }
.hidden { display: none; }
#toast { position: fixed; right: 24px; bottom: 24px; max-width: 340px; padding: 14px 18px; border-radius: 14px; color: white; background: var(--ink); opacity: 0; transform: translateY(16px); pointer-events: none; transition: .2s ease; }
#toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 680px); padding-top: 24px; }
  .topline { align-items: start; flex-direction: column; gap: 8px; }
  .sun { display: none; }
  .panel { grid-template-columns: 1fr; }
  .section-number { padding: 18px 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .section-content { padding: 30px 22px 34px; }
  .question-grid, .stat-grid, .activity-grid, .school-grid { grid-template-columns: 1fr; }
  .growth-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-heading { align-items: start; flex-direction: column; }
}
