/* ============================================================
 * 生活台 · 样式表
 * 设计基调：浅色、清爽、留白、柔和阴影、克制配色
 * ============================================================ */
:root {
  --bg: #F4F6FB;
  --surface: #FFFFFF;
  --surface-2: #FBFCFE;
  --text: #1F2533;
  --text-2: #6B7280;
  --text-3: #9AA3B2;
  --border: #ECEEF3;
  --border-2: #E2E6EE;
  --primary: #6C7BF2;
  --primary-d: #5A6AE8;
  --primary-soft: rgba(108, 123, 242, 0.12);
  --danger: #E8505B;
  --danger-soft: #FFE3E5;
  --shadow: 0 6px 22px rgba(31, 37, 51, 0.06);
  --shadow-lg: 0 18px 50px rgba(31, 37, 51, 0.14);
  --r: 18px;
  --r-sm: 12px;
  --r-lg: 24px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
button { font-family: inherit; }
::selection { background: var(--primary-soft); }

/* ---------------- 布局骨架 ---------------- */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px; flex: 0 0 auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 22px 16px;
  position: sticky; top: 0; height: 100vh;
}
.brand { font-size: 18px; font-weight: 700; color: var(--text); padding: 6px 10px 20px; display: flex; align-items: center; gap: 8px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px; border: none;
  background: transparent; color: var(--text-2);
  font-size: 14.5px; cursor: pointer; text-align: left;
  transition: background .15s, color .15s, transform .12s;
}
.nav-item .nav-ic { font-size: 18px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.side-foot { font-size: 11.5px; color: var(--text-3); padding: 10px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.topbar-action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 12px;
  background: var(--primary); color: #fff; border: none;
  font-size: 13.5px; cursor: pointer;
  transition: transform .15s, background .15s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(108, 123, 242, 0.28);
}
.topbar-action:hover { background: var(--primary-d); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(108, 123, 242, 0.36); }
.act-icon { font-size: 15px; }

.view { flex: 1; overflow-y: auto; padding: 24px; max-width: 1040px; margin: 0 auto; width: 100%; }

/* ---------------- 通用卡片 / 按钮 ---------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.card-head b { font-size: 15px; }
.card-sub { color: var(--text-2); font-size: 13px; margin: 6px 0; line-height: 1.65; }
.card-tip { color: var(--text-3); font-size: 12px; margin-top: 10px; line-height: 1.6; }

.btn {
  padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border-2);
  background: var(--surface-2); color: var(--text); font-size: 13.5px;
  cursor: pointer; transition: all .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-d); color: #fff; }
.btn-danger { background: #fff; color: var(--danger); border-color: #FFD0D4; }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: #FFB3B9; }
.btn-mini { padding: 6px 12px; font-size: 12.5px; }

/* ---------------- 随手记：快捷录入 ---------------- */
.quick-add {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #6C7BF2, #8E9BF7);
  color: #fff; padding: 18px 20px; border-radius: var(--r);
  box-shadow: 0 10px 26px rgba(108, 123, 242, 0.28);
  cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.quick-add:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(108, 123, 242, 0.36); }
.quick-add-ic { font-size: 22px; }
.quick-add-tx { flex: 1; display: flex; flex-direction: column; }
.quick-add-tx b { font-size: 16px; }
.quick-add-tx span { opacity: .85; font-size: 12.5px; margin-top: 2px; }
.quick-add-go { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); display: grid; place-items: center; font-size: 20px; }

