/* ============ 基础 ============ */
:root {
  --bg: #faf6ef;
  --bg-soft: #f4ecdf;
  --card: #ffffff;
  --ink: #2c2823;
  --ink-2: #574f45;
  --muted: #8d8377;
  --line: #ece2d3;
  --line-soft: #f4ecdf;
  --accent: #e2703a;
  --accent-deep: #c85c2a;
  --accent-soft: #fdeee4;
  --teal: #3d8b78;
  --teal-soft: #e6f1ed;
  --gold: #d9a13f;
  --gold-soft: #fbf2dd;
  --violet: #7566ad;
  --violet-soft: #eeebf8;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(70, 52, 30, .05);
  --shadow: 0 1px 2px rgba(70, 52, 30, .04), 0 10px 30px -18px rgba(70, 52, 30, .35);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: #f8d6c2; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #e2d6c5; border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.hidden { display: none !important; }

/* ============ 登录 ============ */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 24px;
  background: radial-gradient(1200px 600px at 10% -10%, #fdf1e3 0%, transparent 60%),
              radial-gradient(900px 500px at 100% 110%, #e9f1ec 0%, transparent 55%),
              var(--bg);
}
.login-bg .blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.blob.b1 { width: 420px; height: 420px; background: #ffd9bf; top: -120px; left: -80px; }
.blob.b2 { width: 380px; height: 380px; background: #cfe6da; bottom: -140px; right: -60px; }
.blob.b3 { width: 260px; height: 260px; background: #f6e3b6; bottom: 20%; left: 12%; opacity: .35; }

.login-card {
  position: relative;
  width: min(420px, 100%);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 24px;
  padding: 34px 32px 26px;
  box-shadow: 0 24px 70px -30px rgba(90, 60, 30, .45);
}
.login-brand { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 26px; }
.login-brand h1 { font-size: 23px; margin-bottom: 4px; }
.login-brand p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; flex: 0 0 auto;
  border-radius: 14px;
  background: linear-gradient(145deg, #fbe3d2, #f7d0b4);
  font-size: 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.field { display: block; margin-bottom: 15px; }
.field > span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; font-weight: 500; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=search], textarea, select {
  width: 100%;
  padding: 11px 13px;
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
input:focus, textarea:focus, select:focus {
  border-color: #efb08d;
  box-shadow: 0 0 0 4px rgba(226, 112, 58, .10);
  background: #fff;
}
textarea { resize: vertical; min-height: 82px; line-height: 1.65; }
.login-error {
  background: #fdecec; color: #b4433c; border: 1px solid #f6d4d2;
  padding: 9px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 12px;
}
.login-hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 14px; }

/* ============ 布局 ============ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: 0 0 232px;
  background: #fffdf9;
  border-right: 1px solid var(--line);
  padding: 22px 14px 16px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; }
.brand-text strong { display: block; font-size: 15.5px; letter-spacing: .2px; }
.brand-text small { color: var(--muted); font-size: 11px; letter-spacing: .8px; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--ink-2); font-size: 14.5px;
  transition: background .16s, color .16s;
}
.nav a svg { width: 19px; height: 19px; opacity: .78; }
.nav a:hover { background: var(--bg-soft); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.nav a.active svg { opacity: 1; }

.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.side-user { display: flex; align-items: center; gap: 9px; padding: 4px 4px; }
.side-user-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--teal-soft); color: var(--teal);
  font-size: 13px; font-weight: 600;
}
.side-user-info { min-width: 0; flex: 1; }
.side-user-info strong { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-info small { color: var(--muted); font-size: 11px; }
.icon-btn {
  border: 0; background: transparent; color: var(--muted);
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; transition: background .15s, color .15s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--bg-soft); color: var(--ink); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 26px 34px 10px;
}
.topbar h2 { font-size: 24px; }
.topbar p { font-size: 13px; margin-top: 3px; }
.topbar-right { display: flex; gap: 9px; align-items: center; }

.member-bar {
  display: flex; gap: 8px; padding: 6px 34px 2px;
  overflow-x: auto; scrollbar-width: none;
}
.member-bar::-webkit-scrollbar { display: none; }
.member-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 13px 5px 5px;
  border-radius: 999px; border: 1px solid var(--line);
  background: #fffdfa; color: var(--ink-2);
  font-size: 13.5px; white-space: nowrap;
  transition: all .16s;
}
.member-chip:hover { border-color: #e3cbb6; background: #fff; }
.member-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.member-chip .avatar, .member-chip .avatar-fallback { width: 24px; height: 24px; font-size: 11px; }

.view { padding: 14px 34px 60px; max-width: 1180px; width: 100%; }

/* ============ 通用组件 ============ */
.avatar { border-radius: 50%; object-fit: cover; display: block; background: var(--bg-soft); }
.avatar-fallback {
  border-radius: 50%; display: inline-grid; place-items: center;
  font-weight: 650; flex: 0 0 auto; user-select: none;
  background: var(--accent-soft); color: var(--accent-deep);
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font-size: 15.5px; }
.card-head .muted { font-size: 12.5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 11px;
  border: 1px solid var(--line); background: #fff;
  color: var(--ink-2); font-size: 14px; font-weight: 500;
  transition: all .16s; white-space: nowrap;
}
.btn:hover { background: var(--bg-soft); border-color: #e4d6c5; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(180deg, #ea7c47, var(--accent));
  border-color: var(--accent); color: #fff;
  box-shadow: 0 6px 16px -8px rgba(226, 112, 58, .8);
}
.btn-primary:hover { background: linear-gradient(180deg, #e5713c, var(--accent-deep)); border-color: var(--accent-deep); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn-danger { color: #b4433c; }
.btn-danger:hover { background: #fdeceb; border-color: #f3cfcc; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--bg-soft); color: var(--ink-2);
  font-size: 12px; border: 1px solid transparent;
  transition: all .15s;
}
button.chip { cursor: pointer; }
button.chip:hover { background: #efe5d6; }
.chip.active { background: var(--accent-soft); color: var(--accent-deep); border-color: #f6cdb7; font-weight: 600; }
.chip-teal { background: var(--teal-soft); color: var(--teal); }
.chip-gold { background: var(--gold-soft); color: #a5761f; }
.chip-violet { background: var(--violet-soft); color: var(--violet); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; padding: 2px 8px; border-radius: 7px; font-weight: 600;
  background: var(--bg-soft); color: var(--ink-2);
}
.badge-q { background: var(--violet-soft); color: var(--violet); }
.badge-g { background: var(--gold-soft); color: #a5761f; }
.badge-n { background: var(--teal-soft); color: var(--teal); }
.badge-draft { background: var(--bg-soft); color: var(--muted); }
.badge-final { background: var(--teal-soft); color: var(--teal); }

.empty {
  text-align: center; padding: 46px 20px; color: var(--muted);
}
.empty .empty-icon { font-size: 30px; opacity: .5; margin-bottom: 8px; }
.empty p { font-size: 13.5px; }

/* ============ 今天 ============ */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 26px 28px;
  border-radius: 22px;
  background:
    radial-gradient(600px 200px at 100% 0%, #fde6d6 0%, transparent 70%),
    linear-gradient(135deg, #fffdfa, #fdf4ea);
  border: 1px solid #f3e3d2;
  margin-bottom: 18px;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -40px; bottom: -70px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, #f7dcc6 0%, transparent 70%);
  opacity: .7;
}
.hero-copy { position: relative; z-index: 1; }
.eyebrow { font-size: 12.5px; color: var(--accent-deep); letter-spacing: .4px; font-weight: 600; margin-bottom: 8px; }
.hero h1 { font-size: 26px; letter-spacing: -.02em; margin-bottom: 8px; }
.hero p { color: var(--ink-2); font-size: 14px; max-width: 520px; }
.hero-faces {
  display: flex; position: absolute; right: 30px; top: 50%;
  transform: translateY(-50%); z-index: 1; flex: 0 0 auto;
}
.hero-faces .avatar, .hero-faces .avatar-fallback {
  width: 58px; height: 58px; border: 3px solid #fff; margin-left: -14px;
  box-shadow: 0 6px 16px -8px rgba(90, 60, 30, .5);
  font-size: 20px;
}
.hero-faces > *:first-child { margin-left: 0; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }

.composer .seg {
  display: inline-flex; padding: 3px; background: var(--bg-soft);
  border-radius: 11px; gap: 2px; margin-bottom: 14px;
}
.composer .seg button {
  border: 0; background: transparent; padding: 7px 14px;
  border-radius: 9px; font-size: 13.5px; color: var(--ink-2);
  transition: all .15s; white-space: nowrap;
}
.composer .seg button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }
.composer textarea { min-height: 76px; border: 0; background: var(--bg-soft); padding: 13px 15px; }
.composer textarea:focus { background: #fff; box-shadow: 0 0 0 3px rgba(226,112,58,.10); }

.composer-input { position: relative; }
.composer-input textarea { padding-right: 54px; resize: none; }
.voice-btn {
  position: absolute; right: 9px; bottom: 9px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  display: grid; place-items: center; transition: all .16s;
}
.voice-btn svg { width: 18px; height: 18px; }
.voice-btn:hover { background: var(--bg-soft); color: var(--accent-deep); border-color: #e8d3bf; }
.voice-btn.recording {
  background: #fdecea; border-color: #f3c7c2; color: #c0392b;
  animation: voicePulse 1.4s infinite;
}
@keyframes voicePulse {
  0% { box-shadow: 0 0 0 0 rgba(192, 57, 43, .28); }
  70% { box-shadow: 0 0 0 12px rgba(192, 57, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); }
}
.voice-hint {
  display: flex; align-items: center; gap: 7px;
  margin-top: 7px; font-size: 12.5px; color: var(--muted);
}
.voice-hint .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #c0392b;
  animation: voiceBlink 1s infinite; flex: 0 0 auto;
}
@keyframes voiceBlink { 50% { opacity: .2; } }
.composer-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.composer-row .grow { flex: 1; }
.composer .subjects { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.composer input[type=date] { width: auto; padding: 6px 9px; font-size: 13px; background: var(--bg-soft); border-color: transparent; }
.composer .answer-wrap { margin-top: 10px; }
.composer .answer-wrap input { background: var(--bg-soft); border-color: transparent; font-size: 13.5px; padding: 9px 12px; }

.stars { display: inline-flex; gap: 3px; }
.stars button {
  border: 0; background: transparent; padding: 2px; font-size: 17px;
  color: #ded3c3; line-height: 1; transition: transform .12s, color .12s;
}
.stars button.on { color: var(--gold); }
.stars button:hover { transform: scale(1.15); }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-soft); border-radius: 14px; overflow: hidden; }
.stat { background: #fff; padding: 15px 12px; text-align: center; }
.stat b { display: block; font-size: 22px; letter-spacing: -.02em; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--muted); }

.timeline { display: flex; flex-direction: column; }
.tl-day { margin-top: 4px; }
.tl-date {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--muted); margin: 16px 0 8px; font-weight: 600;
}
.tl-date::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.entry {
  display: flex; gap: 12px; padding: 13px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff; margin-bottom: 9px;
  transition: border-color .15s, box-shadow .15s;
  position: relative;
}
.entry:hover { border-color: #e8d8c6; box-shadow: var(--shadow-sm); }
.entry-body { min-width: 0; flex: 1; }
.entry-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 3px; }
.entry-content { font-size: 14.5px; color: var(--ink); line-height: 1.6; word-break: break-word; white-space: pre-wrap; }
.entry-answer {
  margin-top: 7px; padding: 8px 11px; border-radius: 10px;
  background: var(--violet-soft); color: #5b4f8a; font-size: 13px; line-height: 1.6;
}
.entry-answer::before { content: "一起聊到 · "; opacity: .7; }
.entry-meta { display: flex; gap: 8px; align-items: center; margin-top: 6px; color: var(--muted); font-size: 12px; }
.entry-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.entry:hover .entry-actions { opacity: 1; }
.entry-actions .icon-btn { width: 27px; height: 27px; }
.entry-actions .icon-btn svg { width: 15px; height: 15px; }

.mini-report { display: flex; gap: 12px; align-items: center; }
.mini-report .thumb {
  width: 78px; height: 56px; border-radius: 10px; object-fit: cover;
  background: var(--bg-soft); flex: 0 0 auto; border: 1px solid var(--line);
}
.mini-report .thumb-ph {
  width: 78px; height: 56px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(135deg, #fbe8d8, #e8f1ec);
  display: grid; place-items: center; color: #b9a48f; font-size: 20px;
}
.mini-report h4 { font-size: 14px; margin-bottom: 2px; }

/* ============ 足迹 ============ */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input[type=search] { width: 210px; padding: 8px 12px; font-size: 13.5px; }
.filters input[type=date] { width: 138px; padding: 7px 9px; font-size: 13px; }
.filters select { width: auto; padding: 7px 10px; font-size: 13px; }

/* ============ 改进 ============ */
.imp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.imp {
  padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: #fff;
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .18s, border-color .18s;
}
.imp:hover { box-shadow: var(--shadow); border-color: #e8d8c6; }
.imp-head { display: flex; align-items: flex-start; gap: 10px; }
.imp-head h4 { font-size: 15px; line-height: 1.45; flex: 1; }
.imp-goal { font-size: 13px; color: var(--ink-2); background: var(--bg-soft); padding: 7px 11px; border-radius: 10px; }
.imp-goal::before { content: "目标 · "; color: var(--muted); }
.progress-dots { display: flex; gap: 5px; align-items: center; }
.progress-dots i {
  width: 100%; height: 6px; border-radius: 4px; background: var(--line); flex: 1;
  transition: background .2s;
}
.progress-dots i.on { background: linear-gradient(90deg, #ee9a6b, var(--accent)); }
.imp-logs { border-top: 1px dashed var(--line); padding-top: 9px; display: flex; flex-direction: column; gap: 6px; }
.imp-log { display: flex; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.imp-log time { color: var(--muted); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.imp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.imp-actions { display: flex; gap: 4px; }

/* ============ 报告 ============ */
.seg-tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-soft); border-radius: 12px; margin-bottom: 16px; }
.seg-tabs button {
  border: 0; background: transparent; padding: 7px 16px; border-radius: 9px;
  font-size: 13.5px; color: var(--ink-2); transition: all .15s;
}
.seg-tabs button.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }

.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.report-card {
  border-radius: 16px; overflow: hidden; border: 1px solid var(--line);
  background: #fff; cursor: pointer; transition: transform .18s, box-shadow .18s;
  display: flex; flex-direction: column;
}
.report-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.report-cover {
  aspect-ratio: 16 / 10; background: linear-gradient(135deg, #fdf1e5, #eaf2ed);
  position: relative; overflow: hidden;
}
.report-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.report-cover .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #c4ae96; font-size: 26px;
}
.report-cover .spin-badge {
  position: absolute; right: 9px; bottom: 9px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(6px);
  border-radius: 8px; padding: 3px 8px; font-size: 11px; color: var(--ink-2);
  display: flex; align-items: center; gap: 5px;
}
.report-info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.report-info h4 { font-size: 14.5px; }
.report-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; }

/* 报告详情 */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(44, 36, 26, .32);
  backdrop-filter: blur(3px);
  display: flex; justify-content: center;
  animation: fade .18s ease;
}
.sheet {
  width: min(860px, 100%);
  height: 100%;
  background: var(--bg);
  overflow-y: auto;
  animation: slideUp .24s cubic-bezier(.2,.8,.3,1);
  position: relative;
}
@keyframes slideUp { from { transform: translateY(18px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-toolbar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 22px;
  background: rgba(250, 246, 239, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.sheet-body { padding: 0 0 60px; }
.sheet-hero { position: relative; }
.sheet-hero img { width: 100%; height: auto; display: block; }
.sheet-hero .ph {
  width: 100%; aspect-ratio: 16/8; display: grid; place-items: center;
  background: linear-gradient(135deg, #fdf1e5, #eaf2ed); color: #c4ae96; font-size: 13px;
}
.sheet-content { padding: 26px 46px 20px; max-width: 780px; margin: 0 auto; }
.sheet-title { font-size: 26px; margin-bottom: 8px; letter-spacing: -.02em; }
.sheet-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; color: var(--muted); font-size: 12.5px; }
.sheet-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }

.md { font-size: 15px; line-height: 1.85; color: var(--ink); }
.md h2 {
  font-size: 17px; margin: 30px 0 10px; padding-left: 12px;
  border-left: 3px solid var(--accent); line-height: 1.4;
}
.md h3 { font-size: 15.5px; margin: 22px 0 8px; }
.md p { margin: 9px 0; }
.md ul, .md ol { margin: 8px 0; padding-left: 22px; }
.md li { margin: 5px 0; }
.md li.sub { margin-left: 20px; list-style: circle; color: var(--ink-2); font-size: 14px; }
.md li::marker { color: #c9b9a4; }
.md strong { font-weight: 650; color: #1f1c18; }
.md blockquote {
  margin: 12px 0; padding: 10px 16px; border-left: 3px solid var(--line);
  background: #fff; border-radius: 0 10px 10px 0; color: var(--ink-2);
}
.md hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.md img { max-width: 100%; border-radius: 12px; }
.md code { background: var(--bg-soft); padding: 1px 5px; border-radius: 5px; font-size: .9em; }

.editor { padding: 8px 0 20px; }
.editor textarea {
  width: 100%; min-height: 60vh; font-size: 14.5px; line-height: 1.8;
  font-family: "SFMono-Regular", Consolas, "PingFang SC", monospace;
  background: #fff; border-color: var(--line);
}
.editor-foot { display: flex; gap: 9px; justify-content: flex-end; margin-top: 12px; }

/* ============ 家人 ============ */
.family-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.family-card {
  padding: 22px 18px 16px; border-radius: 18px; border: 1px solid var(--line);
  background: #fff; text-align: center; position: relative;
  transition: box-shadow .18s;
}
.family-card:hover { box-shadow: var(--shadow); }
.family-avatar {
  width: 92px; height: 92px; margin: 0 auto 12px; position: relative;
  border-radius: 50%;
}
.family-avatar .avatar, .family-avatar .avatar-fallback {
  width: 92px; height: 92px; font-size: 32px;
  border: 3px solid #fff; box-shadow: 0 8px 20px -12px rgba(80,55,30,.5);
}
.family-avatar .cam {
  position: absolute; right: 0; bottom: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.family-avatar .cam svg { width: 14px; height: 14px; }
.family-card h4 { font-size: 16px; margin-bottom: 3px; }
.family-card .role { font-size: 12px; color: var(--muted); }
.family-card .acts { display: flex; gap: 6px; justify-content: center; margin-top: 14px; }
.family-add {
  border: 1.5px dashed var(--line); border-radius: 18px; background: transparent;
  display: grid; place-items: center; min-height: 190px; color: var(--muted);
  font-size: 13.5px; transition: all .16s;
}
.family-add:hover { border-color: #e0b795; color: var(--accent-deep); background: #fffaf5; }
.family-add span { display: block; font-size: 24px; margin-bottom: 6px; }

/* ============ 设置 ============ */
.settings { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.setting-row { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line-soft); }
.setting-row:first-of-type { border-top: 0; }
.setting-row > label { font-size: 13.5px; color: var(--ink-2); padding-top: 8px; }
.setting-row .hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.55; }
.setting-row input, .setting-row select { max-width: 420px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; }
.switch input { display: none; }
.switch i {
  width: 40px; height: 23px; border-radius: 999px; background: #e4d8c8; position: relative;
  transition: background .2s;
}
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px;
  border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: var(--shadow-sm);
}
.switch input:checked + i { background: var(--teal); }
.switch input:checked + i::after { transform: translateX(17px); }
.test-out { margin-top: 12px; }
.test-out img { max-width: 320px; border-radius: 12px; border: 1px solid var(--line); }
.test-out .ok { color: var(--teal); font-size: 13px; }

/* ============ 弹层 ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(44, 36, 26, .35); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 20px;
  animation: fade .15s ease;
}
.modal {
  width: min(520px, 100%); background: #fff; border-radius: 20px;
  box-shadow: 0 30px 80px -30px rgba(60, 40, 20, .5);
  animation: pop .2s cubic-bezier(.2,.8,.3,1);
  max-height: 88vh; display: flex; flex-direction: column;
}
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 20px 22px 6px; }
.modal-head h3 { font-size: 17px; }
.modal-head p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 14px 22px; overflow-y: auto; }
.modal-foot { padding: 8px 22px 20px; display: flex; gap: 9px; justify-content: flex-end; }
.modal .field:last-child { margin-bottom: 4px; }
.modal .field > span { font-size: 12.5px; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px);
  background: #2f2a24; color: #fff; padding: 10px 18px; border-radius: 11px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .25s;
  z-index: 200; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #a83f38; }

.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite; display: inline-block;
}
.spinner.dark { border-color: rgba(90,70,50,.2); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-block { display: grid; place-items: center; padding: 60px; }

/* ============ 响应式 ============ */
@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: 1fr; }
  .view { padding: 14px 22px 60px; }
  .topbar { padding: 22px 22px 8px; }
  .member-bar { padding: 4px 22px 0; }
}
@media (max-width: 820px) {
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    width: 100%; height: auto; flex-direction: row; align-items: center;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line); z-index: 50;
    background: rgba(255, 253, 249, .96); backdrop-filter: blur(10px);
  }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; gap: 0; }
  .nav a { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 10px; }
  .nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nav a svg { width: 20px; height: 20px; }
  .main { padding-bottom: 66px; }
  .hero { flex-direction: column; align-items: flex-start; padding: 20px; }
  .hero h1 { font-size: 22px; }
  .hero-faces { display: none; }
  .composer .seg { display: flex; width: 100%; }
  .composer .seg button { flex: 1; padding: 7px 4px; font-size: 12.5px; }
  .composer-row { gap: 8px; }
  .composer-row .grow { display: none; }
  .composer-row .btn-primary { margin-left: auto; }
  .sheet-content { padding: 20px 20px 10px; }
  .setting-row { grid-template-columns: 1fr; gap: 6px; }
  .setting-row > label { padding-top: 0; }
  .topbar { flex-wrap: wrap; }
  .filters input[type=search] { width: 100%; }
}
