/* Notely — 精致暖白/深邃暗色双主题 UI 样式表
   设计语言：温润纸感底色 + 细腻层次浮起卡片 + 珊瑚橙灵动强调 + 丝滑弹簧微交互 */
:root {
  --bg: #f9f8f5;
  --bg-subtle: #f3f1ec;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --ink: #2f2b26;
  --ink-strong: #181512;
  --muted: #8c857b;
  --faint: #bcb6ad;
  --line: rgba(24, 21, 18, 0.075);
  --line-strong: rgba(24, 21, 18, 0.13);
  --accent: #f9632c;
  --accent-deep: #dc4c18;
  --accent-light: #ff8c5a;
  --ok: #16a34a;
  --danger: #dc2626;
  --tint: #fff1eb;
  --tint-hover: #ffe6dc;
  --tint-quote: #fff7f3;
  --focus-ring: rgba(249, 99, 44, 0.18);
  --shadow-xs: 0 1px 2px rgba(24, 21, 18, 0.03);
  --shadow-card: 0 1px 3px rgba(24, 21, 18, 0.04), 0 4px 14px -2px rgba(24, 21, 18, 0.045);
  --shadow-hover: 0 4px 12px rgba(24, 21, 18, 0.06), 0 10px 24px -4px rgba(24, 21, 18, 0.06);
  --shadow-float: 0 8px 28px -4px rgba(24, 21, 18, 0.14), 0 2px 6px rgba(24, 21, 18, 0.06);
  --shadow-primary: 0 4px 14px -3px rgba(249, 99, 44, 0.48), 0 1px 3px rgba(249, 99, 44, 0.25);
  --shadow-primary-hover: 0 6px 20px -3px rgba(249, 99, 44, 0.62), 0 2px 6px rgba(249, 99, 44, 0.3);
  --r-xl: 20px;
  --r-lg: 16px;
  --r-md: 11px;
  --r-sm: 8px;
  --r-pill: 999px;
  --hover-bg: rgba(24, 21, 18, 0.045);
  --cnt-bg: rgba(102, 92, 82, 0.085);
  --shimmer-a: rgba(24, 21, 18, 0.05);
  --shimmer-b: rgba(24, 21, 18, 0.11);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

:root[data-theme="dark"] {
  --bg: #14120e;
  --bg-subtle: #1b1813;
  --surface: #1f1c17;
  --surface-elevated: #27231d;
  --ink: #e8e2d7;
  --ink-strong: #f7f3eb;
  --muted: #968e82;
  --faint: #635c52;
  --line: rgba(235, 228, 216, 0.085);
  --line-strong: rgba(235, 228, 216, 0.15);
  --accent: #ff7847;
  --accent-deep: #ff946b;
  --accent-light: #ffa37e;
  --ok: #22c55e;
  --danger: #f87171;
  --tint: rgba(255, 120, 71, 0.15);
  --tint-hover: rgba(255, 120, 71, 0.22);
  --tint-quote: rgba(255, 120, 71, 0.08);
  --focus-ring: rgba(255, 120, 71, 0.24);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.28), 0 6px 18px -2px rgba(0, 0, 0, 0.32);
  --shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.38), 0 12px 28px -4px rgba(0, 0, 0, 0.42);
  --shadow-float: 0 12px 34px -4px rgba(0, 0, 0, 0.55), 0 4px 10px rgba(0, 0, 0, 0.35);
  --shadow-primary: 0 4px 16px -3px rgba(255, 120, 71, 0.45);
  --shadow-primary-hover: 0 6px 22px -2px rgba(255, 120, 71, 0.6);
  --hover-bg: rgba(255, 255, 255, 0.055);
  --cnt-bg: rgba(255, 255, 255, 0.09);
  --shimmer-a: rgba(255, 255, 255, 0.05);
  --shimmer-b: rgba(255, 255, 255, 0.12);
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.7 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro SC", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", "Microsoft YaHei", ui-sans-serif, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color .28s var(--ease), color .28s var(--ease);
}
* { -webkit-tap-highlight-color: transparent; }
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
body.no-scroll { overflow: hidden; }
button, input, textarea, select {
  font: inherit;
  color: inherit;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), box-shadow .2s var(--ease), transform .16s var(--ease), opacity .18s var(--ease);
}
svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
::selection { background: var(--tint); color: var(--accent-deep); }

