/* 主题变量：浅色主题默认值，深色主题在下方 html[data-theme='dark'] 覆盖。 */
:root {
  color-scheme: light;
  --bg: #f5f8fb;
  --page-bg:
    linear-gradient(135deg, rgba(95, 140, 255, 0.12), transparent 34%),
    linear-gradient(155deg, rgba(71, 196, 157, 0.2), transparent 46%), var(--bg);
  --surface: #ffffff;
  --surface-soft: #edf6f2;
  --surface-glass: rgba(255, 255, 255, 0.82);
  --ink: #17202a;
  --heading: #314052;
  --muted: #687485;
  --line: #dbe4ec;
  --panel-line: rgba(219, 228, 236, 0.9);
  --mint: #47c49d;
  --mint-dark: #24846a;
  --mint-soft: rgba(71, 196, 157, 0.18);
  --coral: #ff8069;
  --sun: #f4c542;
  --blue: #5f8cff;
  --primary-gradient: linear-gradient(135deg, var(--mint), #54a8ff);
  --primary-ink: #ffffff;
  --primary-shadow: 0 12px 26px rgba(71, 196, 157, 0.25);
  --interactive-line: rgba(71, 196, 157, 0.65);
  --active-line: rgba(71, 196, 157, 0.9);
  --dark-button: #17202a;
  --dark-button-ink: #ffffff;
  --active-bg: #e9faf4;
  --selected-bg: #eefbf6;
  --tag-bg: #eef6ff;
  --tag-ink: #2c63c7;
  --control-bg: #f3f6fa;
  --scene-bg: linear-gradient(180deg, rgba(95, 140, 255, 0.18), rgba(71, 196, 157, 0.12)), #f7fbff;
  --window-frame: rgba(255, 255, 255, 0.86);
  --window-line: rgba(255, 255, 255, 0.8);
  --window-glow: rgba(255, 255, 255, 0.35);
  --cat: #26313f;
  --cat-shadow: rgba(38, 49, 63, 0.14);
  --cat-eye: #f4c542;
  --cat-blush: #f8c0b2;
  --paw: rgba(38, 49, 63, 0.22);
  --luggage-line: rgba(38, 49, 63, 0.72);
  --luggage-bg: rgba(255, 255, 255, 0.58);
  --dew: #8de3ff;
  --dew-deep: #35aee3;
  --leaf: #45b57e;
  --leaf-dark: #27825e;
  --dev-bg: rgba(244, 197, 66, 0.2);
  --dev-ink: #846100;
  --toast-bg: #ffffff;
  --toast-line: rgba(71, 196, 157, 0.45);
  --postcard-bg: linear-gradient(180deg, rgba(244, 197, 66, 0.16), transparent 52%), var(--surface);
  --souvenir-bg:
    linear-gradient(180deg, rgba(255, 128, 105, 0.14), transparent 52%), var(--surface);
  --rare-ink: #9a4d00;
  --rare-bg: rgba(244, 197, 66, 0.24);
  --danger-ink: #a64231;
  --danger-line: rgba(255, 128, 105, 0.4);
  --danger-bg: rgba(255, 255, 255, 0.76);
  --control-shadow: 0 4px 14px rgba(31, 47, 70, 0.08);
  --shadow: 0 18px 50px rgba(31, 47, 70, 0.12);
  --soft-shadow: 0 10px 28px rgba(31, 47, 70, 0.08);
  --radius: 8px;
}

/* 深色主题只覆盖变量，组件样式继续复用同一套结构。 */
html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #141820;
  --page-bg:
    linear-gradient(135deg, rgba(95, 140, 255, 0.16), transparent 34%),
    linear-gradient(155deg, rgba(232, 179, 108, 0.12), transparent 48%), var(--bg);
  --surface: #222a38;
  --surface-soft: #1d2330;
  --surface-glass: rgba(31, 38, 51, 0.86);
  --ink: #f4eadf;
  --heading: #f2e2ce;
  --muted: #b8aa9d;
  --line: rgba(244, 234, 223, 0.14);
  --panel-line: rgba(244, 234, 223, 0.14);
  --mint: #77d5b8;
  --mint-dark: #9ce6cd;
  --mint-soft: rgba(119, 213, 184, 0.15);
  --coral: #e89984;
  --sun: #e8b36c;
  --blue: #88a8ff;
  --primary-gradient: linear-gradient(135deg, #e8b36c, #7bd5bc);
  --primary-ink: #171820;
  --primary-shadow: 0 14px 28px rgba(0, 0, 0, 0.26);
  --interactive-line: rgba(232, 179, 108, 0.46);
  --active-line: rgba(232, 179, 108, 0.68);
  --dark-button: #e8b36c;
  --dark-button-ink: #1d1820;
  --active-bg: rgba(119, 213, 184, 0.14);
  --selected-bg: rgba(119, 213, 184, 0.12);
  --tag-bg: rgba(136, 168, 255, 0.16);
  --tag-ink: #cbd7ff;
  --control-bg: rgba(20, 24, 32, 0.42);
  --scene-bg:
    linear-gradient(180deg, rgba(136, 168, 255, 0.16), rgba(232, 179, 108, 0.08)), #1a2130;
  --window-frame: rgba(244, 234, 223, 0.46);
  --window-line: rgba(244, 234, 223, 0.34);
  --window-glow: rgba(232, 179, 108, 0.16);
  --cat: #0f141d;
  --cat-shadow: rgba(232, 179, 108, 0.1);
  --cat-eye: #e8b36c;
  --cat-blush: rgba(232, 153, 132, 0.72);
  --paw: rgba(244, 234, 223, 0.22);
  --luggage-line: rgba(244, 234, 223, 0.54);
  --luggage-bg: rgba(244, 234, 223, 0.12);
  --dew: #a8eeff;
  --dew-deep: #62c8ea;
  --leaf: #77d5b8;
  --leaf-dark: #4d9d85;
  --dev-bg: rgba(232, 179, 108, 0.16);
  --dev-ink: #f0c98c;
  --toast-bg: #222a38;
  --toast-line: rgba(232, 179, 108, 0.38);
  --postcard-bg:
    linear-gradient(180deg, rgba(232, 179, 108, 0.13), transparent 56%), var(--surface);
  --souvenir-bg:
    linear-gradient(180deg, rgba(232, 153, 132, 0.12), transparent 56%), var(--surface);
  --rare-ink: #ffd18d;
  --rare-bg: rgba(232, 179, 108, 0.16);
  --danger-ink: #f0a792;
  --danger-line: rgba(232, 153, 132, 0.34);
  --danger-bg: rgba(34, 42, 56, 0.76);
  --control-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
  --soft-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

/* 全局基础样式和页面外壳。 */
html {
  min-height: 100%;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Inter,
    'HarmonyOS Sans SC',
    'PingFang SC',
    'Microsoft YaHei',
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--page-bg);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

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

.app-shell {
  width: min(100% - 32px, 1180px);
  margin: 0 auto;
  padding: 22px 0 42px;
}

/* 顶部状态栏、存档条和通用面板的玻璃质感基底。 */
.topbar,
.save-strip,
.home-panel,
.panel {
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  background: var(--surface-glass);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
}

.brand-block,
.top-status,
.slot-buttons,
.save-meta,
.panel-heading,
.item-heading,
.trip-row,
.segmented-control,
.theme-toggle {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 16px;
  min-width: 0;
}

.lab-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--mint-dark);
  font-size: 14px;
  font-weight: 800;
  padding: 0 12px;
  background: var(--surface);
}

