/* ============================================================
   各页面的布局 —— 每一页都是同一本手账里的不同「页码」
   ============================================================ */

/* ---------- 登录 / 注册：一张摊开的封面 ---------- */
.auth-wrap {
  min-height: 100%;   /* 包它的 #app 已经是满高了；再写整屏 vh 在手机上会比可见区高一截 */
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 440px);
  align-items: center;
  gap: var(--gap-lg);
  padding: 40px clamp(18px, 5vw, 64px);
}

.auth-hero { position: relative; }
.auth-kicker {
  font-family: var(--font-brand);
  font-size: var(--fs-12);
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--accent);
}
.auth-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.28;
  margin: 10px 0 18px;
  letter-spacing: .01em;
}
.hero-svg { width: 100%; max-width: 560px; height: auto; display: block; }
.auth-points { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.auth-points li { display: flex; gap: 10px; align-items: center; color: var(--ink-soft); font-size: var(--fs-14); line-height: 1.6; }
.auth-points i { color: var(--accent); flex: none; }

.auth-card { position: relative; padding: 26px; border-radius: var(--r-irregular-2); background: var(--paper-2); box-shadow: var(--shadow-lift); }
.auth-card::before { content: ""; position: absolute; inset: 0; border: 1.8px solid var(--line); border-radius: inherit; filter: url(#squiggle); pointer-events: none; }
.auth-card h2 { font-family: var(--font-hand); font-size: var(--fs-20); margin: 0 0 2px; }
.auth-card .auth-sub { color: var(--ink-soft); font-size: var(--fs-13); margin-bottom: 18px; }
.auth-card .tabs { margin: -6px -6px var(--gap); }

/* 封面那张纸：给登录卡加一层淡横线 */
.paper { background-image: repeating-linear-gradient(to bottom, transparent 0 27px, color-mix(in srgb, var(--line-soft) 55%, transparent) 27px 28px); }

.tab {
  border: 0; background: none; cursor: pointer;
  padding: 9px 14px;
  color: var(--ink-soft);
  position: relative;
  font-size: var(--fs-14);
  font-family: inherit;
}
.tab:hover { color: var(--ink); }
.tab.is-active, .tab.is-on { color: var(--ink); font-family: var(--font-hand); font-size: var(--fs-16); }
.tab.is-active::after, .tab.is-on::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -2px; height: 3px;
  background: var(--accent); border-radius: 3px; filter: url(#squiggle);
}

.check { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; font-size: var(--fs-13); color: var(--ink-soft); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.auth-note {
  margin-top: 14px; padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--mustard-soft);
  font-size: var(--fs-13);
  color: color-mix(in srgb, var(--mustard) 62%, var(--ink));
  line-height: 1.6;
}
.auth-switch { margin-top: 16px; font-size: var(--fs-13); color: var(--ink-soft); text-align: center; }
.auth-hint {
  margin-top: 14px; padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--mustard-soft);
  font-size: var(--fs-13);
  color: color-mix(in srgb, var(--mustard) 65%, var(--ink));
}

@media (max-width: 980px) {
  .auth-wrap { grid-template-columns: 1fr; gap: var(--gap); padding: 26px 18px 40px; }
  .auth-hero { order: 1; }
  .auth-card { order: 2; }
}

/* ---------- 今日（首页） ---------- */
.today-hello {
  position: relative;
  padding: 18px 20px;
  border-radius: var(--r-irregular);
  background: linear-gradient(138deg, color-mix(in srgb, var(--accent-soft) 68%, var(--paper-2)), var(--paper-2) 72%);
  margin-bottom: var(--gap);
  overflow: hidden;
  box-shadow: var(--shadow-paper);
}
.today-hello::before { content: ""; position: absolute; inset: 0; border: 1.6px solid color-mix(in srgb, var(--accent) 55%, var(--line)); border-radius: inherit; pointer-events: none; }
.today-hello::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: inherit;
  pointer-events: none;
}
.today-hello .hello-line { font-family: var(--font-hand); font-size: var(--fs-20); line-height: 1.45; }
.today-hello .hello-sub { color: var(--ink-soft); font-size: var(--fs-14); margin-top: 4px; }
.today-hello .together { display: inline-flex; align-items: baseline; gap: 6px; margin-top: 8px; }
.today-hello .together b { font-family: var(--font-display); font-size: var(--fs-26); color: var(--accent); }
.today-hello .hello-postmark {
  position: absolute;
  right: 16px;
  bottom: 8px;
  color: var(--accent);
  opacity: .22;
  transform: rotate(-8deg);
  pointer-events: none;
}

.metric-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(144px, 1fr)); gap: var(--gap-sm); margin-bottom: var(--gap); }
.metric {
  position: relative;
  padding: 11px 13px;
  border-radius: 12px 15px 13px 11px / 14px 12px 15px 13px;
  background: var(--paper-2);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 1px 2px 0 rgba(51, 41, 31, .05);
  transition: transform var(--t-fast) var(--ease-spring), box-shadow var(--t-fast);
}
.metric::before { content: ""; position: absolute; inset: 0; border: 1.5px solid var(--line-soft); border-radius: inherit; pointer-events: none; }
.metric::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 0;
  width: 26px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--metric-tone, var(--accent));
  opacity: .75;
}
.metric:hover { transform: translateY(-2.5px) rotate(-.3deg); box-shadow: var(--shadow-paper); }
.metric:active { transform: scale(.97); }
.metric .metric-num { font-family: var(--font-display); font-size: var(--fs-26); line-height: 1.05; }
.metric .metric-label { font-size: var(--fs-12); color: var(--ink-soft); margin-top: 4px; display: flex; gap: 5px; align-items: center; }
.metric-label .metric-sub { color: var(--ink-faint); margin-left: auto; font-size: var(--fs-11); }
.metric--clay { --metric-tone: var(--clay); }
.metric--clay .metric-num { color: var(--clay); }
.metric--sage { --metric-tone: var(--sage); }
.metric--sage .metric-num { color: var(--sage); }
.metric--mustard { --metric-tone: var(--mustard); }
.metric--mustard .metric-num { color: color-mix(in srgb, var(--mustard) 75%, var(--ink)); }
.metric--sky { --metric-tone: var(--sky); }
.metric--sky .metric-num { color: var(--sky); }
.metric--plum { --metric-tone: var(--plum); }
.metric--plum .metric-num { color: var(--plum); }

