/* 诊断页布局。配色、字号和导航来自 assets/site.css。 */

main#root { width: min(840px, 100%); margin: 0 auto; padding: 20px 16px 56px; }
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 18px;
  margin-bottom: 12px;
  min-width: 0;
  max-width: 100%;
}
.card h1, .card h2 { font-size: 1.28rem; margin: 0 0 8px; line-height: 1.3; letter-spacing: -0.02em; }
.card h3 { font-size: 1.05rem; margin: 12px 0 4px; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }
.err { color: var(--bad); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }
button.good { background: var(--ok); border-color: transparent; color: var(--on-ok); }
button.bad { background: var(--bad); border-color: transparent; color: var(--on-bad); }
button.good:hover { background: var(--ok); filter: brightness(1.06); }
button.bad:hover { background: var(--bad); filter: brightness(1.06); }
button:disabled { opacity: .55; cursor: not-allowed; }
label { font-weight: 700; }

.banner { background: var(--brand-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px; }
.banner.demo { background: var(--warn-bg); }
.chapter-browser { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 16px 14px; background: var(--bg-elev); }
.chapter-browser > summary { cursor: pointer; font-weight: 800; font-size: 1.05rem; min-height: 44px; display: flex; align-items: center; color: var(--brand-strong); }
.vol { border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; background: var(--bg-elev); overflow: hidden; box-shadow: var(--shadow-sm); }
.vol > summary { padding: 10px 14px; font-weight: 800; cursor: pointer; background: var(--bg-muted); border-radius: 12px; }
.vol[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: 1px solid var(--line); }
.chap { margin: 0 8px 8px; }
.chap-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 4px; font-weight: 800; border-bottom: 1px solid var(--line); }
.chap-head .t { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.btn-chap-start { display: inline-flex; align-items: center; gap: 4px; background: var(--bg-elev); color: var(--brand-strong); border: 1.5px solid var(--brand); padding: 5px 12px; border-radius: 8px; font-size: 0.86rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: all 0.15s ease; }
.btn-chap-start:hover { background: var(--brand); color: #fff; }
.topic-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 8px; border-bottom: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: background 0.15s ease; }
.topic-row:hover { background: var(--brand-soft); }
.topic-row .nm { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; font-weight: 700; color: var(--text); }
.topic-row .sec { color: var(--muted); font-size: 0.85rem; background: var(--bg-muted); padding: 2px 8px; border-radius: 4px; }
.btn-start-target { display: inline-flex; align-items: center; gap: 4px; background: var(--brand); color: #fff; border: none; padding: 6px 14px; border-radius: 8px; font-size: 0.88rem; font-weight: 700; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 3px rgba(13, 148, 136, 0.25); transition: all 0.15s ease; }
.btn-start-target:hover { background: var(--brand-strong); transform: translateY(-1px); box-shadow: 0 3px 6px rgba(13, 148, 136, 0.35); }
.diag-settings-details { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 8px 12px; background: var(--bg-muted); }
.diag-settings-details > summary { cursor: pointer; font-size: 0.88rem; color: var(--muted); font-weight: 600; }
#search { margin-top: 8px; }

.progress { height: 8px; background: var(--bg-muted); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.q-title { font-size: 1.35rem; margin: 8px 0; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.q-text { font-size: 1.12rem; line-height: 1.65; padding: 14px 14px; background: var(--bg-muted); border-radius: 12px; margin: 12px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.reason { color: var(--muted); }
.ans-input { width: 100%; font-size: 1.1rem; }
.notice { color: var(--warn); background: var(--warn-bg); padding: 8px 12px; border-radius: 10px; margin-top: 12px; }
.verdict { padding: 10px 12px; border-radius: 10px; margin: 10px 0; font-weight: 800; }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.no { background: var(--bad-bg); color: var(--bad); }
.refans { background: var(--ok-bg); border: 1px dashed var(--ok); padding: 10px 12px; border-radius: 10px; margin: 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.explain { background: var(--junior-soft); border-left: 4px solid var(--junior); padding: 10px 12px; border-radius: 8px; margin: 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.choices { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
button.choice { text-align: left; width: 100%; min-height: 48px; padding: 12px 14px; font-size: 1.02rem; font-weight: 600; white-space: pre-wrap; border-radius: 12px; }
button.choice.picked { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }

/* 提交/下一题所在操作栏固定在视口底部，看完解析不用再滚动 */
.card .actions-sticky {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-left: -16px;
  margin-right: -16px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-elev);
  border-top: 1px solid var(--line);
}

.tag { display: inline-block; font-size: 0.78rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; margin-right: 4px; background: var(--bg-muted); color: var(--text); vertical-align: 1px; }
.tag.weak { background: var(--bad-bg); color: var(--bad); }
.tag.mastered { background: var(--ok-bg); color: var(--ok); }
.tag.unknown { background: var(--unk-bg); color: var(--unk); }
.tag.shaky { background: var(--diagram-shaky-bg); color: var(--diagram-shaky); }
.tag.root { background: var(--bad); color: var(--on-bad); }
.tag.target { background: var(--junior); color: var(--on-brand); }
.tag.ext { background: var(--junior-soft); color: var(--text); }
.tag.diff-basic { background: var(--ok-bg); color: var(--ok); }
.tag.diff-standard { background: var(--junior-soft); color: var(--text); }
.tag.diff-challenge, .tag.diff-advanced { background: #fae8ff; color: #86198f; }
@media (prefers-color-scheme: dark) {
  .tag.diff-challenge, .tag.diff-advanced { background: #581c87; color: #f5d0fe; }
}

.stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.stat { flex: 1 1 88px; min-width: 0; padding: 10px 8px; border-radius: 12px; text-align: center; background: var(--bg-muted); }
.stat b { display: block; font-size: 1.55rem; line-height: 1.1; letter-spacing: -0.03em; }
.stat.ok { background: var(--ok-bg); color: var(--ok); }
.stat.bad { background: var(--bad-bg); color: var(--bad); }
.stat.shaky { background: var(--diagram-shaky-bg); color: var(--diagram-shaky); }
.stat.unk { background: var(--unk-bg); color: var(--unk); }
.stat.ask { background: var(--junior-soft); color: var(--text); }
details.card > summary { cursor: pointer; font-size: 1.15rem; font-weight: 800; padding: 4px 0; }
details.card[open] > summary { margin-bottom: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
details.topic { border-bottom: 1px solid var(--line); padding: 4px 0; }
details.topic > summary { cursor: pointer; padding: 8px 0; min-height: 44px; overflow-wrap: anywhere; }
details.topic[open] > summary { font-weight: 750; }
details.topic > .body { padding: 4px 0 10px 8px; }
.body ul { margin: 4px 0; padding-left: 1.2em; }
.std { margin: 8px 0; padding: 8px 10px; background: var(--bg-muted); border-left: 3px solid var(--brand); border-radius: 8px; overflow-wrap: anywhere; }
.std code { color: var(--text); }
.std .conf { color: var(--muted); margin-left: 4px; }
ol.path { padding-left: 0; list-style: none; counter-reset: step; margin: 0; }
ol.path > li { counter-increment: step; position: relative; padding-left: 40px; min-width: 0; }
ol.path > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 8px;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--brand);
  color: var(--on-brand);
  text-align: center;
  line-height: 28px;
  font-size: 0.85rem;
  font-weight: 800;
}
details.chap-sum > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.chap-name { flex: 1 1 200px; min-width: 0; font-weight: 800; }
.chap-counts { display: inline-flex; flex-wrap: wrap; gap: 4px 0; }
.chap-bar { flex: 1 1 100%; display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--bg-muted); }
.chap-bar i { display: block; height: 100%; }
.chap-bar .m { background: var(--ok); }
.chap-bar .s { background: var(--diagram-shaky); }
.chap-bar .w { background: var(--bad); }
.chap-bar .u { background: var(--unk); opacity: .45; }
.chap-names { margin: 6px 0; overflow-wrap: anywhere; }
#out-of-scope { margin-top: 4px; }
#log { overflow-x: auto; max-width: 100%; }
.iq-line { margin: 8px 0 0; overflow-wrap: anywhere; }
.iq-line a { color: var(--brand-strong); font-weight: 700; }
body.share-open { overflow: hidden; }
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.share-panel {
  width: min(440px, 100%);
  max-height: 100%;
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.share-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 0; }
.share-bar h2 { margin: 0; font-size: 1.15rem; }
.share-hint { margin: 8px 12px 0; text-align: center; font-weight: 800; color: var(--brand-strong); }
.share-scroll { overflow: auto; padding: 10px 12px 12px; min-height: 0; flex: 1 1 auto; }
.share-scroll img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: #f3f7fb;
  -webkit-touch-callout: default;
}
.share-actions { padding: 0 12px 12px; }
.share-actions .btn { width: 100%; }
@media (min-width: 701px) {
  .share-modal { align-items: center; padding: 24px; }
  .share-panel { border-radius: 16px; max-height: calc(100% - 48px); }
  #share-hint { display: none !important; }
}
@media (max-width: 700px) {
  .share-actions { display: none; }
}
table.log { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 0.95rem; }
table.log th, table.log td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
table.log select { min-height: 44px; }
.path-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.path-tools button.on { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.graph-fold {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 8px;
  padding: 8px 12px;
  background: var(--warn-bg);
  color: var(--text);
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
}
.graph-fold button { white-space: normal; max-width: 100%; }
.path-graph { position: relative; max-width: 100%; }
#path-cy {
  height: 440px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-muted);
}
.legend { display: flex; gap: 8px 14px; flex-wrap: wrap; font-size: 0.92rem; margin: 8px 0; padding: 0; list-style: none; align-items: center; font-weight: 700; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 2px solid transparent; display: inline-block; }
.sw-p { background: var(--node-primary-bg); border-color: var(--node-primary); }
.sw-j { background: var(--node-junior-bg); border-color: var(--node-junior); }
.sw-h { background: var(--node-senior-bg); border-color: var(--node-senior); }
.sw-root { background: var(--diagram-bad-bg); border-color: var(--diagram-bad); }
.sw-target { background: var(--node-current-bg); border-color: var(--node-current-border); }
.line-hard, .line-soft, .line-skip { width: 22px; height: 0; border-radius: 0; border: none; border-top: 2px solid var(--edge); background: none; }
.line-soft { border-top-style: dashed; border-top-color: var(--edge-soft); }
.line-skip { border-top-style: dotted; border-top-color: var(--edge-soft); }

@media (max-width: 640px) {
  .card { padding: 14px 12px; }
  .q-title { font-size: 1.28rem; }
  #path-cy { height: 380px; }
}

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  main#root { max-width: none; padding: 0; }
  .card { break-inside: avoid-page; box-shadow: none; }
  details.topic { break-inside: avoid; }
  #path-cy { height: 520px; border: none; background: #fff; }
  a { color: inherit; text-decoration: none; }
  select { border: none; appearance: none; -webkit-appearance: none; }
}


/* 盲区再测卡片与操作网格 */
.blind-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}
.blind-card-header h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1.25rem;
}
.blind-hist-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.88rem;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--bg-muted);
  border: 1px solid var(--line);
  transition: all 0.18s ease;
}
.blind-hist-link:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}

