/* 嘉豪智慧课堂 · 平面图 3D 建模（对齐 bs.zunzhe88.cn 亮黄主题） */
:root {
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --line: #E4E8EE;
  --line-strong: #D7DDE5;
  --text: #1F2937;
  --ink: #14181F;
  --muted: #6B7280;
  --gold: #FFD400;
  --gold-hover: #FFDF52;
  --gold-deep: #C9A500;
  --gold-dark: #A88500;
  --gold-ink: #4F3F00;
  --gold-50: #FFFBEB;
  --gold-100: #FFF4C7;
  --red: #E5484D;
  --green: #25C06A;
  --blue: #3B7DE0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 1px rgba(15, 23, 42, .03);
  --shadow-float: 0 12px 32px -12px rgba(15, 23, 42, .18);
  --font: Inter, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 520px at 8% -12%, rgba(255, 212, 0, .16), transparent 62%),
    radial-gradient(700px 460px at 100% 0%, rgba(201, 165, 0, .06), transparent 55%);
  pointer-events: none;
  z-index: -1;
}
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; }
a { color: var(--gold-dark); text-decoration: none; }
[hidden] { display: none !important; }

/* ---------------- 顶部栏（与背诵测评一致） ---------------- */
.topbar {
  position: sticky;
  top: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 3vw, 40px);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; color: #FFD400;
}
.brand-mark svg { display: block; width: 32px; height: 32px; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: .5px; color: var(--ink); line-height: 1.15; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .5px; }
.topbar-ctx { flex: 1; display: flex; align-items: center; justify-content: center; gap: 14px; min-width: 0; padding: 0 24px; }
.ctx-search { position: relative; width: min(360px, 34vw); }
.ctx-search .ctx-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--muted); pointer-events: none;
}
.ctx-search input {
  width: 100%;
  height: 36px;
  padding: 0 14px 0 34px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #F7F8FA;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border .16s ease, box-shadow .16s ease, background .16s ease;
}
.ctx-search input:focus { border-color: var(--gold-deep); background: #fff; box-shadow: 0 0 0 3px rgba(255, 212, 0, .16); }
.ctx-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #FFFDF3;
  color: var(--gold-ink);
  font-size: 12.5px;
  white-space: nowrap;
}
.ctx-pill svg { width: 15px; height: 15px; color: var(--gold-deep); }
.ctx-pill b { font-weight: 600; }
.ctx-pill.on { border-color: var(--gold); background: var(--gold-50); }
.topbar-class { font-size: 13px; color: var(--gold-dark); font-weight: 600; letter-spacing: .5px; white-space: nowrap; }
.topbar-right { display: flex; gap: 8px; }

/* ---------------- 通用按钮 ---------------- */
.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13px;
  transition: all .16s ease;
}
.ghost-btn:hover { background: var(--gold-50); border-color: var(--gold); color: var(--ink); }
.ghost-btn:disabled { opacity: .45; cursor: not-allowed; }
.ghost-btn.wide { width: 100%; justify-content: center; margin-top: 10px; padding: 10px 14px; }
.ghost-btn.icon-btn svg { width: 15px; height: 15px; }
.ghost-btn.on { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 600; }
.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 24px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .3px;
  box-shadow: 0 2px 6px rgba(201, 165, 0, .18);
  transition: background .16s ease, transform .16s ease;
}
.primary-btn svg { width: 16px; height: 16px; }
.primary-btn:hover { background: var(--gold-hover); transform: translateY(-1px); }
.primary-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.primary-btn.wide { width: 100%; margin-top: 12px; }

/* ---------------- 布局 ---------------- */
.main {
  flex: 1;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-columns: 378px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head h2 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0; letter-spacing: .3px; }