.today-columns { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
@media (max-width: 1000px) { .today-columns { grid-template-columns: 1fr; } }

.panel {
  position: relative;
  padding: 14px 16px;
  border-radius: var(--r-irregular);
  background: var(--paper-2);
  box-shadow: var(--shadow-paper);
  contain: layout style;
}
.panel::before { content: ""; position: absolute; inset: 0; border: 1.5px solid var(--line); border-radius: inherit; pointer-events: none; }
.panel-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--line-soft);
}
.panel-head h3 { font-family: var(--font-hand); font-size: var(--fs-16); margin: 0; }
.panel-head .panel-more { margin-left: auto; font-size: var(--fs-12); color: var(--ink-faint); }

/* ---------- 笔记 ---------- */
.note-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.note-toolbar .note-search-box {
  flex: 1 1 220px;
  min-width: 180px;
}
.note-toolbar .note-seg {
  flex: 0 0 auto;
  padding: 3px;
  border-radius: 10px 13px 11px 12px / 12px 10px 13px 11px;
}
.note-toolbar .note-seg button {
  padding: 5.5px 12px;
  border-radius: 8px 10px 9px 9px;
  font-size: var(--fs-13);
  line-height: 1.35;
}
.note-toolbar .note-filter-select {
  width: auto;
  flex: 0 1 164px;
  min-width: 144px;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(256px, 1fr));
  gap: var(--gap);
  align-items: stretch;
}
.note-card {
  --sticky-bg: var(--paper-2);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 172px;
  padding: 16px 16px 13px;
  border: 0;
  border-radius: var(--r-irregular);
  box-shadow: var(--shadow-paper);
  transform: rotate(var(--tilt, 0deg));
}
.note-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--line);
  border-radius: inherit;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--paper-2) 82%, white);
  pointer-events: none;
  transition: border-color var(--t-fast);
}
.note-card:hover {
  transform: translateY(-4px) rotate(0deg);
  box-shadow: var(--shadow-lift);
}
.note-card:hover::before {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
}
.note-card.is-pinned {
  --sticky-bg: color-mix(in srgb, var(--mustard-soft) 42%, var(--paper-2));
}
.note-card.is-pinned::before {
  border-color: color-mix(in srgb, var(--mustard) 52%, var(--line));
}
.note-card.is-draft { opacity: .84; }
.note-card.is-draft::before { border-style: dashed; }

