@import url("home.css");
@import url("world.css");
@import url("world-map.css");
@import url("chat.css");
@import url("pets.css");
@import url("games.css");
@import url("kitchen.css");
@import url("settings.css");
@import url("onboarding.css");

@font-face {
  font-family: "Silkscreen";
  src: url("../fonts/silkscreen/silkscreen-latin-400-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* =========================================================
   欣欣小屋 · 基础设计系统
   温暖像素 / 手绘 SVG / 本地优先
   ========================================================= */

:root {
  --cream: #fff8ec;
  --paper: #fffbf4;
  --paper-deep: #f8ead6;
  --peach: #f6d7ba;
  --peach-deep: #eab894;
  --rose: #e8918d;
  --rose-deep: #c85f6d;
  --rose-soft: #f7d3d4;
  --gold: #f2c14e;
  --gold-soft: #f9e4a4;
  --sage: #9cc6a5;
  --sage-deep: #6f9b72;
  --sky: #a9d6df;
  --blue-deep: #5c92a4;
  --lavender: #cbb7d8;
  --ink: #4b342c;
  --ink-soft: #6f574b;
  --ink-mute: #9b8275;
  --line: #5b3e33;
  --white: #fffdf7;
  --danger: #b7545f;
  --shadow: rgba(91, 61, 45, 0.16);
  --shadow-strong: rgba(91, 61, 45, 0.28);
  --font-pixel: "Fusion Pixel 10px Proportional Simplified Chinese", "Zpix", "Microsoft YaHei UI", sans-serif;
  --font-num: "Silkscreen", "Fusion Pixel 10px Proportional Simplified Chinese", monospace;
  --font-body: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", sans-serif;
  --font-mono: "Fusion Pixel 10px Proportional Simplified Chinese", "Cascadia Mono", monospace;
  --sidebar-w: 252px;
  --topbar-h: 76px;
  --ease: cubic-bezier(0.22, 0.8, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.65;
  background-color: #f3e2cb;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255, 252, 242, 0.9) 0 18%, transparent 45%),
    radial-gradient(circle at 90% 4%, rgba(247, 211, 212, 0.4) 0 12%, transparent 40%),
    linear-gradient(180deg, #f8ead6 0%, #f2dfc7 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.24;
  background-image:
    repeating-linear-gradient(0deg, rgba(107, 74, 59, 0.06) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(107, 74, 59, 0.04) 0 1px, transparent 1px 4px);
  mix-blend-mode: multiply;
}

body.is-locked {
  overflow: hidden;
}

::selection {
  color: var(--ink);
  background: var(--gold-soft);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

:focus-visible {
  outline: 3px dotted var(--rose-deep);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  display: inline-block;
  vertical-align: -0.12em;
}

.sprite {
  width: 100%;
  height: 100%;
  overflow: visible;
  image-rendering: pixelated;
  shape-rendering: crispEdges;
}

.food-sprite {
  width: 1em;
  height: 1em;
  overflow: visible;
  shape-rendering: crispEdges;
}

.avatar-art {
  width: 100%;
  height: 100%;
  shape-rendering: crispEdges;
  border-radius: 2px;
}

.avatar-art--me {
  --avatar-bg: #f6d7ba;
}

.avatar-art--partner {
  --avatar-bg: #f3c8c7;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -120px;
  z-index: 3000;
  padding: 12px 18px;
  border: 2px solid var(--line);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--line);
  transition: top 0.18s ease;
}

.skip-link:focus {
  top: 16px;
}

/* ----------------------------- */
/* 字体与通用文字                 */
/* ----------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  text-transform: uppercase;
}

.eyebrow__dot {
  width: 6px;
  height: 6px;
  background: var(--rose);
  box-shadow: 2px -2px 0 var(--gold);
  flex: none;
}

.accent,
.ink-rose {
  color: var(--rose-deep);
}

.muted-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-mute);
  font-size: 12px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  padding: 0;
  background: none;
  color: var(--rose-deep);
  font-size: 12px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.text-link:hover {
  color: var(--ink);
}

/* ----------------------------- */
/* 按钮                          */
/* ----------------------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border: 2px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.25;
  box-shadow: 3px 3px 0 var(--line);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  overflow: hidden;
  white-space: nowrap;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--line);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}

.btn:disabled {
  opacity: 0.55;
  transform: none;
  box-shadow: 2px 2px 0 var(--line);
}

.btn--primary {
  background: var(--rose);
}

.btn--primary:hover {
  background: #ed9f9a;
}

.btn--ghost {
  background: var(--cream);
}

.btn--danger {
  color: var(--white);
  background: var(--danger);
}

.btn--small {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 12px;
  gap: 5px;
  box-shadow: 2px 2px 0 var(--line);
}

.btn--small:hover {
  box-shadow: 3px 3px 0 var(--line);
}

.btn--large {
  min-height: 52px;
  padding: 13px 22px;
  font-size: 15px;
  box-shadow: 4px 4px 0 var(--line);
}

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 2px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--line);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.icon-button:hover {
  background: var(--gold-soft);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--line);
}

.icon-button:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--line);
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1.5px solid rgba(91, 62, 51, 0.32);
  background: rgba(255, 251, 244, 0.72);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}

/* ----------------------------- */
/* 骨架布局                      */
/* ----------------------------- */

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 18px 18px;
  border-right: 3px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 251, 244, 0.97), rgba(248, 233, 211, 0.97)),
    repeating-linear-gradient(0deg, transparent 0 11px, rgba(107, 74, 59, 0.04) 11px 12px);
  overflow: hidden auto;
}

.sidebar::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 96px;
  width: 38px;
  height: 38px;
  opacity: 0.06;
  background: var(--rose);
  clip-path: polygon(0 25%, 25% 25%, 25% 0, 75% 0, 75% 25%, 100% 25%, 100% 75%, 75% 75%, 75% 100%, 25% 100%, 25% 75%, 0 75%);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 4px 4px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--line);
  background: var(--rose);
  color: var(--white);
  box-shadow: 3px 3px 0 var(--line);
  transform: rotate(-2deg);
}

