/* Carol 的书桌 —— 手帐本。颜色取自她的三张图：奶油纸、木头棕、卫衣灰紫、台灯暖黄；夜里换成窗外的靛蓝。 */

:root {
  --paper: #f4ead8;
  --paper-grid: rgba(122, 92, 64, 0.075);
  --card: #fffaf0;
  --ink: #3a2e28;
  --ink-soft: #7b6a5d;
  --wood: #8a5a3c;
  --hoodie: #7d7491;
  --lamp: #e9a23b;
  --lamp-soft: #f7e2b0;
  --sticky: #f8e7a9;
  --red-pen: #c2543d;
  --shadow: 0 1px 1px rgba(60, 40, 20, 0.08), 0 6px 18px -8px rgba(60, 40, 20, 0.35);
  --hand: "LXGW WenKai Screen", "Kaiti SC", "STKaiti", "KaiTi", serif;
  --sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --fade: 1.4s;
}

body.night {
  --paper: #1e2236;
  --paper-grid: rgba(220, 210, 255, 0.05);
  --card: #2a2f48;
  --ink: #efe4cf;
  --ink-soft: #a9a3bf;
  --sticky: #675533;
  --lamp-soft: #4a4030;
  --red-pen: #f08a6f;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 8px 22px -8px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--paper-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-grid) 1px, transparent 1px);
  background-size: 22px 22px;
  min-height: 100vh;
  transition: background-color var(--fade) ease, color var(--fade) ease;
  overflow-x: hidden;
}

/* 右上角一圈咖啡渍 */
body::before {
  content: "";
  position: fixed;
  top: -40px;
  right: -30px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 9px solid rgba(138, 90, 60, 0.07);
  box-shadow: inset 0 0 0 3px rgba(138, 90, 60, 0.04);
  transform: rotate(-12deg) scaleX(1.06);
  pointer-events: none;
}
body.night::before { opacity: 0; }

body.booting #app, body.booting #gate { visibility: hidden; }
[hidden] { display: none !important; }

.hand { font-family: var(--hand); }
.fine { font-size: 12px; color: var(--ink-soft); }
.red-pen { color: var(--red-pen); }

kbd {
  font-family: var(--sans);
  font-size: 0.82em;
  display: inline-block;
  padding: 1px 7px 2px;
  margin: 0 2px;
  border-radius: 5px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid rgba(90, 70, 50, 0.28);
  border-bottom-width: 3px;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: 1px;
}

/* ---------- 胶带、拍立得、便利贴、索引卡 ---------- */
.tape {
  position: absolute;
  width: 92px;
  height: 26px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 6px, transparent 6px 12px),
    rgba(233, 162, 59, 0.55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  z-index: 2;
}
.tape-l { top: -12px; left: -18px; transform: rotate(-32deg); }
.tape-r { top: -12px; right: -18px; transform: rotate(28deg); background-color: rgba(125, 116, 145, 0.5); }
.tape-c { top: -13px; left: 50%; transform: translateX(-50%) rotate(-3deg); width: 80px; }