.note-card .note-title {
  margin: 0;
  font-family: var(--font-hand);
  font-size: var(--fs-18);
  font-weight: 600;
  line-height: 1.38;
  color: var(--ink);
  word-break: break-word;
}
.note-pin-mark {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: var(--fs-11);
  font-family: var(--font-hand);
  background: var(--mustard-soft);
  color: color-mix(in srgb, var(--mustard) 72%, var(--ink));
}
.note-card .note-snippet {
  margin: 0;
  font-size: var(--fs-14);
  color: var(--ink-soft);
  line-height: 1.62;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}
.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}
.note-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--fs-12);
  line-height: 1.35;
  background: var(--paper-3);
  color: var(--ink-soft);
  border: 1px solid var(--line-soft);
}
.note-tag-chip i {
  font-style: normal;
  color: var(--accent);
  opacity: .85;
}

.note-card .note-foot {
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px dashed var(--line-soft);
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
  font-size: var(--fs-12);
  color: var(--ink-faint);
}
.note-card .note-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-mood-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--fs-12);
  line-height: 1.35;
  white-space: nowrap;
  background: var(--paper-3);
  color: var(--ink-soft);
  border: 1px solid var(--line-soft);
}
.note-mood-pill--accent { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 26%, transparent); }
.note-mood-pill--sage { background: var(--sage-soft); color: var(--sage); border-color: color-mix(in srgb, var(--sage) 26%, transparent); }
.note-mood-pill--sky { background: var(--sky-soft); color: var(--sky); border-color: color-mix(in srgb, var(--sky) 26%, transparent); }
.note-mood-pill--mustard { background: var(--mustard-soft); color: color-mix(in srgb, var(--mustard) 72%, var(--ink)); border-color: color-mix(in srgb, var(--mustard) 32%, transparent); }
.note-mood-pill--plum { background: var(--plum-soft); color: var(--plum); border-color: color-mix(in srgb, var(--plum) 26%, transparent); }

.note-edit-btn {
  margin-left: auto;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
  color: var(--ink-soft);
}
.note-edit-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.note-detail .note-body { font-family: var(--font-hand); font-size: var(--fs-17); line-height: 1.82; white-space: pre-wrap; word-break: break-word; }
.note-detail .note-meta { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-bottom: 12px; font-size: var(--fs-13); color: var(--ink-soft); }