.eyebrow,
.section-kicker {
  margin: 0 0 6px;
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 12px;
  font-size: 17px;
}

h4 {
  margin-bottom: 0;
  font-size: 16px;
}

.top-status {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.top-status span,
.panel-heading > span,
.route-pill,
.theme-toggle {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 9px 10px;
}

.theme-toggle {
  min-height: 34px;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--interactive-line);
  transform: translateY(-1px);
}

.save-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 12px;
}

.slot-area {
  min-width: 0;
}

.slot-buttons {
  flex-wrap: wrap;
  gap: 8px;
}

.slot-button {
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.slot-button:hover {
  border-color: var(--interactive-line);
  transform: translateY(-1px);
}

.slot-button.is-active {
  border-color: var(--active-line);
  background: var(--active-bg);
}

.slot-button span,
.slot-button small {
  display: block;
}

.slot-button span {
  font-size: 14px;
  font-weight: 800;
}

.slot-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.save-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dev-note,
.pace-note {
  border-radius: var(--radius);
  background: var(--dev-bg);
  color: var(--dev-ink);
  padding: 7px 9px;
}

main {
  margin-top: 18px;
}

/* 首页场景：通过 CSS 图形表现窗边状态，JS 只切换 is-away。 */
.home-panel {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) minmax(240px, 280px);
  gap: 22px;
  align-items: stretch;
  min-height: 260px;
  padding: 18px;
}