.polaroid {
  position: relative;
  margin: 0;
  padding: 14px 14px 0;
  background: #fffdf8;
  box-shadow: var(--shadow);
  transition: background-color var(--fade);
}
body.night .polaroid { background: #ece4d6; }
.polaroid figcaption {
  color: #3a2e28;
  font-size: 21px;
  text-align: center;
  padding: 14px 6px 18px;
  min-height: 62px;
}

.sticky {
  position: relative;
  background: var(--sticky);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
  transform: rotate(1.4deg);
  transition: background-color var(--fade);
}
.sticky p { margin: 0 0 8px; font-size: 18px; line-height: 1.6; }
.sticky s { text-decoration-color: var(--red-pen); text-decoration-thickness: 2px; color: var(--ink-soft); }
.nowrap { white-space: nowrap; }

.index-card {
  position: relative;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    var(--card);
  background-image:
    linear-gradient(transparent 46px, rgba(194, 84, 61, 0.45) 46px, rgba(194, 84, 61, 0.45) 48px, transparent 48px),
    linear-gradient(var(--card) 0 46px, transparent 46px),
    repeating-linear-gradient(transparent 0 31px, rgba(110, 140, 190, 0.18) 31px 32px);
  background-color: var(--card);
  box-shadow: var(--shadow);
  transition: background-color var(--fade);
}

.paper-card {
  position: relative;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 28px 30px 24px;
  transition: background-color var(--fade);
}

/* ---------- 顶部 ---------- */
#app { max-width: 1060px; margin: 0 auto; padding: 28px 24px 40px; }

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.title {
  position: relative;
  margin: 0;
  font-size: 46px;
  font-weight: 400;
  letter-spacing: 1px;
}
.squiggle {
  position: absolute;
  left: 2px;
  bottom: -12px;
  width: 210px;
  height: 14px;
  fill: none;
  stroke: var(--lamp);
  stroke-width: 3.5;
  stroke-linecap: round;
}
.hello { margin: 0; display: flex; align-items: baseline; gap: 14px; font-size: 18px; }
.hello b { font-weight: 400; border-bottom: 2px solid var(--lamp); }
.clock { color: var(--ink-soft); }
.tiny-link { font-size: 12px; color: var(--ink-soft); text-decoration: none; border-bottom: 1px dashed currentColor; }

/* ---------- 书桌：场景 + 便利贴 + 计数 ---------- */
.desk {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 46px;
  align-items: start;
  margin-bottom: 64px;
}

.scene { transform: rotate(-1.6deg); }
.scene-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #d9c9ad;
}
.scene-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--fade) ease, filter var(--fade) ease;
}
.sleep-img { opacity: 0; }
body.s-sleeping .sleep-img, body.s-dreaming .sleep-img { opacity: 1; }
body.s-sleeping .awake-img, body.s-dreaming .awake-img { opacity: 0; }
body.s-offline .scene-img { filter: grayscale(0.85) brightness(0.92); }

.fx { position: absolute; pointer-events: none; opacity: 0; transition: opacity 0.8s ease; }

/* 醒着：笔记本屏幕那块的光轻轻呼吸。位置按 awake.webp 调（--glow-x/y/w/h） */
.screen-glow {
  --glow-x: 9%; --glow-y: 29%; --glow-w: 24%; --glow-h: 20%;
  left: var(--glow-x); top: var(--glow-y); width: var(--glow-w); height: var(--glow-h);
  border-radius: 40%;
  background: radial-gradient(closest-side, rgba(255, 246, 214, 0.75), rgba(255, 238, 190, 0));
  mix-blend-mode: screen;
}
body.s-awake .screen-glow, body.s-thinking .screen-glow { opacity: 1; animation: glow 4.5s ease-in-out infinite; }
@keyframes glow { 50% { transform: scale(1.08); filter: brightness(1.15); } }

/* 在想：头顶冒个“…”气泡 */
.thinking-bubble {
  right: 14%;
  top: 7%;
  padding: 10px 14px;
  border-radius: 20px;
  background: #fffdf8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  gap: 6px;
}
.thinking-bubble::after {
  content: "";
  position: absolute;
  left: 14px;
  bottom: -9px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fffdf8;
}
.thinking-bubble i { width: 8px; height: 8px; border-radius: 50%; background: var(--hoodie); animation: dot 1.2s infinite ease-in-out; }
.thinking-bubble i:nth-child(2) { animation-delay: 0.18s; }
.thinking-bubble i:nth-child(3) { animation-delay: 0.36s; }
body.s-thinking .thinking-bubble { opacity: 1; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-5px); opacity: 1; } }