/* ---------- 待办 ---------- */
.task-row { align-items: center; }
.task-check {
  width: 23px; height: 23px; flex: none; cursor: pointer;
  border-radius: 50% 46% 52% 48% / 48% 52% 46% 52%;
  position: relative; background: var(--paper-2);
  transition: transform var(--t-fast) var(--ease-pop), background var(--t-fast);
}
.task-check:active { transform: scale(.86); }
.task-check::before { content: ""; position: absolute; inset: 0; border: 1.8px solid var(--line); border-radius: inherit; pointer-events: none; }
.task-check.is-done { background: var(--sage-soft); }
.task-check.is-done::before { border-color: var(--sage); }
.task-check.is-doing { background: var(--mustard-soft); }
.task-check .tick {
  position: absolute; left: 4px; top: 3px; width: 15px; height: 11px;
  border-left: 2.5px solid var(--sage); border-bottom: 2.5px solid var(--sage);
  border-radius: 2px; transform: rotate(-40deg);
}
.task-title { font-family: var(--font-hand); font-size: var(--fs-16); }
.task-meta { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; font-size: var(--fs-12); color: var(--ink-soft); margin-top: 3px; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.priority-1 { background: var(--sage); }
.priority-2 { background: var(--mustard); }
.priority-3 { background: var(--clay); }

/* ---------- 日历 ---------- */
.calendar-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 330px); gap: var(--gap); align-items: start; }
@media (max-width: 1000px) { .calendar-wrap { grid-template-columns: 1fr; } }
.calendar { position: relative; padding: 13px; border-radius: var(--r-irregular); background: var(--paper-2); box-shadow: var(--shadow-paper); }
.calendar::before { content: ""; position: absolute; inset: 0; border: 1.6px solid var(--line); border-radius: inherit; pointer-events: none; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-head .cal-title { font-family: var(--font-display); font-size: var(--fs-20); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: var(--fs-12); color: var(--ink-faint); padding: 4px 0; letter-spacing: .1em; }
.cal-day {
  position: relative; min-height: 68px; padding: 6px 7px;
  border-radius: 10px 12px 9px 13px;
  background: color-mix(in srgb, var(--paper-3) 55%, transparent);
  cursor: pointer; text-align: left; border: 0;
  transition: transform var(--t-fast) var(--ease-spring), background var(--t-fast);
}
.cal-day:hover { transform: translateY(-2px); background: var(--paper-3); }
.cal-day.is-out { opacity: .38; }
.cal-day.is-today { background: var(--highlight); }
.cal-day.is-selected { box-shadow: var(--shadow-paper), inset 0 0 0 1.5px var(--accent); }
.cal-day .cal-num { font-family: var(--font-hand); font-size: var(--fs-15); }
.cal-day .cal-dots { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 4px; }
.cal-day .cal-dots i { width: 6.5px; height: 6.5px; border-radius: 50%; }
.cal-day .cal-preview { font-size: var(--fs-12); color: var(--ink-soft); margin-top: 3px; line-height: 1.32; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.countdown-card { position: relative; padding: 13px 15px; border-radius: var(--r-irregular); background: var(--paper-2); overflow: hidden; box-shadow: var(--shadow-paper); }
.countdown-card::before { content: ""; position: absolute; inset: 0; border: 1.6px solid color-mix(in srgb, var(--accent) 55%, var(--line)); border-radius: inherit; pointer-events: none; }
.countdown-card .cd-num { font-family: var(--font-display); font-size: var(--fs-34); line-height: 1; color: var(--accent); }
.countdown-card .cd-label { font-size: var(--fs-14); }
.countdown-card .cd-date { font-size: var(--fs-12); color: var(--ink-faint); margin-top: 4px; }

/* ---------- 习惯 ---------- */
.habit-name { font-family: var(--font-hand); font-size: var(--fs-17); }
.habit-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 5px; }
.habit-day {
  aspect-ratio: 1; border-radius: 7px 8px 6px 9px;
  background: var(--paper-3); position: relative; cursor: pointer; border: 0;
  font-size: var(--fs-12); color: var(--ink-faint);
  transition: transform var(--t-fast) var(--ease-pop);
}
.habit-day.is-done { background: var(--sage); color: var(--paper-2); }
.habit-day.is-mine { background: var(--accent); }
.habit-day:hover { transform: scale(1.1); }
.habit-streak { display: flex; gap: 10px; flex-wrap: wrap; font-size: var(--fs-13); color: var(--ink-soft); }

/* ---------- 心情 ---------- */
.mood-picker { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.mood-face {
  width: 54px; height: 54px; border-radius: 50% 47% 53% 49%;
  border: 0; cursor: pointer; background: var(--paper-2);
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: transform var(--t-fast) var(--ease-pop);
}
.mood-face::before { content: ""; position: absolute; inset: 0; border: 1.7px solid var(--line); border-radius: inherit; pointer-events: none; }
.mood-face:hover { transform: translateY(-3px) rotate(-3deg); }
.mood-face.is-on { background: var(--plum-soft); }
.mood-face.is-on::before { border-color: var(--plum); border-width: 2.2px; }
.mood-today-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- 问答 ---------- */
.prompt-card { position: relative; padding: 18px; border-radius: var(--r-irregular-2); background: var(--paper-2); box-shadow: var(--shadow-paper); }
.prompt-card::before { content: ""; position: absolute; inset: 0; border: 1.7px solid color-mix(in srgb, var(--plum) 65%, var(--line)); border-radius: inherit; pointer-events: none; }
.prompt-composer { display: flex; flex-direction: column; gap: 10px; }
.prompt-answer-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.prompt-answer-field > span { color: var(--ink-soft); font-size: var(--fs-13); }
.prompt-answer-field .textarea { min-height: 96px; padding: 10px 12px; background-color: var(--paper); }
.prompt-composer-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.prompt-q { font-family: var(--font-hand); font-size: var(--fs-20); line-height: 1.48; }
.prompt-answer { font-family: var(--font-hand); font-size: var(--fs-15); line-height: 1.65; padding: 10px 12px; border-radius: var(--r-md); background: var(--paper-3); margin-top: 9px; }
.prompt-match {
  margin-top: 10px; padding: 9px 12px; border-radius: var(--r-md);
  background: var(--sage-soft); color: var(--sage); font-size: var(--fs-14); font-family: var(--font-hand);
}
.prompt-history-item { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 10px 0; border-top: 1.3px dashed var(--line-soft); }
.prompt-history-item:first-child { border-top: 0; }
.prompt-history-item .ph-date { font-size: var(--fs-13); color: var(--ink-faint); }

/* ---------- 说话：一面留言墙 ---------- */
.chat-wrap {
  display: flex; flex-direction: column; gap: 12px;
  width: 100%; max-width: 960px; margin-inline: auto;
  height: clamp(560px, calc(100dvh - 210px), 860px);
}
body[data-page="chat"] .page-head { max-width: 960px; margin-inline: auto; }

.chat-frame {
  position: relative; flex: 1 1 auto; min-height: 0;
  border-radius: var(--r-irregular);
  background: var(--paper-2);
  box-shadow: var(--shadow-paper);
  overflow: hidden;
}
/* 滚到最底时，最上面那条旧消息会被截掉半行；用一层纸色渐隐把断口收干净 */
.chat-frame::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 30px;
  z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, var(--paper-2) 35%, transparent);
}
/* 边框画在滚动容器外面：内容滚动时框不动，像一页真的纸 */
.chat-frame::before {
  content: ""; position: absolute; inset: 0; z-index: 2;
  border: 1.6px solid var(--line); border-radius: inherit;
  pointer-events: none;
}
.chat-scroll {
  height: 100%;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 20px 22px 14px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 16% 8%, color-mix(in srgb, var(--paper-3) 55%, transparent), transparent 42%),
    var(--paper-2);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ink-faint) 42%, transparent) transparent;
}
.chat-scroll::-webkit-scrollbar { width: 8px; }
.chat-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink-faint) 34%, transparent);
  border-radius: 999px;
}

