/* ==========================================================================
   刻下 · 暖白金重构版
   结构：全屏骨架 → 三栏 Grid（380 / 300 / 1fr）→ 左输入 / 中痕迹 / 右 A4
   说明：本文件只服务视觉层，不包含任何业务逻辑；原 app.js 未改动。
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. 设计令牌
   -------------------------------------------------------------------------- */
:root {
  --bg-0: #f4eee3;
  --bg-1: #fbf7ef;
  --bg-2: #efe7d8;

  --ink: #3b3025;
  --ink-2: #5b4b39;
  --ink-3: #7c6a53;
  --muted: #a4927b;
  --muted-2: #b8a891;

  --gold: #b3893f;
  --gold-deep: #8a6423;
  --gold-light: #d8b977;
  --gold-pale: #f5e8cb;

  --paper: #fffdf8;
  --panel: rgba(255, 252, 246, 0.84);
  --panel-strong: rgba(255, 253, 248, 0.96);
  --line: rgba(151, 116, 60, 0.14);
  --line-strong: rgba(151, 116, 60, 0.24);

  --danger: #b4552d;
  --success: #7c8a4a;

  --font-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --paper-max-h: calc(100vh - 302px);
  /* 900 高时主输入框 120，1080 高时自然长到 290，填掉高屏左栏的多余空白 */
  --main-input-h: clamp(120px, calc(120px + (100vh - 900px) * 1.2), 290px);
}

/* --------------------------------------------------------------------------
   02. 全局骨架：绝对一屏，不出现页面滚动条
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

html {
  background: var(--bg-0);
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 12% 0%, #fdf9f0 0%, rgba(253, 249, 240, 0) 62%),
    radial-gradient(100% 80% at 90% 16%, #fbf1df 0%, rgba(251, 241, 223, 0) 58%),
    linear-gradient(155deg, #f7f1e6 0%, #f2eadc 52%, #f6efe3 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.01em;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

::selection {
  background: rgba(214, 177, 104, 0.32);
  color: var(--ink);
}

/* 极细暖金滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(179, 137, 63, 0.32) transparent;
}
*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: rgba(179, 137, 63, 0.26);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(179, 137, 63, 0.48);
  background-clip: content-box;
}

/* --------------------------------------------------------------------------
   03. 背景氛围：香槟金 / 暖米白，禁止冷蓝与纯黑
   -------------------------------------------------------------------------- */
.aurora {
  position: fixed;
  inset: -14%;
  z-index: -4;
  pointer-events: none;
  background:
    radial-gradient(52% 46% at 18% 18%, rgba(233, 204, 148, 0.48) 0%, rgba(233, 204, 148, 0) 66%),
    radial-gradient(48% 44% at 84% 12%, rgba(245, 218, 178, 0.40) 0%, rgba(245, 218, 178, 0) 64%),
    radial-gradient(56% 52% at 78% 86%, rgba(228, 183, 115, 0.30) 0%, rgba(228, 183, 115, 0) 68%),
    radial-gradient(42% 40% at 48% 48%, rgba(255, 248, 230, 0.72) 0%, rgba(255, 248, 230, 0) 70%),
    linear-gradient(150deg, #faf5ea 0%, #f3ebdd 54%, #f8f2e7 100%);
  filter: blur(46px);
  animation: auroraDrift 52s ease-in-out infinite alternate;
}

@keyframes auroraDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  55%  { transform: translate3d(-1.4%, 0.9%, 0) scale(1.045); }
  100% { transform: translate3d(1.1%, -1.2%, 0) scale(1.02); }
}

.stars {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  opacity: 0.55;
}

/* 极淡的暖金色点阵，替代旧版科技网格 */
.stars::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(151, 116, 60, 0.12) 0.8px, transparent 0.9px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(72% 66% at 50% 42%, #000 0%, transparent 82%);
  mask-image: radial-gradient(72% 66% at 50% 42%, #000 0%, transparent 82%);
  opacity: 0.7;
}

.aurora-flow {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  filter: blur(70px);
  opacity: 0.55;
}
.aurora-flow .glow {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.aurora-flow .g1 {
  width: 48vw; height: 48vw; left: -12vw; top: -16vw;
  background: radial-gradient(circle, rgba(242, 210, 150, 0.58), rgba(242, 210, 150, 0) 68%);
  animation: glowOne 38s ease-in-out infinite alternate;
}
.aurora-flow .g2 {
  width: 42vw; height: 42vw; right: -10vw; top: 8vh;
  background: radial-gradient(circle, rgba(247, 218, 185, 0.48), rgba(247, 218, 185, 0) 70%);
  animation: glowTwo 46s ease-in-out infinite alternate;
}
.aurora-flow .g3 {
  width: 54vw; height: 54vw; left: 24vw; bottom: -28vw;
  background: radial-gradient(circle, rgba(235, 192, 128, 0.34), rgba(235, 192, 128, 0) 70%);
  animation: glowThree 54s ease-in-out infinite alternate;
}
@keyframes glowOne { to { transform: translate3d(6vw, 3vh, 0) scale(1.08); } }
@keyframes glowTwo { to { transform: translate3d(-5vw, 4vh, 0) scale(1.06); } }
@keyframes glowThree { to { transform: translate3d(3vw, -3vh, 0) scale(1.04); } }

/* --------------------------------------------------------------------------
   04. 开场幕布
   -------------------------------------------------------------------------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(60% 56% at 50% 44%, #fffdf8 0%, rgba(255, 253, 248, 0) 72%),
    linear-gradient(150deg, #fbf6ec 0%, #f0e5d2 100%);
  transition: opacity 0.95s var(--ease-soft), visibility 0.95s;
}
.intro.out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.intro-core {
  text-align: center;
  animation: introRise 1.15s var(--ease-out) both;
}
.intro-seal {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(179, 137, 63, 0.5);
  border-radius: 20px;
  font-family: var(--font-serif);
  font-size: 36px;
  color: var(--gold-deep);
  background: linear-gradient(145deg, rgba(255, 253, 247, 0.9), rgba(246, 233, 206, 0.7));
  box-shadow:
    inset 0 0 24px rgba(179, 137, 63, 0.12),
    0 16px 40px rgba(140, 105, 45, 0.12);
}
.intro-name {
  font-family: var(--font-serif);
  font-size: 21px;
  letter-spacing: 0.34em;
  color: #5b472b;
}
.intro-rule {
  width: 58px;
  height: 1px;
  margin: 20px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.intro-seam {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(179, 137, 63, 0.28), transparent);
  opacity: 0.6;
}
@keyframes introRise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   05. 全屏玻璃主壳
   -------------------------------------------------------------------------- */
.wrap {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  padding: 16px 28px 12px;
}

.card {
  position: relative;
  width: 100%;
  max-width: 1400px !important;
  margin: 0 auto !important;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 12px 26px 0;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255, 253, 247, 0.90) 0%, rgba(252, 246, 236, 0.82) 100%);
  box-shadow:
    0 1px 2px rgba(120, 88, 40, 0.05),
    0 18px 44px rgba(125, 92, 45, 0.10),
    0 48px 110px rgba(125, 92, 45, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(30px) saturate(125%);
  backdrop-filter: blur(30px) saturate(125%);
  overflow: hidden;
}
/* 顶部一线极淡香槟金 */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(179, 137, 63, 0.34), transparent);
  pointer-events: none;
}
.card.blur-hit {
  filter: blur(2.5px);
  transition: filter 0.16s ease;
}

/* --------------------------------------------------------------------------
   06. 头部：标题与胶囊整体靠左，右侧留给萌宠留白
   -------------------------------------------------------------------------- */
.top-bar.hero-head {
  flex: 0 0 72px;
  height: 72px;
  width: 100%;
  max-width: 1400px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 38px;
  padding: 0 20px !important;
  position: relative;
  z-index: 3;
}

.hero-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}
.hero-mark {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 15px;
  border-left: 2px solid rgba(179, 137, 63, 0.42);
}
.hero-eyebrow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.34em;
  color: #a5854e;
  line-height: 1.2;
  white-space: nowrap;
}
.hero-mark h1 {
  margin: 2px 0 1px;
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: 0.12em;
  background: linear-gradient(118deg, #3c3125 0%, #6b5127 54%, #ab8136 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap;
}
.subtitle {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #9c8b74;
  line-height: 1.4;
  white-space: nowrap;
}

/* 模式胶囊：JS 用 offsetLeft 控制 mode-indicator，这里只需保证相对定位 */
.mode-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border: 1px solid rgba(179, 137, 63, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.66);
  box-shadow:
    inset 0 1px 2px rgba(120, 88, 40, 0.04),
    0 8px 20px rgba(120, 88, 40, 0.05);
  isolation: isolate;
}
.mode-indicator {
  position: absolute;
  left: 4px;
  top: 5px;
  bottom: 5px;
  width: 86px;
  z-index: -1;
  border-radius: 999px;
  background: linear-gradient(135deg, #fffdf8 0%, #f6e8c9 58%, #efdcb4 100%);
  box-shadow:
    0 4px 12px rgba(150, 110, 40, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  transition:
    transform 0.46s var(--ease-out),
    width 0.46s var(--ease-out);
}
.mode-pill {
  position: relative;
  z-index: 1;
  height: 44px;
  min-width: 88px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8d7d67;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: color 0.3s ease, font-weight 0.3s ease;
}
.mode-pill:hover { color: #6d5734; }
.mode-pill.active {
  color: #7a5a1e;
  font-weight: 600;
}
.mode-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cdbb9d;
  box-shadow: 0 0 0 3px rgba(205, 187, 157, 0.14);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.mode-pill.active .mode-dot {
  background: #bd9343;
  box-shadow: 0 0 0 3px rgba(189, 147, 67, 0.16);
}

/* --------------------------------------------------------------------------
   07. 三栏 Grid：380 / 300 / 1fr，间距 16；整体收拢到 1400 以内
   -------------------------------------------------------------------------- */
.workspace {
  display: grid;
  width: 100%;
  max-width: 1400px !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
  grid-template-columns: 380px 300px 1fr !important;
  gap: 16px !important;
  height: calc(100vh - 120px);
  min-height: 0;
  align-items: stretch;
}

.col-control,
.col-traces,
.paper-preview {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-lg);
  box-shadow:
    0 1px 2px rgba(120, 88, 40, 0.03),
    0 12px 30px rgba(120, 88, 40, 0.055);
}

/* --------------------------------------------------------------------------
   08. 左列：输入控制台
   -------------------------------------------------------------------------- */
.col-control {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96) 0%, rgba(252, 247, 238, 0.90) 100%);
  border-color: rgba(179, 137, 63, 0.12);
}

.control-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px 6px;
  scrollbar-color: rgba(179, 137, 63, 0.38) transparent;
}
.control-scroll::-webkit-scrollbar { width: 7px; }
.control-scroll::-webkit-scrollbar-thumb {
  background: rgba(179, 137, 63, 0.38);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.control-scroll:hover::-webkit-scrollbar-thumb {
  background: rgba(179, 137, 63, 0.55);
  background-clip: content-box;
}

/* 打卡条 */
.streak-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 8px 13px;
  margin-bottom: 10px;
  border: 1px solid rgba(179, 137, 63, 0.11);
  border-radius: 11px;
  background:
    linear-gradient(120deg, rgba(250, 241, 224, 0.92), rgba(247, 235, 211, 0.72));
  color: #8c7147;
  font-size: 12.5px;
}
.streak-days {
  font-weight: 600;
  color: #89652a;
  white-space: nowrap;
}
.streak-tip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #a38c6b;
  font-size: 11px;
}
.streak-bar.on {
  border-color: rgba(179, 137, 63, 0.22);
  background: linear-gradient(120deg, #fbf1de, #f6e7c8);
}

/* 模式面板堆叠 */
.mode-stack {
  position: relative;
}
.mode-stack > [hidden] {
  display: none !important;
}

.group {
  position: relative;
  padding: 18px 16px 10px;
  border: 1px solid rgba(179, 137, 63, 0.13);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.97) 0%, rgba(253, 248, 239, 0.94) 100%);
  box-shadow:
    0 1px 2px rgba(120, 88, 40, 0.03),
    0 12px 28px rgba(120, 88, 40, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.group-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.group-head label {
  display: block;
  cursor: text;
}
.lb-en {
  display: block;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.30em;
  line-height: 1.25;
  color: #b09058;
}
.lb-cn {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.04em;
  color: #3e3226;
}
.char-count {
  flex: 0 0 auto;
  padding-bottom: 2px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: #b4a28a;
  font-variant-numeric: tabular-nums;
}
.char-count.full { color: var(--danger); }

/* 输入框：大字号、大内边距、暖白底 */
textarea,
input[type="text"] {
  display: block;
  width: 100%;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: #4c3f2f;
  background: #fffdf9;
  border: 1px solid rgba(179, 137, 63, 0.16);
  border-radius: 13px;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(120, 88, 40, 0.035);
  transition:
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    background 0.24s ease;
}
textarea::placeholder,
input[type="text"]::placeholder {
  color: #b9ab97;
  font-size: 15px;
  letter-spacing: 0.01em;
}
textarea:hover,
input[type="text"]:hover {
  border-color: rgba(179, 137, 63, 0.26);
}
textarea:focus,
input[type="text"]:focus {
  background: #fffefa;
  border-color: rgba(179, 137, 63, 0.52);
  box-shadow:
    0 0 0 4px rgba(199, 164, 98, 0.11),
    inset 0 1px 3px rgba(120, 88, 40, 0.03);
}

#wrongInput {
  height: var(--main-input-h);
  min-height: var(--main-input-h);
  padding: 13px 15px;
  resize: none;
}
#diaryInput {
  height: 150px;
  min-height: 150px;
  padding: 13px 15px;
  resize: none;
}
.material-input {
  height: 64px !important;
  min-height: 64px !important;
  padding: 11px 14px !important;
  font-size: 14.5px !important;
  line-height: 1.65 !important;
  resize: none;
}
.diary-panel .field--single {
  margin-top: 12px;
}
.diary-panel input[type="text"] {
  height: 48px;
  padding: 0 14px;
  font-size: 15px;
}