/* ---------- 全局动画帧 ---------- */
@keyframes app-spin {
  to { transform: rotate(360deg); }
}
@keyframes pop {
  0% { transform: translateY(6px) scale(0.985); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes view-in {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes sheet-in {
  0% { opacity: 0; transform: translateY(14px) scale(0.975); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes sheet-up {
  0% { transform: translateY(100%); }
  100% { transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes sk-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: .85; }
  50% { transform: scale(1.06); opacity: 1; }
}

/* ---------- 初始全屏加载动画 ---------- */
#app.loading {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
#app.loading::before {
  content: "";
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid var(--tint);
  border-top-color: var(--accent);
  animation: app-spin .75s linear infinite;
}
#app.loading::after {
  content: "Notely 正在加载…";
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .5px;
}

/* ---------- 通用加载组件（Spinner & 状态块） ---------- */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.2px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: app-spin .7s linear infinite;
  flex: none;
}
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 16px;
  color: var(--muted);
  font-size: 13.5px;
  animation: fade-in .2s var(--ease);
}
.btn.is-busy {
  position: relative;
  pointer-events: none;
  opacity: .78;
}
.btn.is-busy::after {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-inline-start: 6px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: app-spin .65s linear infinite;
  vertical-align: -2px;
}

/* ---------- 通用表单输入控件美化 ---------- */
input:not([type="checkbox"]):not([type="file"]),
textarea,
select {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 13px;
  outline: none;
}
input:not([type="checkbox"]):not([type="file"]):hover,
textarea:hover,
select:hover {
  border-color: var(--line-strong);
  border-color: color-mix(in srgb, var(--line-strong) 70%, var(--accent));
}
input:not([type="checkbox"]):not([type="file"]):focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--focus-ring);
}
input::placeholder,
textarea::placeholder {
  color: var(--faint);
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238c857b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  border-radius: 4px;
  cursor: pointer;
}

/* ---------- auth 登录与初始化页 ---------- */
.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: radial-gradient(circle at 50% 22%, var(--tint) 0%, transparent 58%);
  animation: fade-in .35s var(--ease);
}
.brand-big {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 2px;
}
.brand-big svg {
  fill: none;
  stroke: none;
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 6px 14px rgba(234, 88, 12, 0.28));
  transition: transform .25s var(--ease-spring);
}
.brand-big:hover svg {
  transform: scale(1.05) rotate(-3deg);
}
.brand-big h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--ink-strong);
}
.tagline {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
}
.auth-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(390px, 92vw);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-hover);
  padding: 22px 22px 20px;
  animation: pop .28s var(--ease-out);
}
.auth-card input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 11px 14px;
  background: var(--bg);
  font-size: 16px;
}
.auth-card input:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--focus-ring);
}
.auth-card .btn.primary {
  width: 100%;
  justify-content: center;
  padding: 11px 22px;
  font-size: 15px;
  margin-inline-start: 0;
}
.auth-msg {
  width: 100%;
  display: none;
  font-size: 13px;
  text-align: center;
  padding: 6px 10px;
  border-radius: var(--r-sm);
}
.auth-msg.err {
  display: block;
  color: var(--danger);
  background: rgba(220, 38, 38, 0.08);
}
.auth-msg.ok {
  display: block;
  color: var(--ok);
  background: rgba(22, 163, 74, 0.08);
}
.foot-note { color: var(--muted); font-size: 12px; }

/* ---------- layout：36% 侧栏 + 62% 主区 ---------- */
.layout {
  display: grid;
  grid-template-columns: clamp(320px, 36%, 400px) minmax(0, 1fr);
  max-width: 1280px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
}
.rail {
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: var(--bg);
}
.rail::-webkit-scrollbar { display: none; width: 0; height: 0; }
/* 侧栏高度不足时禁止 flex 压缩子项，保证所有标签与区块完整展开显示 */
.rail > * { flex-shrink: 0; }

.brand-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18.5px;
  letter-spacing: -.3px;
  color: var(--ink-strong);
  padding: 0 8px 16px;
}
.brand-line svg {
  fill: none;
  stroke: none;
  align-self: center;
  filter: drop-shadow(0 2px 6px rgba(234, 88, 12, 0.25));
  width: 30px;
  height: 30px;
}
.rail-user {
  margin-inline-start: auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
}
.rail-user:hover {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}
.rail-user:active { transform: scale(0.94); }
.avatar-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ffb07c);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(249, 99, 44, 0.3);
}

/* nav：圆角选中底 + 指示条 + 行内计数徽标 */
#nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 4px;
}
.nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8.5px 12px;
  border: 0;
  background: none;
  border-radius: var(--r-md);
  color: var(--ink);
  cursor: pointer;
  font-size: 14.5px;
  text-align: start;
}
.nav-btn i { font-style: normal; }
.nav-btn svg {
  color: var(--muted);
  transition: transform .2s var(--ease-spring), color .18s var(--ease);
}
.nav-btn:hover {
  color: var(--ink-strong);
  background: var(--hover-bg);
}
.nav-btn:hover svg {
  color: var(--accent);
  transform: translateX(1.5px);
}
.nav-btn:active { transform: scale(0.985); }
.nav-btn.on {
  background: var(--tint);
  color: var(--accent-deep);
  font-weight: 600;
}
.nav-btn.on svg { color: var(--accent); }
.nav-btn.on::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 3.5px;
  border-radius: 4px;
  background: var(--accent);
}
.nav-btn .cnt {
  margin-inline-start: auto;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--cnt-bg);
  border-radius: var(--r-pill);
  padding: 1px 8.5px;
  font-variant-numeric: tabular-nums;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.nav-btn.on .cnt {
  background: rgba(249, 99, 44, 0.16);
  color: var(--accent-deep);
  font-weight: 600;
}
.nav-btn .cnt.zero { opacity: .45; }

