:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --ink: #152033;
  --muted: #5c6b80;
  --line: #dbe3ee;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --violet: #7c3aed;
  --radius: 8px;
  --shadow: 0 14px 34px rgba(21, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(245, 247, 251, 0.9), rgba(237, 242, 249, 0.96)),
    url("data:image/svg+xml,%3Csvg width='140' height='140' viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23d9e2ef' stroke-width='1'%3E%3Cpath d='M0 30h140M0 90h140M30 0v140M90 0v140'/%3E%3Ccircle cx='30' cy='30' r='3' fill='%23cbd5e1' stroke='none'/%3E%3Ccircle cx='90' cy='90' r='3' fill='%23bfdbfe' stroke='none'/%3E%3C/g%3E%3C/svg%3E");
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px);
}

.brand-block {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #059669);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-block h1,
.brand-block p,
.page-head h2,
.page-head p,
.panel h3 {
  margin: 0;
}

.brand-block h1 {
  font-size: 18px;
}

.brand-block p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.nav-tab span:first-child {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 800;
}

.nav-tab.is-active {
  border-color: rgba(37, 99, 235, 0.22);
  color: var(--accent-strong);
  background: #eff6ff;
}

.side-panel {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.side-panel h2 {
  margin: 0 0 14px;
  font-size: 14px;
}

.metric-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.metric-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.metric-list dt {
  color: var(--muted);
  font-size: 13px;
}

.metric-list dd {
  margin: 0;
  font-weight: 800;
}

.workspace {
  min-width: 0;
  padding: 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 24px rgba(21, 32, 51, 0.06);
}

.topbar-copy span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.account-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 38px;
}

.account-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #059669);
  font-size: 12px;
  font-weight: 900;
}

.user-meta {
  display: grid;
  line-height: 1.2;
}

.user-meta b {
  font-size: 13px;
}

.user-meta span {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
}

.page-head h2 {
  margin-top: 4px;
  font-size: 30px;
  line-height: 1.2;
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 18px;
}