.cat-scene {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--scene-bg);
}

.window-shape {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 118px;
  height: 138px;
  border: 8px solid var(--window-frame);
  border-radius: 26px 26px 8px 8px;
  background:
    linear-gradient(90deg, transparent 47%, var(--window-line) 48% 52%, transparent 53%),
    linear-gradient(180deg, transparent 47%, var(--window-line) 48% 52%, transparent 53%),
    rgba(95, 140, 255, 0.16);
  box-shadow: inset 0 -20px 0 var(--window-glow);
}

.cat-shape {
  position: absolute;
  right: 24px;
  bottom: 28px;
  width: 112px;
  height: 82px;
  border-radius: 42px 42px 24px 24px;
  background: var(--cat);
  box-shadow: -22px 18px 0 var(--cat-shadow);
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.ear {
  position: absolute;
  top: -18px;
  width: 34px;
  height: 34px;
  background: var(--cat);
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.left-ear {
  left: 16px;
}

.right-ear {
  right: 18px;
}

.face {
  position: absolute;
  top: 30px;
  left: 30px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cat-eye);
  box-shadow:
    40px 0 0 var(--cat-eye),
    20px 20px 0 -3px var(--cat-blush);
}

.tail {
  position: absolute;
  right: -16px;
  bottom: 10px;
  width: 42px;
  height: 58px;
  border: 12px solid var(--cat);
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 36px 0 0;
}

.away-traces {
  position: absolute;
  right: 34px;
  bottom: 34px;
  display: none;
  width: 116px;
  height: 76px;
}

.luggage-dot,
.paw-dot {
  position: absolute;
  display: block;
  border-radius: 999px;
}

.luggage-dot {
  right: 10px;
  bottom: 4px;
  width: 42px;
  height: 26px;
  border: 3px solid var(--luggage-line);
  background: var(--luggage-bg);
}

.luggage-dot::before {
  position: absolute;
  top: -13px;
  left: 10px;
  width: 18px;
  height: 12px;
  border: 3px solid var(--luggage-line);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  content: '';
}

.paw-dot {
  width: 14px;
  height: 10px;
  background: var(--paw);
}

.paw-dot-one {
  left: 6px;
  bottom: 12px;
  transform: rotate(-14deg);
}

.paw-dot-two {
  left: 34px;
  bottom: 28px;
  transform: rotate(12deg);
}

.paw-dot-three {
  left: 64px;
  bottom: 42px;
  transform: rotate(-10deg);
}

.cat-scene.is-away .cat-shape {
  display: none;
}

.cat-scene.is-away .away-traces {
  display: block;
}

.home-copy {
  align-self: center;
  min-width: 0;
}

.home-text {
  display: grid;
  gap: 7px;
  margin: 18px 0 14px;
  color: var(--heading);
  font-size: 20px;
  line-height: 1.55;
}

.return-notice,
.panel-note,
.item-card p,
.choice-card em,
.collection-card p {
  color: var(--muted);
  line-height: 1.65;
}

.return-notice {
  margin-bottom: 0;
}

.trip-card {
  display: grid;
  align-content: center;
  gap: 14px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 18px;
}

.trip-row {
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.trip-row strong {
  color: var(--ink);
  text-align: right;
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: var(--mint-soft);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--blue));
  transition: width 0.4s ease;
}

.toast {
  position: fixed;
  z-index: 20;
  top: calc(env(safe-area-inset-top, 0px) + 28px);
  right: auto;
  bottom: auto;
  left: 50%;
  width: max-content;
  max-width: min(calc(100% - 24px), 560px);
  margin: 0;
  border: 1px solid var(--toast-line);
  border-radius: var(--radius);
  background: var(--toast-bg);
  box-shadow: var(--soft-shadow);
  color: var(--mint-dark);
  font-weight: 800;
  padding: 11px 14px;
  text-align: center;
  transform: translateX(-50%);
}

/* 主内容两列：庭院/行李在左，商店和收藏可跨列铺开。 */
.content-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(360px, 1.28fr);
  gap: 16px;
  margin-top: 16px;
}

.panel {
  padding: 18px;
}

