/* ============================================================
   巴羊羊 H5 v5.1 — 奶油糖果风 · 可爱版
   设计语言：暖奶油底 + 珊瑚橙主色 + 大圆角果冻感 + 手绘小羊
   目标用户：小学 / 初中 / 高中
   ============================================================ */

:root {
  --bg: #fff8f0;
  --bg-deco-1: rgba(255, 183, 138, .35);
  --bg-deco-2: rgba(255, 170, 196, .28);
  --bg-deco-3: rgba(126, 208, 255, .25);

  --surface: #ffffff;
  --surface-2: #fff3e6;
  --border: rgba(94, 62, 40, .08);
  --border-strong: rgba(94, 62, 40, .16);

  --ink: #40303c;
  --ink-2: #7a6570;
  --ink-3: #b39aa4;

  --primary: #ff8a5c;
  --primary-deep: #f06d3b;
  --primary-soft: #ffe9dc;
  --pink: #ff9dbb;
  --pink-soft: #ffe9f0;
  --mint: #3ecfb2;
  --mint-soft: #e2faf4;
  --sky: #6cb8ff;
  --sky-soft: #e7f3ff;
  --sun: #ffc94d;
  --sun-soft: #fff4d6;

  --danger: #f4626e;
  --gold: #e8a33d;

  --r-xl: 28px;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 13px;

  --shadow-sm: 0 2px 8px rgba(180, 110, 60, .06);
  --shadow-md: 0 8px 28px -8px rgba(180, 110, 60, .16);
  --shadow-lg: 0 20px 50px -14px rgba(240, 109, 59, .28);
  --shadow-btn: 0 6px 0 0 rgba(214, 90, 43, .35);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* 背景装饰：漂浮的糖果泡泡 */
body::before, body::after {
  content: '';
  position: fixed; z-index: 0; border-radius: 50%; pointer-events: none;
}
body::before {
  width: 320px; height: 320px; top: -120px; right: -100px;
  background: radial-gradient(circle at 35% 35%, var(--bg-deco-1), transparent 70%);
}
body::after {
  width: 380px; height: 380px; bottom: -160px; left: -140px;
  background: radial-gradient(circle at 35% 35%, var(--bg-deco-2), transparent 70%);
}

/* ============ 小羊形象（新插画） ============ */
.sheep {
  display: block; object-fit: cover; object-position: center 42%;
  border-radius: 50%; background: #fff6ec;
}
.sheep-face { width: 100%; height: 100%; }
.hero-sheep {
  width: 96px; height: 96px;
  border-radius: 50%; border: 3px solid rgba(255,255,255,.75);
  filter: drop-shadow(0 6px 12px rgba(120,60,20,.18));
  animation: sheepBob 3.2s ease-in-out infinite;
}
.sheep-sm { width: 22px; height: 22px; }
@keyframes sheepBob { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-7px) rotate(3deg); } }

/* ============ 顶栏 ============ */
#header {
  position: sticky; top: 0; z-index: 50;
  height: 58px;
  display: flex; align-items: center;
  padding: 0 18px;
  background: rgba(255, 248, 240, .86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
#headerTitle { font-size: 17.5px; font-weight: 800; letter-spacing: .3px; flex: 1; }
.header-back {
  font-size: 15px; color: var(--primary-deep); font-weight: 700;
  margin-right: 12px; padding: 4px 10px 4px 0; cursor: pointer;
}
#headerRight { display: flex; align-items: center; gap: 8px; }

/* ============ 主内容 ============ */
#mainContent {
  position: relative; z-index: 1;
  max-width: 640px; margin: 0 auto;
  padding: 18px 16px 130px;
}
.tab-page { display: none; }
.tab-page.active { display: block; animation: pageIn .3s cubic-bezier(.22,1,.36,1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }

/* ============ 首页 Hero ============ */
.hero {
  position: relative;
  border-radius: var(--r-xl);
  padding: 24px 20px 22px;
  color: #fff;
  background: linear-gradient(135deg, #ffb27a 0%, #ff8e6e 48%, #ff7b93 100%);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 22px;
}
.hero::before {
  content: ''; position: absolute; width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255,255,255,.16); top: -60px; right: -40px;
}
.hero::after {
  content: ''; position: absolute; width: 90px; height: 90px; border-radius: 50%;
  background: rgba(255,255,255,.12); bottom: 24px; right: 90px;
}
.hero-greet { font-size: 22px; font-weight: 800; letter-spacing: .3px; position: relative; }
.hero-sub { font-size: 13px; opacity: .92; margin-top: 5px; position: relative; }
.hero-meta { display: flex; gap: 8px; margin-top: 15px; flex-wrap: wrap; position: relative; }
.hero-chip {
  font-size: 12px; font-weight: 700; padding: 6px 13px; border-radius: 999px;
  background: rgba(255,255,255,.22); border: 1.5px solid rgba(255,255,255,.35);
  cursor: pointer; transition: transform .15s;
}
.hero-chip:active { transform: scale(.93); }
.hero-chip.gold { background: #fff; color: #d0682f; border-color: transparent; box-shadow: 0 3px 10px rgba(120,60,20,.15); }
.hero-deco {
  position: absolute; right: 12px; bottom: -4px; width: 104px; height: 104px;
  pointer-events: none; opacity: .96;
}

/* ============ 区块标题 ============ */
.section-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 24px 2px 13px;
}
.section-title {
  font-size: 16.5px; font-weight: 800; display: flex; align-items: center; gap: 7px;
}
.section-title::before {
  content: ''; width: 5px; height: 17px; border-radius: 3px;
  background: linear-gradient(180deg, var(--sun), var(--primary));
}
.section-more { font-size: 13px; color: var(--ink-3); cursor: pointer; font-weight: 600; }

/* ============ 学科宫格 ============ */
.subject-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px;
}
.subject-tile {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  padding: 15px 14px 13px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .18s cubic-bezier(.22,1,.36,1), box-shadow .18s;
  overflow: hidden;
}
.subject-tile:active { transform: scale(.95) rotate(-.5deg); box-shadow: var(--shadow-md); }
.tile-glow {
  position: absolute; right: -20px; top: -20px; width: 70px; height: 70px;
  border-radius: 50%; opacity: .16;
}
.tile-head { display: flex; align-items: center; gap: 10px; }
.tile-icon {
  width: 42px; height: 42px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; color: #fff; flex: none;
  box-shadow: 0 4px 10px rgba(120,60,20,.18);
}
.tile-name { font-size: 16px; font-weight: 800; }
.tile-desc { font-size: 12px; color: var(--ink-3); margin-top: 8px; line-height: 1.5; }

/* ============ 快捷功能区 ============ */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-item {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--r-md); padding: 14px 4px 11px;
  text-align: center; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .18s cubic-bezier(.22,1,.36,1);
}
.quick-item:active { transform: scale(.92); }
.quick-icon {
  width: 40px; height: 40px; margin: 0 auto 8px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  border: 2px solid rgba(255,255,255,.8); box-shadow: inset 0 -3px 0 rgba(120,60,20,.05);
}
.quick-label { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.quick-lock {
  font-size: 10px; color: #fff; background: var(--sun);
  margin: 3px auto 0; width: fit-content; padding: 1px 8px; border-radius: 999px; font-weight: 700;
}

/* ============ 卡片通用 ============ */
.card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--r-md); padding: 16px; box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.section { margin-bottom: 20px; }
.section-header { font-size: 14px; font-weight: 800; color: var(--ink-2); margin-bottom: 10px; letter-spacing: .3px; }