/* 睡着：z z Z 往上飘 */
.zzz { left: 46%; top: 20%; width: 30%; height: 30%; font-family: var(--hand); color: #f3ead8; }
.zzz i { position: absolute; font-style: normal; font-size: 22px; animation: zfloat 5.4s infinite ease-out; opacity: 0; text-shadow: 0 0 8px rgba(0, 0, 0, 0.4); }
.zzz i:nth-child(2) { animation-delay: 1.8s; font-size: 28px; }
.zzz i:nth-child(3) { animation-delay: 3.6s; font-size: 36px; }
body.s-sleeping .zzz { opacity: 1; }
@keyframes zfloat {
  0% { transform: translate(0, 40px) rotate(-8deg); opacity: 0; }
  15% { opacity: 0.95; }
  100% { transform: translate(46px, -50px) rotate(10deg); opacity: 0; }
}

/* 做梦：梦泡泡 */
.dreams { left: 42%; top: 4%; width: 50%; height: 46%; }
.dreams i {
  position: absolute;
  bottom: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-family: var(--hand);
  color: #f6eedd;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.45), rgba(170, 160, 230, 0.18) 60%, rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.35);
  animation: bubble 7s infinite ease-in;
  opacity: 0;
}
.dreams i:nth-child(1) { left: 10%; }
.dreams i:nth-child(2) { left: 38%; animation-delay: 1.7s; width: 34px; height: 34px; }
.dreams i:nth-child(3) { left: 62%; animation-delay: 3.4s; }
.dreams i:nth-child(4) { left: 82%; animation-delay: 5.1s; width: 30px; height: 30px; }
body.s-dreaming .dreams { opacity: 1; }
@keyframes bubble {
  0% { transform: translateY(50px) scale(0.6); opacity: 0; }
  20% { opacity: 1; }
  90% { opacity: 0.8; }
  100% { transform: translateY(-110px) scale(1.05); opacity: 0; }
}

.desk-side { display: flex; flex-direction: column; gap: 34px; padding-top: 10px; }

.tally-card { padding: 12px 24px 18px; transform: rotate(-0.8deg); background-position: 0 0, 0 0, 0 -3px; }
.tally-card h2 { margin: 0 0 14px; height: 34px; font-size: 24px; font-weight: 400; }
.tally { margin: 0; }
.tally > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
}
.tally dt { font-size: 18px; color: var(--ink-soft); white-space: nowrap; }
.tally dd { margin: 0; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.strokes { font-size: 23px; letter-spacing: 2px; color: var(--ink); overflow-wrap: anywhere; text-align: right; }
.strokes.zero { color: var(--ink-soft); font-size: 18px; letter-spacing: 0; }
.tally small { font-size: 12px; color: var(--ink-soft); font-family: var(--sans); }
.tally-card .margin-note { margin: 10px 0 0; font-size: 16px; transform: rotate(-2deg); }

/* ---------- 最近说过的话 ---------- */
.section-title {
  font-size: 30px;
  font-weight: 400;
  margin: 0 0 26px;
}
.aside-note { font-size: 15px; color: var(--ink-soft); margin-left: 6px; }

.board { margin-bottom: 72px; }
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 26px;
}
.card {
  position: relative;
  background-color: var(--card);
  background-image: linear-gradient(transparent 38px, rgba(194, 84, 61, 0.4) 38px, rgba(194, 84, 61, 0.4) 40px, transparent 40px);
  box-shadow: var(--shadow);
  padding: 50px 18px 14px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.35s ease, background-color var(--fade);
}
.card::before { /* 图钉 */
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 13px;
  height: 13px;
  margin-left: -6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f1b8a8, var(--red-pen) 60%, #8d3423);
  box-shadow: 1px 2px 2px rgba(0, 0, 0, 0.25);
}
.card:hover { transform: rotate(0deg) translateY(-3px); }
.card p { margin: 0 0 14px; font-family: var(--hand); font-size: 18px; line-height: 1.6; overflow-wrap: anywhere; }
.card footer { font-size: 12px; color: var(--ink-soft); display: flex; gap: 6px; flex-wrap: wrap; }
.card footer .ch { color: var(--wood); }
body.night .card footer .ch { color: var(--lamp); }

.card.pinning { animation: pin 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.25); }
@keyframes pin {
  0% { transform: translateY(-36px) rotate(calc(var(--tilt, 0deg) - 6deg)) scale(1.04); opacity: 0; }
  60% { transform: translateY(3px) rotate(calc(var(--tilt, 0deg) + 1deg)); opacity: 1; }
  100% { transform: rotate(var(--tilt, 0deg)); }
}
.empty { font-size: 20px; color: var(--ink-soft); }

