/* 宠物工作台基础样式：治愈可爱卡片风，禁企业后台视觉 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-gutter: stable; }
body {
  font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--desk-grad);
  color: var(--text);
  min-height: 100dvh;
  /* 屏蔽浏览器手势：只允许纵向滚动；禁横向滑返回、双指页面缩放、边缘回弹 */
  touch-action: pan-y;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
body.in-app { padding-bottom: 0; }
body.no-tabbar { padding-bottom: 0; }
body.no-tabbar .tabbar { display: none; }
.hidden { display: none !important; }

/* ---- 裸列式 App 壳 ---- */
.app {
  max-width: 430px; margin: 0 auto; min-height: 100dvh; background: var(--bg);
  padding-bottom: 88px;
}
@media (min-width: 768px) {
  .app {
    margin: 26px auto; min-height: calc(100dvh - 52px);
    border-radius: 28px; box-shadow: 0 20px 60px rgba(120, 90, 70, .16);
    overflow: hidden;
  }
}
.view { padding: 14px 14px 32px; }

/* ---- 底部导航 ---- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(100%, 430px);
  display: flex; background: var(--surface);
  border-top: 1px solid var(--tile-bg); padding: 8px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 40;
}
@media (min-width: 768px) { .tabbar { bottom: 26px; border-radius: 0 0 28px 28px; } }
.tab { flex: 1; text-align: center; font-size: 20px; color: var(--muted); background: none; border: none; cursor: pointer; padding: 4px 0; }
.tab span { display: block; font-size: 10px; margin-top: 1px; }
.tab.on, .tab.on span { color: var(--accent); font-weight: 600; }

/* ---- 卡片与按钮 ---- */
.card { background: var(--surface); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.card-t { font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.card-d { font-size: 12px; color: var(--muted); margin-top: 4px; }
.btn { display: block; width: 100%; border: none; border-radius: 999px; padding: 14px; font-size: 16px; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.btn-soft { background: var(--tile-bg); color: var(--text); }
.btn:active { transform: scale(.97); }
.btn-sticky { position: sticky; bottom: 100px; margin-top: 8px; }

/* ---- Pill 选择器 ---- */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1.5px solid var(--tile-bg); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; cursor: pointer;
}
.pill.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ---- 今日状态 2×2 色块 ---- */
.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tile { background: var(--tile-bg); border-radius: var(--radius-md); padding: 12px 6px 10px; text-align: center; }
.tile b { display: block; font-size: 22px; font-weight: 400; }
.tile i { display: block; font-style: normal; font-size: 11px; color: var(--text); margin-top: 3px; }

/* ---- 底部弹层 ---- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(40, 25, 15, .30); z-index: 60; display: flex; align-items: flex-end; }
@media (min-width: 768px) {
  .sheet-backdrop {
    left: 50%; right: auto; transform: translateX(-50%);
    width: min(100%, 430px); border-radius: 28px; overflow: hidden;
    padding-bottom: 26px;
  }
}
.sheet { width: min(100%, 430px); margin: 0 auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); animation: sheet-in .28s cubic-bezier(.32, .72, .25, 1); max-height: 88dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
@keyframes sheet-in { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet h3 { font-size: 16px; margin-bottom: 14px; }
.sheet .btn { margin-top: 14px; }

/* ---- 输入 ---- */
.input {
  width: 100%; border: 1.5px solid var(--tile-bg); background: var(--bg);
  border-radius: var(--radius-sm); padding: 12px; font-size: 15px; color: var(--text); margin-bottom: 10px;
}
.input:focus { outline: none; border-color: var(--accent); }
button.input.date-field { display: block; text-align: left; font-family: inherit; cursor: pointer; }
.label { font-size: 13px; font-weight: 600; margin: 12px 0 6px; display: block; }

/* ---- 登录页 ---- */
.login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 80; }
.login-card { width: 100%; max-width: 340px; background: var(--surface); border-radius: 24px; padding: 32px 24px; box-shadow: 0 20px 60px rgba(120, 90, 70, .18); text-align: center; }
.login-card img { width: 72px; height: 72px; border-radius: 20px; }
.login-card h1 { font-size: 22px; margin: 12px 0 6px; }
.login-card p { font-size: 12px; color: var(--muted); margin-bottom: 18px; }

/* ---- 空态 ---- */
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .big { font-size: 52px; display: block; margin-bottom: 12px; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 6px; }
.empty p { font-size: 13px; margin-bottom: 16px; }

/* ---- 微动效 ---- */
.paw-pop {
  position: fixed; top: 42%; left: 50%; transform: translate(-50%, -50%);
  font-size: 64px; pointer-events: none; z-index: 90;
  animation: paw-pop .9s ease forwards;
}
@keyframes paw-pop {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.4); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(1); }
}
.toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%);
  background: rgba(60, 45, 30, .88); color: #fff; font-size: 13px;
  padding: 10px 18px; border-radius: 999px; z-index: 130; max-width: 86%;
}
.toast.error { background: rgba(190, 70, 50, .92); }

