/* ==========================================================================
   知招云工作台 · 统一视觉主题
   蓝色教育 SaaS 风格，覆盖基础样式的绿色/米色旧主题。
   ========================================================================== */

:root {
  --brand: #2f63f5;
  --brand-strong: #1d47d6;
  --brand-soft: #edf3ff;
  --brand-softer: #f6f9ff;
  --brand-line: #d8e4ff;
  --cyan: #16b8c8;
  --orange: #ff8a3d;
  --ink: #15213b;
  --ink-2: #30415f;
  --muted: #6f7f9b;
  --faint: #94a2b8;
  --bg: #f3f6fc;
  --surface: #ffffff;
  --line: #e5ebf5;
  --line-strong: #d6e0ef;
  --green: #2f63f5;
  --green-dark: #1d47d6;
  --pale: #edf3ff;
  --sidebar: #ffffff;
  --radius: 16px;
  --shadow-sm: 0 4px 14px rgba(24, 47, 94, .055);
  --shadow: 0 18px 46px rgba(24, 47, 94, .10);
  font-family: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

html { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #cfe0ff; color: #10214a; }

button { color: inherit; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(47, 99, 245, .28);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfd9ea; border: 3px solid transparent; background-clip: content-box; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #aebdd6; border: 3px solid transparent; background-clip: content-box; }

/* --------------------------------------------------------------------------
   登录
   -------------------------------------------------------------------------- */

.login-screen { background: #f4f7fd; grid-template-columns: 1.08fr 1fr; }

.login-story {
  background:
    radial-gradient(900px 520px at 12% 6%, rgba(72, 142, 255, .55), transparent 62%),
    radial-gradient(700px 500px at 92% 92%, rgba(22, 184, 200, .34), transparent 60%),
    linear-gradient(145deg, #0d2a6b 0%, #123c96 48%, #1e56d8 100%);
  border-right: 0;
  color: #fff;
  isolation: isolate;
}

.login-story::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .85), transparent 78%);
  pointer-events: none;
}

.login-story::after {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  right: -170px;
  bottom: -190px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 52px rgba(255, 255, 255, .045), 0 0 0 104px rgba(255, 255, 255, .03);
  pointer-events: none;
}

.login-brand { color: #fff; font-size: 26px; letter-spacing: 1.2px; position: relative; z-index: 1; }
.login-brand small { color: rgba(255, 255, 255, .52); letter-spacing: 4px; }
.login-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 12px 30px rgba(0, 0, 0, .18);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

.login-intro { position: relative; z-index: 1; margin: 54px 0 30px; max-width: 620px; }
.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 2.6px;
  color: rgba(255, 255, 255, .62);
}
.login-kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: rgba(255, 255, 255, .5);
}
.login-intro h1 {
  color: #fff;
  font-size: clamp(34px, 4.1vw, 58px);
  line-height: 1.32;
  font-weight: 650;
  letter-spacing: -1.8px;
  margin: 20px 0 20px;
}
.login-intro h1 em { color: #9fc4ff; font-style: normal; }
.login-intro p { color: rgba(255, 255, 255, .68); font-size: 14px; line-height: 2; }
.login-features { gap: 10px; margin-top: 32px; }
.login-features span {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .82);
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 11px;
  letter-spacing: .3px;
  backdrop-filter: blur(6px);
}
.login-story-note { color: rgba(255, 255, 255, .48); font-size: 11px; letter-spacing: .3px; position: relative; z-index: 1; }

.login-panel { background: #f6f9ff; padding: 40px; }
.login-card {
  width: min(410px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 42px 40px 34px;
  box-shadow: 0 30px 80px rgba(24, 47, 94, .12);
}
.login-card .eyebrow { color: var(--brand); letter-spacing: 2.8px; font-weight: 650; }
.login-card h2 { color: var(--ink); font-size: 30px; letter-spacing: -1px; margin: 14px 0 10px; }
.login-card > p { color: var(--muted); font-size: 13px; line-height: 1.8; margin-bottom: 26px; }
.entry-login-form label { color: var(--ink-2); font-size: 12px; font-weight: 600; margin-top: 18px; }
.entry-login-form input {
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #f9fbff;
  padding: 14px 15px;
  color: var(--ink);
  font-size: 14px;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.entry-login-form input:focus {
  background: #fff;
  border-color: #8bacff;
  outline: 0;
  box-shadow: 0 0 0 4px rgba(47, 99, 245, .11);
}
.entry-login-form input::placeholder { color: #a9b6ca; }
.entry-login-form .primary-button { margin-top: 24px; padding: 14px 16px; font-size: 14px; border-radius: 11px; }
.login-status { color: var(--muted); font-size: 12px; line-height: 1.8; }
.login-status.error { color: #d05757; }
.login-meta { border-top-color: var(--line); color: var(--faint); font-size: 11px; }
.login-retry { color: var(--brand); }
.login-panel a { color: var(--brand); }

/* --------------------------------------------------------------------------
   应用骨架 / 侧栏 / 顶栏
   -------------------------------------------------------------------------- */

.shell { background: var(--bg); }

.sidebar {
  width: 248px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 26px 16px 18px;
  box-shadow: 1px 0 0 rgba(24, 47, 94, .025);
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--cyan));
}

.brand {
  gap: 12px;
  padding: 0 8px;
  margin-bottom: 26px;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: .4px;
  color: var(--ink);
}
.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, #4a7dff 0%, #2457e8 58%, #183fbf 100%);
  box-shadow: 0 9px 20px rgba(36, 87, 232, .28), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.brand-en { color: var(--faint); letter-spacing: 2.6px; font-weight: 600; margin-top: 3px; }
.brand-text { line-height: 1.05; }

.new-chat {
  background: linear-gradient(135deg, #3a72ff, #1e4ed8);
  border: 0;
  border-radius: 12px;
  color: #fff;
  padding: 13px 14px;
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 10px 22px rgba(36, 87, 232, .24);
  transition: transform .18s, box-shadow .18s, filter .18s;
  margin-bottom: 24px;
}
.new-chat:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(36, 87, 232, .3); filter: saturate(1.06); }
.new-chat svg { width: 18px; height: 18px; }
.new-chat .key { color: rgba(255, 255, 255, .66); }

nav { gap: 5px; }
.nav-item {
  border-radius: 10px;
  padding: 11px 12px;
  color: #5d6d89;
  font-size: 13px;
  font-weight: 500;
  transition: background .16s, color .16s;
}
.nav-item svg { width: 18px; height: 18px; color: #7c8dab; }
.nav-item:hover { background: #f5f8ff; color: var(--brand-strong); }
.nav-item:hover svg { color: var(--brand); }
.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 650;
  box-shadow: inset 3px 0 0 var(--brand);
}
.nav-item.active svg { color: var(--brand); }
.tiny-dot { background: var(--brand); }
.nav-count { color: #98a6bc; font-size: 11px; }

.recent-label { color: #9aa8bd; font-size: 10px; letter-spacing: 1.1px; margin: 30px 12px 12px; font-weight: 600; }
.recent-item { border-radius: 9px; color: #5c6d8a; font-size: 12px; padding: 10px 11px; }
.recent-item svg { color: #9aabc4; }
.recent-item:hover { background: #f4f8ff; color: var(--brand-strong); }
.recent-empty { color: #9aa8bc; }

.sidebar-bottom { padding-top: 12px; }
.account-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  margin: 0 4px 14px;
  padding: 12px 6px;
}
.account-strip button { color: var(--brand); font-weight: 500; }
.account-strip button:hover { color: var(--brand-strong); }

.small-note {
  background: linear-gradient(135deg, #f1f6ff, #f8fbff);
  border: 1px solid #dbe6ff;
  border-radius: 12px;
  color: #6b7d9c;
  padding: 13px 12px;
  margin-bottom: 14px;
}
.small-note svg { color: var(--brand); }
.small-note strong { color: #2c4a86; font-size: 11.5px; font-weight: 650; }
.small-note p { color: #8293ae; font-size: 10px; }

.profile { border-top: 1px solid var(--line); padding-top: 16px; color: var(--ink-2); }
.avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #e6efff, #f3f7ff);
  border: 1px solid #d7e4ff;
  color: var(--brand-strong);
  font-weight: 650;
}
.profile small { color: #93a2b9; }
.profile > span:last-child { color: #a3b1c5; }
.profile:hover strong { color: var(--brand); }

.main-shell { margin-left: 248px; }

.topbar {
  height: 68px;
  padding: 0 32px;
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(24, 47, 94, .02);
}
.topbar-left { gap: 12px; }
.topbar-titles { display: flex; flex-direction: column; gap: 3px; }
.topbar-title { color: var(--ink); font-size: 14.5px; font-weight: 700; letter-spacing: -.1px; }
.topbar-subtitle { color: #93a1b7; font-size: 10.5px; }
.divider { background: #dbe3f0; height: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #5d7397;
  background: #f6f9ff;
  border: 1px solid #e3ebfa;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 10.5px;
  font-weight: 500;
}
.topbar-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(47, 99, 245, .12); }
.preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: #50617f;
  font-size: 11px;
  font-weight: 500;
  padding: 8px 11px;
  box-shadow: var(--shadow-sm);
  transition: border-color .16s, color .16s, background .16s;
}
.preview-badge:hover { border-color: #b9ccf6; color: var(--brand); background: #f9fbff; }
.preview-badge svg { width: 14px; height: 14px; color: var(--brand); }

/* --------------------------------------------------------------------------
   主内容 / 模式切换 / 目标栏
   -------------------------------------------------------------------------- */

#main-content { max-width: 1240px; padding: 0 34px; }
body[data-mode=paper] #main-content,
body[data-mode=book] #main-content,
body[data-mode=knowledge] #main-content { max-width: 1280px; padding-left: 34px; padding-right: 34px; }

.workspace-controls { max-width: 1240px; padding: 22px 34px 0; }
.mode-tabs { gap: 12px; }
.mode-tab {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px 14px;
  gap: 11px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s, border-color .18s, box-shadow .18s, background .18s;
}
.mode-tab:hover { transform: translateY(-2px); border-color: #bcd0fb; background: #fbfdff; }
.mode-tab-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f1f5fd;
  color: #788cad;
  transition: background .18s, color .18s;
}
.mode-tab-icon svg { width: 18px; height: 18px; }
.mode-tab strong { color: #253654; font-size: 13px; font-weight: 650; }
.mode-tab small { color: #93a1b7; font-size: 9.5px; margin-top: 5px; }
.tab-index { color: #c0cbdb; font-size: 9px; font-weight: 600; }
.mode-tab.selected {
  background: linear-gradient(145deg, #f2f6ff, #fbfdff);
  border-color: #a9c1fb;
  box-shadow: 0 12px 26px rgba(36, 87, 232, .10);
}
.mode-tab.selected::after {
  content: "";
  position: absolute;
  inset: auto 14px -1px 14px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, var(--brand), var(--cyan));
}
.mode-tab.selected .mode-tab-icon {
  background: linear-gradient(135deg, #4a7dff, #1e4ed8);
  color: #fff;
  box-shadow: 0 6px 14px rgba(36, 87, 232, .22);
}
.mode-tab.selected strong { color: var(--brand-strong); }

.target-bar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
  gap: 8px;
}
.target-label { color: #7c8eab; font-size: 10px; font-weight: 500; }
.target-label svg { color: var(--brand); }
.target-bar select {
  border: 1px solid var(--line-strong);
  background: #f8faff;
  border-radius: 8px;
  color: #405472;
  font-size: 10.5px;
  padding: 7px 24px 7px 9px;
}
.target-bar select:hover { border-color: #b8ccf5; }
.target-hint { color: #98a6bb; }
.workspace-disclaimer { color: #9aa8bc; }
.practice-preferences { color: #6f7f99; }
.segmented { background: #eef3fb; border-radius: 9px; padding: 3px; }
.segmented button { color: #7b8ba5; font-size: 10px; border-radius: 7px; padding: 7px 12px; }
.segmented button.active { color: var(--brand-strong); font-weight: 650; box-shadow: 0 2px 7px rgba(36, 87, 232, .12); }
.eyebrow { color: var(--brand); letter-spacing: 2.2px; font-weight: 650; }

.mode-workspace { padding: 24px 0 40px; }
.mode-demo { display: none !important; }
.mode-intro h1 { color: var(--ink); font-weight: 650; }
.mode-intro p { color: var(--muted); }

/* --------------------------------------------------------------------------
   首页
   -------------------------------------------------------------------------- */

.home { padding-top: 26px; }
.hero {
  position: relative;
  min-height: 300px;
  padding: 38px 42px;
  border: 1px solid #dce7fb;
  border-radius: 22px;
  background:
    radial-gradient(520px 300px at 88% 6%, rgba(47, 99, 245, .12), transparent 65%),
    radial-gradient(480px 300px at 100% 100%, rgba(22, 184, 200, .10), transparent 60%),
    linear-gradient(135deg, #f1f6ff 0%, #f8fbff 55%, #f3fbff 100%);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(47, 99, 245, .10) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 58%, rgba(0, 0, 0, .9) 100%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; max-width: 610px; }
.hero-topline { color: #4d70ad; font-size: 11px; letter-spacing: 1.8px; font-weight: 650; }
.hero-topline svg { color: var(--brand); }
.hero h1 {
  color: #10224a;
  font-size: clamp(32px, 3.3vw, 46px);
  font-weight: 700;
  line-height: 1.34;
  letter-spacing: -1.6px;
  margin: 14px 0 14px;
}
.hero h1 > span { color: var(--brand); }
.hero-description { color: #607393; font-size: 13px; line-height: 1.95; margin: 0; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.hero-points span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid #dfe9fb;
  border-radius: 999px;
  color: #4c6285;
  font-size: 10.5px;
  padding: 7px 11px;
  backdrop-filter: blur(4px);
}
.hero-points i { display: inline-flex; color: var(--brand); }
.hero-points svg { width: 12px; height: 12px; }

.hero-art { right: 26px; top: 24px; transform: scale(.94); transform-origin: right top; opacity: .96; }
.orbit { border-color: #c9d9f8; }
.orbit-two { border-color: #bcd2f8; }
.orbit-dot { background: #8fb1fb; }
.paper-back { background: #dbe7ff; border-color: #ccdcff; }
.paper-front { background: linear-gradient(135deg, #fff, #f2f7ff); border-color: #d8e4fb; box-shadow: 0 18px 28px rgba(47, 99, 245, .12); }
.paper-cap { color: var(--brand); }
.paper-line { background: #c5d7f7; }
.paper-line.short { background: #e3ebf9; }
.paper-check { color: #5d85d4; }
.paper-check svg { color: var(--brand); }
.paper-check span:last-child { background: #e8effc; }
.art-label { background: #fff; color: #4c6691; border-color: #dbe7fa; box-shadow: 0 8px 18px rgba(47, 99, 245, .10); }
.art-label svg { color: var(--brand); }
.floating-star { color: #6f96f8; }

.section-heading { margin: 22px 0 14px; }
.section-heading h2 { color: var(--ink); font-size: 15px; font-weight: 700; }
.section-heading > span { color: #94a2b8; font-size: 10.5px; }
.prompt-grid { gap: 14px; }
.prompt-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  padding: 20px 18px 21px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.prompt-card:hover {
  transform: translateY(-4px);
  border-color: #b7cdfb;
  box-shadow: 0 16px 34px rgba(24, 47, 94, .10);
}
.card-icon { width: 36px; height: 36px; border-radius: 10px; }
.card-icon.mint { background: #e9f1ff; color: var(--brand); }
.card-icon.peach { background: #fff1e6; color: #f07a28; }
.card-icon.lavender { background: #eef0ff; color: #6f63e8; }
.card-eyebrow { color: #96a4ba; font-size: 10px; letter-spacing: .5px; }
.prompt-card strong { color: #223350; font-size: 13px; font-weight: 650; }
.prompt-card p { color: #8d9bb1; font-size: 10.5px; }
.card-arrow { color: #9fb3d2; }
.prompt-card:hover .card-arrow { color: var(--brand); }
.how-it-works { color: #99a7bc; margin: 26px 0 18px; }
.how-it-works i { background: #eaf1fd; color: var(--brand); font-weight: 600; }
.how-it-works b { color: #d4deec; }

/* --------------------------------------------------------------------------
   练习对话 / 题目卡片
   -------------------------------------------------------------------------- */

.conversation { max-width: 900px; margin: 0 auto; padding-top: 28px; padding-bottom: 132px; }
.assistant-heading { color: #223350; font-size: 12px; font-weight: 700; gap: 9px; }
.assistant-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #4a7dff, #1e4ed8);
  color: #fff;
  box-shadow: 0 5px 12px rgba(36, 87, 232, .22);
}
.assistant-heading > small { color: #98a6bb; }
.assistant-copy { color: #52637f; font-size: 13px; line-height: 1.95; }
.user-message {
  background: linear-gradient(135deg, #4a7dff, #2457e8);
  color: #fff;
  border-radius: 15px 15px 4px 15px;
  box-shadow: 0 8px 20px rgba(36, 87, 232, .18);
  font-size: 13px;
}
.scope-card { background: #f5f8ff; border-color: #e2eafb; border-radius: 11px; }
.scope-card span { color: #6c7f9d; border-right-color: #dde6f7; }
.scope-card .scope-name { color: var(--brand-strong); }

.question-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 21px;
  margin: 12px 0;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s, box-shadow .18s;
}
.question-card:hover { border-color: #cad9f3; box-shadow: 0 10px 26px rgba(24, 47, 94, .07); }
.question-number { color: var(--brand); }
.question-type { background: #eef3ff; color: #5b77a7; border-radius: 5px; }
.question-topic { color: #93a2b8; }
.question-stem { color: #263753; font-weight: 550; }
.favorite-button { color: #a8b6ca; }
.favorite-button.saved { color: #f0a13c; }
.favorite-button.saved svg { fill: #fff1dc; }
.options { gap: 10px; }
.option {
  border: 1px solid #e3eafa;
  background: #fbfdff;
  border-radius: 10px;
  color: #40536f;
  font-size: 11.5px;
  padding: 11px 13px;
  transition: border-color .16s, background .16s, color .16s;
}
.option:hover:not(:disabled) { background: #f2f7ff; border-color: #a9c2fb; }
.option-letter { color: #8296b5; font-weight: 600; }
.option.selected { border-color: #6f93f5; background: #eef4ff; color: var(--brand-strong); }
.option.selected .option-letter { color: var(--brand); }
.option.correct { border-color: #5fc39a; background: #ecfbf4; color: #1d7a58; }
.option.wrong { border-color: #efb1a3; background: #fff4f1; color: #b2543f; }
.answer-line { color: #8c9bb2; }
.answer-toggle { color: var(--brand); }
.analysis { background: #f7faff; border-left: 3px solid #8fb1fb; color: #526780; border-radius: 0 9px 9px 0; }
.analysis strong { color: var(--brand-strong); }
.practice-result { background: linear-gradient(135deg, #eef5ff, #f7fbff); border-color: #d9e7ff; border-radius: 14px; }
.practice-result > div > span { color: #7189ad; }
.practice-result strong { color: var(--brand); }
.practice-result strong small { color: #8ba1c3; }
.practice-result p { color: #6c82a1; }
.score-line { color: #6f86a8; }
.result-actions .secondary-button { background: #fff; }
.batch-meta { color: #98a6bb; }
.suggestions button { border-color: #d8e4fa; color: #4c6ea8; background: #fff; }
.suggestions button:hover { background: #f2f7ff; border-color: #b7ccf5; color: var(--brand); }

.primary-button {
  background: linear-gradient(135deg, #4a7dff, #2457e8);
  color: #fff;
  border-radius: 9px;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(36, 87, 232, .16);
  transition: filter .18s, transform .18s, box-shadow .18s;
}
.primary-button:hover { filter: saturate(1.08); box-shadow: 0 10px 20px rgba(36, 87, 232, .22); }
.primary-button:active { transform: translateY(1px); }
.secondary-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #4f6383;
  border-radius: 9px;
  transition: border-color .16s, color .16s, background .16s;
}
.secondary-button:hover { background: #f5f9ff; border-color: #b9ccf6; color: var(--brand); }

.library h1 { color: var(--ink); font-weight: 700; }
.library-intro { color: #93a2b8; }
.empty-state { border: 1px dashed #ccd9ee; border-radius: 16px; color: #94a3b9; background: #fbfdff; }
.history-card { border-color: var(--line); border-radius: 13px; box-shadow: var(--shadow-sm); transition: border-color .16s, transform .16s, box-shadow .16s; }
.history-card:hover { border-color: #b9cdf6; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(24, 47, 94, .08); }
.history-card > span:first-child { background: #eef4ff; color: var(--brand); }
.history-card strong { color: #263753; }
.history-card small { color: #94a2b8; }
.history-card > span:last-child { color: #9fb3d1; }

/* --------------------------------------------------------------------------
   出卷 / 出书对话工作区
   -------------------------------------------------------------------------- */

/* Keep the home composer in flow so quick-start cards stay fully visible. */
body:has(#home:not(.hidden)) .composer-area {
  position: relative;
  bottom: auto;
  background: transparent;
  max-width: 1240px;
  padding: 6px 34px 18px;
}

body[data-mode="paper"] .main-content,
body[data-mode="book"] .main-content { padding-bottom: 30px; }
.nl-heading { display: none; }
.nl-conversation { max-width: 1000px; }
.nl-conversation .nl-messages { height: clamp(320px, calc(100dvh - 530px), 560px); }
.nl-format-toolbar {
  background: linear-gradient(135deg, #f2f7ff, #fbfdff);
  border: 1px solid #dce7fb;
  border-radius: 14px;
  padding: 13px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.nl-format-toolbar span { color: #7b8fac; font-size: 10px; letter-spacing: .3px; }
.nl-format-toolbar p { color: #435a7e; font-size: 11.5px; margin-top: 4px; }
.nl-format-toolbar button { border-radius: 8px; }

.nl-chat {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(24, 47, 94, .08);
}
.nl-chat-head {
  padding: 17px 22px;
  background: #fbfdff;
  border-bottom: 1px solid var(--line);
  color: #223350;
}
.nl-chat-title { display: inline-flex; align-items: center; gap: 9px; }
.nl-chat-title b { font-size: 13px; font-weight: 700; letter-spacing: .1px; }
.nl-chat-title b::before {
  content: "✦";
  color: var(--brand);
  margin-right: 7px;
  font-weight: 400;
}
.nl-chat-title small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eaf1ff;
  border: 1px solid #d9e6ff;
  color: #3d63ab;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 550;
  padding: 3px 8px;
}
.nl-chat-title small::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #2f9e6f; }
.nl-chat-head button { color: #7d8fac; font-size: 11px; border-radius: 6px; padding: 5px 8px; }
.nl-chat-head button:hover { color: var(--brand); background: #f0f5ff; }

.nl-messages { background: linear-gradient(180deg, #fbfdff 0%, #fff 26%); }
.nl-welcome { max-width: 640px; margin: 0 auto; padding: 22px 8px; }
.nl-orb {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #4a7dff, #1e4ed8);
  box-shadow: 0 12px 26px rgba(36, 87, 232, .24);
  font-size: 26px;
}
.nl-welcome h2 { color: #1c2d4c; font-size: 21px; font-weight: 650; }
.nl-welcome > p { color: #7c8da9; font-size: 12px; }
.nl-starters { gap: 10px; }
.nl-starters button {
  background: #fff;
  border: 1px solid #e0e8f6;
  border-radius: 12px;
  padding: 14px 36px 14px 15px;
  transition: border-color .16s, background .16s, transform .16s;
}
.nl-starters button:hover { border-color: #b7ccf5; background: #f8fbff; transform: translateY(-1px); }
.nl-starters small { color: #5f7fb5; font-size: 9.5px; font-weight: 550; }
.nl-starters span { color: #40536f; font-size: 11.5px; }
.nl-starters b { color: #a1b6d6; }

.nl-message { color: #40536f; font-size: 13px; }
.nl-message > div { background: #f5f8fd; border: 1px solid #e8eef8; border-radius: 4px 14px 14px 14px; color: #3f5270; }
.nl-message.user > div {
  background: linear-gradient(135deg, #4a7dff, #2457e8);
  border-color: transparent;
  color: #fff;
  border-radius: 14px 4px 14px 14px;
  box-shadow: 0 8px 18px rgba(36, 87, 232, .16);
}
.nl-avatar { background: linear-gradient(135deg, #4a7dff, #1e4ed8); border-radius: 9px; box-shadow: 0 4px 10px rgba(36, 87, 232, .18); }
.nl-choices { gap: 8px; }
.nl-choices button, .nl-ignore {
  border: 1px solid #d7e3f8;
  background: #fff;
  color: #3f6099;
  border-radius: 8px;
  transition: background .16s, border-color .16s, color .16s;
}
.nl-choices button:hover, .nl-ignore:hover { background: #f1f6ff; border-color: #a9c2fb; color: var(--brand-strong); }
.nl-composer { border: 1px solid #dce5f4; border-radius: 13px; background: #fff; box-shadow: 0 8px 24px rgba(24, 47, 94, .06); }
.nl-composer:focus-within { border-color: #9bb8fb; box-shadow: 0 0 0 4px rgba(47, 99, 245, .09); }
.nl-composer textarea { color: #2b3d5c; }
.nl-composer textarea::placeholder { color: #9caac0; }
.nl-composer button { background: linear-gradient(135deg, #4a7dff, #2457e8); border-radius: 8px; color: #fff; font-weight: 600; box-shadow: 0 5px 12px rgba(36, 87, 232, .18); }
.nl-composer button:disabled { box-shadow: none; }
.nl-footnote { color: #9facbf; }
.nl-chat-brief { background: #f8fbff; border-color: #e1e9f9; border-radius: 12px; color: #526780; }
.nl-chat-brief summary, .nl-chat-verification summary { color: #4d6a9c; }
.nl-chat-brief dt { color: #8b9bb5; }
.nl-chat-tags p { color: #8596b0; }
.nl-confirm { border-top-color: #e7edf8; }
.nl-confirm > span { color: #8d9db6; }
.nl-chat-verification > .nl-allocation { border-left-color: #d7e3f7; }
.nl-allocation { color: #647b9d; }
.nl-allocation p { border-bottom-color: #e6edf8; }
.nl-allocation small { color: #8e9fb8; }
.nl-file-card { background: #f6faff; border-color: #d9e6fb; border-radius: 13px; }
.nl-file-icon { background: #e6efff; color: var(--brand); }
.nl-file-info strong { color: #243653; }
.nl-file-download { border-color: #c8d9f6; color: var(--brand-strong); border-radius: 8px; }
.nl-file-download:hover { background: #edf4ff; }
.nl-after-file { color: #8b9bb5; }
.nl-working { color: #5f7fb5; }
.nl-working i { border-color: #b8ccf0; border-top-color: var(--brand); }
.nl-error { background: #fff5f3; color: #b55443; border: 1px solid #f7d9d2; border-radius: 9px; }
.nl-notice { background: #fff9ed; border-color: #f0dfb8; color: #8e7438; }
.nl-notice a { color: var(--brand); }

/* 出书 / 出卷的知识目录与配置面板 */
.studio-layout { gap: 20px; }
.config-panel { border-color: var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.panel-heading { color: #243653; }
.section-label { color: #3f5270; }
.field-label { color: #6f7f99; }
.field-label input { border-color: var(--line-strong); background: #f9fbff; color: #3f5270; border-radius: 8px; }
.document-sheet { border-color: var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(24, 47, 94, .08); color: #3f5270; }
.studio-empty { border-color: #d3e0f6; background: linear-gradient(135deg, #f6f9ff, #fbfdff); border-radius: 14px; }
.studio-empty h3 { color: #2a3c5b; }
.studio-empty p { color: #7e8fa9; }
.knowledge-layout { gap: 22px; }
.knowledge-nav { border-color: var(--line); background: #f8fbff; border-radius: 14px; }
.lesson-nav { border-radius: 10px; }
.lesson-nav.active { border-color: #d2e0f8; box-shadow: 0 4px 12px rgba(24, 47, 94, .06); }
.lesson-nav.active > span { color: var(--brand); }
.lesson-reader { border-color: var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.lesson-reader h2 { color: #1f304e; font-weight: 650; }
.lesson-tags > span { background: #eef4ff; color: #5374a7; }
.learned { background: #e9f1ff; color: var(--brand-strong); }
.worked-example { background: #f7faff; border-color: #e0eafb; border-radius: 10px; }
.worked-example > span { color: var(--brand); }
.pitfall { border-left-color: #f0c36a; }
.learning-progress i { background: linear-gradient(90deg, #4a7dff, #16b8c8); }

/* --------------------------------------------------------------------------
   格式设置弹窗
   -------------------------------------------------------------------------- */

.fmt-dialog { border-color: #dde6f4; border-radius: 22px; box-shadow: 0 32px 120px rgba(13, 36, 88, .24); background: #fbfdff; color: var(--ink); }
.fmt-dialog::backdrop { background: rgba(10, 28, 66, .45); backdrop-filter: blur(6px); }
.fmt-form > header { background: #fff; border-bottom-color: var(--line); }
.fmt-form h2 { color: #1c2d4c; font-weight: 650; }
.fmt-form > header p { color: #8b9bb5; }
.fmt-controls { background: #fff; }
.fmt-controls section { border-bottom-color: #edf1f8; }
.fmt-controls h3 { color: #2a3c5b; }
.fmt-field { color: #71819b; }
.fmt-field input, .fmt-field select { border-color: var(--line-strong); background: #f9fbff; color: #3f5270; border-radius: 8px; }
.fmt-field input:focus, .fmt-field select:focus { border-color: #9bb8fb; outline: 3px solid rgba(47, 99, 245, .10); }
.fmt-check { color: #4b5e7c; }
.fmt-check input { accent-color: var(--brand); }
.fmt-note { color: #8e9eb6; }
.fmt-preview { background: #f8fbff; }
.fmt-page { border-color: #e5ebf6; box-shadow: 0 10px 28px rgba(24, 47, 94, .08); }
.fmt-sample-watermark { color: rgba(47, 99, 245, .08); }
.fmt-live-summary { color: #5f7fb5; }
.fmt-priority { background: #eef4ff; color: #3f5f96; border-radius: 10px; }
.fmt-priority small { color: #8197bb; }
.fmt-form > footer { background: #fff; border-top-color: var(--line); }
.fmt-form > footer > button { color: #8b9bb5; }
.fmt-form .primary-button { background: linear-gradient(135deg, #4a7dff, #2457e8); }

/* --------------------------------------------------------------------------
   说明弹窗 / 提示
   -------------------------------------------------------------------------- */

dialog { border-color: var(--line); border-radius: 20px; box-shadow: 0 32px 100px rgba(13, 36, 88, .24); color: var(--ink); }
dialog::backdrop { background: rgba(10, 28, 66, .42); backdrop-filter: blur(6px); }
.dialog-mark { background: #eaf1ff; color: var(--brand); }
dialog h2 { color: #1c2d4c; font-weight: 650; }
dialog p { color: #7586a1; }
.dialog-detail { background: #f7faff; border-radius: 12px; }
.dialog-detail strong { color: #2a3c5b; }
.toast { background: #1b2c4c; border-radius: 10px; box-shadow: 0 12px 30px rgba(10, 28, 66, .25); }

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .sidebar { width: 226px; }
  .main-shell { margin-left: 226px; }
  #main-content, body[data-mode=paper] #main-content, body[data-mode=book] #main-content, body[data-mode=knowledge] #main-content { padding-left: 26px; padding-right: 26px; }
  .workspace-controls { padding-left: 26px; padding-right: 26px; }
  .hero { padding: 34px 32px; }
  .hero-art { transform: scale(.82); right: -6px; }
}

@media (max-width: 980px) {
  .hero-art { opacity: .55; transform: scale(.66); right: -40px; top: 34px; }
  .hero-content { max-width: 560px; }
  .mode-tab small { display: none; }
  .mode-tab { padding: 12px; }
  .mode-tab-icon { width: 32px; height: 32px; }
  .topbar-chip { display: none; }
  .login-story { padding: 38px; }
  .login-card { padding: 34px 28px; }
}

@media (max-width: 760px) {
  .sidebar { width: 248px; }
  .main-shell { margin-left: 0; }
  .topbar { padding: 0 18px; height: 62px; }
  .topbar-subtitle { display: none; }
  #main-content, body[data-mode=paper] #main-content, body[data-mode=book] #main-content, body[data-mode=knowledge] #main-content { padding-left: 18px; padding-right: 18px; }
  .workspace-controls { padding: 16px 18px 0; }
  .hero { padding: 28px 22px; border-radius: 18px; min-height: 260px; }
  .hero h1 { font-size: 30px; letter-spacing: -1px; }
  .hero-art { display: none; }
  .hero-description { max-width: none; }
  .hero-points { gap: 6px; margin-top: 18px; }
  .hero-points span { font-size: 9.5px; padding: 6px 9px; }
  .mode-tabs { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .mode-tab { border-radius: 11px; }
  .mode-tab strong { font-size: 12px; }
  .target-bar { padding: 9px 10px; }
  .target-hint { display: none; }
  .prompt-grid { grid-template-columns: 1fr; }
  .section-heading { margin-top: 18px; }
  .nl-chat { border-radius: 14px; }
  .nl-conversation .nl-messages { padding: 18px; height: clamp(340px, calc(100dvh - 500px), 470px); }
  .nl-conversation .nl-composer { margin: 0 10px; }
  .nl-message > div { max-width: 92%; }
  .nl-format-toolbar { padding: 11px 12px; }
  .nl-format-toolbar p { font-size: 10.5px; }
  .login-story { min-height: 200px; }
  .login-intro h1 { font-size: 30px; }
  .login-panel { padding: 26px 20px 40px; }
  .login-card { padding: 30px 22px; border-radius: 18px; }
  .composer-area { padding: 10px 16px 12px; }
  .composer { border-radius: 14px; }
  .footer-note { font-size: 9px; }
  .user-message { max-width: 90%; }
  .question-card { padding: 16px; }
  .options { grid-template-columns: 1fr; }
  .question-stem { font-size: 12.5px; }
}

@media (max-width: 520px) {
  .login-features { display: none; }
  .login-story-note { display: none; }
  .login-intro { margin: 26px 0 8px; }
  .topbar-actions .preview-badge { font-size: 10px; padding: 7px 9px; }
  .mode-tabs { grid-template-columns: 1fr 1fr; }
  .nl-chat-title small { display: none; }
  .nl-chat-head { padding: 14px 14px; }
  .nl-chat-head button { font-size: 10px; }
  .nl-welcome h2 { font-size: 18px; }
  .nl-starters { grid-template-columns: 1fr; }
  .hero { min-height: 0; }
  .hero h1 { font-size: 27px; }
}
/* Compact laptops: keep quick starts and the composer above the fold. */
@media (max-height: 1000px) {
  .home { padding-top: 16px; }
  .workspace-controls { padding-top: 16px; }
  .hero { min-height: 236px; padding: 26px 32px; }
  .hero h1 { font-size: clamp(30px, 3vw, 38px); margin: 10px 0; }
  .hero-description { line-height: 1.8; }
  .hero-points { display: none; }
  .practice-preferences { padding-top: 10px; }
  .how-it-works { display: none; }
  .sidebar { padding-top: 22px; padding-bottom: 16px; }
  .brand { margin-bottom: 20px; }
  .new-chat { margin-bottom: 18px; }
  .recent-label { margin-top: 24px; }
  .small-note { padding: 11px 10px; margin-bottom: 10px; }
  .profile { padding-top: 12px; }
}

/* --------------------------------------------------------------------------
   右侧可收起的工作台面板
   -------------------------------------------------------------------------- */

.main-shell {
  margin-right: 320px;
  transition: margin-right .26s ease;
}
body.rail-collapsed .main-shell { margin-right: 0; }

.control-rail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 46px rgba(24, 47, 94, .055);
  transition: transform .26s ease;
}
body.rail-collapsed .control-rail { transform: translateX(100%); }

.rail-head {
  height: 68px;
  flex-shrink: 0;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
}
.rail-kicker { display: block; color: #95a3b9; font-size: 8.5px; font-weight: 650; letter-spacing: 2.2px; }
.rail-head strong { display: block; margin-top: 3px; color: var(--ink); font-size: 14px; font-weight: 700; }
.rail-collapse {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #7386a3;
  background: #fff;
  transition: color .16s, border-color .16s, background .16s;
}
.rail-collapse:hover { color: var(--brand); border-color: #b9ccf6; background: #f7faff; }
.rail-collapse svg { width: 16px; height: 16px; }

.rail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
}
.rail-section { margin-bottom: 20px; }
.rail-section:last-child { margin-bottom: 0; }
.rail-label {
  margin-bottom: 10px;
  color: #94a2b8;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 1.2px;
}
#format-rail-mount:empty { display: none; }
.rail-section:has(#format-rail-mount:empty) { display: none; }

/* 面板里的模式选择：纵向列表 */
.control-rail .workspace-controls { max-width: none; width: 100%; margin: 0; padding: 0; }
.control-rail .mode-tabs { display: flex; flex-direction: column; gap: 8px; }
.control-rail .mode-tab {
  width: 100%;
  flex-direction: row;
  align-items: center;
  text-align: left;
  padding: 10px 11px;
  gap: 10px;
  border-radius: 10px;
  border-color: var(--line);
  box-shadow: none;
  background: #fff;
}
.control-rail .mode-tab:hover { transform: none; border-color: #c7d7f6; background: #fbfdff; }
.control-rail .mode-tab.selected {
  background: #f1f6ff;
  border-color: #b9ccf6;
  box-shadow: inset 3px 0 0 var(--brand), 0 4px 12px rgba(36, 87, 232, .07);
}
.control-rail .mode-tab.selected::after { display: none; }
.control-rail .mode-tab-icon { width: 32px; height: 32px; border-radius: 9px; }
.control-rail .mode-tab-icon svg { width: 16px; height: 16px; }
.control-rail .mode-tab strong { font-size: 12px; }
.control-rail .mode-tab small { display: block; font-size: 9px; margin-top: 3px; white-space: normal; line-height: 1.5; }
.control-rail .tab-index { display: block; color: #c3cedf; font-size: 8px; margin-left: auto; }
.control-rail .target-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
}
.control-rail .target-label { margin: 0 0 2px; font-size: 9.5px; }
.control-rail .target-bar select { width: 100%; max-width: none; background: #fff; font-size: 10.5px; }
.control-rail .target-hint { margin: 2px 0 0; font-size: 9px; color: #96a5bb; }
.control-rail .workspace-disclaimer { display: none; }
.control-rail .practice-preferences {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-top: 14px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.65;
}
.control-rail .practice-preferences .eyebrow { display: none; }
.control-rail .segmented { display: flex; width: 100%; }
.control-rail .segmented button { flex: 1; justify-content: center; }

/* 面板里的格式卡片 */
.control-rail .nl-format-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid #dce7fb;
  border-radius: 12px;
  background: #f8fbff;
  box-shadow: none;
}
.control-rail .nl-format-toolbar > div { min-width: 0; }
.control-rail .nl-format-toolbar span { font-size: 9.5px; }
.control-rail .nl-format-toolbar p { margin-top: 5px; font-size: 10.5px; line-height: 1.8; word-break: keep-all; overflow-wrap: anywhere; }
.control-rail .nl-format-toolbar button {
  width: 100%;
  justify-content: center;
  padding: 9px 12px;
  border-color: #c8d9f6;
  background: #fff;
  color: var(--brand-strong);
}
.control-rail .nl-format-toolbar button:hover { background: #eef4ff; }

/* 顶栏设置按钮与移动端遮罩 */
.topbar-settings {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: #50617f;
  font-size: 11px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: color .16s, border-color .16s, background .16s;
}
.topbar-settings:hover { color: var(--brand); border-color: #b9ccf6; background: #f9fbff; }
.topbar-settings svg { width: 14px; height: 14px; color: var(--brand); }
body.rail-collapsed .topbar-settings { color: var(--brand-strong); border-color: #b9ccf6; background: #f4f8ff; }
.rail-backdrop { display: none; }

@media (max-width: 1180px) {
  .main-shell { margin-right: 0; }
  .control-rail { width: 320px; box-shadow: -24px 0 60px rgba(10, 28, 66, .16); }
  body:not(.rail-collapsed) .rail-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(10, 28, 66, .34);
    backdrop-filter: blur(2px);
  }
}

@media (max-width: 760px) {
  .control-rail { width: min(320px, 88vw); }
  .topbar-settings-label { display: none; }
  .topbar-settings { padding: 8px; }
  .rail-body { padding: 14px; }
}
