/* 「我俩的事」— 样式表 */
:root {
  --bg: #FAF6EF;
  --bg-soft: #F3EBDD;
  --surface: #FFFDF8;
  --surface-2: #FBF4E8;
  --ink: #2A2620;
  --ink-soft: #6B6052;
  --ink-muted: #978B79;
  --line: #E8DCC6;
  --line-soft: #EFE6D4;

  --person-a: #D9663D;       /* 暖陶土 */
  --person-a-soft: #F4D8C9;
  --person-b: #2E6F6B;       /* 深青 */
  --person-b-soft: #C7DCDB;

  --gold: #C99846;
  --danger: #C0452E;
  --success: #5E8A52;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(42, 38, 32, 0.06), 0 2px 8px rgba(42, 38, 32, 0.04);
  --shadow-md: 0 4px 12px rgba(42, 38, 32, 0.08), 0 12px 28px rgba(42, 38, 32, 0.06);
  --shadow-lg: 0 12px 40px rgba(42, 38, 32, 0.18);

  --font-sans: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body {
  position: relative;
  overflow-x: hidden;
}

/* Paper-like background */
.paper-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(217, 102, 61, 0.06), transparent 60%),
    radial-gradient(1000px 700px at 110% 10%, rgba(46, 111, 107, 0.06), transparent 55%),
    linear-gradient(180deg, #FAF6EF 0%, #F6EEDD 100%);
}
.paper-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(120, 100, 70, 0.018) 0 1px, transparent 1px 28px);
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* ---------- Topbar ---------- */
.topbar {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.brand-mark .dot {
  width: 12px; height: 12px; border-radius: 50%;
  transition: transform .4s ease;
}
.brand-mark .dot + .dot { margin-left: -4px; }
.brand-mark .dot-a { background: var(--person-a); }
.brand-mark .dot-b { background: var(--person-b); }
.brand-text h1 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.brand-text .subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.whoami { display: flex; align-items: center; gap: 12px; }
.whoami-label { font-size: 13px; color: var(--ink-soft); }
.whoami-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  box-shadow: var(--shadow-sm);
}
.who-btn {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s ease;
}
.who-btn[aria-selected="true"][data-who="a"] {
  background: var(--person-a); color: #fff;
}
.who-btn[aria-selected="true"][data-who="b"] {
  background: var(--person-b); color: #fff;
}
.icon-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  width: 38px; height: 38px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .2s ease;
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-muted); transform: rotate(30deg); }

/* ---------- Container ---------- */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 24px 60px;
}

/* ---------- Tabs ---------- */
.tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.tab {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .2s ease;
}
.tab:hover { color: var(--ink); }
.tab.active {
  background: var(--ink);
  color: #FBF4E8;
}
.tab-count {
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  padding: 0 5px;
}
.tab.active .tab-count { background: rgba(255,255,255,0.18); }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-chips { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s ease;
}
.chip:hover { color: var(--ink); border-color: var(--ink-muted); }
.chip.active {
  background: var(--ink);
  color: #FBF4E8;
  border-color: var(--ink);
}

.add-btn {
  border: none;
  background: var(--ink);
  color: #FBF4E8;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: all .2s ease;
}
.add-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.add-btn:active { transform: translateY(0); }