.garden-panel {
  --dew-progress: 0;
  --dew-top: 12px;
  --dew-landing-opacity: 0.24;
  --dew-landing-scale: 0.56;
}

.shop-panel,
.collection-panel {
  grid-column: 1 / -1;
}

.panel-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-heading strong {
  color: var(--mint-dark);
  font-size: 22px;
}

/* 庭院动效：JS 通过 class 和 CSS 变量控制露珠位置、落点和满额状态。 */
.dewfall-scene {
  position: relative;
  height: 132px;
  margin: -2px 0 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 18%, rgba(141, 227, 255, 0.26), transparent 22%),
    linear-gradient(180deg, rgba(95, 140, 255, 0.12), rgba(71, 196, 157, 0.2));
}

.dewfall-scene::before {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  height: 16px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 18% 50%, var(--leaf) 0 8px, transparent 9px),
    radial-gradient(circle at 34% 50%, var(--leaf-dark) 0 6px, transparent 7px),
    radial-gradient(circle at 58% 50%, var(--leaf) 0 9px, transparent 10px),
    radial-gradient(circle at 80% 50%, var(--leaf-dark) 0 7px, transparent 8px);
  content: '';
  opacity: 0.72;
}

.garden-stem,
.garden-stem::before,
.garden-stem::after {
  position: absolute;
  display: block;
  border-radius: 999px 999px 12px 12px;
  background: linear-gradient(180deg, var(--leaf), var(--leaf-dark));
  content: '';
}

.garden-stem {
  bottom: 24px;
  width: 8px;
  height: 62px;
  transform-origin: bottom center;
}

.garden-stem::before,
.garden-stem::after {
  width: 28px;
  height: 13px;
  border-radius: 999px 4px 999px 4px;
}

.garden-stem::before {
  top: 14px;
  left: -24px;
  transform: rotate(-24deg);
}

.garden-stem::after {
  top: 31px;
  left: 6px;
  transform: rotate(22deg);
}

.garden-stem-left {
  left: 24%;
  transform: rotate(-7deg);
}

.garden-stem-right {
  right: 20%;
  height: 76px;
  transform: rotate(8deg);
}

.falling-dew {
  position: absolute;
  z-index: 2;
  top: var(--dew-top);
  left: 50%;
  width: 18px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 62% 62% 68% 68%;
  background:
    radial-gradient(circle at 38% 26%, rgba(255, 255, 255, 0.95) 0 3px, transparent 4px),
    linear-gradient(180deg, var(--dew), var(--dew-deep));
  box-shadow:
    0 9px 18px rgba(53, 174, 227, 0.22),
    inset 0 -6px 9px rgba(38, 132, 106, 0.16);
  transform: translateX(-50%);
  transition:
    top 1s linear,
    opacity 0.2s ease;
}

.falling-dew::after {
  position: absolute;
  inset: 4px 5px auto auto;
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  content: '';
}

.dew-landing {
  position: absolute;
  right: 50%;
  bottom: 23px;
  width: 46px;
  height: 9px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(141, 227, 255, 0.72), transparent 70%);
  transform: translateX(50%) scaleX(var(--dew-landing-scale));
  transform-origin: center;
  opacity: var(--dew-landing-opacity);
  transition:
    opacity 1s linear,
    transform 1s linear;
}

.garden-panel.is-full .falling-dew {
  opacity: 0;
}

.garden-panel.has-pending .dew-landing {
  background:
    radial-gradient(circle at 26% 50%, rgba(141, 227, 255, 0.82) 0 4px, transparent 5px),
    radial-gradient(circle at 52% 50%, rgba(141, 227, 255, 0.7) 0 5px, transparent 6px),
    radial-gradient(circle at 74% 50%, rgba(141, 227, 255, 0.78) 0 4px, transparent 5px);
}