/* ---------------- Feed 列表 ---------------- */
.feed { margin-top: 18px; }
.feed-group { margin-bottom: 16px; }
.feed-date { display: flex; align-items: baseline; gap: 8px; margin: 6px 2px 10px; }
.feed-date span { font-weight: 600; color: var(--text); font-size: 14px; }
.feed-date em { font-style: normal; color: var(--text-3); font-size: 12px; }
.feed-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 12px 14px; margin-bottom: 10px; cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.feed-item:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--border-2); }
.feed-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; flex: 0 0 auto; }
.feed-main { flex: 1; min-width: 0; }
.feed-top { display: flex; align-items: center; gap: 8px; }
.feed-cat { font-size: 13px; color: var(--text-2); font-weight: 500; }
.feed-tx { font-size: 14.5px; color: var(--text); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-time { font-size: 12px; color: var(--text-3); flex: 0 0 auto; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 20px; }
.badge-expense { color: #E8505B; background: #FFE3E5; }
.badge-weight { color: #2F80C2; background: #E2F0FB; }

/* ---------------- 日历 ---------------- */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-title { font-weight: 600; font-size: 16px; flex: 1; text-align: center; }
.cal-nav { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 18px; cursor: pointer; color: var(--text); transition: background .15s; }
.cal-nav:hover { background: var(--surface-2); }
.cal-today { padding: 7px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; cursor: pointer; color: var(--text); }
.cal-today:hover { background: var(--surface-2); }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-week span { text-align: center; font-size: 12px; color: var(--text-3); padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  cursor: pointer; position: relative; transition: transform .15s, box-shadow .15s, border-color .15s;
  min-height: 66px;
}
.cal-cell.empty { background: transparent; border: none; cursor: default; }
.cal-cell.has:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-2); }
.cal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.cal-num { font-size: 14px; font-weight: 600; color: var(--text); }
.cal-dots { display: flex; gap: 3px; flex-wrap: wrap; margin-top: auto; }
.cal-dots i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.cal-dots i.more { background: var(--text-3); width: auto; height: auto; border-radius: 8px; font-size: 9px; color: #fff; padding: 0 4px; line-height: 12px; font-style: normal; }
.cal-exp { position: absolute; right: 8px; bottom: 8px; font-size: 10.5px; color: #E8505B; font-weight: 600; }

/* ---------------- 回溯 ---------------- */
.review-ctrl { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.ctrl-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ctrl-row + .ctrl-row { margin-top: 12px; }
.ctrl-row > label { font-size: 13px; color: var(--text-2); width: 60px; flex: 0 0 auto; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.wrap { flex: 1; }
.chip { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border-2); background: var(--surface-2); font-size: 13px; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip.on i { background: #fff; }

.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.chart-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.chart-card-head b { font-size: 15px; }
.chart-stats { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); }
.chart-stats b { color: var(--text); }
.chart-host { position: relative; width: 100%; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis-y { fill: var(--text-3); font-size: 10px; }
.chart-axis-x { fill: var(--text-3); font-size: 10px; }
.chart-tip { position: absolute; background: rgba(31, 37, 51, 0.92); color: #fff; padding: 6px 10px; border-radius: 10px; font-size: 12px; display: flex; flex-direction: column; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow); }
.chart-tip b { font-size: 11px; opacity: .8; font-weight: 500; }
.chart-tip span { font-size: 13px; font-weight: 600; }
.chart-empty { text-align: center; color: var(--text-3); padding: 40px 0; font-size: 13px; }

/* ---------------- 我的 ---------------- */
.mine { max-width: 720px; }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); display: inline-block; transition: background .2s, box-shadow .2s; }
.sync-dot.live { background: #37C871; box-shadow: 0 0 0 4px rgba(55, 200, 113, 0.18); }
.sync-dot.err { background: var(--danger); box-shadow: 0 0 0 4px rgba(232, 80, 91, 0.18); }
.switch-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; }
.switch { width: 46px; height: 26px; border-radius: 20px; background: var(--border-2); position: relative; display: inline-block; transition: background .2s; flex: 0 0 auto; }
.switch.on { background: var(--primary); }
.switch input { display: none; }
.switch::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: left .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.switch.on::after { left: 23px; }
.field { margin: 12px 0; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border-2); border-radius: 12px;
  font-size: 14px; background: var(--surface-2); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s; font-family: inherit;
}
.field input:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: #fff; }
.field textarea { resize: vertical; }
.field.two { display: flex; gap: 12px; } .field.two > div { flex: 1; }
.mine-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.cat-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.cat-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: all .15s; }
.cat-row:hover { border-color: var(--border-2); box-shadow: var(--shadow); }
.cat-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; flex: 0 0 auto; }
.cat-info { flex: 1; display: flex; flex-direction: column; }
.cat-info b { font-size: 14px; }
.cat-info span { font-size: 12px; color: var(--text-3); }
.cat-del { border: none; background: transparent; font-size: 15px; cursor: pointer; opacity: .45; padding: 6px; transition: opacity .15s; }
.cat-del:hover { opacity: 1; }
.about .card-tip { margin-top: 4px; }

/* ---------------- 底部面板 Sheet ---------------- */
.sheet-root { position: fixed; inset: 0; z-index: 100; display: none; }
.sheet-root.open { display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 24, 33, 0.42); opacity: 0; transition: opacity .28s; backdrop-filter: blur(2px); }
.sheet-root.shown .sheet-backdrop { opacity: 1; }
.sheet-panel {
  position: relative; width: min(480px, 100%); max-height: 92vh; overflow-y: auto;
  background: var(--bg); border-radius: 24px 24px 0 0; padding: 8px 20px 26px;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.22, 1, .36, 1);
  box-shadow: var(--shadow-lg);
}
.sheet-root.shown .sheet-panel { transform: translateY(0); }
.sheet-body { }
.sheet-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 8px; }
.sheet-h b { font-size: 17px; }
.sheet-x { border: none; background: transparent; font-size: 18px; color: var(--text-3); cursor: pointer; width: 32px; height: 32px; border-radius: 50%; transition: background .15s, color .15s; }
.sheet-x:hover { background: var(--border); color: var(--text); }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; }

