:root {
  --ink: #17202a;
  --muted: #607080;
  --line: #d8e0e7;
  --panel: #ffffff;
  --paper: #eef3f6;
  --nav: #111923;
  --nav-soft: #223044;
  --green: #167c55;
  --red: #b84343;
  --amber: #a66a12;
  --cyan: #0f7885;
  --violet: #5d5aa0;
  --focus: #246fb2;
  --shadow: 0 16px 38px rgba(17, 25, 35, 0.08);
  --shadow-soft: 0 8px 22px rgba(17, 25, 35, 0.06);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Segoe UI",
    Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #eef3f6 0%, #f8fbfc 54%, #eef3f6 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px 18px;
  color: #ecf2f5;
  background: linear-gradient(180deg, #111923 0%, #172535 100%);
  min-height: 0;
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 800;
  color: #10202d;
  background: #83d0c6;
  box-shadow: 0 10px 24px rgba(131, 208, 198, 0.24);
}

.brand strong,
.brand span,
.sidebar-status strong,
.sidebar-status span {
  display: block;
}

.brand span,
.sidebar-status span {
  margin-top: 3px;
  color: #9fb0bd;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.nav-item {
  width: 100%;
  height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  text-align: left;
  color: #d6e2e9;
  background: transparent;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: var(--nav-soft);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-item:hover {
  transform: translateX(2px);
}

.nav-item.active {
  box-shadow: inset 3px 0 #83d0c6;
}

.sidebar-status {
  margin-top: auto;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #63d49e;
  box-shadow: 0 0 0 4px rgba(99, 212, 158, 0.14);
}

.main {
  min-width: 0;
  padding: 24px 26px 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(216, 224, 231, 0.85);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.12;
}

h2 {
  font-size: 17px;
}

.topbar-actions,
.view-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.view-toolbar {
  margin-bottom: 16px;
  justify-content: space-between;
}

.select-label,
.search-box,
.form-grid label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

select,
input {
  width: 100%;
  min-height: 38px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(17, 25, 35, 0.03);
}

select:focus,
input:focus,
button:focus {
  outline: 2px solid rgba(39, 113, 186, 0.25);
  outline-offset: 2px;
}

.select-label {
  min-width: 132px;
}

.search-box {
  min-width: 260px;
}

.icon-button,
.primary-button,
.secondary-button,
.danger-button,
.text-button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 13px;
  font-weight: 700;
  white-space: nowrap;
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    background 0.14s ease;
}

.icon-button:hover,
.primary-button:hover,
.secondary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.primary-button {
  color: #fff;
  background: var(--focus);
  border-color: var(--focus);
}

.secondary-button {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.danger-button {
  color: #fff;
  background: var(--red);
}

.icon-button {
  color: #fff;
  background: var(--nav-soft);
}

.icon-button[aria-pressed="false"] {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.text-button {
  min-height: 32px;
  padding: 0 8px;
  color: var(--focus);
  background: transparent;
}

.full {
  width: 100%;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric-grid.compact {
  grid-template-columns: repeat(2, minmax(140px, 1fr));
}

.metric-card,
.panel,
.pool-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 112px;
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--focus);
}

.metric-card:nth-child(2)::before {
  background: var(--green);
}

.metric-card:nth-child(3)::before {
  background: var(--cyan);
}

.metric-card:nth-child(4)::before {
  background: var(--red);
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 12px 0 7px;
  font-size: 30px;
  line-height: 1;
}

.metric-card.risk {
  border-color: rgba(184, 67, 67, 0.35);
}

.positive {
  color: var(--green) !important;
}

.negative {
  color: var(--red) !important;
}

.warning {
  color: var(--amber) !important;
}

.layout-two {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.layout-market {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(330px, 0.7fr);
  gap: 18px;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.panel-head {
  min-height: 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(216, 224, 231, 0.72);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--cyan);
  background: rgba(20, 120, 138, 0.1);
  font-size: 12px;
  font-weight: 800;
}

.pill.danger {
  color: var(--red);
  background: rgba(184, 67, 67, 0.12);
}

.pill.ok {
  color: var(--green);
  background: rgba(22, 124, 85, 0.12);
}

.pill.warn {
  color: var(--amber);
  background: rgba(166, 106, 18, 0.12);
}

.market-summary,
.strategy-strip,
.order-summary,
.stack-list,
.detail-list,
.report-block,
.check-list {
  display: grid;
  gap: 10px;
}

.market-row,
.stack-item,
.strategy-card,
.summary-row,
.detail-row,
.check-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(17, 25, 35, 0.035);
}

.market-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 12px;
}

.market-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8edf1;
}

