/* ===========================================================
   人人宠伴 · pet.coaiz.com
   暖光书桌 / 米纸 / 琥珀
   =========================================================== */

:root {
  --paper: #FBF5EA;
  --paper-deep: #F4EADB;
  --card: #FFFDF8;
  --ink: #3B2E24;
  --ink-2: #6E5B4A;
  --ink-3: #9C8874;
  --ink-4: #B8A692;
  --amber: #D97706;
  --amber-deep: #B45309;
  --amber-light: #F59E0B;
  --amber-soft: #FBEBCE;
  --line: #EDDFCE;
  --line-soft: #F5EBDD;
  --green: #6F9B77;
  --red-soft: #C2705B;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --shadow-sm: 0 2px 8px -4px rgba(88, 60, 32, .22);
  --shadow-md: 0 14px 32px -22px rgba(88, 60, 32, .45);
  --shadow-lg: 0 30px 60px -30px rgba(88, 60, 32, .45);
  --radius: 22px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-image:
    radial-gradient(1200px 620px at 82% -8%, rgba(245, 158, 11, .12), transparent 62%),
    radial-gradient(900px 520px at 4% 102%, rgba(194, 160, 120, .14), transparent 60%);
  background-attachment: fixed;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

button {
  font-family: inherit;
  color: inherit;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

input { font-family: inherit; }

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

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------------- 桌面端左栏 ---------------- */

.site {
  display: block;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.site-aside { display: none; }

/* ---------------- 应用外壳 ---------------- */

.app {
  max-width: 520px;
  margin: 0 auto;
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}

.app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px 10px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(180deg, rgba(251, 245, 234, .97) 62%, rgba(251, 245, 234, 0));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(160deg, #FFF6E3, #FBE4BE);
  border: 1px solid #F0DDBE;
  display: grid;
  place-items: center;
  color: var(--amber);
  box-shadow: var(--shadow-sm);
}

.brand-mark svg { width: 19px; height: 19px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15.5px; letter-spacing: .04em; font-weight: 700; }
.brand-text small { font-size: 10px; color: var(--ink-4); letter-spacing: .09em; margin-top: 2px; }

/* ---------------- Tab ---------------- */

.tabs { display: flex; align-items: center; }

.tabs-top {
  display: none;
  gap: 2px;
  padding: 4px;
  background: rgba(255, 253, 248, .78);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.tabs-top .tab {
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-3);
  transition: color .2s, background .2s;
}

.tabs-top .tab.is-active {
  background: var(--amber);
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(180, 83, 9, .85);
}

.tabs-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  justify-content: space-around;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 248, .92);
  border-top: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.tabs-bottom .tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 18px;
  font-size: 11px;
  color: var(--ink-4);
  transition: color .18s;
}

.tabs-bottom .tab svg { width: 21px; height: 21px; }
.tabs-bottom .tab.is-active { color: var(--amber-deep); font-weight: 600; }

/* ---------------- 视图 ---------------- */

.view { display: none; }
.view.is-active { display: block; animation: viewIn .34s cubic-bezier(.22, .8, .3, 1); }
.view[hidden] { display: none !important; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.desk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px 11px;
}

.desk-title h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: .01em;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.desk-title h2 > .title-text { flex: none; }

.rename {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-4);
  border-bottom: 1px dashed var(--ink-4);
  padding-bottom: 1px;
  line-height: 1;
}
.rename:hover { color: var(--amber-deep); border-color: var(--amber-deep); }

.desk-title p {
  margin: 7px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: .02em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.desk-title { min-width: 0; }

.snack-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  margin-top: 4px;
  padding: 7px 11px 7px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s;
}
.snack-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.snack-chip #snackCount { font-weight: 700; color: var(--amber-deep); font-variant-numeric: tabular-nums; }
.chip-arrow { width: 13px; height: 13px; color: var(--ink-4); margin-left: 1px; }

/* ---------------- 舞台 ---------------- */

.stage-wrap { position: relative; }

.stage {
  --pet-height: 194px;
  --pet-base: 66px;
  position: relative;
  height: 344px;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 78% 4%, #FFF8E8 0%, #FBEED6 42%, #F3E1C4 100%);
  border: 1px solid #F0DDBE;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .8);
  isolation: isolate;
}

