/* ============================================================
   Stephen 美高申请进度网站 — 样式表
   ============================================================ */

:root {
  --bg: #f4f6fb;
  --ink: #1a2233;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --card: #ffffff;
  --line: #e2e8f0;
  --brand: #4338ca;
  --brand-deep: #312e81;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-hover: 0 4px 8px rgba(15, 23, 42, .08), 0 16px 40px rgba(15, 23, 42, .12);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 顶部 Hero ---------- */

.hero {
  background: linear-gradient(135deg, #1e293b 0%, #312e81 55%, #4338ca 100%);
  color: #fff;
  padding: 40px 0 84px;
}

.hero-inner { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #c7d2fe;
  margin-bottom: 10px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(26px, 4.5vw, 38px);
  font-weight: 700;
  letter-spacing: -.01em;
}

.hero .program {
  color: #e0e7ff;
  font-size: 15px;
  margin: 0 0 18px;
}

.hero .updated {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 13px;
  color: #e0e7ff;
}

.hero-progress {
  margin-top: 26px;
  max-width: 520px;
}

.hero-progress .bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  overflow: hidden;
}

.hero-progress .bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #a7f3d0);
  transition: width .6s ease;
}

.hero-progress .caption {
  font-size: 13px;
  color: #c7d2fe;
  margin-top: 6px;
}

/* ---------- 统计卡片 ---------- */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: -46px 0 30px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-card .num {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}

.stat-card .lbl {
  font-size: 13px;
  color: var(--muted);
}

.stat-card .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

/* ---------- 区块标题 ---------- */

.section { margin: 34px 0; }

.section > h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section > h2 .count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #eef2ff;
  border-radius: 999px;
  padding: 2px 10px;
}

/* ---------- 重要日期 ---------- */

.dates-wrap {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}

.dates-list { display: flex; flex-direction: column; gap: 4px; }

.date-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--line);
  flex-wrap: wrap;
}

.date-row:last-child { border-bottom: none; }

.date-row .d {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--brand-deep);
  min-width: 118px;
}

.date-row .what { color: var(--muted); font-size: 14px; flex: 1; min-width: 140px; }

.date-row .school-name { font-weight: 600; font-size: 14px; }