.market-bar span {
  display: block;
  height: 100%;
  background: var(--cyan);
}

.market-row:nth-child(2) .market-bar span {
  background: var(--violet);
}

.market-row:nth-child(3) .market-bar span {
  background: var(--green);
}

.stack-item,
.summary-row,
.detail-row,
.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stack-item strong,
.detail-row strong {
  display: block;
  margin-bottom: 3px;
}

.stack-item small,
.detail-row small,
.pool-card small,
.strategy-card small {
  color: var(--muted);
}

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

.strategy-card {
  min-height: 128px;
}

.strategy-card strong,
.pool-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.strategy-meta,
.pool-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  height: 48px;
  border-bottom: 1px solid var(--line);
  padding: 0 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  background: #f6f9fb;
}

td {
  font-size: 14px;
}

tbody tr:hover {
  background: #f4f8fa;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.small-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--ink);
  background: #fff;
  font-weight: 700;
}

.small-button.primary {
  color: #fff;
  border-color: var(--focus);
  background: var(--focus);
}

.small-button.danger {
  color: var(--red);
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.segment {
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.segment:last-child {
  border-right: 0;
}

.segment.active {
  color: #fff;
  background: var(--focus);
}

.mini-chart {
  width: 100%;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 10px;
  background:
    linear-gradient(#edf2f5 1px, transparent 1px),
    linear-gradient(90deg, #edf2f5 1px, transparent 1px),
    #fbfdfe;
  background-size: 36px 36px;
}

.mini-chart.large {
  min-height: 260px;
}

.mini-chart svg {
  width: 100%;
  height: 100%;
  min-height: 160px;
  display: block;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.pool-card {
  min-height: 178px;
  padding: 16px;
}

.pool-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.strategy-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.wide-detail {
  margin-top: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid .full,
.form-grid button.full {
  grid-column: 1 / -1;
}

.audit-list {
  margin-top: 12px;
  max-height: 220px;
  overflow: auto;
}

.audit-list.expanded {
  max-height: 620px;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(64px, 1fr));
  gap: 8px;
}

.heat-cell {
  min-height: 66px;
  display: grid;
  align-content: center;
  border-radius: 8px;
  padding: 8px;
  color: #fff;
  background: var(--cyan);
}

.heat-cell small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.8);
}

.weight-bar {
  width: 160px;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8edf1;
}

.weight-bar span {
  display: block;
  height: 100%;
  background: var(--focus);
}

.config-value {
  font-weight: 800;
  color: var(--ink);
}

.report-block p {
  margin: 0;
  line-height: 1.7;
}

.check-row.done {
  border-color: rgba(22, 124, 85, 0.2);
}

.check-row.pending {
  border-color: rgba(166, 106, 18, 0.25);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: 360px;
  min-height: 42px;
  display: none;
  align-items: center;
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  background: var(--nav);
  box-shadow: var(--shadow);
}

.toast.show {
  display: flex;
}

/* ---- Skeleton Loading ---- */
.skeleton {
  background: linear-gradient(90deg, #e2e8ef 25%, #f0f4f7 50%, #e2e8ef 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease infinite;
  border-radius: 4px;
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  align-items: center;
}
.skeleton-text { height: 15px; flex: 1; }
.skeleton-text.short { flex: 0 0 60px; }
.skeleton-text.medium { flex: 0 0 120px; }
.skeleton-block { height: 40px; width: 80px; border-radius: 6px; }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty-state strong {
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--ink);
}
.empty-state small {
  display: block;
  line-height: 1.5;
}

/* ---- Field Error ---- */
.field-error {
  display: block;
  color: var(--red);
  font-size: 12px;
  margin-top: 4px;
  font-weight: 700;
}
input.field-invalid,
select.field-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(184, 67, 67, 0.15);
}

/* ---- Data Freshness ---- */
.pill.fresh { background: rgba(22, 124, 85, 0.12); color: var(--green); }
.pill.stale { background: rgba(166, 106, 18, 0.12); color: var(--amber); }
.pill.expired { background: rgba(184, 67, 67, 0.12); color: var(--red); }

/* ---- Retry Button ---- */
.retry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}
.retry-button {
  min-height: 28px;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--focus);
  border: none;
  cursor: pointer;
}

