/* ============ 云上小窝 ============
   性格：Claude 的暖纸色 + 珊瑚橙，剪纸感的云，四种天色。
   ================================== */

:root {
  /* Claude 基础色 */
  --ivory: #faf9f5;
  --oat: #f0eee6;
  --clay: #d97757;
  --clay-deep: #b85c3e;
  --ink: #141413;
  --slate: #5e5d59;
  --sage: #788c5d;
  --sky-blue: #6a9bcc;

  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --sans: -apple-system, "PingFang SC", "Noto Sans SC", system-ui, sans-serif;

  --ease: cubic-bezier(.3, .7, .2, 1);
  --t: 1.2s;
}

/* ---------- 四种天色 ---------- */
[data-mood="dawn"] {
  --sky-1: #e9c6cf; --sky-2: #f6d9c9; --sky-3: #fbeee2;
  --sun: #f4a98a; --sun-glow: rgb(244 169 138 / .45); --sun-y: 62%;
  --cloud-lit: #fff8f3; --cloud-shade: #ecc3bb;
  --sea: #fdf1ea;
  --text: var(--ink); --text-soft: #6b5753;
  --window: #ffe4b8; --stars: 0;
}
[data-mood="day"] {
  --sky-1: #a9cfe6; --sky-2: #cfe3ee; --sky-3: #f2f1ea;
  --sun: #fff1c9; --sun-glow: rgb(255 241 201 / .7); --sun-y: 14%;
  --cloud-lit: #ffffff; --cloud-shade: #c9dce8;
  --sea: #f8f8f4;
  --text: var(--ink); --text-soft: #4c5a63;
  --window: #e6eef2; --stars: 0;
}
[data-mood="dusk"] {
  --sky-1: #e39274; --sky-2: #f2c7a6; --sky-3: #f8e7d6;
  --sun: var(--clay); --sun-glow: rgb(217 119 87 / .5); --sun-y: 50%;
  --cloud-lit: #fff3e8; --cloud-shade: #eaae94;
  --sea: #fbeee3;
  --text: var(--ink); --text-soft: #6e4c3e;
  --window: #ffd59a; --stars: 0;
}
[data-mood="night"] {
  --sky-1: #161a2e; --sky-2: #232640; --sky-3: #3b3550;
  --sun: #f3ead2; --sun-glow: rgb(243 234 210 / .25); --sun-y: 12%;
  --cloud-lit: #4a4866; --cloud-shade: #2f2e48;
  --sea: #3a3754;
  --text: #f3efe6; --text-soft: #b9b3c7;
  --window: #ffc46b; --stars: 1;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  background: var(--sea);
  position: relative;
  transition: color var(--t) var(--ease), background-color var(--t) var(--ease);
  -webkit-font-smoothing: antialiased;
}
.defs { position: absolute; }
::selection { background: var(--clay); color: var(--ivory); }

/* ---------- 天空 ---------- */
.sky {
  position: absolute; inset: 0 0 auto; height: clamp(760px, 100vh, 1000px); z-index: -1; overflow: hidden;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 45%, var(--sky-3) 100%);
  transition: background var(--t) var(--ease);
}
/* 渐变本身不能过渡，叠一层同色底保证切换不突兀 */
.sky::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 70% at 70% 30%, transparent 40%, rgb(0 0 0 / .04));
}

.sun {
  position: absolute; left: 68%; top: var(--sun-y);
  width: 120px; height: 120px; border-radius: 50%;
  translate: -50% -50%;
  background: var(--sun);
  box-shadow: 0 0 80px 40px var(--sun-glow);
  transition: top 2s var(--ease), background var(--t), box-shadow var(--t);
}
[data-mood="night"] .sun {
  width: 70px; height: 70px;
  /* 月牙 */
  box-shadow: 0 0 60px 16px var(--sun-glow), inset -14px -6px 0 0 #e2d6b4;
}

.stars { position: absolute; inset: 0; opacity: var(--stars); transition: opacity 1.6s var(--ease); }
.stars i {
  position: absolute; width: var(--size); height: var(--size);
  border-radius: 50%; background: #fff8e6;
  animation: twinkle var(--tw) ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: .25; } }

