:root {
  --bg: #f6f8fc;
  --card: #fff;
  --text: #1b2430;
  --muted: #5f6b7a;
  --primary: #3662ff;
  --border: #e4e9f2;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.wrap { width: 100%; max-width: none; margin: 0 auto; padding: 16px; box-sizing: border-box; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
h1 { margin: 0 0 8px; font-size: 22px; }
h2 { margin: 0 0 10px; font-size: 17px; }
p.muted { margin: 0; color: var(--muted); }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs button {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}
.tabs button.on { border-color: #c7d2fe; background: #eef2ff; font-weight: 600; color: #3730a3; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}
input[type="radio"],
input[type="checkbox"] {
  width: auto;
  max-width: none;
  padding: 0;
  vertical-align: middle;
  accent-color: var(--primary);
}
textarea { min-height: 140px; font-family: inherit; }
.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  font-size: 14px;
}
.btn.secondary { background: #64748b; }
.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.flash { padding: 10px 12px; border-radius: 8px; margin-bottom: 10px; font-size: 13px; }
.flash.err { background: #fee2e2; color: #7f1d1d; }
.flash.ok { background: #dcfce7; color: #14532d; }
.flash.info { background: #e0f2fe; color: #0c4a6e; }
.paper-list { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.paper-item {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.paper-item:last-child { border-bottom: 0; }
.paper-item:hover { background: #f8fafc; }
.paper-item.on { background: #eef2ff; }
.detail { margin-top: 12px; padding: 12px; background: #f8fafc; border-radius: 10px; border: 1px solid var(--border); }
pre.block {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.drop {
  border: 1px dashed #b7c6eb;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  margin-top: 10px;
}
.drop:focus {
  outline: none;
}
.drop:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(54, 98, 255, 0.25);
}
.form-grid { display: grid; gap: 12px; }
.btn:disabled { opacity: 0.65; cursor: not-allowed; }
.detail h4 {
  margin: 14px 0 8px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}
.meta-line { margin: 6px 0; font-size: 14px; }
.meta-line .lbl { color: var(--muted); margin-right: 8px; }
ul.bullets, ol.steps { margin: 8px 0 0; padding-left: 1.25rem; }
ul.bullets li.muted, ol.steps li.muted { color: var(--muted); list-style: none; margin-left: -1rem; }

.btn-tab {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  margin-right: 8px;
  margin-bottom: 4px;
}
.btn-tab.on {
  border-color: #c7d2fe;
  background: #eef2ff;
  font-weight: 600;
  color: #3730a3;
}
.eo-mode-tabs { margin: 10px 0; }
.eo-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
}
.btn-tab-sub {
  font-size: 13px;
  padding: 7px 12px;
}
.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 8px;
  align-items: center;
}
label.radio-chip {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: 100%;
  margin-bottom: 0;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  line-height: 1.3;
}
.radio-chip input[type="radio"] {
  flex: 0 0 auto;
  margin: 0;
}
.radio-chip .radio-label {
  flex: 0 1 auto;
  white-space: normal;
}
.eo-subsection[hidden] { display: none !important; }
.essay-topic-card {
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.essay-topic-card h4 { font-size: 14px; color: var(--muted); font-weight: 600; }
.essay-review-grid { display: grid; gap: 10px; }
@media (min-width: 720px) {
  .essay-review-grid { grid-template-columns: 1fr 1fr; }
}
.essay-card {
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.essay-card h4 { margin: 0 0 10px; font-size: 14px; color: var(--muted); font-weight: 600; }
.essay-card-span { grid-column: 1 / -1; }
.essay-review-p { margin: 0; line-height: 1.55; }
.star-dim { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; }
.dim-name { color: var(--muted); font-size: 13px; }
.dim-stars { letter-spacing: 1px; font-size: 16px; white-space: nowrap; }
.star.on { color: #d97706; }
.star.off { color: #cbd5e1; }

.btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
}
.btn-link:hover { text-decoration: underline; }

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.subject-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.subject-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 14px rgba(54, 98, 255, 0.08);
}
.sc-name { font-size: 16px; font-weight: 700; color: var(--text); }
.sc-hint { font-size: 12px; color: var(--muted); }

.hub-nav { margin-bottom: 12px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.feature-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fafbff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.feature-card:hover { border-color: #b7c6eb; background: #fff; }
.feature-card.on {
  border-color: var(--primary);
  background: #eef2ff;
  box-shadow: 0 0 0 1px rgba(54, 98, 255, 0.25);
}
.feature-card.soon {
  opacity: 0.72;
  cursor: default;
  background: #f8fafc;
}
.feature-card.soon:hover { border-color: var(--border); background: #f8fafc; }
.fc-title { font-size: 15px; font-weight: 700; color: var(--text); }
.fc-desc { font-size: 12px; color: var(--muted); line-height: 1.45; }

.feature-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}


/* ==== v0.2 c-sidebar style refresh ==== */
:root {
  --bg: #fff7e6;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #fa8c16;
  --border: #eadfcb;
  --accent: #597ef7;
}

body {
  background: linear-gradient(180deg, #fff, #fff7e6);
  font-size: 14px;
  letter-spacing: 0.1px;
}

.student-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.student-sidebar {
  border-right: 1px solid var(--border);
  background: #ffffffd9;
  backdrop-filter: blur(8px);
  min-height: 100vh;
  position: sticky;
  top: 0;
}

.student-nav-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 18px 12px;
}

.student-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.student-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.student-brand strong {
  font-size: 0.92rem;
  font-weight: 600;
}

.student-nav-title {
  padding: 14px 18px 8px;
  color: var(--muted);
  font-size: 0.74rem;
}

.student-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 8px;
  padding: 8px 11px;
  border-radius: 10px;
  color: #111827;
  text-decoration: none;
  font-size: 0.88rem;
}

.student-nav-link.active {
  background: color-mix(in srgb, var(--primary) 14%, white);
  font-weight: 600;
}

.student-main {
  min-width: 0;
}

.topbar-lite {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffffd9;
  position: sticky;
  top: 0;
  z-index: 6;
}

.topbar-lite strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.topbar-lite small {
  color: var(--muted);
  font-size: 0.76rem;
}

.wrap { padding: 20px; }
.card {
  border-radius: 14px;
  border-color: var(--border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

h1 { font-size: 1.18rem; font-weight: 600; }
h2, .section-title, .feature h3, .fc-title { font-size: 0.93rem; font-weight: 600; }
.muted, .fc-desc, label { font-size: 0.86rem; line-height: 1.55; }

.btn {
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 12px;
}

.btn.secondary {
  background: #8b6f47;
}

.tabs button.on,
.btn-tab.on,
.feature-card.on,
.paper-item.on {
  border-color: color-mix(in srgb, var(--primary) 45%, white);
  background: color-mix(in srgb, var(--primary) 13%, white);
  color: #7c2d12;
}

.subject-card:hover,
.feature-card:hover,
.paper-item:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, white);
}

.mobile-bottom-tab {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  background: #fff;
  border-top: 1px solid var(--border);
  z-index: 20;
}

.mobile-bottom-tab .tab {
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.mobile-bottom-tab .tab.active {
  color: var(--primary);
  font-weight: 700;
}

.radio-line {
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  line-height: 1.5;
}

.radio-line:hover {
  border-color: color-mix(in srgb, var(--primary) 35%, white);
}

.radio-line input[type="radio"] {
  margin-right: 8px;
}

#studentMainPane .detail {
  background: #fffdf9;
}

#studentMainPane .detail .card {
  box-shadow: none;
}

#studentMainPane [data-er-qcard] {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

#studentMainPane .er-reading-titlebar {
  justify-content: flex-start;
}

#studentMainPane .er-grade-banner {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
}

#studentMainPane .er-passage-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 4px 0;
}

#studentMainPane .er-passage-title {
  margin: 0;
  line-height: 1.35;
  font-size: 1.05rem;
  font-weight: 600;
}

#studentMainPane .er-passage-meta-toggle {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0 2px;
  margin: 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 4px;
  vertical-align: middle;
}

#studentMainPane .er-passage-meta-toggle:hover {
  color: var(--text);
}

#studentMainPane .er-passage-meta-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#studentMainPane .er-q-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

#studentMainPane .radio-line {
  color: var(--muted);
}

#studentMainPane .er-q-stem {
  font-size: 14px;
  line-height: 1.6;
}

#studentMainPane [data-er-qcard] p.muted {
  margin: 8px 0 0;
}

#studentMainPane .er-current-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #7c2d12;
  background: color-mix(in srgb, var(--primary) 16%, white);
  border: 1px solid color-mix(in srgb, var(--primary) 40%, white);
}