/* 墙面柔光 */
.stage-light {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 85%;
  background:
    radial-gradient(46% 60% at 72% 20%, rgba(255, 236, 190, .85), transparent 70%),
    radial-gradient(38% 50% at 18% 8%, rgba(255, 249, 235, .7), transparent 72%);
  pointer-events: none;
}

/* 窗 */
.stage-window {
  position: absolute;
  top: 26px;
  right: 26px;
  width: 96px;
  height: 118px;
  border-radius: 10px;
  background: linear-gradient(165deg, #FFFDF4, #FDF2D8 65%, #F7E4BC);
  border: 3px solid rgba(255, 253, 248, .85);
  box-shadow: 0 0 0 1px rgba(203, 170, 124, .3), 0 18px 40px -18px rgba(203, 160, 96, .55), inset 0 0 26px rgba(255, 228, 168, .75);
  opacity: .9;
}
.stage-window::before,
.stage-window::after {
  content: "";
  position: absolute;
  background: rgba(255, 253, 248, .82);
}
.stage-window::before { left: 50%; top: 0; bottom: 0; width: 3px; transform: translateX(-50%); }
.stage-window::after { top: 52%; left: 0; right: 0; height: 3px; }
.stage-window i {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  filter: blur(1px);
}
.stage-window i:nth-child(1) { width: 14px; height: 14px; left: 14px; top: 16px; }
.stage-window i:nth-child(2) { width: 8px; height: 8px; right: 20px; bottom: 26px; }
.stage-window i:nth-child(3) { width: 5px; height: 5px; left: 34px; bottom: 44px; opacity: .7; }

/* 绿植剪影 */
.stage-plant {
  position: absolute;
  left: -30px;
  bottom: 120px;
  width: 150px;
  height: 170px;
  opacity: .5;
  background:
    radial-gradient(36% 30% at 44% 62%, rgba(240, 219, 183, .9), transparent 72%),
    radial-gradient(26% 24% at 60% 40%, rgba(255, 246, 224, .8), transparent 72%);
  filter: blur(6px);
  pointer-events: none;
}

.stage-wallline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 130px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180, 143, 96, .28) 22%, rgba(180, 143, 96, .28) 78%, transparent);
}

/* 桌面 */
.stage-table {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 132px;
  background:
    linear-gradient(180deg, #F3D9B5 0%, #E8C79F 24%, #DDB283 100%);
  box-shadow:
    inset 0 14px 24px -18px rgba(120, 84, 48, .55),
    inset 0 -20px 30px -26px rgba(120, 84, 48, .5);
}

.stage-table::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(151, 108, 66, .07) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .12) 0 1px, transparent 1px 96px);
  opacity: .8;
}

.table-lip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 9px;
  background: linear-gradient(180deg, #FBEDD8, #E9C9A0 58%, #DDB98C);
  box-shadow:
    0 5px 12px -5px rgba(120, 84, 48, .55),
    inset 0 1px 0 rgba(255, 255, 255, .75);
}

/* 专注状态牌 */
.focus-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 253, 248, .8);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 6px 18px -12px rgba(120, 84, 48, .6);
  font-size: 11.5px;
  color: var(--ink-2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 4;
}

.focus-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(217, 119, 6, .5);
  animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(217, 119, 6, .45); }
  70% { box-shadow: 0 0 0 7px rgba(217, 119, 6, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
}

/* 宠物 */
.pet-zone {
  position: absolute;
  left: 50%;
  bottom: var(--pet-base);
  width: 300px;
  height: calc(var(--pet-height) + 16px);
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 3;
  cursor: pointer;
}

.pet-halo {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 250px;
  height: 250px;
  margin-left: -125px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 137, .55) 0%, rgba(255, 226, 173, .18) 46%, transparent 68%);
  opacity: 0;
  transform: scale(.86);
  transition: opacity .8s ease, transform 1.2s ease;
  pointer-events: none;
}

.is-focusing .pet-halo { opacity: 1; transform: scale(1); animation: haloBreathe 5.6s ease-in-out infinite; }