/* ---------- Board ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ---------- Card（便利贴） ---------- */
.card {
  position: relative;
  background:
    linear-gradient(176deg,
      color-mix(in srgb, var(--card-accent, var(--ink-muted)) 9%, #FFFDF2) 0%,
      color-mix(in srgb, var(--card-accent, var(--ink-muted)) 5%, #FBF4DE) 100%);
  border: 1px solid color-mix(in srgb, var(--card-accent, var(--ink-muted)) 22%, #E6DCC4);
  border-radius: 3px 3px 12px 3px;
  padding: 22px 18px 16px;
  box-shadow:
    0 1px 2px rgba(42, 38, 32, .10),
    0 6px 16px rgba(42, 38, 32, .09);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: cardIn .35s cubic-bezier(.2,.7,.2,1);
  transition: box-shadow .25s ease, transform .25s ease;
}
/* 便利贴的随手一贴：轻微交替倾斜 */
.board > .card:nth-child(odd)  { transform: rotate(-0.7deg); }
.board > .card:nth-child(even) { transform: rotate(0.6deg); }
.board > .card:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow:
    0 3px 6px rgba(42, 38, 32, .12),
    0 16px 32px rgba(42, 38, 32, .12);
  z-index: 2;
}
.card.is-overdue { border-color: rgba(192, 69, 46, 0.45); }
/* 完成：不再划掉，只压一枚印记（内容轻微褪色） */
.card.is-done .card-title { color: var(--ink-muted); }
.card.is-done .card-meta,
.card.is-done .card-notes,
.card.is-done .card-foot { opacity: .6; }

/* 便签顶部的胶带 */
.card::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 88px;
  height: 20px;
  transform: translateX(-50%) rotate(-2.2deg);
  background: linear-gradient(180deg,
    rgba(255, 255, 255, .62) 0%,
    rgba(244, 238, 220, .48) 45%,
    rgba(236, 228, 204, .55) 100%);
  border-left: 2px solid rgba(255, 255, 255, .45);
  border-right: 2px solid rgba(255, 255, 255, .45);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(42, 38, 32, .14);
  pointer-events: none;
}
/* 右下角的折角 */
.card::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  background: linear-gradient(315deg,
    rgba(42, 38, 32, .10) 0%,
    rgba(42, 38, 32, .10) 49%,
    rgba(255, 255, 255, .4) 50%,
    rgba(255, 255, 255, 0) 54%);
  border-radius: 0 0 12px 0;
  pointer-events: none;
}

/* 已完成印记：青绿色印章，盖在便签上 */
.stamp-done {
  position: absolute;
  top: 40%;
  right: 14px;
  transform: rotate(-12deg);
  padding: 4px 12px;
  border: 2px solid rgba(36, 94, 90, .55);
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(36, 94, 90, .22);
  color: rgba(36, 94, 90, .78);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3em;
  text-indent: .3em;
  pointer-events: none;
  mix-blend-mode: multiply;
  animation: stampIn .28s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes stampIn {
  from { opacity: 0; transform: rotate(-12deg) scale(1.7); }
  to   { opacity: 1; transform: rotate(-12deg) scale(1); }
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  margin: 0;
  word-break: break-word;
}
.card-actions { display: inline-flex; gap: 4px; flex-shrink: 0; }
.mini {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  width: 28px; height: 28px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s ease;
}
.mini:hover { background: var(--bg-soft); color: var(--ink); }

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* 人物贴纸：像一小片手撕纸，微微翘起 */
.tag-people {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 5px;
  border-radius: 10px 13px 11px 12px / 12px 10px 13px 11px;
  background:
    linear-gradient(178deg,
      #FFFDF8 0%,
      color-mix(in srgb, var(--card-accent, var(--ink-muted)) 8%, var(--surface-2)) 100%);
  border: 1px solid color-mix(in srgb, var(--card-accent, var(--line)) 26%, var(--line));
  color: var(--ink-soft);
  font-weight: 500;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 1px 1px rgba(42, 38, 32, .07),
    0 3px 8px rgba(42, 38, 32, .055);
  transform: rotate(-1.1deg);
  transform-origin: left center;
  transition: transform .24s cubic-bezier(.2,.7,.2,1), box-shadow .24s ease;
}
.card:hover .tag-people {
  transform: rotate(-2deg) translateY(-1.5px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 2px 3px rgba(42, 38, 32, .09),
    0 7px 16px rgba(42, 38, 32, .08);
}
.avatar {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.arrow-mini { color: var(--ink-muted); font-size: 11px; }

/* 截止日期贴纸：平时是半透明胶带，逾期变红色印章 */
.tag-deadline {
  --tape: #EDE7DA;
  --tape-ink: var(--ink-muted);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border: none;
  border-radius: 3px;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--tape) 72%, #fff) 0%,
      var(--tape) 42%,
      color-mix(in srgb, var(--tape) 90%, #7a6a52) 100%);
  color: var(--tape-ink);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: .012em;
  transform: rotate(1.2deg);
  transform-origin: right center;
  box-shadow: 0 1px 2px rgba(42, 38, 32, .10), 0 3px 8px rgba(42, 38, 32, .06);
  transition: transform .24s cubic-bezier(.2,.7,.2,1), box-shadow .24s ease;
}
/* 胶带两端的轻微撕口感 */
.tag-deadline::before,
.tag-deadline::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 3px;
  background: rgba(255, 255, 255, .35);
  pointer-events: none;
}
.tag-deadline::before { left: 0; border-radius: 3px 0 0 3px; }
.tag-deadline::after { right: 0; border-radius: 0 3px 3px 0; }

.card:hover .tag-deadline {
  transform: rotate(2.1deg) translateY(-1.5px);
  box-shadow: 0 2px 3px rgba(42, 38, 32, .12), 0 7px 16px rgba(42, 38, 32, .08);
}

.tag-deadline.is-soon { --tape: #E7DEC5; --tape-ink: #7c6a45; transform: rotate(1.4deg); }
.tag-deadline.is-today {
  --tape: #F1DCA6;
  --tape-ink: #7d5716;
  font-weight: 600;
  transform: rotate(-1.7deg);
  transform-origin: left center;
}
.card:hover .tag-deadline.is-today { transform: rotate(-2.6deg) translateY(-1.5px); }

/* 逾期：改成盖上去的红色印章 */
.tag-deadline.is-overdue {
  --tape-ink: var(--danger);
  background: rgba(192, 69, 46, .06);
  border: 1.5px dashed rgba(192, 69, 46, .55);
  border-radius: 6px;
  padding: 3px 11px;
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--danger);
  text-shadow: 0 0 .5px rgba(192, 69, 46, .5);
  transform: rotate(-3.2deg);
  transform-origin: center;
  box-shadow: none;
  animation: stampIn .42s cubic-bezier(.2,1.5,.4,1) both;
}
/* 印章内圈：用 ::after 画，覆盖掉胶带的高光条 */
.tag-deadline.is-overdue::before { display: none; }
.tag-deadline.is-overdue::after {
  inset: 2px;
  width: auto;
  height: auto;
  background: none;
  border: 1px solid rgba(192, 69, 46, .3);
  border-radius: 4px;
}
.card:hover .tag-deadline.is-overdue { transform: rotate(-3.2deg) scale(1.03); }

@keyframes stampIn {
  0%   { opacity: 0; transform: rotate(-3.2deg) scale(1.5); }
  60%  { opacity: 1; transform: rotate(-3.2deg) scale(.97); }
  100% { opacity: 1; transform: rotate(-3.2deg) scale(1); }
}

.card-notes {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
}

.toggle-done {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .15s ease;
}
.toggle-done:hover { color: var(--ink); border-color: var(--ink-muted); }
.card.is-done .toggle-done {
  background: rgba(94, 138, 82, 0.12);
  border-color: rgba(94, 138, 82, 0.4);
  color: var(--success);
}

.created-at { font-size: 11px; color: var(--ink-muted); }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Empty state ---------- */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty-illu {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted);
}
.empty h3 { margin: 0 0 6px; font-size: 16px; color: var(--ink-soft); font-weight: 600; }
.empty p { margin: 0; font-size: 13.5px; }

/* ---------- Footer ---------- */
.footer {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px 40px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 38, 32, 0.42);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  animation: fadeIn .2s ease;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: min(440px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn .25s cubic-bezier(.2,.7,.2,1);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
}
.modal-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  min-height: 0;
}
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.field-label {
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}
.field input, .field select, .field textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
  width: 100%;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--ink-muted);
  background: var(--surface);
}
.field-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.arrow { color: var(--ink-muted); padding-bottom: 10px; font-size: 18px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.btn-ghost, .btn-primary {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s ease;
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-muted); }
.btn-primary {
  background: var(--ink);
  color: #FBF4E8;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* Person row in settings */
.person-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.person-row .avatar {
  width: 32px; height: 32px;
  font-size: 14px;
}
.person-row input[type="text"] {
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--surface);
  outline: none;
}
.person-row input[type="color"] {
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  background: var(--surface);
  cursor: pointer;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #FBF4E8;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  z-index: 100;
  opacity: 0;
  transition: all .25s ease;
}
.toast[hidden] { display: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 工具栏按钮组 ---------- */
.toolbar-actions {
  display: inline-flex;
  gap: 8px;
  margin-left: auto;
}

/* ---------- 小日记 ---------- */
.board--diary {
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
}

.diary {
  display: flex;
  gap: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  animation: cardIn .35s cubic-bezier(.2,.7,.2,1);
  transition: box-shadow .25s ease;
}
.diary:hover { box-shadow: var(--shadow-md); }

/* 左侧日期块，像日历撕下的一页 */
.diary-stamp {
  flex: 0 0 auto;
  align-self: flex-start;
  width: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 9px 0 8px;
  border-radius: 10px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--mood) 15%, #fff) 0%,
    color-mix(in srgb, var(--mood) 7%, #fff) 100%);
  border: 1px solid color-mix(in srgb, var(--mood) 26%, var(--line));
  color: color-mix(in srgb, var(--mood) 74%, #40382e);
}
.diary-stamp-m { font-size: 11px; letter-spacing: .1em; opacity: .85; }
.diary-stamp-d {
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.05;
}
.diary-stamp-w { font-size: 10.5px; opacity: .78; letter-spacing: .04em; }

.diary-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }

.diary-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.diary-who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.diary-mood {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--mood) 12%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--mood) 30%, var(--line));
  color: color-mix(in srgb, var(--mood) 70%, #40382e);
  transform: rotate(-1deg);
}
.diary-mood .mood-emoji { font-size: 12px; line-height: 1; }
.diary-spacer { flex: 1; }