/* ---- 首页 Hero ---- */
.hero { text-align: center; padding: 22px 14px 18px; }
.hero .avatar {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, #FFE3C2, #FFC9A3);
  display: flex; align-items: center; justify-content: center; font-size: 48px; margin: 0 auto 10px;
  box-shadow: var(--shadow-lg);
}
.hero .nm { font-size: 20px; font-weight: 800; }
.hero .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.hero .days { font-size: 13px; color: var(--accent); font-weight: 700; margin-top: 8px; }

/* ---- 首页 Header 与快速记录 ---- */
.pg-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 2px 6px; }
.pg-head .greet { font-size: 13px; color: var(--muted); }
.pg-head .title { font-size: 17px; font-weight: 800; }
.pg-head .icons { display: flex; gap: 12px; font-size: 18px; }
.sync-cloud.pending { opacity: .55; }
.sync-cloud.syncing { animation: cloud-pulse 1.2s ease infinite; }
@keyframes cloud-pulse { 50% { opacity: .45; } }
.quick { display: flex; gap: 8px; }
.quick .q {
  flex: 1; background: var(--surface); border-radius: var(--radius-md); text-align: center;
  padding: 12px 0 10px; font-size: 22px; box-shadow: var(--shadow); border: none; cursor: pointer;
}
.quick .q span { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.sec-t { font-size: 13px; font-weight: 800; margin: 16px 2px 8px; }

/* ---- Onboarding ---- */
.wiz-dots { display: flex; gap: 6px; justify-content: center; margin: 10px 0 18px; }
.wiz-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--tile-bg); }
.wiz-dots i.on { background: var(--accent); width: 18px; border-radius: 4px; }
.wiz-step h2 { font-size: 20px; margin-bottom: 4px; }
.wiz-step .hint { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.type-row { display: flex; gap: 10px; }
.type-card {
  flex: 1; background: var(--surface); border: 2px solid var(--tile-bg); border-radius: var(--radius-lg);
  padding: 18px 0 14px; text-align: center; font-size: 34px; cursor: pointer;
}
.type-card span { display: block; font-size: 13px; color: var(--text); margin-top: 6px; }
.type-card.on { border-color: var(--accent); background: var(--tile-bg); }
.photo-box {
  border: 2px dashed var(--accent-2); border-radius: var(--radius-lg); padding: 34px 10px;
  text-align: center; color: var(--muted); cursor: pointer; background: var(--surface);
}
.photo-box img { max-width: 150px; max-height: 150px; border-radius: var(--radius-md); }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-card { border: 2px solid var(--tile-bg); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; background: var(--surface); }
.theme-card.on { border-color: var(--accent); }
.theme-card .sw { height: 64px; padding: 10px; display: flex; gap: 4px; align-items: flex-end; }
.theme-card .sw i { flex: 1; height: 100%; border-radius: 8px; }
.theme-card .tn { font-size: 13px; font-weight: 700; padding: 8px 10px 10px; }

/* ---- 我的 ---- */
.mine-row {
  display: flex; align-items: center; gap: 12px; background: var(--surface);
  border-radius: var(--radius-lg); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow);
  border: none; width: 100%; font-size: 15px; color: var(--text); cursor: pointer; text-align: left;
}
.mine-row .ico { font-size: 22px; }
.mine-row .arrow { margin-left: auto; color: var(--muted); }
.mine-row .sub { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.pet-mini { display: flex; align-items: center; gap: 10px; }
.pet-mini .av { width: 44px; height: 44px; border-radius: 50%; background: var(--tile-bg); display: flex; align-items: center; justify-content: center; font-size: 22px; overflow: hidden; }
.pet-mini .av img { width: 100%; height: 100%; object-fit: cover; }

/* ---- 里程碑 2：健康中心 ---- */
.back-row { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text); background: none; border: none; cursor: pointer; padding: 6px 0; }
.health-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.health-grid .hg {
  background: var(--surface); border-radius: var(--radius-md); text-align: center;
  padding: 14px 0 12px; font-size: 24px; box-shadow: var(--shadow); border: none; cursor: pointer;
}
.health-grid .hg span { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; }
.hmetric { text-align: center; padding: 18px 0 6px; }
.hmetric .num { font-size: 34px; font-weight: 800; }
.hmetric .unit { font-size: 13px; color: var(--muted); margin-left: 3px; }
.hmetric .delta { font-size: 12px; margin-top: 4px; }
.hmetric .delta.up { color: var(--amber); }
.hmetric .delta.down { color: var(--accent-2); }
.range-row { display: flex; gap: 6px; justify-content: center; margin: 8px 0 2px; }
.range-row .pill { padding: 5px 12px; font-size: 12px; }
.rec-row {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow);
  border: none; width: 100%; font-size: 14px; color: var(--text); cursor: pointer; text-align: left;
}
.rec-row .main { flex: 1; min-width: 0; }
.rec-row .main b { display: block; font-size: 14px; }
.rec-row .main span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.rec-row .tag { font-size: 11px; color: var(--accent); font-weight: 700; white-space: nowrap; }
.rec-row .tag.amber { color: var(--amber); }
.fab {
  position: fixed; bottom: 92px; right: max(16px, calc(50% - 199px)); left: auto;
  width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 26px; border: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); cursor: pointer; z-index: 30;
}
@media (min-width: 768px) { .fab { bottom: 118px; } }
.attach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.attach-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: pointer; }
.attach-add {
  border: 1.5px dashed var(--accent-2); border-radius: 10px; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  color: var(--muted); background: var(--bg); cursor: pointer;
}
.fullimg { position: fixed; inset: 0; background: rgba(20, 12, 8, .92); z-index: 99; display: flex; align-items: center; justify-content: center; }
.fullimg img { max-width: 92%; max-height: 86%; border-radius: 12px; }
.fullimg .fi-close {
  position: absolute; top: 18px; right: 18px; background: rgba(255, 255, 255, .18); color: #fff;
  border: none; border-radius: 50%; width: 36px; height: 36px; font-size: 16px; cursor: pointer;
}
.empty-mini { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 0; }