@keyframes haloBreathe {
  0%, 100% { transform: scale(1); opacity: .82; }
  50% { transform: scale(1.07); opacity: 1; }
}

.pet-img {
  position: relative;
  height: var(--pet-height);
  width: auto;
  max-width: 96%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 16px 18px rgba(120, 84, 48, .18));
  transform-origin: 50% 100%;
  animation: breathe 5.2s ease-in-out infinite;
  user-select: none;
  -webkit-user-drag: none;
  transition: height .35s cubic-bezier(.22, .8, .3, 1), opacity .3s;
  z-index: 2;
}

@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  50% { transform: translateY(-3px) scale(.994, 1.012); }
}

.pet-zone.is-hop .pet-img { animation: hop .62s cubic-bezier(.3, .9, .4, 1); }

@keyframes hop {
  0% { transform: translateY(0) scale(1, 1); }
  22% { transform: translateY(2px) scale(1.03, .97); }
  48% { transform: translateY(-24px) scale(.97, 1.04); }
  72% { transform: translateY(0) scale(1.02, .98); }
  86% { transform: translateY(-5px) scale(.995, 1.008); }
  100% { transform: translateY(0) scale(1, 1); }
}

.pet-shadow {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 178px;
  height: 26px;
  margin-left: -89px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(122, 84, 44, .28), rgba(122, 84, 44, .06) 62%, transparent 74%);
  filter: blur(2px);
  z-index: 1;
  transition: opacity .4s, transform .4s;
}

.pet-zone.is-hop .pet-shadow { animation: shadowPulse .62s ease-out; }

@keyframes shadowPulse {
  0%, 100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(.82); opacity: .55; }
}

/* 气泡 */
.bubble {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translate(-50%, -6px);
  max-width: 78%;
  padding: 11px 15px;
  border-radius: 16px;
  background: rgba(255, 253, 248, .97);
  border: 1px solid #F2E4D0;
  box-shadow: 0 16px 30px -20px rgba(120, 84, 48, .7);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .26s ease, transform .26s ease;
  z-index: 6;
}

.bubble.is-show { opacity: 1; transform: translate(-50%, 0); }

.bubble i {
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: rgba(255, 253, 248, .97);
  border-right: 1px solid #F2E4D0;
  border-bottom: 1px solid #F2E4D0;
  transform: rotate(45deg);
  border-bottom-right-radius: 3px;
}

.stage-status {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  max-width: 84%;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 253, 248, .72);
  border: 1px solid rgba(255, 255, 255, .8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 5;
  cursor: pointer;
  transition: background .2s, box-shadow .2s;
}

.stage-status:hover { background: rgba(255, 253, 248, .92); box-shadow: var(--shadow-sm); }

.stage-status::after {
  content: " ⌄";
  color: var(--ink-4);
  font-size: 10px;
}

.stage-hint {
  position: absolute;
  right: 14px;
  bottom: 18px;
  font-size: 10.5px;
  color: rgba(110, 91, 74, .62);
  padding: 4px 8px;
  border-radius: 8px;
  z-index: 5;
  transition: background .2s, color .2s;
}
.stage-hint:hover { background: rgba(255, 253, 248, .6); color: var(--ink-2); }

/* 舞台内换宠面板 */
.pet-switcher {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: rgba(251, 245, 234, .86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-content: center;
  animation: viewIn .22s ease;
}

.switch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px 8px;
  border-radius: 16px;
  background: rgba(255, 253, 248, .8);
  border: 1px solid transparent;
  transition: border-color .18s, transform .18s;
}
.switch-item:hover { transform: translateY(-2px); border-color: var(--amber-soft); }
.switch-item.is-current { border-color: var(--amber); background: #FFF9EC; }
.switch-item img { height: 56px; width: auto; object-fit: contain; }
.switch-item b { font-size: 11.5px; font-weight: 600; }
.switch-item small { font-size: 9.5px; color: var(--ink-4); }

.switch-close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 12px;
  color: var(--ink-3);
  padding: 4px 8px;
}

/* ---------------- 控制面板 ---------------- */

.panel {
  margin-top: 12px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  animation: viewIn .3s ease;
}