.brand-mark .icon {
  width: 20px;
  height: 20px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-en {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.brand-cn {
  margin-top: 3px;
  font-family: var(--font-pixel);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.couple-card {
  position: relative;
  padding: 14px 13px 12px;
  border: 2px solid var(--line);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--shadow-strong);
}

.couple-card::before {
  content: "";
  position: absolute;
  left: -2px;
  top: -2px;
  width: 30px;
  height: 4px;
  background: var(--gold);
}

.couple-avatars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 8px;
}

.mini-avatar {
  width: 44px;
  height: 44px;
  border: 2px solid var(--line);
  background: var(--paper);
  overflow: hidden;
  box-shadow: 2px 2px 0 var(--shadow-strong);
}

.mini-avatar--me {
  transform: translateX(4px) rotate(-2deg);
}

.mini-avatar--partner {
  transform: translateX(-4px) rotate(2deg);
}

.couple-link {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0 -6px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--rose-deep);
}

.couple-link .icon {
  width: 11px;
  height: 11px;
}

.couple-names {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.couple-names strong {
  color: var(--ink);
}

.couple-amp {
  color: var(--rose-deep);
}

.couple-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 5px;
  color: var(--ink-mute);
  font-size: 10px;
  line-height: 1.4;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--sage-deep);
  box-shadow: 0 0 0 2px rgba(156, 198, 165, 0.28);
  animation: soft-pulse 2.8s ease-in-out infinite;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 10px;
  border: 2px solid transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.nav-item .icon {
  width: 18px;
  height: 18px;
}

.nav-item:hover {
  background: rgba(255, 251, 244, 0.8);
  border-color: rgba(91, 62, 51, 0.2);
  transform: translateX(2px);
}

.nav-item.is-active {
  color: var(--ink);
  border-color: var(--line);
  background: var(--rose-soft);
  box-shadow: 3px 3px 0 var(--line);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 12px;
  width: 3px;
  height: 18px;
  background: var(--rose-deep);
}