.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 14px; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 20px; border: 1.5px solid var(--border-2); background: var(--surface); font-size: 13px; color: var(--text-2); cursor: pointer; transition: all .15s; }
.cat-chip i { font-style: normal; }
.cat-chip.on { background: var(--c); color: #fff; border-color: var(--c); font-weight: 600; }

.type-row { display: flex; gap: 8px; flex-wrap: wrap; }
.type-btn { padding: 8px 14px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-2); font-size: 13px; color: var(--text-2); cursor: pointer; transition: all .15s; }
.type-btn.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.icon-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.icon-btn { aspect-ratio: 1; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 17px; cursor: pointer; transition: all .15s; }
.icon-btn.on { border-color: var(--primary); background: var(--primary-soft); }
.color-row { display: flex; gap: 10px; flex-wrap: wrap; }
.color-btn { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform .12s; }
.color-btn:hover { transform: scale(1.12); }
.color-btn.on { border-color: var(--text); box-shadow: 0 0 0 2px #fff inset; }
.day-stat { color: var(--text-2); font-size: 13px; margin: 4px 0 12px; }
.day-add { width: 100%; margin-top: 16px; }
.confirm-msg { color: var(--text-2); font-size: 14px; line-height: 1.6; margin: 6px 0 4px; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%) translateY(20px);
  background: rgba(31, 37, 51, 0.94); color: #fff; padding: 11px 20px; border-radius: 14px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; padding: 48px 16px; color: var(--text-3); }
.empty-ic { font-size: 40px; margin-bottom: 10px; }
.empty p { color: var(--text-2); font-size: 15px; margin: 4px 0; }
.empty span { font-size: 12.5px; }

/* ---------------- 动画 ---------------- */
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.view-enter { animation: viewIn .35s cubic-bezier(.22, 1, .36, 1); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.stagger-in { animation: fadeUp .45s cubic-bezier(.22, 1, .36, 1) both; }

/* ---------------- 移动端：底部胶囊 Tab ---------------- */
.tabbar { display: none; }
@media (max-width: 860px) {
  .sidebar { display: none; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    justify-content: center; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }
  .tabbar-inner {
    display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 36px; padding: 6px; box-shadow: var(--shadow-lg); width: 100%; max-width: 420px;
  }
  .tabbar .nav-item {
    flex: 1; flex-direction: column; gap: 3px; padding: 8px 4px; border-radius: 26px;
    font-size: 10px; justify-content: center; align-items: center;
  }
  .tabbar .nav-ic { font-size: 18px; }
  .tabbar .nav-item.active { background: var(--primary); color: #fff; }
  .topbar { padding: 0 16px; }
  .view { padding: 16px 16px 100px; max-width: 600px; }
  .cal-cell { min-height: 56px; }
  .icon-grid { grid-template-columns: repeat(8, 1fr); }
}

/* 桌面居中弹窗 */
@media (min-width: 861px) {
  .sheet-root.open { align-items: center; }
  .sheet-panel { border-radius: 24px; transform: translateY(20px) scale(.98); }
  .sheet-root.shown .sheet-panel { transform: translateY(0) scale(1); }
}

/* 大屏：视图更舒展 */
@media (min-width: 1200px) {
  .view { max-width: 1120px; }
}

/* ---------------- 锁屏 / 鉴权 ---------------- */
.lock { position: fixed; inset: 0; z-index: 2000; display: none; }
.lock.open { display: flex; align-items: center; justify-content: center; }
.lock-bg { position: absolute; inset: 0; background: linear-gradient(135deg, #EEF1FB 0%, #F7F4FB 50%, #EAF2FB 100%); }
.lock-bg::after { content: ''; position: absolute; inset: 0; background:
  radial-gradient(60% 50% at 15% 12%, rgba(108, 123, 242, .10), transparent 60%),
  radial-gradient(50% 42% at 88% 90%, rgba(247, 130, 133, .10), transparent 60%); }
.lock-card {
  position: relative; width: min(380px, 90vw);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: 30px 26px 24px; box-shadow: var(--shadow-lg);
  animation: lockIn .4s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes lockIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.lock-brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.lock-brand .lb-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #6C7BF2, #8E9BF7); font-size: 22px; box-shadow: 0 6px 16px rgba(108, 123, 242, .3); }
.lock-sub { color: var(--text-2); font-size: 13px; margin: 4px 0 16px; line-height: 1.55; }
.lock-form { display: flex; flex-direction: column; gap: 12px; }
.lock-field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.lock-form input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border-2); border-radius: 12px;
  font-size: 15px; background: var(--surface-2); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.lock-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: #fff; }
.lock-btn { margin-top: 6px; width: 100%; padding: 13px; border-radius: 12px; border: none; background: var(--primary); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s, transform .12s; box-shadow: 0 6px 18px rgba(108, 123, 242, .28); }
.lock-btn:hover { background: var(--primary-d); transform: translateY(-1px); }
.lock-link { margin-top: 14px; text-align: center; font-size: 13px; color: var(--primary); cursor: pointer; }
.lock-link:hover { text-decoration: underline; }
.lock-note { margin-top: 14px; font-size: 12px; color: var(--text-3); line-height: 1.65; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.lock-err { color: var(--danger); font-size: 13px; min-height: 18px; }
.lock.shake .lock-card { animation: lockShake .4s; }
@keyframes lockShake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }

/* ---------------- 图片：Feed 缩略图 / 录入预览 ---------------- */
.feed-imgs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.feed-imgs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; transition: transform .15s; }
.feed-imgs img:hover { transform: scale(1.04); }
.img-block { margin: 4px 0 8px; }
.img-block[style*="display: none"] { margin: 0; }
.img-prevs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.img-thumb { position: relative; width: 84px; height: 84px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.img-rm { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(31, 37, 51, .6); color: #fff; font-size: 12px; cursor: pointer; display: grid; place-items: center; }
.img-rm:hover { background: var(--danger); }
.img-add { width: 100%; padding: 11px; border: 1.5px dashed var(--border-2); border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-size: 13.5px; cursor: pointer; transition: all .15s; }
.img-add:hover { border-color: var(--primary); color: var(--primary); }

/* ---------------- 图片查看器 ---------------- */
#imgViewer { position: fixed; inset: 0; z-index: 1500; display: none; align-items: center; justify-content: center; background: rgba(15, 18, 26, .9); padding: 24px; }
#imgViewer.open { display: flex; animation: viewIn .2s ease; }
#imgViewer img { max-width: 100%; max-height: 100%; border-radius: 14px; box-shadow: var(--shadow-lg); }
#imgViewer .iv-close { position: absolute; top: 18px; right: 20px; color: #fff; font-size: 22px; cursor: pointer; background: rgba(255, 255, 255, .15); width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: none; }
#imgViewer .iv-close:hover { background: rgba(255, 255, 255, .28); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