/* 交互按钮统一高度和 hover 动效，后续卡片按钮复用这里的基线。 */
.primary-action,
.ghost-action,
.item-card button {
  min-height: 42px;
  border-radius: var(--radius);
  font-weight: 850;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.primary-action {
  width: 100%;
  background: var(--primary-gradient);
  box-shadow: var(--primary-shadow);
  color: var(--primary-ink);
  padding: 0 16px;
}

.primary-action:hover:not(:disabled),
.item-card button:hover:not(:disabled),
.ghost-action:hover {
  transform: translateY(-1px);
}

.primary-action:disabled,
.item-card button:disabled {
  opacity: 0.48;
}

.wide {
  margin-top: 16px;
}

.shop-lists {
  display: grid;
  gap: 20px;
}

/* 商店、行李选择和收藏卡片的通用网格。 */
.shop-group h3,
.luggage-section h3 {
  color: var(--heading);
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.item-card,
.choice-card,
.collection-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.item-card {
  display: grid;
  min-height: 178px;
  align-content: space-between;
  gap: 16px;
  padding: 14px;
}

.item-heading {
  justify-content: space-between;
  gap: 10px;
}

.item-heading span {
  flex: 0 0 auto;
  border-radius: var(--radius);
  background: var(--tag-bg);
  color: var(--tag-ink);
  font-size: 12px;
  font-weight: 850;
  padding: 6px 8px;
}

.item-card p {
  min-height: 52px;
  margin: 10px 0;
  font-size: 14px;
}

.item-card small,
.choice-card small,
.collection-card small {
  color: var(--muted);
  font-size: 12px;
}

.item-card button {
  background: var(--dark-button);
  color: var(--dark-button-ink);
  padding: 0 14px;
}

.luggage-section + .luggage-section {
  margin-top: 18px;
}

.choice-list {
  display: grid;
  gap: 9px;
}

.choice-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.choice-card input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--mint);
}

.choice-card span,
.choice-card em,
.choice-card small {
  display: block;
}

.choice-card span {
  min-width: 0;
}

.choice-card strong {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.choice-card small {
  margin-bottom: 4px;
  font-weight: 800;
}

.choice-card em {
  font-size: 13px;
  font-style: normal;
}

.choice-card.is-selected {
  border-color: var(--active-line);
  background: var(--selected-bg);
}

.choice-card.is-disabled {
  opacity: 0.58;
}

/* 收藏页分段控件和列表。 */
.segmented-control {
  width: fit-content;
  gap: 4px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--control-bg);
  padding: 4px;
}

.segmented-control button {
  min-height: 34px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  padding: 0 14px;
}

.segmented-control button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--control-shadow);
}

.collection-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.collection-card {
  min-height: 168px;
  padding: 15px;
}

.collection-card h3 {
  margin: 14px 0 10px;
  font-size: 18px;
}

.collection-card p {
  min-height: 54px;
  margin-bottom: 16px;
  font-size: 14px;
}

.postcard-card {
  background: var(--postcard-bg);
}

.souvenir-card {
  background: var(--souvenir-bg);
}

.route-pill {
  display: inline-flex;
  margin: 0 6px 6px 0;
  padding: 6px 8px;
}

.rarity-uncommon {
  color: var(--tag-ink);
  background: var(--tag-bg);
}

.rarity-rare {
  color: var(--rare-ink);
  background: var(--rare-bg);
}

.empty-state {
  grid-column: 1 / -1;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.app-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.ghost-action {
  border: 1px solid var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger-ink);
  padding: 0 14px;
}

/* 平板布局：把首页和内容区收为单列，卡片保留两列。 */
@media (max-width: 980px) {
  .home-panel,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .cat-scene {
    min-height: 190px;
  }

  .item-grid,
  .collection-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 手机布局：减小外边距并把卡片、按钮和分段控件改为单列。 */
@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .topbar,
  .save-strip,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    min-height: auto;
  }

  .brand-block {
    width: 100%;
    align-items: flex-start;
  }

  .lab-link {
    min-height: 34px;
  }

  h1 {
    font-size: 25px;
  }

  h2 {
    font-size: 20px;
  }

  .top-status,
  .save-meta,
  .panel-heading > span {
    justify-content: flex-start;
  }

  .save-meta {
    width: 100%;
  }

  .slot-button {
    min-width: 84px;
  }

  .home-panel,
  .panel {
    padding: 14px;
  }

  .home-text {
    font-size: 18px;
  }

  .item-grid,
  .collection-list {
    grid-template-columns: 1fr;
  }

  .item-card {
    min-height: auto;
  }

  .item-card p,
  .collection-card p {
    min-height: auto;
  }

  .segmented-control,
  .segmented-control button,
  .primary-action,
  .ghost-action {
    width: 100%;
  }

  .app-footer {
    justify-content: stretch;
  }
}

/* 用户偏好减少动态时，关闭庭院露珠过渡。 */
@media (prefers-reduced-motion: reduce) {
  .falling-dew,
  .dew-landing {
    transition: none;
  }
}