.goal-field { display: block; }
.goal-label { display: block; font-size: 11.5px; color: var(--ink-3); letter-spacing: .03em; margin-bottom: 8px; }

.goal-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 46px;
  border-radius: 14px;
  background: #FDF8F0;
  border: 1px solid var(--line-soft);
  transition: border-color .2s, box-shadow .2s;
}

.goal-input-wrap:focus-within {
  border-color: #E9C79B;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, .08);
}

.goal-mark { color: var(--amber); font-size: 15px; line-height: 1; }

.goal-input-wrap input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  color: var(--ink);
  height: 100%;
}

.goal-input-wrap input::placeholder { color: var(--ink-4); }

.goal-clear { color: var(--ink-4); font-size: 17px; line-height: 1; padding: 4px; }
.goal-clear:hover { color: var(--ink-2); }

.duration-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 0 10px;
}

.duration-label { font-size: 11.5px; color: var(--ink-3); letter-spacing: .03em; }

.duration-pills { display: flex; gap: 5px; }

.duration-pills button {
  min-width: 40px;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--ink-2);
  background: #FBF3E7;
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
  transition: all .18s;
}

.duration-pills button:hover { background: #F8EBD9; }

.duration-pills button.is-active {
  background: var(--amber-soft);
  border-color: #EDC58A;
  color: var(--amber-deep);
  font-weight: 700;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 22px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 5px;
  background: linear-gradient(90deg, #F0C083 var(--pct, 24%), #EBD9BE var(--pct, 24%));
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 19px;
  height: 19px;
  margin-top: -7px;
  border-radius: 50%;
  background: #FFFDF8;
  border: 2px solid var(--amber);
  box-shadow: 0 3px 8px -3px rgba(180, 83, 9, .6);
}

input[type="range"]::-moz-range-track {
  height: 5px;
  border-radius: 5px;
  background: linear-gradient(90deg, #F0C083 var(--pct, 24%), #EBD9BE var(--pct, 24%));
}
input[type="range"]::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #FFFDF8;
  border: 2px solid var(--amber);
}

.range-row output {
  flex: none;
  min-width: 62px;
  text-align: right;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--amber-deep);
  font-variant-numeric: tabular-nums;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  height: 50px;
  border-radius: 15px;
  background: linear-gradient(180deg, #E8890D, #CE6D05);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .03em;
  box-shadow: 0 12px 24px -14px rgba(180, 83, 9, .9), inset 0 1px 0 rgba(255, 255, 255, .28);
  transition: transform .16s, box-shadow .16s, filter .16s;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 30px -14px rgba(180, 83, 9, .95); }
.btn-primary:active { transform: translateY(0) scale(.995); filter: brightness(.98); }

.btn-primary svg { width: 16px; height: 16px; margin-right: 7px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 18px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #FFFCF6;
  font-size: 13px;
  color: var(--ink-2);
  transition: background .18s, border-color .18s;
}

.btn-ghost:hover { background: #FBF3E7; border-color: #E5D2BA; }
.btn-soft { color: var(--ink-3); background: transparent; }

.panel-note {
  margin: 11px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: .02em;
}

/* 计时面板 */
.panel-timer { padding: 20px 18px 18px; }

.timer-top { display: flex; align-items: center; gap: 18px; }

.ring-wrap { position: relative; width: 132px; height: 132px; flex: none; }

.ring { width: 132px; height: 132px; transform: rotate(-90deg); }

.ring-track { fill: none; stroke: #F3E7D6; stroke-width: 7; }

.ring-bar {
  fill: none;
  stroke: var(--amber);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 364.42;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .9s linear;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.time-left {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.ring-center small { font-size: 10.5px; color: var(--ink-4); letter-spacing: .08em; }

.timer-meta { flex: 1; min-width: 0; }

.timer-goal {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.timer-tip { margin: 7px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--ink-4); }

.timer-actions { display: flex; gap: 10px; margin-top: 16px; }
.timer-actions .btn-ghost { flex: 1; }

/* ---------------- 通用页面头部 ---------------- */

.page-head { padding: 10px 2px 14px; }

.page-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
}

.page-head p { margin: 7px 0 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 20px 2px 10px;
}

.section-head h3 { margin: 0; font-size: 13.5px; font-weight: 700; letter-spacing: .03em; }
.section-count { font-size: 11.5px; color: var(--ink-4); }

.text-btn { font-size: 11.5px; color: var(--amber-deep); }
.text-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------- 偶遇 ---------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 16px;
}

.card-pet { display: flex; gap: 13px; align-items: center; }

.card-avatar {
  width: 74px;
  height: 74px;
  border-radius: 20px;
  flex: none;
  background: linear-gradient(160deg, #FFF7E9, #F7E6C9);
  border: 1px solid #F1E0C8;
  display: grid;
  place-items: end center;
  overflow: hidden;
}

.card-avatar img { height: 68px; width: auto; object-fit: contain; }

.card-info { flex: 1; min-width: 0; }

.name-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.name-row strong { font-size: 15px; letter-spacing: .01em; }

.tag {
  font-size: 10px;
  padding: 2.5px 7px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber-deep);
  border: 1px solid #F1D6A9;
  white-space: nowrap;
}

.card-owner { margin: 6px 0 0; font-size: 11.5px; color: var(--ink-3); }

.owner-edit {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  color: var(--ink-2);
  border-bottom: 1px dashed var(--ink-4);
  padding-bottom: 1px;
}
.owner-edit svg { width: 11px; height: 11px; opacity: .6; }
.owner-edit:hover { color: var(--amber-deep); border-color: var(--amber-deep); }

.card-goal {
  margin: 5px 0 0;
  font-size: 11.5px;
  color: var(--ink-4);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card-share { margin-top: 15px; padding-top: 14px; border-top: 1px dashed var(--line); }

.btn-share { height: 46px; font-size: 14px; }

.card-share-tip { margin: 9px 0 0; font-size: 11px; line-height: 1.6; color: var(--ink-4); text-align: center; }

/* 来访 */
.visitor-area:empty { display: none; }

.visitor-card {
  margin-top: 14px;
  border-radius: var(--radius);
  border: 1px solid #EAD2AE;
  background: linear-gradient(165deg, #FFFDF6, #FDF3E1);
  box-shadow: var(--shadow-md);
  padding: 16px;
  position: relative;
  overflow: hidden;
  animation: viewIn .4s ease;
}

.visitor-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, .16), transparent 68%);
  pointer-events: none;
}

.visitor-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--amber-deep);
  letter-spacing: .06em;
  margin-bottom: 10px;
}

.visitor-main { display: flex; gap: 13px; align-items: center; }

.visitor-main img {
  width: 86px;
  height: 86px;
  object-fit: contain;
  object-position: bottom;
  flex: none;
  filter: drop-shadow(0 8px 10px rgba(120, 84, 48, .16));
}

.visitor-body h4 { margin: 0; font-size: 14.5px; font-weight: 700; }
.visitor-body p { margin: 5px 0 0; font-size: 11.5px; line-height: 1.65; color: var(--ink-3); }

.visitor-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .7);
  border: 1px dashed #EBD3B4;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-2);
  font-family: var(--serif);
}