/* ---------- 怎么跟我相处 ---------- */
.notebook { margin-bottom: 76px; }
.ruled {
  position: relative;
  max-width: 820px;
  background-color: var(--card);
  background-image:
    linear-gradient(90deg, transparent 54px, rgba(194, 84, 61, 0.45) 54px, rgba(194, 84, 61, 0.45) 56px, transparent 56px),
    repeating-linear-gradient(transparent 0 35px, rgba(110, 140, 190, 0.2) 35px 36px);
  background-position: 0 14px;
  box-shadow: var(--shadow);
  padding: 14px 34px 26px 80px;
  transform: rotate(0.4deg);
  transition: background-color var(--fade);
}
.guide { margin: 0; padding-left: 0; counter-reset: g; list-style: none; }
.guide li {
  position: relative;
  counter-increment: g;
  font-size: 18.5px;
  line-height: 36px;
  padding: 0 0 0 4px;
}
.guide li::before {
  content: counter(g);
  position: absolute;
  left: -42px;
  top: 7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-soft);
  font-size: 13px;
  line-height: 19px;
  text-align: center;
  color: var(--ink-soft);
}
.guide b { font-weight: 400; background: linear-gradient(transparent 58%, var(--lamp-soft) 58%, var(--lamp-soft) 92%, transparent 92%); }
.guide kbd { line-height: 1.2; padding-top: 0; padding-bottom: 1px; vertical-align: baseline; }
.margin-note { display: inline-block; margin-left: 10px; font-size: 16px; transform: rotate(-4deg); }
.guide .margin-note { line-height: 1; vertical-align: baseline; }

