:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-alt: #f8f9fc;
  --ink: #171a24;
  --muted: #6f7586;
  --line: #e4e7ef;
  --line-strong: #d6dae5;
  --blue: #3158d8;
  --blue-soft: #e9edff;
  --rose: #e6657a;
  --rose-soft: #fff0f3;
  --green: #248768;
  --green-soft: #e8f6f1;
  --gold: #b67a20;
  --gold-soft: #fff5df;
  --danger: #b64355;
  --shadow: 0 10px 28px rgba(24, 31, 52, 0.07);
  --sidebar: 224px;
}

* { box-sizing: border-box; }

html { min-width: 1120px; background: var(--bg); }

body {
  margin: 0;
  min-width: 1120px;
  color: var(--ink);
  background: var(--bg);
  font-family: "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
select { font: inherit; letter-spacing: 0; }

button { color: inherit; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(49, 88, 216, 0.22);
  outline-offset: 2px;
}

svg { width: 18px; height: 18px; stroke-width: 1.9; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  color: #d9deeb;
  background: #1d2330;
  border-right: 1px solid #2b3241;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 48px;
  margin: 0 8px 28px;
  color: white;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-size: 23px;
  font-weight: 800;
  font-family: Georgia, serif;
  box-shadow: inset -5px -5px 0 rgba(230, 101, 122, 0.72);
}

.brand-copy { display: flex; flex-direction: column; }
.brand-copy strong { font-size: 21px; line-height: 1.05; font-weight: 750; }
.brand-copy small { margin-top: 4px; color: #9199ab; font-size: 9px; font-weight: 700; }

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

.nav-item {
  width: 100%;
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: #aeb5c4;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: color 160ms ease, background 160ms ease;
}

.nav-item:hover { color: #fff; background: #272e3d; }
.nav-item.is-active { color: #fff; background: #30394b; box-shadow: inset 3px 0 0 var(--rose); }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; }
.nav-item span:nth-child(2) { flex: 1; }

.nav-count,
.nav-beta {
  flex: 0 0 auto !important;
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 999px;
  color: #fff;
  background: #3d4658;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.nav-beta { color: #ffc7d0; background: rgba(230, 101, 122, 0.14); }
.sidebar-bottom { margin-top: auto; }

.coach-mini {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 3px 12px;
  padding: 10px 8px;
  border-top: 1px solid #313949;
  border-bottom: 1px solid #313949;
}

.coach-mini img { width: 39px; height: 39px; object-fit: cover; object-position: center 38%; border-radius: 50%; background: #fff; }
.coach-mini div { min-width: 0; display: flex; flex-direction: column; }
.coach-mini strong { color: #eef1f6; font-size: 12px; }
.coach-mini span { color: #858ea1; font-size: 10px; white-space: nowrap; }

.workspace { grid-column: 2; min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.breadcrumb { display: flex; align-items: center; gap: 7px; color: #9a9faf; font-size: 12px; }
.breadcrumb svg { width: 14px; height: 14px; }
.breadcrumb strong { color: #444b5d; font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.icon-button:hover { border-color: var(--line-strong); background: #f8f9fc; }

.target-chip {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}
.target-chip strong { color: var(--blue); font-size: 15px; }

.profile-button {
  position: relative;
  width: 37px;
  height: 37px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #e6657a;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.online-dot { position: absolute; right: 0; bottom: 0; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: #3ba77a; }

.view-container { max-width: 1480px; margin: 0 auto; padding: 35px 38px 70px; }
.app-view { display: none; }
.app-view.is-visible { display: block; animation: view-in 220ms ease both; }

@keyframes view-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-heading.compact { align-items: center; }
.page-heading h1 { margin: 3px 0 7px; font-size: 28px; line-height: 1.2; font-weight: 720; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--blue) !important; font-size: 10px; font-weight: 750; text-transform: uppercase; }

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 650;
  white-space: nowrap;
}

.primary-button { padding: 0 16px; border: 1px solid var(--blue); color: #fff; background: var(--blue); box-shadow: 0 5px 14px rgba(49, 88, 216, 0.18); }
.primary-button:hover { background: #2549c5; border-color: #2549c5; }
.secondary-button { padding: 0 14px; border: 1px solid var(--line-strong); color: #444b5d; background: #fff; }
.secondary-button:hover { border-color: #aeb6c8; background: #fbfbfd; }
.danger-button { padding: 0 14px; border: 1px solid #efcad1; color: var(--danger); background: #fff8f9; }
.text-button { min-height: 30px; padding: 0; border: 0; color: var(--blue); background: transparent; }
.wide { min-width: 180px; }

.focus-band {
  min-height: 126px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 28px;
  padding: 24px 28px;
  margin-bottom: 18px;
  border: 1px solid #d9def1;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.focus-main { min-width: 0; display: flex; align-items: center; gap: 18px; }
.focus-index { width: 54px; height: 54px; display: grid; place-items: center; flex: 0 0 54px; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font: 700 19px Georgia, serif; }
.focus-main h2 { margin: 7px 0 4px; font-size: 19px; }
.focus-main p { margin: 0; color: var(--muted); }
.focus-meta { display: flex; align-items: center; gap: 17px; color: #5f6677; white-space: nowrap; }
.focus-meta span { display: inline-flex; align-items: center; gap: 6px; }
.focus-meta svg { width: 15px; height: 15px; }

.status-pill,
.trend-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 10px;
  font-weight: 750;
}
.status-pill.neutral { color: #555d70; background: #eef0f5; }
.status-pill svg,
.trend-chip svg { width: 13px; height: 13px; }
.trend-chip { color: var(--green); background: var(--green-soft); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.metric-card { min-height: 94px; display: flex; align-items: center; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.metric-icon { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 39px; border-radius: 7px; }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.green { color: var(--green); background: var(--green-soft); }
.metric-icon.rose { color: var(--rose); background: var(--rose-soft); }
.metric-icon.gold { color: var(--gold); background: var(--gold-soft); }
.metric-card > div:last-child { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 5px; }
.metric-card span { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.metric-card strong { font-size: 23px; line-height: 1.2; }
.metric-card small { color: #9298a7; font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr); gap: 18px; margin-bottom: 18px; }
.panel { border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 4px 15px rgba(24, 31, 52, 0.035); }
.panel-head { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0 0 2px; font-size: 15px; }
.panel-head p { margin: 0; color: var(--muted); font-size: 11px; }
.progress-text { color: var(--blue); font-size: 12px; font-weight: 700; }

.task-list { padding: 4px 0; }
.task-row { width: 100%; min-height: 72px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; padding: 9px 20px; border: 0; border-bottom: 1px solid #f0f1f5; background: transparent; cursor: pointer; text-align: left; }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: #fafbfe; }
.task-check { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); }
.task-check.muted { color: #777f91; background: #eef0f5; }
.task-check svg { width: 14px; height: 14px; }
.task-copy { min-width: 0; display: flex; flex-direction: column; }
.task-copy strong { font-size: 13px; }
.task-copy small { margin-top: 3px; color: var(--muted); }
.task-tag { padding: 3px 7px; border-radius: 999px; color: var(--rose); background: var(--rose-soft); font-size: 10px; font-weight: 700; }
.task-tag.light { color: #6d7484; background: #f0f1f5; }
.task-row > svg { width: 16px; color: #a8aebe; }

.week-panel { min-width: 0; }
.week-chart { height: 170px; display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 10px; padding: 24px 22px 9px; }
.day-column { min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.day-bar-wrap { height: 125px; display: flex; align-items: flex-end; }
.day-bar { width: 16px; min-height: 3px; border-radius: 4px 4px 2px 2px; background: var(--blue); opacity: 0.86; }
.day-column.today .day-bar { background: var(--rose); }
.day-column span { color: #9298a7; font-size: 10px; }
.chart-legend { display: flex; justify-content: space-between; align-items: center; padding: 8px 22px 18px; color: var(--muted); font-size: 11px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--blue); }
.chart-legend strong { color: var(--ink); }

.recent-panel { overflow: hidden; }
.recent-table { min-height: 90px; }
.recent-row { display: grid; grid-template-columns: minmax(260px, 1fr) 90px 120px 100px 36px; align-items: center; min-height: 60px; padding: 0 20px; border-top: 1px solid #f0f1f5; }
.recent-row:first-child { border-top: 0; }
.recent-title { min-width: 0; display: flex; align-items: center; gap: 10px; }
.recent-title > span { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 31px; border-radius: 6px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 750; }
.recent-title div { min-width: 0; display: flex; flex-direction: column; }
.recent-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.recent-title small,
.recent-row > span { color: var(--muted); font-size: 11px; }
.score-good { color: var(--green) !important; font-weight: 700; }
.score-mid { color: var(--gold) !important; font-weight: 700; }
.empty-state { min-height: 140px; display: grid; place-items: center; align-content: center; gap: 6px; padding: 20px; color: var(--muted); text-align: center; }
.empty-state svg { width: 25px; height: 25px; color: #aeb4c1; }
.empty-state strong { color: #596173; }
.empty-state p { margin: 0; font-size: 11px; }

.library-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.collection-tile { min-height: 76px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 18px; align-items: center; gap: 12px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; text-align: left; }
.collection-tile:hover,
.collection-tile.is-active { border-color: #b9c4eb; box-shadow: inset 0 -2px 0 var(--blue); }
.collection-symbol { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 7px; font-size: 9px; font-weight: 800; }
.collection-symbol.ink { color: #fff; background: #303746; }
.collection-symbol.rose { color: var(--rose); background: var(--rose-soft); }
.collection-symbol.blue { color: var(--blue); background: var(--blue-soft); }
.collection-tile div { display: flex; flex-direction: column; }
.collection-tile strong { font-size: 13px; }
.collection-tile small { color: var(--muted); }
.collection-tile > svg { color: #a8aebe; }

.library-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.segmented { height: 38px; display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.segmented button { min-width: 53px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; }
.segmented button.is-active { color: #fff; background: #303746; }
.search-field { min-width: 250px; height: 38px; display: flex; align-items: center; gap: 7px; flex: 1; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.search-field:focus-within { border-color: #9fafdf; }
.search-field svg { width: 16px; color: #969dad; }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
select,
input[type="date"],
input[type="number"] { height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; color: #3d4557; background: #fff; }

.exam-list-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.exam-list-head,
.exam-row { display: grid; grid-template-columns: minmax(330px, 1fr) 90px 150px 120px 94px; align-items: center; gap: 10px; padding: 0 18px; }
.exam-list-head { min-height: 39px; color: #8a91a1; background: #f7f8fb; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 700; }
.exam-row { min-height: 66px; border-bottom: 1px solid #eef0f4; }
.exam-row:last-child { border-bottom: 0; }
.exam-row:hover { background: #fafbfe; }
.exam-title-cell { min-width: 0; display: flex; align-items: center; gap: 11px; }
.part-dot { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 31px; border-radius: 6px; color: var(--blue); background: var(--blue-soft); font-size: 9px; font-weight: 800; }
.part-dot.p2 { color: var(--green); background: var(--green-soft); }
.part-dot.p3 { color: var(--rose); background: var(--rose-soft); }
.part-dot.c19 { color: var(--gold); background: var(--gold-soft); }
.exam-title-cell > div { min-width: 0; display: flex; flex-direction: column; }
.exam-title-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.exam-title-cell small { color: var(--muted); font-size: 10px; }
.frequency-label { width: max-content; padding: 3px 7px; border-radius: 999px; color: var(--rose); background: var(--rose-soft); font-size: 10px; }
.frequency-label.normal { color: #6f7586; background: #f0f1f5; }
.frequency-label.official { color: var(--gold); background: var(--gold-soft); }
.difficulty-dots { display: flex; align-items: center; gap: 4px; }
.difficulty-dots i { width: 21px; height: 4px; border-radius: 2px; background: #e4e6ec; }
.difficulty-dots i.on { background: #687085; }
.average-cell { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.average-cell i { width: 45px; height: 4px; overflow: hidden; border-radius: 3px; background: #e8eaf0; }
.average-cell i::after { content: ""; display: block; width: var(--avg, 60%); height: 100%; background: var(--gold); }
.practice-button { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 10px; border: 1px solid #cdd5ee; border-radius: 6px; color: var(--blue); background: #f7f9ff; cursor: pointer; font-size: 11px; font-weight: 700; }
.practice-button:hover { color: #fff; background: var(--blue); border-color: var(--blue); }
.practice-button svg { width: 13px; height: 13px; }
.list-footer { min-height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

.mock-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.mock-builder { overflow: hidden; }
.mock-topline { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; color: #fff; background: #272f3f; }
.mock-topline div { display: flex; align-items: baseline; gap: 16px; }
.mock-topline span { color: #aeb7c8; font-size: 11px; font-weight: 700; }
.mock-topline strong { font: 700 29px "SF Mono", Menlo, monospace; }
.mock-topline p { margin: 0; color: #c9cfda; font-size: 11px; }
.paper-slots { padding: 8px 24px; }
.paper-slot { min-height: 104px; display: grid; grid-template-columns: 60px minmax(0, 1fr) 38px; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); }
.paper-slot:last-child { border-bottom: 0; }
.slot-part { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid #d9dfea; border-radius: 7px; color: var(--blue); background: #f5f7fe; font-size: 12px; font-weight: 800; }
.paper-slot:nth-child(2) .slot-part { color: var(--green); background: #eff8f4; }
.paper-slot:nth-child(3) .slot-part { color: var(--rose); background: #fff3f5; }
.slot-copy { min-width: 0; }
.slot-copy span { color: var(--muted); font-size: 10px; }
.slot-copy strong { display: block; overflow: hidden; margin: 3px 0; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.slot-copy small { color: #8e95a5; }
.slot-reroll { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.slot-reroll:hover { color: var(--blue); border-color: #acb9e2; }
.slot-reroll svg { width: 15px; }
.mock-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--line); background: #fafbfc; }
.mock-aside { display: grid; gap: 18px; }
.readiness-panel { padding: 20px; }
.readiness-score { display: flex; align-items: flex-end; justify-content: space-between; }
.readiness-score span { color: var(--muted); }
.readiness-score strong { font-size: 28px; }
.readiness-score small { font-size: 13px; }
.readiness-bar { height: 6px; overflow: hidden; margin: 12px 0; border-radius: 4px; background: #eaecf2; }
.readiness-bar i { display: block; width: 72%; height: 100%; background: var(--green); }
.readiness-panel p { margin: 0; color: var(--muted); font-size: 11px; }
.exam-rules { padding: 3px 4px; }
.exam-rules h2 { margin: 0 0 12px; font-size: 14px; }
.exam-rules ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.exam-rules li { display: flex; align-items: flex-start; gap: 9px; color: #646b7d; font-size: 11px; }
.exam-rules svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--blue); }

.review-summary { display: grid; grid-template-columns: 180px minmax(240px, 1fr) 220px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.review-summary > div { min-height: 85px; display: flex; align-items: baseline; gap: 7px; padding: 21px 24px; border-right: 1px solid var(--line); }
.review-summary > div:last-child { border-right: 0; }
.review-summary span { align-self: center; color: var(--muted); font-size: 11px; }
.review-summary strong { align-self: center; font-size: 23px; }
.review-summary small { color: var(--muted); }
.wrong-panel { overflow: hidden; }
.wrong-list { min-height: 180px; }
.wrong-row { display: grid; grid-template-columns: 54px minmax(280px, 1fr) 170px 170px 92px; align-items: center; gap: 14px; min-height: 76px; padding: 10px 20px; border-bottom: 1px solid #eef0f4; }
.wrong-row:last-child { border-bottom: 0; }
.question-number { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 7px; color: var(--rose); background: var(--rose-soft); font-size: 11px; font-weight: 800; }
.wrong-context { min-width: 0; }
.wrong-context strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.wrong-context small { color: var(--muted); }
.answer-cell { min-width: 0; display: flex; flex-direction: column; }
.answer-cell span { color: var(--muted); font-size: 9px; }
.answer-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.answer-cell.user strong { color: var(--danger); }
.answer-cell.correct strong { color: var(--green); }
.master-button { min-height: 30px; border: 1px solid var(--line-strong); border-radius: 6px; color: #586073; background: #fff; cursor: pointer; font-size: 10px; }
.master-button:hover { color: var(--green); border-color: #9cc9b9; background: #f2fbf7; }

.record-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.record-stat-grid article { min-height: 88px; display: flex; align-items: baseline; gap: 6px; padding: 23px 24px; border-right: 1px solid var(--line); }
.record-stat-grid article:last-child { border-right: 0; }
.record-stat-grid span { align-self: center; margin-right: auto; color: var(--muted); font-size: 11px; }
.record-stat-grid strong { align-self: center; font-size: 23px; }
.record-stat-grid small { color: var(--muted); }
.records-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr); gap: 18px; margin-bottom: 18px; }
.accuracy-chart { height: 220px; display: flex; align-items: flex-end; gap: 12px; padding: 24px 22px; }
.accuracy-point { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.accuracy-point strong { color: var(--blue); font-size: 10px; }
.accuracy-point i { width: 100%; max-width: 38px; min-height: 3px; border-radius: 4px 4px 2px 2px; background: var(--blue); opacity: 0.82; }
.accuracy-point span { color: #969dac; font-size: 9px; }
.type-performance { display: grid; gap: 13px; padding: 20px; }
.type-row { display: grid; grid-template-columns: 98px minmax(0, 1fr) 36px; align-items: center; gap: 10px; }
.type-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #5a6172; font-size: 10px; }
.type-bar { height: 6px; overflow: hidden; border-radius: 4px; background: #eceef3; }
.type-bar i { display: block; height: 100%; background: var(--green); }
.type-row strong { font-size: 10px; text-align: right; }
.record-table-panel { overflow: hidden; }
.record-list { min-height: 140px; }
.record-row { display: grid; grid-template-columns: minmax(280px, 1fr) 100px 110px 110px 120px; align-items: center; gap: 10px; min-height: 62px; padding: 0 20px; border-bottom: 1px solid #eef0f4; }
.record-row:last-child { border-bottom: 0; }
.record-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.record-row span { color: var(--muted); font-size: 11px; }

.planner-layout { display: grid; grid-template-columns: 470px minmax(0, 1fr); gap: 20px; align-items: start; }
.planner-form { padding: 24px; }
.form-section { margin-bottom: 22px; }
.form-section h2 { margin: 0 0 13px; font-size: 14px; }
.score-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.planner-form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 10px; }
.planner-form label input,
.planner-form label select { width: 100%; color: var(--ink); }
.planner-form .primary-button { width: 100%; }
.planner-output { min-height: 480px; }
.planner-placeholder { min-height: 450px; display: grid; place-items: center; align-content: center; padding: 30px; border: 1px dashed #cfd5e3; border-radius: 8px; color: var(--muted); background: rgba(255,255,255,0.55); text-align: center; }
.planner-placeholder img { width: 125px; height: 125px; object-fit: contain; margin-bottom: 10px; mix-blend-mode: multiply; }
.planner-placeholder h2 { margin: 0 0 6px; color: #3b4252; font-size: 17px; }
.planner-placeholder p { max-width: 340px; margin: 0; font-size: 11px; }
.plan-result { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.plan-result-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; color: #fff; background: #293142; }
.plan-result-head h2 { margin: 4px 0 0; font-size: 19px; }
.plan-result-head p { margin: 0; color: #bbc3d1; font-size: 10px; }
.plan-score { font-size: 30px; font-weight: 750; }
.plan-days { padding: 8px 22px; }
.plan-day { min-height: 58px; display: grid; grid-template-columns: 78px minmax(0, 1fr) 62px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.plan-day:last-child { border-bottom: 0; }
.plan-day span { color: var(--blue); font-size: 11px; font-weight: 750; }
.plan-day strong { font-size: 12px; }
.plan-day small { color: var(--muted); text-align: right; }
.plan-note { display: flex; align-items: flex-start; gap: 9px; margin: 0; padding: 15px 22px; border-top: 1px solid var(--line); color: #626a7c; background: #f8f9fb; font-size: 10px; }
.plan-note svg { width: 15px; flex: 0 0 15px; color: var(--rose); }

.settings-panel { max-width: 800px; overflow: hidden; }
.setting-row { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row > div { display: flex; flex-direction: column; }
.setting-row strong { font-size: 13px; }
.setting-row span { margin-top: 3px; color: var(--muted); font-size: 10px; }

.writing-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.writing-stat-grid article {
  min-height: 86px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 22px 24px;
  border-right: 1px solid var(--line);
}
.writing-stat-grid article:last-child { border-right: 0; }
.writing-stat-grid span { align-self: center; margin-right: auto; color: var(--muted); font-size: 11px; }
.writing-stat-grid strong { align-self: center; font-size: 23px; }
.writing-stat-grid small { color: var(--muted); }
.writing-home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 324px; gap: 18px; align-items: start; }
.writing-library-panel { overflow: hidden; }
.writing-filter { height: 34px; }
.writing-filter button { min-width: 62px; font-size: 10px; }
.writing-library-toolbar { min-height: 58px; display: grid; grid-template-columns: minmax(260px, 1fr) 190px auto; align-items: center; gap: 10px; padding: 9px 20px; border-bottom: 1px solid var(--line); background: #f9fafc; }
.writing-library-toolbar .search-field { width: 100%; }
.writing-library-toolbar select { width: 100%; }
.writing-library-toolbar > span { color: var(--muted); font-size: 10px; text-align: right; white-space: nowrap; }
.writing-task-list { min-height: 420px; }
.writing-task-row {
  min-height: 126px;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 140px 112px;
  align-items: center;
  gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid #eef0f4;
}
.writing-task-row:last-child { border-bottom: 0; }
.writing-task-lead { width: 62px; height: 62px; display: grid; place-items: center; overflow: hidden; border: 1px solid #e0e3ea; border-radius: 6px; background: #fff; }
.writing-task-lead img { width: 100%; height: 100%; object-fit: contain; }
.writing-task-type-block { color: var(--blue); border-color: #dce3fb; background: var(--blue-soft); font-size: 13px; font-weight: 800; }
.writing-task-copy { min-width: 0; }
.writing-task-copy > span { color: var(--rose); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.writing-task-copy strong { display: block; margin: 4px 0; font-size: 13px; }
.writing-task-copy small { display: block; overflow: hidden; margin: -2px 0 4px; color: #7d8493; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.writing-task-copy p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-family: Georgia, serif; font-size: 11px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.writing-task-meta { display: grid; gap: 7px; color: #6a7181; font-size: 10px; }
.writing-task-meta span { display: flex; align-items: center; gap: 6px; }
.writing-task-meta svg { width: 13px; height: 13px; }
.writing-task-row > button { justify-content: center; white-space: nowrap; }
.writing-list-footer { min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 9px 20px; border-top: 1px solid var(--line); color: var(--muted); background: #f9fafc; font-size: 9px; }
.writing-home-aside { display: grid; gap: 18px; }
.writing-resume-card { min-height: 200px; padding: 20px; }
.writing-resume-head { display: flex; align-items: center; justify-content: space-between; }
.writing-resume-head small { color: var(--muted); font-size: 9px; }
.writing-resume-card h2 { margin: 20px 0 6px; font-size: 16px; }
.writing-resume-card > strong { display: block; font-size: 12px; }
.writing-resume-card > p { margin: 4px 0 18px; color: var(--muted); font-size: 10px; }
.writing-empty-mini { min-height: 160px; display: grid; place-items: center; align-content: center; text-align: center; }
.writing-empty-mini > svg { width: 30px; height: 30px; color: #9ca3b2; }
.writing-empty-mini h2 { margin: 12px 0 4px; font-size: 14px; }
.writing-empty-mini p { max-width: 230px; margin: 0; color: var(--muted); font-size: 10px; }
.writing-process-card { overflow: hidden; }
.writing-process-card ol { display: grid; gap: 0; margin: 0; padding: 8px 20px 14px; list-style: none; }
.writing-process-card li { min-height: 65px; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.writing-process-card li:last-child { border-bottom: 0; }
.writing-process-card li > span { color: var(--blue); font-size: 10px; font-weight: 800; }
.writing-process-card li strong,
.writing-process-card li small { display: block; }
.writing-process-card li strong { font-size: 11px; }
.writing-process-card li small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.writing-history-panel { margin-top: 18px; overflow: hidden; }
.writing-history-list { min-height: 130px; }
.writing-history-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: 44px minmax(250px, 1fr) repeat(4, 62px) 48px 96px;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  border-bottom: 1px solid #eef0f4;
}
.writing-history-row:last-child { border-bottom: 0; }
.writing-history-type { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; color: var(--blue); background: var(--blue-soft); font-size: 9px; font-weight: 800; }
.writing-history-row > div { min-width: 0; }
.writing-history-row > div strong,
.writing-history-row > div small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.writing-history-row > div strong { font-size: 11px; }
.writing-history-row > div small,
.writing-history-row > span { color: var(--muted); font-size: 9px; }
.writing-history-row > b { color: var(--rose); font-size: 16px; }
.writing-custom-dialog { width: min(760px, calc(100vw - 80px)); }
.writing-custom-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; padding: 22px 24px; }
.writing-custom-fields { display: grid; gap: 15px; }
.writing-custom-fields label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; }
.writing-custom-fields select { width: 100%; }
.writing-custom-fields textarea { width: 100%; resize: vertical; padding: 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font: 12px/1.55 Georgia, serif; }
.writing-custom-fields textarea:focus-visible { outline: 3px solid rgba(49, 88, 216, 0.22); outline-offset: 1px; }
.writing-upload-field { position: relative; min-height: 220px; display: grid; place-items: center; align-content: center; gap: 6px; overflow: hidden; border: 1px dashed #c9cfdb; border-radius: 7px; color: #505869; background: #f9fafc; text-align: center; cursor: pointer; }
.writing-upload-field.is-hidden { display: none; }
.writing-upload-field input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.writing-upload-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; color: var(--blue); background: var(--blue-soft); }
.writing-upload-field strong { font-size: 11px; }
.writing-upload-field small { color: var(--muted); font-size: 9px; }
.writing-upload-field img { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; border-radius: 5px; background: #fff; pointer-events: none; }

.builder-dialog { width: min(720px, calc(100vw - 80px)); padding: 0; border: 0; border-radius: 8px; background: transparent; box-shadow: 0 25px 70px rgba(15, 19, 31, 0.26); }
.builder-dialog::backdrop { background: rgba(18, 23, 34, 0.48); backdrop-filter: blur(3px); }
.dialog-shell { background: #fff; border-radius: 8px; overflow: hidden; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 23px 24px 18px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 8px 0 3px; font-size: 21px; }
.dialog-head p { margin: 0; color: var(--muted); font-size: 11px; }
.dialog-slots { padding: 7px 24px; }
.dialog-slot { min-height: 73px; display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.dialog-slot:last-child { border-bottom: 0; }
.dialog-slot label { color: var(--blue); font-size: 11px; font-weight: 800; }
.dialog-slot select { width: 100%; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 17px 24px; border-top: 1px solid var(--line); background: #f8f9fb; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: flex; align-items: center; gap: 9px; padding: 11px 14px; border: 1px solid #b9dfd0; border-radius: 7px; color: #1e684f; background: #f1fbf7; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: 180ms ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast svg { width: 17px; height: 17px; }

@media (max-width: 1240px) {
  :root { --sidebar: 202px; }
  .view-container { padding-left: 28px; padding-right: 28px; }
  .focus-meta { display: none; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 330px; }
  .exam-list-head,
  .exam-row { grid-template-columns: minmax(300px, 1fr) 80px 120px 100px 86px; }
}