.diary-text {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.95;
  letter-spacing: .012em;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 心情选择器 ---------- */
.mood-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.mood-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
}
.mood-opt:hover { background: var(--surface); border-color: var(--ink-muted); }
.mood-opt-emoji { font-size: 18px; line-height: 1; }
.mood-opt-name { font-size: 11px; color: var(--ink-soft); }
.mood-opt[aria-checked="true"] {
  background: color-mix(in srgb, var(--mood) 13%, var(--surface));
  border-color: color-mix(in srgb, var(--mood) 55%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--mood) 15%, transparent);
}
.mood-opt[aria-checked="true"] .mood-opt-name {
  color: color-mix(in srgb, var(--mood) 68%, #40382e);
  font-weight: 600;
}

/* ---------- 日记配图 ---------- */
.diary-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
  margin-top: 2px;
}
.diary-photo {
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: #FFFEFB;
  box-shadow: 0 1px 2px rgba(42, 38, 32, .09), 0 4px 10px rgba(42, 38, 32, .05);
  cursor: zoom-in;
  transform: rotate(var(--tilt, 0deg));
  transition: transform .24s cubic-bezier(.2,.7,.2,1), box-shadow .24s ease;
  animation: cardIn .3s cubic-bezier(.2,.7,.2,1) both;
}
.diary-photo:hover {
  transform: rotate(0deg) translateY(-3px) scale(1.04);
  box-shadow: 0 6px 16px rgba(42, 38, 32, .14), 0 14px 28px rgba(42, 38, 32, .09);
  z-index: 2;
}
.diary-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 2px;
  background: var(--bg-soft);
}

