:root {
  --ink: #152039;
  --muted: #788296;
  --soft: #9aa4b4;
  --line: #e7eaf0;
  --accent: #3454dc;
  --accent-dark: #2742b4;
  --paper: #ffffff;
  --page: #f7f8fa;
  --red: #ce574f;
  --green: #2c927b;
  --shadow: 0 24px 64px rgba(22, 32, 55, 0.055);
  --radius: 20px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft Yahei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(52, 84, 220, 0.25);
  outline-offset: 3px;
}
.shell { max-width: 1200px; padding: 0 32px; margin: 0 auto; }
.topbar {
  height: 79px;
  background: rgba(247, 248, 250, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(219, 224, 233, 0.72);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .shell { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 200px; }
.brand-icon {
  height: 34px; width: 34px; display: grid; place-items: center;
  background: #162440; border-radius: 10px; color: white;
}
.brand-name { font-size: 20px; letter-spacing: 0.07em; font-weight: 730; }
.brand-divider { width: 1px; height: 19px; background: #d9dee8; }
.brand-sub { font-size: 11px; color: #8b94a6; font-weight: 560; letter-spacing: 0.08em; }
.head-actions { display: flex; align-items: center; gap: 12px; }
.head-login, .head-quiet {
  font-size: 13px; font-weight: 600; border: 0; background: none; color: #44516a; padding: 12px 8px;
}
.head-login:hover, .head-quiet:hover { color: var(--accent); }
.who { font-size: 13px; color: #626e82; }
.page { padding: 42px 0 80px; }
.hero { position: relative; padding: 64px 0 72px; }
.hero .shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 64px;
  align-items: center;
}
.overline {
  display: flex; align-items: center; gap: 11px;
  font-size: 11px; letter-spacing: 0.16em; font-weight: 750; color: var(--accent);
}
.overline i { display: block; width: 20px; height: 1px; background: var(--accent); }
.hero h1 {
  font-weight: 740; font-size: clamp(36px, 4vw, 52px);
  letter-spacing: -0.056em; line-height: 1.35; margin: 28px 0 0;
}
.mark {
  position: relative; white-space: nowrap;
}
.mark:after {
  content: ""; position: absolute; bottom: -4px; left: 0; right: 0;
  background: #8ea3f6; opacity: 0.65; height: 9px; z-index: -1; transform: skewX(-15deg);
}
.carousel { position: relative; margin-top: 56px; }
.carousel-frame {
  height: 340px; border-radius: 16px; border: 1px solid #e5e9f1; background: #fff;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 16px 40px rgba(26, 40, 80, 0.08);
}
.carousel-frame img { max-width: 100%; max-height: 100%; object-fit: contain; }
.carousel-nav {
  position: absolute; top: 154px; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: #fff; color: #2742b4; box-shadow: 0 4px 14px rgba(22, 32, 55, 0.12); font-size: 20px; line-height: 1;
}
.carousel-nav.prev { left: 10px; }
.carousel-nav.next { right: 10px; }
.carousel-dots { display: flex; justify-content: center; gap: 7px; margin-top: 12px; }
.carousel-dots button {
  width: 7px; height: 7px; border: 0; border-radius: 50%; background: #d3dae5; padding: 0;
}
.carousel-dots button.on { background: var(--accent); }
.capabilities {
  min-height: calc(100vh - 79px);
  background: #fff;
  border-top: 1px solid #e7eaf0;
  padding: 88px 0 72px;
}
.section-kicker { font-size: 11px; letter-spacing: 0.13em; font-weight: 750; color: var(--accent); }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 42px; }
.section-header h2 { font-size: 34px; letter-spacing: -0.05em; line-height: 1.4; margin: 12px 0 0; font-weight: 720; }
.section-header p { font-size: 13px; line-height: 1.9; max-width: 360px; color: #8994a6; margin: 0 0 5px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { border: 1px solid #e7eaf0; background: #fff; border-radius: 14px; padding: 27px 26px 24px; min-height: 180px; }
.feature-num { font-size: 10px; letter-spacing: 0.14em; color: #a4aec2; font-weight: 740; }
.feature h3 { margin: 22px 0 8px; font-size: 17px; font-weight: 720; letter-spacing: -0.02em; }
.feature p { font-size: 12px; line-height: 1.9; color: #8993a4; margin: 0; }
.upload-card, .panel {
  background: white;
  border-radius: 23px;
  border: 1px solid #e5e9f1;
  box-shadow: 0 27px 74px rgba(26, 40, 80, 0.1), 0 2px 9px rgba(40, 52, 77, 0.025);
  padding: 29px;
  position: relative;
}
.upload-card::before {
  content: ""; position: absolute; top: -12px; right: 28px;
  width: 82px; height: 3px; background: #97aaff; border-radius: 3px;
}
.upload-title { font-size: 19px; font-weight: 730; letter-spacing: -0.02em; }
.upload-subtitle { font-size: 12px; color: #9aa3b2; margin-top: 7px; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.micro-label {
  background: #f5f7ff; color: #5870d1; font-size: 10px; letter-spacing: 0.06em;
  font-weight: 750; padding: 7px 10px; border-radius: 6px; white-space: nowrap;
}
.steps { display: flex; align-items: center; margin: 0 0 18px; gap: 8px; }
.step-node { display: flex; align-items: center; gap: 7px; color: #a3acbc; font-size: 11px; white-space: nowrap; }
.step-node b {
  width: 20px; height: 20px; border: 1px solid #d7dce6; border-radius: 50%;
  font-size: 10px; display: grid; place-items: center; font-weight: 720;
}
.step-node.on { color: var(--accent); font-weight: 680; }
.step-node.on b { color: white; background: var(--accent); border-color: var(--accent); }
.step-sep { flex: 1; height: 1px; background: #e7eaf1; min-width: 10px; }
.field-label { font-size: 12px; font-weight: 710; display: block; margin: 0 0 9px; color: #57647c; }
.field, input[type="text"], input[type="password"], input[type="number"], textarea {
  width: 100%;
  border: 1px solid #dfe4ed;
  border-radius: 9px;
  background: #fff;
  color: #25344c;
}
input[type="text"], input[type="password"], input[type="number"] { height: 46px; padding: 0 13px; }
textarea { min-height: 120px; padding: 12px 13px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus {
  outline: none;
  border-color: #8196ec;
  box-shadow: 0 0 0 3px #eff2ff;
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.primary-btn, .btn {
  width: 100%; height: 48px; display: flex; justify-content: center; align-items: center; gap: 10px;
  background: var(--accent); color: white; border: 1px solid var(--accent); border-radius: 10px;
  font-size: 13px; font-weight: 720; box-shadow: 0 6px 14px rgba(52, 84, 220, 0.13);
}
.primary-btn:hover:not(:disabled), .btn:hover:not(:disabled) { background: var(--accent-dark); }
.btn.secondary, .outlined-btn {
  width: auto; height: auto; background: white; color: #3b4a66; border: 1px solid #dce2ee;
  border-radius: 8px; padding: 9px 14px; font-size: 12px; font-weight: 640; box-shadow: none;
}
.btn.secondary:hover, .outlined-btn:hover { border-color: #96a7ed; color: var(--accent); background: white; }
.btn:disabled, .primary-btn:disabled { opacity: 0.48; cursor: not-allowed; box-shadow: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row .btn, .row .primary-btn { width: auto; padding: 0 18px; }
.note, .hint { color: var(--soft); font-size: 12px; line-height: 1.7; margin: 8px 0 0; }
.req { color: var(--red); }
.banner {
  border-radius: 11px; padding: 12px 14px; margin: 0 0 14px;
  background: #fff7ed; color: #9a3412; font-size: 13px; line-height: 1.6;
}
.banner.ok { background: #ebf7f3; color: #166534; }
.banner.pending { background: #f5f7ff; color: #2742b4; }
.banner.error { background: #fff1f0; color: var(--red); }
.dropzone {
  min-height: 180px; position: relative; border: 1.5px dashed #cbd3e2; border-radius: 13px;
  background: linear-gradient(180deg, #fafbff, #fdfdff);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 18px; cursor: pointer;
}
.dropzone:hover { background: #f5f7ff; border-color: #5776e8; }
.drop-main { font-size: 14px; font-weight: 690; margin: 0 0 6px; }
.drop-desc { font-size: 12px; color: #9aa4b5; margin: 0; }
.dropzone input[type="file"] { display: none; }
.stem-img, .answer-img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); margin-top: 12px; }
.upload-card #local-preview {
  display: block;
  max-width: min(100%, 420px);
  max-height: 240px;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #f8f9fc;
}
#stem-local, #ref-local, #ref-figure-local { width: 72px; height: 72px; max-width: 72px; object-fit: cover; margin: 0; border-radius: 8px; display: block; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.label-row .field-label { margin: 0; }
.stem-picked {
  display: flex; align-items: center; gap: 12px; margin-top: 12px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff;
}
.stem-picked[hidden], .dropzone[hidden], .retry-recognize[hidden], #btn-recognize[hidden] { display: none !important; }
.stem-thumb { border: 0; padding: 0; background: none; border-radius: 8px; flex-shrink: 0; }
.stem-picked-meta { flex: 1; min-width: 0; }
.stem-picked-name { font-size: 13px; font-weight: 650; color: #2e405f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stem-picked-hint { font-size: 12px; color: #9aa3b2; margin-top: 4px; }
.stem-lightbox {
  position: fixed; inset: 0; z-index: 40; background: rgba(12, 22, 43, 0.72);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.stem-lightbox[hidden] { display: none; }
.stem-lightbox img { max-width: min(920px, 100%); max-height: calc(100vh - 48px); object-fit: contain; border-radius: 8px; background: #fff; }
.source-img-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.source-img-actions .btn { width: auto; padding: 0 16px; font-size: 13px; }
.math {
  font-size: 15px;
  line-height: 1.8;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.math .katex-display { margin: 0.6em 0; overflow-x: auto; }
.math-fold-body.is-folded {
  max-height: calc(var(--fold-lines, 6) * 1.8em);
  overflow: hidden;
  position: relative;
}
.math-fold-body.is-folded::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.2em;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 85%);
  pointer-events: none;
}
.math-fold-toggle {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  font-weight: 650;
  color: var(--accent);
  cursor: pointer;
}
.math-fold-toggle:hover { text-decoration: underline; }
.math-fold-toggle[hidden] { display: none !important; }
.stem-readout {
  margin-top: 12px;
  padding: 14px 16px;
  background: #f8f9fc;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.readout-block { margin-top: 8px; }
.readout-actions { margin-top: 4px !important; }
.edit-block { margin-top: 8px; }
.edit-block textarea { min-height: 0; max-height: none; overflow: visible; }
.figure-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.figure-preview-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}
.figure-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.figure-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: rgba(21, 32, 57, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.figure-preview-remove:hover { background: rgba(206, 87, 79, 0.92); }
.r-title.math { font-weight: inherit; }
.r-title.math .katex { font-size: 1em; }
.view-top { display: flex; gap: 20px; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.crumbs { font-size: 12px; color: #9ca5b5; display: flex; align-items: center; gap: 9px; }
.crumbs a:hover { color: var(--accent); }
.view-title { font-size: 29px; font-weight: 750; letter-spacing: -0.05em; margin: 8px 0 4px; }
.view-sub { font-size: 12px; color: #95a0b1; line-height: 1.8; }
.workflow {
  display: grid; grid-template-columns: 1fr 48px 1fr 48px 1fr; gap: 8px; align-items: start;
  margin: 8px 0 28px;
}
.workflow-item { text-align: center; }
.workflow-icon {
  width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 10px;
  background: #f4f6fa; border: 1px solid #e8ecf4; border-radius: 16px; color: #536388; font-weight: 740;
}
.workflow-item h3 { font-size: 14px; margin: 0 0 6px; }
.workflow-item p { font-size: 11px; line-height: 1.7; color: #9aa3b2; margin: 0; }
.workflow-line { height: 1px; border-top: 1px dashed #d4dbea; margin-top: 26px; }
.record-list { display: flex; flex-direction: column; gap: 10px; }
.record {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: #fff; padding: 19px 21px; border-radius: 12px; border: 1px solid var(--line); text-align: left;
}
.record:hover { border-color: #bdcafa; }
.record-main { flex: 1; min-width: 0; }
.record-side { display: flex; align-items: center; gap: 22px; flex-shrink: 0; margin-left: 8px; }
.record-grades-btn { white-space: nowrap; }
.r-title { font-weight: 710; color: #2e405f; font-size: 14px; }
.r-detail { font-size: 11px; color: #9ca7b6; margin-top: 5px; }
.r-score { white-space: nowrap; flex-shrink: 0; text-align: right; }
.r-quota { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 72px; }
.r-quota-label { font-size: 10px; font-weight: 650; color: #9ca7b6; letter-spacing: 0.02em; }
.r-quota-num { font-size: 20px; font-weight: 750; color: var(--accent); line-height: 1.1; }
.r-quota-only { font-size: 13px; font-weight: 710; color: #9ca7b6; }
.records-empty {
  border: 1px dashed #d7deeb; padding: 56px 20px; text-align: center; border-radius: 15px;
  color: #98a3b6; background: #fff;
}
.records-empty strong { display: block; font-size: 15px; color: #65748c; margin: 0 0 8px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: #3b4c69; }
.check input { width: auto; }
.result-grid { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 18px; }
.result-panel {
  border: 1px solid var(--line); background: white; border-radius: 15px; padding: 23px; min-width: 0; margin-bottom: 16px;
}
.score-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding-bottom: 18px; border-bottom: 1px solid #edf0f4; margin-bottom: 8px;
}
.score-kicker { font-size: 10px; font-weight: 800; letter-spacing: 0.13em; color: #8b97aa; }
.score-value { margin-top: 8px; display: flex; align-items: baseline; gap: 7px; }
.score-value strong { font-size: 42px; line-height: 1; font-weight: 740; letter-spacing: -0.07em; }
.score-value span { color: #9aa4b4; font-size: 16px; }
.score-result { font-size: 11px; background: #ebf7f3; color: #268569; padding: 7px 10px; border-radius: 6px; font-weight: 730; }
.grading-item {
  display: grid; grid-template-columns: 27px 1fr auto; column-gap: 12px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid #eef0f4;
}
.grading-index {
  width: 25px; height: 25px; display: grid; place-items: center; border-radius: 6px;
  font-size: 11px; background: #eff7f4; color: #269378; font-weight: 760;
}
.grading-index.warn { background: #fff0ed; color: #d05e52; }
.grading-title { font-size: 13px; font-weight: 740; margin: 1px 0 6px; }
.grading-sub { font-size: 11px; line-height: 1.8; color: #95a0af; }
.grading-score { font-size: 12px; color: #5c6980; font-weight: 730; padding-top: 3px; white-space: nowrap; }
.grading-score b { color: var(--red); }
.takeaway {
  display: flex; gap: 10px; background: #f5f7ff; border: 1px solid #e8edff;
  border-radius: 10px; margin-top: 16px; padding: 14px; font-size: 12px; line-height: 1.7; color: #46557d;
}
/* 答卷留痕：对齐 bydetc math_answer_share（mas-mark-*） */
.mark-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin-top: 12px;
  line-height: 0;
}
.mark-stage .answer-img {
  margin-top: 0;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
.mark-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.mark-box {
  position: absolute;
  box-sizing: border-box;
  border-radius: 2px;
  pointer-events: none;
}
.mark-box.is-score {
  border: 2px solid #0f766e;
  background: rgba(15, 118, 110, 0.12);
}
.mark-box.is-loss {
  border: 1.5px solid rgba(194, 65, 12, 0.34);
  background: rgba(194, 65, 12, 0.05);
  pointer-events: auto;
  cursor: pointer;
}
.mark-box.is-loss::after {
  content: "点击";
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(194, 65, 12, 0.42);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
  pointer-events: none;
}
.mark-box.is-loss[aria-expanded="true"]::after {
  display: none;
}
.mark-tag {
  position: absolute;
  z-index: 2;
  max-width: 140px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  pointer-events: none;
  white-space: nowrap;
}
.mark-tag.is-score {
  color: #0f766e;
  border: 1px solid #0f766e;
}
.mark-tag.is-loss {
  color: #c2410c;
  border: 1px solid #c2410c;
  max-width: min(220px, 58%);
  white-space: pre-wrap;
  pointer-events: auto;
  cursor: pointer;
}
.mark-misses {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  max-width: min(220px, 62%);
  pointer-events: auto;
}
.mark-misses[hidden] { display: none !important; }
.mark-misses-toggle {
  display: block;
  margin: 0;
  padding: 4px 8px;
  border: 1px solid rgba(194, 65, 12, 0.45);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.55);
  color: #c2410c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}
.mark-misses-body {
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid rgba(226, 232, 240, 0.72);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: #c2410c;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.mark-miss + .mark-miss { margin-top: 4px; }
details { margin-top: 12px; font-size: 13px; color: #5c6980; }
.footer { border-top: 1px solid #e9edf3; padding: 22px 0 28px; }
.footer .shell { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: #a0a9b8; }
.footer strong { font-size: 13px; color: #65738a; letter-spacing: 0.05em; }
.loading-layer {
  display: none; position: fixed; inset: 0; background: rgba(247, 248, 251, 0.93);
  z-index: 40; align-items: center; justify-content: center;
}
.loading-layer.active { display: flex; }
.loading-panel {
  text-align: center; background: white; padding: 42px 36px; border: 1px solid #e6eaf2;
  border-radius: 20px; box-shadow: var(--shadow); width: min(390px, calc(100% - 32px));
}
.loading-panel h3 { font-size: 17px; margin: 0 0 7px; }
.loading-panel p { font-size: 12px; color: #9ba5b5; line-height: 1.8; margin: 0; }
@media (max-width: 860px) {
  .shell { padding: 0 20px; }
  .topbar { height: 65px; }
  .brand-sub, .brand-divider { display: none; }
  .hero { padding: 36px 0 48px; }
  .hero .shell, .workflow, .result-grid, .feature-grid, .section-header { display: block; }
  .capabilities { min-height: 0; padding: 56px 0; }
  .feature { margin-bottom: 12px; }
  .workflow-line { display: none; }
  .workflow-item { margin-bottom: 16px; }
  .upload-card { margin-top: 28px; }
  .view-title { font-size: 24px; }
  .mark { white-space: normal; }
}
