/* ————— 苏格拉底学园 · 设计系统 ————— */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --ink: #1d1b24;
  --muted: #6e6960;
  --line: #e4e1d8;
  --accent: #4a3fd6;
  --accent-ink: #ffffff;
  --accent-soft: #eceafb;
  --gold: #b45309;
  --gold-soft: #fdf1e0;
  --green: #15803d;
  --green-soft: #e5f4ea;
  --red: #dc2626;
  --red-soft: #fdeaea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 27, 36, .05), 0 8px 24px -12px rgba(29, 27, 36, .12);
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.65 var(--sans);
  letter-spacing: .01em;
}
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: 0; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ————— 按钮 ————— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; border: 1px solid transparent;
  padding: 9px 18px; font-weight: 600; font-size: 14px;
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn-primary:hover { background: #3d33b8; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-gold { background: var(--gold-soft); color: var(--gold); }
.btn-lg { padding: 13px 28px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ————— 顶栏 ————— */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 245, 241, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 18px; height: 60px; }
.logo { display: flex; align-items: center; gap: 9px; font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--ink); }
.logo .mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, #4a3fd6, #7a6cf0);
  display: grid; place-items: center; color: #fff; font-size: 15px; font-family: var(--serif);
}
.topbar nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar nav a.navlink { color: var(--muted); padding: 7px 10px; border-radius: 8px; font-size: 14px; }
.topbar nav a.navlink:hover { color: var(--ink); background: var(--surface-2); }
.topbar nav a.navlink.active { color: var(--accent); background: var(--accent-soft); }
.credit-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px 5px 8px; font-size: 13px; font-weight: 600; color: var(--ink);
}
.credit-pill .n { color: var(--accent); font-size: 14px; }
.credit-pill:hover { border-color: var(--accent); }
.avatar-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; font-size: 14px;
}

/* ————— 落地页 ————— */
.hero { padding: 72px 0 56px; text-align: center; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; color: var(--muted); margin-bottom: 22px;
}
.hero .eyebrow b { color: var(--accent); }
.hero h1 { font-size: clamp(30px, 5.2vw, 48px); line-height: 1.25; margin: 0 0 16px; }
.hero h1 em { font-style: normal; color: var(--accent); position: relative; }
.hero p.sub { color: var(--muted); font-size: 17px; max-width: 560px; margin: 0 auto 30px; }
.hero .ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .fineprint { margin-top: 14px; font-size: 13px; color: var(--muted); }