/* 标签区：保持 overflow: visible 自然撑开，完整显示所有标签 */
.rail-sec {
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 2px;
  padding: 18px 12px 6px;
}
.rail-tags {
  flex: 1 0 auto;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  overflow: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.rail-tags::-webkit-scrollbar { display: none; width: 0; height: 0; }
.rtag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 4px 11px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  width: auto;
  text-align: start;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .16s var(--ease);
}
.rtag svg {
  width: .85em;
  height: .85em;
  color: var(--muted);
  transition: transform .18s var(--ease), color .18s var(--ease);
}
.rtag b {
  margin-inline-start: auto;
  font-weight: 400;
  font-size: 12px;
  color: var(--faint);
}
.rtag:hover {
  background: var(--tint-hover);
  border-color: var(--line-strong);
  color: var(--ink-strong);
}
.rtag:hover svg {
  color: var(--accent);
  transform: scale(1.08);
}
.rtag:active { transform: scale(0.985); }
.rtag { max-width: 100%; }
.rtag > span:not(.cnt) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtag.on {
  background: var(--tint);
  border-color: transparent;
  color: var(--accent-deep);
  font-weight: 600;
}
.rtag.on svg { color: var(--accent); }
.rtag .cnt {
  margin-inline-start: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: var(--cnt-bg);
  border-radius: var(--r-pill);
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
.rtag.on .cnt,
.rtag .cnt.hot {
  background: rgba(249, 99, 44, 0.16);
  color: var(--accent-deep);
  font-weight: 600;
}
.rtag .cnt.zero { opacity: .45; }

/* ---- 侧栏统计卡：四列指标 + 趋势/日历 seg + 月份条 ---- */
.st-card {
  margin: 0 0 12px;
  padding: 13px 14px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.st-card:hover {
  box-shadow: var(--shadow-hover);
}
.st-top { display: flex; align-items: center; gap: 6px; }
.st-top .st-stats { flex: 1; }
.st-fold {
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--r-sm);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.st-fold svg {
  width: 14px;
  height: 14px;
  transition: transform .22s var(--ease);
}
.st-fold:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--tint);
}
.st-fold:active { transform: scale(0.92); }
.st-card.folded .st-stats { margin-bottom: 0; }
.st-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.st-cell {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px;
  border-radius: var(--r-sm);
}
.st-cell b {
  display: block;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink-strong);
  letter-spacing: -.4px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.st-cell span { font-size: 11.5px; color: var(--muted); }
.st-date b.full, .st-date b.short {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--accent-deep);
  letter-spacing: 0;
  line-height: 1.2;
}
.st-date .short { display: none; }
.st-card .seg { margin-bottom: 10px; }

.st-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 42px;
  padding: 2px 0;
}
.st-bars i {
  flex: 1;
  min-width: 2px;
  border-radius: 3px 3px 1.5px 1.5px;
  background: linear-gradient(180deg, var(--accent) 0%, #ffa070 100%);
  opacity: .22;
  transition: height .28s var(--ease), opacity .18s var(--ease), transform .18s var(--ease);
}
.st-bars i.on { opacity: .92; }
.st-bars i.today {
  opacity: 1;
  box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 2.5px var(--accent);
  border-radius: 3px;
}
.st-bars i.sel {
  opacity: 1;
  box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 2.5px var(--accent-deep);
  border-radius: 3px;
  cursor: pointer;
}
.st-bars i:not(.off):hover {
  opacity: 1;
  transform: scaleY(1.06);
  cursor: pointer;
}

.st-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3.5px;
  padding: 2px 0;
}
.st-grid i {
  height: 21px;
  border-radius: 5px;
  background: var(--bg-subtle);
  position: relative;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: transform .15s var(--ease), background-color .18s var(--ease);
}
.st-grid i.st-wd { background: none; font-size: 10px; color: var(--faint); pointer-events: none; }
.st-grid i.l1 { background: #ffd8c2; color: #9c3b0b; font-weight: 600; }
.st-grid i.l2 { background: #ffa87a; color: #752904; font-weight: 700; }
.st-grid i.l3 { background: var(--accent); color: #fff; font-weight: 700; }
.st-grid i.off { opacity: .25; pointer-events: none; }
.st-grid i.today {
  outline: 1.5px solid var(--accent);
  outline-offset: 1px;
  border-radius: 5px;
}
.st-grid i.sel {
  outline: 1.5px solid var(--accent-deep);
  outline-offset: 1px;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 0 0 3px var(--tint);
}
.st-grid i:not(.st-wd):not(.off):hover {
  cursor: pointer;
  transform: scale(1.1);
  z-index: 1;
}
.st-month {
  text-align: end;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.st-year {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 2px 0 8px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.st-year b { color: var(--ink-strong); font-weight: 600; }
.st-year button {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--r-sm);
  width: 30px;
  height: 26px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.st-year button:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--tint);
}
.month-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-top: 9px;
}
.month-strip button {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--r-sm);
  padding: 5px 0;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
}
.month-strip button:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}
.month-strip button.on {
  background: var(--tint);
  border-color: rgba(249, 99, 44, 0.25);
  color: var(--accent-deep);
  font-weight: 600;
}