/* 五个字段：第一行三枚短字段，第二行「水平」宽 +「目标」窄 */
.field-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.field {
  min-width: 0;
}
.field:nth-child(1) { grid-column: span 3; }
.field:nth-child(2) { grid-column: span 4; }
.field:nth-child(3) { grid-column: span 5; }
.field:nth-child(4) { grid-column: span 8; }
.field:nth-child(5) { grid-column: span 4; }
.field > label,
.field-label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #8d7b64;
}
.field--single {
  margin-top: 8px;
}

/* 原生 select 的兜底外观（增强脚本失效时也不丑） */
.field select {
  width: 100%;
  height: 50px;
  padding: 0 30px 0 12px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(179, 137, 63, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(45deg, transparent 50%, #ae8d57 50%) calc(100% - 16px) 22px / 5px 5px no-repeat,
    linear-gradient(135deg, #ae8d57 50%, transparent 50%) calc(100% - 11px) 22px / 5px 5px no-repeat,
    #fffdf9;
  color: #4c3f2f;
  font-size: 15px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}
.field select:focus {
  border-color: rgba(179, 137, 63, 0.52);
  box-shadow: 0 0 0 4px rgba(199, 164, 98, 0.11);
}

/* 困境标签 */
.field-block {
  margin-top: 11px;
  min-width: 0;
}
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 31px;
  padding: 0 12px;
  border: 1px solid rgba(179, 137, 63, 0.15);
  border-radius: 999px;
  background: #fbf6ec;
  color: #7e6c54;
  font-size: 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  user-select: none;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.tag:hover {
  background: #fff;
  border-color: rgba(179, 137, 63, 0.3);
  transform: translateY(-1px);
}
.tag.active {
  color: #fffdf7;
  border-color: transparent;
  background: linear-gradient(135deg, #cba75f 0%, #ae8438 100%);
  box-shadow: 0 6px 14px rgba(160, 118, 45, 0.22);
}

/* 思考模式 */
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  padding: 3px 0;
  font-size: 14px;
  color: #6c5a43;
  cursor: pointer;
  user-select: none;
}
.check-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid rgba(179, 137, 63, 0.38);
  border-radius: 5px;
  background: #fffdf9;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.check-row input[type="checkbox"]:checked {
  border-color: transparent;
  background:
    linear-gradient(135deg, #cba75f, #a97f33);
  box-shadow: 0 3px 8px rgba(160, 118, 45, 0.24);
}
.check-row input[type="checkbox"]:checked::after {
  content: "";
  display: block;
  width: 5px;
  height: 9px;
  margin: 2px auto 0;
  border: solid #fffdf7;
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(43deg);
}
.check-note {
  display: inline-block;
  margin-left: 7px;
  font-size: 10.5px;
  color: #ad9b84;
}

/* 提交按钮：固定在左列底部 */
.submit-wrap {
  flex: 0 0 auto;
  padding: 10px 16px 14px;
  background:
    linear-gradient(180deg, rgba(252, 247, 238, 0) 0%, rgba(251, 245, 234, 0.92) 34%, #fbf5ea 100%);
}
#submitBtn {
  position: relative;
  display: block;
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 15px;
  overflow: hidden;
  color: #3d2c0f;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.10em;
  background:
    linear-gradient(135deg, #f7e7bd 0%, #e6c47e 38%, #c99a45 100%);
  box-shadow:
    0 12px 26px rgba(170, 125, 45, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
  transition:
    transform 0.24s var(--ease-out),
    box-shadow 0.24s ease,
    filter 0.24s ease;
}
#submitBtn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.52) 48%, transparent 64%);
  transform: translateX(-130%);
  transition: transform 0.8s var(--ease-out);
  pointer-events: none;
}
#submitBtn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 18px 34px rgba(170, 125, 45, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
#submitBtn:hover::after { transform: translateX(130%); }
#submitBtn:active {
  transform: translateY(0) scale(0.995);
}
#submitBtn[disabled] {
  cursor: wait;
  filter: saturate(0.8);
}
#submitBtn.gold5 {
  animation: goldPulse 5s ease-in-out both;
}
#submitBtn.burst {
  animation: btnBurst 0.5s var(--ease-out) both;
}
@keyframes goldPulse {
  0%, 100% { box-shadow: 0 12px 26px rgba(170, 125, 45, 0.26); }
  20%      { box-shadow: 0 0 0 6px rgba(222, 181, 93, 0.18), 0 18px 40px rgba(190, 145, 55, 0.45); }
  55%      { box-shadow: 0 0 0 3px rgba(222, 181, 93, 0.10), 0 14px 30px rgba(190, 145, 55, 0.30); }
}
@keyframes btnBurst {
  0%   { transform: scale(1, 1); }
  22%  { transform: scale(1.035, 0.94); }
  48%  { transform: scale(0.97, 1.04); }
  72%  { transform: scale(1.015, 0.985); }
  100% { transform: scale(1, 1); }
}

/* --------------------------------------------------------------------------
   09. 定制下拉（JS 只做展示层，值仍写回原生 select）
   -------------------------------------------------------------------------- */
.select-shell {
  position: relative;
  width: 100%;
}
.field select.is-enhanced {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.select-trigger {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid rgba(179, 137, 63, 0.16);
  border-radius: 12px;
  background: #f8f6f1;
  color: #4c3f2f;
  font-size: 15px;
  line-height: 1;
  text-align: left;
  box-shadow: inset 0 1px 3px rgba(120, 88, 40, 0.025);
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}
.select-trigger:hover {
  background: #fffdf9;
  border-color: rgba(179, 137, 63, 0.30);
}
.select-shell.open .select-trigger {
  background: #fffefa;
  border-color: rgba(179, 137, 63, 0.54);
  box-shadow: 0 0 0 4px rgba(199, 164, 98, 0.11);
}
.select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.select-caret {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin: -3px 2px 0 0;
  border-right: 1.5px solid #aa8b58;
  border-bottom: 1.5px solid #aa8b58;
  transform: rotate(45deg);
  transition: transform 0.28s var(--ease-out), border-color 0.2s ease;
}
.select-shell.open .select-caret {
  transform: rotate(225deg);
  margin-top: 3px;
}

.select-menu {
  position: fixed;
  z-index: 400;
  max-height: 296px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid rgba(179, 137, 63, 0.22);
  border-radius: 14px;
  background: rgba(251, 249, 245, 0.98);
  box-shadow:
    0 24px 52px rgba(90, 65, 30, 0.20),
    0 3px 10px rgba(90, 65, 30, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.985);
  transform-origin: top center;
  transition:
    opacity 0.18s ease,
    transform 0.24s var(--ease-out),
    visibility 0.18s;
}
.select-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.select-menu.up {
  transform-origin: bottom center;
  transform: translateY(6px) scale(0.985);
}
.select-menu.up.open {
  transform: translateY(0) scale(1);
}
.select-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #5a4a36;
  font-size: 15px;
  line-height: 1.35;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease;
}
.select-option:hover,
.select-option:focus-visible {
  outline: none;
  background: #f7eedc;
  color: #7c5a1f;
}
.select-option[aria-selected="true"] {
  background: #fbf2df;
  color: #8a6423;
  font-weight: 600;
}
.select-check {
  flex: 0 0 auto;
  opacity: 0;
  color: #b3893f;
  font-size: 12px;
  transform: translateY(-1px);
}
.select-option[aria-selected="true"] .select-check { opacity: 1; }

/* --------------------------------------------------------------------------
   10. 中列：刻下的痕迹
   -------------------------------------------------------------------------- */
.col-traces {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96) 0%, rgba(251, 246, 237, 0.92) 100%);
  border-color: rgba(179, 137, 63, 0.12);
}

.list-title-row {
  flex: 0 0 auto;
  padding: 18px 18px 9px;
}
.list-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: default;
}
.list-title {
  position: relative;
  padding-left: 13px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #3d3125;
  line-height: 1.3;
}
.list-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 17px;
  border-radius: 2px;
  background: linear-gradient(180deg, #d9b66b, #a97f33);
  transform: translateY(-50%);
}
.list-hint {
  flex: 0 0 auto;
  padding: 3px 9px;
  border: 1px solid rgba(179, 137, 63, 0.13);
  border-radius: 999px;
  background: #f8f0e1;
  color: #9b825c;
  font-size: 10.5px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.list-hint.hint-absorbed {
  color: #7d5a1c;
  background: #f6e7c7;
  box-shadow: 0 0 0 3px rgba(214, 177, 104, 0.12);
}
.list-toggle.hint-active .list-title::before {
  animation: hintPulse 1.8s ease-in-out infinite;
}
@keyframes hintPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 177, 104, 0); }
  50%      { box-shadow: 0 0 0 5px rgba(214, 177, 104, 0.14); }
}

.toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 12px;
}
.search-shell {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.search-shell::before {
  content: "⌕";
  position: absolute;
  left: 11px;
  top: 50%;
  z-index: 1;
  color: #b29a77;
  font-size: 17px;
  line-height: 1;
  transform: translateY(-52%);
  pointer-events: none;
}
#searchInput {
  height: 41px;
  padding: 0 12px 0 32px;
  font-size: 13.5px;
  border-radius: 11px;
  border-color: transparent;
  background: #f8f1e4;
  box-shadow: none;
}
#searchInput::placeholder { font-size: 12.5px; }
#searchInput:hover { background: #fbf6ec; border-color: transparent; }
#searchInput:focus {
  background: #fffdf8;
  border-color: rgba(179, 137, 63, 0.36);
  box-shadow: 0 0 0 3px rgba(199, 164, 98, 0.10);
}
.fav-filter {
  flex: 0 0 auto;
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 11px;
  background: #f8f1e4;
  color: #b59a6a;
  font-size: 16px;
  line-height: 1;
  transition:
    color 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
}
.fav-filter:hover {
  color: #a97f33;
  background: #fbf4e7;
  transform: translateY(-1px);
}
.fav-filter.on {
  color: #fffdf7;
  background: linear-gradient(135deg, #d1ad66, #b3893f);
  box-shadow: 0 6px 15px rgba(160, 118, 45, 0.24);
}

.trace-panel {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}
.trace-scroll {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 13px 18px;
}
#recordList {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* 记录卡片 */
.record {
  position: relative;
  flex: 0 0 auto;
  padding: 10px 12px;
  border: 1px solid rgba(179, 137, 63, 0.12);
  border-radius: 13px;
  background: #fffdf9;
  box-shadow: 0 3px 10px rgba(120, 88, 40, 0.035);
  cursor: pointer;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
}
.record:hover {
  background: #fff;
  border-color: rgba(179, 137, 63, 0.28);
  box-shadow: 0 10px 24px rgba(120, 88, 40, 0.09);
  transform: translateY(-1px);
}
.record.active {
  background: linear-gradient(135deg, #fffaf0 0%, #fdf3df 100%);
  border-color: rgba(179, 137, 63, 0.52);
  box-shadow:
    0 9px 22px rgba(150, 110, 40, 0.12),
    inset 3px 0 0 #b3893f;
}
.record.active .wrong { color: #4a3a24; }

.rec-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-bottom: 5px;
}
.rec-star {
  flex: 0 0 auto;
  color: #d9c7a7;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.2s ease;
}
.rec-star:hover { transform: scale(1.12); color: #c39a4b; }
.rec-star.on {
  color: #c08f2e;
  text-shadow: 0 0 10px rgba(192, 143, 46, 0.30);
}
.rec-tag {
  display: none;
}
.rec-head .time {
  margin-left: auto;
  color: #ad9c85;
  font-size: 10.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.rec-status {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  line-height: 1.45;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.rec-status.pending { color: #9c8b76; background: #f5eee2; }
.rec-status.ready { color: #8a6423; background: #fbf0d7; }
.rec-status.printed { color: #6f7c46; background: #f0f1df; }
.rec-status.recorded { color: #8a6423; background: #f8efdd; }
body.mode-diary .record-footer .rec-btn.ai { display: none; }

.record .wrong {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #5a4a36;
  font-size: 15px;
  line-height: 1.62;
  word-break: break-word;
}
.record .attitude {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #a68c68;
  font-size: 10.5px;
}
.record .ai-result { display: none; }
.record-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed rgba(179, 137, 63, 0.14);
}
.rec-btn {
  height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(179, 137, 63, 0.16);
  border-radius: 7px;
  background: transparent;
  color: #94805f;
  font-size: 10.5px;
  line-height: 1;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.rec-btn:hover {
  background: #fff;
  color: #7d5d24;
  border-color: rgba(179, 137, 63, 0.3);
}
.rec-btn.ai {
  color: #936d29;
  background: #fbf3e2;
  border-color: rgba(179, 137, 63, 0.18);
}
.rec-btn.del:hover {
  color: var(--danger);
  border-color: rgba(180, 85, 45, 0.28);
  background: #fff8f4;
}
.rec-btn.is-busy {
  opacity: 0.65;
  cursor: wait;
}

/* 空状态 */
#recordList .empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
  padding: 34px 18px;
  color: #ab9a83;
  font-size: 12.5px;
  line-height: 1.8;
  text-align: center;
}
#recordList .empty::before {
  content: "◇";
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(179, 137, 63, 0.18);
  border-radius: 50%;
  color: #c4a66e;
  font-size: 15px;
  background: #fbf5e9;
}

/* 删除：高度收缩 + 淡出（JS 先锁高，再挂 .card-removing） */
.record.card-removing {
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
  opacity: 0;
  overflow: hidden;
  transform: translateX(20px) scale(0.97);
  transition:
    height 0.4s var(--ease-out),
    opacity 0.26s ease,
    transform 0.32s ease,
    padding 0.4s ease,
    margin 0.4s ease,
    border-width 0.4s ease !important;
}
.record.arrive {
  animation: cardArrive 0.9s var(--ease-spring) both;
}
@keyframes cardArrive {
  0%   { transform: translateY(-10px) scale(0.96); box-shadow: 0 0 0 6px rgba(214, 177, 104, 0.16); }
  50%  { transform: translateY(1px) scale(1.01); }
  100% { transform: translateY(0) scale(1); }
}

/* --------------------------------------------------------------------------
   11. 右列：A4 预览
   -------------------------------------------------------------------------- */
.paper-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 16px 0;
  background:
    radial-gradient(120% 80% at 50% 0%, #f7f2e8 0%, rgba(247, 242, 232, 0) 60%),
    linear-gradient(180deg, #f2ece1 0%, #eee7db 100%);
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 12px 30px rgba(120, 88, 40, 0.05);
}

.paper-toolbar {
  flex: 0 0 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.paper-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #a08a67;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
}
.paper-label i {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c09a4d;
  box-shadow: 0 0 0 4px rgba(192, 154, 77, 0.12);
}
.paper-label-study { display: inline; }
.paper-label-diary { display: none; }
body.mode-diary .paper-label-study { display: none; }
body.mode-diary .paper-label-diary { display: inline; }
.paper-btn,
#tmDiaryPrint {
  flex: 0 0 auto;
  height: 33px;
  padding: 0 13px;
  border: 1px solid rgba(179, 137, 63, 0.20);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.72);
  color: #8b6a2c;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
}
.paper-btn:hover,
#tmDiaryPrint:hover {
  background: #fffdf8;
  border-color: rgba(179, 137, 63, 0.38);
  box-shadow: 0 7px 16px rgba(120, 88, 40, 0.10);
  transform: translateY(-1px);
}
.paper-btn:active,
#tmDiaryPrint:active { transform: translateY(0); }
#tmDiaryPrint { display: none; margin-left: 6px; }

.paper-stage {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  /* A4 的 width:100% 需要一个“高度安全上限”的舞台，否则 900px 高的屏幕里
     600px 宽的纸会长到 848px，直接顶穿预览区。 */
  max-width: min(600px, calc(var(--paper-max-h) * 0.70710678));
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6px 0 120px;
}

/* A4：宽度吃满舞台，但硬上限 600px；比例永远 210:297 */
.a4-paper {
  position: relative;
  width: 100% !important;
  max-width: 600px !important;
  aspect-ratio: 210 / 297 !important;
  margin: 0 auto !important;
  display: flex;
  flex-direction: column;
  padding: 6.2% 6.5% 4.4%;
  border-radius: 2px;
  background:
    linear-gradient(180deg, #fffefb 0%, #fffdf8 100%);
  box-shadow:
    0 1px 1px rgba(90, 65, 30, 0.08),
    0 3px 7px rgba(90, 65, 30, 0.07),
    0 22px 44px rgba(90, 65, 30, 0.16),
    0 48px 90px rgba(90, 65, 30, 0.13);
  overflow: hidden;
}
/* 纸张纤维与顶部烫金线 */
.a4-paper::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(130, 98, 48, 0.035) 0.7px, transparent 0.8px);
  background-size: 4px 4px;
  pointer-events: none;
  opacity: 0.65;
}
.a4-paper::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(179, 137, 63, 0.55), transparent);
  pointer-events: none;
}

.paper-head {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}
.paper-badge {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid rgba(179, 137, 63, 0.22);
  border-radius: 999px;
  background: #fdf7ea;
  color: #a17c39;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.25em;
  line-height: 1.5;
}
.paper-title {
  margin: 9px 0 4px;
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.7vw, 24px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.05em;
  color: #362b20;
}
.paper-meta {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(179, 137, 63, 0.20);
  color: #9d8b73;
  font-size: 10.5px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  word-break: break-word;
}

.paper-body {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  padding-right: 3px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #4a3d2e;
  font-size: 13px;
  line-height: 1.78;
  letter-spacing: 0.01em;
}
.paper-body::-webkit-scrollbar { width: 5px; }
.paper-body::-webkit-scrollbar-thumb {
  background: rgba(179, 137, 63, 0.22);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: content-box;
}
.paper-placeholder {
  margin: auto 0;
  padding: 34px 12px;
  color: #b2a18a;
  font-size: 11.5px;
  line-height: 1.95;
  text-align: center;
}
.paper-body.is-loading .paper-placeholder {
  color: #a17c39;
  animation: paperBreathe 1.8s ease-in-out infinite;
}
@keyframes paperBreathe {
  0%, 100% { opacity: 0.62; }
  50%      { opacity: 1; }
}
.paper-sec {
  margin-bottom: 10px;
}
.paper-sec:last-child { margin-bottom: 0; }
.paper-sec-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  color: #8a6423;
  font-size: 11.8px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.04em;
}
.paper-sec-title::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  background: linear-gradient(135deg, #d3ae62, #a97f33);
  transform: rotate(45deg);
}
.paper-sec-body {
  color: #4a3d2e;
  font-size: 12.9px;
  line-height: 1.78;
  white-space: pre-wrap;
  word-break: break-word;
}
.paper-sec-line {
  position: relative;
  padding-left: 11px;
  color: #4a3d2e;
  font-size: 12.9px;
  line-height: 1.78;
  word-break: break-word;
}
.paper-sec-line::before {
  content: "·";
  position: absolute;
  left: 2px;
  top: 0;
  color: #b3893f;
  font-weight: 700;
}
.paper-sec--draft {
  padding: 8px 10px;
  border-left: 2px solid rgba(179, 137, 63, 0.28);
  border-radius: 0 7px 7px 0;
  background: rgba(249, 241, 225, 0.55);
}
.paper-sec--draft .paper-sec-title { color: #9c845b; }
.paper-sec--ace {
  padding: 8px 10px;
  border: 1px solid rgba(179, 137, 63, 0.20);
  border-radius: 8px;
  background: linear-gradient(135deg, #fdf7e9, #faf0db);
}
.tm-diary-note {
  color: #4a3d2e;
  font-size: 14px;
  line-height: 2;
  white-space: pre-wrap;
  word-break: break-word;
}
.tm-diary-attitude {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(179, 137, 63, 0.22);
  color: #9b7a47;
  font-size: 11.5px;
  line-height: 1.8;
}

.paper-foot {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(179, 137, 63, 0.16);
  color: #ae9d84;
  font-size: 7.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.paper-foot i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #c9b18a;
}
.paper-foot-study {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.paper-foot-diary { display: none; }
body.mode-diary .paper-foot-study { display: none; }
body.mode-diary .paper-foot-diary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* 预览区加载遮罩 / 思考动画 */
.paper-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: inherit;
  background: rgba(249, 243, 232, 0.74);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s ease, visibility 0.32s;
}
.paper-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.po-ring {
  width: 38px;
  height: 38px;
  border: 2px solid rgba(179, 137, 63, 0.18);
  border-top-color: #b3893f;
  border-radius: 50%;
  animation: paperSpin 0.95s linear infinite;
}
@keyframes paperSpin { to { transform: rotate(360deg); } }
.po-text {
  max-width: 80%;
  color: #7f6435;
  font-size: 12.5px;
  line-height: 1.7;
  text-align: center;
}
.po-sub {
  color: #b4a087;
  font-size: 8.5px;
  letter-spacing: 0.30em;
}

/* 记录模式：右列改为日记纸；没有“底牌”可改，隐藏继续修改胶囊，
   并把省下来的底部空间还给纸张，让日记页更大。 */
body.mode-diary { --paper-max-h: calc(100vh - 206px); }
body.mode-diary .refine-bar { display: none; }
body.mode-diary .paper-stage { padding-bottom: 24px; }
body.mode-diary #btnPrint { display: none; }
body.mode-diary .paper-badge { display: none; }
body.mode-diary .paper-title { margin-top: 4px; }
body.mode-diary .paper-foot { opacity: 0.55; }
body.mode-diary .paper-body { font-size: 13px; }
body.mode-diary .paper-placeholder { padding-top: 48px; }
body.mode-diary #diaryInput {
  height: 320px;
  min-height: 320px;
}

/* --------------------------------------------------------------------------
   12. 固定右下角：继续修改大胶囊
   -------------------------------------------------------------------------- */
.refine-bar {
  position: fixed;
  right: max(40px, calc((100vw - 1400px) / 2 + 20px));
  bottom: 40px;
  z-index: 200;
  width: 400px;
  height: 84px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.94) 0%, rgba(250, 243, 230, 0.86) 100%);
  box-shadow:
    0 30px 70px rgba(100, 72, 30, 0.24),
    0 8px 22px rgba(100, 72, 30, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  backdrop-filter: blur(26px) saturate(140%);
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s var(--ease-out);
}
.refine-bar:focus-within {
  border-color: rgba(179, 137, 63, 0.42);
  box-shadow:
    0 32px 76px rgba(100, 72, 30, 0.28),
    0 0 0 4px rgba(199, 164, 98, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.refine-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #f7e8c8 0%, #dfc085 100%);
  color: #7d5a1f;
  font-family: var(--font-serif);
  font-size: 19px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 5px 13px rgba(150, 110, 40, 0.16);
}
.refine-field {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.refine-field label {
  margin-bottom: 2px;
  color: #a18558;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  line-height: 1.2;
}
#refineInput {
  width: 100%;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #4a3c2b;
  font-size: 15px;
  line-height: 1.3;
  outline: none;
}
#refineInput:hover,
#refineInput:focus {
  background: transparent;
  border: 0;
  box-shadow: none;
}
#refineInput::placeholder {
  color: #b5a58d;
  font-size: 12.5px;
}
.btn-refine {
  flex: 0 0 auto;
  min-width: 84px;
  height: 54px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #c9a25a 0%, #a97f33 100%);
  color: #fffaf0;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  box-shadow:
    0 8px 20px rgba(150, 110, 40, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s ease, filter 0.22s ease;
}
.btn-refine:hover {
  transform: translateY(-1px);
  box-shadow:
    0 11px 24px rgba(150, 110, 40, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}
.btn-refine:active { transform: translateY(0) scale(0.99); }
.btn-refine:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

/* --------------------------------------------------------------------------
   13. 小精灵：固定右上角，画稿 100 × 100
   -------------------------------------------------------------------------- */
#mascot {
  position: fixed;
  top: 10px;
  right: 28px;
  z-index: 210;
  width: 100px;
  height: 100px;
  cursor: pointer;
  opacity: 1;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform, opacity;
  filter: drop-shadow(0 10px 18px rgba(120, 88, 40, 0.14));
}
body:not(.intro-done) #mascot { opacity: 0; }
#mascot:focus-visible {
  outline: 1px dashed rgba(179, 137, 63, 0.55);
  outline-offset: 5px;
  border-radius: 50%;
}
#mascot.dragging {
  cursor: grabbing;
  filter: drop-shadow(0 18px 26px rgba(120, 88, 40, 0.24));
}

#mascot .gs-scale {
  position: absolute;
  left: 0;
  top: 0;
  width: 100px;
  height: 100px;
  transform: scale(1);
  transform-origin: 0 0;
}
#mascot .gs-idle,
#mascot .gs-body,
#mascot .gs-inner {
  position: absolute;
  inset: 0;
}
body.intro-done #mascot .gs-idle {
  animation: mascotFloat 4.2s ease-in-out infinite;
  will-change: transform;
}
#mascot .gs-body { transform-origin: 50% 88%; }
#mascot .gs-inner { transform-origin: 50% 78%; will-change: transform; }

/* 兜帽 */
#mascot .gs-hood {
  position: absolute;
  left: 12px;
  top: 4px;
  z-index: 3;
  width: 76px;
  height: 64px;
  border-radius: 50% 50% 44% 44% / 58% 58% 42% 42%;
  background:
    radial-gradient(120% 92% at 50% 8%, #fffaf0 0%, #f5e3c2 46%, #e8ca91 100%);
  box-shadow:
    inset 0 -9px 14px rgba(196, 158, 92, 0.22),
    inset 0 7px 10px rgba(255, 255, 255, 0.96),
    0 0 26px rgba(230, 196, 132, 0.42),
    0 8px 16px rgba(120, 100, 68, 0.12);
}
#mascot .gs-hood::before {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  bottom: 10px;
  left: 4px;
  border-radius: inherit;
  background-image: radial-gradient(circle at 50% 0, rgba(170, 142, 100, 0.15) 0 6px, rgba(170, 142, 100, 0) 7px);
  background-size: 19px 15px;
  background-repeat: repeat-x;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 46%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 46%);
  opacity: 0.7;
  pointer-events: none;
}
#mascot .gs-hood::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 9px;
  width: 24px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0));
  transform: rotate(-20deg);
  pointer-events: none;
}

/* 脸 */
#mascot .gs-face {
  position: absolute;
  left: 17px;
  top: 22px;
  width: 42px;
  height: 34px;
  border-radius: 50% 50% 48% 48% / 44% 44% 56% 56%;
  background: radial-gradient(110% 90% at 50% 4%, #f6ecd9 0%, #fffaf0 54%, #fffdf7 100%);
  box-shadow: inset 0 5px 9px rgba(158, 137, 103, 0.18);
}
#mascot .gs-eye {
  position: absolute;
  top: 13px;
  width: 5px;
  height: 6px;
  border-radius: 50%;
  background: #3f3324;
}
#mascot .gs-eye-l { left: 9px; transform: rotate(-4deg); }
#mascot .gs-eye-r { right: 9px; transform: rotate(4deg); }
#mascot .gs-blush {
  position: absolute;
  top: 21px;
  width: 15px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(244, 150, 116, 0.82) 0%, rgba(248, 173, 140, 0.50) 58%, rgba(255, 190, 160, 0) 100%);
  filter: blur(1.5px);
}
#mascot .gs-blush-l { left: 1px; }
#mascot .gs-blush-r { right: 1px; }