/* ============ 聊天 ============ */
#tab-chat { padding-top: 4px; }
.message-list { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
.message-item { display: flex; gap: 10px; align-items: flex-end; }
.msg-user { flex-direction: row-reverse; }

.avatar {
  width: 36px; height: 36px; border-radius: 14px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.avatar-ai {
  background: linear-gradient(150deg, #ffe3d0, #ffd6e4);
  border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(240,109,59,.18);
}
.avatar-user { background: var(--sky-soft); border: 2px solid #fff; }

.bubble-area { max-width: 78%; display: flex; flex-direction: column; gap: 5px; }
.bubble {
  padding: 12px 15px; font-size: 15px; line-height: 1.65;
  border-radius: 20px; word-break: break-word;
}
.bubble-ai {
  background: var(--surface); border: 2px solid var(--border);
  border-bottom-left-radius: 7px; box-shadow: var(--shadow-sm);
}
.bubble-name {
  display: block; font-size: 11px; color: var(--primary-deep); font-weight: 800; margin-bottom: 3px;
}
.bubble-user {
  background: linear-gradient(135deg, #ff9a6b, #ff7b93); color: #fff;
  border-bottom-right-radius: 7px; box-shadow: 0 5px 14px rgba(255,123,147,.28);
}
.bubble-text { white-space: pre-wrap; }
.bubble-text code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.ai-tag { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 6px; }
.bubble-actions { display: flex; gap: 14px; padding: 0 4px; }
.action-btn { font-size: 12px; color: var(--primary-deep); cursor: pointer; font-weight: 700; }

.msg-system { justify-content: center; }
.system-insight {
  max-width: 92%; font-size: 12.5px; color: #9a6b1f;
  background: var(--sun-soft); border: 2px dashed #f5d98c;
  border-radius: var(--r-sm); padding: 10px 14px; line-height: 1.7;
  white-space: pre-wrap;
}

/* 打字动画 */
.typing-indicator { display: flex; gap: 10px; align-items: flex-end; margin-top: 4px; }
.typing-dots { display: flex; gap: 5px; padding: 15px 16px; }
.typing-dots .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--primary);
  animation: blink 1.2s infinite;
}
.typing-dots .dot:nth-child(2) { animation-delay: .2s; background: var(--pink); }
.typing-dots .dot:nth-child(3) { animation-delay: .4s; background: var(--sun); }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: scale(.85); } 40% { opacity: 1; transform: scale(1.05); } }

/* 空状态 */
.empty-state { display: flex; justify-content: center; padding: 26px 0 10px; }
.empty-card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--r-lg); padding: 28px 22px; text-align: center;
  box-shadow: var(--shadow-md); max-width: 552px; width: calc(100% - 88px);
  position: relative; overflow: hidden;
}
.empty-card::before {
  content: ''; position: absolute; width: 130px; height: 130px; border-radius: 50%;
  background: var(--sun-soft); top: -60px; left: -50px; opacity: .7;
}
.empty-emoji { font-size: 40px; position: relative; }
.empty-emoji .sheep { width: 72px; height: 72px; margin: 0 auto; }
.empty-title { font-size: 18px; font-weight: 800; margin-top: 10px; position: relative; }
.empty-desc { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; position: relative; }
.empty-hints { margin: 16px auto 0; max-width: 420px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.hint-item {
  font-size: 13px; color: var(--ink-2); background: var(--bg);
  border-radius: 12px; padding: 10px 13px; text-align: left; cursor: pointer;
  border: 1.5px dashed var(--border-strong); transition: all .15s;
}
.hint-item:active { background: var(--primary-soft); border-color: var(--primary); transform: scale(.97); }

/* ============ 底部输入栏 ============ */
.input-area {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 248, 240, .92); backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
}
/* v9 输入框卡片化：textarea 在上，工具条（拍照/发送）在下，一整张卡片 */
.input-wrapper {
  max-width: 640px; margin: 0 auto;
  background: var(--surface); border: 2px solid var(--border-strong); border-radius: 22px;
  padding: 4px 14px 10px; transition: border .2s, box-shadow .2s;
}
.input-wrapper:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255,138,92,.14); }
.message-input {
  width: 100%; min-height: 64px; max-height: 45vh;
  border: none; border-radius: 0; padding: 10px 2px 6px; font-size: 15.5px; line-height: 1.6;
  font-family: var(--font); resize: none; overflow-y: auto;
  background: transparent; outline: none; box-shadow: none;
  color: var(--ink); display: block;
}
.message-input::placeholder { color: var(--ink-3); font-size: 13.5px; }
.message-input:focus { border: none; box-shadow: none; }
.input-toolbar { display: flex; align-items: center; gap: 10px; }
.toolbar-hint { flex: 1; font-size: 11px; color: var(--ink-3); }
.send-btn {
  height: 40px; padding: 0 26px; border: none; border-radius: 20px;
  background: linear-gradient(135deg, #ff9a6b, #f06d3b); color: #fff;
  font-size: 15px; font-weight: 800; font-family: var(--font); flex: none;
  box-shadow: var(--shadow-btn); cursor: pointer; opacity: .5;
  transition: opacity .2s, transform .15s, box-shadow .15s;
}
.send-btn.has-text { opacity: 1; }
.send-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 0 rgba(214,90,43,.35); }

/* ============ TabBar ============ */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  display: flex; gap: 4px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 248, 240, .92); backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
}
.tab-item {
  flex: 1; text-align: center; font-size: 12px; color: var(--ink-3);
  padding: 7px 0 6px; border-radius: 16px; cursor: pointer; font-weight: 700;
  transition: all .2s;
}
.tab-item::before { content: attr(data-icon); display: block; font-size: 21px; margin-bottom: 1px; filter: grayscale(1); opacity: .55; transition: all .2s; }
.tab-item.active { color: var(--primary-deep); background: var(--primary-soft); }
.tab-item.active::before { filter: none; opacity: 1; transform: scale(1.12); }