.demo-card {
  max-width: 640px; margin: 40px auto 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  padding: 22px 24px; text-align: left;
}
.demo-card .who { font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.bubble { border-radius: 14px; padding: 10px 14px; max-width: 88%; font-size: 14.5px; }
.bubble.tutor { background: var(--surface-2); border: 1px solid var(--line); margin: 10px 0 0 auto; }
.bubble.student { background: var(--accent-soft); color: #2d2560; margin: 12px 0 0 6px; }
.skillbar { display: flex; gap: 4px; margin-top: 10px; }
.skillbar span { flex: 1; height: 7px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); }
.skillbar span.on { background: var(--accent); border-color: var(--accent); }

.section { padding: 64px 0; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: 28px; margin: 0 0 8px; }
.section-head p { color: var(--muted); margin: 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step-card, .feature-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.step-card .num {
  width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; margin-bottom: 12px;
}
.step-card h3, .feature-card h3 { margin: 0 0 6px; font-size: 17px; }
.step-card p, .feature-card p { margin: 0; color: var(--muted); font-size: 14px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card .ico { font-size: 22px; margin-bottom: 10px; }

/* ————— 定价 ————— */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.price-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 26px 24px; box-shadow: var(--shadow); position: relative; display: flex; flex-direction: column;
}
.price-card.hot { border: 2px solid var(--accent); }
.price-card .badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  padding: 3px 12px; border-radius: 999px;
}
.price-card h3 { margin: 2px 0 2px; font-size: 18px; }
.price-card .price { font-family: var(--serif); font-size: 34px; font-weight: 700; margin: 6px 0; }
.price-card .price small { font-size: 14px; color: var(--muted); font-family: var(--sans); font-weight: 400; }
.price-card ul { list-style: none; padding: 0; margin: 8px 0 18px; color: var(--muted); font-size: 14px; flex: 1; }
.price-card ul li { padding: 3px 0; }
.price-card ul li::before { content: "✓ "; color: var(--green); font-weight: 700; }
.trial-banner {
  text-align: center; background: var(--green-soft); color: var(--green);
  border-radius: 12px; padding: 12px 16px; font-size: 14px; font-weight: 600; margin: 0 0 18px;
}

.faq { max-width: 680px; margin: 0 auto; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { color: var(--muted); margin: 8px 0 0; font-size: 14px; }

footer.site { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 13px; }
footer.site .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ————— 应用布局 ————— */
.app-main { padding: 28px 0 80px; }
.app-title { display: flex; align-items: baseline; gap: 12px; margin: 0 0 20px; flex-wrap: wrap; }
.app-title h2 { margin: 0; font-size: 24px; }
.app-title .spacer { flex: 1; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.panel h3 { margin: 0 0 12px; font-size: 16px; }

.empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
  border: 1.5px dashed var(--line); border-radius: 16px; background: var(--surface);
}
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* 主题卡片 */
.topic-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s ease; position: relative; color: inherit;
}
.topic-card:hover { border-color: var(--accent); }
.topic-card .row1 { display: flex; align-items: flex-start; gap: 10px; }
.topic-card h3 { margin: 0; font-size: 17px; flex: 1; line-height: 1.4; }
.topic-card .pct { font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--accent); }
.progress { height: 8px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 5px; background: var(--accent); transition: width .4s ease; }
.progress.gold i { background: var(--gold); }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2.5px 10px;
  background: var(--surface-2); color: var(--muted); border: 1px solid transparent;
}
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.gold { background: var(--gold-soft); color: var(--gold); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.plain { background: transparent; border-color: var(--line); }

/* ————— 学习页（地图 + 对话）————— */
.study-grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .study-grid { grid-template-columns: 1fr; } }
.map-panel { position: sticky; top: 76px; }
.skill-item { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.skill-item:last-child { border-bottom: 0; }
.skill-item .name { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; gap: 8px; }
.skill-item .name .lv { color: var(--muted); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.skill-item.focus .name b { color: var(--accent); }
.skill-item .lvname { font-size: 12px; color: var(--muted); margin-top: 1px; }
.map-overall { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.ring {
  --p: 0%; width: 64px; height: 64px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--accent) var(--p), var(--surface-2) 0);
  display: grid; place-items: center;
}
.ring::before { content: ""; width: 50px; height: 50px; border-radius: 50%; background: var(--surface); }
.ring b { position: relative; margin-left: 0; font-family: var(--serif); font-size: 16px; }
.ring b, .ring::before { grid-area: 1 / 1; }

.chat-panel { display: flex; flex-direction: column; min-height: 560px; max-height: 74vh; }
.chat-log { flex: 1; overflow-y: auto; padding: 6px 4px; display: flex; flex-direction: column; gap: 4px; }
.chat-msg { max-width: 86%; border-radius: 14px; padding: 10px 14px; font-size: 14.5px; }
.chat-msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-msg .who { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 3px; letter-spacing: .04em; }
.chat-msg.user .who { color: rgba(255,255,255,.75); }
.chat-msg.milestone { align-self: stretch; max-width: 100%; text-align: center; background: var(--gold-soft); border: 1px solid #f3ddb8; color: var(--gold); font-weight: 600; border-radius: 12px; }
.chat-msg.milestone .bar-viz { font-family: var(--mono); font-size: 12.5px; text-align: left; margin-top: 6px; white-space: pre; overflow-x: auto; }
.chat-msg.map-card { align-self: stretch; max-width: 100%; background: var(--surface); border: 1px solid var(--line); }
.chat-msg.sys { align-self: center; background: transparent; border: 1px dashed var(--line); color: var(--muted); font-size: 13px; }
.chat-msg .md p { margin: 0 0 6px; } .chat-msg .md p:last-child { margin: 0; }
.chat-msg .md code { font-family: var(--mono); font-size: 13px; background: rgba(0,0,0,.06); border-radius: 4px; padding: 1px 5px; }
.chat-msg.user .md code { background: rgba(255,255,255,.2); }
.chat-msg .md strong { font-weight: 700; }

.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

.chat-input-area { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
.chat-input-row { display: flex; gap: 10px; }
.chat-input-row textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; min-height: 46px; max-height: 140px; background: var(--surface); outline: none;
}
.chat-input-row textarea:focus { border-color: var(--accent); }
.chat-hint { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cmd-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.cmd-chip { font-size: 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 10px; color: var(--muted); }
.cmd-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ————— 表单 ————— */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--ink); }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: var(--surface); outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--accent); color: #fff; }