.chat-body { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; }

.chat-day {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  margin: 12px 0 6px;
  padding: 6px 0 4px;
  color: var(--ink-faint);
  font-size: var(--fs-12); letter-spacing: .12em;
  background: linear-gradient(to bottom, var(--paper-2) 62%, transparent);
}
.chat-day:first-child { margin-top: 0; }
.chat-day span { padding: 3px 12px; border-radius: 999px; background: var(--paper-3); white-space: nowrap; }
.chat-day::after { content: ""; flex: 1; border-top: 1.4px dashed var(--line-soft); }

.chat-row { display: flex; gap: 10px; align-items: flex-start; max-width: min(80%, 680px); margin-top: 8px; }
.chat-row.is-mine { margin-left: auto; flex-direction: row-reverse; }
.chat-row.is-grouped { margin-top: 2px; }
.chat-row .avatar { --size: 30px; flex: 0 0 auto; }
.chat-avatar-spacer { width: 30px; flex: 0 0 30px; }

.chat-stack { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.chat-row.is-mine .chat-stack { align-items: flex-end; }
.chat-author { font-size: var(--fs-12); color: var(--ink-soft); margin: 0 0 4px 3px; font-family: var(--font-hand); }

.chat-bubble {
  position: relative; min-width: 0; max-width: 100%;
  padding: 10px 14px;
  border-radius: 16px 18px 18px 6px;
  background: var(--paper-3);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 5%, transparent);
}
.chat-row.is-grouped .chat-bubble { border-top-left-radius: 6px; }
.chat-row.is-mine .chat-bubble { border-radius: 18px 16px 6px 18px; background: var(--sky-soft); }
.chat-row.is-mine.is-grouped .chat-bubble { border-top-right-radius: 6px; }
.chat-text { font-size: var(--fs-15); line-height: 1.75; white-space: pre-wrap; word-break: break-word; text-wrap: pretty; }