/* 身体与云朵裙摆 */
#mascot .gs-skirt {
  position: absolute;
  left: 8px;
  top: 50px;
  z-index: 2;
  width: 84px;
  height: 46px;
  border-radius: 48% 48% 50% 50% / 32% 32% 68% 68%;
  background: linear-gradient(180deg, #fffaf0 0%, #f7e6c8 48%, #e9ca91 100%);
  box-shadow:
    0 0 24px rgba(230, 192, 128, 0.38),
    0 10px 20px rgba(120, 100, 68, 0.11),
    inset 0 6px 10px rgba(255, 255, 255, 0.82);
}
#mascot .gs-skirt::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(94deg, rgba(168, 145, 108, 0.09) 0 1px, rgba(168, 145, 108, 0) 1px 9px);
  -webkit-mask-image: linear-gradient(180deg, transparent 14%, #000 48%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 14%, #000 48%, #000 100%);
}
#mascot .gs-skirt::after {
  content: "";
  position: absolute;
  left: -7px;
  right: -7px;
  bottom: -9px;
  height: 27px;
  background:
    radial-gradient(circle at 13% 36%, rgba(255, 253, 247, 0.86) 0 9px, rgba(255, 253, 247, 0) 10px),
    radial-gradient(circle at 34% 58%, rgba(255, 253, 247, 0.96) 0 11px, rgba(255, 253, 247, 0) 12px),
    radial-gradient(circle at 52% 26%, rgba(255, 253, 247, 0.74) 0 13px, rgba(255, 253, 247, 0) 14px),
    radial-gradient(circle at 72% 56%, rgba(255, 253, 247, 0.96) 0 11px, rgba(255, 253, 247, 0) 12px),
    radial-gradient(circle at 88% 38%, rgba(255, 253, 247, 0.86) 0 9px, rgba(255, 253, 247, 0) 10px);
  background-repeat: no-repeat;
  pointer-events: none;
}
#mascot .gs-fin {
  position: absolute;
  top: 55px;
  z-index: 2;
  width: 12px;
  height: 17px;
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(255, 253, 247, 0.98), rgba(250, 238, 218, 0.92));
  box-shadow: 0 3px 6px rgba(120, 100, 68, 0.11);
}
#mascot .gs-fin-l { left: 3px; transform: rotate(-16deg); }
#mascot .gs-fin-r { right: 3px; transform: rotate(16deg); }
#mascot .gs-spark {
  position: absolute;
  left: 50%;
  top: -3px;
  z-index: 4;
  font-size: 13px;
  line-height: 1;
  opacity: 0;
  transform: translate(-50%, 0);
  pointer-events: none;
  filter: drop-shadow(0 1px 5px rgba(214, 178, 96, 0.6));
}

/* 入场：只在右上角原地落下 + 轻微回弹，绝不飞越 A4 纸张 */
#mascot.mascot-intro {
  animation: mascotIntro 2.05s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}
@keyframes mascotIntro {
  0%   { opacity: 0; transform: translateY(-34px) scale(0.78); }
  26%  { opacity: 1; transform: translateY(0) scale(1.06, 0.94); }
  46%  { transform: translateY(-3px) scale(0.98, 1.02); }
  64%  { transform: translateY(0) scale(1.025, 0.985); }
  82%  { transform: translateY(-1px) scale(0.995, 1.005); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes mascotFloat {
  0%, 100% { transform: translateY(0) rotate(-1.1deg); }
  50%      { transform: translateY(-6px) rotate(1.1deg); }
}
#mascot.joy .gs-inner { animation: mascotSpin 0.95s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
#mascot.joy .gs-spark { animation: mascotSpark 1s ease-out both; }
@keyframes mascotSpin {
  0%   { transform: rotate(0deg) translateY(0) scale(1); }
  18%  { transform: rotate(-12deg) translateY(-5px) scale(1.06, 0.95); }
  55%  { transform: rotate(190deg) translateY(-9px) scale(1); }
  82%  { transform: rotate(340deg) translateY(0) scale(1.04, 0.96); }
  100% { transform: rotate(360deg) translateY(0) scale(1); }
}
@keyframes mascotSpark {
  0%   { opacity: 0; transform: translate(-50%, 4px) scale(0.6); }
  25%  { opacity: 1; transform: translate(-50%, -6px) scale(1.1); }
  70%  { opacity: 0.9; transform: translate(-50%, -18px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -26px) scale(0.9); }
}
#mascot.cheer .gs-inner { animation: mascotCheer 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
#mascot.cheer .gs-spark {
  font-size: 22px;
  animation: mascotCheerSpark 1.5s ease-out both;
}
@keyframes mascotCheer {
  0%   { transform: translateY(0) scale(1, 1) rotate(0deg); }
  10%  { transform: translateY(3px) scale(1.28, 0.72) rotate(0deg); }
  26%  { transform: translateY(-42px) scale(0.80, 1.22) rotate(-11deg); }
  42%  { transform: translateY(0) scale(1.30, 0.70) rotate(7deg); }
  58%  { transform: translateY(-28px) scale(0.88, 1.14) rotate(11deg); }
  72%  { transform: translateY(0) scale(1.20, 0.84) rotate(-6deg); }
  86%  { transform: translateY(-8px) scale(1.03, 0.97) rotate(2deg); }
  100% { transform: translateY(0) scale(1, 1) rotate(0deg); }
}
@keyframes mascotCheerSpark {
  0%   { opacity: 0; transform: translate(-50%, 6px) scale(0.5) rotate(0deg); }
  22%  { opacity: 1; transform: translate(-50%, -12px) scale(1.3) rotate(16deg); }
  55%  { opacity: 1; transform: translate(-50%, -30px) scale(1.1) rotate(-10deg); }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(0.85) rotate(6deg); }
}
#mascot.dizzy .gs-eye {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #fffdf6 0 42%, #3f3324 43% 100%);
  animation: mascotStarEye 0.7s linear infinite;
}
@keyframes mascotStarEye { to { transform: rotate(360deg); } }
#mascot.dizzy .gs-inner { animation: mascotDizzyJelly 0.42s ease-in-out infinite; }
@keyframes mascotDizzyJelly {
  0%   { transform: translateX(0) rotate(0deg) scale(1, 1); }
  20%  { transform: translateX(-7px) rotate(-7deg) scale(1.10, 0.90); }
  40%  { transform: translateX(6px) rotate(6deg) scale(0.92, 1.08); }
  60%  { transform: translateX(-5px) rotate(-5deg) scale(1.06, 0.94); }
  80%  { transform: translateX(4px) rotate(4deg) scale(0.96, 1.04); }
  100% { transform: translateX(0) rotate(0deg) scale(1, 1); }
}
#mascot.dizzy .gs-spark {
  font-size: 17px;
  opacity: 1;
  animation: mascotDizzySpark 0.9s ease-in-out infinite;
}
@keyframes mascotDizzySpark {
  0%, 100% { transform: translate(-50%, -6px) rotate(-12deg) scale(1); }
  50%      { transform: translate(-50%, -16px) rotate(12deg) scale(1.12); }
}

/* 气泡：挂在萌宠左侧，始终留在头部留白区域 */
#mascotBubble {
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  z-index: 5;
  width: 256px;
  max-height: 94px;
  padding: 10px 13px;
  overflow-y: auto;
  border: 1px solid rgba(179, 137, 63, 0.18);
  border-radius: 13px;
  background: rgba(255, 253, 247, 0.97);
  box-shadow:
    0 14px 34px rgba(100, 72, 30, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #65523b;
  font-size: 12px;
  line-height: 1.65;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-50%) translateX(6px);
  transition:
    opacity 0.26s ease,
    transform 0.32s var(--ease-out),
    visibility 0.26s;
}
#mascotBubble::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-top: 1px solid rgba(179, 137, 63, 0.18);
  border-right: 1px solid rgba(179, 137, 63, 0.18);
  background: #fffdf7;
  transform: translateY(-50%) rotate(45deg);
}
#mascotBubble.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

/* --------------------------------------------------------------------------
   14. 保存反馈：闪光 / 震屏 / 粒子 / 吸入光球 / 飞行卡片
   -------------------------------------------------------------------------- */
#flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 52%, rgba(255, 249, 226, 0.96) 0%, rgba(255, 235, 190, 0.48) 36%, rgba(255, 235, 190, 0) 68%);
}
#flash-overlay.fire {
  animation: flashFire 0.9s ease-out both;
}
@keyframes flashFire {
  0%   { opacity: 0; }
  10%  { opacity: 0.96; }
  100% { opacity: 0; }
}

#particleLayer {
  position: fixed;
  inset: 0;
  z-index: 810;
  overflow: hidden;
  pointer-events: none;
}
.spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--size, 10px);
  height: var(--size, 10px);
  border-radius: 50%;
  background: var(--color, #e2b85c);
  box-shadow: 0 0 10px var(--color, #e2b85c);
  filter: sepia(1) saturate(1.35) hue-rotate(-8deg) brightness(1.04);
  animation: sparkFly var(--dur, 1.5s) cubic-bezier(0.15, 0.7, 0.3, 1) forwards;
  pointer-events: none;
}
@keyframes sparkFly {
  0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px))) scale(0.1); opacity: 0; }
}

body.shake {
  animation: bodyShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes bodyShake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
  40%, 60% { transform: translate3d(3px, 0, 0); }
}

.absorb-orb {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 820;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff8d8 0%, #eccb79 46%, #c4943c 100%);
  box-shadow:
    0 0 16px rgba(224, 178, 82, 0.75),
    0 0 36px rgba(224, 178, 82, 0.35);
  pointer-events: none;
}
.flying-card {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 820;
  max-width: 240px;
  padding: 8px 12px;
  overflow: hidden;
  border: 1px solid rgba(179, 137, 63, 0.26);
  border-radius: 10px;
  background: #fffdf7;
  box-shadow: 0 14px 32px rgba(100, 72, 30, 0.18);
  color: #5c4a34;
  font-size: 11.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  transition:
    transform 0.8s cubic-bezier(0.22, 0.8, 0.3, 1),
    opacity 0.8s ease;
}

/* --------------------------------------------------------------------------
   15. 全息光之信笺
   -------------------------------------------------------------------------- */