/* ————— 弹层 / 提示 ————— */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(29, 27, 36, .45); z-index: 100;
  display: grid; place-items: center; padding: 20px; animation: fade .15s ease;
}
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); max-width: 460px; width: 100%; padding: 26px; animation: pop .18s ease; }
.modal h3 { margin: 0 0 6px; font-size: 20px; }
.modal .sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }

#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 18px; font-size: 14px;
  box-shadow: var(--shadow); animation: pop .18s ease; max-width: 90vw;
}
.toast.err { background: var(--red); }

/* ————— 表格 / 后台 ————— */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .v { font-family: var(--serif); font-size: 26px; font-weight: 700; margin-top: 2px; }
.stat .v small { font-size: 13px; color: var(--muted); font-family: var(--sans); font-weight: 400; }
.funnel-row { display: grid; grid-template-columns: 120px 1fr 70px; align-items: center; gap: 10px; margin-bottom: 7px; font-size: 13.5px; }
.funnel-row .bar { height: 18px; border-radius: 5px; background: linear-gradient(90deg, var(--accent), #7a6cf0); min-width: 2px; }
.funnel-row .lbl { color: var(--muted); }
.chart { display: flex; align-items: flex-end; gap: 5px; height: 120px; padding: 10px 0 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; align-items: center; height: 100%; }
.chart .col i { width: 100%; border-radius: 3px 3px 0 0; background: var(--accent); min-height: 1px; }
.chart .col i.rev { background: var(--gold); }
.chart .col span { font-size: 9.5px; color: var(--muted); transform: rotate(-45deg); white-space: nowrap; margin-top: 4px; }
.legend { font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin: 0 3px 0 8px; }

/* ————— 响应式 ————— */
@media (max-width: 860px) {
  .steps, .features, .pricing-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 40px; }
  .map-panel { position: static; }
  .topbar-inner { height: 54px; gap: 10px; }
  .hide-sm { display: none !important; }
}
@media (max-width: 480px) {
  .chat-msg { max-width: 94%; }
  .wrap, .wrap-narrow { padding: 0 14px; }
  .topbar-inner { gap: 8px; height: 52px; }
  .logo { font-size: 15px; white-space: nowrap; }
  .logo .mark { width: 26px; height: 26px; font-size: 13px; }
  .topbar nav { gap: 4px; }
  .topbar nav a.navlink { padding: 6px 7px; font-size: 13px; white-space: nowrap; }
  .credit-pill { padding: 4px 9px 4px 7px; font-size: 12px; }
  .credit-pill .n { font-size: 13px; }
  .app-title h2 { font-size: 20px; }
  .admin-two { grid-template-columns: 1fr !important; }
}