.chat-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  margin-top: 6px; padding: 0 2px;
  font-size: var(--fs-12); color: var(--ink-faint);
}
.chat-row.is-mine .chat-meta { justify-content: flex-end; }
.chat-time { white-space: nowrap; }
.chat-edited { opacity: .7; }
.chat-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px;
  min-height: 24px;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
  background: var(--paper-2); color: var(--ink-soft);
  font-size: var(--fs-12); line-height: 1.4; cursor: pointer;
  box-shadow: 0 1px 0 rgba(51, 41, 31, .04);
  transition: transform var(--t-fast) var(--ease-hand), background var(--t-fast), border-color var(--t-fast);
}
.chat-pill:hover { transform: translateY(-1px); background: var(--paper-3); border-color: var(--line); }
.chat-pill b { font-weight: 600; }
.chat-pill--note { border-style: dashed; cursor: default; }
.chat-pill--comment .ico { display: inline-flex; }
.chat-more {
  border: 0; background: none; padding: 2px 4px; border-radius: 6px;
  color: var(--ink-faint); cursor: pointer; opacity: .5;
  transition: opacity var(--t-fast), background var(--t-fast);
}
.chat-more:hover, .chat-more:focus-visible { opacity: 1; background: var(--paper-2); }

.chat-earlier { display: flex; justify-content: center; padding: 0 0 8px; }
.chat-earlier-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  border: 1.4px solid var(--line-soft); background: var(--paper-2);
  color: var(--ink-soft); font: inherit; font-size: var(--fs-12);
  cursor: pointer;
}
.chat-earlier-btn .ico { transform: rotate(180deg); }
.chat-earlier-btn:hover { background: var(--paper-3); }

.chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 270px; text-align: center; color: var(--ink-soft); }
.chat-empty-art {
  display: grid; place-items: center; width: 64px; height: 64px;
  border-radius: 18px 21px 17px 22px;
  color: var(--accent); background: var(--paper-3);
  box-shadow: inset 0 0 0 1.4px var(--line-soft);
}
.chat-empty p { margin: 0; font-family: var(--font-hand); font-size: var(--fs-20); }
.chat-empty small { max-width: 320px; color: var(--ink-faint); line-height: 1.7; }

.chat-composer { position: relative; flex: 0 0 auto; display: flex; flex-direction: column; gap: 5px; }
.chat-composer--sticky {
  position: sticky; bottom: 0; z-index: 4;
  padding: 8px 0 4px;
  background: linear-gradient(to top, var(--paper) 68%, transparent);
}
.chat-composer-box {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 7px 7px 7px 14px;
  border-radius: 24px;
  border: 1.5px solid var(--line-soft);
  background: var(--paper-2);
  box-shadow: 0 8px 22px -18px rgba(51, 41, 31, .4);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.chat-composer-box:focus-within {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: 0 10px 24px -18px color-mix(in srgb, var(--accent) 30%, transparent);
}
.chat-composer .textarea {
  flex: 1; min-height: 40px; max-height: 132px;
  padding: 9px 0 7px;
  border: 0; border-radius: 0;
  background: transparent; box-shadow: none; resize: none;
  font-size: var(--fs-15); line-height: 1.65;
}
.chat-composer .textarea:focus { outline: none; box-shadow: none; }
.chat-send {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 16px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: var(--paper);
  font: inherit; font-size: var(--fs-14); font-weight: 600;
  cursor: pointer;
  box-shadow: 0 5px 14px -9px var(--accent);
  transition: transform var(--t-fast) var(--ease-hand), opacity var(--t-fast);
}
.chat-send:hover { transform: translateY(-1px); }
.chat-send:disabled { opacity: .75; cursor: default; transform: none; box-shadow: none; background: var(--paper-3); color: var(--ink-faint); }
.chat-composer-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 10px;
  color: var(--ink-faint); font-size: var(--fs-11);
}
.chat-kbd { letter-spacing: .02em; }
.chat-jump {
  position: absolute; top: -42px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  border: 1.4px solid var(--line-soft); background: var(--paper-2);
  color: var(--ink-soft); font: inherit; font-size: var(--fs-12);
  box-shadow: var(--shadow-paper); cursor: pointer;
}
.chat-jump[hidden] { display: none; }