.holo-letter {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.42s ease, visibility 0.42s;
}
.holo-letter.show {
  opacity: 1;
  visibility: visible;
}
.holo-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 249, 233, 0.86) 0%, rgba(244, 226, 191, 0.56) 42%, rgba(82, 60, 30, 0.30) 100%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.holo-card {
  position: relative;
  width: min(580px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 32px 36px 26px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 22px;
  background:
    linear-gradient(155deg, rgba(255, 253, 247, 0.98) 0%, rgba(249, 238, 218, 0.96) 100%);
  box-shadow:
    0 34px 90px rgba(80, 55, 20, 0.30),
    0 8px 22px rgba(80, 55, 20, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateY(18px) scale(0.985);
  transition: transform 0.5s var(--ease-out);
}
.holo-letter.show .holo-card { transform: translateY(0) scale(1); }
.holo-eyebrow {
  color: #b19158;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.34em;
}
.holo-title {
  margin-top: 6px;
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0.10em;
  color: #3c3024;
}
.holo-rule {
  width: 42px;
  height: 1px;
  margin: 14px 0 16px;
  background: linear-gradient(90deg, #b3893f, transparent);
}
.holo-text {
  flex: 1 1 auto;
  min-height: 90px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 6px;
  color: #554634;
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: 0.01em;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: pointer;
}
.holo-btn {
  align-self: flex-end;
  flex: 0 0 auto;
  margin-top: 18px;
  height: 42px;
  padding: 0 22px;
  border: 1px solid rgba(179, 137, 63, 0.24);
  border-radius: 999px;
  background: rgba(255, 252, 244, 0.76);
  color: #8d6a2b;
  font-size: 13px;
  letter-spacing: 0.06em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition:
    opacity 0.3s ease,
    transform 0.3s var(--ease-out),
    visibility 0.3s,
    background 0.2s ease;
}
.holo-btn.on {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.holo-btn:hover { background: #fffdf8; }

/* --------------------------------------------------------------------------
   16. 白金盲盒
   -------------------------------------------------------------------------- */
.plat-mask {
  position: fixed;
  inset: 0;
  z-index: 650;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 246, 224, 0.42) 0%, rgba(94, 68, 32, 0.42) 100%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s ease, visibility 0.55s;
}
.plat-mask.on {
  opacity: 1;
  visibility: visible;
}
.plat-flip {
  position: relative;
  width: min(330px, 82vw);
  height: min(430px, 62vh);
  cursor: pointer;
  perspective: 1200px;
}
.plat-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 24px;
  background:
    linear-gradient(155deg, #fffdf8 0%, #f7e9cd 58%, #f1ddb8 100%);
  box-shadow:
    0 32px 80px rgba(70, 48, 18, 0.30),
    0 8px 20px rgba(70, 48, 18, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
  transition: opacity 0.32s ease, transform 0.32s var(--ease-out);
}
.plat-front { transform: scale(1); }
.plat-back {
  opacity: 0;
  transform: scale(0.97);
  background:
    linear-gradient(155deg, #fffdf9 0%, #f8ecd6 100%);
}
.plat-flip.flipped .plat-front { opacity: 0; transform: scale(0.97); }
.plat-flip.flipped .plat-back { opacity: 1; transform: scale(1); }
.plat-label {
  color: #b19158;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.30em;
}
.plat-title {
  padding: 0 24px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-align: center;
  color: #3d3124;
}
.plat-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  color: #a8926e;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-align: center;
}

/* 礼物盒：纯 CSS 线面 */
.gift {
  position: relative;
  width: 132px;
  height: 120px;
}
.gift-body {
  position: absolute;
  left: 16px;
  top: 43px;
  width: 100px;
  height: 70px;
  overflow: hidden;
  border: 1px solid rgba(176, 132, 62, 0.30);
  border-radius: 5px 5px 9px 9px;
  background: linear-gradient(155deg, #fffaf0 0%, #f1d8a5 56%, #dfbd7f 100%);
  box-shadow:
    inset 0 2px 5px rgba(255, 255, 255, 0.86),
    0 12px 24px rgba(150, 110, 40, 0.16);
}
.gift-lid {
  position: absolute;
  left: 8px;
  top: 28px;
  z-index: 2;
  width: 116px;
  height: 24px;
  overflow: hidden;
  border: 1px solid rgba(176, 132, 62, 0.26);
  border-radius: 5px;
  background: linear-gradient(180deg, #fff9ec, #e9cb93);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.9),
    0 5px 10px rgba(150, 110, 40, 0.12);
}
.gift-lid::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 14px;
  background: linear-gradient(90deg, #c8a15a, #dfc084 50%, #b98e43);
  transform: translateX(-50%);
  opacity: 0.9;
}
.gift-bow {
  position: absolute;
  left: 50%;
  top: 2px;
  z-index: 3;
  width: 58px;
  height: 30px;
  background: radial-gradient(circle at 50% 38%, #b98e43 0 4px, transparent 5px);
  transform: translateX(-50%);
}
.gift-bow::before,
.gift-bow::after {
  content: "";
  position: absolute;
  top: 0;
  width: 27px;
  height: 27px;
  border: 2px solid #c59f59;
  border-radius: 56% 44% 52% 48% / 62% 58% 42% 38%;
  background: rgba(255, 248, 231, 0.5);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.8);
}
.gift-bow::before { left: 0; transform: rotate(-20deg); }
.gift-bow::after { right: 0; transform: rotate(20deg) scaleX(-1); }
.gift-ribbon-v {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 4;
  width: 14px;
  height: 100%;
  background: linear-gradient(90deg, #c8a15a, #dfc084 50%, #b98e43);
  transform: translateX(-50%);
  opacity: 0.9;
}
.gift-ribbon-h {
  position: absolute;
  left: 0;
  top: 34px;
  z-index: 4;
  width: 100%;
  height: 13px;
  background: linear-gradient(180deg, #dfc084, #c8a15a 55%, #b98e43);
  opacity: 0.9;
}

.plat-bloom {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 210, 0.92) 0%, rgba(232, 190, 110, 0.36) 42%, rgba(232, 190, 110, 0) 70%);
  opacity: 0;
  transform: scale(0.2);
  pointer-events: none;
}
.plat-bloom.fire { animation: platBloom 1s ease-out both; }
@keyframes platBloom {
  0%   { opacity: 0; transform: scale(0.2); }
  28%  { opacity: 0.95; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.7); }
}
.plat-reveal {
  position: absolute;
  width: min(520px, 86vw);
  padding: 38px 34px 58px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(255, 253, 247, 0.98), rgba(247, 234, 211, 0.97));
  box-shadow:
    0 34px 88px rgba(70, 48, 18, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.97);
  transition:
    opacity 0.45s ease,
    transform 0.55s var(--ease-out),
    visibility 0.45s;
  cursor: pointer;
}
.plat-reveal.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.plat-quote {
  font-family: var(--font-serif);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 600;
  line-height: 1.72;
  letter-spacing: 0.05em;
  color: #3c3022;
}
.plat-author {
  margin-top: 16px;
  color: #a18454;
  font-size: 11.5px;
  letter-spacing: 0.10em;
}
.plat-speck {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  background: #e8c477;
  box-shadow: 0 0 9px rgba(232, 196, 119, 0.9);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.9s cubic-bezier(0.16, 0.7, 0.3, 1),
    opacity 0.9s ease;
}

/* --------------------------------------------------------------------------
   17. 弹窗 / 诊断 / 收藏夹 / 找回箱 / 设置
   -------------------------------------------------------------------------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: rgba(64, 48, 28, 0.30);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: maskFade 0.24s ease both;
}
@keyframes maskFade { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  width: min(600px, 100%);
  max-height: 84vh;
  overflow-y: auto;
  padding: 28px 30px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(255, 253, 248, 0.99) 0%, rgba(250, 241, 227, 0.98) 100%);
  box-shadow:
    0 34px 90px rgba(70, 48, 18, 0.26),
    0 8px 22px rgba(70, 48, 18, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  color: #4c3e2e;
  animation: modalPop 0.36s var(--ease-out) both;
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-box h3 {
  margin-bottom: 10px;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #392e21;
}
.modal-box p {
  margin-bottom: 12px;
  color: #8d7b62;
  font-size: 12.5px;
  line-height: 1.85;
}
.modal-input {
  width: 100%;
  height: 44px;
  margin-top: 8px;
  padding: 0 13px;
  border: 1px solid rgba(179, 137, 63, 0.2);
  border-radius: 10px;
  background: #fffdf9;
  color: #4c3f2f;
  font-size: 14px;
  outline: none;
}
.modal-input:focus {
  border-color: rgba(179, 137, 63, 0.5);
  box-shadow: 0 0 0 3px rgba(199, 164, 98, 0.10);
}
.modal-btn {
  height: 40px;
  padding: 0 17px;
  border: 1px solid rgba(179, 137, 63, 0.18);
  border-radius: 10px;
  background: #fffdf8;
  color: #7d684a;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.modal-btn:hover {
  background: #fff;
  border-color: rgba(179, 137, 63, 0.36);
  transform: translateY(-1px);
}
.modal-btn.modal-confirm {
  border-color: transparent;
  background: linear-gradient(135deg, #cba75f, #a97f33);
  color: #fffaf0;
  box-shadow: 0 6px 14px rgba(150, 110, 40, 0.18);
}
.modal-btn.modal-confirm:hover { background: linear-gradient(135deg, #d2b06a, #b3893f); }
.modal-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.modal-btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}
.modal-fav.on {
  border-color: rgba(179, 137, 63, 0.36);
  background: #fbf1dc;
  color: #8a6423;
}

/* AI 诊断弹窗 */
.ai-modal { max-width: 660px; }
.ai-eyebrow {
  margin-bottom: 7px;
  color: #b19158;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.30em;
}
.ai-modal h3 { margin-bottom: 4px; }
.ai-body {
  max-height: 46vh;
  margin: 12px 0 4px;
  padding-right: 4px;
  overflow-y: auto;
}
.ai-sec {
  margin-bottom: 11px;
  padding: 11px 13px;
  border-left: 2px solid rgba(179, 137, 63, 0.34);
  border-radius: 0 9px 9px 0;
  background: rgba(250, 243, 231, 0.62);
}
.ai-sec-label {
  margin-bottom: 3px;
  color: #9a7430;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.ai-sec-text {
  color: #554634;
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-sec-plain {
  padding: 10px 12px;
  border-left: 0;
  border-radius: 10px;
  background: rgba(250, 243, 231, 0.45);
}
.ai-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}
.ai-meta {
  min-width: 0;
  color: #a69278;
  font-size: 10px;
  line-height: 1.6;
}
.ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}
.ai-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding-top: 11px;
  border-top: 1px dashed rgba(179, 137, 63, 0.18);
  color: #b0a08a;
  font-size: 9.5px;
  letter-spacing: 0.04em;
}
.ai-brand b { color: #9a7c48; font-weight: 600; }
.ai-brand-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c8a45f;
}

/* 收藏夹 */
.fav-modal { max-width: 680px; }
.fav-list {
  max-height: 48vh;
  margin: 14px 0 4px;
  overflow-y: auto;
}
.fav-item {
  padding: 13px 14px;
  margin-bottom: 9px;
  border: 1px solid rgba(179, 137, 63, 0.13);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.7);
}
.fav-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
}
.fav-title {
  color: #6f5528;
  font-size: 12.5px;
  font-weight: 600;
}
.fav-time {
  margin-left: auto;
  color: #b1a18b;
  font-size: 9.5px;
}
.fav-remove {
  padding: 2px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b09b7f;
  font-size: 10px;
}
.fav-remove:hover { color: var(--danger); background: #fff7f2; }
.fav-body {
  color: #5a4a36;
  font-size: 12.5px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
}
.fav-empty {
  padding: 42px 24px;
  border: 1px dashed rgba(179, 137, 63, 0.2);
  border-radius: 12px;
  color: #a99984;
  font-size: 12px;
  line-height: 1.9;
  text-align: center;
}

/* 找回箱 */
.trash-list {
  max-height: 44vh;
  margin: 12px 0 10px;
  overflow-y: auto;
}
.trash-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed rgba(179, 137, 63, 0.14);
}
.trash-main { flex: 1 1 auto; min-width: 0; }
.trash-time {
  color: #ac9b84;
  font-size: 9.5px;
  margin-bottom: 3px;
}
.trash-text {
  color: #5b4b38;
  font-size: 12px;
  line-height: 1.7;
  word-break: break-word;
}
.trash-sub { color: #a38a65; font-size: 10.5px; }
.trash-acts {
  flex: 0 0 auto;
  display: flex;
  gap: 5px;
}
.trash-del:hover {
  color: var(--danger);
  border-color: rgba(180, 85, 45, 0.28);
  background: #fff8f4;
}

/* 设置里的 Key / 兑换码 */
.key-box,
.redeem-box {
  margin-top: 18px;
  padding: 14px 15px;
  border: 1px solid rgba(179, 137, 63, 0.14);
  border-radius: 12px;
  background: rgba(250, 244, 233, 0.58);
}
.key-box-title,
.redeem-title {
  margin-bottom: 4px;
  color: #7f6435;
  font-size: 12.5px;
  font-weight: 600;
}
.key-box-desc {
  margin: 0 !important;
  color: #a08c70 !important;
  font-size: 11px !important;
  line-height: 1.7 !important;
}
.redeem-row {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}
.redeem-row .modal-input { flex: 1 1 auto; margin-top: 0; }

/* --------------------------------------------------------------------------
   18. Toast
   -------------------------------------------------------------------------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  z-index: 900;
  max-width: min(560px, calc(100vw - 48px));
  padding: 11px 20px;
  border: 1px solid rgba(179, 137, 63, 0.26);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.97);
  box-shadow:
    0 18px 40px rgba(100, 72, 30, 0.18),
    0 3px 10px rgba(100, 72, 30, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #5a4630;
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition:
    opacity 0.28s ease,
    transform 0.32s var(--ease-out),
    visibility 0.28s;
}
#toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   19. 打印：只留 A4 / 日记纸
   -------------------------------------------------------------------------- */
#diaryPrint { display: none; }

@media print {
  @page { size: A4; margin: 0; }

  html,
  body {
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }
  body::before,
  body::after,
  .aurora,
  .stars,
  .aurora-flow,
  .intro,
  .refine-bar,
  #mascot,
  #toast,
  #flash-overlay,
  #particleLayer,
  .holo-letter,
  .plat-mask,
  .modal-mask,
  .paper-overlay,
  .paper-toolbar,
  .no-print {
    display: none !important;
  }

  /* 只显示预览纸 */
  body > *:not(.wrap) { display: none !important; }
  body > .wrap { display: block !important; }
  .wrap,
  .card,
  .workspace,
  .paper-preview,
  .paper-stage {
    display: block !important;
    position: static !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    overflow: visible !important;
    transform: none !important;
    filter: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .top-bar,
  .col-control,
  .col-traces {
    display: none !important;
  }
  #a4Paper {
    display: grid !important;
    grid-template-rows: auto minmax(auto, 1fr) auto;
    position: static !important;
    width: 210mm !important;
    max-width: 210mm !important;
    min-height: 297mm;
    height: auto !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    padding: 14mm 15mm 12mm !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    overflow: visible !important;
    color: #1f1a14 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  #a4Paper::before,
  #a4Paper::after { display: none !important; }
  .paper-head,
  .paper-body,
  .paper-foot { position: static !important; }
  .paper-title { color: #1f1a14 !important; font-size: 24pt !important; }
  .paper-badge {
    color: #7b5b1c !important;
    border-color: #c9ad7c !important;
    background: transparent !important;
  }
  .paper-meta { color: #5f5140 !important; border-color: #d8c8b0 !important; font-size: 9pt !important; }
  .paper-body {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    font-size: 10.5pt !important;
    line-height: 1.75 !important;
    color: #1f1a14 !important;
  }
  .paper-sec { break-inside: avoid; }
  .paper-sec-title { color: #6f4d10 !important; font-size: 10.5pt !important; }
  .paper-sec-body,
  .paper-sec-line,
  .tm-diary-note { color: #1f1a14 !important; font-size: 10.5pt !important; }
  .paper-placeholder { color: #666 !important; }
  .paper-foot {
    display: flex !important;
    margin-top: 7mm !important;
    padding-top: 4mm !important;
    border-top: 1px solid #d8c8b0 !important;
    color: #5f5140 !important;
    font-size: 8pt !important;
  }
  .paper-foot i { background: #b39a72 !important; }

  /* 日记打印模式 */
  body.printing-diary > *:not(#diaryPrint) { display: none !important; }
  body.printing-diary {
    display: block !important;
    padding: 0 !important;
    background: #fff !important;
  }
  body.printing-diary #diaryPrint {
    display: block !important;
    position: static !important;
    width: 100% !important;
    padding: 18mm 18mm !important;
    color: #1f1a14 !important;
  }
  #diaryPrint .dp-date {
    padding-bottom: 8mm;
    margin-bottom: 10mm;
    border-bottom: 1px solid #c9bda9;
    font-size: 24pt;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #1f1a14;
  }
  #diaryPrint .dp-note {
    font-size: 13pt;
    line-height: 2.1;
    white-space: pre-wrap;
    word-break: break-word;
    color: #1f1a14;
  }
  #diaryPrint .dp-mood {
    margin-top: 12mm;
    padding-top: 5mm;
    border-top: 1px dashed #c9bda9;
    font-size: 11pt;
    line-height: 1.9;
    color: #3f3528;
  }
}

/* --------------------------------------------------------------------------
   20. 响应式：宽屏严格三栏，窄桌面进入紧凑档
   -------------------------------------------------------------------------- */
@media (max-width: 1280px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .card { padding-left: 20px; padding-right: 20px; }
  .hero-head { gap: 26px; }
  .hero-mark h1 { font-size: 35px; }
  .mode-pill { min-width: 80px; padding: 0 15px; }
}

/* <1200px：栏宽保持 380 / 300，隐藏放不下的预览标题，并把悬浮修改胶囊
   缩到 340px，避免在窄桌面上压住中栏。 */
@media (max-width: 1199px) {
  .paper-label { display: none; }
  .paper-toolbar { justify-content: flex-end; }
  .refine-bar {
    width: 340px;
    right: 20px;
    bottom: 24px;
  }
}

@media (max-width: 1036px) {
  /* 继续修改胶囊是 fixed 的，窄桌面会让它的左端压住中栏底部；
     给列表留出可滚动的安全区，最后几条卡片仍能完整露出来。 */
  .trace-scroll { padding-bottom: 104px; }
  body.mode-diary .trace-scroll { padding-bottom: 18px; }
}

@media (max-width: 1120px) {
  .hero-eyebrow { letter-spacing: 0.22em; }
  .hero-head { gap: 18px; }
  .hero-mark h1 { font-size: 32px; }
  .mode-pill { min-width: 72px; padding: 0 12px; font-size: 13.5px; }
  .paper-label { letter-spacing: 0.12em; }
}

@media (max-height: 800px) {
  #wrongInput { height: 88px; min-height: 88px; }
  .material-input { height: 56px !important; min-height: 56px !important; }
  .group { padding: 14px 14px 12px; }
  .group-head { margin-bottom: 8px; }
  .lb-cn { font-size: 16px; }
  .field-grid { margin-top: 11px; gap: 8px; }
  .field-block { margin-top: 10px; }
  .tag { height: 29px; font-size: 12.5px; }
  .tag-group { margin-top: 6px; gap: 6px; }
  .check-row { margin-top: 8px; }
  .streak-bar { min-height: 34px; margin-bottom: 10px; }
  .submit-wrap { padding-top: 8px; padding-bottom: 12px; }
  #submitBtn { height: 52px; }
  .list-title-row { padding-top: 14px; }
  .paper-title { font-size: 19px; }
  .paper-body { font-size: 11.8px; }
  .paper-sec-body,
  .paper-sec-line { font-size: 11.6px; }
}

@media (max-height: 700px) {
  .hero-eyebrow { display: none; }
  .hero-mark h1 { font-size: 30px; }
  .streak-tip { display: none; }
}

/* --------------------------------------------------------------------------
   21. 无障碍 / 降级
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .aurora,
  .aurora-flow .glow,
  .gs-idle { animation: none !important; }
}

/* 选中标签页时键盘焦点不要难看 */
:focus-visible {
  outline: 1px solid rgba(179, 137, 63, 0.55);
  outline-offset: 3px;
}
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: none;
}

/* 防止 JS 动态插入的旧版残留块破坏布局 */
.trace-mask,
.trace-drawer { display: none !important; }

/* ==========================================================================
   22. 反套路 / 对练入口 / 生成冷却
   ========================================================================== */

.quality-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 9px 2px 0;
  color: #a58b62;
  font-size: 10.5px;
  line-height: 1.45;
  letter-spacing: 0.01em;
}
.quality-spark {
  color: #b3893f;
  font-size: 11px;
  line-height: 1;
}
.quality-line b {
  color: #8a6423;
  font-weight: 600;
}

.coach-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px dashed rgba(179, 137, 63, 0.28);
  border-radius: 14px;
  background:
    radial-gradient(130% 100% at 0% 0%, rgba(255, 253, 247, 0.96), transparent 62%),
    linear-gradient(135deg, rgba(250, 240, 219, 0.82), rgba(247, 234, 209, 0.58));
}
.coach-entry-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.coach-entry-kicker {
  color: #b19158;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  line-height: 1.3;
}
.coach-entry-copy strong {
  color: #4b3b28;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}
.coach-entry-sub {
  color: #a38c6b;
  font-size: 10px;
  line-height: 1.45;
}
.coach-entry-btn {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(179, 137, 63, 0.28);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.78);
  color: #856323;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
.coach-entry-btn:hover {
  background: #fffdf8;
  border-color: rgba(179, 137, 63, 0.46);
  box-shadow: 0 7px 16px rgba(120, 88, 40, 0.10);
  transform: translateY(-1px);
}
.coach-entry-btn:active { transform: translateY(0); }

.submit-hint {
  display: block;
  margin-top: 7px;
  text-align: center;
  color: #ad9b84;
  font-size: 9.5px;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

#submitBtn.is-cooldown {
  filter: saturate(0.58) brightness(1.015);
  cursor: wait;
}
#submitBtn.is-generating {
  cursor: progress;
  animation: submitBreathe 1.6s ease-in-out infinite;
}
@keyframes submitBreathe {
  0%, 100% { box-shadow: 0 12px 26px rgba(170, 125, 45, 0.22); }
  50%      { box-shadow: 0 0 0 5px rgba(222, 181, 93, 0.14), 0 16px 32px rgba(170, 125, 45, 0.32); }
}

/* ==========================================================================
   23. 记录模式：高级羊皮纸手账
   ========================================================================== */

body.mode-diary .diary-panel {
  position: relative;
  padding: 26px 24px 24px;
  border: 1px solid rgba(154, 117, 56, 0.28);
  border-radius: 5px 18px 18px 5px;
  background:
    radial-gradient(120% 80% at 10% 0%, rgba(255, 252, 244, 0.96), transparent 56%),
    repeating-linear-gradient(0deg, rgba(120, 88, 40, 0.018) 0 1px, transparent 1px 4px),
    linear-gradient(145deg, #fbf3e4 0%, #f4e8d3 100%);
  box-shadow:
    0 18px 36px rgba(90, 65, 30, 0.10),
    inset 0 1px 0 rgba(255, 253, 246, 0.96),
    inset 0 0 60px rgba(170, 130, 65, 0.055);
}
body.mode-diary .diary-panel::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: rgba(169, 127, 51, 0.20);
  pointer-events: none;
}
body.mode-diary .diary-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: radial-gradient(rgba(120, 88, 40, 0.05) 0.6px, transparent 0.7px);
  background-size: 5px 5px;
  opacity: 0.32;
  pointer-events: none;
}
body.mode-diary .diary-panel > * {
  position: relative;
  z-index: 1;
}
body.mode-diary .diary-panel .group-head {
  align-items: flex-end;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(169, 127, 51, 0.18);
}
body.mode-diary .diary-panel .lb-en {
  color: #a88345;
  font-size: 8px;
  letter-spacing: 0.44em;
}
body.mode-diary .diary-panel .lb-cn {
  margin-top: 5px;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: #3e3123;
}
body.mode-diary .diary-panel .char-count {
  color: #ac987c;
  font-family: var(--font-serif);
  font-size: 11px;
}
body.mode-diary #diaryInput {
  height: 228px;
  min-height: 228px;
  padding: 6px 4px 2px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 35px,
    rgba(169, 127, 51, 0.15) 35px,
    rgba(169, 127, 51, 0.15) 36px
  );
  background-size: 100% 36px;
  background-position: 0 6px;
  box-shadow: none;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 36px;
  letter-spacing: 0.03em;
  color: #443626;
}
body.mode-diary #diaryInput:focus {
  border: 0;
  background-color: transparent;
  box-shadow: none;
}
body.mode-diary #diaryInput::placeholder {
  font-family: var(--font-serif);
  font-size: 15.5px;
  color: #b3a38c;
  letter-spacing: 0.02em;
}
body.mode-diary .diary-panel .field--single {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(169, 127, 51, 0.16);
}
body.mode-diary .diary-panel .field--single label {
  color: #9c8158;
  font-family: var(--font-serif);
  font-size: 10.5px;
  letter-spacing: 0.16em;
}
body.mode-diary #diaryAttitude {
  height: 38px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(169, 127, 51, 0.28);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: var(--font-serif);
  font-size: 15.5px;
  color: #4a3b2a;
}
body.mode-diary #diaryAttitude:focus {
  box-shadow: none;
  border-bottom-color: rgba(169, 127, 51, 0.55);
}
body.mode-diary #diaryAttitude::placeholder {
  font-family: var(--font-serif);
  color: #b4a58e;
}