/* ---- 里程碑 2：提醒 ---- */
.rem-sec { font-size: 12px; font-weight: 800; color: var(--muted); margin: 16px 2px 8px; }
.rem-item {
  display: flex; align-items: center; gap: 12px; background: var(--surface);
  border-radius: var(--radius-md); padding: 13px 14px; margin-bottom: 8px; box-shadow: var(--shadow);
  position: relative; overflow: hidden; transition: transform .22s ease;
}
.rem-item .ric { font-size: 24px; }
.rem-item .rmain { flex: 1; min-width: 0; }
.rem-item .rmain b { display: block; font-size: 14px; }
.rem-item .rmain span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.rem-item.overdue .rmain span { color: var(--amber); }
.rcheck {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--accent-2);
  background: var(--bg); color: #fff; font-size: 15px; cursor: pointer; flex-shrink: 0;
}
.rem-item .rcheck {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--accent-2);
  background: var(--bg); color: #fff; font-size: 15px; cursor: pointer; flex-shrink: 0;
}
.rem-item.done { opacity: .55; }
.rem-item.done .rcheck { background: var(--accent); border-color: var(--accent); }
.rem-item.done .rcheck::after { content: '✓'; }
.rem-item .rdel { background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 4px; }
.rem-item .rswipe {
  position: absolute; top: 0; right: 0; bottom: 0; width: 84px;
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; transform: translateX(100%); transition: transform .22s ease; cursor: pointer;
}
.rem-item.swiped { transform: translateX(-84px); }
.bell-dot {
  position: absolute; top: -2px; right: -3px; width: 8px; height: 8px; border-radius: 50%;
  background: #E2574C; border: 1.5px solid var(--surface);
}
.switch { position: relative; width: 46px; height: 26px; display: inline-block; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0; background: var(--tile-bg); border-radius: 999px; transition: .2s; cursor: pointer;
}
.switch i::after {
  content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }

/* ---- 里程碑 2：体重图表 ---- */
.wchart { width: 100%; height: auto; display: block; }
.wchart .wg { stroke: var(--tile-bg); stroke-width: 1; }
.wchart .wl { stroke: var(--accent); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wchart .wd { fill: var(--accent); }
.wchart .wx { font-size: 8px; fill: var(--muted); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.chart-box { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 12px 10px 6px; margin-bottom: 12px; }

/* ---- 苹果风格日期滚轮 ---- */
.picker-backdrop {
  position: fixed; inset: 0; background: rgba(40, 25, 15, .30); z-index: 120;
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 768px) {
  .picker-backdrop {
    left: 50%; right: auto; transform: translateX(-50%);
    width: min(100%, 430px); border-radius: 28px; overflow: hidden;
    padding-bottom: 26px;
  }
}
.picker-sheet {
  width: min(100%, 430px); background: var(--surface);
  border-radius: 22px 22px 0 0; padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  animation: sheet-in .28s cubic-bezier(.32, .72, .25, 1);
}
.picker-bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px; }
.picker-bar > span { width: 44px; }
.picker-btn { border: none; background: none; font-size: 15px; color: var(--accent); cursor: pointer; padding: 4px 10px; }
.picker-btn.cancel { color: var(--muted); }
.picker-title { font-size: 15px; font-weight: 700; }
.picker-body { display: flex; gap: 10px; position: relative; padding: 0 8px; }
.wheel { flex: 1; height: 220px; overflow-y: auto; scroll-snap-type: y mandatory; padding: 88px 0; scrollbar-width: none; position: relative; z-index: 1; }
.wheel::-webkit-scrollbar { display: none; }
.wheel-item { height: 44px; line-height: 44px; text-align: center; font-size: 17px; color: var(--muted); scroll-snap-align: center; }
.wheel-item.sel { color: var(--text); font-weight: 800; font-size: 20px; }
.picker-highlight {
  position: absolute; top: 88px; left: 18px; right: 18px; height: 44px;
  background: var(--tile-bg); border: 2px solid var(--accent); border-radius: 10px; pointer-events: none;
}
.wheel-caps { display: flex; gap: 10px; padding: 4px 8px 0; }
.wheel-caps span { flex: 1; text-align: center; font-size: 11px; color: var(--muted); }

/* ---- 苹果风左滑操作（提醒） ---- */
.rem-wrap { position: relative; overflow: hidden; border-radius: var(--radius-md); margin-bottom: 8px; box-shadow: var(--shadow); background: var(--surface); }
.rem-wrap .rem-item { box-shadow: none; margin-bottom: 0; border-radius: 0; }
.rem-actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; width: 132px; }
.rem-actions button { flex: 1; border: none; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.rem-act-edit { background: var(--accent-2); }
.rem-act-del { background: #E2574C; }
.rem-item .rrestore { background: none; border: none; color: var(--accent); font-size: 15px; cursor: pointer; padding: 4px; }

/* ---- 里程碑 3：相册 ---- */
.album-grid { columns: 2; column-gap: 8px; }
.m-item { break-inside: avoid; margin-bottom: 8px; border-radius: 12px; overflow: hidden; position: relative; cursor: pointer; box-shadow: var(--shadow); background: var(--tile-bg); }
.m-item img { width: 100%; display: block; }
.m-badge { position: absolute; top: 6px; left: 6px; font-size: 10px; color: #fff; background: rgba(0, 0, 0, .45); padding: 2px 7px; border-radius: 999px; }
.m-badge.fav { left: auto; right: 6px; background: rgba(220, 60, 80, .6); }
.m-badge.sb { background: rgba(140, 110, 70, .6); }
.m-video { width: 100%; aspect-ratio: 1; background: #1c1c1e; display: flex; align-items: center; justify-content: center; color: #fff; position: relative; }
.m-play { font-size: 26px; opacity: .85; }
.m-dur { position: absolute; right: 6px; bottom: 6px; font-size: 10px; background: rgba(0, 0, 0, .5); padding: 2px 6px; border-radius: 999px; }
.d-act { background: rgba(255, 255, 255, .16); color: #fff; border: none; border-radius: 999px; padding: 8px 12px; font-size: 13px; cursor: pointer; }
.d-act.danger { background: rgba(210, 60, 45, .7); }

/* ---- 里程碑 3：时间线 / 手账 ---- */
.tl-card { display: flex; gap: 10px; background: var(--surface); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer; }
.tl-node { display: flex; gap: 10px; padding: 8px 6px; cursor: pointer; border-bottom: 1px dashed var(--tile-bg); font-size: 13px; }
.tl-ico { font-size: 22px; }
.tl-main { flex: 1; }
.tl-main b { display: block; font-size: 14px; }
.tl-main span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.past-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; }
.past-card { flex: 0 0 120px; background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); cursor: pointer; }
.past-card img { width: 120px; height: 100px; object-fit: cover; display: block; }
.past-emo { width: 120px; height: 100px; display: flex; align-items: center; justify-content: center; font-size: 34px; background: var(--tile-bg); }
.past-t { font-size: 11px; padding: 6px 8px 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.past-y { font-size: 10px; color: var(--muted); padding: 2px 8px 8px; }
.sc-card { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 12px; margin: 14px 8px 18px; cursor: pointer; text-align: center; }
.sc-card img { max-width: 100%; max-height: 260px; border-radius: 8px; }
.sc-empty { font-size: 44px; padding: 40px 0; color: var(--muted); }
.sc-date { font-size: 11px; color: var(--accent); font-weight: 800; text-align: left; }
.sc-title { font-size: 14px; font-weight: 700; margin-top: 8px; }
.sc-canvas { position: relative; aspect-ratio: 3 / 4; border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; touch-action: none; }
.sc-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px; }
.sc-slot { background: rgba(255, 255, 255, .6); border: 2px dashed var(--accent-2); border-radius: 10px; min-height: 90px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; cursor: pointer; overflow: hidden; }
.sc-slot.has { border-style: solid; }
.sc-slot img { width: 100%; height: 100%; object-fit: cover; }
.sc-stickers { position: absolute; inset: 0; pointer-events: none; }
.sc-stickers .stk { position: absolute; pointer-events: auto; font-size: 34px; cursor: grab; transform: translate(-50%, -50%); }
.stk.sel { border-radius: 8px; }
.stk-ctl { position: fixed; bottom: 120px; left: 50%; transform: translateX(-50%); background: var(--surface); border-radius: 999px; box-shadow: var(--shadow-lg); padding: 6px 10px; display: flex; gap: 6px; z-index: 65; }
.stk-ctl button { border: none; background: var(--tile-bg); border-radius: 999px; width: 34px; height: 34px; font-size: 15px; cursor: pointer; }
.sticker-btn { border: none; background: var(--surface); border-radius: 10px; width: 38px; height: 38px; font-size: 20px; cursor: pointer; box-shadow: var(--shadow); }

/* ---- 里程碑 3.1：自由手账 ---- */
.sc-free { position: absolute; inset: 0; }
.free-photo { position: absolute; overflow: hidden; border-radius: 8px; cursor: grab; touch-action: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.free-photo img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.free-photo.sel { }
.free-text { position: absolute; color: #5C4A3A; white-space: pre-wrap; cursor: grab; touch-action: none; line-height: 1.5; }
.free-text.sel { border-radius: 4px; }
.sc-stickers .stk { touch-action: none; }
.sc-free .stk { touch-action: none; }

/* ---- 真实手账质感 ---- */
.sc-canvas {
  background-image:
    repeating-linear-gradient(0deg, rgba(150, 120, 100, .045) 0 1px, transparent 1px 27px),
    radial-gradient(rgba(150, 120, 100, .05) 1px, transparent 1.4px);
  background-size: auto, 18px 18px;
}
.sc-canvas::after { content: ''; position: absolute; top: 12px; left: 10%; width: 42%; height: 20px; background: rgba(216, 155, 122, .35); transform: rotate(-4deg); border-radius: 2px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.sc-card { position: relative; }
.sc-card::before { content: ''; position: absolute; top: -8px; left: 20%; width: 58%; height: 20px; background: rgba(216, 155, 122, .4); transform: rotate(2deg); border-radius: 2px; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); z-index: 1; }
.sc-title { font-family: "KaiTi", "STKaiti", "Kaiti SC", serif; }
.sc-date { font-family: "KaiTi", "STKaiti", "Kaiti SC", serif; font-size: 12px; }

/* ---- 首页回忆合并区块（并排 + 堆叠） ---- */
.mem-merge { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.mem-merge.single { grid-template-columns: 1fr; }
.mem-card { position: relative; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 8px 8px; cursor: pointer; min-height: 92px; }
.mem-stack { position: relative; height: 66px; }
.mem-stack img { position: absolute; width: 52px; height: 52px; object-fit: cover; border-radius: 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.mem-stack .mem-emo { position: absolute; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; font-size: 24px; background: var(--tile-bg); border-radius: 10px; }
.mem-stack i { position: absolute; right: 2px; bottom: 0; background: var(--accent); color: #fff; font-style: normal; font-size: 10px; border-radius: 999px; padding: 1px 6px; }
.mem-t { font-size: 12px; font-weight: 700; margin-top: 2px; }
.mem-y { font-size: 10px; color: var(--muted); margin-top: 2px; }
/* 时间线堆叠缩小 */
.tl-stack { width: 46px; height: 46px; }
.tl-stack img { width: 32px; height: 32px; top: 4px; left: 5px; border-radius: 7px; }
.tl-stack i { font-size: 10px; }

/* ---- 相册缩放时间线 ---- */
.alb-grid { display: grid; gap: 6px; margin-bottom: 10px; }
.alb-grid .m-item { margin-bottom: 0; }
.alb-grid .m-item img { aspect-ratio: 1; object-fit: cover; width: 100%; height: 100%; }
.alb-group-h { font-size: 12px; font-weight: 800; color: var(--muted); margin: 10px 2px 6px; }
.m-single { margin-bottom: 14px; }
.m-single img { width: 100%; display: block; border-radius: 12px 12px 0 0; }
.m-single .m-video { border-radius: 12px 12px 0 0; }
.m-single-meta { background: var(--surface); border-radius: 0 0 12px 12px; box-shadow: var(--shadow); font-size: 11px; color: var(--muted); padding: 7px 10px; }

/* ---- 贴纸盒子模型（与照片同款定位，彻底解决拖动/缩放） ---- */
.stk-box { position: absolute; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: grab; pointer-events: auto; user-select: none; -webkit-user-select: none; }
.stk-box span { display: block; line-height: 1; }
.stk-box.sel { border-radius: 8px; }

/* ---- 手账 v3：悬浮工具栏 / 纸张样式 ---- */
.sc-canvas-wrap { position: relative; }
.sc-canvas-wrap .sc-canvas { touch-action: none; }
.sc-tools { position: absolute; right: 8px; top: 64px; display: flex; flex-direction: column; gap: 8px; z-index: 6; touch-action: none; }
.sc-tools button { width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--surface); box-shadow: var(--shadow-lg); font-size: 19px; cursor: pointer; }
.sc-tools .sc-tool-handle { font-size: 13px; color: var(--muted); background: var(--tile-bg); cursor: grab; }
.sc-panel { position: absolute; left: 8px; right: 8px; bottom: 8px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 10px; z-index: 7; max-height: 46%; overflow-y: auto; }
.paper-swatch { display: inline-block; width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(0,0,0,.08); background: #FDF8F0; }
.paper-swatch.paper-lines { background-image: repeating-linear-gradient(0deg, rgba(150,130,110,.25) 0 1px, transparent 1px 6px); }
.paper-swatch.paper-grid { background-image: repeating-linear-gradient(0deg, rgba(150,130,110,.25) 0 1px, transparent 1px 6px), repeating-linear-gradient(90deg, rgba(150,130,110,.25) 0 1px, transparent 1px 6px); }
.paper-swatch.paper-dots { background-image: radial-gradient(rgba(150,130,110,.4) 1px, transparent 1.3px); background-size: 7px 7px; }
.paper-swatch.paper-pink { background: #FFF3EF; }
.paper-swatch.paper-mint { background: #F0FAF4; }
.sc-canvas.paper-lines { background-image: repeating-linear-gradient(0deg, rgba(150,130,110,.16) 0 1px, transparent 1px 44px); }
.sc-canvas.paper-grid { background-image: repeating-linear-gradient(0deg, rgba(150,130,110,.16) 0 1px, transparent 1px 44px), repeating-linear-gradient(90deg, rgba(150,130,110,.16) 0 1px, transparent 1px 44px); }
.sc-canvas.paper-dots { background-image: radial-gradient(rgba(150,130,110,.3) 1.2px, transparent 1.5px); background-size: 26px 26px; }

/* ---- 手账 v4：可画风选中框 ---- */
.sc-tools.collapsed button:not(.sc-tool-handle) { display: none; }
#sel-overlay { position: absolute; border: 2px solid #8B5CF6; border-radius: 6px; pointer-events: none; z-index: 8; box-sizing: border-box; }
#sel-overlay .sel-h { position: absolute; touch-action: none; width: 14px; height: 14px; background: #fff; border: 2px solid #8B5CF6; border-radius: 50%; pointer-events: auto; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
#sel-overlay .sel-h[data-h="nw"] { left: -7px; top: -7px; cursor: nwse-resize; }
#sel-overlay .sel-h[data-h="ne"] { right: -7px; top: -7px; cursor: nesw-resize; }
#sel-overlay .sel-h[data-h="sw"] { left: -7px; bottom: -7px; cursor: nesw-resize; }
#sel-overlay .sel-h[data-h="se"] { right: -7px; bottom: -7px; cursor: nwse-resize; }
#sel-overlay .sel-h.sq { border-radius: 3px; width: 12px; height: 12px; display: none; }
#sel-overlay .sel-h.sq[data-h="w"] { left: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
#sel-overlay .sel-h.sq[data-h="e"] { right: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
#sel-overlay.is-text .sel-h.sq { display: block; }
#sel-overlay .sel-rot { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 18px; width: 32px; height: 32px; background: #fff; border: 2px solid #8B5CF6; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; color: #8B5CF6; pointer-events: auto; cursor: grab; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
#sel-overlay .sel-rot::before { content: ''; position: absolute; bottom: 30px; left: 50%; width: 2px; height: 14px; background: #8B5CF6; }
#sel-overlay .sel-size { position: absolute; top: -28px; right: -8px; background: #8B5CF6; color: #fff; font-size: 10px; border-radius: 6px; padding: 2px 8px; pointer-events: none; display: none; white-space: nowrap; }
#sel-overlay.resizing .sel-size { display: block; }
.sc-panel-close { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: none; border-radius: 50%; background: var(--tile-bg); color: var(--muted); font-size: 12px; cursor: pointer; z-index: 2; }
.sc-panel { padding-top: 8px; }

/* ---- 里程碑 4：装扮 ---- */
.sel-canvas { position: relative; border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; touch-action: pan-y; background: #fff; }
.ds-layer { position: absolute; inset: 0; }
.ds-el { position: absolute; cursor: grab; touch-action: none; transform-origin: center; user-select: none; -webkit-user-select: none; }
.ds-el img { width: 100%; pointer-events: none; }
.ds-el.sticker { display: flex; align-items: center; justify-content: center; }
.ds-el.sel { outline: 1px dashed rgba(139, 92, 246, .4); }
.checker { background-image: conic-gradient(#e8e8e8 25%, #f7f7f7 0 50%, #e8e8e8 0 75%, #f7f7f7 0); background-size: 20px 20px; }
.acc-btn { width: 52px; height: 52px; border: none; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); cursor: pointer; padding: 4px; }
.acc-btn img { width: 100%; height: 100%; object-fit: contain; }

/* ---- 装扮面板紧凑横滑 ---- */
.ds-scroll { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.ds-scroll .acc-btn { flex: 0 0 52px; }
.ds-scroll .sticker-btn { flex: 0 0 auto; }

/* ---- 装扮面板（普通流式布局，非浮层） ---- */
.ds-panel { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 12px; margin-top: 10px; }
.ds-el.sticker { aspect-ratio: 1; }
.alb-grid .m-item.m-cutout img { object-fit: contain; background: #fff; }

/* ---- 首页试用/激活可爱提示条 ---- */
.trial-banner { display: flex; align-items: center; gap: 8px; background: var(--tile-bg); border: 1.5px dashed var(--accent-soft, #E8C8A0); border-radius: 16px; padding: 10px 12px; margin: 4px 0 10px; position: relative; overflow: hidden; }
.trial-banner .tb-pet { font-size: 22px; }
.trial-banner .tb-text { flex: 1; font-size: 12.5px; color: var(--text); line-height: 1.5; }
.trial-banner .tb-text b { color: var(--accent-2, #E8956C); }
.trial-banner .tb-btn { border: none; background: var(--accent); color: #fff; border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(232, 149, 108, .35); flex: 0 0 auto; }
.trial-banner .tb-paw { position: absolute; right: -4px; bottom: -6px; font-size: 26px; opacity: .18; transform: rotate(-15deg); pointer-events: none; }
.trial-banner.expired { background: #FFF6EE; border-color: #F0C8A8; }