.nav-key {
  min-width: 18px;
  padding: 1px 3px;
  border: 1px solid rgba(91, 62, 51, 0.22);
  color: var(--ink-mute);
  font-family: var(--font-pixel);
  font-size: 9px;
  text-align: center;
  line-height: 1.4;
  background: rgba(255, 253, 247, 0.7);
}

.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1.5px solid var(--line);
  background: var(--rose-deep);
  color: var(--white);
  font-family: var(--font-pixel);
  font-size: 8px;
  line-height: 1;
  box-shadow: 1px 1px 0 var(--line);
}

.nav-badge[hidden] {
  display: none;
}

.sidebar-note {
  position: relative;
  margin-top: auto;
  padding: 13px 13px 15px;
  border: 2px dashed rgba(91, 62, 51, 0.35);
  background: var(--gold-soft);
  transform: rotate(-0.7deg);
}

.sidebar-note__label {
  display: block;
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
}

.sidebar-note p {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.sidebar-note__heart {
  position: absolute;
  right: 10px;
  bottom: 5px;
  color: var(--rose-deep);
  font-size: 14px;
  transform: rotate(10deg);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-settings {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 2px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: left;
}

.side-settings:hover {
  border-color: rgba(91, 62, 51, 0.2);
  background: rgba(255, 251, 244, 0.7);
}

.side-settings .icon {
  width: 16px;
  height: 16px;
}

.version-tag {
  padding-left: 4px;
  color: var(--ink-mute);
  font-size: 9px;
  letter-spacing: 0.03em;
}

/* ----------------------------- */
/* 主区域和顶栏                   */
/* ----------------------------- */

.main-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--topbar-h);
  padding: 12px 30px;
  border-bottom: 2px solid rgba(91, 62, 51, 0.18);
  background: rgba(255, 248, 236, 0.82);
  backdrop-filter: blur(12px);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: -4px;
  height: 2px;
  background-image: linear-gradient(90deg, rgba(91, 62, 51, 0.12) 50%, transparent 50%);
  background-size: 8px 2px;
}

.topbar-heading {
  min-width: 0;
}

.topbar-kicker {
  display: block;
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  line-height: 1.3;
}

.topbar-title {
  margin-top: 2px;
  font-family: var(--font-pixel);
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1.5px solid rgba(91, 62, 51, 0.24);
  background: rgba(255, 251, 244, 0.8);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}

.date-chip .icon {
  width: 12px;
  height: 12px;
  color: var(--gold);
}

.identity-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 8px 4px 5px;
  border: 2px solid var(--line);
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--line);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.identity-chip:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--line);
  background: var(--gold-soft);
}

.identity-avatar {
  width: 31px;
  height: 31px;
  border: 1.5px solid var(--line);
  overflow: hidden;
  flex: none;
}

.identity-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.identity-copy small {
  color: var(--ink-mute);
  font-size: 8px;
}

.identity-copy strong {
  font-size: 11.5px;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-swap-icon {
  width: 12px;
  height: 12px;
  color: var(--ink-mute);
}

.top-settings {
  display: none;
}

.main-view {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 30px 70px;
  outline: none;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-height: 50vh;
}

.page-transition {
  animation: page-in 0.38s var(--ease);
}

.mobile-nav {
  display: none;
}

/* ----------------------------- */
/* 卡片 / 进度 / 提示             */
/* ----------------------------- */

.card {
  position: relative;
  border: 2px solid var(--line);
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--shadow);
}

.card::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(91, 62, 51, 0.07);
  pointer-events: none;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 0;
}