body.mode-diary .paper-preview {
  background:
    radial-gradient(100% 70% at 50% 0%, #f7efe1 0%, rgba(247, 239, 225, 0) 64%),
    linear-gradient(180deg, #f0e7d8 0%, #ece2d2 100%);
}
body.mode-diary .a4-paper {
  background: linear-gradient(180deg, #fffaf0 0%, #fbf2e2 100%);
  box-shadow:
    0 1px 1px rgba(90, 65, 30, 0.08),
    0 4px 9px rgba(90, 65, 30, 0.07),
    0 24px 48px rgba(90, 65, 30, 0.16),
    0 52px 96px rgba(90, 65, 30, 0.11);
}
body.mode-diary .paper-badge {
  border-color: rgba(166, 127, 62, 0.28);
  background: #f8ecd8;
  color: #9b7a46;
  letter-spacing: 0.28em;
}
body.mode-diary .paper-title {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: #3b2f21;
}
body.mode-diary .paper-meta {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: #a28b6b;
}
body.mode-diary .paper-body {
  font-family: var(--font-serif);
  font-size: 15.5px;
  line-height: 2.05;
  letter-spacing: 0.02em;
  color: #463829;
}
body.mode-diary .tm-diary-note {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 2.1;
  letter-spacing: 0.02em;
  color: #443627;
  text-align: justify;
}
body.mode-diary .tm-diary-attitude {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(169, 127, 51, 0.18);
  font-family: var(--font-serif);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: #94713f;
}
body.mode-diary .paper-foot-diary {
  font-family: var(--font-serif);
  letter-spacing: 0.22em;
  color: #a58b65;
}

/* ==========================================================================
   24. 苏格拉底 / 费曼对练弹层
   ========================================================================== */

body.coach-open {
  overflow: hidden !important;
}

.coach-layer {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.coach-layer[hidden] { display: none !important; }
.coach-veil {
  position: absolute;
  inset: 0;
  background: rgba(55, 42, 25, 0.34);
  -webkit-backdrop-filter: blur(13px) saturate(115%);
  backdrop-filter: blur(13px) saturate(115%);
  animation: maskFade 0.24s ease both;
}
.coach-shell {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
  max-height: min(88vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 26px;
  background:
    radial-gradient(100% 70% at 0% 0%, rgba(255, 253, 247, 0.98), transparent 62%),
    linear-gradient(155deg, #fffdf8 0%, #f9f0e0 100%);
  box-shadow:
    0 40px 100px rgba(60, 40, 16, 0.32),
    0 10px 28px rgba(60, 40, 16, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
  animation: modalPop 0.38s var(--ease-out) both;
}
.coach-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 12px;
}
.coach-head-copy { min-width: 0; }
.coach-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #b19158;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.28em;
  line-height: 1.4;
}
.coach-head h2 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 29px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.2;
  color: #382d20;
}
.coach-head p {
  margin: 0;
  color: #9a866c;
  font-size: 11.5px;
  line-height: 1.6;
}
.coach-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(179, 137, 63, 0.16);
  border-radius: 50%;
  background: rgba(255, 253, 247, 0.74);
  color: #927a58;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.coach-close:hover {
  background: #fffdf8;
  color: #7c5a1f;
  transform: rotate(90deg);
}
.coach-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  margin: 0 26px;
  padding: 4px;
  border: 1px solid rgba(179, 137, 63, 0.12);
  border-radius: 999px;
  background: rgba(247, 238, 222, 0.64);
}
.coach-tab {
  flex: 1 1 0;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #9b8668;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}
.coach-tab:hover { color: #765b2d; }
.coach-tab.active {
  background: #fffdf8;
  color: #7c5a1f;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(120, 88, 40, 0.09);
}
.coach-context-row {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
  padding: 12px 26px 8px;
}
.coach-context-label {
  flex: 0 0 auto;
  color: #b19158;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
}
.coach-context {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7f6a50;
  font-family: var(--font-serif);
  font-size: 12px;
  line-height: 1.5;
}
.coach-round {
  flex: 0 0 auto;
  color: #b29a77;
  font-family: var(--font-serif);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}
.coach-thread {
  flex: 1 1 auto;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 26px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(179, 137, 63, 0.32) transparent;
}
.coach-thread::-webkit-scrollbar { width: 5px; }
.coach-thread::-webkit-scrollbar-thumb {
  background: rgba(179, 137, 63, 0.28);
  border-radius: 999px;
}
.coach-msg {
  max-width: 86%;
  padding: 12px 15px;
  border: 1px solid rgba(179, 137, 63, 0.14);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 4px 12px rgba(120, 88, 40, 0.04);
  animation: coachMsgIn 0.32s var(--ease-out) both;
}
@keyframes coachMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.coach-msg--coach {
  align-self: flex-start;
  border-top-left-radius: 4px;
}
.coach-msg--user {
  align-self: flex-end;
  border-top-right-radius: 4px;
  border-color: rgba(179, 137, 63, 0.24);
  background: linear-gradient(135deg, #fbf0da 0%, #f5e4c2 100%);
}
.coach-msg--diagnosis {
  align-self: stretch;
  max-width: 100%;
  padding: 16px 17px;
  border-color: rgba(179, 137, 63, 0.28);
  background:
    radial-gradient(100% 80% at 0% 0%, rgba(255, 253, 246, 0.96), transparent 64%),
    linear-gradient(145deg, #fbf3e4, #f4e8d3);
}
.coach-msg--error {
  align-self: center;
  max-width: 92%;
  border-color: rgba(180, 85, 45, 0.18);
  background: #fdf1e7;
}
.coach-msg-label {
  margin-bottom: 4px;
  color: #b19158;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
}
.coach-msg--user .coach-msg-label { color: #a57f43; }
.coach-msg-text {
  margin: 0;
  color: #4b3c2b;
  font-size: 13.5px;
  line-height: 1.85;
  letter-spacing: 0.01em;
  white-space: pre-wrap;
  word-break: break-word;
}
.coach-msg--coach .coach-msg-text {
  font-family: var(--font-serif);
  font-size: 14px;
}
.coach-msg--diagnosis .ai-sec {
  margin-bottom: 9px;
  padding: 10px 12px;
  border-left-color: rgba(179, 137, 63, 0.34);
  background: rgba(255, 252, 245, 0.56);
}
.coach-msg--diagnosis .ai-sec:last-child { margin-bottom: 0; }
.coach-msg--diagnosis .ai-sec-label {
  color: #916c2d;
  font-size: 10px;
}
.coach-msg--diagnosis .ai-sec-text {
  font-size: 13px;
  line-height: 1.85;
}
.coach-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(179, 137, 63, 0.16);
}
.coach-result-actions button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(179, 137, 63, 0.20);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
  color: #80622c;
  font-size: 11px;
}
.coach-result-actions button:hover { background: #fffdf8; }
.coach-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9a825f;
  font-size: 12px;
}
.coach-loading i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b3893f;
  animation: coachDot 1s ease-in-out infinite;
}
.coach-loading i:nth-child(2) { animation-delay: 0.14s; }
.coach-loading i:nth-child(3) { animation-delay: 0.28s; }
@keyframes coachDot {
  0%, 100% { opacity: 0.28; transform: translateY(0); }
  50%      { opacity: 1; transform: translateY(-3px); }
}
.coach-compose {
  flex: 0 0 auto;
  margin: 0 26px;
  padding: 11px 12px 10px;
  border: 1px solid rgba(179, 137, 63, 0.16);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: inset 0 1px 3px rgba(120, 88, 40, 0.025);
}
#coachInput {
  width: 100%;
  height: 74px;
  min-height: 74px;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  line-height: 1.7;
  color: #4a3b2a;
  resize: none;
}
#coachInput:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
}
#coachInput::placeholder { font-size: 13px; color: #b4a48e; }
.coach-compose-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid rgba(179, 137, 63, 0.10);
}
.coach-count {
  color: #b3a18a;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}
.coach-send {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #d8b46a, #ad8135);
  color: #fffdf7;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 14px rgba(150, 110, 40, 0.18);
}
.coach-send:hover { filter: brightness(1.04); }
.coach-send:disabled,
.coach-finish:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}
.coach-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 26px 18px;
}
.coach-hint {
  min-width: 0;
  color: #a9957a;
  font-size: 9.5px;
  line-height: 1.5;
}
.coach-finish {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(179, 137, 63, 0.24);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.60);
  color: #80622c;
  font-size: 10.5px;
  letter-spacing: 0.03em;
}
.coach-finish:hover { background: #fffdf8; }

/* ==========================================================================
   25. 移动端 / 微信 WebView：单列流式布局
   PC 端三栏布局完全不动；以下只在窄屏 screen 生效，不影响打印。
   ========================================================================== */
@media screen and (max-width: 980px) {
  html,
  body {
    width: 100%;
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
  }
  body {
    -webkit-text-size-adjust: 100%;
    background: var(--bg-0);
  }

  .wrap {
    width: 100%;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0 10px 108px;
    overflow: visible;
  }
  .card {
    width: 100%;
    max-width: none !important;
    height: auto;
    min-height: 0;
    padding: 0 12px 4px;
    border-radius: 0 0 24px 24px;
    overflow: visible;
    /* 让内部 fixed 提交条回到视口坐标系 */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .top-bar.hero-head {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 12px;
    margin: 0;
    padding: 14px 2px 10px !important;
    border-bottom: 1px solid rgba(179, 137, 63, 0.10);
  }
  .hero-brand { width: auto; }
  .hero-mark {
    padding-left: 10px;
    border-left-width: 1.5px;
  }
  .hero-mark h1 {
    font-size: 31px;
    letter-spacing: 0.10em;
  }
  .hero-eyebrow {
    font-size: 7.5px;
    letter-spacing: 0.18em;
  }
  .subtitle { font-size: 10.5px; }
  .mode-switch {
    order: 3;
    display: flex;
    width: 100%;
    margin-top: 2px;
    padding: 4px;
    border-radius: 14px;
  }
  .mode-indicator {
    top: 4px;
    bottom: 4px;
    border-radius: 11px;
  }
  .mode-pill {
    flex: 1 1 0;
    min-width: 0;
    height: 42px;
    padding: 0 10px;
    border-radius: 11px;
    font-size: 14px;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none !important;
    height: auto;
    gap: 12px !important;
    padding: 0 !important;
  }
  .col-control,
  .col-traces,
  .paper-preview {
    width: 100%;
    min-width: 0;
    border-radius: 16px;
  }
  .col-control {
    overflow: visible;
  }
  .control-scroll {
    overflow: visible;
    padding: 10px 10px 0;
  }
  .streak-bar {
    min-height: 36px;
    margin-bottom: 8px;
    padding: 8px 11px;
    font-size: 11.5px;
  }
  .streak-days { font-size: 11.5px; }
  .streak-tip { font-size: 10px; }

  .group {
    padding: 16px 14px 14px;
    border-radius: 15px;
  }
  .group-head {
    align-items: flex-end;
    margin-bottom: 8px;
  }
  .lb-en { font-size: 8px; letter-spacing: 0.24em; }
  .lb-cn { font-size: 18px; }
  .char-count { font-size: 10px; }
  #wrongInput {
    height: 148px;
    min-height: 148px;
    padding: 12px 13px;
    font-size: 16px;
    line-height: 1.7;
  }
  .quality-line {
    margin-top: 8px;
    font-size: 10px;
    line-height: 1.5;
  }

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 9px;
    margin-top: 12px;
  }
  .field:nth-child(n) { grid-column: auto; }
  .field > label,
  .field-label {
    margin-bottom: 4px;
    font-size: 12px;
  }
  .select-trigger {
    height: 46px;
    padding: 0 10px;
    font-size: 14.5px;
  }
  .field select { height: 46px; font-size: 15px; }
  .tag-group { gap: 7px; margin-top: 7px; }
  .tag {
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
  }
  .field-block { margin-top: 12px; }
  .material-input {
    height: 82px !important;
    min-height: 82px !important;
    font-size: 14px !important;
  }
  .check-row {
    min-height: 44px;
    margin-top: 8px;
    font-size: 13px;
  }
  .check-row input[type="checkbox"] { width: 20px; height: 20px; }
  .check-note {
    display: block;
    margin: 2px 0 0;
    font-size: 10px;
  }
  .coach-entry {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    margin-top: 12px;
    padding: 12px;
  }
  .coach-entry-copy strong { font-size: 13px; }
  .coach-entry-btn {
    width: 100%;
    height: 42px;
    font-size: 12.5px;
  }

  .submit-wrap {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    padding: 9px 14px calc(9px + env(safe-area-inset-bottom));
    background:
      linear-gradient(180deg, rgba(251, 245, 234, 0) 0%, rgba(251, 245, 234, 0.94) 24%, #fbf5ea 100%);
    box-shadow: 0 -10px 28px rgba(120, 88, 40, 0.10);
  }
  #submitBtn {
    height: 52px;
    border-radius: 13px;
    font-size: 16px;
  }
  .submit-hint {
    margin-top: 5px;
    font-size: 9px;
    color: #a8967e;
  }

  .col-traces {
    margin-top: 2px;
    overflow: hidden;
  }
  .list-title-row { padding: 15px 14px 8px; }
  .list-title { font-size: 18px; }
  .toolbar { padding: 0 12px 10px; }
  #searchInput { height: 42px; font-size: 16px; }
  #searchInput::placeholder { font-size: 12.5px; }
  .fav-filter { width: 42px; height: 42px; }
  .trace-panel { overflow: hidden; }
  .trace-scroll {
    height: auto;
    max-height: 48vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 2px 10px 12px;
    -webkit-overflow-scrolling: touch;
  }
  #recordList { gap: 8px; }
  .record {
    padding: 13px 13px 12px;
    border-radius: 13px;
  }
  .record .wrong {
    font-size: 14.5px;
    line-height: 1.65;
    -webkit-line-clamp: 4;
  }
  .record .attitude { font-size: 10.5px; }
  .record-footer {
    gap: 7px;
    margin-top: 8px;
    padding-top: 7px;
  }
  .rec-btn {
    height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 12px;
  }
  .rec-head .time { font-size: 10px; }
  .rec-status { font-size: 9.5px; }

  .paper-preview {
    overflow: visible;
    padding: 10px 10px 0;
  }
  .paper-toolbar {
    flex: 0 0 auto;
    height: auto;
    min-height: 40px;
    padding: 2px 0 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
  }
  .paper-label { display: none; }
  .paper-btn,
  #tmDiaryPrint {
    height: 40px;
    padding: 0 14px;
    font-size: 11.5px;
  }
  .paper-stage {
    width: 100%;
    max-width: none;
    display: block;
    padding: 0;
  }
  .a4-paper {
    width: 100% !important;
    max-width: none !important;
    min-height: 440px;
    aspect-ratio: auto !important;
    padding: 7.2% 7% 6%;
    border-radius: 5px;
  }
  .paper-title {
    margin-top: 8px;
    font-size: 21px;
    line-height: 1.35;
  }
  .paper-badge { font-size: 6.5px; }
  .paper-meta {
    padding-bottom: 8px;
    font-size: 9.5px;
    line-height: 1.7;
  }
  .paper-body {
    margin-top: 8px;
    padding-right: 0;
    overflow: visible;
    font-size: 12.5px;
    line-height: 1.8;
  }
  .paper-sec { margin-bottom: 9px; }
  .paper-sec-title { font-size: 11.3px; }
  .paper-sec-body,
  .paper-sec-line { font-size: 12.4px; line-height: 1.8; }
  .paper-placeholder {
    padding: 26px 10px;
    font-size: 11px;
    line-height: 1.85;
  }
  .paper-foot {
    margin-top: 8px;
    padding-top: 7px;
    font-size: 6.5px;
  }

  body.mode-diary .diary-panel {
    padding: 20px 18px 18px;
    border-radius: 4px 15px 15px 4px;
  }
  body.mode-diary .diary-panel::before { left: 9px; }
  body.mode-diary .diary-panel .lb-cn { font-size: 23px; }
  body.mode-diary #diaryInput {
    height: 204px;
    min-height: 204px;
    font-size: 16px;
    line-height: 34px;
    background-image: repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 33px,
      rgba(169, 127, 51, 0.15) 33px,
      rgba(169, 127, 51, 0.15) 34px
    );
    background-size: 100% 34px;
  }
  body.mode-diary #diaryInput::placeholder { font-size: 15px; }
  body.mode-diary .paper-title { font-size: 23px; }
  body.mode-diary .paper-body { font-size: 14px; line-height: 1.95; }
  body.mode-diary .tm-diary-note { font-size: 15px; line-height: 2; }

  /* 继续修改胶囊：移动端落到 A4 下方，不再 fixed 遮挡 */
  .refine-bar {
    position: static;
    width: auto;
    margin: 10px 12px 18px;
    right: auto;
    bottom: auto;
    padding: 8px;
    border-radius: 14px;
  }
  .refine-field label { font-size: 10px; }
  #refineInput { font-size: 16px; }
  .btn-refine { height: 44px; }

  #mascot { display: none !important; }

  .modal-mask { padding: 14px; }
  .modal-box {
    width: 100%;
    max-height: 86vh;
    padding: 22px 20px;
    border-radius: 18px;
  }
  .ai-modal { max-width: 100%; }
  .ai-body { max-height: 52vh; }
  .ai-foot { align-items: stretch; flex-direction: column; }
  .ai-actions { justify-content: stretch; }
  .ai-actions .modal-btn { flex: 1 1 auto; }
  .holo-card {
    width: calc(100vw - 32px);
    max-width: 560px;
    padding: 22px 20px;
  }

  .coach-layer { padding: 0; align-items: stretch; }
  .coach-shell {
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .coach-head { padding: 18px 18px 10px; }
  .coach-head h2 { font-size: 25px; }
  .coach-head p { font-size: 11px; }
  .coach-close { width: 38px; height: 38px; }
  .coach-tabs { margin: 0 16px; }
  .coach-tab { height: 40px; font-size: 12px; }
  .coach-context-row { padding: 10px 18px 7px; }
  .coach-thread { padding: 8px 16px 14px; }
  .coach-msg { max-width: 92%; padding: 11px 13px; }
  .coach-msg-text { font-size: 13.5px; }
  .coach-msg--coach .coach-msg-text { font-size: 14px; }
  .coach-compose { margin: 0 12px; padding: 9px 10px 8px; }
  #coachInput { height: 70px; min-height: 70px; font-size: 16px; }
  .coach-compose-row { padding-top: 5px; }
  .coach-send { height: 42px; padding: 0 15px; font-size: 12px; }
  .coach-foot {
    padding: 9px 16px calc(9px + env(safe-area-inset-bottom));
  }
  .coach-finish { height: 42px; padding: 0 14px; font-size: 11px; }
  .coach-hint { font-size: 9px; }
}