/* ---------- 今日页里的那段小时间线（和「时光轴」页不是一套） ---------- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 4px; bottom: 4px;
  width: 2px; background: var(--line);
}
.mini-tl { position: relative; margin-bottom: var(--gap-sm); }
.mini-tl::before {
  content: ""; position: absolute; left: -21px; top: 14px;
  width: 10px; height: 10px; border-radius: 50% 46% 54% 50%;
  background: var(--paper-2); box-shadow: 0 0 0 1.8px var(--tl-color, var(--line));
}
.mini-tl .tl-card { cursor: pointer; }
.mini-tl .tl-card:hover { transform: translateY(-2px); }
.mini-tl-type { font-size: var(--fs-12); color: var(--tl-color, var(--ink-soft)); letter-spacing: .08em; }

/* ---------- 通知 ---------- */
.notif-row { align-items: center; }
.notif-row.is-unread { background: color-mix(in srgb, var(--highlight) 40%, var(--paper-2)); }
.notif-row .notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.notif-row .notif-dot.is-read { background: var(--line); }

/* ---------- 回收站 ---------- */
.trash-row { opacity: .86; }
.trash-row .row-title { text-decoration: line-through; color: var(--ink-faint); }

/* ---------- 设置 / 个人资料 ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: var(--gap); align-items: start; }
.swatch-row { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50% 47% 53% 49%; border: 0; cursor: pointer; position: relative; transition: transform var(--t-fast) var(--ease-pop); }
.swatch:hover { transform: scale(1.08); }
.swatch::before { content: ""; position: absolute; inset: 0; border: 1.8px solid var(--line); border-radius: inherit; pointer-events: none; }
.swatch.is-on { box-shadow: 0 0 0 3px var(--paper-2), 0 0 0 5px var(--ink); }

/* ---------- 空间 / 成员 ---------- */
.member-row { align-items: center; }
.role-tag { font-size: var(--fs-12); padding: 2px 8px; border-radius: 999px; background: var(--paper-3); color: var(--ink-soft); }
.invite-code {
  font-family: var(--font-display);
  font-size: var(--fs-26);
  letter-spacing: .3em;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--mustard-soft);
  color: color-mix(in srgb, var(--mustard) 60%, var(--ink));
  text-align: center;
  position: relative;
}
.invite-code::before { content: ""; position: absolute; inset: 0; border: 1.8px dashed var(--mustard); border-radius: inherit; pointer-events: none; }

/* ============================================
   笔记详情页（正文页）
   ============================================ */
.grow { flex: 1 1 auto; }

.note-head { display: flex; align-items: flex-start; gap: 8px; }
.note-head .note-title { flex: 1; min-width: 0; }

.chip--sm { padding: 2px 9px; font-size: var(--fs-12); }
.chip button { border: 0; background: none; cursor: pointer; color: inherit; opacity: .6; font-size: 1em; padding: 0 0 0 2px; }
.chip button:hover { opacity: 1; }
.tag-x { opacity: .65; margin-left: 2px; font-weight: 700; }
button.chip:hover .tag-x { opacity: 1; }