.panel,
.score-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.panel h3 {
  margin-bottom: 16px;
  font-size: 18px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.source-switch {
  grid-template-columns: repeat(3, 1fr);
}

.segment {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.segment.is-active {
  color: var(--accent-strong);
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(21, 32, 51, 0.08);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  outline: 0;
}

input:not([type="radio"]):not([type="checkbox"]),
select {
  height: 42px;
  min-height: 42px;
  padding: 0 12px;
  line-height: 42px;
}

textarea {
  resize: vertical;
  min-height: 120px;
  padding: 12px;
  line-height: 1.65;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.is-hidden {
  display: none !important;
}

.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.type-mixer {
  display: grid;
  gap: 10px;
}

.type-row {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) 96px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.type-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.type-label b {
  display: block;
  font-size: 14px;
}

.type-label small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.type-dot {
  width: 12px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent);
}

.difficulty-custom {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mastery-source {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.mastery-source > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mastery-source label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

.mastery-source input {
  width: auto;
  min-height: 0;
}

.mastery-source p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.mastery-source-tree {
  display: grid;
  gap: 8px;
}

.mastery-source-tools,
.mastery-source-pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.mastery-source-tools input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.mastery-source-pager {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.mastery-source-pager span,
.list-pager span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.list-pager span small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.list-pager {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.mastery-source-empty {
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.mastery-source-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mastery-source-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  background: #f8fafc;
}

.mastery-source-group-head label {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.mastery-toggle-button {
  margin-right: 8px;
  min-height: 32px;
  padding: 0 12px;
}

.mastery-source-children {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.mastery-source-children.is-hidden {
  display: none;
}

.mastery-source-children label {
  min-height: 34px;
  padding: 0 10px;
  border-style: dashed;
  font-size: 13px;
}

.mastery-page-jump,
.list-pager label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mastery-page-jump input,
.list-pager input {
  width: 64px;
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.input-limit-hint {
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.input-limit-hint.is-over {
  color: var(--red);
  font-weight: 800;
}

.difficulty-preview {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.difficulty-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.difficulty-chip b,
.difficulty-chip em,
.difficulty-chip small {
  font-style: normal;
  line-height: 1.2;
}

.difficulty-chip b {
  min-width: 56px;
  color: var(--difficulty-color);
  font-size: 13px;
}

.difficulty-chip em {
  color: #ea580c;
  font-size: 18px;
  font-weight: 900;
}

.difficulty-chip small {
  color: var(--muted);
  font-size: 12px;
}

.distribution-preview {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.distribution-preview span,
.distribution-preview p {
  color: var(--muted);
  font-size: 13px;
}

.distribution-preview strong {
  display: block;
  margin-top: 2px;
}

.distribution-preview p {
  margin: 0;
  text-align: right;
}

.action-row,
.head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.action-row {
  margin-top: 18px;
}

.generation-progress {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.06);
}

.generation-progress.is-hidden {
  display: none;
}

.generation-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.generation-progress-head strong {
  color: #f97316;
  font-variant-numeric: tabular-nums;
}

.generation-progress-track {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
}

.generation-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #059669, #f97316);
  transition: width 260ms ease;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.72);
}

.exam-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}

.question-map {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.map-button {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.map-button.is-answered {
  border-color: rgba(5, 150, 105, 0.35);
  color: var(--green);
  background: #ecfdf5;
}

.question-list {
  display: grid;
  gap: 14px;
}

.exam-bottom-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.question-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(21, 32, 51, 0.06);
}

.question-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
}

.pill-basic {
  color: #1d4ed8;
  background: #eff6ff;
}

.pill-strong {
  color: #ca8a04;
  background: #fffbeb;
}

.pill-hard {
  color: #b91c1c;
  background: #fef2f2;
}

.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 16px;
}

.filter-button,
.bookmark-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
}

.filter-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.filter-button span {
  color: var(--accent-strong);
  font-size: 12px;
}

.filter-button.is-active,
.bookmark-button.is-active {
  border-color: rgba(37, 99, 235, 0.34);
  color: var(--accent-strong);
  background: #eff6ff;
}

.bookmark-button {
  flex: 0 0 auto;
}

.record-capacity {
  align-self: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-strong);
  background: #fff;
  font-weight: 900;
}

.mastery-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.mastery-stat,
.mastery-column,
.mastery-item,
.mastery-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mastery-stat {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.mastery-stat span,
.mastery-stat em,
.mastery-stat small,
.mastery-item span,
.muted-text {
  color: var(--muted);
}

.mastery-stat strong {
  font-size: 34px;
  line-height: 1;
}

.mastery-stat em {
  color: #ea580c;
  font-style: normal;
  font-size: 18px;
  font-weight: 900;
}

.mastery-stat.is-green,
.mastery-column.is-green {
  border-color: rgba(5, 150, 105, 0.24);
  background: #f4fffb;
}

.mastery-stat.is-yellow,
.mastery-column.is-yellow {
  border-color: rgba(202, 138, 4, 0.28);
  background: #fffbea;
}

.mastery-stat.is-red,
.mastery-column.is-red {
  border-color: rgba(220, 38, 38, 0.24);
  background: #fff7f7;
}

.mastery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mastery-column {
  min-width: 0;
  padding: 14px;
}

.mastery-column h3 {
  margin: 0 0 12px;
}

.mastery-list {
  display: grid;
  gap: 10px;
}

.mastery-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.8);
}

.mastery-group {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
}

.mastery-group summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.mastery-group summary::-webkit-details-marker {
  display: none;
}

.mastery-group summary::before {
  content: "›";
  color: var(--accent-strong);
  font-size: 20px;
  font-weight: 900;
  transition: transform 180ms ease;
}

.mastery-group[open] summary::before {
  transform: rotate(90deg);
}

.mastery-group summary div {
  flex: 1;
  min-width: 0;
}

.mastery-group summary b,
.mastery-group summary span {
  display: block;
}

.mastery-group summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.mastery-group summary strong {
  color: var(--accent-strong);
  font-size: 20px;
}

.mastery-children {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px 32px;
}

.mastery-children .mastery-item {
  border-style: dashed;
  box-shadow: none;
}

.mastery-item b,
.mastery-item span {
  display: block;
}

.mastery-item span {
  margin-top: 3px;
  font-size: 12px;
}

.mastery-item strong {
  color: var(--accent-strong);
  font-size: 20px;
}

.record-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.record-toolbar .segmented {
  min-width: 220px;
}

.record-search {
  display: grid;
  gap: 6px;
  flex: 1 1 240px;
  min-width: 220px;
}

.record-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.record-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.record-list,
.record-question-list,
.knowledge-records {
  display: grid;
  gap: 10px;
}

.record-list {
  align-self: start;
  align-content: start;
}

.record-list .list-pager {
  grid-template-columns: 1fr 1fr;
}

.record-list .list-pager span {
  grid-column: 1 / -1;
  grid-row: 2;
  padding-top: 2px;
  line-height: 1.5;
}

.record-list .list-pager label {
  grid-column: 1 / -1;
  justify-content: center;
}

.record-tab {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.record-tab.is-active {
  border-color: rgba(37, 99, 235, 0.34);
  background: #eff6ff;
}

.record-tab b,
.record-detail-head h3,
.knowledge-record h3,
.record-question b {
  display: block;
}

.record-tab span,
.record-detail-head p,
.record-question small,
.knowledge-record h3 span {
  color: var(--muted);
  font-size: 12px;
}

.record-detail,
.knowledge-record {
  min-width: 0;
}

.record-detail-head {
  margin-bottom: 12px;
}

.record-detail-head h3,
.knowledge-record h3 {
  margin: 0 0 4px;
}

.knowledge-record {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.record-question {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.record-question.is-wrong {
  border-color: rgba(220, 38, 38, 0.22);
  background: #fff7f7;
}

.record-question.is-right {
  border-color: rgba(5, 150, 105, 0.22);
  background: #f4fffb;
}

.record-question p {
  margin: 5px 0;
  color: var(--muted);
  line-height: 1.55;
}

.membership-plans {
  display: grid;
  gap: 16px;
}

.activation-panel {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(21, 32, 51, 0.06);
}

.activation-panel h3,
.activation-panel p {
  margin: 0;
}

.activation-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}

.activation-message {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
}

.activation-message.is-error {
  color: #b91c1c;
}

.plan-card {
  position: relative;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(21, 32, 51, 0.06);
}

.plan-card.is-vip {
  border-color: rgba(37, 99, 235, 0.36);
  background: #f8fbff;
}

.plan-card.is-go {
  border-color: rgba(5, 150, 105, 0.3);
  background: #f4fffb;
}

.plan-card.is-svip {
  border-color: rgba(124, 58, 237, 0.34);
  background: #fbf9ff;
}

.plan-badge {
  justify-self: start;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.plan-card.is-svip .plan-badge {
  background: #7c3aed;
}

.plan-card.is-go .plan-badge {
  background: #059669;
}

.plan-head {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.plan-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.plan-head h3,
.plan-head p {
  margin: 0;
}

.plan-price {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.plan-price strong {
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.plan-price small,
.plan-head del {
  color: var(--muted);
}

.plan-action {
  justify-self: start;
  margin-top: 4px;
}

.plan-features {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-features li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.plan-features b {
  flex: 0 0 auto;
}

.plan-features span {
  color: var(--muted);
  text-align: right;
}

.compact-empty {
  min-height: 260px;
}

.question-text {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.7;
}

.options {
  display: grid;
  gap: 8px;
}

.option-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.option-line input {
  width: auto;
  min-height: 0;
  margin-top: 4px;
}

.text-answer {
  min-height: 70px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.score-panel {
  display: grid;
  align-content: center;
  min-height: 220px;
  padding: 24px;
}

.score-panel span {
  color: var(--muted);
  font-weight: 800;
}

.score-panel strong {
  margin-top: 8px;
  font-size: 60px;
  line-height: 1;
}

.score-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.quadrant-list,
.review-list,
.benefit-grid {
  display: grid;
  gap: 10px;
}

.quadrant-item,
.review-item,
.benefit-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.quadrant-item b,
.review-item b,
.benefit-item b {
  display: block;
  margin-bottom: 4px;
}

.quadrant-item p,
.review-item p,
.benefit-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.review-item.is-wrong {
  border-color: rgba(220, 38, 38, 0.24);
  background: #fff7f7;
}

.review-item.is-right {
  border-color: rgba(5, 150, 105, 0.22);
  background: #f4fffb;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 40px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
}

.empty-state h3 {
  margin: 16px 0 6px;
  font-size: 22px;
}

.empty-state p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.empty-visual {
  width: 160px;
  height: 110px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 48%, rgba(37, 99, 235, .22) 49%, rgba(37, 99, 235, .22) 51%, transparent 52%),
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, #2563eb, #059669) border-box;
  border: 1px solid transparent;
  box-shadow: var(--shadow);
}

.toast {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: 20px;
  transform: translateY(20px);
  opacity: 0;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #152033;
  box-shadow: var(--shadow);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(8px);
}

.auth-card,
.notice-card {
  position: relative;
  width: min(440px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.auth-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.auth-head h2 {
  margin: 4px 0 0;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 20px;
  line-height: 1;
}

.auth-switch {
  margin-bottom: 16px;
}

.verify-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 10px;
}

.verify-button {
  padding: 0 12px;
  white-space: nowrap;
}

.auth-submit {
  width: 100%;
}

.auth-error {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(220, 38, 38, 0.24);
  border-radius: 8px;
  color: #b91c1c;
  background: #fff7f7;
  font-size: 13px;
  line-height: 1.5;
}

.auth-error.is-info {
  border-color: rgba(37, 99, 235, 0.24);
  color: #1d4ed8;
  background: #eff6ff;
}

.auth-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.quota-detail {
  display: grid;
  gap: 12px;
}

.quota-detail p {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.quota-detail dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.quota-detail div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.quota-detail dt {
  color: var(--muted);
}

.quota-detail dd {
  margin: 0;
  font-weight: 900;
}

.quota-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .nav-tabs {
    grid-template-columns: repeat(6, 1fr);
  }

  .nav-tab {
    justify-content: center;
  }

  .nav-tab span:last-child {
    display: none;
  }

  .side-panel {
    display: none;
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    align-items: stretch;
  }

  .page-head,
  .builder-grid,
  .exam-layout,
  .mastery-summary,
  .mastery-grid,
  .activation-panel,
  .plan-card,
  .record-layout,
  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .activation-message {
    grid-column: auto;
  }

  .page-head {
    display: grid;
  }

  .question-map {
    position: static;
    grid-template-columns: repeat(10, minmax(32px, 1fr));
  }
}

@media (max-width: 620px) {
  .nav-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .split-row {
    grid-template-columns: 1fr;
  }

  .source-switch {
    grid-template-columns: 1fr;
  }

  .type-row {
    grid-template-columns: 1fr;
  }

  .difficulty-custom,
  .difficulty-preview,
  .mastery-source-tools,
  .mastery-source-pager,
  .list-pager,
  .mastery-source-group-head {
    grid-template-columns: 1fr;
  }

  .distribution-preview {
    display: grid;
  }

  .distribution-preview p {
    text-align: left;
  }

  .page-head h2 {
    font-size: 24px;
  }
}