.visitor-actions { display: flex; gap: 8px; margin-top: 13px; }
.visitor-actions .btn-primary { height: 42px; font-size: 12.5px; flex: 1; }
.visitor-actions .btn-ghost { flex: none; font-size: 12px; }

/* 小报 */
.news-list { display: flex; flex-direction: column; gap: 10px; }

.news-card {
  position: relative;
  padding: 14px 16px 14px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.news-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, #F2C078, #E29A45);
  opacity: .85;
}

.news-meta { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--ink-4); margin-bottom: 6px; }
.news-meta img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }

.news-text {
  margin: 0;
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.78;
  color: var(--ink-2);
}

.news-from { display: block; margin-top: 8px; font-size: 10.5px; color: var(--ink-4); text-align: right; font-family: var(--sans); }

/* 已认识 */
.friend-list { display: flex; flex-direction: column; gap: 9px; }

.friend-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
  text-align: left;
  width: 100%;
  transition: transform .16s, border-color .16s;
}

.friend-row:hover { transform: translateY(-1px); border-color: #E7D3B7; }

.friend-row img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: contain;
  object-position: bottom;
  background: #FBF2E3;
  flex: none;
}

.friend-info { flex: 1; min-width: 0; }
.friend-info b { display: block; font-size: 13px; font-weight: 600; }
.friend-info small { display: block; font-size: 10.5px; color: var(--ink-4); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-arrow { color: var(--ink-4); font-size: 15px; }

.empty-card {
  padding: 20px 16px;
  border-radius: 16px;
  border: 1px dashed #E7D3B7;
  background: rgba(255, 253, 248, .55);
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-4);
}