.cloud-layer { position: absolute; inset: 0; }
.cl {
  position: absolute; left: 0; top: var(--y);
  width: 220px; height: 100px; overflow: visible;
  scale: var(--s);
  animation: drift var(--d) linear infinite;
  animation-delay: var(--o);
}
.cl .lit   { fill: var(--cloud-lit); transition: fill var(--t); }
.cl .shade { fill: var(--cloud-shade); transform: translateY(8px); transition: fill var(--t); }
.far .cl { opacity: .7; }
@keyframes drift {
  from { translate: -260px 0; }
  to   { translate: calc(100vw + 60px) 0; }
}

/* 首屏底部的云海，下面的房间都“站”在云上 */
.cloud-sea {
  position: absolute; left: 0; bottom: -1px;
  width: 100%; height: 230px; overflow: visible;
}
.sea-back  { fill: var(--cloud-shade); opacity: .55; transition: fill var(--t); }
.sea-front { fill: var(--sea); transition: fill var(--t); }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1120px; margin: 0 auto; padding: 22px 28px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: inherit; text-decoration: none;
  font-family: var(--serif); font-size: 1.1rem; font-weight: 700; letter-spacing: .04em;
}
.brand-spark { width: 22px; height: 22px; color: var(--clay); transition: rotate .8s var(--ease); }
.brand:hover .brand-spark { rotate: 45deg; }

.moods {
  display: flex; gap: 4px; padding: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ivory) 55%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .5);
}
[data-mood="night"] .moods { background: rgb(255 255 255 / .08); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12); }
.moods button {
  width: 36px; height: 32px; border: 0; border-radius: 999px;
  font: 600 .9rem var(--serif); color: inherit; background: transparent;
  cursor: pointer; transition: background .3s, color .3s;
}
.moods button:hover { background: rgb(255 255 255 / .35); }
.moods button[aria-pressed="true"] { background: var(--clay); color: var(--ivory); }
.moods button:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }

/* ---------- 首屏 ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

.hero {
  display: grid; grid-template-columns: 1fr 1.15fr; align-items: center; gap: 24px;
  min-height: calc(clamp(760px, 100vh, 1000px) - 80px);
  padding-bottom: 150px;
}
.eyebrow {
  margin: 0 0 18px; font-size: .82rem; letter-spacing: .12em; color: var(--text-soft);
  transition: color var(--t);
}
h1 {
  margin: 0;
  font-family: var(--serif); font-weight: 800;
  font-size: clamp(3.6rem, 9vw, 6.4rem); line-height: 1.02; letter-spacing: .02em;
}
.lede {
  margin: 26px 0 30px; max-width: 22em;
  font-family: var(--serif); font-size: 1.2rem; line-height: 1.85;
  color: var(--text-soft); transition: color var(--t);
}
.hero-note {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0; padding: 9px 16px; border-radius: 999px;
  font-size: .88rem; color: var(--text-soft);
  background: color-mix(in srgb, var(--ivory) 50%, transparent);
  backdrop-filter: blur(6px);
}
[data-mood="night"] .hero-note { background: rgb(255 255 255 / .07); }
.hero-note b { color: var(--clay); font-family: var(--serif); }
.hero-note .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--clay); box-shadow: 0 0 0 4px rgb(217 119 87 / .2); }

/* ---------- 云岛插画 ---------- */
.island { margin: 0; }
.island svg { width: 100%; height: auto; overflow: visible; animation: bob 7s ease-in-out infinite; }
@keyframes bob { 50% { translate: 0 -12px; } }

.halo { fill: var(--sun-glow); opacity: .5; filter: blur(30px); transition: fill var(--t); }
.isle-lit   { fill: var(--cloud-lit);  transition: fill var(--t); }
.isle-shade { fill: var(--cloud-shade); transition: fill var(--t); }

