/* ============ 瓯外道童修仙系统 · 水墨国风 ============ */
:root {
  --paper: #f7f3ea;
  --paper-deep: #efe8d8;
  --ink: #292524;
  --ink-soft: #57534e;
  --ink-light: #a8a29e;
  --green: #2B7A5B;
  --green-deep: #23634a;
  --red: #C94A4A;
  --red-deep: #aa3e3e;
  --gold: #B8860B;
  --card: rgba(255, 255, 255, 0.92);
  --line: rgba(41, 37, 36, 0.12);
  --radius: 18px;
  --serif: "Noto Serif SC", "STKaiti", "KaiTi", "SimSun", serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--serif);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}
#ink-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 15% 8%, rgba(43, 122, 91, 0.07), transparent 70%),
    radial-gradient(ellipse 50% 35% at 88% 20%, rgba(41, 37, 36, 0.05), transparent 70%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(201, 74, 74, 0.05), transparent 75%),
    linear-gradient(175deg, #f9f6ee 0%, var(--paper) 45%, var(--paper-deep) 100%);
}
#ink-bg::after {
  content: ""; position: absolute; right: -60px; top: 22%;
  width: 300px; height: 300px; opacity: 0.05;
  background: radial-gradient(circle at 40% 40%, #292524 0 22%, transparent 23%),
    radial-gradient(circle at 62% 58%, #292524 0 14%, transparent 15%);
  filter: blur(2px);
}
#app { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
.page-foot { position: relative; z-index: 1; text-align: center; color: var(--ink-light); font-size: 12px; letter-spacing: 0.4em; padding: 0 0 calc(18px + env(safe-area-inset-bottom)); }

/* ============ 顶栏 ============ */
#topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 243, 234, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: 960px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; gap: 12px;
}
.seal-mini {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px; flex: none;
  background: var(--red); color: #fff; font-size: 18px; font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35), 0 2px 6px rgba(201, 74, 74, 0.35);
  font-family: var(--serif);
}
.tb-realm { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tb-realm-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.tb-realm-text strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-realm-text span { font-size: 11px; color: var(--ink-light); white-space: nowrap; }
.tb-center { flex: 1; min-width: 0; }
.tb-today { font-size: 12px; color: var(--ink-soft); text-align: center; margin-bottom: 3px; }
.tb-today #tb-today-num { color: var(--green); font-size: 14px; font-weight: 700; }
.tb-progress { height: 6px; border-radius: 3px; background: rgba(41, 37, 36, 0.1); overflow: hidden; }
.tb-progress-fill { height: 100%; width: 0%; border-radius: 3px; background: linear-gradient(90deg, var(--green), #3aa577); transition: width 0.4s; }
.tb-game { text-align: right; flex: none; }
.tb-game-label { display: block; font-size: 10px; color: var(--ink-light); }
.tb-game strong { font-size: 13px; color: var(--gold); font-variant-numeric: tabular-nums; }
.btn-tiny {
  display: inline-block; margin-top: 2px; padding: 3px 10px; font-size: 11px;
  border: none; border-radius: 999px; background: var(--gold); color: #fff; cursor: pointer;
  font-family: var(--serif); min-height: 22px;
}

/* ============ 通用组件 ============ */
.page { animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; margin-bottom: 14px;
  font-size: 14px; color: var(--ink-soft); font-family: var(--serif);
  background: rgba(41, 37, 36, 0.06); border: none; border-radius: 12px;
  cursor: pointer; min-height: 44px; transition: background 0.2s;
}
.back-btn:hover { background: rgba(41, 37, 36, 0.12); }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: 0.05em; display: flex; align-items: center; gap: 10px; }
.page-title .seal-mini { width: 30px; height: 30px; font-size: 14px; border-radius: 6px; }
.page-sub { font-size: 13px; color: var(--ink-light); margin-top: 6px; margin-bottom: 20px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
  box-shadow: 0 2px 10px rgba(41, 37, 36, 0.05);
}
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px; padding: 12px 18px;
  font-size: 16px; font-weight: 700; font-family: var(--serif); letter-spacing: 0.08em;
  color: #fff; background: linear-gradient(135deg, var(--green), var(--green-deep));
  border: none; border-radius: 14px; cursor: pointer;
  box-shadow: 0 3px 10px rgba(43, 122, 91, 0.3);
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.red { background: linear-gradient(135deg, var(--red), var(--red-deep)); box-shadow: 0 3px 10px rgba(201, 74, 74, 0.3); }
.btn.gold { background: linear-gradient(135deg, #d4a017, #9c7508); box-shadow: 0 3px 10px rgba(184, 134, 11, 0.3); }
.btn.ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); box-shadow: none; }
.grid-menu { display: grid; grid-template-columns: 1fr; gap: 14px; }
.menu-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 14px; text-align: center;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  cursor: pointer; min-height: 76px; transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.menu-item:active { transform: scale(0.97); }
.menu-item:hover { border-color: var(--green); box-shadow: 0 6px 18px rgba(43, 122, 91, 0.14); }
.menu-item .mi-icon { font-size: 30px; line-height: 1; }
.menu-item .mi-title { font-size: 18px; font-weight: 700; }
.menu-item .mi-sub { font-size: 12px; color: var(--ink-light); line-height: 1.5; }
.menu-item.green { border-color: rgba(43, 122, 91, 0.35); }
.menu-item.red { border-color: rgba(201, 74, 74, 0.35); }
.menu-item.red .mi-title { color: var(--red); }

/* ============ 首页 ============ */
.home-hero { text-align: center; padding: 18px 0 8px; }
.home-hero .hh-ring {
  width: 108px; height: 108px; margin: 0 auto 10px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--realm-color, #718096) calc(var(--pct, 0) * 1%), rgba(41, 37, 36, 0.08) 0);
  position: relative;
}
.home-hero .hh-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--paper); }
.home-hero .hh-realm {
  position: relative; font-size: 30px; font-weight: 800; color: var(--realm-color, #718096);
  font-family: var(--serif); text-shadow: 0 1px 0 #fff;
}
.home-hero h1 { font-size: 20px; margin-top: 4px; }
.home-hero .hh-title { font-size: 13px; color: var(--gold); letter-spacing: 0.2em; }
.home-hero .hh-desc { font-size: 12px; color: var(--ink-light); margin-top: 6px; line-height: 1.6; }
.home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.hs-card { text-align: center; padding: 14px 6px; }
.hs-card .hs-num { font-size: 22px; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; }
.hs-card .hs-label { font-size: 11px; color: var(--ink-light); margin-top: 2px; }
.home-actions { display: grid; gap: 12px; margin-top: 16px; }

/* ============ 答题 ============ */
.quiz-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.qm-position { font-size: 14px; color: var(--ink-soft); }
.qm-position b { color: var(--green); font-size: 18px; }
.grade-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.grade-tabs button {
  flex: none; min-height: 40px; padding: 8px 14px; font-size: 13px; font-family: var(--serif);
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-soft); cursor: pointer;
}
.grade-tabs button.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.qcard { padding: 22px 20px; }
.q-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.q-tag { font-size: 11px; padding: 3px 10px; border-radius: 999px; background: rgba(43, 122, 91, 0.1); color: var(--green); }
.q-tag.chapter { background: rgba(184, 134, 11, 0.1); color: var(--gold); }
.q-text { font-size: 19px; line-height: 1.7; font-weight: 600; }
.q-options { display: grid; gap: 10px; margin-top: 18px; }
.q-opt {
  display: flex; align-items: center; gap: 12px; text-align: left;
  min-height: 50px; padding: 12px 16px; font-size: 16px; font-family: var(--serif);
  background: #fff; border: 2px solid var(--line); border-radius: 14px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s; color: var(--ink); line-height: 1.5;
}
.q-opt:hover { border-color: var(--green); }
.q-opt .opt-key {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(41, 37, 36, 0.07); font-size: 13px; font-weight: 700;
}
.q-opt.right { border-color: var(--green); background: rgba(43, 122, 91, 0.08); }
.q-opt.right .opt-key { background: var(--green); color: #fff; }
.q-opt.wrong { border-color: var(--red); background: rgba(201, 74, 74, 0.08); }
.q-opt.wrong .opt-key { background: var(--red); color: #fff; }
.q-opt:disabled { cursor: default; opacity: 0.85; }
.q-blank-row { display: flex; gap: 10px; margin-top: 18px; }
.q-blank-row input {
  flex: 1; min-height: 50px; padding: 10px 16px; font-size: 17px; font-family: var(--serif);
  border: 2px solid var(--line); border-radius: 14px; outline: none; background: #fff; color: var(--ink);
}
.q-blank-row input:focus { border-color: var(--green); }
.q-feedback { margin-top: 14px; border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.7; display: none; }
.q-feedback.show { display: block; animation: fadeIn 0.25s; }
.q-feedback.ok { background: rgba(43, 122, 91, 0.09); color: var(--green-deep); border: 1px solid rgba(43, 122, 91, 0.25); }
.q-feedback.bad { background: rgba(201, 74, 74, 0.07); color: var(--red-deep); border: 1px solid rgba(201, 74, 74, 0.25); }
.q-actions { display: grid; gap: 10px; margin-top: 16px; }
.q-hint { font-size: 12px; color: var(--ink-light); margin-top: 8px; }

/* ============ 天劫大考 ============ */
.exam-timer {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; margin-bottom: 12px; border-radius: 14px;
  background: rgba(201, 74, 74, 0.08); border: 1px solid rgba(201, 74, 74, 0.3);
  font-size: 20px; font-weight: 800; color: var(--red); font-variant-numeric: tabular-nums;
}
.exam-timer.danger { animation: pulse 1s infinite; }
@keyframes pulse { 50% { background: rgba(201, 74, 74, 0.2); } }
.paper-item { display: flex; flex-direction: column; gap: 10px; padding: 18px; cursor: pointer; }
.paper-item:hover { border-color: var(--green); box-shadow: 0 6px 18px rgba(43, 122, 91, 0.12); }
.paper-item .p-title { font-size: 17px; font-weight: 700; }
.paper-item .p-sub { font-size: 12px; color: var(--ink-light); }
.paper-item .p-meta { display: flex; gap: 14px; font-size: 12px; color: var(--ink-soft); flex-wrap: wrap; }
.result-hero { text-align: center; padding: 26px 18px; }
.result-seal {
  width: 92px; height: 92px; margin: 0 auto 12px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  background: var(--seal, var(--red)); color: #fff; transform: rotate(-6deg);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.4), 0 6px 16px rgba(41, 37, 36, 0.25);
}
.result-seal b { font-size: 30px; letter-spacing: 0.1em; }
.result-seal span { font-size: 10px; letter-spacing: 0.3em; opacity: 0.9; }
.result-score { font-size: 46px; font-weight: 800; font-variant-numeric: tabular-nums; }
.result-comment { font-size: 14px; color: var(--ink-soft); margin-top: 6px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.rg-item { text-align: center; padding: 12px 6px; }
.rg-item .rg-num { font-size: 20px; font-weight: 800; color: var(--gold); }
.rg-item .rg-label { font-size: 11px; color: var(--ink-light); }
.ana-item { margin-bottom: 12px; }
.ana-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ana-badge { font-size: 11px; padding: 2px 10px; border-radius: 999px; color: #fff; }
.ana-badge.ok { background: var(--green); }
.ana-badge.bad { background: var(--red); }
.ana-q { font-size: 15px; line-height: 1.65; font-weight: 600; }
.ana-line { font-size: 13px; line-height: 1.7; margin-top: 6px; color: var(--ink-soft); }
.ana-line b.good { color: var(--green); }
.ana-line b.bad { color: var(--red); }

/* ============ 心魔录 ============ */
.wrong-item { margin-bottom: 12px; }
.wrong-meta { font-size: 11px; color: var(--ink-light); margin-bottom: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.empty-tip { text-align: center; color: var(--ink-light); padding: 50px 20px; font-size: 14px; line-height: 2; }
.empty-tip .et-icon { font-size: 44px; display: block; margin-bottom: 8px; }

/* ============ 知识卡 ============ */
.kcard { padding: 22px 20px; }
.kcard .kc-chapter { font-size: 11px; color: var(--gold); letter-spacing: 0.2em; margin-bottom: 6px; }
.kcard h3 { font-size: 20px; margin-bottom: 12px; line-height: 1.5; }
.kcard .kc-formula {
  padding: 14px; border-radius: 12px; margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.08), rgba(201, 74, 74, 0.06));
  border: 1px dashed rgba(184, 134, 11, 0.4); font-size: 16px; line-height: 1.8; font-weight: 600;
}
.kcard .kc-kp { margin: 0 0 12px 18px; font-size: 14px; line-height: 1.9; color: var(--ink-soft); }
.kcard .kc-example { background: rgba(43, 122, 91, 0.06); border: 1px solid rgba(43, 122, 91, 0.2); border-radius: 12px; padding: 14px; font-size: 14px; line-height: 1.8; }
.kcard .kc-chant { margin-top: 12px; text-align: center; font-size: 13px; color: var(--gold); letter-spacing: 0.1em; line-height: 1.8; }

/* ============ 弹窗 ============ */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(41, 37, 36, 0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn 0.25s;
}
.modal {
  width: 100%; max-width: 420px; max-height: 84vh; overflow-y: auto;
  background: linear-gradient(170deg, #fdfbf5, var(--paper));
  border: 1px solid rgba(184, 134, 11, 0.35); border-radius: 22px;
  padding: 28px 22px; text-align: center; position: relative;
  box-shadow: 0 20px 60px rgba(41, 37, 36, 0.35);
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
.modal .m-close {
  position: absolute; right: 12px; top: 12px; width: 34px; height: 34px;
  border: none; border-radius: 50%; background: rgba(41, 37, 36, 0.07);
  font-size: 16px; cursor: pointer; color: var(--ink-soft); font-family: var(--serif);
}
.modal h2 { font-size: 22px; margin-bottom: 10px; }
.modal .m-body { font-size: 14px; color: var(--ink-soft); line-height: 1.9; margin-bottom: 18px; }
.modal .m-actions { display: grid; gap: 10px; }
.bless-glow {
  font-size: 52px; margin-bottom: 6px;
  animation: glow 1.6s ease-in-out infinite alternate;
}
@keyframes glow {
  from { filter: drop-shadow(0 0 6px rgba(212, 160, 23, 0.5)); transform: scale(1); }
  to { filter: drop-shadow(0 0 22px rgba(212, 160, 23, 0.95)); transform: scale(1.12); }
}
.bless-reward {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 10px 0 16px; padding: 10px 22px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(212, 160, 23, 0.14), rgba(201, 74, 74, 0.1));
  border: 1px solid rgba(184, 134, 11, 0.4); font-size: 15px; font-weight: 700; color: var(--gold);
}
.realm-up-icon { font-size: 54px; margin-bottom: 8px; animation: rise 0.8s ease; }
@keyframes rise { from { transform: translateY(26px); opacity: 0; } to { transform: none; opacity: 1; } }
.realm-arrow { font-size: 15px; color: var(--ink-light); margin: 8px 0; }
.realm-new { font-size: 26px; font-weight: 800; color: var(--green); }
.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 200;
  padding: 10px 22px; border-radius: 999px; font-size: 14px; color: #fff;
  background: rgba(41, 37, 36, 0.88); box-shadow: 0 6px 20px rgba(41, 37, 36, 0.3);
  animation: fadeIn 0.25s; pointer-events: none; white-space: nowrap; max-width: 90vw;
}

/* ============ 响应式：手机 ============ */
@media (max-width: 640px) {
  .topbar-inner { padding: 6px 10px; gap: 8px; }
  .tb-realm-text span { display: none; }
  .seal-mini { width: 32px; height: 32px; font-size: 15px; }
  #app { padding: 12px 12px calc(28px + env(safe-area-inset-bottom)); }
  .page-title { font-size: 20px; }
  .q-text { font-size: 17px; }
  .home-stats { gap: 8px; }
  .hs-card .hs-num { font-size: 19px; }
  .grid-menu.cols2 { grid-template-columns: 1fr 1fr; }
  .result-score { font-size: 38px; }
}
/* ============ 响应式：平板 ============ */
@media (min-width: 641px) {
  .grid-menu { grid-template-columns: repeat(2, 1fr); }
  .grid-menu.cols3 { grid-template-columns: repeat(3, 1fr); }
  .qcard { padding: 28px 30px; }
  .q-options { grid-template-columns: 1fr 1fr; }
  .exam-paper-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .wrong-list, .ana-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
  .wrong-item, .ana-item { margin-bottom: 0; }
}
@media (min-width: 900px) {
  .grid-menu { grid-template-columns: repeat(2, 1fr); }
  .grid-menu.cols3 { grid-template-columns: repeat(3, 1fr); }
  .home-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
}
.hidden { display: none !important; }

/* ============ 小榉 · 学校形象代言人 ============ */
@keyframes xj-bob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-7px) rotate(1.5deg); } }
@keyframes xj-pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.xj-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; text-align: left; }
.xj-avatar { width: 64px; height: 64px; flex: 0 0 64px; object-fit: contain; animation: xj-bob 3.2s ease-in-out infinite; filter: drop-shadow(0 6px 10px rgba(41,37,36,.18)); }
.xj-bubble { position: relative; background: rgba(255,255,255,.95); border: 1.5px solid rgba(184,134,11,.35); border-radius: 14px; padding: 9px 12px; font-size: 13px; line-height: 1.7; color: var(--ink-soft); flex: 1; box-shadow: 0 3px 10px rgba(41,37,36,.06); }
.xj-bubble::before { content: ""; position: absolute; left: -5px; top: 50%; width: 10px; height: 10px; background: rgba(255,255,255,.95); border-left: 1.5px solid rgba(184,134,11,.35); border-bottom: 1.5px solid rgba(184,134,11,.35); transform: translateY(-50%) rotate(45deg); }
.xj-bubble b { color: var(--gold); }
.xj-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; line-height: 1.6; color: var(--ink-soft); animation: xj-pop .3s ease; }
.xj-line img { width: 28px; height: 28px; flex: 0 0 28px; object-fit: contain; animation: xj-bob 3.2s ease-in-out infinite; }