/* ---------------- 小窝 ---------------- */

.stat-card {
  display: flex;
  align-items: center;
  padding: 16px 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.stat { flex: 1; text-align: center; }
.stat b {
  display: block;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.stat span { display: block; margin-top: 4px; font-size: 10.5px; color: var(--ink-4); }
.stat-line { width: 1px; height: 30px; background: var(--line-soft); }

.pet-cards { display: flex; flex-direction: column; gap: 11px; }

.pet-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  transition: border-color .2s;
}

.pet-card.is-current { border-color: #EBC794; box-shadow: 0 12px 30px -22px rgba(180, 83, 9, .55); }
.pet-card.is-locked { background: rgba(255, 253, 248, .6); border-style: dashed; }

.pet-card-top { display: flex; gap: 12px; align-items: center; }

.pet-card-img {
  width: 66px;
  height: 66px;
  border-radius: 17px;
  background: linear-gradient(160deg, #FFF8EA, #F7E8CF);
  border: 1px solid #F0E0C9;
  display: grid;
  place-items: end center;
  overflow: hidden;
  flex: none;
}
.pet-card-img img { height: 61px; width: auto; object-fit: contain; }
.is-locked .pet-card-img { background: linear-gradient(160deg, #FBF4E6, #F6EAD6); }
.is-locked .pet-card-img img { opacity: .92; }

.pet-card-meta { flex: 1; min-width: 0; }

.pet-card-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pet-card-name b { font-size: 14px; font-weight: 700; }
.pet-card-name span.species { font-size: 11px; color: var(--ink-4); }
.pet-card-name .tag { font-size: 9.5px; }

.pet-card-info { margin: 5px 0 0; font-size: 11px; color: var(--ink-4); line-height: 1.5; }

.pet-card-action { flex: none; }

.mini-btn {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #FFFCF6;
  font-size: 11px;
  color: var(--ink-2);
  white-space: nowrap;
}
.mini-btn:hover { border-color: #E3CDAF; background: #FBF3E7; }
.mini-btn.is-primary { background: var(--amber-soft); border-color: #EDC98F; color: var(--amber-deep); font-weight: 600; }

.bowl {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed var(--line-soft);
}

.bowl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bowl-label { font-size: 10.5px; color: var(--ink-4); letter-spacing: .02em; }

.bowl-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 7px;
  min-height: 26px;
  padding: 6px 9px;
  border-radius: 11px;
  background: #FDF7EC;
  border: 1px solid #F4E8D7;
}

.bowl-items i { font-size: 15px; line-height: 1; font-style: normal; animation: popIn .3s ease backwards; }

@keyframes popIn {
  from { transform: scale(.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.bowl-more { font-size: 10px; color: var(--ink-3); margin-left: 3px; }
.bowl-empty { font-size: 10.5px; color: var(--ink-4); }

.milestone { margin: 9px 0 0; font-size: 10.5px; color: var(--ink-4); }
.milestone b { color: var(--amber-deep); font-weight: 600; }

.foot-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 26px 0 6px;
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: .04em;
}

.foot-links .text-btn { color: var(--ink-4); font-size: 10.5px; }
.foot-links .text-btn:hover { color: var(--red-soft); }

/* ---------------- 模态 ---------------- */

.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }

.modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(58, 42, 28, .42);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fadeIn .24s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border-radius: 26px;
  padding: 26px 22px 20px;
  box-shadow: 0 40px 80px -40px rgba(40, 26, 12, .7);
  text-align: center;
  animation: cardIn .38s cubic-bezier(.2, .9, .3, 1.1);
  overflow: hidden;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to { opacity: 1; transform: none; }
}

.reward-glow {
  position: absolute;
  left: 50%;
  top: -70px;
  width: 240px;
  height: 190px;
  margin-left: -120px;
  background: radial-gradient(circle, rgba(250, 197, 106, .55), transparent 66%);
  pointer-events: none;
}

.reward-kicker {
  position: relative;
  font-size: 10.5px;
  letter-spacing: .22em;
  color: var(--amber-deep);
  text-transform: uppercase;
}

.modal-card h3 {
  position: relative;
  margin: 9px 0 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
}

.reward-snack {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  margin: 14px 0 2px;
  padding: 14px 0 12px;
}

.reward-snack-icon { font-size: 34px; align-self: center; animation: popIn .5s .1s backwards; }
.reward-snack b { font-family: var(--serif); font-size: 40px; font-weight: 600; color: var(--amber-deep); line-height: 1; }
.reward-snack-unit { font-size: 12.5px; color: var(--ink-3); }

.reward-line {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
}

.reward-extra { margin: 7px 0 0; font-size: 10.5px; color: var(--ink-4); }

.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.modal-actions .btn-primary { height: 46px; font-size: 14px; }
.modal-actions .btn-ghost { height: 40px; border: none; background: none; color: var(--ink-3); font-size: 12px; }
.modal-actions .btn-ghost:hover { background: #FBF3E7; }

.name-card h3 { margin-top: 0; }
.name-sub { margin: 7px 0 16px; font-size: 11.5px; color: var(--ink-4); }

.name-card input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #FDF8F0;
  font-size: 16px;
  text-align: center;
  color: var(--ink);
  outline: none;
}
.name-card input:focus { border-color: #E9C79B; box-shadow: 0 0 0 3px rgba(217, 119, 6, .08); }

/* ---------------- 首次进入 ---------------- */

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(1000px 600px at 80% -10%, rgba(245, 158, 11, .16), transparent 60%),
    rgba(251, 245, 234, .97);
  backdrop-filter: blur(8px);
  overflow-y: auto;
}

.onboard-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  padding: 24px 20px 20px;
  text-align: center;
  animation: cardIn .5s cubic-bezier(.2, .9, .3, 1.05);
}

.onboard-kicker { font-size: 10.5px; letter-spacing: .24em; color: var(--amber); }

.onboard-card h2 {
  margin: 9px 0 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: .01em;
}

.onboard-sub { margin: 8px 0 16px; font-size: 12px; line-height: 1.7; color: var(--ink-3); }

.onboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.onboard-item {
  position: relative;
  padding: 8px 4px 7px;
  border-radius: 16px;
  border: 1.5px solid transparent;
  background: #FDF8F0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: border-color .18s, background .18s, transform .18s;
}

.onboard-item:hover { transform: translateY(-2px); background: #FBF2E3; }
.onboard-item.is-chosen { border-color: var(--amber); background: #FFF8E9; }
.onboard-item img { height: 62px; width: auto; object-fit: contain; }
.onboard-item b { font-size: 11px; font-weight: 600; }
.onboard-item small { font-size: 9px; color: var(--ink-4); }

.onboard-item .check {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--amber);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  display: none;
}
.onboard-item.is-chosen .check { display: block; }

.onboard-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 15px 0 14px;
  padding: 0 12px;
  height: 46px;
  border-radius: 13px;
  background: #FDF8F0;
  border: 1px solid var(--line-soft);
  text-align: left;
}

.onboard-name span { font-size: 11.5px; color: var(--ink-3); flex: none; }

.onboard-name input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-size: 16px;
  color: var(--ink);
}

.onboard-foot { margin: 12px 0 0; font-size: 10px; color: var(--ink-4); letter-spacing: .03em; }

/* ---------------- 提示 ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(78px + env(safe-area-inset-bottom));
  transform: translate(-50%, 8px);
  z-index: 120;
  max-width: 82vw;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(59, 46, 36, .94);
  color: #FFF8EC;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 18px 30px -18px rgba(40, 26, 12, .8);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s, transform .24s;
}

.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* 零食飘落 */
.snack-rain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 7;
}

.snack-rain i {
  position: absolute;
  top: -24px;
  font-size: 18px;
  font-style: normal;
  animation: fall linear forwards;
  filter: drop-shadow(0 4px 4px rgba(120, 84, 48, .2));
}

@keyframes fall {
  0% { transform: translateY(-20px) rotate(0); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(330px) rotate(220deg); opacity: 0; }
}

/* 爱心 */
.heart {
  position: absolute;
  font-size: 17px;
  pointer-events: none;
  z-index: 9;
  animation: floatUp 1.1s ease-out forwards;
}

@keyframes floatUp {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; }
  22% { opacity: 1; }
  100% { transform: translate(var(--dx, 10px), -74px) scale(1.05); opacity: 0; }
}

/* ---------------- 桌面端 ---------------- */

@media (min-width: 980px) {
  .site {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 470px;
    gap: 64px;
    align-items: start;
    padding: 0 40px 60px;
    max-width: 1180px;
  }

  .site-aside {
    display: block;
    position: sticky;
    top: 88px;
    padding-top: 46px;
  }

  .aside-kicker { font-size: 11px; letter-spacing: .26em; color: var(--amber); text-transform: uppercase; }

  .aside-title {
    margin: 18px 0 0;
    font-family: var(--serif);
    font-size: 44px;
    line-height: 1.34;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--ink);
  }

  .aside-copy {
    margin: 20px 0 0;
    max-width: 420px;
    font-size: 13.5px;
    line-height: 1.9;
    color: var(--ink-2);
  }

  .aside-points { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }

  .aside-points li { display: flex; gap: 12px; align-items: flex-start; }

  .point-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: #FFFDF8;
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    color: var(--amber);
    flex: none;
    box-shadow: var(--shadow-sm);
  }
  .point-icon svg { width: 17px; height: 17px; }

  .aside-points b { display: block; font-size: 13px; font-weight: 700; }
  .aside-points small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--ink-4); line-height: 1.6; }

  .aside-foot { margin: 40px 0 0; font-size: 10.5px; color: var(--ink-4); letter-spacing: .06em; }

  .app { max-width: 470px; margin: 0; padding-bottom: 30px; }

  .app-head { padding: 52px 2px 12px; position: static; background: none; }

  .tabs-top { display: flex; }
  .toast { bottom: 34px; }
  .tabs-bottom { display: none; }

  .stage { --pet-height: 236px; --pet-base: 76px; height: 400px; }
  .pet-zone { width: 340px; }

  .desk-title h2 { font-size: 27px; }
  .page-head h2 { font-size: 27px; }
}