.note-detail-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.note-detail-acts {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.note-detail {
  position: relative;
  background: var(--paper-2);
  border-radius: var(--r-irregular);
  padding: 24px 26px 22px;
  box-shadow: var(--shadow-paper);
}
.note-detail::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.6px solid var(--line);
  border-radius: inherit;
  pointer-events: none;
}
.detail-head {
  padding-bottom: 12px;
  border-bottom: 1.5px dashed var(--line-soft);
  margin-bottom: 14px;
}
.detail-title {
  width: 100%;
  border: 0;
  background: none;
  font-family: var(--font-hand);
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  padding: 2px 0 6px;
}
.detail-title:focus { outline: none; box-shadow: 0 2px 0 0 var(--accent); }
.detail-byline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: var(--fs-13);
  color: var(--ink-soft);
}

.note-meta-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line-soft);
}
.note-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.note-meta-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-12);
  color: var(--ink-faint);
  letter-spacing: .04em;
}
.note-mood-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.note-mood-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1.3px solid var(--line-soft);
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: var(--fs-12);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-spring), background var(--t-fast), border-color var(--t-fast);
}
.note-mood-btn:hover {
  transform: translateY(-1px);
  background: var(--paper-2);
  border-color: var(--line);
}
.note-mood-btn.is-on {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.note-editor {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.editor-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.editor-bar .segmented {
  width: auto;
  flex: 0 0 auto;
}
.editor-bar .segmented button {
  flex: 0 0 auto;
  white-space: nowrap;
}
.editor-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.editor-bar .btn.is-on { background: var(--paper-deep); border-color: var(--ink-soft); }
.editor-bar #save { margin-left: auto; flex: 0 0 auto; white-space: nowrap; }
.save-hint { display: none; font-size: var(--fs-12); color: var(--clay); white-space: nowrap; }
.save-hint.is-on { display: inline-flex; align-items: center; }

.comment-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.comment-form .textarea {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  max-height: 140px;
  padding: 8px 12px;
  resize: vertical;
  line-height: 1.5;
}
.comment-form .btn {
  flex: 0 0 auto;
  min-height: 40px;
  white-space: nowrap;
}

.editor-area {
  width: 100%;
  min-height: 320px;
  border: 0;
  border-radius: var(--r-sm);
  resize: vertical;
  background-color: color-mix(in srgb, var(--paper) 45%, var(--paper-2));
  background-image: repeating-linear-gradient(
    transparent,
    transparent 30px,
    color-mix(in srgb, var(--line-soft) 68%, transparent) 30px,
    color-mix(in srgb, var(--line-soft) 68%, transparent) 31px
  );
  background-attachment: local;
  font-family: var(--font-hand);
  font-size: var(--fs-17);
  line-height: 31px;
  color: var(--ink);
  padding: 4px 10px 10px;
}
.editor-area:focus {
  outline: none;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, var(--line));
}

.note-social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
  align-items: start;
}

.markdown-body { font-size: var(--fs-17); line-height: 1.85; color: var(--ink); }
.markdown-body h2 { font-size: 22px; margin: 14px 0 6px; }
.markdown-body h3 { font-size: 19px; margin: 12px 0 5px; }
.markdown-body h4, .markdown-body h5 { font-size: var(--fs-17); margin: 10px 0 4px; }
.markdown-body p { margin: 0 0 10px; }
.markdown-body ul, .markdown-body ol { margin: 0 0 12px; padding-left: 22px; }
.markdown-body li { margin: 3px 0; }
.markdown-body blockquote {
  margin: 10px 0; padding: 8px 14px;
  border-left: 3px solid var(--accent);
  background: var(--paper-deep);
  font-family: var(--font-hand);
  color: var(--ink-soft);
}
.markdown-body code {
  font-family: var(--font-ui); font-size: .92em;
  background: var(--paper-deep); padding: 1px 6px; border-radius: 6px;
  border: 1.4px solid var(--line);
}
.markdown-body hr { border: 0; border-top: 1.8px dashed var(--line); margin: 14px 0; }
.markdown-body a { color: var(--accent-deep); text-decoration: underline; text-decoration-style: wavy; text-underline-offset: 3px; }
.md-task { list-style: none; margin-left: -18px; }
.md-task::before { content: '☐'; margin-right: 8px; color: var(--ink-faint); }
.md-task.is-done::before { content: '☑'; color: var(--sage-deep); }
.md-task.is-done { text-decoration: line-through; color: var(--ink-faint); }
