/* =========================================================
   我们的小日子 · 样式
   两套主题：玉桂狗（云朵系） / Hello Kitty（贴纸系）
   所有图形均为原创 CSS / SVG，不使用官方图片素材
   ========================================================= */

/* ---------- 主题变量 ---------- */
body.theme-cinnamon,
.xp.theme-cinnamon {
  --bg: #fffaf4;
  --bg-soft: #f3faff;
  --card: #ffffff;
  --card-tint: #f2faff;
  --ink: #3d4a5c;
  --ink-soft: #5e6f83;
  --muted: #94a7ba;
  --primary: #6ec1ec;
  --primary-deep: #2e97cc;
  --primary-soft: #ddf1fd;
  --secondary-soft: #ffe6ee;
  --accent: #ffb7c9;
  --border: rgba(110, 193, 236, 0.26);
  --border-strong: rgba(110, 193, 236, 0.45);
  --shadow: 0 16px 34px -18px rgba(74, 158, 205, 0.55);
  --radius: 26px;
  --radius-sm: 16px;
  --tab-active-bg: #6ec1ec;
  --tab-active-ink: #ffffff;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body.theme-kitty,
.xp.theme-kitty {
  --bg: #ffffff;
  --bg-soft: #fff6f8;
  --card: #ffffff;
  --card-tint: #fff6f8;
  --ink: #1d1d1d;
  --ink-soft: #333333;
  --muted: #8b8b8b;
  --primary: #f27d9d;
  --primary-deep: #d8002f;
  --primary-soft: #ffe4ec;
  --secondary-soft: #ffe9f0;
  --accent: #e6003c;
  --border: #1d1d1d;
  --border-strong: #1d1d1d;
  --shadow: 4px 4px 0 rgba(29, 29, 29, 0.16);
  --radius: 18px;
  --radius-sm: 12px;
  --tab-active-bg: #e6003c;
  --tab-active-ink: #ffffff;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body.theme-cinnamon {
  background-image:
    radial-gradient(520px 300px at 8% -8%, #e6f6ff 0%, rgba(230, 246, 255, 0) 70%),
    radial-gradient(460px 260px at 100% 6%, #fff0f4 0%, rgba(255, 240, 244, 0) 70%),
    linear-gradient(180deg, #fffbf6 0%, #f4fbff 55%, #fff8f3 100%);
  background-attachment: fixed;
}

body.theme-kitty {
  background-color: #ffffff;
  background-image:
    repeating-linear-gradient(0deg, rgba(242, 125, 157, 0.085) 0 12px, rgba(255, 255, 255, 0) 12px 24px),
    repeating-linear-gradient(90deg, rgba(242, 125, 157, 0.085) 0 12px, rgba(255, 255, 255, 0) 12px 24px);
  background-attachment: fixed;
}

button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- 装饰层（仅页面，不进入导出） ---------- */
.deco-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.deco-cloud {
  position: absolute;
  background: #eaf7ff;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.85;
}
.deco-cloud::before,
.deco-cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.deco-cloud.c1 { width: 190px; height: 110px; top: 110px; left: -60px; }
.deco-cloud.c1::before { width: 120px; height: 100px; left: 50px; top: -40px; }
.deco-cloud.c1::after { width: 90px; height: 80px; left: 130px; top: -20px; }
.deco-cloud.c2 { width: 150px; height: 90px; top: 46%; right: -50px; }
.deco-cloud.c2::before { width: 90px; height: 80px; left: 20px; top: -34px; }
.deco-cloud.c2::after { width: 70px; height: 60px; left: 92px; top: -10px; }
.deco-cloud.c3 { width: 130px; height: 80px; bottom: 8%; left: -40px; opacity: 0.6; }
.deco-cloud.c3::before { width: 80px; height: 70px; left: 30px; top: -30px; }

.deco-star {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #bfe5fb;
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
  opacity: 0.9;
}
.deco-star.s1 { top: 90px; right: 70px; transform: scale(0.8) rotate(10deg); }
.deco-star.s2 { top: 210px; right: 30px; transform: scale(1.2) rotate(20deg); }

.deco-bow { display: none; }

body.theme-kitty .deco-cloud,
body.theme-kitty .deco-star { display: none; }

body.theme-kitty .deco-bow {
  display: block;
  position: absolute;
  width: 90px;
  height: 54px;
  top: 78px;
  right: 26px;
  opacity: 0.55;
}
body.theme-kitty .deco-bow::before,
body.theme-kitty .deco-bow::after {
  content: "";
  position: absolute;
  width: 44px;
  height: 38px;
  background: #f9a8c0;
  border: 2px solid #e6003c;
  border-radius: 50% 14% 50% 14%;
  top: 6px;
}
body.theme-kitty .deco-bow::before { left: 0; transform: rotate(-14deg); }
body.theme-kitty .deco-bow::after { right: 0; transform: rotate(14deg) scaleX(-1); }

/* ---------- 页面容器 ---------- */
.app {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 18px 16px calc(28px + env(safe-area-inset-bottom));
}

/* ---------- 顶部 ---------- */
.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px 14px;
}

.date-main {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.25;
}
.date-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 2px;
  margin-top: 3px;
}

body.theme-cinnamon .date-main { text-shadow: 0 3px 0 #ffffff; }
body.theme-kitty .date-main {
  text-shadow: 2px 2px 0 #ffe4ec;
  letter-spacing: 0;
}

.theme-switch {
  display: flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  flex-shrink: 0;
  margin-top: 4px;
}
body.theme-kitty .theme-switch { border: 2px solid #1d1d1d; box-shadow: 3px 3px 0 rgba(29, 29, 29, 0.16); }

.theme-opt {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.5px;
  transition: all 0.18s ease;
}
.theme-opt.active {
  background: var(--primary);
  color: #fff;
}
body.theme-kitty .theme-opt.active { background: #e6003c; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px -18px rgba(60, 120, 160, 0.7);
  position: sticky;
  top: 8px;
  z-index: 8;
  backdrop-filter: blur(10px);
}
body.theme-kitty .tabs { background: #fff; border: 2px solid #1d1d1d; box-shadow: 4px 4px 0 rgba(29, 29, 29, 0.14); }

.tab {
  position: relative;
  flex: 1;
  border: 0;
  background: transparent;
  padding: 10px 8px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 1px;
  transition: all 0.18s ease;
}
.tab.active { background: var(--tab-active-bg); color: var(--tab-active-ink); }
.tab-dot {
  display: none;
  position: absolute;
  top: 8px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e6003c;
}
.tab-dot.on { display: block; }
.tab.sunday-hint:not(.active) {
  background: var(--primary-soft);
  color: var(--primary-deep);
}
body.theme-kitty .tab.sunday-hint:not(.active) {
  background: #ffe4ec;
  color: #d8002f;
}
#reviewHero.sunday {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow);
}
body.theme-kitty #reviewHero.sunday {
  border-color: #e6003c;
  box-shadow: 4px 4px 0 rgba(29, 29, 29, 0.14);
}

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-top: 14px;
  box-shadow: var(--shadow);
}
body.theme-kitty .card {
  border: 2px solid #1d1d1d;
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 rgba(29, 29, 29, 0.14);
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.4px;
}
.title-note {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 2px 8px;
  letter-spacing: 0;
}

/* ---------- 今日说明卡 ---------- */
.intro-card { overflow: hidden; }
body.theme-cinnamon .intro-card::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 80px;
  right: -28px;
  top: -28px;
  background: #eaf7ff;
  border-radius: 50%;
  opacity: 0.9;
  z-index: 0;
}
body.theme-cinnamon .intro-card::before {
  content: "";
  position: absolute;
  width: 70px;
  height: 60px;
  right: 42px;
  top: -24px;
  background: #eaf7ff;
  border-radius: 50%;
  z-index: 0;
}
body.theme-kitty .intro-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(242, 125, 157, 0.1) 0 8px, rgba(255, 255, 255, 0) 8px 16px);
  pointer-events: none;
}