/* 侧栏底部 AI 快捷入口 */
.rail-ai {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 12px;
  margin-top: 6px;
  border-top: 1px solid var(--line);
}
.rail-ai .btn.wide {
  text-align: center;
  justify-content: center;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-deep);
  background: var(--tint);
  border: 1px solid rgba(249, 99, 44, 0.14);
  border-radius: var(--r-md);
}
.rail-ai .btn.wide:hover {
  background: var(--tint-hover);
  border-color: rgba(249, 99, 44, 0.32);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}
.rail-ai .btn.wide:active { transform: scale(0.97); }

/* ---------- topbar：标题 + 搜索框 + 快捷工具 ---------- */
.main {
  border-inline-start: 1px solid var(--line);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px 14px;
  border-bottom: 1px solid var(--line);
}
.crumb {
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: -.2px;
  color: var(--ink-strong);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.crumb::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--tint);
}
.menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-md);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.menu-btn:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}
.menu-btn:active { transform: scale(0.94); }

.top-tools {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 1px 10px;
  box-shadow: var(--shadow-xs);
  width: min(210px, 30vw);
  transition: width .24s var(--ease), border-color .18s var(--ease), box-shadow .2s var(--ease);
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--focus-ring);
  width: min(240px, 34vw);
}
.search svg {
  color: var(--muted);
  transition: color .18s var(--ease);
}
.search:focus-within svg { color: var(--accent); }
.search input {
  flex: 1;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  outline: none;
  min-width: 0;
  padding: 0;
  font-size: 13.5px;
}
.search input::placeholder { color: var(--faint); }

.expand, .theme-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--r-md);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  box-shadow: var(--shadow-xs);
}
.expand svg, .theme-btn svg {
  width: 16px;
  height: 16px;
  transition: transform .24s var(--ease-spring);
}
.expand:hover, .theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--tint);
  transform: translateY(-1px);
}
.theme-btn:hover svg { transform: rotate(18deg) scale(1.08); }
.expand:active, .theme-btn:active { transform: scale(0.93); }
.expand.on {
  color: var(--accent-deep);
  border-color: var(--accent);
  background: var(--tint);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.tagstrip {
  padding: 10px 26px 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tagstrip:empty { display: none; }
.tagstrip::-webkit-scrollbar { display: none; }

/* ---------- 内容区 & 卡片基础 ---------- */
#view {
  padding: 22px 26px 96px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}
#view > * {
  animation: view-in .22s var(--ease-out) both;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 22px;
  transition: box-shadow .22s var(--ease), border-color .22s var(--ease), transform .2s var(--ease);
}

/* ---------- 编辑器 composer：「此刻在想什么？记下来...」 ---------- */
.composer {
  border: 1px solid var(--line-strong);
  padding: 16px 20px 14px;
  position: relative;
}
.composer:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover), 0 0 0 3.5px var(--focus-ring);
}
.composer textarea {
  width: 100%;
  border: 0 !important;
  box-shadow: none !important;
  outline: none;
  background: none !important;
  resize: vertical;
  min-height: 60px;
  padding: 2px 0;
  font-size: 15.5px;
  line-height: 1.65;
}
.composer textarea::placeholder { color: var(--faint); }
.composer .row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.composer #c-meta:empty { display: none; margin-top: 0; }
.composer .row:last-child {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.tool {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  background: var(--bg);
  border-radius: var(--r-sm);
  color: var(--muted);
  cursor: pointer;
  transition: all .18s var(--ease);
}
.tool:hover {
  background: var(--tint);
  border-color: rgba(249, 99, 44, 0.2);
  color: var(--accent-deep);
  transform: translateY(-1px);
}
.tool:active { transform: scale(0.92); }

/* ---------- 按钮与徽标体系 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 7px 15px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink);
  box-shadow: var(--shadow-xs);
  user-select: none;
}
.btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--surface-elevated);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}
.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
}
.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.btn.mini {
  padding: 4px 10px;
  font-size: 12.5px;
  border-radius: var(--r-sm);
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.btn.ghost:hover:not(:disabled) {
  background: var(--tint);
  border-color: transparent;
  color: var(--accent-deep);
  box-shadow: none;
}
.btn.wide {
  width: 100%;
  text-align: start;
  border-radius: var(--r-md);
  padding: 7px 12px;
  font-size: 13.5px;
  background: none;
}
.btn.primary {
  margin-inline-start: auto;
  border: 0;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent) 0%, #ff8c52 100%);
  border-radius: var(--r-pill);
  padding: 8px 22px;
  box-shadow: var(--shadow-primary);
  display: inline-flex;
  gap: 7px;
  align-items: center;
}
.btn.primary:hover:not(:disabled) {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-deep) 0%, var(--accent) 100%);
  box-shadow: var(--shadow-primary-hover);
  transform: translateY(-1.5px);
}
.btn.primary:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: var(--tint);
  color: var(--accent-deep);
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid rgba(249, 99, 44, 0.15);
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
}
.chip:hover {
  background: var(--tint-hover);
  border-color: rgba(249, 99, 44, 0.3);
}
.chip.mute {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-weight: 400;
}
.chip.mute:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}
.chip .x { opacity: .65; font-size: 11px; margin-inline-start: 2px; }
.chip .cnt { font-size: 11px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.mute .cnt { color: var(--faint); }

.att-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px dashed var(--line-strong);
  background: var(--bg);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}
.att-chip:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--tint);
}
.c-hint {
  color: var(--faint);
  font-size: 11.5px;
  margin-inline-start: auto;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ---------- 日期分组 & 笔记卡 ---------- */
.memo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.memo-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.memo-group:first-child { margin-top: 2px; }
.day-sep {
  position: sticky;
  top: 75px;
  z-index: 4;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--bg);
  background: color-mix(in srgb, var(--surface) 85%, var(--bg));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  letter-spacing: .8px;
  font-variant-numeric: tabular-nums;
}
.day-sep::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.memo {
  padding: 18px 22px 15px;
  scroll-margin-top: 120px;
  position: relative;
}
.memo:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--line-strong);
}
.memo.pinned {
  border-color: rgba(249, 99, 44, 0.26);
  background: linear-gradient(180deg, var(--tint-quote) 0%, var(--surface) 46px);
}
.memo.group-top { margin-top: 4px; }
.memo.fresh { animation: pop .22s var(--ease-out); }