.card-head h3 {
  margin-top: 3px;
  font-family: var(--font-pixel);
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.pixel-progress {
  height: 12px;
  border: 2px solid var(--line);
  background: #f2dfc7;
  padding: 2px;
  overflow: hidden;
}

.pixel-progress > span {
  display: block;
  height: 100%;
  min-width: 2px;
  background:
    repeating-linear-gradient(90deg, var(--rose) 0 8px, var(--rose-deep) 8px 10px),
    var(--rose);
  transition: width 0.5s var(--ease);
}

.render-error {
  max-width: 560px;
  margin: 12vh auto;
  padding: 36px;
  border: 2px solid var(--line);
  background: var(--paper);
  text-align: center;
  box-shadow: 7px 7px 0 var(--shadow-strong);
}

.render-error__icon {
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 26px;
}

.render-error h2 {
  font-family: var(--font-pixel);
  font-size: 24px;
}

.render-error p {
  margin: 10px 0 20px;
  color: var(--ink-soft);
}

.boot-error {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 6000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(420px, calc(100vw - 32px));
  padding: 16px;
  border: 2px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-hard);
  text-align: center;
  transform: translate(-50%, -50%);
}

.boot-error strong {
  font-family: var(--font-pixel);
  font-size: 13px;
}

.boot-error span {
  color: var(--ink-mute);
  font-size: 11px;
}

.boot-error[hidden] {
  display: none;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--cream);
  color: var(--ink);
  font-size: 18px;
  text-align: center;
}

/* ----------------------------- */
/* 弹窗 / Toast / 粒子            */
/* ----------------------------- */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.modal-layer.is-visible {
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(53, 35, 29, 0.58);
  backdrop-filter: blur(3px);
}

.modal {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  max-height: min(88dvh, 920px);
  border: 3px solid var(--line);
  background: var(--paper);
  box-shadow: 10px 10px 0 rgba(40, 24, 19, 0.36);
  transform: translateY(12px) scale(0.985);
  transition: transform 0.2s var(--ease);
}

.modal-layer.is-visible .modal {
  transform: translateY(0) scale(1);
}

.modal--small {
  width: min(460px, 100%);
}

.modal--identity {
  width: min(680px, 100%);
}

.modal--settings {
  width: min(1040px, 100%);
  max-height: min(90dvh, 960px);
}

.modal--pet {
  width: min(980px, 100%);
}

.modal--dish {
  width: min(820px, 100%);
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex: none;
  padding: 20px 24px 16px;
  border-bottom: 2px dashed rgba(91, 62, 51, 0.22);
}

.modal__heading {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.modal__title {
  font-family: var(--font-pixel);
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.modal__close {
  margin-top: 2px;
}

.modal__body {
  flex: 1;
  min-height: 0;
  padding: 22px 24px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 62, 51, 0.28) transparent;
}

.modal__footer {
  flex: none;
  padding: 16px 24px;
  border-top: 2px dashed rgba(91, 62, 51, 0.22);
}

.confirm-copy {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.8;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 2px solid var(--line);
  background: var(--ink);
  color: var(--cream);
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: 4px 4px 0 rgba(40, 24, 19, 0.3);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: auto;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--danger {
  background: #713c42;
}

.toast--info {
  background: #4d4a3d;
}

.toast__icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border: 1px solid rgba(255, 248, 236, 0.35);
  color: var(--gold);
}

.toast__icon .icon {
  width: 13px;
  height: 13px;
}

.toast__text {
  min-width: 0;
}

.heart-particle {
  position: fixed;
  z-index: 1400;
  width: 16px;
  height: 16px;
  pointer-events: none;
  animation: heart-fly 1.1s var(--ease) forwards;
  animation-delay: var(--delay, 0s);
  transform: translate(-50%, -50%) scale(var(--scale, 0.8));
  filter: drop-shadow(1px 1px 0 rgba(40, 24, 19, 0.18));
}

.heart-particle svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 1400;
  overflow: hidden;
  pointer-events: none;
}

.confetti-bit {
  position: absolute;
  top: -20px;
  border: 1px solid rgba(75, 52, 44, 0.18);
  animation: confetti-fall var(--fall-duration, 2.4s) linear forwards;
  animation-delay: var(--fall-delay, 0s);
}

.click-ripple {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 253, 247, 0.65);
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 0.55s ease-out forwards;
  pointer-events: none;
}