/* ---- Onboarding Wizard ---- */
.onboarding-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(17, 25, 35, 0.72);
  display: grid; place-items: center;
  padding: 20px;
}
.onboarding-overlay.hidden { display: none; }
.onboarding-modal {
  max-width: 580px; width: 100%;
  background: #fff; border-radius: 14px;
  box-shadow: 0 28px 56px rgba(17, 25, 35, 0.28);
  overflow: hidden;
}
.onboarding-header {
  text-align: center; padding: 32px 24px 16px;
  background: linear-gradient(180deg, #111923 0%, #1c3148 100%);
  color: #fff;
}
.onboarding-header h2 { color: #fff; font-size: 22px; margin-top: 12px; font-weight: 900; }
.onboarding-steps { padding: 24px; min-height: 220px; }
.onboarding-step { display: none; }
.onboarding-step.active { display: block; }
.onboarding-step h3 { margin-bottom: 12px; font-size: 18px; font-weight: 900; color: var(--ink); }
.onboarding-step p { color: var(--muted); line-height: 1.7; margin-bottom: 12px; font-size: 14px; }
.workflow-visual {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0; flex-wrap: wrap; justify-content: center;
}
.workflow-node {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--cyan); color: #fff;
  display: grid; place-items: center; font-weight: 800;
  font-size: 14px; box-shadow: 0 4px 14px rgba(15, 120, 133, 0.3);
}
.arrow { color: var(--muted); font-weight: 800; font-size: 20px; }
.onboarding-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; border-top: 1px solid var(--line);
}
.onboarding-dots { display: flex; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); transition: background .2s; }
.dot.active { background: var(--focus); }
.onboarding-checkbox {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; font-size: 14px; cursor: pointer; color: var(--ink);
}
.onboarding-checkbox input { width: auto; min-height: auto; margin: 0; }

