:root {
  --blue: #e08361;        /* 暖珊瑚/赤陶（统一主色，原蓝色已暖化）*/
  --blue-dark: #cf6f4e;
  --ink: #3b342d;        /* 暖调深色，更柔和 */
  --muted: #9c9088;      /* 暖灰 */
  --bg: #fdf7ef;         /* 暖奶油 */
  --card: #ffffff;
  --err: #d4504a;
  --warm-shadow: 0 10px 34px rgba(120, 92, 56, 0.10);
}

* { box-sizing: border-box; }

/* 启动画面（秒显，消除白屏） */
#boot {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(165deg, #fdf7ef 0%, #f7efe4 100%);
  display: flex; align-items: center; justify-content: center;
}
#boot[hidden] { display: none; }
.boot-logo { font-size: 52px; text-align: center; }
.boot-title { font-size: 18px; font-weight: 600; color: #2b2f38; margin-top: 10px; text-align: center; }
.boot-spinner {
  width: 26px; height: 26px; margin: 20px auto 0;
  border: 3px solid #ecdfd2; border-top-color: var(--blue); border-radius: 50%;
  animation: boot-spin 0.8s linear infinite;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }
#boot-slow {
  display: none; max-width: 300px; margin: 22px auto 0; text-align: center;
  font-size: 14px; line-height: 1.7; color: #7a6a5b;
}
#boot-slow b { color: var(--blue); }
#boot-retry {
  margin-top: 12px; padding: 9px 22px; font-size: 15px; font-family: inherit;
  border: none; border-radius: 999px; background: var(--blue); color: #fff; cursor: pointer;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: linear-gradient(165deg, #fdf7ef 0%, #f7efe4 60%, #f3eee6 100%);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: env(safe-area-inset-top, 12px) 12px env(safe-area-inset-bottom, 16px);
}

.card {
  background: var(--card);
  width: 100%;
  max-width: 380px;
  padding: 28px 22px;
  border-radius: 22px;
  box-shadow: var(--warm-shadow);
  text-align: center;
}

/* 登录封面图（家庭插画） */
.login-card { padding-top: 0; overflow: hidden; }
.cover {
  width: calc(100% + 44px);
  margin: 0 -22px 12px;
  display: block;
  height: 40vh; max-height: 400px; min-height: 200px;
  object-fit: cover; object-position: center 36%;  /* 露出三张脸+抱抱的核心 */
  border-radius: 22px 22px 0 0;
}
/* 登录卡片整体收紧，保证一屏不用下拉 */
.login-card { padding-bottom: 20px; }
.login-card h1 { margin-top: 2px; }
.login-card .sub { margin-bottom: 14px; }
.login-card .email-form label { margin-bottom: 4px; }
.login-card .email-form input { padding: 11px 12px; margin-bottom: 2px; }
.login-card .mt12 { margin-top: 8px; }
.login-card .remember { margin: 10px 0 6px; }
/* 复选框等表单控件也用暖色主色 */
input[type="checkbox"], input[type="radio"] { accent-color: var(--blue); }

/* 无权限：小卡片垂直居中；登录卡片较高，靠上对齐可完整滚动查看 */
#denied-view { margin: auto 0; }
#login-view { margin: 6px 0; }
/* 主界面：铺满屏幕高度，从顶部开始，消除上下空白 */
#app-view { flex: 1 1 auto; }

h1 { font-size: 22px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 24px; }

.btn {
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  border: none;
  border-radius: 12px;
  background: #eef1f6;
  color: var(--ink);
  cursor: pointer;
  margin-top: 10px;
  transition: filter .15s ease;
}
.btn:active { filter: brightness(0.95); }

.btn-google { background: var(--blue); color: #fff; margin-top: 0; }
.btn-google:active { background: var(--blue-dark); }
.btn-email { background: var(--ink); color: #fff; }

.divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 13px; margin: 18px 0;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: #e3e7ee;
}

.email-form { text-align: left; }
.email-form label { font-size: 14px; color: var(--muted); display: block; margin-bottom: 6px; }
.email-form input {
  width: 100%; padding: 12px; font-size: 16px;
  border: 1px solid #d7dde7; border-radius: 12px; margin-bottom: 4px;
}
.email-form input:focus { outline: none; border-color: var(--blue); }

.mt12 { margin-top: 12px; }
.remember { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin: 14px 0 4px; cursor: pointer; }
.remember input { width: auto; margin: 0; }

.msg { font-size: 14px; color: var(--muted); min-height: 20px; margin: 14px 0 0; }
.msg.error { color: var(--err); }

.tip { font-size: 13px; color: var(--muted); margin-top: 18px; line-height: 1.5; }
.age { font-size: 15px; color: var(--muted); margin: 4px 0 0; }

/* ===== 问答界面 ===== */
.card-wide { max-width: 600px; text-align: left; padding: 20px 18px; }

.app-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  position: sticky; top: env(safe-area-inset-top, 0); z-index: 30;
  background: var(--card);
  margin: -20px -18px 14px; padding: 12px 18px 10px;
  border-radius: 22px 22px 0 0;
}
.app-header h1 { font-size: 20px; margin: 0; }

