/* ============ 技术宅也很可爱 · imcute.tech ============ */
:root {
  --pink: #ff8fc0;
  --pink-soft: #ffd6e8;
  --mint: #4fd8b5;
  --mint-soft: #c9f7ea;
  --lav: #a98bff;
  --lav-soft: #e5dcff;
  --cream: #fff8fb;
  --ink: #4a3a5c;
  --ink-soft: #8a7a9c;
  --night: #2a2347;
  --radius: 28px;
  --shadow: 0 18px 50px -18px rgba(170, 90, 150, .45);
  /* 寒蝉圆黑体每个字重是独立的 family 名，按粗细分三档 */
  --fallback: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font: "Chill Round Gothic", var(--fallback);
  --font-bold: "Chill Round Gothic Bold", var(--fallback);
  --font-heavy: "Chill Round Gothic Heavy", var(--fallback);
  --mono: "JetBrains Mono", "Chill Round Gothic", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(1200px 800px at 10% 0%, var(--pink-soft), transparent 60%),
              radial-gradient(1000px 700px at 100% 100%, var(--lav-soft), transparent 60%),
              var(--cream);
  overflow: hidden;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cg fill='%23ff8fc0' stroke='%23fff' stroke-width='1.5'%3E%3Cellipse cx='14' cy='18' rx='6' ry='5'/%3E%3Ccircle cx='7' cy='11' r='2.6'/%3E%3Ccircle cx='11.5' cy='7' r='2.6'/%3E%3Ccircle cx='16.5' cy='7' r='2.6'/%3E%3Ccircle cx='21' cy='11' r='2.6'/%3E%3C/g%3E%3C/svg%3E") 14 14, auto;
}
/* 字重映射：粗体用 Bold，标题和按钮用 Heavy；关闭伪粗体避免双重加粗 */
body { font-synthesis-weight: none; }
b, strong, .rotator, .tag, .bubble, summary, .toast, .switch { font-family: var(--font-bold); }
h1, h2, .logo, .pop { font-family: var(--font-heavy); }
.mono, .mono b { font-family: var(--mono); }
::selection { background: var(--pink); color: #fff; }

/* ---------- 滚动吸附容器 ---------- */
#snap {
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
#snap::-webkit-scrollbar { display: none; }

.panel {
  position: relative;
  min-height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: clamp(24px, 5vw, 80px);
  padding: 96px clamp(20px, 7vw, 120px) 56px;
}
.panel > * { min-width: 0; } /* 防止 pre 等宽内容撑破网格列 */
.panel.reverse .art { order: -1; }
.panel.dark {
  color: #f3eaff;
  background: linear-gradient(160deg, #3b2f66 0%, var(--night) 70%);
}
.panel.dark .eyebrow, .panel.dark .say { color: #c9b6ff; }

/* ---------- 背景 ---------- */
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(169,139,255,.09) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(169,139,255,.09) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 80%);
}
.floaters { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.floaters span {
  position: absolute; bottom: -40px;
  color: var(--pink); opacity: .35; white-space: nowrap;
  font-size: var(--s, 16px);
  animation: floatUp var(--d, 18s) linear infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes floatUp {
  to { transform: translate(var(--x, 40px), -115vh) rotate(var(--r, 20deg)); }
}
main, .topbar, .dots { position: relative; z-index: 1; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px clamp(20px, 5vw, 56px);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.logo {
  font-weight: 900; font-size: 22px; color: var(--ink); text-decoration: none;
  background: rgba(255,255,255,.75); backdrop-filter: blur(10px);
  padding: 8px 18px; border-radius: 999px; box-shadow: var(--shadow);
}
.logo span { color: var(--pink); }
.status {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
  background: rgba(255,255,255,.75); backdrop-filter: blur(10px);
  padding: 8px 16px; border-radius: 999px; box-shadow: var(--shadow); color: var(--ink);
}
.status i {
  width: 9px; height: 9px; border-radius: 50%; background: var(--mint);
  box-shadow: 0 0 0 0 var(--mint); animation: ping 1.8s infinite;
}
@keyframes ping { 70% { box-shadow: 0 0 0 8px transparent; } }

/* ---------- 导航点 ---------- */
.dots {
  position: fixed; right: clamp(10px, 2vw, 28px); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 14px; z-index: 10;
}
.dots a {
  position: relative; width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,.9); border: 2px solid var(--pink);
  transition: transform .3s, background .3s;
}
.dots a.on { background: var(--pink); transform: scale(1.35); }
.dots a::before {
  content: attr(data-label);
  position: absolute; right: 26px; top: 50%; transform: translateY(-50%) translateX(6px);
  white-space: nowrap; font-size: 13px; color: #fff; background: var(--pink);
  padding: 4px 10px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: .25s;
}
.dots a:hover::before, .dots a.on::before { opacity: 1; transform: translateY(-50%); }
.dots a.on::before { opacity: .0; }
.dots a.on:hover::before { opacity: 1; }

/* ---------- 文字 ---------- */
.eyebrow { color: var(--ink-soft); font-size: 14px; letter-spacing: .05em; margin-bottom: 14px; }
.caret { display: inline-block; width: 9px; height: 1.1em; background: var(--pink); vertical-align: -3px; margin-left: 4px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
h1 { font-size: clamp(48px, 8.5vw, 120px); line-height: 1.02; font-weight: 900; letter-spacing: -.02em; }
h1 .line { display: block; }
h1 small { font-size: .38em; color: var(--pink); margin-left: .2em; vertical-align: .9em; display: inline-block; animation: wiggle 2.4s ease-in-out infinite; }
h2 { font-size: clamp(32px, 4.6vw, 62px); line-height: 1.18; font-weight: 900; margin-bottom: 24px; }
em {
  font-style: normal; color: var(--pink);
  background: linear-gradient(transparent 62%, rgba(255,143,192,.28) 62%);
}
em.mint { color: var(--mint); background: linear-gradient(transparent 62%, rgba(79,216,181,.25) 62%); }
em.lav { color: var(--lav); background: linear-gradient(transparent 62%, rgba(169,139,255,.25) 62%); }
.lead { font-size: clamp(16px, 1.5vw, 20px); line-height: 1.9; margin: 22px 0; color: var(--ink-soft); }
.panel.dark .lead { color: #d8ccf5; }
.lead.small { font-size: 16px; margin: 0 0 18px; }
.lead code, .curl code { font-family: var(--mono); }
.lead code { white-space: nowrap; background: var(--mint-soft); color: #1f8a70; padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.kao { color: var(--pink); white-space: nowrap; }
.say { margin-top: 22px; font-size: 17px; color: var(--ink-soft); }
.hint { margin-top: 36px; color: var(--ink-soft); }
.bounce { display: inline-block; animation: bounce 1.4s infinite; color: var(--pink); }
@keyframes bounce { 50% { transform: translateY(6px); } }
@keyframes wiggle { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(8deg) translateY(-4px); } }
.center { text-align: center; }

.rotator {
  display: inline-block; color: var(--lav); font-weight: 700;
  border-bottom: 2px dashed var(--lav); transition: opacity .3s, transform .3s;
}
.rotator.out { opacity: 0; transform: translateY(-8px); }

.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag { padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; transition: transform .2s; }
.tag:hover { transform: translateY(-3px) rotate(-3deg); }
.tag.pink { background: var(--pink-soft); color: #d94f8f; }
.tag.mint { background: var(--mint-soft); color: #1f8a70; }
.tag.lav { background: var(--lav-soft); color: #6f4fd6; }

/* ---------- 插图 ---------- */
.art { position: relative; display: grid; place-items: center; }
.art img {
  position: relative; z-index: 1;
  width: min(100%, 520px); aspect-ratio: 1; object-fit: cover;
  border-radius: 42% 58% 52% 48% / 48% 42% 58% 52%;
  border: 6px solid #fff; box-shadow: var(--shadow);
  animation: morph 12s ease-in-out infinite;
}
.art.wide img { aspect-ratio: 3 / 2; width: min(100%, 640px); border-radius: var(--radius); animation: none; }
@keyframes morph {
  50% { border-radius: 58% 42% 46% 54% / 54% 58% 42% 46%; }
}
.blob {
  position: absolute; width: 86%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--pink-soft), transparent 70%);
  filter: blur(20px); animation: pulse 6s ease-in-out infinite;
}
.blob.mint { background: radial-gradient(circle, var(--mint-soft), transparent 70%); }
.blob.lav { background: radial-gradient(circle, var(--lav-soft), transparent 70%); }
.blob.night { background: radial-gradient(circle, rgba(169,139,255,.5), transparent 70%); }
@keyframes pulse { 50% { transform: scale(1.12); } }

.hero .art img { cursor: pointer; }
.bubble {
  position: absolute; z-index: 2; top: 6%; right: 2%;
  background: #fff; color: var(--ink); font-weight: 700;
  padding: 10px 16px; border-radius: 20px 20px 20px 4px;
  box-shadow: var(--shadow); animation: float 3.2s ease-in-out infinite;
  max-width: 220px;
}
@keyframes float { 50% { transform: translateY(-10px); } }

/* ---------- 进场动画（滚到面板时触发） ---------- */
.panel .text > *, .panel .art {
  opacity: 0; transform: translateY(36px);
  transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1);
}
.panel .art { transform: scale(.88) rotate(-4deg); }
.panel.in .text > *, .panel.in .art { opacity: 1; transform: none; }
.panel.in .text > *:nth-child(2) { transition-delay: .08s; }
.panel.in .text > *:nth-child(3) { transition-delay: .16s; }
.panel.in .text > *:nth-child(4) { transition-delay: .24s; }
.panel.in .text > *:nth-child(5) { transition-delay: .32s; }
.panel.in .text > *:nth-child(6) { transition-delay: .40s; }
.panel.in .art { transition-delay: .12s; }

/* ---------- 终端 ---------- */
.term { background: #2b2440; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); max-width: 520px; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: #3a3155; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff8fa3; }
.term-bar i:nth-child(2) { background: #ffd36e; }
.term-bar i:nth-child(3) { background: var(--mint); }
.term-bar span { margin-left: 8px; font-family: var(--mono); font-size: 12px; color: #a99cc8; }
.term pre { padding: 18px 20px; color: #efe6ff; font-size: clamp(12px, 1.1vw, 14.5px); line-height: 1.75; overflow-x: auto; }
.term .k { color: #ff9fd0; font-weight: 400; }
.term s { color: #9ff0d8; text-decoration: none; }
.term n { color: #ffd36e; }
.term f { color: #c9b6ff; }
.term c { color: #7d70a0; font-style: italic; }

/* ---------- 统计 ---------- */
.stats { list-style: none; display: flex; gap: clamp(14px, 2vw, 28px); flex-wrap: wrap; }
.stats li {
  background: #fff; border-radius: 22px; padding: 18px 22px; min-width: 130px;
  box-shadow: var(--shadow); border: 2px dashed var(--lav-soft);
}
.stats b { display: block; font-size: 38px; font-weight: 900; color: var(--lav); font-family: var(--mono); }
.stats span { font-size: 14px; color: var(--ink-soft); }

/* ---------- 深夜日志 ---------- */
.log {
  background: rgba(0,0,0,.28); border: 1px solid rgba(201,182,255,.25);
  border-radius: 16px; padding: 16px 18px; min-height: 172px; font-size: 13.5px; line-height: 1.8;
  max-width: 520px; color: #d8ccf5;
}
.log .ok { color: #9ff0d8; } .log .err { color: #ff9fb8; } .log .warn { color: #ffd36e; }

/* ---------- Teapot 聊天框 ---------- */
/* teapot 屏固定一屏高，聊天框吸收剩余空间，消息在框内滚动 */
.panel.teapot { height: 100dvh; grid-template-rows: minmax(0, 1fr); }
.teapot .text { height: 100%; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.teapot h2 { font-size: clamp(28px, 3.6vw, 50px); margin-bottom: 14px; }
.teapot .eyebrow { margin-bottom: 8px; }
.chat {
  background: rgba(255,255,255,.85); backdrop-filter: blur(12px);
  border-radius: 24px; box-shadow: var(--shadow); overflow: hidden;
  max-width: 560px; border: 2px solid var(--pink-soft);
  flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column;
}
.chat-head, .chat-input { flex-shrink: 0; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--pink-soft); gap: 10px; }
.chat-head select {
  font-family: var(--mono); font-size: 13px; color: var(--ink); background: #fff;
  border: none; border-radius: 999px; padding: 6px 12px; outline: none; cursor: pointer;
}
.switch { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; user-select: none; }
.switch input { accent-color: var(--pink); width: 16px; height: 16px; }
.chat-body { flex: 0 1 280px; min-height: 64px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: var(--pink); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: #f6f0ff; border-bottom-left-radius: 4px; }
.msg details { margin-bottom: 8px; font-size: 13px; color: var(--ink-soft); }
.msg details summary { cursor: pointer; color: var(--lav); font-weight: 700; }
.msg details div { margin-top: 6px; padding-left: 10px; border-left: 3px solid var(--lav-soft); white-space: pre-wrap; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--pink-soft); }
.chat-input input {
  flex: 1; border: 2px solid var(--pink-soft); border-radius: 999px; padding: 10px 16px;
  font: inherit; font-size: 15px; color: var(--ink); outline: none; background: #fff;
}
.chat-input input:focus { border-color: var(--pink); }
.chat-input button, .pat {
  border: none; cursor: pointer; font: inherit; font-family: var(--font-heavy); font-weight: 900; color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--lav));
  padding: 10px 20px; border-radius: 999px; box-shadow: 0 8px 20px -8px var(--pink);
  transition: transform .15s;
}
.chat-input button:hover, .pat:hover { transform: translateY(-2px) scale(1.04); }
.chat-input button:active, .pat:active { transform: scale(.94); }
.chat-input button:disabled { opacity: .5; cursor: wait; }

.curl { margin-top: 12px; max-width: 560px; flex-shrink: 0; }
.curl pre { max-height: max(64px, calc(100dvh - 640px)); }
.curl summary { cursor: pointer; color: var(--lav); font-weight: 700; }
.curl pre { margin-top: 10px; background: #2b2440; color: #9ff0d8; border-radius: 16px; padding: 14px 16px; font-size: 12.5px; overflow-x: auto; }

/* ---------- 结尾 ---------- */
.pat { font-size: 20px; padding: 14px 34px; margin: 10px 0 26px; }
.pat span { display: inline-block; min-width: 1.5em; font-family: var(--mono); }
.tiny { font-size: 12px; color: var(--ink-soft); opacity: .8; }

/* ---------- 点击爆出的颜文字 ---------- */
.pop {
  position: fixed; z-index: 100; pointer-events: none; font-weight: 900;
  color: var(--pink); white-space: nowrap; font-size: 18px;
  animation: pop 1s ease-out forwards; text-shadow: 0 2px 0 #fff;
}
@keyframes pop {
  0% { transform: translate(-50%, -50%) scale(.4); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% - 70px)) scale(1.1); opacity: 0; }
}
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 100; transform: translate(-50%, 30px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px;
  opacity: 0; transition: .35s; box-shadow: var(--shadow); font-weight: 700;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.rainbow { animation: hue 3s linear infinite; }
@keyframes hue { to { filter: hue-rotate(360deg); } }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .panel { grid-template-columns: 1fr; padding: 84px 22px 40px; gap: 18px; align-content: center; }
  .panel.reverse .art { order: 0; }
  .panel .art { order: -1; }
  .art img { width: min(72vw, 340px); }
  .art.wide img { width: 100%; }
  h2 { margin-bottom: 14px; }
  .lead { margin: 14px 0; }
  .hint, .bubble { display: none; }
  .dots { right: 8px; }
  .dots a::before { display: none; }
  .teapot .art, .bye .art { display: none; }
  .panel.teapot { padding-top: 76px; padding-bottom: 20px; }
  .teapot .lead.small { font-size: 14px; line-height: 1.7; margin-bottom: 12px; }
  .teapot .curl pre { max-height: max(56px, calc(100dvh - 590px)); font-size: 11.5px; }
  .stats li { min-width: 0; flex: 1; padding: 12px 14px; }
  .stats b { font-size: 28px; }
}
@media (max-height: 720px) and (min-width: 861px) {
  .panel { padding-top: 80px; }
  .art img { width: min(100%, 420px); }
  .panel.teapot { padding-top: 72px; padding-bottom: 24px; }
  .teapot h2 { font-size: clamp(26px, 3vw, 40px); margin-bottom: 8px; }
  .teapot .lead.small { font-size: 14px; line-height: 1.7; margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  #snap { scroll-behavior: auto; }
  .panel .text > *, .panel .art { opacity: 1; transform: none; }
}
