/* =========================================================
   备考练习站 · 现代学术与黑曜石高阶门户排版
   ========================================================= */
:root {
  --bg: #F6F7FA;
  --card: #FFFFFF;
  --ink: #111827;
  --ink-2: #374151;
  --ink-muted: #6B7280;
  --ink-light: #9CA3AF;
  --border: #E5E7EB;
  --border-subtle: #F1F3F5;
  --brand: #E11D48;
  --brand-dark: #111827;
  --ok: #059669;
  --ok-soft: #ECFDF5;
  --ok-border: #A7F3D0;
  --r-xl: 20px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
  --tabbar-h: 58px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- 页面骨架 ---------- */
header, main, footer {
  max-width: 480px;
  margin: 0 auto;
}

header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 54px;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.brand b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #111827;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 750;
  box-shadow: 0 2px 6px rgba(17, 24, 39, 0.15);
}

header > span {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
}

main {
  min-height: calc(100dvh - 54px);
  padding: 16px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px);
}

/* 顶部欢迎区 */
.intro {
  margin-bottom: 16px;
}

.intro h1 {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 4px 0 6px;
  color: var(--ink);
}

.intro p {
  font-size: 13.5px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.5;
}

/* ---------- 底部方向切换 (Tabbar) ---------- */
.tracks {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 60;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 6px 14px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.04);
}

.track {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  border-radius: 12px;
  color: var(--ink-muted);
  transition: all 0.15s ease;
  position: relative;
}

.track .track-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--ink-light);
  transition: all 0.15s ease;
}

.track strong {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.track[aria-selected="true"] {
  color: var(--ink);
  background: #F1F5F9;
}

.track[aria-selected="true"] .track-ico {
  color: var(--ink);
  transform: translateY(-1px);
}

.track[aria-selected="true"] strong {
  color: var(--ink);
  font-weight: 750;
}

.track:active {
  transform: scale(0.97);
}

/* 隐藏旧版多余装饰 */
.eyebrow, .track > span:not(.track-ico), .track small, .track i {
  display: none !important;
}

/* ---------- 科目列表与卡片 ---------- */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 20px 0 12px;
}

.section-title h2 {
  font-size: 17px;
  font-weight: 750;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.2px;
}

.section-title p {
  display: none;
}

#summary {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.subjects {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.subject {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 4px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  position: relative;
  text-align: left;
}

.subject:active {
  transform: scale(0.985);
  border-color: #CBD5E1;
}

.subject-top {
  display: contents;
}

.icon {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 44px;
  height: 44px;
  align-self: center;
  border-radius: 12px;
  background: #F1F5F9;
  color: #1E293B;
  border: 1px solid #E2E8F0;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 750;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.subject h3 {
  grid-column: 2;
  grid-row: 1;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  align-self: center;
  line-height: 1.4;
}

.subject p {
  grid-column: 2;
  grid-row: 2;
  font-size: 12px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.5;
}

.status {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  justify-self: end;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2.5px 8px;
  border-radius: 99px;
  background: #F3F4F6;
  color: var(--ink-light);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, monospace;
  white-space: nowrap;
}

.ready .status {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid var(--ok-border);
}

.action {
  grid-column: 3;
  grid-row: 2;
  align-self: center;
  justify-self: end;
  font-size: 12px;
  color: var(--ink-light);
  font-weight: 500;
}

.ready .action {
  color: var(--ink-2);
  font-weight: 600;
}

/* 底部说明 */
aside {
  font-size: 12px;
  color: var(--ink-light);
  line-height: 1.7;
  margin-top: 22px;
  padding: 12px 14px;
  background: #F8FAFC;
  border: 1px solid #EDF2F7;
  border-radius: 12px;
  text-align: center;
}

footer {
  display: none;
}

/* ---------- 弹窗：待补充题库 ---------- */
dialog {
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  max-width: 400px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 48px -12px rgba(15, 23, 42, 0.35);
  background: var(--card);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

dialog small {
  color: var(--ink-muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

dialog h2 {
  font-size: 20px;
  font-weight: 750;
  margin: 8px 0 10px;
  color: var(--ink);
}

dialog p {
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.6;
  margin: 0;
}

.close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: #F1F5F9;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-muted);
  display: grid;
  place-items: center;
}

.close:active {
  background: #E2E8F0;
}

.note {
  font-size: 13px;
  line-height: 1.7;
  background: #F8FAFC;
  border: 1px solid var(--border-subtle);
  color: var(--ink-2);
  padding: 14px;
  border-radius: 12px;
  margin: 18px 0 20px;
}

.done {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 11px;
  background: #111827;
  color: #FFFFFF;
  font-weight: 650;
  font-size: 14px;
  transition: opacity 0.15s;
}

.done:active {
  opacity: 0.85;
}

@media (min-width: 481px) {
  header, main {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}