/* ----------------------------- */
/* 滚动条                         */
/* ----------------------------- */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 62, 51, 0.3) transparent;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  background: rgba(91, 62, 51, 0.3);
  background-clip: padding-box;
}

/* ----------------------------- */
/* 动画                           */
/* ----------------------------- */

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes soft-pulse {
  0%,
  100% {
    opacity: 0.65;
  }
  50% {
    opacity: 1;
  }
}

@keyframes heart-fly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(var(--scale, 0.8));
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.1) rotate(var(--rot));
  }
}

@keyframes confetti-fall {
  to {
    transform: translate(var(--drift), 110vh) rotate(var(--spin));
    opacity: 0.85;
  }
}

@keyframes ripple {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(13);
  }
}

@keyframes pet-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes pet-blink {
  0%,
  43%,
  47%,
  100% {
    transform: scaleY(1);
  }
  45% {
    transform: scaleY(0.12);
  }
}

@keyframes tail-sway {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(7deg);
  }
}

@keyframes parrot-bob {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-2px) rotate(-1deg);
  }
}

@keyframes steam-rise {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.9);
  }
  28% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(-16px) scale(1.08);
  }
}

/* ----------------------------- */
/* 响应式基础                     */
/* ----------------------------- */

@media (max-width: 1180px) {
  :root {
    --sidebar-w: 232px;
  }

  .main-view {
    padding: 24px 22px 60px;
  }

  .topbar {
    padding: 12px 22px;
  }

  .topbar::after {
    left: 22px;
    right: 22px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
    padding-bottom: 76px;
  }

  .sidebar {
    display: none;
  }

  .main-column {
    min-height: 100dvh;
  }

  .topbar {
    min-height: 64px;
    padding: 9px 16px;
  }

  .topbar::after {
    left: 16px;
    right: 16px;
  }

  .topbar-kicker {
    display: none;
  }

  .topbar-title {
    font-size: 17px;
  }

  .date-chip {
    display: none;
  }

  .identity-copy small {
    display: none;
  }

  .identity-chip {
    min-height: 38px;
    padding: 3px 6px 3px 4px;
  }

  .identity-avatar {
    width: 28px;
    height: 28px;
  }

  .top-settings {
    display: inline-grid;
    width: 34px;
    height: 34px;
  }

  .main-view {
    padding: 18px 14px 32px;
  }

  .page {
    gap: 18px;
  }

  .modal-layer {
    padding: 12px;
  }

  .modal {
    max-height: 92dvh;
  }

  .modal__head {
    padding: 16px 17px 13px;
  }

  .modal__body {
    padding: 17px;
  }

  .modal__title {
    font-size: 20px;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 3px solid var(--line);
    background: rgba(255, 249, 238, 0.96);
    backdrop-filter: blur(12px);
  }

  .mobile-nav__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 2px;
    border: 1.5px solid transparent;
    color: var(--ink-mute);
    font-size: 9.5px;
    line-height: 1.2;
  }

  .mobile-nav__item .icon {
    width: 19px;
    height: 19px;
  }

  .mobile-nav__item.is-active {
    border-color: var(--line);
    background: var(--rose-soft);
    color: var(--ink);
    box-shadow: 2px 2px 0 var(--line);
  }

  .mobile-nav__item .nav-badge {
    position: absolute;
    top: 0;
    right: calc(50% - 19px);
  }

  .toast-root {
    right: 12px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    left: 12px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .main-view {
    padding: 14px 11px 26px;
  }

  .identity-copy strong {
    max-width: 64px;
  }

  .topbar-title {
    font-size: 15.5px;
  }

  .modal-layer {
    padding: 8px;
  }

  .modal {
    max-height: 94dvh;
  }

  .modal__body {
    padding: 14px;
  }

  .modal__head {
    padding: 14px;
  }

  .btn {
    min-height: 40px;
    padding: 8px 12px;
  }

  .btn--large {
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* 预览/截图模式：跳过所有动画，避免无头浏览器把画面停在淡入的中间帧。 */
html.qa-static *,
html.qa-static *::before,
html.qa-static *::after {
  animation: none !important;
  transition: none !important;
}