.blind-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.blind-action-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  min-height: 136px;
}
.blind-action-tile:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 6px 16px rgba(15, 110, 98, 0.1);
}
.blind-action-tile.primary {
  background: linear-gradient(135deg, var(--brand-soft) 0%, var(--bg-elev) 100%);
  border-color: var(--brand);
}
.blind-action-tile.primary .tile-title {
  color: var(--brand-strong);
}

.tile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.tile-icon {
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
}
.tile-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  background: var(--bg-muted);
  color: var(--muted);
}
.tile-badge.primary {
  background: var(--brand);
  color: #ffffff;
}
.tile-badge.shaky {
  background: var(--diagram-shaky-bg);
  color: var(--diagram-shaky);
}

.tile-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tile-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 4px;
  flex: 1;
}
.tile-foot {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand);
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
.tile-arrow {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: transform 0.15s ease;
}
.blind-action-tile:hover .tile-arrow {
  transform: translateX(3px);
}

.blind-list { list-style: none; margin: 8px 0 0; padding: 0; }
.blind-item { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.blind-name { font-weight: 700; }
.blind-retest { font-weight: 700; white-space: nowrap; }
.report-link { text-align: right; font-size: .85rem; margin: -4px 0 10px; }
.btn-report-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand-strong);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-report-link:hover {
  color: var(--brand);
}