.step {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--gold); color: var(--ink);
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.step.alt { background: var(--gold-50); color: var(--gold-dark); border: 1px solid var(--gold-100); }
.card-hint { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ---------------- 上传 ---------------- */
.drop {
  border: 1.5px dashed var(--line-strong);
  background: #FFFDF6;
  border-radius: 10px;
  min-height: 168px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: border-color .16s ease, background .16s ease;
}
.drop:hover, .drop.over { border-color: var(--gold); background: var(--gold-50); }
.drop-in { text-align: center; padding: 20px 14px; color: var(--muted); }
.drop-in b { display: block; font-size: 13.5px; margin: 10px 0 4px; color: var(--ink); font-weight: 600; }
.drop-in span { font-size: 11.5px; color: var(--muted); }
.drop-ico {
  width: 44px; height: 44px; margin: 0 auto;
  border-radius: 50%; background: var(--gold-100); color: var(--gold-dark);
  display: inline-flex; align-items: center; justify-content: center;
}
.drop-ico svg { width: 22px; height: 22px; }
.drop img { width: 100%; max-height: 270px; object-fit: contain; display: block; background: #fff; }

.progress { margin-top: 11px; height: 6px; border-radius: 6px; background: #F0F1F4; overflow: hidden; }
.progress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #FFD400, #FFC400);
  transition: width .25s;
}
.hint { font-size: 12px; color: var(--muted); line-height: 1.75; margin-top: 9px; }
.hint b { color: var(--gold-ink); }

/* ---------------- 比例尺 ---------------- */
.scale-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 10px; }
.scale-row label { font-size: 13px; color: #46505E; display: flex; align-items: center; gap: 6px; }
.eq { color: var(--muted); }
input[type="number"], select {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13.5px;
  color: var(--text);
  background: #F9FAFB;
  outline: none;
  width: 82px;
  transition: border .16s ease, box-shadow .16s ease, background .16s ease;
}
select { width: auto; min-width: 132px; padding-right: 6px; }
input[type="number"]:focus, select:focus {
  border-color: var(--gold-deep);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 212, 0, .16);
}

/* ---------------- 校对 ---------------- */
.review { display: flex; flex-direction: column; gap: 7px; max-height: 330px; overflow: auto; }
.rev {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  transition: border .16s ease, background .16s ease;
}
.rev:hover { border-color: var(--gold); background: var(--gold-50); }
.rev .no {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--gold-100); color: var(--gold-ink);
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.rev input {
  width: 86px; border: 1px solid var(--line-strong); border-radius: 6px;
  padding: 4px 6px; font-size: 13px; color: var(--text); outline: none; background: #fff;
}
.rev input:focus { border-color: var(--gold-deep); box-shadow: 0 0 0 2px rgba(255, 212, 0, .16); }
.rev .bar { flex: 1; height: 5px; border-radius: 4px; background: #EEF0F3; overflow: hidden; min-width: 26px; }
.rev .bar i { display: block; height: 100%; width: 0; background: var(--green); }
.rev .pct { font-size: 11px; color: var(--muted); width: 34px; text-align: right; flex: 0 0 auto; }
.rev .tag {
  font-size: 10px; color: var(--gold-ink); background: var(--gold-50);
  border: 1px solid var(--gold-100); border-radius: 4px; padding: 1px 4px;
  flex: 0 0 auto;
}
.rev .tag.ai { background: var(--gold); border-color: var(--gold); font-weight: 700; }
.rev.low .bar i { background: var(--gold); }
.rev.none .bar i { background: var(--red); }

/* ---------------- 历史 ---------------- */
.hist { display: flex; flex-direction: column; gap: 7px; max-height: 250px; overflow: auto; }
.hi {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  transition: border .16s ease, background .16s ease;
}
.hi:hover { border-color: var(--gold); background: var(--gold-50); }
.hi .t { flex: 1; min-width: 0; }
.hi .t b { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.hi .t span { font-size: 11px; color: var(--muted); }
.hi .go { font-size: 11.5px; color: var(--gold-dark); font-weight: 600; }

/* ---------------- 3D 舞台 ---------------- */
.stage { padding: 0; display: flex; flex-direction: column; overflow: hidden; min-height: 680px; height: calc(100vh - 64px - 18px * 2 - 44px); }
.stage-top {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.stage-title { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.stage-title b { font-size: 14.5px; color: var(--ink); font-weight: 700; letter-spacing: .3px; }
.stage-title span { font-size: 11px; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chip {
  font-size: 11.5px; color: var(--gold-ink);
  background: var(--gold-50);
  border: 1px solid var(--gold-100);
  border-radius: 20px;
  padding: 5px 10px;
  white-space: nowrap;
}
.tools { display: flex; gap: 6px; flex-wrap: wrap; }
.warn {
  padding: 9px 16px; font-size: 12.5px; line-height: 1.7;
  background: #FFF8E6; color: #8A6A00;
  border-bottom: 1px solid #FFE9A8;
}
.ai-notes {
  padding: 8px 16px; font-size: 12px; line-height: 1.8;
  background: #FFFDF3; color: #6B5A10;
  border-bottom: 1px solid var(--gold-100);
}
.ai-notes b { color: var(--gold-dark); }
.canvas-wrap {
  flex: 1; position: relative;
  background: linear-gradient(180deg, #FCFDFF 0%, #F4F6F9 100%);
  min-height: 440px;
}
.canvas-wrap canvas { display: block; width: 100%; height: 100%; }
.empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; color: #9AA3AF; pointer-events: none;
}
.empty-ico { color: #D7DDE5; }
.empty-ico svg { width: 64px; height: 64px; }
.empty b { font-size: 15.5px; color: #6B7280; font-weight: 600; }
.empty span { font-size: 12.5px; }
.loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(255, 253, 246, .88);
  color: #6B5A10; font-size: 13px;
  backdrop-filter: blur(1px); z-index: 5;
}
.loading i {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--gold-100); border-top-color: var(--gold-deep);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.stage-tip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 16px; font-size: 11.5px; color: #9AA3AF;
  border-top: 1px solid var(--line);
  background: #fff;
}

/* ---------------- 页脚 ---------------- */
.foot {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; font-size: 12px; color: var(--muted);
}
.foot a { color: var(--muted); }
.foot a:hover { color: var(--gold-dark); }
.foot i { font-style: normal; color: #C9CFD8; }
.foot .copy { margin-left: 10px; color: #A6AEBA; }

/* ---------------- 登录（对齐 bs.zunzhe88.cn） ---------------- */
.login-view { min-height: 100vh; display: flex; flex-direction: column; }
.login-topbar { position: static; background: transparent; backdrop-filter: none; border-bottom: none; }
.login-main {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(30px, 6vh, 74px) clamp(18px, 4vw, 60px) 60px;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: clamp(30px, 5vw, 84px);
}
.login-badge {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: var(--gold-50);
  color: var(--gold-ink);
  font-size: 12px;
  letter-spacing: 1px;
}
.login-left h1 {
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.14;
  margin: 18px 0 20px;
  letter-spacing: -.5px;
  font-weight: 700;
  color: var(--ink);
}
.login-features { display: flex; gap: 32px; margin: 26px 0 0; flex-wrap: wrap; }
.feature b { display: block; font-size: 26px; color: var(--ink); font-weight: 700; }
.feature b::after { content: ""; display: block; width: 22px; height: 3px; background: var(--gold); margin-top: 6px; border-radius: 2px; }
.feature span { font-size: 12px; color: var(--muted); }
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(26px, 3vw, 40px);
  box-shadow: var(--shadow-float);
}
.login-card h2 { margin: 0 0 22px; font-size: 24px; letter-spacing: .2px; color: var(--ink); }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; letter-spacing: .3px; }
.field select, .field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #F9FAFB;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border .16s ease, box-shadow .16s ease, background .16s ease;
}
.field select:focus, .field input:focus {
  border-color: var(--gold-deep);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 212, 0, .16);
}
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin: 4px 0 20px; }
.check input { accent-color: var(--gold-deep); }
.login-error { color: var(--red); font-size: 13px; min-height: 18px; margin: 10px 0 0; }
.app-view { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------------- 提示 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: rgba(20, 24, 31, .93); color: #fff;
  padding: 10px 16px; border-radius: 8px; font-size: 13px;
  max-width: 80vw; z-index: 99; box-shadow: var(--shadow-float);
  line-height: 1.6;
}

@media (max-width: 1180px) {
  .main { grid-template-columns: 1fr; }
  .stage { height: 68vh; min-height: 480px; }
  .topbar-ctx { padding: 0 10px; }
  .ctx-pill { display: none; }
}
@media (max-width: 900px) {
  .login-main { grid-template-columns: 1fr; padding: 24px 20px 40px; }
  .login-left { text-align: center; }
  .login-features { justify-content: center; gap: 24px; }
  .login-left h1 { margin: 14px 0 10px; }
  .ctx-search { display: none; }
  .topbar-class { font-size: 12px; }
}
@media (max-width: 720px) {
  .brand-name { font-size: 17px; }
  .brand-sub { font-size: 10px; }
  .topbar-right a:last-child { display: none; }
}