.memo-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  min-height: 28px;
}
.memo-time {
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.memo-time .place { color: var(--faint); }

.memo-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transform: translateY(-1px);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
  background: var(--bg);
  padding: 2px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}
.memo:hover .memo-actions,
.memo:focus-within .memo-actions {
  opacity: 1;
  transform: translateY(0);
}
.memo-actions button {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
}
.memo-actions button:hover {
  background: var(--tint);
  color: var(--accent-deep);
}
.memo-actions button[data-act="trash"]:hover,
.memo-actions button[data-act="hard"]:hover,
.memo-actions button[data-del]:hover {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}
.memo-actions .pin-on {
  color: var(--accent);
  background: var(--tint);
}

.memo-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink-strong);
  margin: 2px 0 6px;
  word-break: break-word;
  line-height: 1.48;
}
.memo-content {
  color: var(--ink);
  word-break: break-word;
  position: relative;
  line-height: 1.75;
}
.memo-content.collapsed {
  max-height: 200px;
  overflow: hidden;
}
.memo-content.collapsed::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 76px;
  background: linear-gradient(to bottom, transparent, var(--surface) 88%);
  pointer-events: none;
}
.memo-expand {
  position: absolute;
  bottom: 0;
  right: 12px;
  z-index: 2;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-deep);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}
.memo-expand:hover {
  background: var(--tint);
  transform: translateY(-1px);
}
.memo-content:not(.collapsed) .memo-expand { display: none; }

.memo-fab {
  position: sticky;
  bottom: 20px;
  right: 12px;
  margin-left: auto;
  display: block;
  width: fit-content;
  z-index: 999;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--r-pill);
  padding: 12px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-deep);
  box-shadow: var(--shadow-float);
  cursor: pointer;
  animation: pop .2s var(--ease-out);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}
.memo-fab:hover {
  background: var(--tint);
  transform: translateY(-2px);
}

.memo-content .bq {
  margin: 10px 0;
  padding: 10px 15px;
  background: var(--tint-quote);
  border-inline-start: 3.5px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--ink);
}
.memo-content ul {
  margin: 8px 0 8px 2px;
  padding-inline-start: 20px;
  list-style: none;
}
.memo-content li {
  position: relative;
  margin: 4px 0;
}
.memo-content li::before {
  content: "";
  position: absolute;
  inset-inline-start: -15px;
  top: .64em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.memo-content .htag {
  color: var(--accent-deep);
  background: var(--tint);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.92em;
  cursor: pointer;
  transition: background-color .15s var(--ease);
}
.memo-content .htag:hover {
  background: var(--tint-hover);
}

.memo-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.tpill {
  background: var(--tint);
  color: var(--accent-deep);
  border: 1px solid rgba(249, 99, 44, 0.14);
  border-radius: var(--r-pill);
  padding: 3px 11px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.tpill:hover {
  background: var(--tint-hover);
  border-color: rgba(249, 99, 44, 0.32);
  transform: translateY(-1px);
}

.memo-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  color: var(--faint);
  font-size: 12px;
}
.memo-foot .sep { flex: 1; }
.pinned-mark {
  color: var(--accent-deep);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.memo-atts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.memo-atts img {
  width: 100%;
  height: 118px;
  object-fit: cover;
  border-radius: var(--r-md);
  cursor: zoom-in;
  border: 1px solid var(--line);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.memo-atts img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-card);
}
.memo-atts audio { width: 100%; border-radius: var(--r-md); }

.memo-edit {
  margin-top: 4px;
  animation: fade-in .18s var(--ease);
}
.memo-edit textarea {
  width: 100%;
  min-height: 90px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 11px 14px;
  outline: none;
  resize: vertical;
  line-height: 1.65;
}
.memo-edit textarea:focus {
  background: var(--surface);
  border-color: var(--accent);
}
.ed-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.ed-tags input {
  flex: 0 1 180px;
  min-width: 0;
  border: 1px dashed var(--line-strong);
  background: var(--bg);
  border-radius: var(--r-pill);
  padding: 5px 13px;
  font-size: 12.5px;
  outline: none;
}
.ed-tags input:focus {
  border-style: solid;
  border-color: var(--accent);
  background: var(--surface);
}
.load-more {
  align-self: center;
  margin-top: 8px;
  padding: 8px 22px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
}
.empty {
  color: var(--faint);
  text-align: center;
  padding: 48px 0 24px;
  font-size: 13.5px;
}

/* ---------- 看板（顶部全宽新建栏 + 三列状态看板） ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.col {
  background: var(--bg-subtle);
  background: color-mix(in srgb, var(--bg-subtle) 75%, var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 12px;
  min-height: 260px;
  transition: border-color .18s var(--ease), background-color .18s var(--ease), box-shadow .18s var(--ease);
}
/* 顶部「＋ 新任务」输入栏横跨三列，保证下方待办/进行中/已完成三列整齐并排 */
.col[data-status="none"] {
  grid-column: 1 / -1;
  min-height: 0;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}
.col[data-status="none"] h3 {
  margin: 0;
  white-space: nowrap;
  color: var(--accent-deep);
  letter-spacing: 1px;
}
.col[data-status="none"] .row {
  flex: 1;
  margin-top: 0 !important;
}
.col[data-status="none"] input#nt {
  width: 100%;
  padding: 8px 13px !important;
  border-radius: var(--r-md) !important;
  background: var(--bg) !important;
}
.col[data-status="none"] input#nt:focus {
  background: var(--surface) !important;
}

