/* ==========================================================================
   我们家的空间 —— 样式
   暖色家庭主题，桌面/平板/手机自适应
   ========================================================================== */

:root {
  --bg: #fbf7f2;
  --bg-soft: #f5ede4;
  --card: #ffffff;
  --ink: #3b322c;
  --ink-2: #6b5f55;
  --muted: #9c8e82;
  --line: #eee3d8;
  --brand: #e2703a;
  --brand-dark: #c85a28;
  --brand-soft: #fdeee5;
  --accent: #4f8a8b;
  --accent-soft: #e7f2f2;
  --danger: #d9534f;
  --danger-soft: #fdeceb;
  --ok: #4c9a63;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(59, 50, 44, .05), 0 8px 24px rgba(59, 50, 44, .06);
  --shadow-lg: 0 12px 40px rgba(59, 50, 44, .18);
  --topbar-h: 62px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC",
    system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
code {
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: .88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.hidden { display: none !important; }

/* ---------------------------------------------------------------- 通用控件 */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: .16s ease;
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.btn:hover { border-color: #dccbb9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.soft { background: var(--brand-soft); border-color: transparent; color: var(--brand-dark); }
.btn.soft:hover { background: #fbe2d5; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.danger:hover { background: #fbdcdb; }
.btn.block { width: 100%; }
.btn.big { padding: 12px 22px; font-size: 15px; }
.btn.icon { padding: 8px 10px; }
.btn.small { padding: 4px 12px; font-size: 13px; }

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(226, 112, 58, .12);
}
.input.big { padding: 13px 16px; font-size: 16px; border-radius: 12px; }
.textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
.select { appearance: none; background-image: none; cursor: pointer; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.brand { background: var(--brand-soft); color: var(--brand-dark); }

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty .emoji { font-size: 46px; display: block; margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; color: var(--ink-2); font-weight: 600; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ------------------------------------------------------------------ 登录页 */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1000px 500px at 15% -10%, #ffe9dc 0%, rgba(255, 233, 220, 0) 60%),
    radial-gradient(800px 500px at 110% 110%, #e3f1f1 0%, rgba(227, 241, 241, 0) 55%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 38px 30px 26px;
  text-align: center;
  animation: rise .5s cubic-bezier(.2, .8, .3, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.login-logo { font-size: 52px; line-height: 1; }
.login-card h1 { font-size: 22px; margin: 12px 0 4px; }
.login-sub { color: var(--muted); margin: 0 0 24px; font-size: 13.5px; }
.login-card form { display: grid; gap: 12px; }
.login-error { color: var(--danger); font-size: 13px; min-height: 20px; margin: 12px 0 0; }
.login-tip { color: var(--muted); font-size: 12px; margin: 6px 0 0; line-height: 1.6; }

/* -------------------------------------------------------------------- 框架 */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: rgba(251, 247, 242, .88);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16.5px; }
.brand-logo { font-size: 21px; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 14.5px;
  transition: .15s;
}
.nav a:hover { background: var(--bg-soft); }
.nav a.active { background: var(--brand); color: #fff; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.view {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 20px 90px;
}

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  padding: 10px 20px 26px;
}

.tabbar { display: none; }

/* -------------------------------------------------------------------- 首页 */
.hero {
  border-radius: 22px;
  padding: 28px;
  margin-bottom: 22px;
  background: linear-gradient(120deg, #fff1e7 0%, #fde7f0 45%, #e6f1f1 100%);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero h2 { margin: 0 0 6px; font-size: 24px; }
.hero p { margin: 0; color: var(--ink-2); }
.hero-stats { display: flex; gap: 26px; margin-top: 20px; flex-wrap: wrap; }
.hero-stat b { display: block; font-size: 22px; color: var(--brand-dark); line-height: 1.2; }
.hero-stat span { font-size: 12.5px; color: var(--muted); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 26px 0 14px;
}
.section-head h3 { margin: 0; font-size: 17px; }
.section-head .more { margin-left: auto; color: var(--brand); font-size: 13.5px; }

.strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 168px;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}
.strip .tile {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-soft);
  cursor: pointer;
  scroll-snap-align: start;
  position: relative;
}
.strip .tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.strip .tile:hover img { transform: scale(1.05); }

/* -------------------------------------------------------------------- 相册 */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { margin: 0; font-size: 20px; }
.page-head .sub { color: var(--muted); font-size: 13px; }

.album-toolbar {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.album-toolbar .select { width: auto; min-width: 140px; }
.album-toolbar .search { width: 180px; }

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

.photo {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-soft);
  cursor: zoom-in;
  box-shadow: var(--shadow);
}
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.photo:hover img { transform: scale(1.06); }
.photo .meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 22px 10px 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, .58), rgba(0, 0, 0, 0));
  color: #fff;
  font-size: 12px;
  opacity: 0;
  transition: .2s;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.photo:hover .meta { opacity: 1; }
.photo .meta .up { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo .check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .9);
  background: rgba(0, 0, 0, .25);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  z-index: 2;
}
.photo.selected .check { background: var(--brand); border-color: #fff; }
.photo.selected { outline: 3px solid var(--brand); outline-offset: -3px; }
.photo .missing { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 12px; }

.group-title {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  margin: 16px 0 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.selection-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 22px;
  z-index: 45;
  background: #fff;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
}

/* -------------------------------------------------------------------- 日志 */
.post-list { display: grid; gap: 14px; }

.post-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  cursor: pointer;
  transition: .18s;
  border: 1px solid transparent;
}
.post-card:hover { transform: translateY(-2px); border-color: var(--line); box-shadow: var(--shadow-lg); }
.post-card h3 { margin: 0 0 6px; font-size: 17.5px; }
.post-card .meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.post-card .excerpt { color: var(--ink-2); font-size: 14px; max-height: 3.4em; overflow: hidden; }
.post-thumbs { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.post-thumbs img { width: 74px; height: 74px; object-fit: cover; border-radius: 8px; }

.post-detail { max-width: 780px; margin: 0 auto; }
.post-detail .post-body {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 30px;
}
.post-detail h1 { margin: 0 0 8px; font-size: 24px; line-height: 1.35; }
.post-detail .meta { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.post-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 20px; }
.post-photos img { aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: zoom-in; }

.prose { font-size: 15.5px; line-height: 1.9; word-wrap: break-word; }
.prose p { margin: 0 0 14px; }
.prose h1, .prose h2, .prose h3 { margin: 24px 0 10px; line-height: 1.4; }
.prose h1 { font-size: 22px; }
.prose h2 { font-size: 19px; }
.prose h3 { font-size: 16.5px; }
.prose blockquote {
  margin: 12px 0;
  padding: 6px 16px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 8px 8px 0;
  color: var(--ink-2);
}
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin: 4px 0; }
.prose img { border-radius: 10px; margin: 10px 0; }
.prose a { color: var(--brand); text-decoration: underline; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
.prose code { background: var(--bg-soft); }

/* 编辑器 */
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor-pane {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}
.editor-pane textarea {
  flex: 1;
  border: none;
  padding: 6px 4px;
  min-height: 340px;
  font-size: 15px;
  line-height: 1.85;
  background: transparent;
}
.editor-pane textarea:focus { box-shadow: none; }
.pane-title { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.md-toolbar { display: flex; gap: 4px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.md-toolbar button {
  border: none;
  background: transparent;
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 13.5px;
}
.md-toolbar button:hover { background: var(--bg-soft); color: var(--ink); }
.attach-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.attach-list .attach { position: relative; width: 76px; height: 76px; }
.attach-list .attach img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.attach-list .attach button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: grid;
  place-items: center;
}

/* --------------------------------------------------------------- 时光轴 */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--brand-soft), var(--accent-soft));
}
.tl-year { font-size: 20px; font-weight: 700; margin: 22px 0 12px; color: var(--brand-dark); }
.tl-item { position: relative; margin-bottom: 16px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--brand);
}
.tl-item .tl-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.tl-item .tl-date { color: var(--muted); font-size: 12.5px; white-space: nowrap; padding-top: 3px; }
.tl-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tl-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }

/* -------------------------------------------------------------- 大图查看器 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(24, 18, 14, .93);
  display: flex;
  flex-direction: column;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.lb-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: #fff;
}
.lb-top .title { font-size: 14px; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-top .btn { background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff; }
.lb-top .btn:hover { background: rgba(255, 255, 255, .24); }
.lb-stage { flex: 1; display: grid; place-items: center; position: relative; padding: 0 12px; min-height: 0; }
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.lb-nav:hover { background: rgba(255, 255, 255, .28); }
.lb-nav.prev { left: 14px; }
.lb-nav.next { right: 14px; }
.lb-bottom { padding: 10px 16px 18px; color: #fff; text-align: center; }
.lb-bottom .cap { font-size: 14px; opacity: .95; }
.lb-bottom .info { font-size: 12px; opacity: .6; margin-top: 4px; }

/* ------------------------------------------------------------------ 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(40, 30, 24, .45);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade .16s ease;
}
.modal {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: rise .22s cubic-bezier(.2, .8, .3, 1);
}
.modal.wide { max-width: 720px; }
.modal-head {
  padding: 18px 22px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 16.5px; }
.modal-head .btn { margin-left: auto; }
.modal-body { padding: 18px 22px; overflow: auto; }
.modal-foot {
  padding: 14px 22px 18px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

/* 上传 */
.dropzone {
  border: 2px dashed #e3d3c4;
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  color: var(--ink-2);
  cursor: pointer;
  transition: .18s;
  background: #fffaf6;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .big { font-size: 34px; display: block; margin-bottom: 6px; }
.dropzone .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.upload-list { display: grid; gap: 8px; margin-top: 14px; max-height: 240px; overflow: auto; }
.upload-item { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.upload-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--bg-soft); flex: none; }
.upload-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .bar { width: 90px; height: 5px; border-radius: 3px; background: var(--bg-soft); overflow: hidden; flex: none; }
.upload-item .bar i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.upload-item.done .bar i { background: var(--ok); }