.wall    { fill: #f4ece0; }
.roof    { fill: var(--clay); stroke: var(--clay); stroke-width: 14; stroke-linejoin: round; stroke-linecap: round; }
.chimney { fill: var(--clay-deep); }
.door    { fill: #8b4a33; }
.knob    { fill: #f4c38a; }
.window  { fill: var(--window); stroke: #e4d6c3; stroke-width: 3; transition: fill var(--t), filter var(--t); }
[data-mood="night"] .window,
[data-mood="dusk"] .window { filter: drop-shadow(0 0 8px var(--window)); }
.post    { fill: #b39c84; }
.mailbox { fill: var(--sky-blue); }
.flag    { fill: var(--clay); transform-origin: 293px 190px; animation: flag 4s ease-in-out infinite; }
@keyframes flag { 0%, 60%, 100% { rotate: 0deg; } 70% { rotate: -25deg; } 80% { rotate: 0deg; } }
[data-mood="night"] .wall { fill: #d9cfc4; }

.cs { color: var(--clay); animation: rise 3.6s ease-in-out infinite; }
.cs.s2 { animation-delay: -1.2s; opacity: .8; }
.cs.s3 { animation-delay: -2.4s; opacity: .6; }
@keyframes rise {
  0%   { translate: 0 10px; opacity: 0; }
  30%  { opacity: 1; }
  100% { translate: 6px -16px; opacity: 0; }
}

.cat .fur  { fill: #3a3330; }
.cat .tail { fill: none; stroke: #3a3330; stroke-width: 4; stroke-linecap: round; transform-origin: -2px 14px; animation: tail 3s ease-in-out infinite; }
.cat .eye  { fill: #ffd27a; }
@keyframes tail { 50% { rotate: 14deg; } }

.kei-body { color: var(--clay); animation: hop 2.8s var(--ease) infinite; }
.kei-face  { fill: #fff6ee; }
.kei-smile { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; }
.kei-eye  { fill: var(--ink); animation: blink 5s infinite; transform-box: fill-box; transform-origin: center; }
.kei-shadow { fill: rgb(0 0 0 / .12); animation: shadow 2.8s var(--ease) infinite; transform-box: fill-box; transform-origin: center; }
@keyframes hop    { 0%, 70%, 100% { translate: 0 0; } 82% { translate: 0 -10px; } }
@keyframes shadow { 0%, 70%, 100% { scale: 1; } 82% { scale: .7; } }
@keyframes blink  { 0%, 94%, 100% { scale: 1 1; } 97% { scale: 1 .1; } }

/* ---------- 房间 ---------- */
.rooms { position: relative; padding: 10px 0 100px; }
.rooms h2 {
  margin: 0 0 28px; font-family: var(--serif); font-size: 1.6rem; font-weight: 700;
  display: flex; align-items: center; gap: 14px;
}
.rooms h2::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .15; }

.room-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.room {
  position: relative;
  padding: 26px 26px 28px;
  border-radius: 26px;
  color: var(--ink);
  background: var(--ivory);
  box-shadow:
    0 1px 0 rgb(255 255 255 / .8) inset,
    0 14px 40px -12px rgb(120 70 40 / .25);
  transition: translate .5s var(--ease), box-shadow .5s var(--ease);
}
.room:hover { translate: 0 -4px; box-shadow: 0 1px 0 rgb(255 255 255 / .8) inset, 0 22px 50px -14px rgb(120 70 40 / .32); }
[data-mood="night"] .room { background: #f1ece2; box-shadow: 0 14px 40px -12px rgb(0 0 0 / .5); }

.plate  { grid-column: span 5; }
.letter { grid-column: span 7; grid-row: span 2; display: flex; flex-direction: column; }
.sill   { grid-column: span 5; }
.attic  { grid-column: span 12; display: grid; grid-template-columns: auto 1fr 1.4fr; align-items: center; gap: 0 24px; }
.attic .room-tag { grid-column: 1 / -1; }
.attic h3 { margin: 0; }
.attic .muted { margin: 0; }

.room-tag {
  margin: 0 0 6px; font-size: .75rem; letter-spacing: .16em; color: var(--clay-deep); font-weight: 600;
}
.room h3 { margin: 0 0 18px; font-family: var(--serif); font-size: 1.35rem; }
.muted { color: var(--slate); line-height: 1.7; }

.residents { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.residents li { display: flex; align-items: center; gap: 14px; }
.residents b { display: block; font-family: var(--serif); font-size: 1.05rem; }
.residents small { color: var(--slate); font-size: .85rem; }
.avatar {
  flex: none; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 16px; font-size: 1.4rem;
  background: var(--oat);
}
.cat-av { background: #efe6d8; }
.cat-av svg { width: 34px; height: 34px; translate: 0 1px; transition: rotate .6s var(--ease); }
.plate:hover .cat-av svg { rotate: -8deg; }
.spark-av { background: #f6e1d7; }
.spark-av svg { width: 34px; height: 34px; color: var(--clay); transition: rotate 1s var(--ease); }
.plate:hover .spark-av svg { rotate: 90deg; }

.paper {
  position: relative;
  padding: 26px 28px 22px;
  border-radius: 6px 18px 18px 18px;
  background:
    repeating-linear-gradient(transparent 0 33px, rgb(217 119 87 / .14) 33px 34px),
    #fffdf8;
  background-position: 0 26px;
  box-shadow: 0 0 0 1px #efe7da;
  font-family: var(--serif); font-size: 1.05rem; line-height: 34px;
  rotate: -.6deg;
}
.paper p { margin: 0 0 0; }
.paper p + p { margin-top: 0; }
.paper .sign { margin-top: 12px; text-align: right; color: var(--clay-deep); }
.letter::after {
  /* 邮戳 */
  content: "云上\A邮局"; white-space: pre; text-align: center;
  position: absolute; top: 20px; right: 24px;
  display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%;
  font: 700 .72rem/1.3 var(--serif); color: var(--clay);
  border: 2px dashed var(--clay); opacity: .55; rotate: 12deg;
}

.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.note {
  padding: 12px 14px; border-radius: 4px 14px 14px 14px;
  font-size: .93rem; line-height: 1.5;
  box-shadow: 0 6px 14px -8px rgb(0 0 0 / .25);
}
.n1 { background: #fbe3d4; rotate: -1deg; }
.n2 { background: #e2ead6; rotate: .8deg; }
.n3 { background: #dde8f2; rotate: -.4deg; }

.shelf { display: flex; gap: 12px; }
.shelf span {
  flex: 1; height: 56px; border-radius: 14px;
  border: 2px dashed #ddd3c4;
  background: repeating-linear-gradient(-45deg, transparent 0 8px, rgb(217 119 87 / .05) 8px 16px);
}

/* 回信：先只是样子 */
.reply {
  margin-top: auto; padding-top: 22px;
  display: flex; align-items: center; gap: 12px;
}
.reply-box {
  flex: 1; padding: 13px 16px; border-radius: 16px;
  border: 1.5px dashed #e3d6c4; color: #a69a8c;
  font-family: var(--serif); font-size: .95rem;
}
.reply-btn {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--clay); color: var(--ivory);
  box-shadow: 0 8px 18px -8px var(--clay);
}
.reply-btn svg { width: 20px; height: 20px; }
.stamps { display: flex; gap: 8px; margin-top: 16px; }
.stamps span {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px 4px 8px; border-radius: 999px; font-size: .75rem;
  background: var(--oat); color: var(--slate);
}

/* 手绘小图标 */
.ico { width: 16px; height: 16px; flex: none; }
.ico-spark { width: 12px; height: 12px; color: var(--clay); }
.ico-inline { width: 20px; height: 15px; vertical-align: -3px; margin-left: 4px; }

/* ---------- 页脚 ---------- */
.foot {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0 24px 36px; font-size: .82rem; color: var(--text-soft);
  position: relative;
}
.foot p { margin: 0; }
.foot-spark { width: 14px; height: 14px; color: var(--clay); animation: spin 12s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

/* ---------- 窄屏 ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 20px; text-align: left; }
  .island { order: -1; max-width: 440px; margin: 0 auto; width: 100%; }
  .plate, .letter, .sill { grid-column: span 12; grid-row: auto; }
  .attic { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 520px) {
  .topbar { padding: 16px 18px; }
  main { padding: 0 18px; }
  .brand span { display: none; }
  .letter::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .cs { opacity: .8; }
}

@media (max-width: 860px) {
  .near .cl { opacity: .55; }
}