@media (min-width: 1280px) {
  .site { gap: 80px; }
  .aside-title { font-size: 48px; }
}

/* ---------------- 响应 / 无障碍 ---------------- */

@media (max-width: 400px) {
  .stage { --pet-height: 176px; --pet-base: 60px; height: 312px; }
  .bubble { font-size: 12.5px; padding: 10px 13px; }
  .stage-status { font-size: 11px; max-width: 88%; }
  .pet-zone { width: 270px; }
  .desk-title h2 { font-size: 22px; }
  .pet-switcher { padding: 12px; gap: 7px; }
  .switch-item img { height: 46px; }
}

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

/* 小窝分组标签 */
.group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 4px 2px;
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--ink-4);
  text-transform: uppercase;
}

.group-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.group-label:first-child { margin-top: 4px; }


/* 照片风格的宠伴（布偶猫）铺满容器 */
.card-avatar img[src$="ragdoll.jpg"],
.pet-card-img img[src$="ragdoll.jpg"],
.onboard-item img[src$="ragdoll.jpg"],
.switch-item img[src$="ragdoll.jpg"] {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}


.visitor-kicker svg { width: 13px; height: 13px; opacity: .8; }

.visitor-note b {
  display: block;
  margin-bottom: 3px;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: .1em;
  color: var(--amber-deep);
  font-weight: 600;
}

.visitor-sent {
  margin: 8px 0 0;
  font-size: 10.5px;
  color: var(--ink-4);
  text-align: right;
}