.date-row .chip {
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

.chip-warn { background: #fef3c7; color: #92400e; }
.chip-ok { background: #dcfce7; color: #166534; }
.chip-muted { background: #f1f5f9; color: var(--muted); }

.empty-hint {
  color: var(--muted-2);
  font-size: 14px;
  text-align: center;
  padding: 14px 0;
}

/* ---------- 家庭待办清单 ---------- */

.todo-wrap {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 22px;
}

.todo-item {
  display: flex;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid #f1f5f9;
}

.todo-item:last-child { border-bottom: none; }

.todo-body { flex: 1; min-width: 0; }

.todo-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.todo-text { font-weight: 600; font-size: 15px; }
.todo-item.is-todo .todo-text { color: var(--muted); font-weight: 500; }
.todo-item.is-done .todo-text { text-decoration: line-through; color: var(--muted-2); }

.todo-state {
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 1px 10px;
  white-space: nowrap;
}

.todo-school {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: #eef2ff;
  border-radius: 999px;
  padding: 1px 10px;
  white-space: nowrap;
}

.todo-school:hover { background: #e0e7ff; text-decoration: none; }

.todo-due {
  font-size: 13px;
  color: #b45309;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.todo-note {
  font-size: 13px;
  color: #475569;
  background: #f8fafc;
  border-radius: 8px;
  padding: 5px 12px;
  margin-top: 7px;
  display: inline-block;
  max-width: 100%;
}

/* 限时 / 会过期的待办：红色高亮置顶 */
.todo-item.urgent {
  background: #fef2f2;
  border-bottom: 1px solid #fecaca;
  border-radius: 10px;
  padding-left: 12px;
  padding-right: 12px;
  margin: 6px -12px 0;
}

.todo-item.urgent .todo-text { color: #991b1b; font-weight: 700; }

.todo-urgent {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #dc2626;
  border-radius: 999px;
  padding: 1px 10px;
  white-space: nowrap;
  animation: todo-pulse 2s ease-in-out infinite;
}

@keyframes todo-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

/* ---------- 学校卡片网格 ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.school-card {
  position: relative;
  display: block;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 18px;
  color: inherit;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}

.school-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}

.school-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--accent, var(--brand));
}

.school-card .top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.monogram {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  color: #fff;
  background: var(--accent, var(--brand));
}

.school-card .name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.school-card .name-cn {
  font-size: 13px;
  color: var(--muted);
  margin-top: 1px;
}

.school-card .loc {
  font-size: 13px;
  color: var(--muted-2);
  margin-top: 2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.pill-row { margin-top: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.school-card .deadline {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.progressbar {
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
  margin-top: 14px;
}

.progressbar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #4338ca);
  transition: width .6s ease;
}

.progress-caption {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
}

.school-card .arrow {
  position: absolute;
  right: 18px;
  bottom: 16px;
  color: var(--muted-2);
  font-size: 14px;
}

/* ---------- 学校详情页 ---------- */

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.topbar .site {
  font-weight: 700;
  color: var(--ink);
}

.back-link { color: var(--muted); white-space: nowrap; }
.back-link:hover { color: var(--brand); }

.school-hero {
  background: linear-gradient(135deg, #1e293b 0%, #312e81 55%, #4338ca 100%);
  color: #fff;
  padding: 42px 0;
}

.school-hero .row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.school-hero .monogram { width: 64px; height: 64px; font-size: 20px; border-radius: 16px; }

.school-hero h1 {
  margin: 0;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  letter-spacing: -.01em;
}

.school-hero .sub { color: #e0e7ff; font-size: 14px; margin-top: 4px; }

.school-hero .links { margin-top: 14px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.school-hero .links a {
  color: #e0e7ff;
  font-size: 14px;
  border-bottom: 1px dashed rgba(224, 231, 255, .5);
}

.school-hero .links a:hover { color: #fff; }

.school-hero .pill { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.25); }

/* 详情页主体 */

.detail-main { padding: 26px 0 60px; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.meta-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.meta-card .k {
  font-size: 12px;
  color: var(--muted-2);
  letter-spacing: .06em;
  margin-bottom: 4px;
}

.meta-card .v { font-weight: 600; font-size: 15px; }
.meta-card .v .sub { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }
.meta-card .v.placeholder { color: var(--muted-2); font-weight: 400; }

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 22px;
}

.panel > h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 16px;
}

.progress-big { margin-bottom: 6px; }
.progress-big .progressbar { height: 12px; margin-top: 10px; }
.progress-big .nums { font-size: 14px; color: var(--muted); margin-top: 8px; }
.progress-big .nums b { color: var(--ink); }

.note-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: #78350f;
  margin-top: 14px;
}

.note-line {
  padding: 3px 0;
  line-height: 1.65;
}

.note-line + .note-line { border-top: 1px dashed #fde68a; }

/* 里程碑清单 */

.milestones { display: flex; flex-direction: column; }

.ms-item {
  display: flex;
  gap: 16px;
  padding: 15px 2px;
  border-bottom: 1px solid #f1f5f9;
}

.ms-item:last-child { border-bottom: none; }

.ms-icon {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  margin-top: 2px;
  position: relative;
}

.ms-icon.todo { border: 2px solid #cbd5e1; }
.ms-icon.doing {
  border: 2px solid #3b82f6;
  background: conic-gradient(#3b82f6 0 50%, transparent 50% 100%);
}
.ms-icon.doing::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #fff;
}
.ms-icon.done { background: #16a34a; }
.ms-icon.done::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.ms-body { flex: 1; min-width: 0; }

.ms-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.ms-head .label { font-weight: 600; font-size: 15px; }
.ms-item.is-todo .label { color: var(--muted); font-weight: 500; }

.ms-head .en { font-size: 12px; color: var(--muted-2); }

.ms-head .ms-status {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 1px 10px;
  white-space: nowrap;
}

.ms-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.ms-note {
  font-size: 13px;
  color: #475569;
  background: #f8fafc;
  border-radius: 8px;
  padding: 6px 12px;
  margin-top: 8px;
  display: inline-block;
  max-width: 100%;
}

/* 动态日志 */

.log-item { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.log-item:last-child { border-bottom: none; }
.log-item .d { color: var(--brand-deep); font-weight: 600; font-size: 13px; min-width: 96px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.log-item .t { font-size: 14px; }

/* 上一所 / 下一所 */

.school-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.school-nav a {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.school-nav a:hover { text-decoration: none; box-shadow: var(--shadow-hover); }

.school-nav .dir { font-size: 12px; color: var(--muted-2); }
.school-nav .nm { font-weight: 600; font-size: 15px; }

.school-nav a.next { text-align: right; }

/* 回到总览按钮 */
.home-link-row { text-align: center; margin-top: 16px; }

.home-link {
  display: inline-block;
  background: #eef2ff;
  color: var(--brand-deep);
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 9px 28px;
  font-size: 15px;
  font-weight: 600;
}

.home-link:hover { background: #e0e7ff; text-decoration: none; }

/* ---------- 页脚 ---------- */

footer {
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding: 22px 0 34px;
  color: var(--muted-2);
  font-size: 13px;
  text-align: center;
}

/* ---------- 响应式 ---------- */

@media (max-width: 640px) {
  .hero { padding: 30px 0 74px; }
  .stats-row { margin-top: -40px; }
  .grid { grid-template-columns: 1fr; }
  .date-row .d { min-width: 100%; }
  .school-nav { grid-template-columns: 1fr; }
  .ms-head .ms-status { margin-left: 0; }
}
