/* ============================================================
   家庭相册 · 样式
   基调：奶油白 + 暖橘 + 蜜糖黄，圆角、柔和阴影、留白充足
   ============================================================ */

:root {
  --bg: #FFF9F3;
  --bg-soft: #FDF1E6;
  --card: #FFFFFF;
  --card-2: #FFFCF8;
  --line: #F2E4D6;
  --line-soft: #F8EDE1;

  --ink: #43342B;
  --ink-2: #7A6559;
  --ink-3: #A89486;

  --brand: #E8855B;
  --brand-2: #F0A868;
  --brand-soft: #FDEDE3;
  --honey: #EFB544;
  --honey-soft: #FDF3DC;
  --sage: #7FA98B;
  --sage-soft: #EAF3EC;
  --rose: #E09AA3;
  --rose-soft: #FCEEF0;

  --shadow-s: 0 2px 8px rgba(196, 152, 112, .10);
  --shadow-m: 0 6px 20px rgba(196, 152, 112, .14);
  --shadow-l: 0 14px 40px rgba(180, 130, 90, .18);

  --r-s: 12px;
  --r-m: 18px;
  --r-l: 26px;

  --tab-h: 60px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
          "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

html[data-theme="dark"] {
  --bg: #1C1714;
  --bg-soft: #241D19;
  --card: #2A221D;
  --card-2: #302721;
  --line: #3B302A;
  --line-soft: #332A24;
  --ink: #F6EBE1;
  --ink-2: #C9B4A4;
  --ink-3: #9B8778;
  --brand: #EE9A6D;
  --brand-2: #F2B47C;
  --brand-soft: #3A2A21;
  --honey-soft: #3A3123;
  --sage-soft: #26332B;
  --rose-soft: #3A2A2E;
  --shadow-s: 0 2px 8px rgba(0, 0, 0, .3);
  --shadow-m: 0 6px 20px rgba(0, 0, 0, .38);
  --shadow-l: 0 14px 40px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { min-height: 100vh; }
img, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: none; background: none; cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
.hide { display: none !important; }

/* ---------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 40;
  padding: calc(var(--safe-t) + 10px) 16px 12px;
  background: linear-gradient(180deg, var(--bg) 62%, rgba(255, 249, 243, 0));
  backdrop-filter: saturate(1.2) blur(6px);
  display: flex; align-items: center; gap: 12px;
}
html[data-theme="dark"] .topbar { background: linear-gradient(180deg, var(--bg) 62%, rgba(28, 23, 20, 0)); }
.topbar h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: .3px; }
.topbar .sub { margin: 2px 0 0; font-size: 12px; color: var(--ink-3); }
.topbar .grow { flex: 1; min-width: 0; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-size: 18px;
  background: var(--card); box-shadow: var(--shadow-s); color: var(--ink-2);
  transition: transform .16s;
}
.icon-btn:active { transform: scale(.9); }

/* 暖色欢迎头 */
.hero {
  margin: 0 16px 16px;
  padding: 20px 18px;
  border-radius: var(--r-l);
  background: linear-gradient(135deg, #F7A473 0%, #EE8E60 52%, #E2836A 100%);
  color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--shadow-m);
}
.hero::after {
  content: ""; position: absolute; right: -34px; top: -46px;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
}
.hero::before {
  content: ""; position: absolute; right: 42px; bottom: -60px;
  width: 108px; height: 108px; border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}
.hero .h-date { font-size: 12.5px; opacity: .92; letter-spacing: .5px; }
.hero .h-title { font-size: 22px; font-weight: 700; margin: 6px 0 4px; position: relative; }
.hero .h-motto { font-size: 13px; opacity: .95; }
.hero .h-stats { display: flex; gap: 18px; margin-top: 16px; position: relative; }
.hero .h-stat b { display: block; font-size: 20px; font-weight: 700; line-height: 1.2; }
.hero .h-stat span { font-size: 11.5px; opacity: .9; }

/* ---------------------------------------------------------- 主区域 */
main {
  padding: 0 0 calc(var(--tab-h) + var(--safe-b) + 26px);
  min-height: 70vh;
}
.pad { padding: 0 16px; }

.section { margin: 22px 0 0; }
.section-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 0 16px 10px;
}
.section-head h2 { margin: 0; font-size: 16.5px; font-weight: 700; }
.section-head .hint { font-size: 12px; color: var(--ink-3); }
.section-head .more { margin-left: auto; font-size: 12.5px; color: var(--brand); font-weight: 600; }

.card {
  background: var(--card); border-radius: var(--r-m);
  box-shadow: var(--shadow-s); padding: 16px; margin: 0 16px;
}
.card + .card { margin-top: 12px; }

.row { display: flex; align-items: center; gap: 12px; }
.row + .row { margin-top: 14px; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-size: 14.5px; font-weight: 600; }
.row .d { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.row .val { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.divider { height: 1px; background: var(--line-soft); margin: 14px 0; }

/* ---------------------------------------------------------- 网格 */
.grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 5px; padding: 0 16px;
}
.grid.g2 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid.g4 { grid-template-columns: repeat(4, 1fr); gap: 4px; }
.cell {
  position: relative; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden;
  background: var(--bg-soft); cursor: pointer;
  animation: pop .3s ease both;
}
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.cell img { width: 100%; height: 100%; object-fit: cover; }
.cell .badge-v {
  position: absolute; right: 5px; bottom: 5px;
  background: rgba(30, 20, 14, .58); color: #fff;
  font-size: 10.5px; padding: 1px 6px; border-radius: 20px;
  backdrop-filter: blur(4px);
}
.cell .fav {
  position: absolute; left: 5px; top: 5px; font-size: 12px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .45));
}
.cell .pick {
  position: absolute; right: 5px; top: 5px; width: 19px; height: 19px;
  border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .9);
  background: rgba(20, 14, 10, .35); display: grid; place-items: center;
  color: #fff; font-size: 12px;
}
.cell.sel .pick { background: var(--brand); border-color: #fff; }
.cell.sel img { opacity: .72; }
.cell.noimg { display: grid; place-items: center; color: var(--ink-3); font-size: 22px; }

.day-group { padding-top: 4px; }
.day-head {
  position: sticky; top: calc(var(--safe-t) + 54px); z-index: 12;
  padding: 8px 16px 6px; margin-top: 8px;
  background: linear-gradient(180deg, var(--bg) 72%, rgba(255, 249, 243, 0));
  font-size: 13.5px; font-weight: 700; display: flex; align-items: baseline; gap: 8px;
}
html[data-theme="dark"] .day-head { background: linear-gradient(180deg, var(--bg) 72%, rgba(28, 23, 20, 0)); }
.day-head .wd { font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.day-head .n { margin-left: auto; font-size: 11.5px; color: var(--ink-3); font-weight: 500; }

/* ---------------------------------------------------------- 筛选条 */
.chips {
  display: flex; gap: 8px; padding: 4px 16px 12px;
  overflow-x: auto; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 14px; border-radius: 20px;
  background: var(--card); color: var(--ink-2); font-size: 13px;
  box-shadow: var(--shadow-s); white-space: nowrap; transition: all .18s;
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(232, 133, 91, .35); }
.chip .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* ---------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 18px; border-radius: 14px; font-size: 14.5px; font-weight: 600;
  background: var(--brand-soft); color: var(--brand); transition: transform .14s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  background: linear-gradient(135deg, #F0A06B, #E8855B); color: #fff;
  box-shadow: 0 6px 16px rgba(232, 133, 91, .34);
}
.btn.ghost { background: var(--card); box-shadow: var(--shadow-s); color: var(--ink-2); }
.btn.sage { background: var(--sage-soft); color: #4E7A5D; }
.btn.danger { background: var(--rose-soft); color: #C25C68; }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------------------------------------------------------- 开关 */
.switch {
  width: 48px; height: 28px; border-radius: 20px; background: var(--line);
  position: relative; flex: none; transition: background .22s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .22); transition: transform .22s;
}
.switch.on { background: linear-gradient(135deg, #F0A06B, #E8855B); }
.switch.on::after { transform: translateX(20px); }

/* ---------------------------------------------------------- 相册卡 */
.album-card {
  background: var(--card); border-radius: var(--r-m); overflow: hidden;
  box-shadow: var(--shadow-s); position: relative;
}
.album-card .cover { aspect-ratio: 4/3; background: var(--bg-soft); position: relative; overflow: hidden; }
.album-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.album-card .cover .ph { display: grid; place-items: center; height: 100%; font-size: 34px; }
.album-card .meta { padding: 10px 12px 12px; }
.album-card .meta .nm { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.album-card .meta .ct { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.album-card .pin {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  background: rgba(255, 255, 255, .9); color: var(--ink);
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* ---------------------------------------------------------- 成员 */
.member {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
}
.member + .member { border-top: 1px solid var(--line-soft); }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 17px;
  box-shadow: var(--shadow-s);
}
.avatar.sm { width: 30px; height: 30px; font-size: 12.5px; }
.avatar.lg { width: 62px; height: 62px; font-size: 24px; }

/* ---------------------------------------------------------- 统计条 */
.bar { height: 9px; border-radius: 10px; background: var(--line-soft); overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.legend span { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: block; }

.kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 16px; }
.kpi > div {
  background: var(--card); border-radius: var(--r-m); padding: 13px 12px;
  box-shadow: var(--shadow-s); text-align: center;
}
.kpi b { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 11.5px; color: var(--ink-3); }

/* ---------------------------------------------------------- 底栏 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: rgba(255, 252, 248, .93);
  backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--line-soft);
}
html[data-theme="dark"] .tabbar { background: rgba(42, 34, 29, .93); }
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--ink-3); font-size: 10.5px; transition: color .18s;
}
.tabbar button .ic { font-size: 21px; line-height: 1; transition: transform .2s; }
.tabbar button.on { color: var(--brand); font-weight: 700; }
.tabbar button.on .ic { transform: translateY(-2px) scale(1.08); }
.tabbar button.mid .ic {
  width: 44px; height: 44px; border-radius: 50%; margin-top: -4px;
  display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(135deg, #F0A06B, #E8855B); color: #fff;
  box-shadow: 0 6px 16px rgba(232, 133, 91, .4);
}

/* ---------------------------------------------------------- 弹层 */
.mask {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(48, 34, 26, .42); backdrop-filter: blur(2px);
  animation: fade .2s ease both;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 81;
  background: var(--bg); border-radius: 24px 24px 0 0;
  padding: 8px 0 calc(16px + var(--safe-b));
  max-height: 88vh; overflow-y: auto;
  animation: up .28s cubic-bezier(.22, .9, .3, 1) both;
  box-shadow: var(--shadow-l);
}
@keyframes up { from { transform: translateY(102%) } to { transform: none } }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 6px auto 12px; }
.sheet h3 { margin: 0 20px 12px; font-size: 16.5px; }
.sheet .opts { padding: 0 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 12px; border-radius: 14px; font-size: 15px; text-align: left;
}
.opt:active { background: var(--brand-soft); }
.opt .ic { width: 24px; text-align: center; font-size: 18px; }
.opt.danger { color: #C25C68; }

.field { padding: 0 20px 12px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.input {
  width: 100%; padding: 12px 14px; border-radius: 14px;
  background: var(--card); border: 1.5px solid var(--line);
  outline: none; transition: border-color .18s;
}
.input:focus { border-color: var(--brand-2); }
textarea.input { resize: none; min-height: 76px; }

/* ---------------------------------------------------------- 轻提示 */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 26px);
  transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  background: rgba(52, 38, 28, .92); color: #fff;
  padding: 10px 18px; border-radius: 22px; font-size: 13.5px;
  box-shadow: var(--shadow-m); animation: tin .26s ease both;
  max-width: 82vw; text-align: center;
}
.toast.ok { background: rgba(88, 130, 100, .95); }
.toast.bad { background: rgba(178, 78, 88, .95); }
@keyframes tin { from { opacity: 0; transform: translateY(10px) scale(.96) } to { opacity: 1 } }

/* ---------------------------------------------------------- 查看器 */
#viewer { position: fixed; inset: 0; z-index: 120; display: none; background: #14100E; }
#viewer.on { display: block; }
.v-track {
  position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.v-track::-webkit-scrollbar { display: none; }
.v-item {
  flex: 0 0 100%; height: 100%; scroll-snap-align: center;
  display: grid; place-items: center; overflow: hidden; position: relative;
}
.v-item img, .v-item video { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .2s; }
.v-item.zoom img { cursor: grab; }
.v-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5;
  padding: calc(var(--safe-t) + 8px) 12px 30px;
  display: flex; align-items: center; gap: 8px; color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0));
  transition: opacity .25s;
}
.v-top .t { font-size: 14px; font-weight: 600; }
.v-top .d { font-size: 11.5px; opacity: .72; }
.v-top button {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 17px; background: rgba(255, 255, 255, .13);
}
.v-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 34px 16px calc(14px + var(--safe-b)); color: #fff;
  background: linear-gradient(0deg, rgba(0, 0, 0, .74), rgba(0, 0, 0, 0));
}
.v-bottom .cap { font-size: 14px; line-height: 1.5; }
.v-bottom .line2 { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 12px; opacity: .78; }
#viewer.chrome-off .v-top, #viewer.chrome-off .v-bottom { opacity: 0; pointer-events: none; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: #cbb9ab; font-size: 13px; }

/* ---------------------------------------------------------- 上传队列 */
.task {
  background: var(--card); border-radius: var(--r-m); padding: 12px 14px;
  box-shadow: var(--shadow-s); margin: 0 16px 10px;
}
.task .tl { display: flex; align-items: center; gap: 10px; }
.task .nm { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task .st { font-size: 11.5px; color: var(--ink-3); flex: none; }
.task .pb { height: 5px; border-radius: 5px; background: var(--line-soft); margin-top: 9px; overflow: hidden; }
.task .pb > i { display: block; height: 100%; background: linear-gradient(90deg, #F0A06A, #E8855B); transition: width .3s; border-radius: 5px; }
.task.done .pb > i { background: linear-gradient(90deg, #9CC4A8, #7FA98B); }
.task.err .pb > i { background: #D98C95; }
.task .thumb-mini { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; flex: none; background: var(--bg-soft); }
.task .tacts { display: flex; align-items: center; gap: 6px; margin-top: 9px; }
.task .tacts .sz { margin-left: auto; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tbtn {
  padding: 5px 11px; border-radius: 9px; font-size: 12px; font-weight: 600;
  background: var(--bg-soft); color: var(--ink-2); transition: background .16s, color .16s;
}
.tbtn:active { background: var(--brand-soft); color: var(--brand); }
.task .qtag {
  font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 7px;
  background: var(--honey-soft); color: #8A6A22; vertical-align: 1px;
}
.task .qtag.mute { background: var(--bg-soft); color: var(--ink-3); }
html[data-theme="dark"] .task .qtag { color: #E8C87E; }

/* ------------------------------------------------ 全局传输入口（网盘式） */
#trFab {
  position: fixed; z-index: 55;
  right: max(14px, calc(50vw - 360px + 14px));
  bottom: calc(var(--tab-h) + var(--safe-b) + 14px);
  display: flex; align-items: center; gap: 7px;
  padding: 9px 14px 9px 12px; border-radius: 22px;
  background: var(--card); color: var(--ink-2);
  box-shadow: var(--shadow-m); font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line-soft); cursor: pointer;
  transition: transform .16s, background .2s, color .2s;
}
#trFab:active { transform: scale(.94); }
#trFab .ic { font-size: 16px; line-height: 1; }
#trFab .bd {
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--brand); color: #fff; font-size: 10.5px;
  display: grid; place-items: center;
}
#trFab .bd:empty { display: none; }
#trFab.on { background: linear-gradient(135deg, #F0A06B, #E8855B); color: #fff; border-color: transparent; }
#trFab.on .bd { background: rgba(255, 255, 255, .92); color: var(--brand); }
#trFab.warn { background: var(--rose-soft); color: #C25C68; border-color: transparent; }
#trFab.warn .bd { background: #C25C68; color: #fff; }
#trFab.done .bd { background: var(--sage); color: #fff; }

/* 拖拽上传蒙层：文件拖到窗口任意处即出现，松手入队 */
.trDropMask {
  position: fixed; inset: 0; z-index: 95;
  display: grid; place-items: center;
  background: rgba(48, 34, 26, .42); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .16s ease;
}
.trDropMask.on { opacity: 1; }
.trDropMask::before {
  content: ''; position: absolute; inset: 14px;
  border: 2px dashed var(--brand); border-radius: 20px;
}
.trDropInner {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 26px 30px; border-radius: 18px; text-align: center;
  background: var(--card); box-shadow: var(--shadow-m);
  color: var(--ink); font-size: 15px; font-weight: 700;
}
.trDropInner .ic { font-size: 30px; line-height: 1; }
.trDropInner .sub { font-size: 12px; font-weight: 500; color: var(--ink-3); }

/* ---------------------------------------------------------- 多选操作条 */
#selectBar {
  position: fixed; z-index: 60; left: 12px; right: 12px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 10px);
  background: var(--card); border-radius: 18px;
  box-shadow: var(--shadow-l); padding: 10px 12px 11px;
}
.sb-row { display: flex; align-items: center; gap: 8px; }
.sb-row + .sb-row { margin-top: 9px; }
.sb-count { font-size: 13.5px; font-weight: 600; flex: 1; }
.sb-count b { color: var(--brand); font-size: 15px; }
.sb-links { display: flex; gap: 12px; flex: none; }
.sb-links button { font-size: 12.5px; color: var(--brand); font-weight: 600; }
.sb-acts { overflow-x: auto; scrollbar-width: none; }
.sb-acts::-webkit-scrollbar { display: none; }
.sb-acts .btn { flex: none; }
.sb-acts .btn.primary { color: #fff; }

/* ---------------------------------------------------------- 空态 / 骨架 */
.empty { text-align: center; padding: 54px 30px; color: var(--ink-3); }
.empty .ic { font-size: 46px; margin-bottom: 12px; opacity: .85; }
.empty p { margin: 6px 0; font-size: 13.5px; }
.empty .btn { margin-top: 16px; }

.sk { border-radius: 10px; background: linear-gradient(100deg, var(--bg-soft) 30%, var(--card) 50%, var(--bg-soft) 70%); background-size: 300% 100%; animation: sh 1.3s infinite; }
@keyframes sh { from { background-position: 130% 0 } to { background-position: -30% 0 } }
.sk.cell { aspect-ratio: 1/1; }

.spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--brand);
  animation: rot .8s linear infinite; margin: 30px auto;
}
@keyframes rot { to { transform: rotate(360deg) } }

/* ---------------------------------------------------------- 登录 */
#auth {
  position: fixed; inset: 0; z-index: 300; display: none;
  background: linear-gradient(170deg, #FFF3E7 0%, #FFE7D4 55%, #F9D9C6 100%);
  overflow-y: auto;
}
html[data-theme="dark"] #auth { background: linear-gradient(170deg, #241D19, #2E211A); }
#auth.on { display: block; }
.auth-wrap { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 40px 26px calc(40px + var(--safe-b)); }
.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-logo .sun { font-size: 54px; line-height: 1; }
.auth-logo h1 { margin: 12px 0 4px; font-size: 25px; font-weight: 800; letter-spacing: .5px; }
.auth-logo p { margin: 0; font-size: 13px; color: var(--ink-2); }
.auth-box { background: var(--card); border-radius: var(--r-l); padding: 22px 20px; box-shadow: var(--shadow-m); }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--ink-2); }
.auth-switch b { color: var(--brand); cursor: pointer; }
.auth-note { margin-top: 14px; font-size: 12px; color: var(--ink-3); text-align: center; line-height: 1.7; }

/* ---------------------------------------------------------- 回忆卡 */
.memory {
  margin: 0 16px; padding: 18px; border-radius: var(--r-l);
  background: linear-gradient(135deg, #FDEBD7, #FBE0E2);
  box-shadow: var(--shadow-s);
}
html[data-theme="dark"] .memory { background: linear-gradient(135deg, #362A22, #3A2A2E); }
.memory .mt { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.memory .strip { display: flex; gap: 7px; margin-top: 13px; overflow-x: auto; scrollbar-width: none; }
.memory .strip::-webkit-scrollbar { display: none; }
.memory .strip .cell { flex: 0 0 31%; }

.progress-ring { transform: rotate(-90deg); }
.notice {
  margin: 0 16px 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--honey-soft); color: #8A6A22; font-size: 12.5px; line-height: 1.6;
  display: flex; gap: 9px;
}
html[data-theme="dark"] .notice { color: #E8C87E; }
.notice.sage { background: var(--sage-soft); color: #4E7A5D; }
html[data-theme="dark"] .notice.sage { color: #9CC4A8; }
.notice.rose { background: var(--rose-soft); color: #B25E69; }
.notice .ic { flex: none; }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .grid.g2 { grid-template-columns: repeat(3, 1fr); }
  main, .topbar, .tabbar { max-width: 720px; margin-left: auto; margin-right: auto; }
  .tabbar { left: 50%; transform: translateX(-50%); width: 100%; }
  .sheet { max-width: 560px; left: 50%; transform: translateX(-50%); border-radius: 24px; bottom: 20px; }
  #selectBar { max-width: 560px; left: 50%; transform: translateX(-50%); }
  @keyframes up { from { transform: translate(-50%, 102%) } to { transform: translate(-50%, 0) } }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
