:root {
  --paper: #f3effa;
  --card: #ffffff;
  --ink: #2b2a66;
  --ink-2: #575280;
  --ink-3: #8f8ab2;
  --line: #e4def2;
  --line-strong: #ccc5e6;
  --accent: #6f55b8;
  --accent-deep: #57449e;
  --accent-soft: #f8efe8;
  --green: #3f7a6a;
  --green-soft: #eaf5f0;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(43, 42, 80, .04), 0 8px 24px -12px rgba(43, 42, 80, .12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: #e9e1f6;
  background-image: linear-gradient(155deg, #faf8fd 0%, #ece4f8 38%, #d9cbf1 68%, #c5b2e8 100%);
  background-attachment: fixed;
  padding-bottom: 48px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(243, 239, 250, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.mark.mark-img {
  background: #fff url('/dada-logo.png') no-repeat;
  background-size: 150% auto;
  background-position: 50% 12%;
  box-shadow: 0 4px 12px -4px rgba(70, 75, 125, .45);
}
.brand { display: flex; align-items: center; gap: 11px; }
.mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #8a6fd1, #57449e);
  color: #fff;
  font-family: Georgia, "Songti SC", serif;
  font-size: 21px;
  letter-spacing: .5px;
  box-shadow: 0 4px 12px -4px rgba(87, 68, 158, .5);
}
.brand-text h1 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: .4px;
}
.brand-text p {
  margin: 1px 0 0;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: .3px;
}
.icon-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: .18s;
}
.icon-btn:active { transform: scale(.94); }