/* ---------- 日记互动区（朋友圈式：一张灰底，点赞一行，留言一行行）---------- */
.diary-social {
  margin-top: 12px;
  padding: 9px 11px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 4px;
  animation: cardIn .24s cubic-bezier(.2,.7,.2,1) both;
}
.likes-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.like-heart { color: #D0554B; display: inline-flex; padding-top: 3px; }
.likes-names { color: #C04E45; font-weight: 500; }
.social-sep {
  height: 1px;
  background: var(--line);
  margin: 5px 0;
}
.cmt-row {
  display: flex;
  align-items: flex-start;
  gap: 1px;
  font-size: 13.5px;
  line-height: 1.75;
  position: relative;
  padding-right: 22px;
}
.cmt-who { color: var(--c, var(--ink)); font-weight: 600; flex: 0 0 auto; }
.cmt-colon { color: var(--ink-soft); flex: 0 0 auto; }
.cmt-text { color: var(--ink); word-break: break-word; }
.cmt-del {
  position: absolute;
  right: 0;
  top: 0;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.6;
  padding: 0 2px;
  cursor: pointer;
  transition: color .15s ease;
}
.cmt-del:hover { color: var(--danger); }

.diary-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px dashed var(--line-soft);
}
.foot-acts { display: flex; align-items: center; gap: 8px; }
.like-btn, .cmt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 12.5px;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.like-btn:hover, .cmt-toggle:hover { color: var(--ink); border-color: var(--ink-muted); }
.cmt-toggle.is-open { background: var(--bg-soft); color: var(--ink); border-color: var(--line); }
.like-btn.is-liked {
  color: #C0452E;
  border-color: #E6BCB4;
  background: #FDF1EE;
  animation: likePop .32s cubic-bezier(.2,.8,.3,1.2);
}
.like-ico, .cmt-ico { display: inline-flex; }
@keyframes likePop {
  0% { transform: scale(1); }
  45% { transform: scale(1.16); }
  100% { transform: scale(1); }
}
.diary-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* 从消息中心跳过来时闪一下，方便找人 */
.diary.is-flash { animation: flashCard 1.8s ease; }
@keyframes flashCard {
  0%, 100% { box-shadow: var(--shadow-sm); }
  25% { box-shadow: 0 0 0 3px rgba(217, 102, 61, .38), var(--shadow-md); }
}

.cmt-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.cmt-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 9px 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
}
.cmt-input::placeholder { color: var(--ink-muted); }
.cmt-input:focus { outline: none; border-color: var(--ink-muted); }
.cmt-send {
  border: none;
  background: var(--ink);
  color: #FBF4E8;
  border-radius: 999px;
  padding: 9px 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  transition: opacity .15s ease;
}
.cmt-send:hover { opacity: .86; }