.col:has(.col-canvas) {
  background: var(--surface);
  border: 1.5px dashed var(--faint);
}
.col h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 1.5px;
  margin: 2px 4px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.col h3 b {
  color: var(--muted);
  background: var(--cnt-bg);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  font-variant-numeric: tabular-nums;
}
.task {
  padding: 11px 12px;
  cursor: grab;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.task:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}
.task.dragging {
  opacity: .38;
  transform: scale(0.98);
}
.task + .task { margin-top: 9px; }
.task .t-head {
  display: flex;
  gap: 8px;
  align-items: center;
}
.task .t-title {
  flex: 1;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  user-select: none;
}
.task.done {
  opacity: .75;
  background: var(--bg);
}
.task.done .t-title {
  text-decoration: line-through;
  color: var(--muted);
}
.task .memo-actions {
  opacity: 0;
  margin-inline-start: 0;
  background: transparent;
  border: 0;
  padding: 0;
}
.task:hover .memo-actions { opacity: 1; }
.t-ck,
.task [data-ck] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px !important;
  background: var(--bg);
  cursor: pointer;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  padding: 0 !important;
  box-shadow: none;
}
.task [data-ck]:hover {
  border-color: var(--ok);
  color: var(--ok);
}
.t-drag {
  color: var(--faint);
  cursor: grab;
  touch-action: none;
  display: grid;
  place-items: center;
}
.task:hover .t-drag { color: var(--muted); }
.ghost-card {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  width: 220px;
  transform: rotate(2deg) scale(1.03);
  opacity: .96;
  box-shadow: var(--shadow-float);
  border-radius: var(--r-md);
  border-color: var(--accent);
}
.drop-line {
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  margin: 5px 2px;
  box-shadow: 0 0 8px rgba(249, 99, 44, 0.45);
}
.col.drop-hint {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  border-radius: var(--r-lg);
  background: var(--tint-quote);
}
.col-canvas { min-height: calc(100% - 34px); }
.col-tools { margin-top: 8px; }
.col-add {
  margin-top: 8px;
  width: 100%;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  text-align: start;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13px;
}
.col-add:hover { background: var(--tint); color: var(--accent-deep); }

.seg {
  display: flex;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px;
  gap: 2px;
}
.seg button {
  flex: 1;
  border: 0;
  background: none;
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.seg button:hover:not(.on) { color: var(--ink); }
.seg button.on {
  background: var(--surface);
  color: var(--accent-deep);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* ---------- 弹层/提示/查看器 ---------- */
.sheet-bg {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(20, 16, 12, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fade-in .18s var(--ease);
}
.sheet {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-float);
  width: min(590px, 96vw);
  max-height: 78vh;
  overflow: auto;
  padding: 24px;
  animation: sheet-in .24s var(--ease-out);
  scrollbar-width: none;
}
.sheet::-webkit-scrollbar { display: none; width: 0; height: 0; }
.sheet h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-strong);
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.sheet h2 svg { color: var(--accent); }
.sheet #f-ask {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.sheet .ask-input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 10px 18px;
  background: var(--bg);
  font-size: 16px;
}
.sheet .ask-input:focus {
  background: var(--surface);
  border-color: var(--accent);
}
.sheet .answer {
  white-space: pre-wrap;
  line-height: 1.8;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}
.sheet .muted { color: var(--muted); }
.sheet .ask-line { display: flex; gap: 8px; margin-bottom: 14px; }
.sheet .ask-line input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 9px 16px;
  background: var(--bg);
  outline: none;
}
.ref {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--r-md);
  padding: 10px 14px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
  word-break: break-all;
  overflow-wrap: break-word;
}
.ref:hover {
  border-color: var(--accent);
  background: var(--tint-quote);
}
.ref b { display: block; color: var(--ink); font-weight: 500; }
.stars { letter-spacing: 3px; color: var(--accent); }