/* ============ 学情页 ============ */
.tabs {
  display: flex; gap: 8px; margin-bottom: 14px;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: 18px; padding: 5px; box-shadow: var(--shadow-sm);
}
.tab {
  flex: 1; text-align: center; font-size: 13.5px; font-weight: 700;
  color: var(--ink-3); padding: 9px 0; border-radius: 13px; cursor: pointer;
  transition: all .2s;
}
.tab-active {
  background: linear-gradient(135deg, #ff9a6b, #ff7b93); color: #fff;
  box-shadow: 0 4px 12px rgba(255,123,147,.3);
}

.learning-content { min-height: 200px; }
.kp-section { background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-md); padding: 15px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.kp-subject-header { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 15px; margin-bottom: 12px; }
.kp-subject-count { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.kp-item { margin-bottom: 11px; }
.kp-item:last-child { margin-bottom: 0; }
.kp-name { font-size: 13.5px; display: block; margin-bottom: 5px; }
.kp-bar-wrapper { display: flex; align-items: center; gap: 10px; }
.kp-bar { flex: 1; height: 9px; background: var(--bg); border-radius: 5px; overflow: hidden; border: 1px solid var(--border); }
.kp-bar-fill { height: 100%; border-radius: 5px; transition: width .5s ease; }
.bar-high { background: linear-gradient(90deg, #6fe3c5, #3ecfb2); }
.bar-mid { background: linear-gradient(90deg, #ffd97a, #ffc94d); }
.bar-low { background: linear-gradient(90deg, #ff9aa5, #f4626e); }
.kp-level { font-size: 12px; font-weight: 800; width: 36px; text-align: right; }
.text-high { color: #21b493; } .text-mid { color: #e5a52f; } .text-low { color: var(--danger); }

.wq-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-md); padding: 15px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.wq-header { display: flex; gap: 8px; align-items: center; margin-bottom: 9px; }
.wq-subject {
  font-size: 11px; padding: 3px 9px; border-radius: 7px; font-weight: 700;
  background: var(--primary-soft); color: var(--primary-deep);
}
.wq-point { font-size: 12px; color: var(--ink-2); flex: 1; }
.wq-date { font-size: 11.5px; color: var(--ink-3); }
.wq-question { font-size: 14px; line-height: 1.6; margin-bottom: 9px; }
.wq-answers { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.wq-label { font-size: 11.5px; color: var(--ink-3); margin-right: 8px; }
.wq-val { font-size: 13px; }
.wrong-val { color: var(--danger); } .right-val { color: #21b493; }
.wq-analysis { font-size: 12.5px; color: var(--ink-2); background: var(--bg); border-radius: 10px; padding: 9px 12px; line-height: 1.6; }

.empty-box {
  text-align: center; color: var(--ink-3); font-size: 14px;
  padding: 48px 20px; line-height: 1.9;
}
.empty-box small { font-size: 12px; }

/* ============ 学习报告（会员） ============ */
.report-card {
  background: linear-gradient(135deg, #5b4a86 0%, #8a6bb5 100%);
  border-radius: var(--r-md); padding: 18px 16px; color: #fff;
  margin-bottom: 12px; position: relative; overflow: hidden;
}
.report-card .rc-title { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.report-card .rc-desc { font-size: 12.5px; opacity: .8; margin-top: 5px; }
.report-card .rc-btn {
  margin-top: 14px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--sun); color: #6b4a00; font-size: 13px; font-weight: 800;
  padding: 10px 20px; border-radius: 999px; cursor: pointer; border: none; font-family: var(--font);
  box-shadow: 0 4px 0 rgba(0,0,0,.12); transition: transform .15s;
}
.report-card .rc-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.report-card .rc-btn.locked { background: rgba(255,255,255,.16); color: #ffe4a8; border: 1.5px dashed rgba(255,228,168,.5); box-shadow: none; }
.report-output { white-space: pre-wrap; font-size: 13.5px; line-height: 1.8; }

/* ============ 会员卡 ============ */
.vip-card {
  border-radius: var(--r-lg); padding: 20px 18px;
  background: linear-gradient(135deg, #5b4a86 0%, #8a6bb5 55%, #b07cc6 100%);
  color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow-lg);
  margin-bottom: 16px;
}
.vip-card::before {
  content: ''; position: absolute; width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.12); top: -50px; right: -30px;
}
.vip-card.free {
  background: var(--surface); color: var(--ink);
  border: 2px dashed var(--border-strong); box-shadow: var(--shadow-sm);
}
.vip-card.free::before { display: none; }
.vip-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  background: var(--sun); color: #6b4a00;
  padding: 4px 12px; border-radius: 999px; position: relative;
}
.vip-card.free .vip-badge { background: var(--sun-soft); color: #b07c2a; }
.vip-title { font-size: 19px; font-weight: 800; margin-top: 10px; position: relative; }
.vip-sub { font-size: 12.5px; opacity: .85; margin-top: 3px; position: relative; }
.vip-features { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; position: relative; }
.vip-f {
  font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 9px;
  background: rgba(255,255,255,.18); border: 1.5px solid rgba(255,255,255,.25);
}
.vip-card.free .vip-f { background: var(--bg); border-color: var(--border-strong); color: var(--ink-2); }
.vip-f.off { opacity: .6; }
.vip-action {
  margin-top: 16px; width: 100%; border: none; font-family: var(--font);
  background: var(--sun); color: #6b4a00; font-size: 14.5px; font-weight: 800;
  padding: 13px; border-radius: 15px; cursor: pointer; position: relative;
  box-shadow: 0 5px 0 rgba(0,0,0,.14); transition: transform .15s, box-shadow .15s;
}
.vip-action:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.14); }
.vip-code-row {
  margin-top: 12px; display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; opacity: .85; position: relative;
}
.vip-code { font-family: ui-monospace, monospace; letter-spacing: 1px; }
.copy-btn {
  font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.2); border: 1.5px solid rgba(255,255,255,.3); color: inherit;
}
.vip-card.free .copy-btn { background: var(--sun-soft); border-color: transparent; color: #b07c2a; }

/* ============ 表单 ============ */
.form-item, .form-block { margin-bottom: 14px; }
.form-item:last-child, .form-block:last-child { margin-bottom: 0; }
.form-label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.form-label-block { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.form-input, .form-select {
  width: 100%; height: 46px; border: 2px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 0 14px; font-size: 14.5px; font-family: var(--font);
  background: var(--bg); outline: none; transition: border .2s, box-shadow .2s;
  color: var(--ink);
}
.form-input:focus, .form-select:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(255,138,92,.12); }
.form-hint-under { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }

/* ============ 按钮 ============ */
.btn {
  border: none; font-family: var(--font); cursor: pointer;
  border-radius: 16px; font-size: 15px; font-weight: 800;
  padding: 14px 20px; transition: transform .15s, box-shadow .15s;
}
.btn:active { transform: translateY(3px); }
.btn-primary {
  background: linear-gradient(135deg, #ff9a6b, #f06d3b); color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn-primary:active { box-shadow: 0 2px 0 0 rgba(214,90,43,.35); }
.btn-secondary { background: var(--surface-2); color: var(--ink-2); border: 2px solid var(--border-strong); box-shadow: 0 4px 0 rgba(94,62,40,.08); }
.btn-secondary:active { box-shadow: 0 1px 0 rgba(94,62,40,.08); }
.btn-gold { background: var(--sun); color: #6b4a00; box-shadow: 0 5px 0 rgba(190,130,20,.35); }
.btn-gold:active { box-shadow: 0 2px 0 rgba(190,130,20,.35); }
.btn-mint { background: linear-gradient(135deg, #5cdcc0, #2bbfa2); color: #fff; box-shadow: 0 5px 0 rgba(30,150,125,.35); }
.btn-block { width: 100%; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

/* ============ 用户信息卡 ============ */
.profile-user-card {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #ffe9dc, #ffe9f0);
  border: 2px solid #fff;
  border-radius: var(--r-lg); padding: 18px 16px; box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}
.profile-avatar {
  width: 56px; height: 56px; border-radius: 20px; flex: none;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 5px 14px rgba(240,109,59,.16); padding: 5px;
}
.profile-avatar .sheep { width: 100%; height: 100%; }
.profile-user-info { flex: 1; }
.profile-user-name { font-size: 17px; font-weight: 800; }
.profile-user-stage { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.profile-phone-badge {
  font-size: 12px; font-weight: 700; color: var(--primary-deep);
  background: #fff; padding: 7px 13px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(240,109,59,.12);
}
.profile-phone-badge.bound { color: #21b493; background: var(--mint-soft); }

/* ============ 菜单列表 ============ */
.menu-list { background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 16px; cursor: pointer; border-bottom: 1px solid var(--border);
  font-size: 14.5px; transition: background .15s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg); }
.menu-icon {
  width: 36px; height: 36px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.menu-text { flex: 1; font-weight: 700; }
.menu-sub { font-size: 11.5px; color: var(--ink-3); font-weight: 500; margin-top: 1px; }
.menu-arrow { color: var(--ink-3); font-size: 17px; }
.menu-tag { font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 7px; background: var(--mint-soft); color: #1a9b80; }

/* ============ 教师工作台 ============ */
.teacher-hero {
  background: linear-gradient(135deg, #4ecdb4 0%, #2bbfa2 60%, #1fae9b 100%);
  border-radius: var(--r-lg); padding: 20px 18px; color: #fff;
  box-shadow: 0 16px 40px -12px rgba(43,191,162,.45); margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.teacher-hero::before {
  content: ''; position: absolute; width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.14); top: -50px; right: -30px;
}
.teacher-code-box {
  margin-top: 14px; background: rgba(255,255,255,.18); border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 15px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between;
  position: relative;
}
.teacher-code { font-size: 22px; font-weight: 800; letter-spacing: 6px; font-family: ui-monospace, monospace; }
.student-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-md); padding: 15px; margin-bottom: 11px; box-shadow: var(--shadow-sm); cursor: pointer; }
.student-row { display: flex; align-items: center; gap: 12px; }
.student-name { font-weight: 800; font-size: 15px; flex: 1; }
.student-stats { display: flex; gap: 10px; margin-top: 11px; }
.stat-cell { flex: 1; text-align: center; background: var(--bg); border-radius: 12px; padding: 9px 4px; border: 1.5px solid var(--border); }
.stat-num { font-size: 17px; font-weight: 800; color: var(--primary-deep); }
.stat-label { font-size: 10.5px; color: var(--ink-3); margin-top: 1px; }

/* ============ 登录遮罩 ============ */
.is-hidden { display: none !important; }

/* ===== 登录卡片表单 ===== */
.login-input {
  width: 100%; min-height: 48px; margin-top: 10px;
  border: 2px solid var(--border-strong); border-radius: 16px;
  padding: 0 16px; font-size: 15px; font-family: var(--font);
  background: var(--surface); color: var(--ink); outline: none;
  transition: border .2s, box-shadow .2s; box-sizing: border-box; display: block;
}
.login-input::placeholder { color: var(--ink-3); font-size: 13.5px; }
.login-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255,138,92,.14); }
.login-links { display: flex; justify-content: space-between; margin-top: 14px; padding: 0 4px; }
.login-links a { color: var(--ink-2); font-size: 13px; text-decoration: none; }
.login-links a:active { color: var(--primary); }

.login-overlay {
  position: fixed; inset: 0; z-index: 100;
  background:
    radial-gradient(420px 300px at 12% 8%, var(--bg-deco-3), transparent 65%),
    radial-gradient(420px 300px at 88% 18%, var(--bg-deco-2), transparent 65%),
    radial-gradient(500px 340px at 50% 100%, var(--bg-deco-1), transparent 70%),
    var(--bg);
  display: none; align-items: center; justify-content: center; padding: 28px;
}
.login-card {
  background: var(--surface); border-radius: 32px; padding: 36px 26px;
  width: 100%; max-width: 370px; text-align: center;
  border: 3px solid #fff;
  box-shadow: 0 26px 70px -18px rgba(240,109,59,.3);
  position: relative; overflow: hidden;
}
.login-card::before {
  content: ''; position: absolute; width: 160px; height: 160px; border-radius: 50%;
  background: var(--sun-soft); top: -70px; right: -60px; opacity: .8;
}
.login-card .empty-emoji { position: relative; }
.login-card .empty-emoji .sheep { width: 92px; height: 92px; margin: 0 auto; animation: sheepBob 3.2s ease-in-out infinite; }
.login-card .empty-title { font-size: 21px; }
.login-card .empty-desc { color: var(--ink-2); }
.login-plant {
  margin-top: 20px; font-size: 12px; color: var(--ink-3); line-height: 1.7;
  background: var(--bg); border-radius: 12px; padding: 10px 12px;
}

/* ============ Toast / Banner ============ */
.toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%);
  background: rgba(64,48,60,.9); color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 11px 24px; border-radius: 999px; z-index: 200;
  backdrop-filter: blur(8px); animation: toastIn .25s ease;
  box-shadow: 0 8px 24px rgba(64,48,60,.25);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.offline-banner {
  display: flex; align-items: center; gap: 8px;
  margin: 12px auto 0; max-width: 608px;
  background: var(--sun-soft); border: 2px dashed #f5d98c; color: #9a6b1f;
  font-size: 12.5px; padding: 10px 14px; border-radius: var(--r-sm);
}

/* ============ 模态 ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 150; background: rgba(64,48,60,.45);
  display: none; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-sheet {
  background: var(--bg); width: 100%; max-width: 640px;
  border-radius: 28px 28px 0 0; padding: 24px 20px calc(26px + env(safe-area-inset-bottom));
  animation: sheetUp .3s cubic-bezier(.22,1,.36,1); position: relative;
  max-height: 85vh; overflow-y: auto;
}
@keyframes sheetUp { from { transform: translateY(80px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-title { font-size: 19px; font-weight: 800; text-align: center; }
.modal-close {
  position: absolute; right: 18px; top: 18px; font-size: 20px; color: var(--ink-3);
  cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border-radius: 50%; box-shadow: var(--shadow-sm);
}
.upgrade-features { margin: 18px 0; display: flex; flex-direction: column; gap: 10px; }
.upgrade-f {
  display: flex; align-items: center; gap: 12px; font-size: 14px;
  background: var(--surface); border: 2px solid var(--border); border-radius: 15px; padding: 13px 15px;
}
.upgrade-f .uf-icon {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--bg);
}
.upgrade-f b { display: block; font-size: 14px; }
.upgrade-f .uf-desc { font-size: 12px; color: var(--ink-3); }

/* ============ 会员套餐价格卡 ============ */
.plan-price-title { font-size: 13.5px; font-weight: 800; color: var(--ink-2); margin: 16px 0 10px; text-align: center; }
.plan-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.plan-item {
  position: relative; background: var(--surface); border: 2px solid var(--border);
  border-radius: 15px; padding: 13px 15px; transition: border-color .2s;
}
.plan-item.recommend { border-color: var(--sun, #f5a623); background: linear-gradient(135deg, rgba(245,166,35,.06), transparent 60%); }
.plan-hot {
  position: absolute; top: -9px; right: 14px; font-size: 10.5px; font-weight: 800;
  color: #fff; background: linear-gradient(135deg, #ff9a3c, #f5a623);
  padding: 3px 9px; border-radius: 999px; box-shadow: 0 2px 6px rgba(245,166,35,.35);
}
.plan-top { display: flex; align-items: center; gap: 10px; }
.plan-top b { font-size: 14.5px; }
.plan-top .plan-grade { font-size: 11.5px; color: var(--ink-3); margin-left: 6px; }
.plan-emoji {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.plan-price { display: flex; align-items: baseline; gap: 2px; margin: 8px 0 6px 46px; }
.plan-price .p-symbol { font-size: 14px; font-weight: 800; color: var(--primary); }
.plan-price .p-num { font-size: 26px; font-weight: 900; color: var(--primary); line-height: 1; }
.plan-price .p-unit { font-size: 12px; color: var(--ink-3); }
.plan-feat { font-size: 12px; color: var(--ink-2); line-height: 1.9; margin-left: 46px; }

/* ============ ICP ============ */
.icp-footer { text-align: center; padding: 6px 0 calc(100px + env(safe-area-inset-bottom)); position: relative; z-index: 1; }
.icp-footer a { font-size: 11px; color: var(--ink-3); text-decoration: none; }

/* ============ 关于卡 ============ */
.about-card-h5 { text-align: center; padding: 18px; }
.about-text { font-size: 14px; font-weight: 800; }
.about-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

.coze-info { display: flex; gap: 12px; align-items: center; }
.coze-icon {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: var(--mint-soft); display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.coze-title { font-size: 14.5px; font-weight: 700; }
.coze-desc { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* Markdown 简易渲染（AI 回复） */
.bubble-text h1, .bubble-text h2, .bubble-text h3 { font-size: 15px; margin: 8px 0 4px; font-weight: 800; }
.bubble-text ul, .bubble-text ol { margin: 6px 0 6px 20px; }
.bubble-text p { margin: 5px 0; }
.bubble-text strong { font-weight: 800; }

/* 桌面侧栏专用元素：手机端隐藏 */
.side-brand, .side-plan { display: none; }
.tab-bar.is-hidden { display: none; }

/* ============================================================
   桌面端自适应（≥768px）—— 与 H5 同一套代码，PC 打开即为宽屏版
   ============================================================ */
@media (min-width: 768px) {
  body { font-size: 15.5px; }

  #mainContent {
    max-width: 940px;
    padding: 28px 24px 140px;
  }

  /* 顶栏内容居中 */
  #header { padding: 0 max(24px, calc((100vw - 940px) / 2 + 24px)); height: 64px; }
  #headerTitle { font-size: 19px; }

  /* Hero 更舒展 */
  .hero { padding: 32px 36px 30px; border-radius: 32px; margin-bottom: 26px; }
  .hero-greet { font-size: 27px; }
  .hero-sub { font-size: 14px; margin-top: 7px; }
  .hero-meta { margin-top: 18px; gap: 10px; }
  .hero-chip { font-size: 13px; padding: 7px 16px; }
  .hero-deco { width: 152px; height: 152px; right: 34px; bottom: -6px; }
  .hero-sheep { width: 100%; height: 100%; }

  .section-row { margin: 30px 4px 16px; }
  .section-title { font-size: 18px; }
  .section-title::before { height: 19px; }

  /* 学科宫格 4 列 */
  .subject-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .subject-tile { padding: 18px 16px 15px; border-radius: 20px; }
  .subject-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(255,138,92,.28); }
  .tile-icon { width: 46px; height: 46px; font-size: 23px; border-radius: 15px; }
  .tile-name { font-size: 17px; }
  .tile-desc { font-size: 12.5px; }

  .quick-grid { gap: 14px; }
  .quick-item { padding: 18px 6px 15px; border-radius: 20px; }
  .quick-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(255,138,92,.28); }
  .quick-icon { width: 46px; height: 46px; font-size: 22px; border-radius: 16px; margin-bottom: 9px; }
  .quick-label { font-size: 13px; }

  /* 聊天区更宽 */
  .bubble-area { max-width: 68%; }
  .bubble { font-size: 15.5px; padding: 13px 17px; }
  .empty-card { max-width: 552px; padding: 32px 28px; }
  .empty-emoji .sheep { width: 84px; height: 84px; }

  /* 悬浮胶囊 TabBar */
  .tab-bar {
    left: 50%; right: auto; transform: translateX(-50%);
    bottom: 18px; width: calc(100% - 40px); max-width: 560px;
    border: 2px solid var(--border); border-radius: 26px;
    padding: 8px 10px;
    background: rgba(255, 248, 240, .94);
    box-shadow: 0 12px 34px -10px rgba(180,110,60,.22);
  }
  .tab-item { border-radius: 18px; padding: 8px 0 7px; }
  .tab-item:hover { background: rgba(255,233,220,.6); color: var(--primary-deep); }
  .tab-item.active:hover { background: var(--primary-soft); }

  /* 悬浮胶囊输入栏 */
  .input-area {
    left: 50%; right: auto; transform: translateX(-50%);
    bottom: 18px; width: calc(100% - 40px); max-width: 860px;
    border: 2px solid var(--border); border-radius: 26px;
    padding: 10px 14px;
    background: rgba(255, 248, 240, .94);
    box-shadow: 0 12px 34px -10px rgba(180,110,60,.22);
  }
  .input-wrapper { max-width: none; }
  .message-input { min-height: 96px; font-size: 16px; }

  /* 弹层居中 */
  .modal-mask { align-items: center; }
  .modal-sheet {
    border-radius: 26px; max-width: 540px; max-height: 82vh;
    box-shadow: var(--shadow-lg); padding: 26px 24px;
  }
  .login-card { max-width: 400px; padding: 42px 32px; }
  .login-card .empty-emoji .sheep { width: 104px; height: 104px; }

  /* 学情 / 我的 / 教师页 */
  .tabs { max-width: 520px; }
  .kp-section, .wq-card { padding: 18px 20px; }
  .card { padding: 20px; border-radius: 20px; }
  .menu-item:hover { background: var(--bg); }
  .profile-user-card { padding: 22px 22px; }
  .student-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .teacher-hero { padding: 26px 24px; }

  .btn:hover { filter: brightness(1.03); }
  .hint-item:hover { background: var(--primary-soft); border-color: var(--primary); }

  .icp-footer { padding-bottom: 118px; }
}

@media (min-width: 1200px) {
  #mainContent { max-width: 1020px; }
  #header { padding: 0 max(24px, calc((100vw - 1020px) / 2 + 24px)); }
  .subject-grid { gap: 18px; }
}

/* ============================================================
   ≥1024px：左侧固定导航栏（PC 应用式布局）
   ============================================================ */
@media (min-width: 1024px) {
  .tab-bar {
    left: 0; right: auto; top: 0; bottom: 0;
    transform: none;
    width: 236px; height: 100vh;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 6px;
    padding: 24px 14px 18px;
    border: none; border-right: 2px solid var(--border);
    border-radius: 0;
    background: #fffaf4;
    box-shadow: none;
  }
  /* 聊天页也保留侧栏 */
  .tab-bar.is-hidden { display: flex; }

  .side-brand {
    display: flex; align-items: center; gap: 11px;
    padding: 0 8px 18px; margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
  }
  .side-brand-sheep { width: 44px; height: 44px; flex: none; }
  .side-brand-text b { display: block; font-size: 16.5px; font-weight: 800; line-height: 1.25; }
  .side-brand-text span { font-size: 11px; color: var(--ink-3); }

  .tab-item {
    display: flex; align-items: center; gap: 12px;
    text-align: left; padding: 12px 15px; border-radius: 15px;
    font-size: 14.5px; flex: none;
  }
  .tab-item::before { margin: 0; font-size: 21px; }
  .tab-item.active::before { transform: none; }

  .side-plan {
    display: block; margin-top: auto;
    font-size: 11.5px; font-weight: 700; color: var(--ink-3);
    background: var(--surface); border: 1.5px dashed var(--border-strong);
    border-radius: 13px; padding: 10px 12px; text-align: center; line-height: 1.5;
  }

  /* 统一内容列：顶栏 / 主内容 / 输入栏 三者同宽同轴，在侧栏右侧居中 */
  #header {
    margin-left: calc(236px + max(24px, (100vw - 1236px) / 2));
    width: min(1000px, calc(100vw - 284px));
    max-width: none; padding: 0; height: 66px;
  }
  #mainContent {
    margin-left: calc(236px + max(24px, (100vw - 1236px) / 2));
    width: min(1000px, calc(100vw - 284px));
    max-width: none; padding: 28px 0 130px;
  }

  .input-area {
    left: calc(236px + max(24px, (100vw - 1236px) / 2));
    right: auto; width: min(1000px, calc(100vw - 284px)); max-width: none;
    transform: none; bottom: 0;
    border: none; border-top: 2px solid var(--border); border-radius: 0;
    padding: 14px 0 calc(16px + env(safe-area-inset-bottom));
    box-shadow: none;
    background: rgba(255, 248, 240, .96);
  }
  .input-wrapper { max-width: none; margin: 0 auto; }
  .empty-state { justify-content: flex-start; }
  .empty-card { max-width: none; width: calc(100% - 88px); }

  .icp-footer {
    margin-left: calc(236px + max(24px, (100vw - 1236px) / 2));
    width: min(1000px, calc(100vw - 284px)); padding-bottom: 26px;
  }
  .bubble-area { max-width: 62%; }

  .modal-mask { left: 236px; }
}

@media (min-width: 1024px) and (max-height: 640px) {
  .side-brand { padding-bottom: 12px; }
  .tab-item { padding: 9px 14px; }
}

/* ============ 错题拍照上传 ============ */
.upload-entry {
  display: flex; align-items: center; gap: 13px;
  background: linear-gradient(135deg, #ffe9dc, #ffe9f0);
  border: 2px dashed rgba(240,109,59,.35); border-radius: var(--r-md);
  padding: 15px 16px; margin-bottom: 14px; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.upload-entry:active { transform: scale(.98); }
.upload-entry:hover { box-shadow: var(--shadow-md); }
.ue-icon {
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  background: #fff; display: flex; align-items: center; justify-content: center; font-size: 21px;
  box-shadow: 0 3px 10px rgba(240,109,59,.14);
}
.ue-text { flex: 1; }
.ue-text b { display: block; font-size: 15px; font-weight: 800; }
.ue-text span { font-size: 12px; color: var(--ink-2); }
.ue-arrow { font-size: 20px; color: var(--primary); }

.upload-stage {
  margin-top: 18px; border: 2px dashed var(--border-strong);
  border-radius: var(--r-md); background: var(--bg);
  min-height: 170px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; position: relative;
}
.upload-empty { text-align: center; padding: 26px 16px; }
.upload-icon {
  width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-deep);
  display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 300;
}
.upload-tip { font-size: 14px; font-weight: 700; }
.upload-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.upload-preview { width: 100%; max-height: 320px; object-fit: contain; display: block; }

.wq-thumb {
  width: 100%; max-height: 220px; object-fit: cover; border-radius: 13px;
  border: 1.5px solid var(--border); margin-bottom: 10px; display: block; cursor: zoom-in;
  background: var(--bg);
}

.img-viewer {
  position: fixed; inset: 0; z-index: 300; background: rgba(30,20,28,.9);
  display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out;
}
.img-viewer img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* ==================== AI 错题解析新增 ==================== */

.wb-count {
  font-size: 12px;
  color: #b39aa4;
  padding: 4px 4px 10px;
}

.wq-type {
  background: #eef3fb;
  color: #185fa5;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
}

.wq-question {
  white-space: pre-wrap;
  word-break: break-word;
}

.wq-question.wq-pending { color: #b39aa4; }

.wq-analysis-text,
.wq-solve-text {
  display: block;
  margin-top: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
}

.wq-solve {
  background: #eef7f2;
  border-left: 3px solid #1d9e75;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
  color: #1d5c48;
  font-size: 13px;
}

.wq-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #eee;
}

.wq-failed-tip {
  font-size: 12px;
  color: #c0392b;
}

.wq-retry-btn {
  border: 1px solid #d85a30;
  color: #d85a30;
  background: #fff;
  border-radius: 20px;
  padding: 3px 14px;
  font-size: 12px;
}

.wq-done-line { border-top: 1px dashed #eee; }
.wq-done-tip { font-size: 12px; color: #999; }
.wq-retry-minor { color: #888; border-color: #ddd; }

/* 拍照提问按钮：工具条内的胶囊按钮（图标+文字） */
.photo-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border-strong);
  background: #fff7ee; color: var(--ink-2);
  font-size: 13px; font-weight: 700; font-family: var(--font);
  padding: 7px 14px; border-radius: 18px; cursor: pointer; flex: none;
  transition: background .15s, transform .15s;
}
.photo-btn .pb-ico { font-size: 15px; line-height: 1; }
.photo-btn:active { transform: scale(0.94); background: #ffe9d6; }

/* ==================== v5 错题本：双入口 / 选项排版 / 知识点串联 ==================== */
.wb-entries { display: flex; gap: 10px; margin-bottom: 14px; }
.wb-entries-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wb-entry {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 6px;
  border-radius: var(--r-md); cursor: pointer; border: 2px solid transparent; text-align: center;
  transition: transform .15s, box-shadow .15s;
}
.wb-entry:active { transform: scale(.985); }
.wb-entry:hover { box-shadow: var(--shadow-md); }
.wb-entry-scan { background: linear-gradient(135deg, #ffe9dc, #ffe0e8); border-color: rgba(240,109,59,.35); }
.wb-entry-book { background: linear-gradient(135deg, #e3f7ee, #d9f0ff); border-color: rgba(7,160,110,.3); }
.wb-entry-similar { background: linear-gradient(135deg, #f0e9ff, #e3ecff); border-color: rgba(123,97,255,.3); }
.wb-entry-ico {
  width: 44px; height: 44px; flex: none; border-radius: 13px; background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 21px;
  box-shadow: 0 3px 10px rgba(0,0,0,.08);
}
.wb-entry-text { width: 100%; }
.wb-entry-text b { display: block; font-size: 13.5px; font-weight: 800; }
.wb-entry-text span { font-size: 10.5px; color: var(--ink-2); line-height: 1.35; display: block; margin-top: 2px; }
.wb-entry-arrow { font-size: 22px; color: var(--primary); flex: none; }

/* 题干 / 解析里的选项逐行排版 */
.wq-question .wq-option, .wq-analysis-text .wq-option, .wq-solve-text .wq-option {
  display: flex; gap: 9px; align-items: flex-start; margin: 4px 0; font-size: 13.5px; line-height: 1.6;
}
.wq-opt-key {
  flex: none; min-width: 20px; height: 20px; border-radius: 6px; background: var(--primary-soft);
  color: var(--primary-deep); font-weight: 800; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 1px;
}
.wq-opt-body { flex: 1; }
.wq-exam-line { margin: 2px 0; }

/* 解析下方对应知识点（串联知识图谱） */
.wq-kp-block { margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border); }
.wq-kp-label { font-size: 11.5px; color: var(--ink-3); margin-right: 8px; }
.wq-kp-list { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wq-kp-chip {
  display: inline-block; font-size: 12px; color: #0f9d6f; background: #eef7f2;
  border: 1px solid #d5ece1; border-radius: 20px; padding: 3px 11px; cursor: pointer;
}
.wq-kp-chip:active { transform: scale(.95); }

/* PC 中栏错题本双按钮 */
.wb-actions { display: flex; gap: 10px; align-items: center; }
.btn-ghost { background: #fff; color: #0f9d6f; border: 1.5px solid #0f9d6f; }

/* ===== v6: 知识点行 + 出同类型题按钮 + 举一反三视图 + 导出底栏 ===== */
.wq-kp-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border); }
.wq-kp-left { flex: 1; min-width: 0; }
.wq-similar-btn {
  flex: none; white-space: nowrap; font-size: 11.5px; font-weight: 700; color: #6b46ff;
  background: #f2edff; border: 1px solid #ddd2ff; border-radius: 8px; padding: 5px 10px; cursor: pointer;
}
.wq-similar-btn:active { transform: scale(.96); }
.wq-similar-btn:disabled { opacity: .6; cursor: default; }
.wq-similar-inline { margin-top: 10px; }

.wb-export-foot {
  margin: 16px 2px 6px; padding: 13px 15px; border-radius: var(--r-md); cursor: pointer;
  background: linear-gradient(135deg, #e3f7ee, #d9f0ff); border: 1.5px solid rgba(7,160,110,.3);
  font-size: 14px; font-weight: 800; color: #0f9d6f;
}
.wb-export-foot span { display: block; font-size: 11px; font-weight: 400; color: var(--ink-2); margin-top: 3px; }
.wb-export-foot:active { transform: scale(.99); }

.similar-view {
  border: 1.5px solid #ddd2ff; background: #faf8ff; border-radius: var(--r-md);
  padding: 14px; margin-bottom: 16px;
}
.sv-head { display: flex; align-items: center; justify-content: space-between; font-size: 15px; color: #5b3fd6; }
.sv-close { cursor: pointer; color: #99a; font-size: 17px; padding: 0 4px; }
.sv-tip { font-size: 11.5px; color: var(--ink-2); margin: 6px 0 12px; }
.sv-pick { display: flex; flex-direction: column; gap: 7px; }
.sv-pick-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fff;
  border: 1px solid #ebe4ff; border-radius: 9px; cursor: pointer;
}
.sv-pick-item:active { transform: scale(.99); }
.sv-pick-sub { flex: none; font-size: 11px; color: #0f9d6f; background: #eef7f2; border-radius: 6px; padding: 2px 7px; }
.sv-pick-q { flex: 1; min-width: 0; font-size: 12.5px; color: #334; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-pick-go { flex: none; font-size: 11.5px; color: #6b46ff; }
.sv-result { margin-top: 12px; }
.sv-res-title { font-size: 13px; font-weight: 800; color: #0f9d6f; margin: 6px 0 10px; }
.sv-q { background: #fff; border: 1px solid #eef0f2; border-radius: 10px; padding: 12px 14px; margin: 9px 0; }
.sv-q-head { font-size: 12px; font-weight: 800; color: #6b46ff; margin-bottom: 7px; }
.sv-q-body { font-size: 13.5px; line-height: 1.65; }
.sv-q-ans { font-size: 12.5px; color: #0f9d6f; margin-top: 8px; }
.sv-q-ans b { font-weight: 800; }
.sv-q-solve { font-size: 12px; color: #7a8a84; margin-top: 6px; line-height: 1.6; }
.sv-q .wq-option { display: flex; gap: 9px; margin: 3px 0; font-size: 13px; }
.sv-q .wq-opt-key { flex: none; min-width: 19px; height: 19px; border-radius: 6px; background: #f2edff; color: #6b46ff; font-weight: 800; font-size: 11.5px; display: inline-flex; align-items: center; justify-content: center; }

/* ==================== v8 错题本：子视图头 / 筛选 / 举一反三互动答题 ==================== */
.wb-home-tip { font-size: 13px; color: var(--ink-2); line-height: 1.8; background: #fff; border: 1px dashed var(--border-strong); border-radius: 14px; padding: 14px 16px; }
.wb-home-tip b { color: var(--primary); }
.wb-view-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.wb-back { flex: none; font-size: 13.5px; font-weight: 700; color: var(--primary); cursor: pointer; padding: 6px 10px 6px 0; }
.wb-view-title { flex: 1; min-width: 0; }
.wb-view-title b { display: block; font-size: 16px; font-weight: 800; }
.wb-view-title span { font-size: 12px; color: var(--ink-3); }
.wb-export-top { flex: none; font-size: 13px; font-weight: 700; color: #0f9d6f; background: #eef7f2; border: 1.5px solid #bfe6d4; border-radius: 18px; padding: 8px 14px; cursor: pointer; }
.wb-export-top:active { transform: scale(.96); }
.wb-filters { display: flex; gap: 8px; align-items: center; margin: 4px 0 12px; flex-wrap: wrap; }
.wb-filter { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 6px 9px; font-size: 12px; color: var(--ink-2); }
.wb-filter select { border: none; outline: none; font-size: 12.5px; color: var(--ink); background: transparent; max-width: 120px; font-family: var(--font); }
.wb-filter-count { font-size: 12px; color: var(--ink-3); }
/* 互动答题选项 */
.sv-quiz .sv-opts { display: grid; gap: 8px; margin-top: 10px; }
.sv-opt {
  text-align: left; border: 1.5px solid #d9d4ef; background: #faf9ff; border-radius: 12px;
  padding: 10px 13px; font-size: 13.5px; line-height: 1.6; color: var(--ink);
  font-family: var(--font); cursor: pointer; transition: border .15s, background .15s, transform .15s;
}
.sv-opt:active { transform: scale(.985); }
.sv-opt:disabled { cursor: default; opacity: .85; }
.sv-opt.opt-right { border-color: #0f9d6f; background: #ecfaf3; color: #0b7a56; font-weight: 700; }
.sv-opt.opt-wrong { border-color: #d64550; background: #fdf0f1; color: #b03040; }
.sv-feedback { margin-top: 10px; }
.sv-fb { font-size: 14px; font-weight: 800; }
.sv-fb.ok { color: #0f9d6f; }
.sv-fb.no { color: #d64550; }
.sv-fb-analysis { margin-top: 8px; font-size: 13px; color: #5c5470; background: #f6f4fd; border-radius: 10px; padding: 10px 13px; line-height: 1.7; }
/* 举一反三历史分组 */
.sv-group { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.sv-group-src { display: flex; gap: 10px; align-items: flex-start; padding-bottom: 10px; border-bottom: 1px dashed var(--border); margin-bottom: 10px; }
.sv-src-q { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); line-height: 1.7; }
/* 无学段引导 */
.empty-stage-tip { font-size: 13px; color: #8a6d1f; background: #fff8e6; border: 1px solid #f0dfae; border-radius: 10px; padding: 10px 14px; margin: 12px auto 10px; max-width: 320px; }
.empty-stage-btn { margin: 0 auto; }
/* 已识别状态行（无照片版） */
.wq-done-line { opacity: .75; }
.wq-done-tip { font-size: 11.5px; color: var(--ink-3); }

/* ============ 20261130a 个人中心行内编辑 ============ */
.ps-card { display: block; padding: 6px 16px; }
.ps-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
}
.ps-row:last-child { border-bottom: none; }
.ps-row:active { background: rgba(255,138,92,.06); border-radius: 10px; }
.ps-avatar-row .profile-avatar { position: relative; width: 54px; height: 54px; border-radius: 50%; }
.ps-avatar-wrap img { border-radius: 50%; }
.ps-cam {
  position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.16);
  display: flex; align-items: center; justify-content: center; font-size: 11.5px;
}
.ps-row-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ps-row-main b { font-size: 15px; }
.ps-val { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-sub { font-size: 12px; color: var(--ink-3); }
.ps-edit {
  flex: none; font-size: 12.5px; font-weight: 800; color: var(--primary-deep);
  background: #fff; padding: 6px 14px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(240,109,59,.14);
}
.stage-pick-row { display: flex; gap: 10px; margin-top: 4px; }
.stage-pick-btn {
  flex: 1; padding: 13px 0; border-radius: 14px;
  border: 1.5px solid var(--border); background: #fff;
  font-size: 14.5px; font-weight: 800; cursor: pointer;
}
.stage-pick-btn:active { border-color: var(--primary); background: var(--primary-soft); }
.tab-vip {
  font-size: 10px; font-weight: 800; color: #b8860b; background: #fff7df;
  border-radius: 999px; padding: 1.5px 7px; margin-left: 4px; vertical-align: 1px;
}
.vip-tag {
  font-size: 11px; font-weight: 800; color: #b8860b; background: #fff7df;
  border-radius: 999px; padding: 2px 9px; margin-left: 8px; vertical-align: 2px;
}
.vip-tag.locked { color: #8a6d1f; }

/* ============ 20261130b 点亮式知识图谱 ============ */
.ko-head {
  background: linear-gradient(135deg, #eef0ff, #e8faf3);
  border-radius: var(--r-lg); padding: 18px 16px; margin-bottom: 16px;
}
.ko-title { font-size: 17px; font-weight: 800; }
.ko-progress-wrap { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.ko-progress { flex: 1; height: 10px; border-radius: 999px; background: rgba(255,255,255,.7); overflow: hidden; }
.ko-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #34d399, #10b981); transition: width .6s; }
.ko-progress-text { font-size: 12px; font-weight: 800; color: #10b981; flex: none; }
.ko-legend { display: flex; gap: 14px; margin-top: 10px; font-size: 11.5px; color: var(--ink-2); }
.lg-green { color: #10b981; } .lg-orange { color: #f59e0b; } .lg-gray { color: #b0b7c3; }
.ko-hint { margin-top: 8px; font-size: 11.5px; color: var(--ink-3); }
.ko-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.ko-chip {
  padding: 10px 6px; border-radius: 12px; text-align: center;
  font-size: 12.5px; font-weight: 700; cursor: pointer;
  border: 1.5px solid transparent; transition: transform .12s;
}
.ko-chip:active { transform: scale(.94); }
.ko-chip.st-green { background: #e7f9f0; color: #0b8a5f; border-color: #bfe9d7; }
.ko-chip.st-orange { background: #fff4e0; color: #b45309; border-color: #ffdfae; }
.ko-chip.st-gray { background: #f4f5f7; color: #9aa2af; border-color: #e6e9ee; }
.kp-badge {
  display: inline-block; font-size: 12px; font-weight: 800;
  border-radius: 999px; padding: 4px 12px;
}
.kp-badge.badge-green { background: #e7f9f0; color: #0b8a5f; }
.kp-badge.badge-orange { background: #fff4e0; color: #b45309; }
.kp-badge.badge-gray { background: #f4f5f7; color: #9aa2af; }

/* ============ 20261130b 套餐点选 + 资料行卡片 ============ */
.plan-item.plan-pick { cursor: pointer; position: relative; }
.plan-item.plan-pick.selected { border-color: var(--primary); box-shadow: 0 8px 24px -8px rgba(240,109,59,.35); }
.plan-item.plan-pick.selected::after {
  content: '✓ 已选'; position: absolute; top: 10px; right: 12px;
  font-size: 11px; font-weight: 800; color: #fff; background: var(--primary);
  border-radius: 999px; padding: 2px 9px;
}
.ps-rows-card { padding: 4px 16px; margin-bottom: 16px; }

/* ============ 20261130c 全学科图谱 + 标准标签 ============ */
.hidden-file-input {
  display: none !important;
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
}
.ko-subj-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px;
  -webkit-overflow-scrolling: touch;
}
.ko-subj-tab {
  flex: none; padding: 8px 18px; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--border);
  font-size: 14px; font-weight: 700; color: var(--ink-2);
  cursor: pointer; transition: all .15s;
}
.ko-subj-tab.active {
  background: linear-gradient(135deg, #ffb27a, #ff8e6e);
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px -4px rgba(240,109,59,.5);
}
.quick-lock.std {
  font-size: 10px; font-weight: 700; color: #8a94a6;
  background: #f4f5f7; border-radius: 999px; padding: 2px 9px;
  margin-top: 5px;
}
.sv-practice-tag {
  font-size: 10.5px; font-weight: 800; color: #0b8a5f;
  background: #e7f9f0; border-radius: 999px; padding: 2px 9px;
  margin-left: 8px; vertical-align: 1px;
}

/* ============ 20261130d 上传记录 + 加入错题本 + 学科筛选 ============ */
.wb-entries-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.wb-entries-4 .wb-entry { padding: 11px 4px; }
.wb-entries-4 .wb-entry-ico { font-size: 22px; }
.wb-entries-4 .wb-entry-text b { font-size: 12.5px; }
.wb-entries-4 .wb-entry-text span { font-size: 10px; }

/* 答错后「正确答案 + 加入错题本」一行 */
.sv-fb-no-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sv-add-wb {
  flex: none; font-size: 12px; font-weight: 800; font-family: var(--font);
  color: #b45309; background: #fff4e0; border: 1.5px solid #ffdfae;
  border-radius: 999px; padding: 6px 13px; cursor: pointer; transition: all .15s;
}
.sv-add-wb:active { transform: scale(.94); }
.sv-add-wb:disabled { color: #0b8a5f; background: #e7f9f0; border-color: #bfe9d7; cursor: default; }

/* 解析长文本段落排版 */
.wq-analysis-text, .wq-solve-text { word-break: break-word; }
.wq-options-static { margin: 6px 0 2px; }
.wq-options-static .wq-option { font-size: 13px; color: var(--ink-2); }

/* 上传记录视图 */
.ur-card { margin-bottom: 18px; }
.ur-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 8px; }
.ur-date { font-size: 13px; font-weight: 800; color: var(--ink); }
.ur-meta { font-size: 11.5px; color: var(--ink-3); }
.ur-photo-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.ur-photo { width: 132px !important; max-height: 110px !important; flex: none; margin-bottom: 0 !important; }
.ur-summary { flex: 1; background: var(--bg); border-radius: 10px; padding: 8px 11px; }
.ur-q-line { font-size: 12px; color: var(--ink-2); line-height: 1.55; margin: 1px 0; word-break: break-all; }

/* 导出报告学科选择弹层 */
.report-picker { z-index: 320; }
.rp-pick-card {
  width: min(86vw, 340px); background: #fff; border-radius: 18px; padding: 22px 20px 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.rp-pick-title { font-size: 16px; font-weight: 800; color: var(--ink); }
.rp-pick-tip { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.rp-pick-list { margin: 14px 0 4px; max-height: 220px; overflow-y: auto; }
.rp-pick-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 4px;
  font-size: 14px; color: var(--ink); cursor: pointer; border-bottom: 1px solid var(--border);
}
.rp-pick-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.rp-pick-actions { display: flex; gap: 10px; margin-top: 14px; }
.rp-pick-actions .btn { flex: 1; }

/* v20261130e：解析段落排版 + 上传记录照片网格 */
.rp-line { margin: 3px 0; line-height: 1.75; }
.wq-analysis-text, .wq-solve-text { line-height: 1.75; }
.sv-fb-analysis { line-height: 1.75; }
.ur-photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.ur-photo-grid .ur-photo { width: 100% !important; max-height: none !important; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; }
.ur-note { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