/* ---------- 日记弹窗里的配图选择器 ---------- */
.photo-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pp-item {
  position: relative;
  width: 74px;
  height: 74px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--bg-soft);
}
.pp-item img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
.pp-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(35, 31, 26, .62);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease;
}
/* 手指比鼠标粗：把可点区域朝四周扩一圈，视觉大小不变 */
.pp-del::after { content: ""; position: absolute; inset: -7px; }
.pp-del:hover { background: var(--danger); }
.pp-add {
  width: 74px;
  height: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: all .15s ease;
}
.pp-add:hover { border-color: var(--ink-muted); color: var(--ink); background: var(--bg-soft); }
.pp-add-plus { font-size: 18px; line-height: 1; }
/* 正在传图：按钮变成进度提示，顺手挡住重复点击 */
.pp-add.is-loading {
  cursor: progress;
  border-style: solid;
  color: var(--ink-soft);
  background: var(--bg-soft);
}
.pp-add:disabled { pointer-events: none; }

/* ---------- 大图浏览 ---------- */
body.no-scroll { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 46px 68px;
  background: rgba(30, 26, 21, .88);
  backdrop-filter: blur(6px);
  animation: lbIn .22s ease both;
}
.lightbox[hidden] { display: none; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }

.lb-figure {
  margin: 0;
  max-width: min(1040px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
}
.lb-figure img {
  max-width: 100%;
  max-height: calc(100vh - 200px);
  object-fit: contain;
  border-radius: 6px;
  background: #1a1712;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
}
.lb-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 2px 0;
  color: #F3EBDD;
}
.lb-text { min-width: 0; }
.lb-caption {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.lb-caption[hidden] { display: none; }
.lb-meta { margin: 3px 0 0; font-size: 12px; color: rgba(243, 235, 221, .58); }
.lb-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; }
.lb-count {
  font-size: 12.5px;
  color: rgba(243, 235, 221, .75);
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  text-align: center;
}

.lb-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(243, 235, 221, .3);
  background: rgba(243, 235, 221, .08);
  color: #F3EBDD;
  cursor: pointer;
  transition: all .15s ease;
}
.lb-btn:hover { background: rgba(243, 235, 221, .16); border-color: rgba(243, 235, 221, .5); }

.lb-close {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(243, 235, 221, .22);
  background: rgba(243, 235, 221, .08);
  color: #F3EBDD;
  cursor: pointer;
  transition: all .15s ease;
}
.lb-close:hover { background: rgba(243, 235, 221, .18); border-color: rgba(243, 235, 221, .45); }
.lb-close { top: 18px; right: 18px; }
.lb-close[hidden] { display: none; }

/* ---------- 登录页 ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-wrap {
  width: 100%;
  max-width: 380px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 34px 30px 26px;
  animation: login-in .45s cubic-bezier(.22,.68,.34,1) both;
}

@keyframes login-in {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  text-align: center;
}

.login-brand .brand-mark {
  width: 52px;
  height: 52px;
}
.login-brand .brand-mark .dot { width: 14px; height: 14px; }

.login-brand h1 {
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.02em;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pass-wrap { position: relative; display: flex; align-items: center; }
.pass-wrap input { padding-right: 42px; }

.pass-toggle {
  position: absolute;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.pass-toggle:hover { color: var(--ink-soft); background: var(--bg-soft); }

.login-error {
  margin: -4px 0 0;
  font-size: 13px;
  color: var(--danger);
  background: rgba(192, 69, 46, 0.07);
  border: 1px solid rgba(192, 69, 46, 0.22);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  animation: shake .34s ease;
}
.login-error[hidden] { display: none; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-6px); }
  44% { transform: translateX(5px); }
  66% { transform: translateX(-3px); }
  88% { transform: translateX(2px); }
}

.login-submit {
  margin-top: 4px;
  padding: 12px 18px;
  font-size: 15px;
  letter-spacing: 0.14em;
  width: 100%;
}
.login-submit:disabled {
  opacity: .6;
  cursor: default;
  transform: none !important;
  box-shadow: none !important;
}

.login-foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--ink-muted);
}

/* 顶栏退出按钮 */
.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  transition: all .15s ease;
}
.logout-btn:hover { color: var(--danger); border-color: rgba(192,69,46,.4); }