#studentMainPane [data-er-qcard].er-qcard-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
  transform: translateY(-1px);
}

#studentMainPane .er-status-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  margin-right: 8px;
}

#studentMainPane .er-status-badge.ok {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
}

#studentMainPane .er-status-badge.err {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

#studentMainPane .er-status-badge.warn {
  color: #92400e;
  background: #ffedd5;
  border: 1px solid #fdba74;
}

#studentMainPane .er-status-note {
  font-size: 12px;
  color: #6b7280;
}

#studentMainPane .er-progress-wrap {
  margin: 6px 0 12px;
}

#studentMainPane .er-progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

#studentMainPane .er-progress-hint {
  margin: 6px 0 0;
  font-size: 12px;
}

#studentMainPane .er-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}

#studentMainPane .er-progress-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #f97316);
  transition: width 0.2s ease;
}

#studentMainPane [data-er-qstem-zh],
#studentMainPane [data-er-options-zh] {
  border-left: 3px solid color-mix(in srgb, var(--primary) 40%, white);
  padding-left: 10px;
}

#studentMainPane .detail > strong {
  color: #374151;
}

#studentMainPane .detail .btn {
  margin-top: 12px;
}

#studentMainPane .er-next-practice-btn {
  margin-left: 8px;
}

#studentMainPane .detail[style*="border-top:1px dashed"] {
  background: #fff;
}

#studentMainPane .flash.err {
  border: 1px solid #fecaca;
}

@media (max-width: 1199px) {
  .student-shell { grid-template-columns: 76px 1fr; }
  .student-brand strong,
  .student-nav-title,
  .student-nav-link .label { display: none; }
  .student-nav-link { justify-content: center; }
}

@media (max-width: 767px) {
  .student-shell { display: block; }
  .student-sidebar { display: none; }
  .topbar-lite { position: static; }
  .wrap { padding: 14px; margin-bottom: 66px; }
  .mobile-bottom-tab { display: flex; }
  #studentMainPane .toolbar { gap: 10px; }
  #studentMainPane .toolbar > div { width: 100%; display: flex; gap: 8px; }
  #studentMainPane .toolbar > div .btn { flex: 1; }
  #studentMainPane [data-er-qcard] {
    padding: 10px 9px !important;
  }
}
