:root {
  --bg: #f4f2ef;
  --bg-grad: linear-gradient(160deg, #fdf3ec 0%, #f4f2ef 45%, #edf2f5 100%);
  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #ffffff;
  --ink: #2d2a26;
  --ink-2: #6f6a63;
  --ink-3: #a39d94;
  --accent: #e8734a;
  --accent-soft: rgba(232, 115, 74, 0.12);
  --accent-2: #5b8a8f;
  --accent-2-soft: rgba(91, 138, 143, 0.12);
  --danger: #d9483b;
  --ok: #4a9a6d;
  --line: rgba(45, 42, 38, 0.08);
  --radius: 16px;
  --shadow: 0 8px 28px rgba(80, 60, 40, 0.08);
  --sidebar-w: 232px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* 线性图标基础样式（SVG，跟随文字颜色） */
svg.ic {
  width: 1.05em; height: 1.05em;
  vertical-align: -0.16em;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  background-image: var(--bg-grad);
  color: var(--ink);
  height: 100vh;
  overflow: hidden;
  display: flex;
}
/* 背景光影 */
body::before, body::after {
  content: ""; position: fixed; border-radius: 50%;
  filter: blur(90px); pointer-events: none; z-index: 0;
}
body::before { width: 460px; height: 460px; background: rgba(242, 163, 123, 0.22); top: -140px; right: -100px; }
body::after { width: 420px; height: 420px; background: rgba(91, 138, 143, 0.16); bottom: -160px; left: 140px; }
.sidebar, .main { z-index: 1; }

/* ============ 左侧边栏 ============ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--line);
  padding: 20px 14px 16px;
}
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 18px; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #f2a37b, #e8734a); display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 4px 12px rgba(232, 115, 74, 0.3); }
.logo .ic { width: 22px; height: 22px; stroke: #fff; }
.sb-brand h1 { font-size: 16px; font-weight: 800; letter-spacing: 0.3px; }
.sb-brand p { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.sb-nav { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.nav-btn {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  border: none; background: none; cursor: pointer;
  padding: 9px 11px; border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  font-family: inherit; text-align: left;
  transition: all 0.18s;
}
.nav-btn .ico {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  background: rgba(45, 42, 38, 0.055);
  display: grid; place-items: center;
  transition: all 0.18s;
}
.nav-btn .ico .ic { width: 17px; height: 17px; }
.nav-btn:hover { background: rgba(45, 42, 38, 0.045); color: var(--ink); }
.nav-btn:hover .ico { background: rgba(45, 42, 38, 0.09); }
.nav-btn.active { color: var(--accent); background: linear-gradient(135deg, rgba(232, 115, 74, 0.13), rgba(242, 163, 123, 0.08)); }
.nav-btn.active .ico { background: linear-gradient(135deg, #f2a37b, #e8734a); box-shadow: 0 4px 10px rgba(232, 115, 74, 0.28); }
.nav-btn.active .ico .ic { stroke: #fff; }
.nav-btn.active::before {
  content: ""; position: absolute; left: -14px; top: 24%; bottom: 24%;
  width: 3.5px; border-radius: 99px; background: var(--accent);
}

.sb-foot { margin-top: auto; padding: 10px 8px 0; }
.sb-clock { font-size: 12px; color: var(--ink-2); line-height: 1.7; padding-left: 6px; }
.sb-clock b { display: block; font-size: 21px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.sb-privacy {
  margin-top: 12px; font-size: 10.5px; color: var(--ink-3); line-height: 1.6;
  background: var(--accent-2-soft); border-radius: 10px; padding: 9px 11px;
}
.sb-privacy b { color: var(--accent-2); }
.sb-privacy .ic { width: 11px; height: 11px; stroke: var(--accent-2); vertical-align: -0.12em; }

/* ============ 主区域 ============ */
.main { flex: 1; min-width: 0; position: relative; }
.pages { position: absolute; inset: 0; }
.page {
  position: absolute; inset: 0;
  display: none;
  overflow-y: auto;
  padding: 26px 34px 30px;
  animation: fadeIn 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(45,42,38,0.18) transparent;
}
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.page-head h2 {
  font-size: 21px; font-weight: 800; letter-spacing: 0.3px;
  background: linear-gradient(120deg, var(--ink) 40%, #b06a45);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.page-head h2 .ic { width: 20px; height: 20px; vertical-align: -0.2em; stroke: var(--accent); }
.page-head .sub { font-size: 12.5px; color: var(--ink-3); }
.page-head .head-actions { margin-left: auto; display: flex; gap: 8px; align-self: center; }

/* 内容宽度 */
.wrap-narrow { max-width: 780px; margin: 0 auto; }
.wrap-wide { max-width: 1100px; margin: 0 auto; }

/* ===== 通用卡片 ===== */
.card {
  background: var(--card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(80, 60, 40, 0.12); }
.card h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 13px; display: flex; align-items: center; gap: 7px; }
.card h3 .ic { width: 15px; height: 15px; flex-shrink: 0; stroke: var(--accent); }
.card h3 .sub { font-size: 11px; font-weight: 400; color: var(--ink-3); margin-left: auto; }

.btn {
  border: none; border-radius: 11px;
  padding: 9px 18px;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  background: linear-gradient(135deg, #ef8350, #e8734a);
  color: #fff;
  box-shadow: 0 3px 10px rgba(232, 115, 74, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.05); box-shadow: 0 5px 16px rgba(232, 115, 74, 0.32); }
.btn:active { transform: scale(0.97); }
.btn.ghost { background: var(--accent-soft); color: var(--accent); }
.btn.teal { background: var(--accent-2); }
.btn.teal-ghost { background: var(--accent-2-soft); color: var(--accent-2); }
.btn.ghost, .btn.teal, .btn.teal-ghost, .btn.danger-ghost { box-shadow: none; }
.btn.ghost:hover, .btn.teal-ghost:hover, .btn.danger-ghost:hover { filter: none; box-shadow: 0 3px 10px rgba(80, 60, 40, 0.1); }
.btn.small { padding: 6px 13px; font-size: 12.5px; border-radius: 9px; }
.btn .ic { width: 13px; height: 13px; vertical-align: -0.15em; }
.btn.danger-ghost { background: rgba(217, 72, 59, 0.1); color: var(--danger); }
.btn.full { width: 100%; }

input[type="text"], input[type="time"], input[type="date"], input[type="datetime-local"],
input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 64px; }

.field { margin-bottom: 11px; }
.field label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 5px; font-weight: 600; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }

.tag {
  display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.tag.teal { background: var(--accent-2-soft); color: var(--accent-2); }
.tag.gray { background: rgba(45,42,38,0.06); color: var(--ink-2); }
.tag.red { background: rgba(217,72,59,0.1); color: var(--danger); }

.empty { text-align: center; color: var(--ink-3); font-size: 13px; padding: 24px 0; }

/* ============ 陪伴页（聊天） ============ */
#page-chat { display: none; flex-direction: column; padding: 0; overflow: hidden; }
#page-chat.active { display: flex; }
.chat-inner {
  width: 100%; max-width: 860px; margin: 0 auto;
  flex: 1; display: flex; flex-direction: column;
  min-height: 0; padding: 22px 34px 0;
}
.chat-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; padding: 0 0 10px;
}
.chat-toolbar-tip { font-size: 11px; color: var(--ink-3); }
.chat-toolbar-tip .ic { width: 11px; height: 11px; }
.ai-dot { font-size: 11px; font-weight: 600; }
.ai-dot::before {
  content: ""; display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; margin-right: 5px; vertical-align: 1px;
  background: var(--ink-3);
}
.ai-dot.ok { color: var(--ok); }
.ai-dot.ok::before { background: var(--ok); }
.ai-dot.off { color: var(--danger); }
.ai-dot.off::before { background: var(--danger); }

.care-banner {
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 12px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(232,115,74,0.14), rgba(242,163,123,0.1));
  border: 1px solid rgba(232, 115, 74, 0.2);
  font-size: 13px;
  line-height: 1.65;
  color: #8a4a2c;
}
.care-banner b { margin-right: 6px; }
.care-banner b .ic { width: 13px; height: 13px; stroke: currentColor; vertical-align: -0.12em; }
.care-banner.crisis {
  background: linear-gradient(135deg, rgba(217,72,59,0.12), rgba(217,72,59,0.06));
  border-color: rgba(217, 72, 59, 0.3);
  color: #8c2c22;
}
.quick-row { display: flex; gap: 8px; flex-shrink: 0; padding: 2px 0 12px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); cursor: pointer; font-family: inherit;
  background: rgba(255,255,255,0.8);
  color: var(--ink-2); font-size: 12.5px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: #fff; box-shadow: 0 3px 10px rgba(232, 115, 74, 0.12); }
.chip .ic { width: 13px; height: 13px; vertical-align: -0.15em; }
.chip:active { transform: scale(0.95); }

.chat-scroll {
  flex: 1; overflow-y: auto; min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(45,42,38,0.18) transparent;
  padding-bottom: 12px;
}
.chat-list { display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; max-width: 78%; }
.msg .avatar {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, #f2a37b, #e8734a);
  display: grid; place-items: center;
  position: relative;
}
.msg .avatar .ic { width: 18px; height: 18px; stroke: #fff; }
.msg .avatar::after {
  content: ""; position: absolute; right: -2px; bottom: -2px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #4a9a6d; border: 2px solid #fff;
}
.msg .bubble {
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px;
  padding: 11px 15px;
  font-size: 14px;
  line-height: 1.7;
  box-shadow: 0 2px 8px rgba(80, 60, 40, 0.05);
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble {
  background: linear-gradient(135deg, #e8734a, #e07b52);
  color: #fff; border: none;
  border-radius: 16px 4px 16px 16px;
}
.msg .time { font-size: 10.5px; color: var(--ink-3); align-self: flex-end; margin-bottom: 4px; white-space: nowrap; }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 70%, 100% { opacity: 0.25; } 35% { opacity: 1; } }

.chat-input-bar {
  flex-shrink: 0;
  display: flex; gap: 10px; align-items: flex-end;
  padding: 12px 0 18px;
}
.chat-input-bar textarea {
  flex: 1; min-height: 44px; max-height: 130px;
  border-radius: 14px; padding: 11px 14px;
  box-shadow: var(--shadow);
}
.send-btn {
  width: 44px; height: 44px; flex-shrink: 0;
  border: none; border-radius: 14px; cursor: pointer;
  background: linear-gradient(135deg, #f2a37b, #e8734a);
  color: #fff;
  box-shadow: 0 4px 12px rgba(232, 115, 74, 0.3);
  transition: transform 0.15s;
}
.send-btn .ic { width: 18px; height: 18px; stroke: #fff; }
.send-btn:hover { opacity: 0.92; }
.send-btn:active { transform: scale(0.92); }

/* ============ 心情页 ============ */
.mood-grid { display: grid; grid-template-columns: 5fr 4fr; gap: 16px; align-items: start; }
.mood-picker { display: flex; justify-content: space-between; gap: 8px; }
.mood-opt {
  flex: 1; border: 1.5px solid var(--line); border-radius: 14px;
  background: rgba(255,255,255,0.7); cursor: pointer; font-family: inherit;
  padding: 12px 2px 9px; text-align: center;
  transition: all 0.18s;
}
.mood-opt:hover { border-color: var(--accent); }
.mood-opt .e { font-size: 26px; display: block; }
.mood-opt .t { font-size: 11px; color: var(--ink-2); margin-top: 4px; display: block; }
.mood-opt.sel { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-3px); box-shadow: 0 6px 14px rgba(232,115,74,0.18); }

.mood-cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin-bottom: 7px; }
.mood-cal-head span { text-align: center; font-size: 10.5px; color: var(--ink-3); font-weight: 700; }
.mood-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.mood-cell {
  aspect-ratio: 1; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(45,42,38,0.04);
  color: var(--ink-3); font-size: 10.5px;
}
.mood-cell.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.mood-cell .e { font-size: 18px; }

.stat-row { display: flex; gap: 10px; }
.stat-box {
  flex: 1; text-align: center;
  background: rgba(255,255,255,0.6); border-radius: 14px; padding: 14px 4px;
}
.stat-box b { font-size: 22px; color: var(--accent); display: block; }
.stat-box span { font-size: 11.5px; color: var(--ink-2); }

/* ============ 日程页 ============ */
.seg { display: flex; background: rgba(45,42,38,0.05); border-radius: 12px; padding: 3px; width: fit-content; margin-bottom: 16px; }
.seg button {
  border: none; background: none; cursor: pointer; font-family: inherit;
  padding: 8px 22px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  border-radius: 10px; transition: all 0.18s;
}
.seg button.on { background: #fff; color: var(--accent); box-shadow: 0 2px 8px rgba(80,60,40,0.1); }
.segpane { display: none; }
.segpane.on { display: block; }

.plan-grid { display: grid; grid-template-columns: 5fr 6fr; gap: 16px; align-items: start; }

.course-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.course-head { font-size: 11px; color: var(--ink-2); text-align: center; padding: 4px 0 6px; font-weight: 700; }
.course-cell {
  min-height: 64px; border-radius: 10px; padding: 7px 8px;
  background: rgba(255,255,255,0.65); border: 1.5px dashed var(--line);
  font-size: 11px; line-height: 1.4; color: var(--ink-3); overflow: hidden;
  display: flex; flex-direction: column; gap: 2px;
}
.course-cell .cc-room { font-size: 10px; opacity: 0.85; }
.course-cell.filled {
  border: none; color: #fff; font-weight: 600; font-size: 12px;
  background: linear-gradient(135deg, #f2a37b, #e8734a);
}
.course-cell.filled.alt { background: linear-gradient(135deg, #7fb0b5, #5b8a8f); }

.ddl-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.ddl-item:last-child { border-bottom: none; }
.ddl-check {
  width: 21px; height: 21px; border-radius: 7px; flex-shrink: 0;
  border: 1.5px solid var(--ink-3); cursor: pointer;
  display: grid; place-items: center; font-size: 12px; color: #fff;
  transition: all 0.15s;
}
.ddl-check:hover { border-color: var(--ok); }
.ddl-item.done .ddl-check { background: var(--ok); border-color: var(--ok); }
.ddl-item .ddl-main { flex: 1; min-width: 0; }
.ddl-item .ddl-title { font-size: 14px; font-weight: 600; }
.ddl-item.done .ddl-title { text-decoration: line-through; color: var(--ink-3); font-weight: 400; }
.ddl-item .ddl-meta { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
.ddl-item .ddl-meta.urgent { color: var(--danger); font-weight: 700; }
.del-x { border: none; background: none; color: var(--ink-3); cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.del-x:hover { color: var(--danger); background: rgba(217,72,59,0.08); }

/* 番茄钟 */
.pomo-wrap { display: flex; flex-direction: column; align-items: center; padding: 12px 0 6px; }
.pomo-ring { position: relative; width: 210px; height: 210px; }
.pomo-ring svg { transform: rotate(-90deg); }
.pomo-ring .pomo-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.pomo-center b { font-size: 42px; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.pomo-center span { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.pomo-btns { display: flex; gap: 10px; margin-top: 18px; }
.pomo-state { margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }

/* ============ 发现页 ============ */
.discover-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 16px; align-items: start; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  width: 100%; border: none; background: none; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: 9px;
  padding: 13px 2px; font-size: 13.5px; font-weight: 600; color: var(--ink);
  text-align: left;
}
.faq-q .arrow { margin-left: auto; color: var(--ink-3); transition: transform 0.2s; font-size: 11px; }
.faq-item.open .arrow { transform: rotate(90deg); }
.faq-a { display: none; font-size: 13px; color: var(--ink-2); line-height: 1.75; padding: 0 2px 14px; }
.faq-item.open .faq-a { display: block; }

.remind-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}
.remind-item:last-child { border-bottom: none; }
.remind-item .r-time {
  font-size: 15px; font-weight: 800; color: var(--accent-2);
  font-variant-numeric: tabular-nums; width: 52px; flex-shrink: 0;
}
.remind-item .r-title { flex: 1; font-size: 13.5px; font-weight: 600; }
.remind-item.off .r-title, .remind-item.off .r-time { opacity: 0.4; }

/* ============ 我的页 ============ */
.me-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.setting-row {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 2px; border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.setting-row:last-child { border-bottom: none; }
.setting-row .s-ico { width: 28px; text-align: center; }
.setting-row .s-ico .ic { width: 16px; height: 16px; stroke: var(--ink-2); vertical-align: middle; }
.setting-row .s-main { flex: 1; }
.setting-row .s-main p { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.switch { position: relative; width: 44px; height: 25px; flex-shrink: 0; cursor: pointer; }
.switch input { display: none; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px;
  background: rgba(45,42,38,0.15); transition: background 0.2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2.5px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2); transition: left 0.2s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { left: 21px; }

.privacy-note {
  font-size: 12.5px; color: var(--ink-2); line-height: 1.75;
  background: var(--accent-2-soft); border-radius: 12px; padding: 12px 15px;
}

.hotline-list { margin-top: 10px; }
.hotline-list li {
  list-style: none; background: rgba(255,255,255,0.8); border-radius: 12px;
  padding: 11px 14px; margin-bottom: 8px; font-size: 13.5px;
  display: flex; justify-content: space-between; align-items: center;
}
.hotline-list b { color: var(--danger); font-variant-numeric: tabular-nums; }
.hotline-list small { display: block; color: var(--ink-3); font-size: 11px; margin-top: 1px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(16px);
  background: rgba(45,42,38,0.92); color: #fff;
  font-size: 13px; padding: 10px 20px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 99;
  max-width: 60%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 模态（居中窗口式） */
.modal-mask {
  position: fixed; inset: 0; background: rgba(30, 26, 22, 0.4);
  backdrop-filter: blur(5px); z-index: 50;
  display: none; align-items: center; justify-content: center;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; width: 460px; max-width: 92vw;
  border-radius: 18px; padding: 22px 24px 24px;
  max-height: 84vh; overflow-y: auto;
  box-shadow: 0 24px 70px rgba(40, 30, 20, 0.25);
  animation: pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes pop { from { transform: scale(0.94) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 16px; margin-bottom: 16px; display: flex; align-items: center; }
.modal h3 .close-x { margin-left: auto; border: none; background: none; font-size: 17px; color: var(--ink-3); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.modal h3 .close-x:hover { color: var(--ink); background: rgba(45,42,38,0.06); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(45,42,38,0.16); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(45,42,38,0.28); }
::-webkit-scrollbar-track { background: transparent; }