/* ---------- 引擎提示 ---------- */
.engine-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 16px 0;
  padding: 9px 13px;
  border-radius: 11px;
  background: var(--accent-soft);
  border: 1px solid #e0d8f4;
  font-size: 12.5px;
  color: #5a4a9a;
}
.engine-bar .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #9b82dd;
  flex: none;
}
.engine-bar.ready { background: var(--green-soft); border-color: #d5e8e0; color: #3a6a5c; }
.engine-bar.ready .dot { background: #5c8a76; }
.engine-bar button {
  margin-left: auto;
  border: none; background: none; padding: 0;
  color: inherit; font-size: 12.5px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; flex: none;
}

/* ---------- 布局 ---------- */
main {
  max-width: 700px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel-title {
  display: flex; align-items: baseline; gap: 9px;
  margin: 0 0 14px;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: .5px;
}
.panel-title .idx {
  font-family: Georgia, serif;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 1px;
}
.panel-desc {
  margin: -6px 0 14px;
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- 分段控件 ---------- */
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #eae4f6;
  border-radius: 11px;
  margin-bottom: 18px;
}
.segmented button {
  flex: 1;
  border: none;
  background: none;
  padding: 9px 4px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-3);
  cursor: pointer;
  font-family: inherit;
  transition: .2s;
}
.segmented button.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(43, 42, 80, .1);
}

/* ---------- 字段 ---------- */
.field { margin-bottom: 16px; }
.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
  letter-spacing: .3px;
}
.field-label .opt { font-weight: 400; color: var(--ink-3); font-size: 11.5px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips button {
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-2);
  padding: 6.5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: .16s;
}
.chips button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.text-input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fbfaff;
  outline: none;
  transition: .18s;
  appearance: none;
}
.text-input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(111, 85, 184, .1);
}
.text-input::placeholder { color: #a9a3c4; }

/* ---------- 上传区 ---------- */
.dropzone {
  position: relative;
  display: block;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: #fbfaff;
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: .2s;
  margin-bottom: 16px;
  min-height: 168px;
  overflow: hidden;
}
.dropzone:active { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.has-image { padding: 0; border-style: solid; border-color: var(--line); }
.dz-empty { color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dz-empty svg { color: #bcb4d8; margin-bottom: 2px; }
.dz-empty strong { color: var(--ink-2); font-size: 14px; font-weight: 600; }
.dz-empty span { font-size: 11.5px; line-height: 1.5; }
#preview { width: 100%; max-height: 46vh; object-fit: contain; display: block; background: #f0ebf8; }
.dz-reset {
  position: absolute;
  right: 10px; bottom: 10px;
  border: none;
  background: rgba(43, 42, 80, .72);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 12px;
  padding: 6px 13px;
  border-radius: 999px;
  font-family: inherit;
  cursor: pointer;
}

/* ---------- 按钮 ---------- */
.primary-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: .5px;
  color: #fff;
  background: linear-gradient(140deg, #8a6fd1, #57449e);
  cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(87, 68, 158, .7);
  transition: .18s;
}
.primary-btn:active { transform: scale(.985); }
.err-box {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 11px;
  background: #f8ecf4;
  border: 1px solid #ecc8da;
  color: #a24068;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
}
.primary-btn:disabled {
  background: #ded9ec;
  color: #a5a0c0;
  box-shadow: none;
  cursor: not-allowed;
}
.ghost-btn {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-2);
  border-radius: 12px;
  padding: 13px;
  font-size: 14px;
  font-weight: 550;
  font-family: inherit;
  cursor: pointer;
  margin-top: 9px;
  transition: .16s;
}
.ghost-btn:active { background: #efebf8; }

/* ---------- 加载 ---------- */
.loading-panel { text-align: center; padding: 40px 20px; }
.pencil-loader { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; }
.pencil-loader span {
  width: 6px; height: 30px;
  border-radius: 3px;
  background: var(--accent);
  opacity: .28;
  animation: bounce 1.15s infinite ease-in-out;
}
.pencil-loader span:nth-child(2) { animation-delay: .16s; height: 40px; margin-top: -5px; }
.pencil-loader span:nth-child(3) { animation-delay: .32s; }
@keyframes bounce {
  0%, 100% { transform: scaleY(.55); opacity: .22; }
  50% { transform: scaleY(1); opacity: .95; }
}
.loading-title { font-size: 16px; font-weight: 650; margin: 0 0 6px; }
.loading-step { font-size: 13.5px; color: var(--accent); margin: 0 0 14px; min-height: 22px; }
.loading-hint { font-size: 11.5px; color: var(--ink-3); margin: 0; }

/* ---------- 成绩单 ---------- */
.score-card { padding: 22px 18px 18px; }
.score-top { display: flex; align-items: center; gap: 8px; }
.score-ring { position: relative; width: 120px; height: 120px; flex: none; }
.score-num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 1px;
  font-family: Georgia, "Songti SC", serif;
}
.score-num span { font-size: 40px; font-weight: 600; letter-spacing: -1px; color: var(--ink); line-height: 1; }
.score-num small { font-size: 11px; color: var(--ink-3); align-self: flex-end; margin-bottom: 6px; }
.score-meta { flex: 1; min-width: 0; padding-left: 6px; }
.badge {
  display: inline-block;
  padding: 3.5px 11px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: .5px;
  border: 1px solid #ded2f4;
}
.score-sub { margin: 7px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.score-rubric { margin: 4px 0 0; font-size: 11.5px; color: var(--ink-3); }
.summary {
  margin: 16px 0 0;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink);
}

/* ---------- 维度 ---------- */
.dims { display: flex; flex-direction: column; gap: 15px; }
.dim-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.dim-name { font-size: 13.5px; font-weight: 600; }
.dim-level {
  font-size: 11px;
  padding: 1.5px 7px;
  border-radius: 5px;
  background: #efebf8;
  color: var(--ink-3);
}
.dim-level.good { background: var(--green-soft); color: var(--green); }
.dim-level.bad { background: #f5e8f2; color: #a8456e; }
.dim-score {
  margin-left: auto;
  font-family: Georgia, serif;
  font-size: 14px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.dim-score i { font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.dim-track {
  height: 5px;
  background: #f0ece5;
  border-radius: 3px;
  overflow: hidden;
}
.dim-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #9b82dd, var(--accent-deep));
  transition: width .9s cubic-bezier(.22, .9, .25, 1);
}
.dim-fill.weak { background: linear-gradient(90deg, #a68fe0, #7a63c4); }
.dim-comment { margin: 7px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.65; }

/* ---------- 致命问题 ---------- */
.fatal-item {
  position: relative;
  padding: 0 0 0 42px;
  margin-bottom: 20px;
}
.fatal-item:last-child { margin-bottom: 0; }
.fatal-rank {
  position: absolute;
  left: 0; top: 1px;
  width: 27px; height: 27px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: #ece4fa;
  color: var(--accent-deep);
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 600;
}
.fatal-title {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .2px;
}
.fatal-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.fatal-locate {
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  background: #f0eafa;
  border: 1px solid rgba(111, 85, 184, .22);
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fatal-locate:active { transform: scale(.97); }
.fatal-where {
  display: inline-block;
  font-size: 11.5px;
  color: var(--ink-3);
  background: #efebf8;
  padding: 2px 8px;
  border-radius: 5px;
}
.fatal-why, .fatal-fix {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
}
.fatal-fix {
  color: var(--ink);
  padding: 9px 12px;
  background: #f6f2fc;
  border-left: 2.5px solid var(--accent);
  border-radius: 0 7px 7px 0;
}
.fatal-fix b { color: var(--accent-deep); font-weight: 650; }

.strength-box {
  margin-top: 18px;
  padding: 14px;
  background: var(--green-soft);
  border-radius: 11px;
}
.strength-title {
  font-size: 12px;
  font-weight: 650;
  color: var(--green);
  letter-spacing: .5px;
  margin-bottom: 7px;
}
.strength-box ul { margin: 0; padding-left: 17px; }
.strength-box li { font-size: 12.5px; color: #3c6a5c; line-height: 1.65; margin-bottom: 3px; }

/* ---------- 修改目标 ---------- */
.steps { position: relative; padding-left: 26px; }
.steps::before {
  content: '';
  position: absolute;
  left: 8px; top: 8px; bottom: 14px;
  width: 1.5px;
  background: linear-gradient(var(--line-strong), #e9e3f4);
}
.step {
  position: relative;
  margin-bottom: 20px;
}
.step:last-child { margin-bottom: 0; }
.step::before {
  content: '';
  position: absolute;
  left: -22px; top: 5px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--accent);
}
.step-title {
  font-size: 13.5px;
  font-weight: 650;
  margin: 0 0 6px;
}
.step-title em {
  font-style: normal;
  color: var(--accent);
  font-family: Georgia, serif;
  margin-right: 6px;
}
.step-line { margin: 0 0 4px; font-size: 12.5px; line-height: 1.65; color: var(--ink-2); }
.step-line b { color: var(--ink); font-weight: 600; }
.step-check {
  font-size: 12px;
  color: var(--green);
  background: var(--green-soft);
  padding: 5px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 4px;
}

/* ---------- 训练课题 ---------- */
.drills { display: grid; grid-template-columns: 1fr; gap: 10px; }
.drill {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 14px;
  background: #fbfaff;
}
.drill-top { display: flex; align-items: baseline; gap: 8px; }
.drill-title { font-size: 13.5px; font-weight: 650; }
.drill-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  padding: 1.5px 8px;
  border-radius: 999px;
  flex: none;
}
.drill-focus { font-size: 11.5px; color: var(--ink-3); margin: 3px 0 6px; }
.drill-desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.65; margin: 0; }

.next-bar {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 11px;
  background: var(--ink);
  color: #f3efe8;
}
.next-bar span {
  font-size: 11px;
  letter-spacing: 1px;
  opacity: .62;
}
.next-bar p { margin: 5px 0 0; font-size: 14px; line-height: 1.6; font-weight: 550; }

/* ---------- 操作 ---------- */
.action-row { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.action-row .ghost-btn { margin-top: 0; }
.footnote {
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
  margin: 6px 0 20px;
}

/* ---------- 抽屉 ---------- */
.drawer-mask {
  position: fixed; inset: 0;
  background: rgba(43, 42, 80, .34);
  backdrop-filter: blur(3px);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.drawer {
  width: 100%;
  max-width: 520px;
  background: var(--paper);
  border-radius: 20px 20px 0 0;
  padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
  animation: slideUp .26s cubic-bezier(.22, .9, .25, 1);
  max-height: 88vh;
  overflow-y: auto;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.drawer-head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.drawer-tip {
  font-size: 12px;
  color: var(--ink-3);
  margin: 0 0 18px;
  line-height: 1.6;
  padding: 9px 11px;
  background: #efebf8;
  border-radius: 8px;
}
.hint { font-size: 11.5px; color: var(--ink-3); margin: 6px 0 0; line-height: 1.5; }
.hint.center { text-align: center; margin-top: 10px; }
.hint.ok { color: var(--green); }
.hint.err { color: #ad4273; }

/* ---------- 媒材判断 ---------- */
.media-strip {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.media-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.media-label { font-size: 11px; letter-spacing: 1.2px; color: var(--ink-3); }
.media-tag {
  font-size: 12.5px;
  font-weight: 650;
  padding: 2.5px 10px;
  border-radius: 6px;
  background: #e9e3f4;
  color: var(--ink);
  letter-spacing: .3px;
}
.media-conf { font-size: 11.5px; color: var(--ink-3); }
.media-conf.low { color: #ad4273; }
.media-fix {
  margin-left: auto;
  border: none;
  background: none;
  padding: 0;
  font-size: 11.5px;
  font-family: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.media-evidence {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.68;
  color: var(--ink-2);
}
.media-picker { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 7px; }
.media-picker button {
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-2);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: .16s;
}
.media-picker button:hover { border-color: var(--accent); color: var(--accent-deep); }
.media-picker button.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.chips.flash button { animation: chipFlash 1.2s ease-in-out 2; }
@keyframes chipFlash {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 3px rgba(111, 85, 184, .2); }
}

/* ---------- 入场动画 ---------- */
.fade-up { animation: fadeUp .45s cubic-bezier(.22, .9, .25, 1) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 560px) {
  .drills { grid-template-columns: repeat(3, 1fr); }
  .action-row { flex-direction: row; }
  .action-row .primary-btn, .action-row .ghost-btn { flex: 1; }
  .step-line { font-size: 13px; }
}

/* ============ 账号与顶栏 ============ */
.user-box { display: flex; align-items: center; gap: 6px; }
.quota-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid #d5e8e0;
  white-space: nowrap;
}
.quota-chip.warn { background: #f5e8f2; color: #a8456e; border-color: #ecd4e2; }

/* ============ 评分标准条 ============ */
.target-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 11px;
  background: #f0ebf8;
  border: 1px solid #e0d9f2;
  margin-bottom: 16px;
}
.target-label { font-size: 10.5px; letter-spacing: 1.2px; color: var(--ink-3); margin-bottom: 2px; }
.target-name { font-size: 13.5px; font-weight: 650; letter-spacing: .2px; }
.target-switch {
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  flex: none;
}

/* ============ 参考照片上传 ============ */
.ref-row { margin-bottom: 16px; }
.ref-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  cursor: pointer;
  background: #fbfaff;
}
.ref-icon {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: #eae4f6;
  color: var(--ink-2);
  font-size: 15px;
  flex: none;
}
.ref-text b { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.ref-text .opt { font-weight: 400; color: var(--ink-3); font-size: 11px; }
.ref-text i { display: block; font-size: 11px; color: var(--ink-3); font-style: normal; margin-top: 1px; }
.ref-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
}
.ref-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 7px; }
.ref-preview button {
  margin-left: auto;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-2);
  font-size: 11.5px;
  font-family: inherit;
  padding: 5px 11px;
  border-radius: 7px;
  cursor: pointer;
}

/* ============ 标注图层 ============ */
.annotator {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #efebf8;
  line-height: 0;
  touch-action: manipulation;
}
.annotator img { display: block; width: 100%; height: auto; }
#annoSvg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
#annoDots { position: absolute; inset: 0; }
.anno-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #6f55b8;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(43, 42, 80, .35);
  font-size: 11.5px;
  font-family: Georgia, serif;
  font-weight: 600;
  display: grid;
  place-items: center;
  cursor: pointer;
  line-height: 1;
  transition: transform .16s;
}
.anno-dot:active { transform: translate(-50%, -50%) scale(1.18); }
.anno-dot.pulse { animation: dotPulse 1.6s ease-out 2; }
@keyframes dotPulse {
  0% { box-shadow: 0 2px 8px rgba(43, 42, 80, .35), 0 0 0 0 rgba(111, 85, 184, .55); }
  70% { box-shadow: 0 2px 8px rgba(43, 42, 80, .35), 0 0 0 12px rgba(111, 85, 184, 0); }
  100% { box-shadow: 0 2px 8px rgba(43, 42, 80, .35), 0 0 0 0 rgba(111, 85, 184, 0); }
}
.anno-dot.mid { background: #8f78d4; }
.anno-dot.low { background: #8b87a8; }
.annotator.hide-marks #annoSvg,
.annotator.hide-marks #annoDots { display: none; }

.anno-legend { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.anno-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 9px 11px;
  border-radius: 9px;
  background: #faf8fe;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: .16s;
}
.anno-item.active { border-color: var(--accent); background: var(--accent-soft); }
.anno-num {
  width: 19px; height: 19px;
  border-radius: 50%;
  background: #6f55b8;
  color: #fff;
  font-size: 10.5px;
  font-family: Georgia, serif;
  display: grid; place-items: center;
  flex: none;
  margin-top: 1px;
}
.anno-num.mid { background: #8f78d4; }
.anno-num.low { background: #8b87a8; }
.anno-body { min-width: 0; }
.anno-title { font-size: 12.5px; font-weight: 650; }
.anno-note { font-size: 12px; color: var(--ink-2); line-height: 1.6; margin-top: 1px; }
.anno-tip { margin: 12px 0 0; font-size: 11px; color: var(--ink-3); line-height: 1.5; }
.mini-btn {
  margin-left: auto;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 400;
  letter-spacing: 0;
}

/* ============ 参考对照 ============ */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.pair figure { margin: 0; }
.pair img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: #efebf8;
  border-radius: 9px;
  display: block;
}
.pair figcaption { font-size: 11px; color: var(--ink-3); text-align: center; margin-top: 5px; }
.dev-list { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.dev-list li {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
  padding-left: 18px;
  position: relative;
}
.dev-list li::before {
  content: '';
  position: absolute;
  left: 4px; top: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}
.dev-list li.high::before { background: var(--accent); }
.dev-list b { color: var(--ink); font-weight: 650; }

/* ============ 历史记录 ============ */
.trend { display: flex; align-items: flex-end; gap: 3px; height: 52px; margin-bottom: 14px; }
.trend-bar {
  flex: 1;
  background: linear-gradient(180deg, #a88fe2, #6f55b8);
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  position: relative;
}
.trend-bar span {
  position: absolute;
  top: -15px; left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--ink-3);
  font-family: Georgia, serif;
}
.hist-list { display: flex; flex-direction: column; gap: 8px; }
.hist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfaff;
  cursor: pointer;
  transition: .16s;
}
.hist-item:active { background: #f0ebf8; }
.hist-score {
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--accent-deep);
  min-width: 30px;
}
.hist-meta { min-width: 0; flex: 1; }
.hist-name { font-size: 12.5px; font-weight: 600; }
.hist-sub { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.hist-empty { text-align: center; font-size: 12.5px; color: var(--ink-3); padding: 22px 0; }

/* ============ 后台：标签页与统计 ============ */
.tabs {
  position: sticky;
  top: 64px;
  z-index: 20;
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  background: rgba(243, 239, 250, .93);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-3);
  padding: 6px 14px;
  border-radius: 8px;
  white-space: nowrap;
  cursor: pointer;
  transition: .16s;
}
.tabs button.active { background: var(--ink); color: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  box-shadow: var(--shadow);
}
.stat-num { font-family: Georgia, serif; font-size: 23px; font-weight: 600; line-height: 1.1; }
.stat-num small { font-size: 11px; color: var(--ink-3); margin-left: 2px; font-family: inherit; font-weight: 400; }
.stat-label { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

/* ============ 后台：学生编辑与卡片 ============ */
.editor {
  background: #faf8fe;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.editor-head strong { font-size: 13.5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.grid2 .field { margin-bottom: 0; }

.student-list { display: flex; flex-direction: column; gap: 10px; }
.stu-card { border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; background: #fbfaff; }
.stu-card.disabled { opacity: .62; }
.stu-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.stu-name { font-size: 14px; font-weight: 650; }
.tag-off { font-size: 10px; color: #a8456e; background: #f5e8f2; padding: 1px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle; font-weight: 500; }
.stu-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.stu-quota { font-family: Georgia, serif; font-size: 17px; font-weight: 600; color: var(--green); white-space: nowrap; }
.stu-quota small { font-size: 11px; color: var(--ink-3); font-family: inherit; font-weight: 400; }
.stu-quota.warn { color: #a8456e; }
.stu-meta { display: flex; gap: 12px; font-size: 11.5px; color: var(--ink-3); margin-top: 8px; flex-wrap: wrap; }
.stu-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.stu-actions button {
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 7px;
  cursor: pointer;
}
.stu-actions button.danger { color: #a8456e; border-color: #ecd4e2; }
.stu-expire { font-size: 11.5px; color: var(--ink-3); margin-top: 7px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stu-expire b { font-weight: 600; color: var(--ink-2); }
.stu-expire .warn { color: #a8456e; font-weight: 600; }
.stu-expire .ok { color: var(--green); }
.wx-badge {
  display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 4px;
  background: #e6f2ec; color: #3d7a5e; margin-left: 6px; vertical-align: middle; font-weight: 500;
}
.wx-note { margin-top: 16px; padding: 12px 13px; background: #f4f0fb; border-radius: 10px; font-size: 12px; color: var(--ink-2); line-height: 1.75; }
.sub-title { margin: 18px 0 10px; font-size: 13.5px; font-weight: 650; color: var(--ink); }
.sub-title:first-of-type { margin-top: 6px; }
.contact-pill {
  position: fixed; right: 14px; bottom: 14px; z-index: 99;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(43, 42, 94, .85); color: #fff;
  font-size: 12px; letter-spacing: .3px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.contact-pill b { color: #d9ccff; }
.contact-pill.done { background: #2f7d4f; }
.ai-note { color: #c0392b; font-size: 12px; text-align: center; margin: 8px 0 0; }
.wx-note b { display: block; margin-bottom: 4px; font-size: 12px; }
.wx-note p { margin: 0 0 6px; }
.wx-note p:last-child { margin-bottom: 0; }

/* ============ 后台：记录弹层 ============ */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(43, 42, 80, .4);
  backdrop-filter: blur(3px);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
  animation: slideUp .26s cubic-bezier(.22, .9, .25, 1);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.modal-head strong { font-size: 14.5px; }
.modal-img { width: 100%; border-radius: 11px; margin-bottom: 12px; display: block; }
.modal-score { display: flex; align-items: baseline; gap: 8px; }
.modal-score span { font-family: Georgia, serif; font-size: 31px; font-weight: 600; }
.modal-score small { font-size: 12px; color: var(--ink-3); }
.modal-summary { font-size: 13px; line-height: 1.7; color: var(--ink-2); margin: 10px 0; }
.modal-dims { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 0; }
.modal-dim { display: flex; justify-content: space-between; font-size: 12px; padding: 6px 9px; background: #f0ebf8; border-radius: 7px; }
.modal-dim b { font-family: Georgia, serif; }
.modal-dim i { font-style: normal; color: var(--ink-3); font-size: 10.5px; }
.modal-fatal { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.modal-fatal-item { margin-bottom: 10px; font-size: 12.5px; line-height: 1.6; }
.modal-fatal-item p { margin: 4px 0 0; color: var(--ink-2); }

/* ============ 后台：标准库 ============ */
.std-card { border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; margin-bottom: 10px; background: #fbfaff; }
.std-head { display: flex; align-items: center; gap: 8px; }
.std-head strong { font-size: 13.5px; }
.std-tag { font-size: 10.5px; color: var(--ink-3); background: #eae4f6; padding: 1px 7px; border-radius: 4px; }
.std-orient { font-size: 12px; color: var(--accent-deep); margin-top: 4px; }
.std-dims { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.std-dims span { font-size: 11px; color: var(--ink-2); background: #efebf8; padding: 2px 8px; border-radius: 5px; }
.std-dims b { color: var(--ink); }
.std-focus { font-size: 12px; color: var(--ink-2); line-height: 1.65; margin: 9px 0 0; }

@media (min-width: 560px) {
  .stat-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 520px) {
  .grid2 { grid-template-columns: 1fr; }
}


/* ============ 身份标签 ============ */
.role-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 4px;
  background: #efeafc;
  color: #5a4a9a;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: .3px;
}
.role-badge.super { background: #2b2a66; color: #eae4ff; }