#toasts {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 60;
  pointer-events: none;
}
.toast {
  background: var(--ink-strong);
  color: var(--surface);
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-float);
  animation: pop .2s var(--ease-spring);
  max-width: min(90vw, 360px);
  white-space: normal;
  word-break: break-word;
  line-height: 1.5;
  text-align: center;
  border-radius: 14px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(16, 12, 8, 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: fade-in .2s var(--ease);
}
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-float);
  animation: pop .22s var(--ease-out);
}
.lb-loading {
  color: #f5efe5;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

/* ---------- 设置页（我的） ---------- */
.me-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 2px 2px 6px;
}
.me-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-strong);
  margin: 0;
}
.me-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  grid-auto-rows: 1fr;
}
.stat {
  text-align: center;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}
.stat b {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink-strong);
  display: block;
  word-break: break-word;
  line-height: 1.2;
  letter-spacing: -.3px;
}
.stat span { color: var(--muted); font-size: 12.5px; }
.code {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 13px 16px;
  overflow: auto;
  line-height: 1.85;
  width: 100%;
  white-space: pre-wrap;
}
.me-card h3 { font-size: 14.5px; color: var(--ink-strong); margin-bottom: 8px; }
.me-card p { font-size: 13px; color: var(--muted); }

/* ============ 新视图页（每日回顾/随机漫步/记忆/项目） ============ */
.page-head { padding: 4px 2px 12px; }
.page-head h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink-strong);
  letter-spacing: -.3px;
}
.page-sub { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.empty-state {
  text-align: center;
  padding: 54px 24px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
}
.empty-state p { font-size: 15px; font-weight: 600; color: var(--ink); }
.empty-state .sub { font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 6px; }

/* 每日回顾：分组 + 卡片 */
.digest-group { margin-bottom: 20px; }
.digest-group h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-deep);
  padding: 0 2px 10px;
  letter-spacing: .4px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.digest-group h3::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* 随机漫步 */
.walk-card { max-width: 660px; }
.walk-card .walk-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-deep);
  background: var(--tint);
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-variant-numeric: tabular-nums;
}
.walk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 660px;
  margin-top: 12px;
}
.walk-actions .btn.primary { margin-inline-start: 0; }
.postcard {
  max-width: 580px;
  margin: 10px auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-hover);
  overflow: hidden;
  animation: pop .26s var(--ease-out);
}
.pc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 22px;
  font-size: 11.5px;
  letter-spacing: 2.2px;
  color: var(--accent-deep);
  background: linear-gradient(90deg, var(--tint) 0%, var(--tint-quote) 100%);
  border-bottom: 1px dashed rgba(249, 99, 44, 0.22);
  font-weight: 700;
}
.pc-body { padding: 26px 24px 20px; }
.pc-body h3 { font-size: 19.5px; font-weight: 800; color: var(--ink-strong); margin-bottom: 12px; }
.pc-line { font-size: 15px; color: var(--ink); line-height: 1.9; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.pc-tags span {
  background: var(--tint);
  color: var(--accent-deep);
  font-size: 12.5px;
  font-weight: 500;
  padding: 3px 11px;
  border-radius: var(--r-pill);
}
.pc-note {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-style: italic;
}
.pc-foot {
  display: flex;
  gap: 10px;
  padding: 0 24px 22px;
}
.pc-foot .btn.primary { margin-inline-start: 0; }

/* 记忆 */
.mem-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  background: var(--surface);
  padding: 8px 8px 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-card);
  transition: border-color .18s var(--ease), box-shadow .2s var(--ease);
}
.mem-bar:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover), 0 0 0 3.5px var(--focus-ring);
}
.mem-bar input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 4px 2px;
  outline: none;
}
.mem-filter { display: flex; gap: 8px; margin-bottom: 12px; }
.mem-filter .chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 5px 14px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}
.mem-filter .chip:not(.mute) {
  background: var(--tint);
  border-color: rgba(249, 99, 44, 0.25);
  color: var(--accent-deep);
  font-weight: 600;
}
.memory .memo-content { font-size: 15px; }