@media screen and (max-width: 420px) {
  .wrap { padding-left: 7px; padding-right: 7px; }
  .card { padding-left: 9px; padding-right: 9px; }
  .hero-mark h1 { font-size: 28px; }
  .hero-eyebrow { display: none; }
  .streak-tip { display: none; }
  .field-grid { gap: 9px 7px; }
  .select-trigger { font-size: 13.5px; padding: 0 8px; }
  .coach-entry-sub { display: none; }
  .paper-preview { padding-left: 7px; padding-right: 7px; }
  .a4-paper { padding: 7.6% 6.8% 6%; }
  .coach-tab { font-size: 11.5px; }
}

/* 触摸设备：避免 hover 卡住 */
@media (hover: none) {
  .record:hover,
  .coach-entry-btn:hover,
  .paper-btn:hover,
  #tmDiaryPrint:hover {
    transform: none;
  }
}


@media screen and (max-width: 980px) {
  .paper-preview > .refine-bar {
    position: static;
    width: auto;
    margin: 0 0 10px;
    padding: 8px 0 2px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .paper-preview > .refine-bar .refine-field { min-width: 0; }
  .paper-preview > .refine-bar #refineInput { font-size: 16px; }
}


/* 小尺寸桌面 / 横屏平板：仍是三栏，但把左右两列收窄，避免 A4 只剩一条 */
@media screen and (min-width: 981px) and (max-width: 1180px) {
  .workspace {
    grid-template-columns: 310px 230px minmax(0, 1fr) !important;
    gap: 12px !important;
  }
  .hero-head { gap: 22px; }
  .group { padding: 16px 14px 10px; }
  .control-scroll { padding-left: 12px; padding-right: 12px; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 8px; }
  .field:nth-child(n) { grid-column: auto; }
  .select-trigger { font-size: 13.8px; padding: 0 8px; }
  .field > label, .field-label { font-size: 12.5px; }
  .paper-preview { padding-left: 12px; padding-right: 12px; }
  .paper-stage { max-width: min(520px, calc(var(--paper-max-h) * 0.70710678)); }
  .list-title-row { padding-left: 14px; padding-right: 14px; }
  .toolbar { padding-left: 12px; padding-right: 12px; }
  .trace-scroll { padding-left: 10px; padding-right: 10px; }
  .record { padding: 10px; }
  .record .wrong { font-size: 13.8px; }
  .refine-bar { width: 320px; right: 18px; bottom: 24px; }
  .coach-entry { flex-direction: column; align-items: stretch; gap: 8px; }
  .coach-entry-btn { width: 100%; }
}


/* ==========================================================================
   26. 松弛感重构：画廊式留白 / 无外框 / 香槟金思考指示灯
   ========================================================================== */

/* 外层不再做一个“盒子”，让页面背景和三张卡片自己呼吸 */
.card {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  overflow: visible !important;
}
.card::before { display: none !important; }

/* 香槟金思考指示灯，替代旧版脑形图标 */
.check-copy {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}
.think-orb {
  position: relative;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff9eb 0 16%, #d9ba7c 34%, #aa8138 74%, #8a6423 100%);
  box-shadow:
    0 0 0 4px rgba(179, 137, 63, 0.07),
    0 0 13px rgba(211, 174, 98, 0.42);
  animation: thinkBreathe 3.6s ease-in-out infinite;
}
.think-orb::before {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(179, 137, 63, 0.18);
  border-radius: 50%;
  animation: thinkRing 3.6s ease-in-out infinite;
}
.think-orb::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(255, 253, 244, 0.96);
  transform: translate(-50%, -50%);
}
@keyframes thinkBreathe {
  0%, 100% { transform: scale(0.92); box-shadow: 0 0 0 4px rgba(179, 137, 63, 0.06), 0 0 9px rgba(211, 174, 98, 0.30); }
  50%      { transform: scale(1.08); box-shadow: 0 0 0 5px rgba(179, 137, 63, 0.09), 0 0 17px rgba(211, 174, 98, 0.52); }
}
@keyframes thinkRing {
  0%, 100% { transform: scale(0.9); opacity: 0.55; }
  50%      { transform: scale(1.18); opacity: 1; }
}
.check-row .check-note {
  margin-left: 0;
  color: #ad9b84;
}