/* 题目纠错文本保存弹窗 */
.correction-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.correction-panel {
  width: min(520px, 100%);
  max-height: 90vh;
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border: 1px solid var(--line);
  padding: 16px 20px;
  gap: 10px;
}
.correction-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.btn-close-modal:hover {
  background: var(--line);
  color: var(--text);
}
.correction-q-summary {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.correction-q-prompt {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
  max-height: 80px;
  overflow-y: auto;
}
.correction-type-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.correction-type-group .type-btn {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.correction-type-group .type-btn:hover {
  border-color: var(--brand);
}
.correction-type-group .type-btn.active {
  background: var(--brand-light);
  border-color: var(--brand);
  color: var(--brand-strong);
  font-weight: 600;
}
.correction-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
.correction-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-light);
}
.correction-preview-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--bg);
}
.correction-preview-details summary {
  cursor: pointer;
  user-select: none;
}
.correction-preview-pre {
  margin: 8px 0 0;
  padding: 8px;
  background: var(--bg-elev);
  border-radius: 6px;
  font-size: 0.8rem;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.correction-status {
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--bg);
  font-weight: 600;
}
.correction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ==================== 诊断结果汇总卡片现代化排版 ==================== */
.summary-card {
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  background: var(--bg-elev);
}

.summary-top-bar {
  margin-bottom: 16px;
}
.summary-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.summary-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
}
.summary-status-badge svg {
  width: 15px;
  height: 15px;
}
@media (prefers-color-scheme: dark) {
  .summary-status-badge {
    background: rgba(22, 101, 52, 0.35);
    color: #86efac;
  }
}
.summary-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}
.summary-headline {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
  margin: 6px 0 0;
}