.btn-text {
  background: none; border: none; color: var(--muted);
  font-size: 14px; cursor: pointer; padding: 4px 6px;
}
.btn-text:active { color: var(--ink); }

.field-label { font-size: 14px; color: var(--muted); margin: 0 0 10px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tag {
  border: 1px solid #d7dde7; background: #fff; color: var(--ink);
  padding: 7px 14px; border-radius: 999px; font-size: 14px; cursor: pointer;
  transition: all .12s ease;
}
.tag:active { transform: scale(0.96); }
.tag.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.question {
  width: 100%; padding: 14px; font-size: 16px; line-height: 1.6;
  border: 1px solid #d7dde7; border-radius: 14px; resize: vertical;
  font-family: inherit; margin-bottom: 12px;
}
.question:focus { outline: none; border-color: var(--blue); }

#btn-ask:disabled { opacity: 0.7; cursor: default; }

/* 提问时上传照片 */
.ask-photos { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ask-photo-add {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 14px; font-size: 14px; color: var(--blue-dark);
  background: #fff; border: 1px dashed var(--blue); border-radius: 12px;
  cursor: pointer; user-select: none; white-space: nowrap;
}
.ask-photo-add:active { filter: brightness(0.96); }
.ask-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.ask-thumb { position: relative; width: 64px; height: 64px; }
.ask-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid #e7ddd2; }
.ask-thumb-x {
  position: absolute; top: -7px; right: -7px;
  width: 20px; height: 20px; line-height: 18px; text-align: center;
  font-size: 15px; color: #fff; background: rgba(59, 52, 45, 0.78);
  border: none; border-radius: 50%; cursor: pointer; padding: 0;
}

.answer-box {
  margin-top: 22px; padding: 18px; background: #f7f9fc;
  border-radius: 14px; border: 1px solid #e6ebf3;
}
.answer-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.answer-badge {
  background: var(--blue); color: #fff; font-size: 12px;
  padding: 3px 10px; border-radius: 999px;
}
.answer-meta { font-size: 12px; color: var(--muted); }
.answer-text {
  font-size: 15.5px; line-height: 1.75; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
}

/* ===== 标签页 ===== */
.app-tabs {
  display: flex; gap: 16px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.app-tabs::-webkit-scrollbar { display: none; }
.app-tab { white-space: nowrap; flex: 0 0 auto; }
.app-tab {
  border: none; background: none; cursor: pointer;
  font-size: 17px; font-weight: 600; color: var(--muted);
  padding: 4px 2px; position: relative;
}
.app-tab.active { color: var(--ink); }
.app-tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 3px; border-radius: 3px; background: var(--blue);
}
.tab-panel { margin-top: 6px; }
.filter-tags { margin-bottom: 16px; }

/* ===== 回忆录条目 ===== */
.rec {
  border: 1px solid #e6ebf3; border-radius: 14px;
  padding: 16px; margin-bottom: 14px; background: #fff;
}
.rec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rec-q { font-size: 15px; color: var(--ink); margin-bottom: 8px; line-height: 1.6; }
.rec-label { color: var(--muted); }
.rec-a {
  font-size: 14.5px; line-height: 1.7; color: #444b57;
  white-space: pre-wrap; word-break: break-word;
}
.rec-a.clamp {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.rec-toggle {
  border: none; background: none; color: var(--blue);
  font-size: 13px; cursor: pointer; padding: 6px 0 0;
}
.rec-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rec-followup-btn { font-weight: 600; }
/* 历史卡片里的 收起/追问/分类：加框、稍大一点 */
.rec-actions .rec-toggle {
  border: 1px solid #f0e6d6; border-radius: 999px;
  padding: 7px 15px; font-size: 14px; background: #fff;
}
.rec-actions .rec-toggle:active { background: #fdf1ea; }

/* 历史的主题分类分组 */
.hist-cat { margin-bottom: 12px; }
.hist-cat-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid #f0e6d6; border-radius: 12px;
  padding: 13px 15px; cursor: pointer; font-family: inherit; text-align: left;
}
.hist-cat-arrow { color: var(--blue); font-size: 12px; width: 12px; }
.hist-cat-name { font-size: 16px; font-weight: 700; color: var(--ink); flex: 1; }
.hist-cat-count {
  font-size: 12px; color: var(--blue); background: #fdf1ea;
  min-width: 22px; text-align: center; padding: 2px 8px; border-radius: 999px;
}
.hist-cat-body { padding-top: 10px; }
.hist-cat-body.collapsed { display: none; }

.hist-cat-empty { font-size: 13px; color: var(--muted); padding: 4px 4px 10px; }

/* 追问框 */
.followup { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e6ebf3; }
.followup-ans {
  margin-top: 10px; font-size: 15px; line-height: 1.7; color: var(--ink);
  background: #fffaf0; padding: 10px 12px; border-radius: 10px; white-space: pre-wrap; word-break: break-word;
}

.rec-cat-btn { font-weight: 600; }

/* 历史：一行紧凑标签（名字 + 小橙点数字） */
.hist-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.hist-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid #f0e6d6; border-radius: 999px;
  padding: 8px 14px; font-size: 15px; color: var(--ink); cursor: pointer; font-family: inherit;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.hist-chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.hist-chip-dot {
  min-width: 18px; height: 18px; line-height: 18px; text-align: center;
  font-size: 11px; padding: 0 5px; border-radius: 999px; background: #fdf1ea; color: var(--blue);
}
.hist-chip.active .hist-chip-dot { background: rgba(255,255,255,0.3); color: #fff; }
.hist-chip-add { font-size: 17px; font-weight: 700; color: var(--blue); padding: 8px 15px; }
.sheet-row-danger { color: var(--err); justify-content: flex-start; }

/* ===== 底部滑出操作面板（仿 iPhone 操作单）===== */
body.sheet-open { overflow: hidden; }
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 120; background: rgba(20, 16, 14, 0);
  display: flex; align-items: flex-end; transition: background 0.24s ease;
}
.sheet-backdrop.show { background: rgba(20, 16, 14, 0.4); }
.sheet {
  width: 100%; max-width: 640px; margin: 0 auto;
  background: #fdfaf6; border-radius: 20px 20px 0 0;
  padding: 10px 14px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 80vh; overflow-y: auto;
}
.sheet-backdrop.show .sheet { transform: translateY(0); }
.sheet::before {
  content: ""; display: block; width: 38px; height: 5px; border-radius: 999px;
  background: #e2d6c8; margin: 4px auto 12px;
}
.sheet-title { font-size: 14px; color: var(--muted); text-align: center; margin-bottom: 8px; }
.sheet-body { display: flex; flex-direction: column; gap: 4px; }
.sheet-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid #f0e6d6; border-radius: 12px;
  padding: 14px 16px; font-size: 16px; color: var(--ink); cursor: pointer; font-family: inherit; text-align: left;
}
.sheet-row:active { background: #fdf1ea; }
.sheet-row-name { flex: 1; }
.sheet-row-check { color: var(--blue); font-weight: 700; }
.sheet-row-create { color: var(--blue); font-weight: 600; justify-content: flex-start; }
.sheet-create { display: flex; gap: 8px; padding: 6px 0; }
.sheet-create-input {
  flex: 1; padding: 12px 14px; font-size: 16px; border: 1px solid #d7dde7; border-radius: 12px; font-family: inherit;
}
.sheet-create-input:focus { outline: none; border-color: var(--blue); }
.sheet-cancel {
  width: 100%; margin-top: 10px; padding: 14px; font-size: 16px; font-weight: 600;
  border: none; border-radius: 12px; background: #fff; color: var(--muted); cursor: pointer; font-family: inherit;
}
.sheet-cancel:active { background: #f2ece4; }

.rec-effect { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e6ebf3; }
.effect-text { font-size: 14px; color: var(--ink); line-height: 1.6; background: #fffaf0; padding: 8px 10px; border-radius: 8px; }
.effect-add {
  border: 1px dashed #c4cdda; background: none; color: var(--muted);
  font-size: 13px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
}
.effect-add:active { background: #f2f5f9; }
.effect-input {
  width: 100%; padding: 10px; font-size: 14px; line-height: 1.6;
  border: 1px solid #d7dde7; border-radius: 10px; font-family: inherit; resize: vertical;
}
.effect-input:focus { outline: none; border-color: var(--blue); }
.effect-actions { display: flex; gap: 8px; margin-top: 8px; }
.btn-mini {
  border: 1px solid #d7dde7; background: #fff; color: var(--ink);
  font-size: 13px; padding: 6px 16px; border-radius: 8px; cursor: pointer;
}
.btn-mini-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-mini:disabled { opacity: 0.7; }

/* ===== 档案编辑 ===== */
.profile-fixed {
  background: #fdf6ec; border: 1px solid #f0e6d6; border-radius: 14px;
  padding: 14px 16px; margin-bottom: 18px; font-size: 14px; line-height: 1.9;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.pf-info { flex: 1; min-width: 0; }
.pf-avatar {
  flex: 0 0 auto; width: 84px; height: 84px; border-radius: 50%;
  object-fit: cover; object-position: center 25%;
  border: 3px solid #fff; box-shadow: 0 4px 14px rgba(120, 92, 56, 0.18);
}
.pf-label {
  display: inline-block; width: 48px; color: var(--muted); font-size: 13px;
}
.field-hint { font-size: 12.5px; color: var(--muted); margin: 4px 0 8px; line-height: 1.5; }
.profile-textarea {
  width: 100%; padding: 12px; font-size: 15px; line-height: 1.7;
  border: 1px solid #d7dde7; border-radius: 12px; resize: vertical;
  font-family: inherit; margin-bottom: 18px;
}
.profile-textarea:focus { outline: none; border-color: var(--blue); }
#btn-save-profile:disabled { opacity: 0.7; }

/* ===== 档案多级结构 ===== */
.cat-list { display: flex; flex-direction: column; gap: 10px; }
.cat-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 16px 16px; border: 1px solid #e6ebf3; border-radius: 12px;
  background: #fff; cursor: pointer; font-size: 16px; color: var(--ink);
}
.cat-row:active { background: #f2f5f9; }
.cat-name { font-weight: 500; }
.cat-arrow { color: var(--muted); font-size: 20px; }

.detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.detail-head-tap { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.detail-back-hint { color: var(--muted); font-size: 24px; line-height: 1; margin-top: -2px; }
.detail-title { font-size: 18px; font-weight: 700; }

.subtabs { display: flex; gap: 18px; border-bottom: 1px solid #e6ebf3; margin-bottom: 14px; }
.subtab {
  border: none; background: none; cursor: pointer; font-size: 15px; color: var(--muted);
  padding: 8px 2px; position: relative;
}
.subtab.active { color: var(--ink); font-weight: 600; }
.subtab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--blue);
}

/* 语言三子板块：iPhone 风分段控件，同一行平分 */
.lang-seg {
  display: flex; gap: 4px; background: #f1ece5; border-radius: 12px;
  padding: 4px; margin-bottom: 16px;
}
.lang-seg-btn {
  flex: 1; border: none; background: none; cursor: pointer;
  font-size: 14px; color: var(--muted); padding: 8px 0; border-radius: 9px;
  transition: background .18s, color .18s, box-shadow .18s;
}
.lang-seg-btn.active {
  background: #fff; color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.input-box { margin-bottom: 18px; }
.input-box .btn { margin-top: 0; }
.entry-list { display: flex; flex-direction: column; gap: 10px; }
.entry { border: 1px solid #e6ebf3; border-radius: 12px; padding: 12px 14px; background: #fff; }
.entry-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.entry-text { font-size: 15px; line-height: 1.7; color: var(--ink); white-space: pre-wrap; word-break: break-word; }

.sum-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.clamp-6 { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== 首页 ===== */
.home-greet { display: flex; align-items: center; gap: 14px; background: #fdf6ec; border: 1px solid #f0e6d6; border-radius: 16px; padding: 16px; }
.home-av { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: center 25%; border: 3px solid #fff; box-shadow: var(--warm-shadow); flex: 0 0 auto; }
.home-hello { font-size: 18px; font-weight: 700; color: var(--ink); }
.home-date { font-size: 13px; color: var(--muted); margin-top: 4px; }
.home-quick { display: flex; gap: 10px; margin: 16px 0 4px; }
.home-quick-btn { flex: 1; padding: 12px 4px; font-size: 14px; border: 1px solid #f0e6d6; border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer; }
.home-quick-btn:active { background: #f7efe4; }
.home-sec { margin-top: 22px; }
.home-sec-head { display: flex; align-items: center; justify-content: space-between; }
.home-h3 { font-size: 16px; color: var(--ink); margin: 0 0 10px; }
.home-mem { border: 1px solid #f0e6d6; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.home-mem-ago { font-size: 13px; color: var(--blue); font-weight: 600; margin-bottom: 6px; }
.home-mem-text { font-size: 14.5px; line-height: 1.7; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.home-mem-media { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.home-mem-media img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; }
.home-mem-onephoto { width: 100%; max-height: 60vh; object-fit: cover; border-radius: 10px; margin-top: 4px; }
.home-date-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border: 1px solid #f0e6d6; border-radius: 12px; background: #fff; margin-bottom: 8px; font-size: 15px; }
.home-date-count { font-weight: 600; color: var(--blue); }

/* ===== 成长报告 ===== */
.report-seg { display: flex; gap: 18px; border-bottom: 1px solid #e6ebf3; }

/* ===== 重要日子 ===== */
.dates-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.date-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid #f0e6d6; border-radius: 12px; background: #fff; }
.date-name { font-size: 15px; color: var(--ink); }
.date-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.date-count { font-size: 14px; font-weight: 600; color: var(--blue); white-space: nowrap; }

/* ===== 成长纪念册 ===== */
.album-print { margin-top: 14px; }
.album-cover { text-align: center; padding: 24px 0; }
.album-avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; object-position: center 25%; border: 4px solid #fff; box-shadow: var(--warm-shadow); }
.album-title { font-size: 24px; font-weight: 700; margin-top: 14px; color: var(--ink); }
.album-sub { font-size: 17px; color: var(--blue); margin-top: 4px; }
.album-sub2 { font-size: 13px; color: var(--muted); margin-top: 6px; }
.album-sec { margin-top: 22px; }
.album-h2 { font-size: 19px; color: var(--ink); border-bottom: 2px solid #f0e6d6; padding-bottom: 6px; }
.album-h3 { font-size: 15px; color: var(--blue); margin: 12px 0 2px; }
.album-p { font-size: 14.5px; line-height: 1.8; color: #444b57; white-space: pre-wrap; word-break: break-word; }
.album-diary { margin: 14px 0; padding-bottom: 12px; border-bottom: 1px dashed #eadfce; }
.album-diary-date { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.album-media { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.album-media img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; }

@media print {
  body * { visibility: hidden !important; }
  .album-print, .album-print * { visibility: visible !important; }
  .album-print { position: absolute; left: 0; top: 0; width: 100%; padding: 0 8px; }
  .album-noprint { display: none !important; }
  #boot { display: none !important; }
}

/* ===== 成长曲线 ===== */
.growth-inputs { display: flex; gap: 8px; }
.growth-inputs .tl-caption { margin-bottom: 10px; }
.growth-charts { display: flex; flex-direction: column; gap: 20px; margin-top: 8px; }
.growth-chart-box { position: relative; height: 280px; border: 1px solid #e6ebf3; border-radius: 12px; padding: 10px; background: #fff; }
.growth-list { margin-top: 22px; }
.gl-row { display: grid; grid-template-columns: 1.4fr 1fr 0.9fr 0.9fr 0.9fr; gap: 6px; padding: 9px 6px; border-bottom: 1px solid #eef1f6; font-size: 13.5px; }
.gl-head { color: var(--muted); font-size: 12px; border-bottom: 1px solid #d7dde7; }

/* ===== 疫苗 ===== */
.vac-plan { margin-bottom: 22px; }
.vac-list { margin-top: 8px; }
.vac-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 4px; border-bottom: 1px solid #eef1f6; }
.vac-name { font-size: 15px; color: var(--ink); }
.vac-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.vac-date { font-size: 13px; color: var(--muted); white-space: nowrap; margin-left: 12px; }

/* ===== 知识 ===== */
.k-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.k-head .field-label { margin: 0; }
.k-month-select {
  width: 100%; padding: 11px 12px; font-size: 16px; margin-bottom: 12px;
  border: 1px solid #d7dde7; border-radius: 10px; background: #fff; color: var(--ink);
  font-family: inherit;
}
.k-month-select:focus { outline: none; border-color: var(--blue); }
.k-content { font-size: 15px; line-height: 1.8; color: var(--ink); }
.k-line { white-space: pre-wrap; word-break: break-word; }
.k-line strong { color: var(--ink); }
.k-h1 { font-size: 18px; font-weight: 700; margin: 6px 0 2px; }
.k-h2 { font-size: 16px; font-weight: 700; color: var(--blue); margin: 18px 0 6px; }
.k-h3 { font-size: 15px; font-weight: 600; margin: 12px 0 2px; }
.k-h2 strong, .k-h3 strong, .k-h1 strong { color: inherit; }
.k-bullet { padding-left: 6px; margin: 3px 0; line-height: 1.7; word-break: break-word; }
.k-hr { border: none; border-top: 1px solid #e6ebf3; margin: 14px 0; }
.k-space { height: 8px; }

/* ===== 时间线 ===== */
.tl-upload {
  background: #f7f9fc; border: 1px solid #e6ebf3; border-radius: 14px;
  padding: 14px; margin-bottom: 20px;
}
.tl-pick {
  display: block; text-align: center; padding: 14px;
  border: 1px dashed #c4cdda; border-radius: 12px; color: var(--blue);
  cursor: pointer; font-size: 15px; margin-bottom: 10px; word-break: break-all;
}
.tl-pick:active { background: #eef1f6; }
.tl-date, .tl-caption {
  width: 100%; padding: 11px; font-size: 15px; margin-bottom: 10px;
  border: 1px solid #d7dde7; border-radius: 10px; font-family: inherit;
}
.tl-date:focus, .tl-caption:focus { outline: none; border-color: var(--blue); }
.tl-upload .btn { margin-top: 0; }
#tl-upload-btn:disabled { opacity: 0.55; }

/* 紧凑上传控件 */
.tl-addbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tl-add-btn {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 26px; line-height: 46px;
  text-align: center; cursor: pointer; user-select: none;
  box-shadow: 0 3px 10px rgba(224, 131, 97, 0.45);
}
.tl-add-btn:active { filter: brightness(0.95); }
.tl-pick-name { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-form { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.tl-form[hidden] { display: none; }
.tl-mini-input { padding: 9px 10px; font-size: 14px; border: 1px solid #d7dde7; border-radius: 9px; font-family: inherit; }
.tl-mini-date { flex: 0 0 auto; width: auto; }
.tl-form .tl-mini-input:not(.tl-mini-date) { flex: 1; min-width: 110px; }
.tl-mini-input:focus { outline: none; border-color: var(--blue); }
.tl-mini-btn { flex: 0 0 auto; padding: 9px 18px; font-size: 14px; border: none; border-radius: 9px; background: var(--blue); color: #fff; cursor: pointer; }
.tl-mini-btn:disabled { opacity: 0.6; }

/* 滚动日期气泡（浮层，不占位置） */
.tl-datebubble {
  position: fixed; top: 92px; left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: rgba(40, 40, 45, 0.82); color: #fff; font-size: 13px;
  padding: 6px 14px; border-radius: 999px; z-index: 50;
  pointer-events: none; opacity: 0; transition: opacity 0.2s, transform 0.2s;
}
.tl-datebubble.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 日记 ===== */
.diary-compose {
  background: #fdf6ec; border: 1px solid #f0e6d6; border-radius: 14px;
  padding: 14px; margin-bottom: 20px;
}
.diary-compose .question { margin-bottom: 10px; }
.diary-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.diary-add-hint { font-size: 13px; color: var(--muted); }
.diary-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.diary-thumb { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; }
.diary-thumb img, .diary-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.diary-thumb-x {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; line-height: 18px;
  border: none; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff; font-size: 15px; cursor: pointer;
}
.diary-compose .btn { margin-top: 0; }

.diary-entry {
  border: 1px solid #f0e6d6; border-radius: 14px; padding: 14px;
  margin-bottom: 16px; background: #fff;
}
.diary-text-show { font-size: 15.5px; line-height: 1.75; color: var(--ink); white-space: pre-wrap; word-break: break-word; margin: 8px 0; }
.diary-media { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.diary-media img, .diary-media video { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; background: #000; display: block; }

/* 日记评论 */
.diary-cmts { margin-top: 10px; padding-top: 8px; border-top: 1px solid #f3ead9; }
.diary-cmt { display: flex; align-items: baseline; gap: 6px; padding: 4px 0; font-size: 14px; line-height: 1.5; }
.diary-cmt-who { color: var(--blue); font-weight: 600; flex: none; }
.diary-cmt-text { color: var(--ink); word-break: break-word; min-width: 0; }
.diary-cmt-time { color: var(--muted); font-size: 11.5px; flex: none; margin-left: auto; padding-left: 8px; }
.diary-cmt-input { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.diary-cmt-input input {
  flex: 1; min-width: 0; border: 1px solid #eee2cd; border-radius: 999px;
  padding: 8px 14px; font-size: 16px; background: #fdfaf4; color: var(--ink); outline: none;
}
.diary-cmt-input input:focus { border-color: var(--blue); background: #fff; }
.diary-cmt-send {
  flex: none; border: none; border-radius: 999px; padding: 8px 16px;
  background: var(--blue); color: #fff; font-size: 14px; cursor: pointer;
}
.diary-cmt-send:disabled { opacity: 0.5; }

.tl-item {
  border: 1px solid #e6ebf3; border-radius: 14px; overflow: hidden;
  margin-bottom: 16px; background: #fff;
}
.tl-media { width: 100%; display: block; background: #000; max-height: 70vh; object-fit: contain; }
.tl-meta { font-size: 13px; color: var(--muted); padding: 10px 14px 0; }
.tl-caption-text { font-size: 15px; color: var(--ink); padding: 4px 14px 6px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.tl-actions { display: flex; gap: 16px; padding: 4px 14px 12px; }
.tl-del { color: var(--err); }
.tl-ai { color: var(--blue); font-weight: 600; }
.tl-ai:disabled { opacity: 0.6; }
.tl-edit { padding: 0 14px 14px; }
.tl-edit .tl-date, .tl-edit .tl-caption { margin-bottom: 8px; }
.tl-caption-area { resize: vertical; line-height: 1.6; }
.tl-ai-tip { font-size: 13px; color: var(--blue); background: #fdf1ea; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; line-height: 1.5; }

/* ===== 相册式视图（年/月/全部）===== */
#tl-list { padding-bottom: 84px; } /* 给底部浮条留位 */
.tl-month-head { font-size: 20px; font-weight: 800; color: var(--ink); margin: 18px 2px 10px; letter-spacing: 0.5px; }
.tl-month-head:first-child { margin-top: 4px; }

.tl-hero, .tl-cell { position: relative; overflow: hidden; background: #000; cursor: pointer; }
.tl-hero { width: 100%; border-radius: 14px; margin-bottom: 4px; }
.tl-hero .tl-thumb-media { width: 100%; max-height: 60vh; aspect-ratio: 4/3; object-fit: cover; display: block; }
.tl-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 4px; }
.tl-gridall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.tl-cell { border-radius: 8px; }
.tl-cell .tl-thumb-media { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.tl-gridall .tl-cell { border-radius: 4px; }

.tl-broken-msg {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 4px;
  align-items: center; justify-content: center; text-align: center;
  color: #cbd5e1; font-size: 12px; line-height: 1.4; background: #000; cursor: pointer; padding: 6px;
}
.tl-broken-msg .tl-retry { color: #fbbf24; font-weight: 700; text-decoration: underline; }

.tl-overlay {
  position: absolute; left: 8px; top: 7px; color: #fff; font-size: 14px; font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.55); pointer-events: none;
}
.tl-hero .tl-overlay { font-size: 17px; }
.tl-play {
  position: absolute; right: 7px; bottom: 6px; width: 22px; height: 22px; line-height: 22px;
  text-align: center; font-size: 11px; color: #fff; background: rgba(0,0,0,0.45);
  border-radius: 50%; pointer-events: none;
}

/* 底部浮动切换条（仅时间线页显示：父级隐藏时 fixed 子元素也随之消失）*/
.tl-modebar {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 60;
  display: flex; gap: 2px; padding: 4px;
  background: rgba(253, 247, 239, 0.92); backdrop-filter: blur(10px);
  border: 1px solid #efe3d4; border-radius: 999px; box-shadow: 0 6px 22px rgba(120, 80, 50, 0.22);
}
.tl-modebar button {
  border: none; background: transparent; color: var(--muted);
  font-size: 15px; padding: 8px 20px; border-radius: 999px; cursor: pointer; font-family: inherit;
}
.tl-modebar button.active { background: var(--blue); color: #fff; font-weight: 700; }

/* ===== 大图查看 lightbox ===== */
body.tl-lb-open { overflow: hidden; }
.tl-lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(20, 16, 14, 0.92);
  overflow-y: auto; overflow-x: hidden; display: flex; justify-content: center;
  -webkit-overflow-scrolling: touch;
}
.tl-lb-inner {
  width: 100%; max-width: 640px; padding: max(20px, env(safe-area-inset-top)) 14px 40px;
  position: relative; will-change: transform;
}
.tl-lb-close {
  position: sticky; top: 6px; float: right; width: 38px; height: 38px; line-height: 34px;
  border: none; border-radius: 50%; background: rgba(255,255,255,0.18); color: #fff;
  font-size: 26px; cursor: pointer; z-index: 2;
}
/* 三联滑动轨道 */
.tl-lb-viewport { width: 100%; overflow: hidden; clear: both; }
.tl-lb-track { display: flex; width: 300%; will-change: transform; }
.tl-lb-slide { flex: 0 0 33.3333%; width: 33.3333%; display: flex; align-items: center; justify-content: center; }
.tl-lb-media { width: 100%; max-height: 72vh; object-fit: contain; border-radius: 12px; background: #000; display: block; }
.tl-lb-errtip { color: #fff; font-size: 14px; line-height: 1.6; text-align: center; padding: 30px 16px; }
.tl-lb-meta { color: #e8ddd4; font-size: 13px; margin: 12px 2px 0; }
.tl-lb-caption { color: #fff; font-size: 15.5px; line-height: 1.7; margin: 8px 2px 0; white-space: pre-wrap; word-break: break-word; }
.tl-lb-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.tl-lb-actions .rec-toggle { background: rgba(255,255,255,0.14); color: #fff; }
.tl-lb-actions .tl-ai { color: #ffd9c7; }
.tl-lb-actions .tl-del { color: #ff9b8a; }
.tl-lb-inner .tl-edit { padding: 14px 0 0; }
.tl-lb-inner .tl-ai-tip { color: var(--ink); }
.tl-lb-inner .tl-date, .tl-lb-inner .tl-caption { background: #fff; }

/* ===== Code 板块（code-board）===== */
.job-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.job-badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; color: #fff; }
.job-pending { background: #9aa3b2; }
.job-running { background: #d99a2b; }
.job-done { background: #3a9d6b; }
.job-error { background: var(--err); }
.job-output {
  margin-top: 8px; padding: 10px 12px; background: #0f1620; color: #d6e2f0;
  border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; overflow-x: auto;
}
.job-output.clamp-6 { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== Code 会话 Recents ===== */
.code-sec-head { margin: 20px 0 8px; }
.code-session-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #eaf1f8; border: 1px solid #cfe0f0; color: var(--blue-dark);
  border-radius: 10px; padding: 8px 12px; margin: 4px 0 12px; font-size: 14px;
}
.code-banner-x { border: none; background: none; color: var(--blue-dark); font-size: 13px; cursor: pointer; text-decoration: underline; }
.sess-row {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: 1px solid #e6ebf3; background: #fff; border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
}
.sess-row:active { background: #f3f6fb; }
.sess-active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(69,104,143,0.15); }
.sess-main { flex: 1; min-width: 0; }
.sess-title { font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sess-cwd { font-size: 11.5px; color: #aab2bf; margin-top: 1px; font-family: ui-monospace, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Mac 在线状态 ===== */
.code-mac-status { font-size: 13px; padding: 8px 12px; border-radius: 10px; margin-bottom: 12px; line-height: 1.5; }
.mac-online { background: #e7f6ee; color: #2b7a4b; border: 1px solid #bfe6cf; }
.mac-offline, .mac-unknown { background: #fdeceb; color: #b3403a; border: 1px solid #f3cfcc; }

/* ===== 会话卡片 + 展开对话 ===== */
.sess-card { border: 1px solid #e6ebf3; background: #fff; border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.sess-card.sess-active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(69,104,143,0.15); }
.sess-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; }
.sess-head:active { background: #f3f6fb; }
.sess-cont-btn { flex: 0 0 auto; border: 1px solid var(--blue); background: #fff; color: var(--blue); font-size: 13px; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.sess-cont-btn:active { background: var(--blue); color: #fff; }
.sess-body { padding: 4px 12px 12px; border-top: 1px solid #eef0f4; max-height: 420px; overflow-y: auto; }
.turn { margin-top: 10px; }
.turn-role { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.turn-user .turn-role { color: var(--blue-dark); }
.turn-text { font-size: 13px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; word-break: break-word; background: #f7f9fc; border-radius: 8px; padding: 8px 10px; }
.turn-user .turn-text { background: #eaf1f8; }

/* ===== 账号保险箱 ===== */
.vault-gate { max-width: 360px; margin: 8px auto; }
.vault-gate .todo-text { width: 100%; }
.vault-bar { display: flex; gap: 10px; margin-bottom: 14px; }
.vault-add-btn { flex: 1; padding: 10px; border: none; border-radius: 12px; background: var(--blue); color: #fff; font-size: 15px; cursor: pointer; }
.vault-add-btn:active { background: var(--blue-dark); }
.vault-lock-btn { flex: 0 0 auto; padding: 10px 16px; border: 1px solid #d7dde7; border-radius: 12px; background: #fff; color: var(--muted); font-size: 14px; cursor: pointer; }
.vault-form-wrap { margin-bottom: 14px; }
.vault-form { background: #f7f9fc; border: 1px solid #e6ebf3; border-radius: 14px; padding: 14px; }
.vault-form .todo-text { width: 100%; }
.vault-card { border: 1px solid #e6ebf3; background: #fff; border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.vault-card-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; cursor: pointer; }
.vault-card-head:active { background: #f3f6fb; }
.vault-title { font-size: 15.5px; font-weight: 600; color: var(--ink); }
.vault-card-body { padding: 4px 14px 14px; border-top: 1px solid #eef0f4; }
.vault-field { margin-top: 10px; }
.vault-field-label { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.vault-field-val { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vault-field-text { font-size: 15px; color: var(--ink); word-break: break-all; font-family: ui-monospace, Menlo, monospace; }
.vault-mini { border: 1px solid var(--blue); background: #fff; color: var(--blue); font-size: 12px; padding: 3px 10px; border-radius: 999px; cursor: pointer; }
.vault-mini:active { background: var(--blue); color: #fff; }
.vault-actions { margin-top: 14px; display: flex; gap: 16px; }
.vault-del { color: var(--err) !important; }

/* lightbox 内容容器（支持左右切换/下拉退出） */
.tl-lb-content { display: flex; flex-direction: column; align-items: center; width: 100%; }

/* Code 二级菜单行末尾的 Mac 状态小圆点 */
.code-mac-dot { margin-left: auto; align-self: center; font-size: 12px; cursor: default; }

/* 项目执行情况 + 推送按钮 */
.proj-jobs { margin-top: 12px; }
.push-btn { width: 100%; padding: 11px; border: 1px solid var(--blue); background: #fff; color: var(--blue); border-radius: 12px; font-size: 14px; cursor: pointer; margin-bottom: 12px; }
.push-btn:active { background: var(--blue); color: #fff; }
.push-on { font-size: 13px; color: #2b7a4b; background: #e7f6ee; border: 1px solid #bfe6cf; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }

/* 二级菜单右侧：铃铛 + Mac 圆点 */
.code-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.code-mac-dot { margin-left: 0 !important; }
.code-bell { font-size: 14px; cursor: default; }

/* Code 执行附件 */
.code-attach-row { display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; }
.code-attach-hint { font-size: 13px; color: var(--muted); }
.code-attach-list { margin-bottom: 12px; }
.code-attach-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; background: #f3f6fb; border: 1px solid #e6ebf3; border-radius: 10px; margin-bottom: 6px; }
.code-attach-name { font-size: 13px; color: var(--ink); word-break: break-all; }
.code-attach-x { border: none; background: none; color: #c4cbd6; font-size: 18px; cursor: pointer; flex: 0 0 auto; }
.code-attach-x:active { color: var(--err); }

/* ＋ 与执行按钮同行（Code）*/
.code-attach-row { display: flex; align-items: center; gap: 10px; }
.code-attach-row .btn { flex: 1; width: auto; margin: 0; }