/* ---- Help Tooltip ---- */
.help-tooltip {
  position: fixed; z-index: 60;
  background: #111923; color: #ecf2f5;
  border-radius: 10px; padding: 14px 18px;
  max-width: 300px; box-shadow: 0 12px 32px rgba(17, 25, 35, 0.3);
}
.help-tooltip.hidden { display: none; }
.tooltip-content strong { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 900; }
.tooltip-content p { color: #b0becd; font-size: 13px; line-height: 1.6; margin: 0 0 10px; }
#tooltipClose { color: #83d0c6; font-size: 12px; font-weight: 700; }

/* ---- Help Icon ---- */
.help-icon {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--line); color: var(--muted);
  font-size: 12px; font-weight: 800; cursor: pointer;
  border: none; transition: background .2s;
}
.help-icon:hover { background: var(--focus); color: #fff; }

/* ---- Glossary Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(17, 25, 35, 0.6);
  display: grid; place-items: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal-panel {
  max-width: 660px; width: 100%; max-height: 80vh;
  background: #fff; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 48px rgba(17, 25, 35, 0.22);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.modal-header h2 { font-size: 20px; font-weight: 900; margin: 0; }
#glossaryContent {
  padding: 16px 22px; overflow-y: auto;
  display: grid; gap: 12px;
}
.glossary-list .stack-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.glossary-list .stack-item strong { color: var(--ink); font-size: 14px; display: block; }
.glossary-list .stack-item small { color: var(--muted); line-height: 1.5; margin-top: 4px; display: block; }

/* ---- Workflow Progress ---- */
.workflow-progress {
  display: flex; align-items: center; gap: 0;
  margin: 0 0 20px; padding: 18px 20px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px;
  overflow-x: auto;
}
.progress-node { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.node-circle {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  background: var(--line); color: var(--muted);
  flex-shrink: 0;
}
.progress-node.completed .node-circle { background: var(--green); color: #fff; }
.progress-node.current .node-circle { background: var(--focus); color: #fff; box-shadow: 0 0 0 5px rgba(36, 111, 178, 0.18); }
.node-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.progress-node.completed .node-label,
.progress-node.current .node-label { color: var(--ink); }
.progress-line { flex: 1; height: 2px; background: var(--line); min-width: 20px; flex-shrink: 1; }
.progress-node.completed + .progress-line { background: var(--green); }

/* ---- Simplified Mode ---- */
.simplified-hidden { display: none !important; }
.checkbox-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0; font-size: 14px; cursor: pointer;
}
.checkbox-row input { width: auto; min-height: auto; margin: 0; }

/* ---- Academy Layout ---- */
.nav-academy span { color: #83d0c6; }
.academy-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}
.academy-toc {
  position: sticky; top: 20px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 16px;
  max-height: calc(100vh - 140px); overflow-y: auto;
}
.academy-toc h3 { font-size: 14px; font-weight: 900; margin-bottom: 12px; color: var(--ink); }
.academy-chapter-item {
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  margin-bottom: 2px; font-size: 13px; font-weight: 700;
  color: var(--ink); transition: background .15s;
  display: flex; align-items: center; gap: 8px;
}
.academy-chapter-item:hover { background: var(--paper); }
.academy-chapter-item.active { background: rgba(36, 111, 178, 0.1); color: var(--focus); }
.academy-chapter-item.read .chapter-check { color: var(--green); }
.chapter-check { font-size: 11px; width: 16px; text-align: center; color: var(--line); flex-shrink: 0; }
.academy-section-item {
  padding: 4px 10px 4px 28px; border-radius: 4px; cursor: pointer;
  font-size: 12px; color: var(--muted); transition: color .15s;
}
.academy-section-item:hover { color: var(--ink); }
.academy-section-item.read { color: var(--green); }

.academy-content {
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 28px; min-height: 60vh;
}
.academy-content h2 { font-size: 24px; font-weight: 900; margin-bottom: 8px; color: var(--ink); }
.academy-content h3 { font-size: 18px; font-weight: 900; margin: 24px 0 10px; color: var(--ink); }
.academy-content p { color: var(--muted); line-height: 1.8; margin-bottom: 14px; font-size: 14px; }
.academy-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 8px; padding: 16px; margin: 16px 0;
}
.academy-card h4 { font-size: 15px; font-weight: 900; margin-bottom: 8px; color: var(--ink); }
.academy-card p { margin-bottom: 0; font-size: 13px; }
.academy-quote {
  border-left: 4px solid var(--cyan); padding: 12px 16px;
  margin: 18px 0; background: rgba(15, 120, 133, 0.04);
  border-radius: 0 6px 6px 0; font-style: italic;
}
.academy-quote p { margin: 0; color: var(--cyan); font-weight: 700; font-size: 15px; }
.academy-comparison {
  width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px;
}
.academy-comparison th {
  text-align: left; padding: 8px 12px; background: var(--nav);
  color: #ecf2f5; font-weight: 800;
}
.academy-comparison td {
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.academy-diagram {
  text-align: center; padding: 20px; margin: 16px 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
}
.academy-cta {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; margin: 18px 0;
  background: rgba(36, 111, 178, 0.08); border: 1px solid rgba(36, 111, 178, 0.2);
  border-radius: 8px;
}
.academy-cta span { font-size: 13px; color: var(--ink); font-weight: 700; }
.academy-next-prev {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line);
}
.reading-paths { display: flex; gap: 4px; }
.reading-paths .segment { font-size: 11px; padding: 4px 10px; }

@media (max-width: 980px) {
  .academy-layout { grid-template-columns: 1fr; }
  .academy-toc { position: static; max-height: none; }
}

/* ---- Academy Quiz & Practice ---- */
.academy-objectives { background: linear-gradient(135deg, rgba(36,111,178,0.06), rgba(15,120,133,0.04)); border: 1px solid rgba(36,111,178,0.15); border-radius: 10px; padding: 16px 20px; margin: 0 0 20px; }
.academy-objectives h4 { font-size: 14px; font-weight: 900; color: var(--focus); margin-bottom: 8px; }
.academy-objectives li { color: var(--ink); font-size: 13px; line-height: 1.8; }
.quiz-block { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 20px; margin: 20px 0; }
.quiz-block h4 { font-size: 15px; font-weight: 900; color: var(--ink); margin-bottom: 6px; }
.quiz-block .quiz-hint { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.quiz-question { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.quiz-question:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.quiz-question p { font-weight: 700; color: var(--ink); margin-bottom: 8px; font-size: 14px; }
.quiz-option { display: block; width: 100%; text-align: left; padding: 8px 14px; margin-bottom: 4px; border: 1px solid var(--line); border-radius: 6px; background: #fafbfc; color: var(--ink); font-size: 13px; cursor: pointer; transition: all .15s; }
.quiz-option:hover { border-color: var(--focus); background: rgba(36,111,178,0.04); }
.quiz-option.correct { border-color: var(--green); background: rgba(22,124,85,0.08); color: var(--green); font-weight: 700; }
.quiz-option.wrong { border-color: var(--red); background: rgba(184,67,67,0.06); color: var(--red); }
.quiz-option:disabled { cursor: default; opacity: 0.85; }
.quiz-result { text-align: center; padding: 14px; border-radius: 8px; margin-top: 12px; font-weight: 800; font-size: 14px; }
.quiz-score { font-size: 24px; font-weight: 900; }
.quiz-pass { background: rgba(22,124,85,0.08); color: var(--green); }
.quiz-fail { background: rgba(184,67,67,0.06); color: var(--red); }
.practice-guide { background: linear-gradient(135deg, rgba(93,90,160,0.06), rgba(15,120,133,0.04)); border: 1px solid rgba(93,90,160,0.15); border-radius: 10px; padding: 18px 20px; margin: 20px 0; }
.practice-guide h4 { font-size: 14px; font-weight: 900; color: var(--violet); margin-bottom: 10px; }
.practice-guide li { color: var(--ink); font-size: 13px; line-height: 1.8; margin-bottom: 4px; }

  display: flex; align-items: center; gap: 8px;
  padding: 10px 0; font-size: 14px; cursor: pointer;
}
.checkbox-row input { width: auto; min-height: auto; margin: 0; }

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

  .sidebar {
    position: static;
    height: auto;
    gap: 14px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(86px, 1fr));
    max-height: 230px;
  }

  .metric-grid,
  .layout-two,
  .layout-market,
  .strategy-detail-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .main {
    padding: 20px;
  }

  .strategy-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .main {
    padding: 16px;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-actions,
  .view-toolbar {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .segmented,
  .search-box,
  .select-label,
  .topbar-actions button,
  .view-toolbar button,
  .view-toolbar .pill {
    width: 100%;
  }

  .segmented {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .segment {
    padding: 0 8px;
  }

  .metric-grid.compact,
  .form-grid {
    grid-template-columns: 1fr;
  }
}