/* 统计卡片网格 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 18px 0;
}
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
    gap: 8px;
  }
}
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}
.stat-card-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
}
.stat-icon-mini {
  width: 15px;
  height: 15px;
  opacity: 0.85;
}
.stat-card .stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.stat-card b, .stat-card .stat-num {
  font-size: 1.85rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* 状态色区分 */
.stat-card.ask {
  background: #f0f9ff;
  border-color: #bae6fd;
}
.stat-card.ask b { color: #0284c7; }
.stat-card.bad {
  background: #fef2f2;
  border-color: #fecaca;
}
.stat-card.bad b { color: #dc2626; }
.stat-card.shaky {
  background: #fffbeb;
  border-color: #fde68a;
}
.stat-card.shaky b { color: #d97706; }
.stat-card.ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.stat-card.ok b { color: #16a34a; }
.stat-card.unk {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.stat-card.unk b { color: #64748b; }

@media (prefers-color-scheme: dark) {
  .stat-card.ask { background: rgba(2, 132, 199, 0.15); border-color: rgba(2, 132, 199, 0.3); }
  .stat-card.ask b { color: #38bdf8; }
  .stat-card.bad { background: rgba(220, 38, 38, 0.15); border-color: rgba(220, 38, 38, 0.3); }
  .stat-card.bad b { color: #f87171; }
  .stat-card.shaky { background: rgba(217, 119, 6, 0.15); border-color: rgba(217, 119, 6, 0.3); }
  .stat-card.shaky b { color: #fbbf24; }
  .stat-card.ok { background: rgba(22, 163, 74, 0.15); border-color: rgba(22, 163, 74, 0.3); }
  .stat-card.ok b { color: #4ade80; }
  .stat-card.unk { background: rgba(100, 116, 139, 0.15); border-color: rgba(100, 116, 139, 0.3); }
  .stat-card.unk b { color: #94a3b8; }
}

/* 提示卡片 */
.summary-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  margin: 14px 0;
  font-size: 0.92rem;
  line-height: 1.5;
}
.summary-notice .notice-body {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
}
.summary-notice .notice-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
.summary-notice.alert-limit {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}
.summary-notice.alert-short {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
}
.summary-notice.alert-warn {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
@media (prefers-color-scheme: dark) {
  .summary-notice.alert-limit { background: rgba(217, 119, 6, 0.15); border-color: rgba(217, 119, 6, 0.3); color: #fde68a; }
  .summary-notice.alert-short { background: rgba(2, 132, 199, 0.15); border-color: rgba(2, 132, 199, 0.3); color: #bae6fd; }
  .summary-notice.alert-warn { background: rgba(220, 38, 38, 0.15); border-color: rgba(220, 38, 38, 0.3); color: #fecaca; }
}

.btn-notice-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  background: var(--bg-elev);
  color: inherit;
  border: 1px solid currentColor;
  transition: all 0.15s ease;
}
.btn-notice-action:hover {
  background: currentColor;
  color: var(--bg-elev);
}
.btn-notice-action svg {
  width: 15px;
  height: 15px;
}

/* 底部元信息 */
.summary-meta-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0 14px;
  font-size: 0.85rem;
  color: var(--muted);
  border-bottom: 1px dashed var(--line);
  margin: 12px 0 18px;
}
.summary-meta-bar .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.summary-meta-bar .meta-item svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

/* 按钮组分层布局 */
.summary-actions-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.actions-row.primary-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 560px) {
  .actions-row.primary-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.btn-action-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  min-width: 0;
  box-sizing: border-box;
}
.btn-action-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
.btn-action-tile:hover .tile-arrow {
  transform: translateX(3px);
  opacity: 0.9;
}
.btn-action-tile .tile-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.btn-action-tile .tile-icon-box svg {
  width: 22px;
  height: 22px;
}
.btn-action-tile .action-text {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}
.btn-action-tile .action-title {
  font-size: 0.98rem;
  font-weight: 750;
  color: var(--text);
  line-height: 1.3;
}
.btn-action-tile .action-desc {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-action-tile .tile-arrow {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--muted);
  opacity: 0.45;
  transition: all 0.2s ease;
}

/* 主操作按钮统一高质感卡片风格 */
/* 1. AI 助教：高级紫 */
.btn-action-tile.action-ai {
  background: var(--bg-elev);
  border-color: #e0e7ff;
}
.btn-action-tile.action-ai .tile-icon-box {
  background: #eef2ff;
  color: #4f46e5;
}
.btn-action-tile.action-ai:hover {
  border-color: #818cf8;
  background: #f5f3ff;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.12);
}
.btn-action-tile.action-ai:hover .tile-icon-box {
  background: #4f46e5;
  color: #ffffff;
}

/* 2. 7天补漏：活力绿 */
.btn-action-tile.action-finals {
  background: var(--bg-elev);
  border-color: #ccfbf1;
}
.btn-action-tile.action-finals .tile-icon-box {
  background: #f0fdf4;
  color: #059669;
}
.btn-action-tile.action-finals:hover {
  border-color: #34d399;
  background: #f0fdf4;
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.12);
}
.btn-action-tile.action-finals:hover .tile-icon-box {
  background: #059669;
  color: #ffffff;
}

/* 3. 错题本：珊瑚粉红 */
.btn-action-tile.action-wrongbook {
  background: var(--bg-elev);
  border-color: #ffe4e6;
}
.btn-action-tile.action-wrongbook .tile-icon-box {
  background: #fff1f2;
  color: #e11d48;
}
.btn-action-tile.action-wrongbook:hover {
  border-color: #fb7185;
  background: #fff1f2;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.12);
}
.btn-action-tile.action-wrongbook:hover .tile-icon-box {
  background: #e11d48;
  color: #ffffff;
}

/* 4. 分享图：天蓝 */
.btn-action-tile.action-share {
  background: var(--bg-elev);
  border-color: #e0f2fe;
}
.btn-action-tile.action-share .tile-icon-box {
  background: #f0f9ff;
  color: #0284c7;
}
.btn-action-tile.action-share:hover {
  border-color: #38bdf8;
  background: #f0f9ff;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.12);
}
.btn-action-tile.action-share:hover .tile-icon-box {
  background: #0284c7;
  color: #ffffff;
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .btn-action-tile.action-ai {
    background: rgba(79, 70, 229, 0.06);
    border-color: rgba(99, 102, 241, 0.25);
  }
  .btn-action-tile.action-ai .tile-icon-box {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
  }
  .btn-action-tile.action-ai:hover {
    border-color: #818cf8;
    background: rgba(79, 70, 229, 0.15);
  }
  .btn-action-tile.action-ai:hover .tile-icon-box {
    background: #6366f1;
    color: #ffffff;
  }

  .btn-action-tile.action-finals {
    background: rgba(5, 150, 105, 0.06);
    border-color: rgba(16, 185, 129, 0.25);
  }
  .btn-action-tile.action-finals .tile-icon-box {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
  }
  .btn-action-tile.action-finals:hover {
    border-color: #34d399;
    background: rgba(5, 150, 105, 0.15);
  }
  .btn-action-tile.action-finals:hover .tile-icon-box {
    background: #10b981;
    color: #ffffff;
  }

  .btn-action-tile.action-wrongbook {
    background: rgba(225, 29, 72, 0.06);
    border-color: rgba(244, 63, 94, 0.25);
  }
  .btn-action-tile.action-wrongbook .tile-icon-box {
    background: rgba(244, 63, 94, 0.2);
    color: #fda4af;
  }
  .btn-action-tile.action-wrongbook:hover {
    border-color: #fb7185;
    background: rgba(225, 29, 72, 0.15);
  }
  .btn-action-tile.action-wrongbook:hover .tile-icon-box {
    background: #f43f5e;
    color: #ffffff;
  }

  .btn-action-tile.action-share {
    background: rgba(2, 132, 199, 0.06);
    border-color: rgba(14, 165, 233, 0.25);
  }
  .btn-action-tile.action-share .tile-icon-box {
    background: rgba(14, 165, 233, 0.2);
    color: #7dd3fc;
  }
  .btn-action-tile.action-share:hover {
    border-color: #38bdf8;
    background: rgba(2, 132, 199, 0.15);
  }
  .btn-action-tile.action-share:hover .tile-icon-box {
    background: #0ea5e9;
    color: #ffffff;
  }
}

/* 次要工具栏按钮 */
.actions-row.secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding-top: 6px;
}
.btn-action-sub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
  transition: all 0.15s ease;
}
.btn-action-sub:hover {
  color: var(--text);
  border-color: var(--brand);
  background: var(--bg-elev);
}
.btn-action-sub svg {
  width: 15px;
  height: 15px;
}