.progress { height: 6px; border-radius: 3px; background: var(--bg-soft); overflow: hidden; margin-top: 14px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #f0a06a); transition: width .2s; }

/* 选择照片（写日志时） */
.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  max-height: 46vh;
  overflow: auto;
  padding: 2px;
}
.pick-grid .pick { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; cursor: pointer; }
.pick-grid .pick img { width: 100%; height: 100%; object-fit: cover; }
.pick-grid .pick.on { outline: 3px solid var(--brand); outline-offset: -3px; }
.pick-grid .pick.on::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  display: grid;
  place-items: center;
}

/* 提示 */
.toast-root {
  position: fixed;
  z-index: 120;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(46, 38, 32, .94);
  color: #fff;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: rise .2s ease;
  max-width: 86vw;
}
.toast.ok { background: rgba(58, 128, 80, .95); }
.toast.err { background: rgba(190, 66, 62, .95); }

/* 骨架屏 */
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.skeleton { aspect-ratio: 1; border-radius: var(--radius-sm); background: linear-gradient(100deg, #f3ece4 30%, #ece3d9 50%, #f3ece4 70%); background-size: 200% 100%; animation: shine 1.3s infinite linear; }
@keyframes shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.loading-more { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; }

/* ------------------------------------------------------- 纪念日 / 生日 */
.remind-card {
  background: linear-gradient(120deg, #fff5ec 0%, #fdeef3 100%);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.remind-head { font-weight: 700; font-size: 14px; color: var(--brand-dark); margin-bottom: 10px; }
.remind-list { display: grid; gap: 8px; }
.remind-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
}
.remind-item.hot { box-shadow: inset 0 0 0 2px var(--brand); }
.remind-item[onclick] { cursor: pointer; }
.ri-emoji { font-size: 22px; flex: none; }
.ri-main { flex: 1; display: grid; min-width: 0; }
.ri-main b { font-size: 14.5px; font-weight: 600; }
.ri-sub { color: var(--muted); font-size: 12.5px; }
.ri-days { font-weight: 700; color: var(--brand-dark); white-space: nowrap; font-size: 14px; }
.remind-item.hot .ri-days { color: var(--danger); }

.date-list { display: grid; gap: 12px; }
.date-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  border: 1px solid transparent;
}
.date-card.today {
  border-color: var(--brand);
  background: linear-gradient(120deg, #fff8f3 0%, #fff 60%);
}
.dc-emoji {
  font-size: 28px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  border-radius: 14px;
  flex: none;
}
.dc-main { flex: 1; min-width: 0; }
.dc-title { display: flex; align-items: center; gap: 8px; font-size: 16px; flex-wrap: wrap; }
.dc-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.dc-next { color: var(--ink-2); font-size: 13.5px; margin-top: 4px; }
.dc-note { color: var(--muted); font-size: 12.5px; margin-top: 3px; font-style: italic; }
.dc-days { text-align: center; min-width: 76px; flex: none; }
.dc-days b { display: block; font-size: 25px; color: var(--brand-dark); line-height: 1.15; font-variant-numeric: tabular-nums; }
.dc-days span { font-size: 12px; color: var(--muted); }
.dc-actions { display: flex; gap: 6px; flex: none; }

.home-dates { padding: 16px 18px; }
.counter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.counter {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(120deg, #fff1e7 0%, #fde7f0 100%);
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform .16s;
}
.counter:hover { transform: translateY(-1px); }
.counter b { display: block; font-size: 17px; color: var(--brand-dark); line-height: 1.3; }
.counter span { font-size: 12.5px; color: var(--muted); }
.c-emoji { font-size: 22px; }
.home-dates .remind-list { margin-top: 4px; }

/* ------------------------------------------------------ 会走的时间 */
.time-hero {
  position: relative;
  border-radius: 22px;
  padding: 22px 26px 20px;
  margin-bottom: 22px;
  background: linear-gradient(120deg, #fff1e7 0%, #fde7f0 30%, #e6f1f1 65%, #fff1e7 100%);
  background-size: 300% 300%;
  animation: timeflow 22s ease-in-out infinite;
  box-shadow: var(--shadow);
  overflow: hidden;
}
@keyframes timeflow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.th-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.th-top .th-emoji { font-size: 22px; }
.th-top b { font-size: 17px; }
.th-days { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 3px; }
.th-num {
  font-size: 54px;
  font-weight: 800;
  line-height: 1;
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.th-unit { font-size: 16px; color: var(--ink-2); }
.th-parts { color: var(--ink-2); font-size: 14px; }
.th-clock { display: flex; align-items: center; gap: 8px; margin-top: 13px; font-size: 12.5px; color: var(--muted); }
.th-clock-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 600;
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  flex: none;
  animation: beat 1.8s ease-out infinite;
}
@keyframes beat {
  0% { box-shadow: 0 0 0 0 rgba(226, 112, 58, .55); }
  70% { box-shadow: 0 0 0 9px rgba(226, 112, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(226, 112, 58, 0); }
}
.th-progress { margin-top: 16px; }
.th-bar {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(120, 90, 70, .12);
}
.th-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #f0a06a);
  transition: width 1.4s cubic-bezier(.2, .8, .3, 1);
}
.th-scale { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); margin-top: 7px; }
.th-progress-text { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.th-second { margin-top: 12px; font-size: 12px; color: var(--muted); }
.th-sec-num { font-variant-numeric: tabular-nums; color: var(--brand-dark); font-weight: 600; }

.mini-bar { height: 5px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; margin-top: 10px; }
.mini-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #f0a06a);
  transition: width 1.1s cubic-bezier(.2, .8, .3, 1);
}

.c-body { display: grid; }
.c-line { font-size: 12.5px; color: var(--muted); }
.c-line b { font-size: 19px; color: var(--brand-dark); font-variant-numeric: tabular-nums; margin: 0 3px; }
.c-sub { font-size: 12.5px; color: var(--muted); }
.c-clock {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--brand-dark);
  opacity: .8;
  font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
}

@media (prefers-reduced-motion: reduce) {
  .time-hero { animation: none; }
  .dot { animation: none; }
  .th-bar i, .mini-bar i { transition: none; }
}

.emoji-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.emoji-opt {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 19px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: .15s;
}
.emoji-opt:hover { border-color: #dccbb9; }
.emoji-opt.on { border-color: var(--brand); background: var(--brand-soft); }
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 8px;
  cursor: pointer;
}
.check-line input { width: 16px; height: 16px; accent-color: var(--brand); }

/* 公历 / 农历 切换 */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-soft);
  border-radius: 999px;
}
.seg button {
  border: none;
  background: transparent;
  padding: 6px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink-2);
  transition: .16s;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: #fff; color: var(--brand-dark); font-weight: 600; box-shadow: 0 1px 3px rgba(59, 50, 44, .12); }

.mini-label { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.field-hint {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 8px;
  padding: 7px 12px;
  line-height: 1.6;
}
.field-hint:empty { display: none; }
.field-tip { font-size: 12px; color: var(--muted); }

/* 游客模式提示 */
.guest-note {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
}
.guest-note .gn-emoji { font-size: 26px; flex: none; }
.guest-note b { font-size: 15px; }
.guest-note .gn-sub { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
#guest-chip { flex: none; }

/* 移动端悬浮新建按钮 */
.fab { display: none; }

/* ------------------------------------------------------------------ 响应式 */
@media (max-width: 900px) {
  .editor-grid { grid-template-columns: 1fr; }
  .editor-pane { min-height: 260px; }
  .editor-pane textarea { min-height: 200px; }
}

@media (max-width: 720px) {
  :root { --topbar-h: 56px; }
  .view { padding: 16px 14px 94px; }
  .nav { display: none; }
  .brand-name { max-width: 130px; font-size: 15px; }
  .topbar { padding: 0 12px; gap: 8px; }
  #btn-upload, #btn-write { display: none; }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 7px; }
  .skeleton-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 7px; }
  .hero { padding: 20px; }
  .hero h2 { font-size: 20px; }
  .hero-stats { gap: 18px; }
  .post-detail .post-body { padding: 20px 18px; }
  .strip { grid-auto-columns: 132px; }
  .photo .meta { opacity: 1; background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0)); }
  .photo .meta .up { display: none; }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    display: grid;
    gap: 2px;
    padding: 5px 0;
    border-radius: 10px;
  }
  .tabbar a span { font-size: 19px; }
  .tabbar a.active { color: var(--brand); background: var(--brand-soft); }
  .selection-bar { bottom: 76px; }
  .lb-nav { width: 38px; height: 38px; font-size: 18px; }
  .foot { padding-bottom: 76px; }

  .date-card { flex-wrap: wrap; padding: 14px; }
  .dc-days { min-width: 62px; }
  .dc-days b { font-size: 21px; }
  .dc-actions { width: 100%; justify-content: flex-end; }
  .dc-emoji { width: 40px; height: 40px; font-size: 24px; }
  .remind-card { padding: 14px; }
  .tabbar a { font-size: 10.5px; }
  .time-hero { padding: 18px; }
  .th-num { font-size: 40px; }
  .th-progress-text { font-size: 12.5px; }
  .th-scale { font-size: 11px; }
  .counter { padding: 9px 13px; }

  .fab {
    display: grid;
    place-items: center;
    position: fixed;
    right: 16px;
    bottom: 84px;
    z-index: 60;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    background: var(--brand);
    color: #fff;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(226, 112, 58, .45);
  }
  .fab:active { transform: scale(.94); }
}