/* 项目 */
.proj-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.proj {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 7px 15px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.proj:hover {
  border-color: var(--accent);
  color: var(--ink-strong);
  transform: translateY(-1px);
}
.proj b {
  font-weight: 600;
  font-size: 11.5px;
  background: var(--cnt-bg);
  border-radius: var(--r-pill);
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
.proj em { font-style: normal; font-size: 11.5px; color: var(--faint); }
.proj.on {
  background: var(--tint);
  border-color: rgba(249, 99, 44, 0.28);
  color: var(--accent-deep);
  font-weight: 600;
}
.proj.on b { background: rgba(249, 99, 44, 0.18); color: var(--accent-deep); }

/* 矮屏（笔记本常见 768~820 高）：压缩侧栏固定内容，把空间让给标签区 */
@media (max-height: 820px) and (min-width: 761px) {
  .rail { padding-top: 12px; }
  .brand-line { padding-bottom: 10px; font-size: 16px; }
  .avatar-dot { width: 30px; height: 30px; font-size: 13px; }
  .nav-btn { padding: 5px 12px; font-size: 13.5px; }
  .rail-sec { padding: 12px 12px 6px; }
  .st-card { padding: 12px 14px 10px; }
  .st-stats b { font-size: 20px; }
  .st-date b.full, .st-date b.short { font-size: 14px; }
  .st-bars { height: 40px; }
  .rail-ai { padding-top: 10px; margin-top: 4px; }
}

/* ============ 手机适配（≤760px）：侧边栏抽屉式（汉堡呼出） ============ */
@media (max-width: 760px) {
  .st-date .full { display: none; }
  .st-date .short { display: block; }
  /* iOS Safari 输入聚焦自动放大：所有 input/textarea 移动端强制 ≥16px */
  input, textarea, select, button { font-size: 16px; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  .layout { grid-template-columns: 1fr; }
  .rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    width: min(80vw, 320px);
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    transform: translateX(-104%);
    transition: transform .28s var(--ease);
    background: var(--bg);
    border-inline-end: 1px solid var(--line);
    box-shadow: 12px 0 40px -12px rgba(24, 21, 18, 0.42);
    padding: 18px 14px 28px;
  }
  .rail.open { transform: translateX(0); }
  .rail-scrim {
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(20, 16, 12, 0.48);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .26s var(--ease);
  }
  .rail-scrim.show { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-flex; }

  .main { border: 0; }
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px 10px;
    position: sticky;
    top: 0;
  }
  .crumb {
    font-size: 16px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .top-tools { margin-inline-start: auto; order: 2; width: 100%; display: contents; }
  .search, .search:focus-within {
    order: 3;
    width: clamp(80px, 50%, 140px);
    padding: 0px 10px;
    gap: 4px;
  }
  .search input { font-size: 16px; line-height: 1.1; }
  .search input::placeholder { font-size: 13.5px; white-space: nowrap; }

  .tagstrip { display: flex !important; padding: 8px 14px 0; }

  #view { padding: 14px 14px 48px; gap: 12px; max-width: 100%; }
  .ai-fabs { display: flex !important; gap: 8px; }

  .composer textarea { min-height: 48px; font-size: 16px; }
  .composer textarea::placeholder { font-size: 14px; }
  .c-hint { display: none; }
  .card { padding: 15px 16px; border-radius: 14px; }
  .memo-actions { opacity: 1; transform: none; }
  .task .memo-actions, .task [data-del] { opacity: 1; }
  .board { grid-template-columns: 1fr; gap: 10px; }
  .col { min-height: 0; }
  .col[data-status="none"] { flex-direction: column; align-items: stretch; gap: 8px; }
  .col h3 b { display: inline; }
  .me-grid { grid-template-columns: 1fr 1fr; }
  .sheet-bg { align-items: center; padding: 16px; }
  .sheet {
    width: min(92vw, 560px);
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: var(--r-xl);
    padding: 22px 18px;
    animation: sheet-in .26s var(--ease-out);
  }
  .ghost-card { width: 62vw; }
}
@media (min-width: 761px) {
  .menu-btn, .rail-scrim { display: none !important; }
  .ai-fabs, #mob-tags { display: none !important; }
  .tagstrip { display: none !important; }
}

/* 浮动 AI 入口（仅手机） */
.ai-fabs { display: none; }
.ai-fabs button {
  border: 1px solid rgba(249, 99, 44, 0.22);
  background: var(--tint);
  box-shadow: var(--shadow-xs);
  border-radius: var(--r-pill);
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-deep);
  cursor: pointer;
}

/* ── 加载骨架屏（流光 Shimmer 动画：笔记列表 / 侧栏标签 / 统计卡） ── */
.sk-list { display: flex; flex-direction: column; gap: 12px; padding: 6px 0; }
.sk-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  box-shadow: var(--shadow-xs);
}
.sk-line, .sk-tag, .sk-stat {
  background: linear-gradient(90deg, var(--shimmer-a) 25%, var(--shimmer-b) 50%, var(--shimmer-a) 75%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.5s ease-in-out infinite;
}
.sk-line { height: 12px; border-radius: 6px; }
.sk-line.w30 { width: 30%; }
.sk-line.w40 { width: 40%; }
.sk-line.w50 { width: 50%; }
.sk-line.w70 { width: 70%; }
.sk-line.w90 { width: 90%; }
.sk-tag {
  display: inline-block;
  height: 28px;
  width: 84px;
  margin: 3px 6px 3px 0;
  border-radius: 14px;
}
.sk-tag.w2 { width: 62px; }
.sk-tag.w3 { width: 98px; }
.sk-stat {
  height: 112px;
  border-radius: var(--r-lg);
  margin-bottom: 12px;
}

/* ── 回收站操作条 + 危险按钮 ── */
.trash-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}
.btn.danger {
  border-color: rgba(220, 38, 38, 0.32);
  color: var(--danger);
  background: rgba(220, 38, 38, 0.06);
}
.btn.danger:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.14);
  border-color: var(--danger);
  color: var(--danger);
}