.intro-card > * { position: relative; z-index: 1; }

.intro-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.badge-soft {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary-deep);
  background: var(--primary-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
body.theme-kitty .badge-soft { border: 1.5px solid #e6003c; color: #e6003c; background: #fff; }
.intro-week { font-size: 11px; color: var(--muted); }

.intro-line {
  font-size: 20px;
  font-weight: 800;
  margin: 12px 0 6px;
  letter-spacing: 1px;
}
.intro-text {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.agreement {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--card-tint);
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-soft);
  border: 1px dashed var(--border-strong);
}
body.theme-kitty .agreement { border: 1.5px dashed #e6003c; background: #fff8fa; }
.agreement-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- 每日题目 ---------- */
.qa-list { margin-top: 2px; }
.qa-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 14px;
  box-shadow: var(--shadow);
}
body.theme-kitty .qa-item { border: 2px solid #1d1d1d; box-shadow: 4px 4px 0 rgba(29, 29, 29, 0.14); }

.qa-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.qa-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
}
.qa-tag.near { background: #f7a8c4; }
.qa-tag.see { background: #6ec1ec; }
.qa-tag.talk { background: #f0a45e; }
body.theme-kitty .qa-tag { border: 1.5px solid #1d1d1d; color: #fff; }
body.theme-kitty .qa-tag.near { background: #f27d9d; }
body.theme-kitty .qa-tag.see { background: #4a4a4a; }
body.theme-kitty .qa-tag.talk { background: #e6003c; }

.qa-index {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 1px;
}
.qa-question {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.55;
  margin: 2px 0 10px;
  letter-spacing: 0.3px;
}
.qa-required {
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
  margin-left: auto;
}

/* ---------- 表单 ---------- */
.textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  padding: 11px 12px;
  font-size: 14.5px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  min-height: 74px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.textarea:focus { border-color: var(--primary); background: #fff; }
body.theme-kitty .textarea { border: 2px solid #1d1d1d; background: #fff; border-radius: 12px; }
body.theme-kitty .textarea:focus { border-color: #e6003c; }
.textarea.small { min-height: 62px; font-size: 14px; }

.textline {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14.5px;
  outline: none;
  margin-top: 2px;
}
.textline:focus { border-color: var(--primary); background: #fff; }
body.theme-kitty .textline { border: 2px solid #1d1d1d; border-radius: 999px; background: #fff; }
body.theme-kitty .textline:focus { border-color: #e6003c; }

.select {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
body.theme-kitty .select { border: 2px solid #1d1d1d; background: #fff; }

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 14px 0 6px;
  letter-spacing: 0.5px;
}
.field-label:first-child { margin-top: 0; }

.hint {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.65;
  margin: 10px 0 0;
}

/* ---------- 情绪温度 ---------- */
.mood-row {
  display: flex;
  gap: 8px;
  margin: 8px 0 4px;
}
.mood-btn {
  flex: 1;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 9px 4px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.15s ease;
}
body.theme-kitty .mood-btn { border: 2px solid #1d1d1d; background: #fff; }
.mood-num { font-size: 17px; font-weight: 800; line-height: 1; }
.mood-word { font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.mood-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}
.mood-btn.active .mood-word { color: rgba(255, 255, 255, 0.85); }
body.theme-kitty .mood-btn.active { background: #ffe4ec; border-color: #e6003c; color: #e6003c; }
body.theme-kitty .mood-btn.active .mood-word { color: #d8002f; }

/* ---------- 按钮 ---------- */
.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(46, 151, 204, 0.9);
}
body.theme-kitty .btn.primary { background: #e6003c; box-shadow: 3px 3px 0 rgba(29, 29, 29, 0.2); }
.btn.soft {
  background: var(--primary-soft);
  color: var(--primary-deep);
}
body.theme-kitty .btn.soft { background: #ffe4ec; color: #d8002f; border: 2px solid #1d1d1d; }
.btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--border-strong);
}
body.theme-kitty .btn.ghost { border: 2px solid #1d1d1d; }
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.55; }

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.btn-row .btn { flex: 1; min-width: 130px; }

.action-card #saveBtn { margin-top: 4px; }

.export-box { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }
body.theme-kitty .export-box { border-top: 1.5px dashed #e6003c; }

/* ---------- 分段控件 ---------- */
.seg {
  display: flex;
  gap: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 10px;
}
body.theme-kitty .seg { border: 2px solid #1d1d1d; background: #fff; }
.seg-btn {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 8px 4px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.seg-btn.active { background: var(--primary); color: #fff; }
body.theme-kitty .seg-btn.active { background: #e6003c; }

/* ---------- 确认区 ---------- */
.confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 13.5px;
  border-bottom: 1px dashed var(--border);
}
.confirm-row:last-of-type { border-bottom: 0; }
.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
}
.status-pill.ok { background: var(--primary-soft); color: var(--primary-deep); }
body.theme-kitty .status-pill.ok { background: #ffe4ec; color: #d8002f; border: 1.5px solid #e6003c; }

/* ---------- TA 粘贴区 ---------- */
.ta-card textarea { margin-bottom: 10px; }
.ta-fields { display: none; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }
.ta-fields.show { display: block; }
body.theme-kitty .ta-fields { border-top: 1.5px dashed #e6003c; }

.ta-mini-row { display: flex; gap: 10px; align-items: flex-end; }
.mini-field { width: 120px; flex-shrink: 0; }
.mini-field.grow { flex: 1; width: auto; }

/* ---------- 复盘 ---------- */
.promise-box {
  background: var(--card-tint);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  border: 1px dashed var(--border-strong);
  line-height: 1.65;
}
body.theme-kitty .promise-box { border: 1.5px dashed #e6003c; }

.week-item {
  display: flex;
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--border);
}
.week-item:last-of-type { border-bottom: 0; }
body.theme-kitty .week-item { border-bottom: 1.5px dashed #e6003c; }

.week-item-no {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
body.theme-kitty .week-item-no { background: #ffe4ec; color: #e6003c; border: 1.5px solid #1d1d1d; }
.week-item-body { flex: 1; min-width: 0; }
.week-item-title { font-size: 14.5px; font-weight: 700; line-height: 1.55; }

.sentence-hint {
  margin: 8px 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--primary-deep);
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
}
body.theme-kitty .sentence-hint { background: #fff6f8; color: #d8002f; border: 1.5px dashed #f27d9d; }

.score-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; }
.range { flex: 1; accent-color: var(--primary); height: 22px; }
body.theme-kitty .range { accent-color: #e6003c; }
.score-val { font-size: 21px; font-weight: 800; color: var(--primary-deep); min-width: 24px; text-align: right; }
.score-max { font-size: 12px; color: var(--muted); }

/* ---------- 摘要 / 历史 ---------- */
.digest-list { display: flex; flex-direction: column; gap: 8px; }
.digest-empty {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  padding: 14px 0;
  line-height: 1.8;
}
.digest-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.6;
}
body.theme-kitty .digest-item { background: #fff6f8; border: 1px solid #f3c2d0; }
.digest-date { flex-shrink: 0; font-weight: 700; color: var(--primary-deep); }
.digest-body { flex: 1; min-width: 0; color: var(--ink-soft); }
.digest-temp { font-weight: 700; color: var(--accent); }

.history-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
  border: 1px solid transparent;
}
body.theme-kitty .history-item { background: #fff; border: 1.5px solid #1d1d1d; }
.history-item .sealed {
  font-size: 10.5px;
  color: var(--muted);
  background: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid var(--border);
}
body.theme-kitty .history-item .sealed { border: 1px solid #1d1d1d; }

/* ---------- AI ---------- */
.privacy-note {
  margin-top: 12px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  background: var(--bg-soft);
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}
body.theme-kitty .privacy-note { border-left: 3px solid #e6003c; background: #fff6f8; }

.ai-result-wrap:empty { display: none; }
.ai-card { margin-top: 14px; }
.ai-result .card-title { margin-bottom: 6px; }

.ratio-bar {
  display: flex;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-soft);
  margin: 8px 0 6px;
  border: 1px solid var(--border);
}
body.theme-kitty .ratio-bar { border: 2px solid #1d1d1d; height: 18px; }
.ratio-bar .me { background: var(--primary); }
.ratio-bar .ta { background: var(--accent); }
.ratio-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}
.ai-apology {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  font-size: 13.5px;
  color: var(--primary-deep);
}
body.theme-kitty .ai-apology { background: #ffe4ec; color: #d8002f; border: 1.5px solid #f27d9d; }
.ai-apology b { font-size: 17px; }

.ai-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.75; color: var(--ink-soft); }
.ai-list li { margin-bottom: 4px; }
.ai-section-label { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: 1px; margin-top: 14px; }

.ai-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-soft);
  padding: 18px 4px;
}
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.degrade {
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.degrade-title { font-weight: 800; font-size: 14.5px; color: var(--accent); margin-bottom: 6px; }
.degrade p { font-size: 12.5px; color: var(--ink-soft); line-height: 1.75; margin: 4px 0; }

/* ---------- 页脚 ---------- */
.foot {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 26px 10px 10px;
  line-height: 1.8;
}
.foot-small { margin-top: 4px; letter-spacing: 1px; }

/* ---------- 面板切换 ---------- */
.panel { display: none; }
.panel.active { display: block; animation: fadeUp 0.28s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(24, 34, 45, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal[hidden] { display: none; }
.modal-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 94vh;
  background: var(--card);
  border-radius: 26px 26px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sheetUp 0.28s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

body.theme-kitty .modal-sheet { border: 2px solid #1d1d1d; box-shadow: 0 -4px 0 rgba(29, 29, 29, 0.14); }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
body.theme-kitty .modal-head { border-bottom: 2px solid #1d1d1d; }
.modal-title { font-size: 14.5px; font-weight: 800; }
.modal-close {
  border: 0;
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}
.modal-body {
  overflow: auto;
  padding: 16px 18px;
  background: var(--bg-soft);
  flex: 1;
  -webkit-overflow-scrolling: touch;
  text-align: center;
}
.modal-body img {
  max-width: 100%;
  border-radius: 14px;
  box-shadow: 0 16px 36px -20px rgba(0, 0, 0, 0.6);
  background: #fff;
}
.modal-foot {
  padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
body.theme-kitty .modal-foot { border-top: 2px solid #1d1d1d; }
.save-hint {
  font-size: 12px;
  color: var(--primary-deep);
  text-align: center;
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
body.theme-kitty .save-hint { color: #d8002f; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(16px);
  background: rgba(35, 45, 58, 0.94);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  max-width: 86vw;
  text-align: center;
  line-height: 1.5;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 导出渲染舞台 ---------- */
.stage {
  position: fixed;
  left: -100000px;
  top: 0;
  width: 0;
  height: 0;
  overflow: visible;
  z-index: -1;
  pointer-events: none;
}

/* =========================================================
   导出卡片（.xp）—— 纯内联宽度，不依赖页面宽度
   ========================================================= */
.xp {
  position: relative;
  width: 720px;
  padding: 52px 44px 44px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  box-sizing: border-box;
  overflow: hidden;
  line-height: 1.6;
  letter-spacing: 0.3px;
}
.xp-story {
  width: 750px;
  min-height: 1333px;
  padding: 66px 52px 56px;
}
.xp-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.xp-inner { position: relative; z-index: 2; }

.xp.theme-cinnamon {
  background-image:
    radial-gradient(420px 240px at 100% 0%, #e7f6ff 0%, rgba(231, 246, 255, 0) 72%),
    radial-gradient(360px 220px at 0% 100%, #fff0f4 0%, rgba(255, 240, 244, 0) 72%),
    linear-gradient(180deg, #fffbf6 0%, #f5fbff 55%, #fff8f3 100%);
}
.xp.theme-kitty {
  background-color: #fff;
  background-image:
    repeating-linear-gradient(0deg, rgba(242, 125, 157, 0.09) 0 14px, rgba(255, 255, 255, 0) 14px 28px),
    repeating-linear-gradient(90deg, rgba(242, 125, 157, 0.09) 0 14px, rgba(255, 255, 255, 0) 14px 28px);
}

.xp-cloud { position: absolute; }
.xp-star { position: absolute; }
.xp-gingham-strip {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 26px;
  background-color: #fff;
  background-image:
    repeating-linear-gradient(90deg, rgba(230, 0, 60, 0.22) 0 14px, rgba(255, 255, 255, 0) 14px 28px),
    repeating-linear-gradient(0deg, rgba(230, 0, 60, 0.22) 0 14px, rgba(255, 255, 255, 0) 14px 28px);
  border-bottom: 2px solid #1d1d1d;
}

/* 导出头部 */
.xp-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--primary-deep);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  margin-bottom: 18px;
}
.xp.theme-kitty .xp-brand {
  background: #fff;
  color: #e6003c;
  border: 2px solid #1d1d1d;
  box-shadow: 3px 3px 0 rgba(29, 29, 29, 0.14);
  letter-spacing: 1px;
}
.xp-brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-deep);
}

.xp-date {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: 1px;
}
.xp.theme-kitty .xp-date { text-shadow: 3px 3px 0 #ffe4ec; }
.xp-date span { font-size: 26px; font-weight: 700; color: var(--muted); margin-left: 6px; }
.xp-sub {
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--muted);
  margin-top: 6px;
}
.xp-rule {
  height: 2px;
  margin: 24px 0 8px;
  background: linear-gradient(90deg, var(--primary-soft), rgba(255, 255, 255, 0));
}
.xp.theme-kitty .xp-rule {
  height: 2px;
  background: #1d1d1d;
}

/* 题目块 */
.xp-q { margin-top: 28px; }
.xp-qhead { display: flex; align-items: flex-start; gap: 10px; }
.xp-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  margin-top: 3px;
}
.xp-tag.near { background: #f7a8c4; }
.xp-tag.see { background: #6ec1ec; }
.xp-tag.talk { background: #f0a45e; }
.xp.theme-kitty .xp-tag { border: 1.5px solid #1d1d1d; }
.xp.theme-kitty .xp-tag.near { background: #f27d9d; }
.xp.theme-kitty .xp-tag.see { background: #4a4a4a; }
.xp.theme-kitty .xp-tag.talk { background: #e6003c; }

.xp-qtext {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  flex: 1;
}
.xp-answers { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }

.xp-msg { display: flex; gap: 10px; align-items: flex-start; }
.xp-msg.mine { flex-direction: row-reverse; }

.xp-avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--primary);
  margin-top: 2px;
}
.xp-msg.ta .xp-avatar { background: #f2a7bf; }
.xp.theme-kitty .xp-avatar {
  border: 2px solid #1d1d1d;
  box-shadow: 2px 2px 0 rgba(29, 29, 29, 0.15);
}
.xp.theme-kitty .xp-msg.ta .xp-avatar { background: #e6003c; }

.xp-bubble {
  position: relative;
  max-width: 545px;
  background: var(--primary-soft);
  border-radius: 18px 18px 18px 6px;
  padding: 11px 15px 12px;
  font-size: 15px;
  line-height: 1.7;
}
.xp-msg.mine .xp-bubble {
  background: var(--primary);
  color: #fff;
  border-radius: 18px 18px 6px 18px;
}
.xp-msg.ta .xp-bubble {
  background: var(--secondary-soft);
  color: var(--ink);
}
.xp.theme-kitty .xp-bubble {
  border: 2px solid #1d1d1d;
  border-radius: 14px 14px 14px 4px;
  background: #fff6f8 !important;
  color: #1d1d1d !important;
  box-shadow: 3px 3px 0 rgba(29, 29, 29, 0.12);
}
.xp.theme-kitty .xp-msg.mine .xp-bubble { background: #ffe4ec !important; }

.xp-who {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  opacity: 0.72;
  margin-bottom: 2px;
}
.xp-atext { white-space: pre-wrap; word-break: break-word; }
.xp-empty { color: var(--muted); font-size: 13px; }
.xp-msg.mine .xp-empty { color: rgba(255, 255, 255, 0.75); }
.xp.theme-kitty .xp-empty { color: #999; font-size: 13px; }

.xp-meta {
  display: flex;
  gap: 14px;
  margin-top: 32px;
  align-items: stretch;
}
.xp-temp {
  flex: 0 0 190px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.xp.theme-kitty .xp-temp { border: 2px solid #1d1d1d; box-shadow: 3px 3px 0 rgba(29, 29, 29, 0.12); }
.xp-temp-label { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--muted); }
.xp-dots { display: flex; gap: 5px; }
.xp-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #eef4f8;
}
.xp-dot.on { background: var(--primary); }
.xp.theme-kitty .xp-dot { border: 1.5px solid #1d1d1d; background: #fff; }
.xp.theme-kitty .xp-dot.on { background: #e6003c; }
.xp-tempnum { font-size: 15px; font-weight: 800; color: var(--primary-deep); }
.xp-temp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.xp-temp-row + .xp-temp-row { margin-top: 6px; }
.xp-side {
  flex-shrink: 0;
  width: 20px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.xp-wish-line {
  display: flex;
  gap: 8px;
  font-size: 14px;
  line-height: 1.65;
  margin-top: 5px;
  align-items: flex-start;
}
.xp-wish-val { flex: 1; word-break: break-word; }

.xp-wish {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px 18px;
}
.xp.theme-kitty .xp-wish { border: 2px solid #1d1d1d; box-shadow: 3px 3px 0 rgba(29, 29, 29, 0.12); }
.xp-wish-label { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--muted); margin-bottom: 6px; }
.xp-wish-text { font-size: 18px; font-weight: 700; line-height: 1.6; }

.xp-foot {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-strong);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 12px;
  color: var(--muted);
  gap: 16px;
}
.xp.theme-kitty .xp-foot { border-top: 2px solid #1d1d1d; }
.xp-foot-note { font-weight: 700; color: var(--primary-deep); letter-spacing: 1px; }
.xp.theme-kitty .xp-foot-note { color: #d8002f; }
.xp-time { text-align: right; }

/* 9:16 */
.xp-story .xp-date { font-size: 42px; }
.xp-story .xp-q { margin-top: 22px; }
.xp-story .xp-qtext { font-size: 18px; }
.xp-story .xp-bubble { font-size: 14px; padding: 9px 13px; max-width: 570px; }
.xp-story .xp-meta { margin-top: 24px; flex-direction: column; gap: 10px; }
.xp-story .xp-temp { flex: none; padding: 12px 16px; }
.xp-story .xp-wish-line { font-size: 13.5px; }
.xp-story .xp-wish { padding: 13px 16px; }
.xp-story .xp-wish-text { font-size: 17px; }
.xp-story .xp-foot { margin-top: 26px; }

/* 周报 */
.xp-weekly { width: 720px; }
.xp-weekly .xp-date { font-size: 38px; }
.xp-week-block {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px 20px;
}
.xp.theme-kitty .xp-week-block { border: 2px solid #1d1d1d; box-shadow: 3px 3px 0 rgba(29, 29, 29, 0.12); }
.xp-week-title {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.55;
}
.xp-week-no {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.xp.theme-kitty .xp-week-no { background: #ffe4ec; color: #e6003c; border: 1.5px solid #1d1d1d; }
.xp-week-answer {
  margin-top: 10px;
  padding-left: 36px;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.xp-score-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 36px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}
.xp-score-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--primary-deep);
}
.xp-theme-note {
  margin-top: 26px;
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--primary-soft);
  font-size: 13px;
  line-height: 1.7;
  color: var(--primary-deep);
}
.xp.theme-kitty .xp-theme-note { background: #fff6f8; border: 1.5px dashed #e6003c; }

/* ---------- 小屏适配 ---------- */
@media (max-width: 380px) {
  .date-main { font-size: 22px; }
  .theme-opt { padding: 6px 8px; font-size: 10px; }
  .btn-row .btn { min-width: 0; }
  .ta-mini-row { flex-direction: column; align-items: stretch; }
  .mini-field { width: 100%; }
}