/* ===== 小榉问事台（云端大模型） ===== */
/* 会话卡片做成「一整块对话窗口」：上为对话记录，下为常驻输入区，比例协调、孩子好按 */
.xj-card { padding: 12px; display: flex; flex-direction: column; }
.xj-log { min-height: 210px; max-height: 46vh; overflow-y: auto; padding: 2px 4px 4px 0; }
.xj-msg { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; animation: xj-pop .3s ease; }
.xj-msg.me { flex-direction: row-reverse; }
.xj-msg-av { width: 32px; height: 32px; flex: 0 0 32px; object-fit: contain; animation: xj-bob 3.2s ease-in-out infinite; }
.xj-msg-b { max-width: 82%; font-size: 14px; line-height: 1.8; color: var(--ink-soft); background: #fff; border: 1.5px solid rgba(184,134,11,.3); border-radius: 12px; padding: 9px 12px; white-space: pre-wrap; word-break: break-word; }
.xj-msg.me .xj-msg-b { background: rgba(184,134,11,.1); border-color: rgba(184,134,11,.42); }
.xj-msg-b::after { content: "·小榉"; display: block; text-align: right; font-size: 10.5px; color: var(--ink-light); margin-top: 2px; }
.xj-msg.me .xj-msg-b::after { content: "·道友"; }
/* 输入区：贴着对话记录底边常驻，字号加大、行高放宽，方便孩子打字 */
.xj-quick { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.xj-chip { font-size: 13px; padding: 8px 13px; border-radius: 999px; border: 1.5px solid rgba(184,134,11,.35); background: rgba(184,134,11,.07); color: var(--gold); cursor: pointer; }
.xj-input-row { display: flex; gap: 9px; align-items: flex-end; margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(184,134,11,.32); }
.xj-input { flex: 1; box-sizing: border-box; min-height: 54px; max-height: 170px; resize: none; border: 2px solid rgba(184,134,11,.34); border-radius: 12px; padding: 11px 13px; font-size: 15px; line-height: 1.6; font-family: inherit; color: var(--ink); background: #fff; transition: border-color .18s, box-shadow .18s; }
.xj-input:focus { outline: none; border-color: rgba(184,134,11,.85); box-shadow: 0 0 0 3px rgba(184,134,11,.14); }
.xj-input::placeholder { color: var(--ink-light); font-size: 13.5px; }
.xj-input-row .btn { width: auto; flex: 0 0 auto; min-width: 78px; height: 54px; padding: 0 18px; font-size: 16px; border-radius: 12px; }
.xj-foot { font-size: 11.5px; color: var(--ink-light); margin-top: 9px; line-height: 1.7; }
/* 密钥提示条 + 填密钥弹窗（2026-10-04：Key 只存本机，不进源码） */
.xj-keytip { margin-top: 9px; font-size: 12.5px; line-height: 1.65; color: var(--ink-soft); background: rgba(184,134,11,.08); border: 1px dashed rgba(184,134,11,.38); border-radius: 10px; padding: 8px 11px; }
/* 「已接上云端大模型」的正常态：绿色，别和警告态一样吓人（2026-10-05） */
.xj-keytip.ok { color: #2f7d4f; background: rgba(47,125,79,.07); border-color: rgba(47,125,79,.32); }
.xj-mask { position: fixed; inset: 0; background: rgba(41,37,36,.5); display: flex; align-items: center; justify-content: center; z-index: 999; padding: 18px; }
.xj-key-box { width: 100%; max-width: 380px; background: var(--card); border: 2px solid rgba(184,134,11,.45); border-radius: 16px; padding: 16px; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.xj-key-box h4 { margin: 0 0 8px; font-size: 16px; color: var(--ink); }
.xj-key-tip { font-size: 12px; line-height: 1.65; color: var(--ink-soft); margin-bottom: 10px; }
.xj-key-input { width: 100%; box-sizing: border-box; font-size: 14px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-family: inherit; }
.xj-key-input:focus { outline: none; border-color: rgba(184,134,11,.85); }
.xj-key-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.xj-key-row .btn { width: auto; min-width: 72px; height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.xj-avatar-link { cursor: pointer; }
.xj-avatar-link:active { transform: scale(.94); }
.xj-fab { position: fixed; right: 14px; bottom: 58px; z-index: 60; display: flex; align-items: center; gap: 6px; border: 1.5px solid rgba(184,134,11,.45); background: rgba(255,255,255,.96); color: var(--gold); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700; box-shadow: 0 6px 18px rgba(41,37,36,.16); cursor: pointer; }
.xj-fab:active { transform: scale(.95); }
.xj-fab span { letter-spacing: .05em; }

/* 小榉思考中：首字到达前的占位，避免孩子以为卡死 */
.xj-thinking { color: var(--ink-light); }
.xj-thinking::after { content: "·"; animation: xj-ellipsis 1.4s infinite; }
@keyframes xj-ellipsis {
  0%   { content: "·"; }
  25%  { content: "··"; }
  50%  { content: "···"; }
  75%  { content: "····"; }
  100% { content: "·"; }
}
.xj-cost { color: var(--gold); opacity: .8; margin-left: 2px; }