/* ---------- 消息中心 ---------- */
.bell-btn { position: relative; }
.bell-btn:hover { transform: none; }
.bell-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #D0554B;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.modal-notify { max-width: 460px; }
.notify-body {
  display: grid;
  gap: 4px;
  padding-top: 4px;
  max-height: min(60vh, 520px);
  overflow-y: auto;
}
.notify-item {
  display: flex;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 10px 10px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background .15s ease;
}
.notify-item:hover { background: var(--bg-soft); }
.notify-item.is-unread { background: #FBF3EA; }
.notify-ico {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notify-item.is-like .notify-ico { color: #D0554B; border-color: #EBD3CE; background: #FDF3F1; }
.notify-main { display: grid; gap: 2px; min-width: 0; }
.notify-text { font-size: 13.5px; color: var(--ink); line-height: 1.6; word-break: break-word; }
.notify-item.is-unread .notify-text { font-weight: 600; }
.notify-sub { font-size: 12px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notify-time { font-size: 11.5px; color: var(--ink-muted); }
.notify-actions {
  padding-top: 10px;
}

/* ---------- 设置里的通知管理 ---------- */
.settings-section {
  border-top: 1px dashed var(--line);
  margin-top: 4px;
  padding-top: 14px;
  display: grid;
  gap: 2px;
}
.settings-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 6px;
  letter-spacing: .04em;
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 2px;
  cursor: pointer;
}
.switch-row.sub { padding-left: 12px; }
.switch-text { font-size: 14px; color: var(--ink); }
.switch-row.sub .switch-text { font-size: 13.5px; color: var(--ink-soft); }
.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--line);
  border: none;
  cursor: pointer;
  transition: background .2s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(42, 38, 32, .22);
  transition: transform .2s cubic-bezier(.2,.7,.2,1);
}
.switch:checked { background: #5E8A52; }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: .45; cursor: not-allowed; }
.settings-hint {
  margin: 8px 0 12px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-muted);
}
.btn-block { width: 100%; justify-content: center; }

/* ---------- 自定义心情 ---------- */
.mood-custom {
  margin-top: 10px;
  padding: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 9px;
  animation: cardIn .22s cubic-bezier(.2,.7,.2,1) both;
}
.mood-emoji-row { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-opt {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.emoji-opt:hover { border-color: var(--ink-muted); transform: translateY(-1px); }
.emoji-opt[aria-checked="true"] {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 152, 70, .22);
}
.mood-custom input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  background: var(--surface);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.mood-custom input[type="text"]:focus { border-color: var(--ink-muted); }
.diary-mood.is-custom { color: var(--ink); }

/* ---------- Responsive ---------- */
/* hidden 属性优先级最高：别让组件自己的 display 把它盖掉 */
[hidden] { display: none !important; }
/* 手机上弹窗从底部升起来，比屏幕正中飘着更好按、也更好滚 */
@keyframes sheetIn {
  from { transform: translateY(26px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@media (max-width: 640px) {
  .topbar { padding: 18px 16px 0; flex-direction: column; align-items: stretch; }
  .whoami { justify-content: space-between; }
  .container { padding: 16px 16px 40px; }
  .brand-text h1 { font-size: 24px; }

  .board { grid-template-columns: 1fr; }
  .board--diary { gap: 12px; }

  /* 4 个标签一行铺满，不滚动 */
  .tabs-wrap {
    width: 100%;
    margin-bottom: 20px;
  }
  .tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 0;
  }
  .tab {
    justify-content: center;
    min-width: 0;
    padding: 9px 2px;
    font-size: 13px;
    gap: 4px;
    white-space: nowrap;
  }
  .tab-count {
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    font-size: 10px;
    padding: 0 4px;
  }
  @media (max-width: 360px) {
    .tab { font-size: 12px; padding: 9px 0; }
  }

  .toolbar { flex-direction: column; align-items: stretch; }
  .filter-chips { justify-content: flex-start; }
  .toolbar-actions { margin-left: 0; }
  .add-btn { justify-content: center; flex: 1; }

  .diary { padding: 14px; gap: 12px; }
  .diary-stamp { width: 46px; }
  .diary-stamp-d { font-size: 21px; }
  .diary-text { font-size: 14.5px; line-height: 1.9; }

  /* 留言：输入框 16px 防 iOS 聚焦缩放，删除按钮放大到手指能戳准 */
  .cmt-input { font-size: 16px; padding: 10px 14px; }
  .cmt-send { padding: 10px 15px; font-size: 13.5px; }
  .cmt-toggle, .like-btn { padding: 7px 13px; font-size: 13px; }
  .cmt-del { width: 28px; height: 28px; font-size: 18px; right: -4px; }
  .cmt-text { font-size: 14px; }
  .diary-time { font-size: 11.5px; }
  .likes-row { font-size: 13.5px; }
  .mood-custom input[type="text"] { font-size: 16px; }
  .emoji-opt { width: 38px; height: 38px; font-size: 20px; }
  .switch-row { padding: 11px 2px; }
  .switch { width: 50px; height: 28px; }
  .switch::after { width: 22px; height: 22px; }
  .switch:checked::after { transform: translateX(22px); }
  .notify-text { font-size: 14px; }
  .modal-notify { max-height: 84vh; }

  /* 卡片上的编辑/删除：28px 手指戳不准，放大一档 */
  .mini { width: 34px; height: 34px; }
  .diary-head { gap: 6px; }

  /* ---------- 写日记弹窗：底部抽屉 ---------- */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal {
    width: 100%;
    max-height: 92dvh;      /* dvh 跟着键盘收缩，不会被顶出屏幕 */
    border-radius: 18px 18px 0 0;
    border-bottom: none;
    animation: sheetIn .28s cubic-bezier(.2,.7,.2,1);
  }
  /* 标题栏吸顶：正文滚到底也能一眼看到在写什么 */
  .modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 14px 18px 10px;
    background: var(--surface);
  }
  .modal-head h2 { font-size: 17px; }
  .icon-btn { width: 42px; height: 42px; }

  /* 底部留白交给操作栏负责，这样按钮能贴住抽屉底边 */
  .modal-body {
    padding: 14px 18px 0;
    gap: 16px;
    overscroll-behavior: contain;   /* 滚到底不把背景一起带着走 */
    -webkit-overflow-scrolling: touch;
  }
  /* iOS 对字号小于 16px 的输入框会自动放大整页，顶到 16px 关掉这个行为 */
  .field input, .field select, .field textarea { font-size: 16px; }

  /* 日期 + 谁写的：窄屏并排两列太挤，改成上下排 */
  .field-row { flex-direction: column; align-items: stretch; gap: 15px; }
  .arrow { display: none; }

  /* 心情 6 个：3 列 2 行，每格给足高度 */
  .mood-picker { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .mood-opt { padding: 11px 6px; min-height: 60px; }
  .mood-opt-emoji { font-size: 21px; }
  .mood-opt-name { font-size: 12.5px; }

  .field textarea { min-height: 112px; }

  /* 配图缩略图：拇指够得着的尺寸 */
  .photo-picker { gap: 10px; }
  .pp-item, .pp-add { width: 84px; height: 84px; }
  .pp-del { width: 27px; height: 27px; top: 4px; right: 4px; }
  .pp-del::after { inset: -6px; }
  .pp-add { font-size: 12.5px; }
  .pp-add-plus { font-size: 21px; }

  /* 取消 / 保存：吸在抽屉底边、左右等分，拇指少走冤枉路 */
  .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 0 -18px;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    gap: 12px;
    background: var(--surface);
    border-top: 1px solid var(--line-soft);
  }
  .btn-ghost, .btn-primary { flex: 1; padding: 13px 18px; font-size: 15px; }

  .lightbox { padding: 56px 12px 20px; }
  .lb-figure img { max-height: calc(100vh - 230px); }
  .lb-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .lb-tools { justify-content: flex-end; }
  .lb-count { order: -1; flex: 1; text-align: left; min-width: 0; }
}

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