@media screen and (min-width: 981px) {
  .wrap {
    padding: 24px clamp(20px, 2.5vw, 36px) 18px;
  }
  .card {
    max-width: 1320px !important;
    padding: 0;
  }
  .top-bar.hero-head {
    flex: 0 0 78px;
    height: 78px;
    max-width: 1320px !important;
    margin-bottom: 10px;
    padding: 0 !important;
    gap: 40px;
  }
  .hero-mark h1 { font-size: 40px; }
  .hero-eyebrow { letter-spacing: 0.36em; }
  .mode-switch { padding: 5px 6px; }
  .mode-pill { height: 46px; min-width: 92px; }

  .workspace {
    max-width: 1320px !important;
    height: calc(100vh - 132px);
    padding: 0 !important;
    grid-template-columns: 380px 300px minmax(0, 1fr) !important;
    gap: 24px !important;
  }
  .col-control,
  .col-traces,
  .paper-preview {
    border-radius: 22px;
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow:
      0 1px 2px rgba(120, 88, 40, 0.025),
      0 18px 44px rgba(120, 88, 40, 0.055);
  }

  .control-scroll {
    padding: 22px 20px 8px;
  }
  .streak-bar {
    min-height: 42px;
    padding: 10px 15px;
    margin-bottom: 14px;
    border-radius: 13px;
  }
  .group {
    padding: 24px 22px 20px;
    border-radius: 20px;
  }
  .group-head { margin-bottom: 12px; }
  #wrongInput { padding: 16px 17px; }
  .quality-line { margin: 12px 2px 0; }
  .coach-entry {
    margin-top: 16px;
    padding: 16px 17px;
    border-radius: 16px;
  }
  .field-grid {
    margin-top: 14px;
    gap: 11px 9px;
  }
  .field > label,
  .field-label { margin-bottom: 7px; }
  .field-block { margin-top: 15px; }
  .tag-group { gap: 8px; margin-top: 8px; }
  .tag { height: 34px; padding: 0 14px; }
  .check-row { margin-top: 12px; padding: 6px 0; gap: 11px; }
  .submit-wrap { padding: 14px 20px 20px; }
  #submitBtn { height: 58px; border-radius: 17px; }
  .submit-hint { margin-top: 9px; }

  .list-title-row { padding: 24px 22px 12px; }
  .toolbar { padding: 0 20px 16px; gap: 10px; }
  #searchInput { height: 44px; }
  .fav-filter { width: 44px; height: 44px; }
  .trace-scroll { padding: 2px 18px 26px; }
  #recordList { gap: 10px; }
  .record {
    padding: 14px 16px;
    border-radius: 15px;
  }
  .record .wrong { line-height: 1.7; }
  .record-footer { margin-top: 8px; padding-top: 7px; }

  .paper-preview { padding: 20px 24px 0; }
  .paper-toolbar { flex: 0 0 48px; height: 48px; }
  .paper-stage { padding: 14px 0 130px; }
  .a4-paper { padding: 6.6% 7% 4.8%; }
  .paper-title { margin: 12px 0 6px; }
  .paper-meta { padding-bottom: 12px; }
  .paper-body { margin-top: 14px; font-size: 13.2px; line-height: 1.86; }
  .paper-sec { margin-bottom: 12px; }
  .paper-sec-title { margin-bottom: 5px; }
  .paper-sec-body,
  .paper-sec-line { font-size: 13.1px; line-height: 1.86; }
  .paper-placeholder { padding: 42px 16px; }

  .refine-bar {
    right: max(40px, calc((100vw - 1320px) / 2 + 24px));
  }
}

/* 小桌面 / 横屏平板：仍是三栏，但降低密度、留出呼吸 */
@media screen and (min-width: 981px) and (max-width: 1180px) {
  .workspace {
    grid-template-columns: 310px 230px minmax(0, 1fr) !important;
    gap: 20px !important;
  }
  .control-scroll { padding: 18px 16px 6px; }
  .group { padding: 20px 18px 16px; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 9px; }
  .field:nth-child(n) { grid-column: auto; }
  .coach-entry { flex-direction: column; align-items: stretch; gap: 9px; }
  .coach-entry-btn { width: 100%; }
  .record { padding: 12px 13px; }
  .paper-preview { padding: 16px 16px 0; }
  .list-title-row { padding: 20px 16px 10px; }
  .toolbar { padding: 0 14px 14px; }
  .trace-scroll { padding: 2px 12px 24px; }
}

@media screen and (min-width: 1181px) and (max-width: 1280px) {
  .workspace {
    grid-template-columns: 340px 260px minmax(0, 1fr) !important;
    gap: 20px !important;
  }
  .control-scroll { padding: 20px 18px 6px; }
  .group { padding: 22px 20px 18px; }
  .paper-preview { padding: 18px 20px 0; }
}

/* 移动端：保住单列流式，只把卡片留白放大一点 */
@media screen and (max-width: 980px) {
  .card {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .workspace { gap: 16px !important; }
  .control-scroll { padding: 12px 10px 0; }
  .group { padding: 18px 16px 16px; }
  .group-head { margin-bottom: 10px; }
  .quality-line { margin-top: 10px; }
  .coach-entry { margin-top: 14px; padding: 14px 14px; }
  .field-grid { gap: 12px 10px; margin-top: 14px; }
  .field-block { margin-top: 14px; }
  .tag-group { gap: 8px; margin-top: 8px; }
  .check-row { padding: 5px 0; }
  .record { padding: 14px 14px 13px; }
  .trace-scroll { padding-left: 12px; padding-right: 12px; }
  .paper-preview { padding: 12px 12px 0; }
  .paper-title { margin-top: 10px; }
  .paper-body { margin-top: 10px; line-height: 1.85; }
  .paper-sec { margin-bottom: 11px; }
}


/* ==========================================================================
   27. 宽屏大屏：SaaS 式横向铺满，吃掉两侧无意义白边
   只作用于 >=1281px 的电脑端；手机/平板单列完全不受影响。
   ========================================================================== */
@media screen and (min-width: 1281px) {
  .wrap {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .card {
    width: calc(100% - clamp(56px, 6vw, 120px)) !important;
    max-width: 2400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .top-bar.hero-head {
    width: 100% !important;
    max-width: 2400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    gap: clamp(34px, 3vw, 64px);
  }
  .workspace {
    width: 100% !important;
    max-width: 2400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    grid-template-columns:
      clamp(400px, 24%, 560px)
      clamp(310px, 20%, 480px)
      minmax(0, 1fr) !important;
    gap: clamp(24px, 2vw, 36px) !important;
  }

  .hero-mark h1 {
    font-size: clamp(40px, 2vw, 52px);
  }
  .mode-pill {
    height: clamp(46px, 3.2vw, 50px);
    min-width: clamp(92px, 6vw, 112px);
  }

  .control-scroll {
    padding: clamp(22px, 1.4vw, 30px) clamp(20px, 1.3vw, 28px) 8px;
  }
  .group {
    padding: clamp(24px, 1.5vw, 32px) clamp(22px, 1.4vw, 30px) clamp(20px, 1.3vw, 28px);
  }
  .group-head { margin-bottom: clamp(12px, 1vw, 16px); }
  .coach-entry {
    padding: clamp(16px, 1.1vw, 20px) clamp(17px, 1.2vw, 22px);
    margin-top: clamp(16px, 1.2vw, 22px);
  }
  .field-grid { gap: clamp(11px, 0.9vw, 14px) clamp(9px, 0.8vw, 13px); }
  .field-block { margin-top: clamp(15px, 1.2vw, 20px); }
  .tag-group { gap: clamp(8px, 0.7vw, 11px); }
  .tag { height: clamp(34px, 2.5vw, 38px); padding: 0 clamp(14px, 1vw, 17px); }
  .submit-wrap { padding: clamp(14px, 1.1vw, 18px) clamp(20px, 1.5vw, 30px) clamp(20px, 1.4vw, 28px); }
  #submitBtn { height: clamp(58px, 4vw, 64px); }

  .list-title-row { padding: clamp(24px, 1.7vw, 30px) clamp(22px, 1.5vw, 28px) clamp(12px, 1vw, 16px); }
  .toolbar { padding: 0 clamp(20px, 1.4vw, 28px) clamp(16px, 1.2vw, 20px); }
  .trace-scroll { padding: 2px clamp(18px, 1.3vw, 24px) clamp(26px, 1.8vw, 34px); }
  #recordList { gap: clamp(10px, 0.8vw, 13px); }
  .record {
    padding: clamp(14px, 1vw, 18px) clamp(16px, 1.2vw, 20px);
    border-radius: clamp(15px, 1.1vw, 18px);
  }

  .paper-preview { padding: clamp(20px, 1.4vw, 28px) clamp(24px, 1.7vw, 34px) 0; }
  .paper-stage {
    max-width: min(820px, calc(var(--paper-max-h) * 0.70710678)) !important;
    padding-top: clamp(14px, 1vw, 20px);
  }
  .a4-paper {
    max-width: 820px !important;
  }
  .paper-title {
    font-size: clamp(24px, 1.7vw, 32px);
  }
  .paper-body {
    font-size: clamp(13.2px, 0.72vw, 15px);
  }
  .paper-sec-body,
  .paper-sec-line {
    font-size: clamp(13.1px, 0.72vw, 15px);
  }
  .paper-sec-title {
    font-size: clamp(11.8px, 0.65vw, 13.5px);
  }

  .refine-bar {
    right: clamp(24px, 3vw, 64px);
  }
}