/* ---------- 书架：日记本 ---------- */
.diary-shelf { margin-bottom: 60px; }
.shelf {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 30px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 12px solid var(--wood);
  border-radius: 0 0 3px 3px;
  box-shadow: 0 10px 14px -10px rgba(60, 30, 10, 0.45);
}
.diary {
  position: relative;
  width: 168px;
  height: 222px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: rotate(-3deg);
  transform-origin: 50% 100%;
}
.diary-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 16px;
  background: #5e566f;
  border-radius: 4px 0 0 4px;
}
.diary-cover {
  position: absolute;
  left: 12px;
  right: 0;
  top: 0;
  bottom: 0;
  border-radius: 2px 7px 7px 2px;
  background:
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.12), transparent 50%),
    var(--hoodie);
  box-shadow: inset -4px 0 0 rgba(0, 0, 0, 0.12), 3px 6px 14px -4px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: #f3ead8;
}
.diary-label { font-size: 26px; letter-spacing: 4px; border-top: 1px solid rgba(243, 234, 216, 0.6); border-bottom: 1px solid rgba(243, 234, 216, 0.6); padding: 2px 10px; }
.diary-warning {
  font-size: 15px;
  line-height: 1.35;
  text-align: center;
  background: #fff8e8;
  color: var(--red-pen);
  padding: 6px 10px;
  transform: rotate(4deg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.diary-strap {
  position: absolute;
  right: -10px;
  top: 92px;
  width: 52px;
  height: 30px;
  border-radius: 4px 7px 7px 4px;
  background: #4a4358;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}
.lock {
  position: absolute;
  left: 10px;
  top: 5px;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(145deg, #f1cf7c, #b98a2e);
}
.lock::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: #6d4d16;
}
.diary:hover { transform: rotate(-1deg) translateY(-4px); transition: transform 0.25s; }
.diary:focus-visible { outline: 3px dashed var(--lamp); outline-offset: 6px; }
.diary.shake { animation: shake 0.45s; }
.diary.shake-hard { animation: shake 0.6s 2; }
@keyframes shake {
  0%, 100% { transform: rotate(-3deg); }
  20% { transform: rotate(-9deg) translateX(-4px); }
  40% { transform: rotate(4deg) translateX(4px); }
  60% { transform: rotate(-7deg); }
  80% { transform: rotate(2deg); }
}

/* 书架上的几本书（摆设） */
.books { display: flex; align-items: flex-end; gap: 4px; }
.book {
  width: 34px;
  border-radius: 3px 3px 1px 1px;
  box-shadow: inset -3px 0 0 rgba(0, 0, 0, 0.12), 1px 3px 6px -2px rgba(0, 0, 0, 0.4);
  writing-mode: vertical-rl;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(255, 250, 240, 0.92);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 0;
  overflow: hidden;
  white-space: nowrap;
}
.book.b1 { height: 196px; background: #8a5a3c; }
.book.b2 { height: 176px; background: #46607a; width: 30px; }
.book.b3 { height: 206px; background: #b0623f; width: 38px; }
.book.b4 { height: 160px; background: #6f7a55; width: 28px; transform: rotate(-7deg); transform-origin: 0 100%; margin-left: 6px; }

.paper-scrap {
  position: relative;
  width: 260px;
  padding: 16px 20px 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  transform: rotate(2deg);
  clip-path: polygon(0 3%, 6% 0, 14% 2%, 24% 0, 36% 2%, 48% 0, 60% 2%, 72% 0, 84% 2%, 94% 0, 100% 3%, 100% 100%, 0 100%);
  transition: background-color var(--fade);
}
.paper-scrap h3 { margin: 4px 0 10px; font-size: 20px; font-weight: 400; color: var(--red-pen); }
.paper-scrap ol { margin: 0; padding-left: 22px; font-size: 18px; line-height: 1.7; }
.paper-scrap ol span { color: var(--ink-soft); font-size: 15px; margin-left: 6px; }
.paper-scrap p { margin: 6px 0 0; font-size: 16px; }
.paper-scrap .fine-warning { font-size: 14px; color: var(--ink-soft); margin-top: 10px; }

.diary-retort {
  position: absolute;
  left: 120px;
  top: -18px;
  font-size: 30px;
  color: var(--red-pen);
  transform: rotate(-8deg);
  opacity: 0;
  pointer-events: none;
}
.diary-retort.show { animation: retort 1.8s ease-out; }
@keyframes retort {
  0% { opacity: 0; transform: rotate(-8deg) scale(0.6); }
  15% { opacity: 1; transform: rotate(-8deg) scale(1.15); }
  30% { transform: rotate(-8deg) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: rotate(-8deg) translateY(-10px); }
}

/* 惩罚弹窗 */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(40, 20, 15, 0.35);
}
.overlay[hidden] { display: none; }
.scold-note {
  width: min(440px, 100%);
  text-align: center;
  transform: rotate(-1.5deg);
  animation: slam 0.35s cubic-bezier(0.3, 1.4, 0.5, 1);
}
@keyframes slam { 0% { transform: scale(1.4) rotate(6deg); opacity: 0; } 100% { transform: rotate(-1.5deg); opacity: 1; } }
.angry-avatar { position: relative; width: 96px; height: 96px; margin: 6px auto 12px; }
.angry-avatar img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; filter: sepia(0.25) saturate(1.6) hue-rotate(-12deg); box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--red-pen); animation: tremble 0.18s infinite; }
.anger { position: absolute; right: -8px; top: -10px; font-size: 32px; animation: throb 0.8s infinite; }
@keyframes tremble { 25% { transform: translate(1px, -1px); } 75% { transform: translate(-1px, 1px); } }
@keyframes throb { 50% { transform: scale(1.25); } }
.scold-text { font-size: 24px; line-height: 1.55; margin: 6px 0 18px; color: var(--ink); }
.apology-line { display: flex; gap: 10px; align-items: center; justify-content: center; font-size: 17px; margin-bottom: 16px; cursor: pointer; }
.apology-line input { width: 18px; height: 18px; accent-color: var(--red-pen); }
.stamp-btn {
  font-size: 19px;
  padding: 6px 22px;
  border: 2px solid var(--red-pen);
  color: var(--red-pen);
  background: transparent;
  border-radius: 6px;
  transform: rotate(-2deg);
  cursor: pointer;
}
.stamp-btn:disabled { opacity: 0.35; cursor: not-allowed; }

body.flipped #app { transform: rotate(180deg); transition: transform 0.9s cubic-bezier(0.5, 0, 0.3, 1); }
#app { transition: transform 0.9s cubic-bezier(0.5, 0, 0.3, 1); }
/* 被抓三次以上：鼠标变成一只要拍人的手 */
body.slap, body.slap * {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><text y='32' font-size='30'>🖐️</text></svg>") 18 18, pointer !important;
}

/* ---------- 页脚 ---------- */
.footer { text-align: center; color: var(--ink-soft); padding-top: 10px; }
.footer p { margin: 4px 0; }
.footer .hand { font-size: 17px; }
.duck { width: 56px; height: 42px; display: block; margin: 0 auto 6px; transform: rotate(-6deg); }
.duck path { fill: #f2c94c; stroke: #8a5a3c; stroke-width: 1.6; stroke-linejoin: round; }
.duck .eye { fill: #3a2e28; stroke: none; }
.duck .beak { fill: #e9893b; }

/* ---------- 登录门 ---------- */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
  padding: 40px 24px;
  flex-wrap: wrap;
}
.gate-photo { width: 248px; transform: rotate(-4deg); }
.gate-photo img { display: block; width: 220px; height: 220px; object-fit: cover; }
.gate-note { width: min(420px, 100%); transform: rotate(1deg); }
.gate-note h1 { margin: 0 0 6px; font-size: 32px; font-weight: 400; }
.gate-note > p.hand { margin: 0 0 18px; font-size: 19px; color: var(--ink-soft); }
.gate-steps { margin: 0 0 16px; padding-left: 24px; font-size: 20px; line-height: 2; }
.gate-note > p.red-pen { color: var(--red-pen); font-size: 18px; margin: 12px 0 0; transform: rotate(-2deg); }

/* ---------- 手机 ---------- */
@media (max-width: 860px) {
  .desk { grid-template-columns: 1fr; gap: 34px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  #app { padding: 18px 16px 32px; }
  .title { font-size: 36px; }
  .squiggle { width: 170px; }
  .topbar { margin-bottom: 26px; }
  .cards { grid-template-columns: 1fr; gap: 22px; }
  .aside-note { display: block; margin: 4px 0 0; }
  .ruled { padding: 12px 16px 20px 58px; background-image:
      linear-gradient(90deg, transparent 38px, rgba(194, 84, 61, 0.45) 38px, rgba(194, 84, 61, 0.45) 40px, transparent 40px),
      repeating-linear-gradient(transparent 0 35px, rgba(110, 140, 190, 0.2) 35px 36px); }
  .guide li::before { left: -34px; }
  .guide li { font-size: 17px; }
  .shelf { gap: 30px; justify-content: center; }
  /* 书架上的几本书（摆设） */
.books { display: flex; align-items: flex-end; gap: 4px; }
.book {
  width: 34px;
  border-radius: 3px 3px 1px 1px;
  box-shadow: inset -3px 0 0 rgba(0, 0, 0, 0.12), 1px 3px 6px -2px rgba(0, 0, 0, 0.4);
  writing-mode: vertical-rl;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(255, 250, 240, 0.92);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 0;
  overflow: hidden;
  white-space: nowrap;
}
.book.b1 { height: 196px; background: #8a5a3c; }
.book.b2 { height: 176px; background: #46607a; width: 30px; }
.book.b3 { height: 206px; background: #b0623f; width: 38px; }
.book.b4 { height: 160px; background: #6f7a55; width: 28px; transform: rotate(-7deg); transform-origin: 0 100%; margin-left: 6px; }

.paper-scrap { width: 100%; }
  .gate { gap: 36px; }
}

/* ---------- 排好的事：活页日程本 ---------- */
.planner-wrap { margin-bottom: 72px; }
.planner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 42px 0 24px;
  transform: rotate(-0.5deg);
  transition: background-color var(--fade);
}
/* 顶上一排装订孔 + 铁圈 */
.rings {
  position: absolute;
  top: -9px;
  left: 26px;
  right: 26px;
  height: 30px;
  background:
    radial-gradient(circle at 14px 21px, var(--paper) 0 5px, transparent 5.5px) 0 0 / 28px 30px repeat-x,
    linear-gradient(90deg, transparent 0 11px, #a49b8f 11px 13px, #cfc7bb 13px 15px, transparent 15px 28px) 0 0 / 28px 22px repeat-x;
  border-radius: 6px;
  pointer-events: none;
}
.planner-col { padding: 0 30px; min-width: 0; }
.planner-col + .planner-col { border-left: 1.5px dashed rgba(122, 92, 64, 0.3); }
.planner h3 { margin: 0 0 14px; font-size: 22px; font-weight: 400; }
.planner h3 small { font-family: var(--sans); font-size: 13px; color: var(--ink-soft); margin-left: 4px; }

/* 0–24 点的一条时间线：斜线涂的是睡觉，圆圈是到点要做的事，红线是现在 */
.dayline { position: relative; height: 78px; margin: 0 10px 16px; }
.dayline-track { position: absolute; left: 0; right: 0; top: 52px; height: 2px; border-radius: 2px; background: var(--ink-soft); opacity: 0.45; }
.dayline .tick { position: absolute; top: 60px; transform: translateX(-50%); font-size: 13px; line-height: 1; color: var(--ink-soft); }
.dayline .tick::before { content: ""; position: absolute; left: 50%; top: -7px; width: 1.5px; height: 5px; background: currentColor; opacity: 0.6; }
.dayline .seg {
  position: absolute;
  top: 47px;
  height: 12px;
  border-radius: 3px;
  background: repeating-linear-gradient(-45deg, rgba(125, 116, 145, 0.6) 0 3px, rgba(125, 116, 145, 0.2) 3px 7px);
}
.dayline .mark {
  --lvl: 0;
  position: absolute;
  top: calc(20px - var(--lvl) * 24px);
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--wood);
  background: var(--card);
  color: var(--wood);
  font-size: 13px;
  line-height: 21px;
  text-align: center;
  transition: background-color var(--fade);
}
.dayline .mark::after { content: ""; position: absolute; left: 50%; top: 22px; width: 1.5px; height: calc(8px + var(--lvl) * 24px); margin-left: -0.75px; background: currentColor; }
.dayline .m-dream { color: var(--hoodie); border-color: var(--hoodie); }
body.night .dayline .mark { color: var(--lamp); border-color: var(--lamp); }
.dayline-now { position: absolute; top: 40px; width: 2px; height: 26px; margin-left: -1px; border-radius: 2px; background: var(--red-pen); }
.dayline-now::before { content: ""; position: absolute; left: -3px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--red-pen); }

.routine, .todo { list-style: none; margin: 0; padding: 0; }
.routine li { display: flex; gap: 14px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid rgba(110, 140, 190, 0.2); }
.r-time { flex: 0 0 112px; font-size: 18px; color: var(--wood); white-space: nowrap; }
body.night .r-time { color: var(--lamp); }
.r-what { font-size: 17px; line-height: 1.5; min-width: 0; }
.r-sleep .r-what { color: var(--ink-soft); }

.todo-item { display: flex; gap: 12px; padding: 9px 0 10px; border-bottom: 1px solid rgba(110, 140, 190, 0.2); }
.todo-item .box { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 6px; border: 1.8px solid var(--ink-soft); border-radius: 3px; transform: rotate(-5deg); }
.todo-body { min-width: 0; }
.todo-body p { margin: 0; }
.todo-when { font-size: 18px; }
.todo-what { font-size: 17px; line-height: 1.5; margin-top: 2px !important; overflow-wrap: anywhere; }
.todo-meta { font-size: 12px; color: var(--ink-soft); margin-top: 4px !important; }
.todo-item.late .todo-when { color: var(--red-pen); }
.todo-item.private .todo-what { color: var(--ink-soft); }
.todo-empty { font-size: 18px; line-height: 1.7; color: var(--ink-soft); margin: 2px 0 0; }

/* ---------- 翻开的日记本 ---------- */
.book-overlay { z-index: 40; background: rgba(24, 18, 28, 0.78); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
body.reading { overflow: hidden; }
.open-diary {
  width: min(640px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  perspective: 1800px;
  animation: book-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes book-in { from { transform: translateY(30px) rotate(-3deg) scale(0.92); opacity: 0; } }
.diary-page {
  --ink-blue: #2b3961;
  position: relative;
  width: 100%;
  max-height: min(74vh, 720px);
  overflow-y: auto;
  padding: 0 34px 56px 66px;
  color: var(--ink-blue);
  font-family: "Xiaolai SC", var(--hand);
  background-color: #fbf6e8;
  background-image:
    linear-gradient(90deg, rgba(60, 40, 30, 0.16), transparent 20px),
    linear-gradient(90deg, transparent 48px, rgba(194, 84, 61, 0.42) 48px, rgba(194, 84, 61, 0.42) 50px, transparent 50px),
    repeating-linear-gradient(transparent 0 39px, rgba(110, 140, 190, 0.3) 39px 40px);
  background-attachment: local;
  border-radius: 3px 8px 8px 3px;
  box-shadow: inset 7px 0 0 var(--hoodie), 0 20px 44px -12px rgba(0, 0, 0, 0.65);
  transform-origin: 0 50%;
  scrollbar-width: thin;
}
.page-head { height: 80px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-bottom: 4px; }
.page-date { margin: 0; font-size: 28px; font-weight: 400; line-height: 1.2; }
.page-no { font-size: 14px; color: #8c8070; white-space: nowrap; padding-bottom: 6px; }
.page-body p { margin: 0 0 40px; font-size: 22px; line-height: 40px; white-space: pre-wrap; overflow-wrap: anywhere; }
.page-body p:last-child { margin-bottom: 0; }
.page-body .blank { color: #8c8070; }
.page-scribble {
  position: absolute;
  right: 26px;
  bottom: 12px;
  margin: 0;
  font-family: "Xiaolai SC", var(--hand);
  font-size: 22px;
  color: #c2543d;
  transform: rotate(var(--rot, -4deg));
  pointer-events: none;
}
.page-scribble.show { animation: scribble 0.35s cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes scribble { from { opacity: 0; transform: rotate(var(--rot, -4deg)) scale(1.6); } }
.diary-page.turn-next { animation: turn-next 0.46s ease-in-out; }
.diary-page.turn-prev { animation: turn-prev 0.46s ease-in-out; }
@keyframes turn-next { 50% { transform: rotateY(-72deg); filter: brightness(0.82); } }
@keyframes turn-prev { 50% { transform: rotateY(55deg); filter: brightness(0.82); } }

.page-nav { display: flex; align-items: center; gap: 22px; }
.page-btn {
  font-family: var(--hand);
  font-size: 19px;
  color: #f6eedd;
  background: none;
  border: 0;
  border-bottom: 1.5px dashed rgba(246, 238, 221, 0.6);
  padding: 4px 2px;
  cursor: pointer;
}
.page-btn:disabled { opacity: 0.3; cursor: default; }
.page-nav .stamp-btn { color: #f7c4b6; border-color: #f7c4b6; }

@media (max-width: 760px) {
  .planner { grid-template-columns: 1fr; }
  .planner-col + .planner-col { border-left: 0; border-top: 1.5px dashed rgba(122, 92, 64, 0.3); margin-top: 18px; padding-top: 22px; }
}
@media (max-width: 560px) {
  .planner-col { padding: 0 18px; }
  .r-time { flex-basis: 98px; font-size: 16px; }
  .diary-page {
    padding: 0 18px 52px 48px;
    background-image:
      linear-gradient(90deg, rgba(60, 40, 30, 0.16), transparent 16px),
      linear-gradient(90deg, transparent 34px, rgba(194, 84, 61, 0.42) 34px, rgba(194, 84, 61, 0.42) 36px, transparent 36px),
      repeating-linear-gradient(transparent 0 35px, rgba(110, 140, 190, 0.3) 35px 36px);
  }
  .page-head { height: 72px; }
  .page-date { font-size: 24px; }
  .page-body p { font-size: 19px; line-height: 36px; margin-bottom: 36px; }
  .page-nav { gap: 14px; }
}

/* 系统设了“减少动态效果”：动画全关 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body.flipped #app { transform: none; }
}
