@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400&family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=Noto+Serif+SC:wght@400;600;700&display=swap');

/* ============================================================
   Muse × Clara · 双主题系统 v6.0
   白天模式：奶油白 + 玫瑰粉 + 暖黄
   夜间模式：深黑 + 深红 + 墨绿
   ============================================================ */

/* ── Day Theme（默认） ── */
:root {
  --bg:             #faf6ed;
  --panel:          #fffcf7;
  --panel2:         #fff8f0;
  --sidebar:        #fff4e8;
  --text:           #2c1b0e;
  --muted:          #9a7c62;
  --line:           rgba(44, 27, 14, 0.10);
  --accent:         #c9596e;
  --accent2:        #d88c3c;
  --accent-bg:      rgba(201, 89, 110, 0.09);
  --accent-border:  rgba(201, 89, 110, 0.28);
  --radius:         16px;
  --shadow:         0 4px 22px rgba(180,90,80,0.09), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg:      0 14px 50px rgba(180,90,80,0.13), 0 2px 10px rgba(0,0,0,0.06);
  --font-head:      'Lora', 'Noto Serif SC', 'Songti SC', Georgia, serif;
  --font-body:      -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color-scheme: light;
}

/* ── Night Theme ── */
body.night {
  --bg:             #080808;
  --panel:          #101010;
  --panel2:         #151515;
  --sidebar:        #0b0b0b;
  --text:           #e0d5c5;
  --muted:          #7a6a58;
  --line:           rgba(255,255,255,0.06);
  --accent:         #9b2333;
  --accent2:        #1e5c3c;
  --accent-bg:      rgba(155,35,51,0.13);
  --accent-border:  rgba(155,35,51,0.36);
  --shadow:         0 4px 24px rgba(0,0,0,0.55);
  --shadow-lg:      0 14px 50px rgba(0,0,0,0.72);
  --font-head:      'Cormorant Garamond', 'Noto Serif SC', 'Songti SC', Georgia, serif;
  color-scheme: dark;
}

/* ── Global Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  transition: background 0.38s ease, color 0.38s ease;
  font-size: 14px;
  line-height: 1.6;
}

/* ── Sidebar ── */
#sidebar {
  width: 236px;
  flex-shrink: 0;
  padding: 22px 14px 18px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: background 0.38s ease, border-color 0.38s ease;
}
#sidebar::-webkit-scrollbar { width: 3px; }
#sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

#brand {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text);
  margin-bottom: 2px;
}
#tagline {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

/* ── Day/Night Toggle ── */
.theme-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}
.theme-toggle-wrap:hover { opacity: 0.85; transform: translateY(-1px); }
.theme-toggle-icon { font-size: 16px; line-height: 1; }
.theme-toggle-label { font-size: 12px; color: var(--accent); font-weight: 600; flex: 1; }
.theme-toggle-pill {
  width: 36px; height: 20px;
  border-radius: 99px;
  background: var(--line);
  border: 1px solid var(--accent-border);
  position: relative;
  transition: background 0.28s ease;
  flex-shrink: 0;
}
.theme-toggle-pill::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.28s ease;
}
body.night .theme-toggle-pill { background: rgba(155,35,51,0.22); }
body.night .theme-toggle-pill::after { transform: translateX(16px); }

/* ── Nav Items ── */
.nav-item {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  opacity: 0.80;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
  user-select: none;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item:hover {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  opacity: 1;
  transform: translateX(2px);
}
.nav-item.active {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--accent);
  opacity: 1;
  font-weight: 600;
}

.sidebar-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 2px;
  transition: background 0.38s ease;
}

/* ── Main ── */
#main {
  flex: 1;
  padding: 22px 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* ── Views ── */
.view {
  display: none;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  transition: background 0.38s ease, border-color 0.38s ease, box-shadow 0.38s ease;
}
.view.active { display: block; }

/* ── Typography ── */
h2 {
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}
h3.subheading {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin: 2px 0 10px;
}
.small { font-size: 12px; color: var(--muted); line-height: 1.55; }

/* ── Cards ── */
.card {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
body.night .card {
  background: rgba(255,255,255,0.025);
  border-color: rgba(255,255,255,0.055);
}

/* ── Buttons ── */
.btn {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-body);
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { border-color: var(--accent-border); background: var(--accent-bg); color: var(--accent); }
.btn.mini { padding: 6px 10px; font-size: 12px; }

/* ── Inputs ── */
.input, textarea, select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  outline: none;
  font-size: 13px;
  font-family: var(--font-body);
  transition: border-color 0.15s ease, background 0.38s ease, color 0.38s ease;
}
.input:focus, textarea:focus, select:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
textarea { width: 100%; min-height: 120px; resize: vertical; line-height: 1.68; }
select { cursor: pointer; }

hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* ── Layout ── */
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Footer ── */
footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.38s ease;
}

/* ── Hero Image ── */
#heroWrap { max-width: 480px; margin: 0 auto; }
#image-wrapper {
  width: 100%; height: 580px; overflow: hidden;
  border-radius: 14px; cursor: zoom-in;
  box-shadow: var(--shadow-lg);
}
#hero-image { width: 100%; height: 100%; object-fit: cover; display: block; }
#dots { text-align: center; margin-top: 10px; }
.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin: 0 4px; background: var(--line); cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.dot.active { background: var(--accent); transform: scale(1.45); }

/* ── Quote Box ── */
.quote-box {
  padding: 16px; border-radius: 12px;
  background: var(--accent-bg); border: 1px solid var(--accent-border);
}
.quote-label { font-size: 11.5px; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.quote-text { font-size: 14.5px; line-height: 1.8; color: var(--text); white-space: pre-wrap; font-style: italic; }

/* ── Lightbox ── */
#lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.88);
  display: none; align-items: center; justify-content: center;
  z-index: 999; cursor: zoom-out;
}
#lightbox img { max-width: 94vw; max-height: 94vh; border-radius: 14px; box-shadow: 0 0 50px rgba(0,0,0,0.9); }

/* ── Toast ── */
.toast, .toast-bar {
  position: fixed; left: 50%; bottom: 22px;
  transform: translateX(-50%) translateY(12px);
  background: var(--text); color: var(--panel);
  padding: 10px 18px; border-radius: 99px; font-size: 13px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999; white-space: nowrap; box-shadow: var(--shadow-lg);
}
.toast.show, .toast-bar.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Letters / Split Pane ── */
.split { display: flex; gap: 14px; align-items: flex-start; }
.pane { flex: 1; min-width: 260px; }
.list {
  max-height: 420px; overflow: auto;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 6px; background: var(--bg);
}
.list::-webkit-scrollbar { width: 4px; }
.list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

.list-item {
  padding: 10px 12px; border-radius: 11px; cursor: pointer;
  line-height: 1.4; background: transparent; border: 1px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.list-item:hover { background: var(--accent-bg); border-color: var(--accent-border); }
.list-item.active { background: var(--accent-bg); border-color: var(--accent-border); }

.li-top { display: flex; align-items: center; gap: 8px; }
.li-title { font-weight: 600; font-size: 13px; }
.li-sub { margin-top: 5px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel2);
  color: var(--muted); white-space: nowrap;
}
.tag-emotion { border-color: var(--accent-border); color: var(--accent); background: var(--accent-bg); }
.tag-relation { border-color: rgba(100,140,255,0.35); color: #6488cc; background: rgba(100,140,255,0.10); }
.tag-node { border-color: rgba(200,160,70,0.35); color: #b89040; background: rgba(200,160,70,0.10); }

.pane-title { font-family: var(--font-head); font-weight: 700; color: var(--accent); font-size: 15px; }
.pane-body {
  white-space: pre-wrap; line-height: 1.88; margin-top: 12px;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; max-height: 420px; overflow: auto; font-size: 13.5px;
}

/* ── Embeds ── */
.embed { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }

/* ── Calendar Grid ── */
#calGridWrap {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px;
}
.cal-week {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 8px; margin-bottom: 10px;
}
.cal-week div, .cal-weekday {
  text-align: center; font-size: 12px; color: var(--muted); padding: 5px 0;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 9px; }

.cal-day {
  position: relative; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel2);
  padding: 10px 8px 8px; min-height: 92px; cursor: pointer;
  overflow: hidden; transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.cal-day:hover { transform: translateY(-2px); border-color: var(--accent-border); background: var(--accent-bg); }
.cal-day.empty { border-style: dashed; background: transparent; cursor: default; opacity: 0.35; }
.cal-day.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg) inset; }
.cal-day.match { outline: 2px solid rgba(200,175,80,0.45); outline-offset: 2px; }
.cal-num { position: absolute; top: 8px; left: 10px; font-weight: 700; font-size: 13px; opacity: 0.88; }
.cal-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); position: absolute; top: 11px; right: 10px;
  box-shadow: 0 0 0 4px var(--accent-bg);
}
.cal-mood {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-bg); border: 1px solid var(--accent-border);
  margin: 18px auto 6px; font-size: 24px; user-select: none;
}
.cal-mood img { width: 38px; height: 38px; object-fit: contain; display: block; }
.cal-title {
  text-align: center; font-size: 11.5px; line-height: 1.25;
  opacity: 0.8; padding: 0 4px; max-height: 2.5em; overflow: hidden;
}
.cal-badge {
  position: absolute; top: 8px; right: 8px;
  font-size: 10.5px; padding: 2px 7px; border-radius: 999px;
  background: var(--accent-bg); border: 1px solid var(--accent-border); color: var(--accent);
}
.cal-badge.node { background: var(--accent-bg); border-color: var(--accent-border); }
.cal-badge.daily { background: rgba(60,160,255,0.12); border-color: rgba(60,160,255,0.28); color: #4a8fd0; }
.cal-badge.fixed { background: var(--panel2); border-color: var(--line); color: var(--muted); }

.cal-sticker {
  position: absolute; left: 50%; top: 52%; transform: translate(-50%,-50%);
  width: 56px; height: 56px; opacity: 0.92;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2)); pointer-events: none;
}

.cal-preview {
  position: absolute; left: 10px; right: 10px; bottom: 8px;
  font-size: 11px; line-height: 1.25; opacity: 0.75;
  max-height: 2.5em; overflow: hidden;
}

.cal-results { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.cal-results-head { margin: 2px 0 10px; opacity: 0.85; }
.cal-result-item {
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel2);
  cursor: pointer; margin-bottom: 8px;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.cal-result-item:hover { background: var(--accent-bg); border-color: var(--accent-border); }
.cal-result-date { font-weight: 700; margin-bottom: 4px; }

.cal-title-list { margin-top: 14px; display: grid; gap: 8px; }
.cal-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel2);
  cursor: pointer; transition: background 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}
.cal-item:hover { border-color: var(--accent-border); background: var(--accent-bg); transform: translateY(-1px); }
.cal-item .day { width: 38px; text-align: center; font-weight: 700; opacity: 0.88; }
.cal-item .ttl { flex: 1; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-item .mood {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-bg); border: 1px solid var(--accent-border); font-size: 16px;
}
.cal-item .mood img { width: 24px; height: 24px; object-fit: contain; }

/* ── Calendar Modal ── */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.52);
  display: none; align-items: center; justify-content: center;
  padding: 20px; z-index: 50; backdrop-filter: blur(5px);
}
.modal.show { display: flex; }
.modal-card {
  width: min(920px, 100%); max-height: 88vh;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-lg);
  overflow: hidden; display: flex; flex-direction: column;
}
.modal-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line); background: var(--panel2);
}
.modal .pane-body { padding: 14px; overflow: auto; }

.cal-moodbar {
  margin-top: 12px; padding: 12px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg);
}
.cal-mood-current {
  min-width: 44px; height: 34px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-bg); border: 1px solid var(--accent-border);
  font-size: 18px; padding: 0 12px;
}
.cal-mood-picker { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.mood-chip {
  height: 34px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel2);
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  font-size: 15px; user-select: none; transition: border-color 0.12s ease, background 0.12s ease;
}
.mood-chip:hover { border-color: var(--accent-border); background: var(--accent-bg); }
.mood-chip img { width: 20px; height: 20px; object-fit: contain; }

/* ── Diary ── */
.diary-title { font-family: var(--font-head); font-size: 15px; color: var(--accent); margin: 2px 0 10px; font-weight: 700; }
.diary-body { white-space: pre-wrap; line-height: 1.85; font-size: 13.5px; }

/* ── Lock Screen ── */
.lock-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

/* Day lock bg */
body:not(.night) .lock-overlay {
  background: radial-gradient(ellipse at 40% 30%, rgba(201,89,110,0.14), transparent 60%), #faf6ed;
}
/* Night lock bg */
body.night .lock-overlay {
  background: radial-gradient(ellipse at 40% 30%, rgba(155,35,51,0.16), transparent 60%), #080808;
}

.lock-card {
  width: min(360px, 90vw);
  padding: 28px 24px 24px;
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.lock-title { font-family: var(--font-head); font-size: 20px; margin-bottom: 8px; font-weight: 700; }
.lock-hint { margin-top: 10px; min-height: 18px; color: var(--accent); font-size: 12px; }
.lock-card .btn { width: 100%; margin-top: 10px; }
.lock-card .input { width: 100%; }
.lock-fade-out { opacity: 0; pointer-events: none; transition: opacity 0.28s ease; }

/* ── History Panel (NEW) ── */
.history-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--accent); cursor: pointer;
  padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--accent-border); background: var(--accent-bg);
  user-select: none; transition: opacity 0.15s ease, transform 0.1s ease;
}
.history-toggle:hover { opacity: 0.78; transform: translateY(-1px); }

.history-panel {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
  display: none;
  animation: slideDown 0.18s ease;
}
.history-panel.open { display: block; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.history-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.12s ease;
}
.history-item:last-child { border-bottom: none; }
.history-item:hover { background: var(--accent-bg); }
.history-date { font-size: 11.5px; color: var(--accent); font-weight: 600; margin-bottom: 3px; }
.history-preview { font-size: 12.5px; opacity: 0.78; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.history-empty { padding: 16px 14px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ── 100件小事 & 推荐清单 ── */
.card-list { display: flex; flex-direction: column; gap: 8px; }
.item-card {
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel2);
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.15s ease;
}
.item-card:hover { border-color: var(--accent-border); }
.item-header { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.item-header input[type="checkbox"] { margin-top: 3px; accent-color: var(--accent); width: 15px; height: 15px; }
.item-title { display: flex; flex-direction: column; gap: 2px; }
.item-title-text { font-weight: 600; font-size: 13.5px; }
.item-subline { font-size: 11.5px; color: var(--muted); }
.item-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.item-tag {
  padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 11px; color: var(--muted); background: var(--bg);
}
.muse-note { margin-top: 4px; font-size: 12px; color: var(--muted); font-style: italic; }
.item-note textarea { width: 100%; min-height: 38px; resize: vertical; border-radius: 8px; font-size: 12px; }
.things-random-text { margin-top: 4px; font-size: 13px; }

/* ── Sidebar Extra ── */
.sidebar-section { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

/* ── Chat API ── */
.muse { color: var(--accent); font-weight: 600; }
#apiChat { max-height: 420px; overflow: auto; }
#apiChat::-webkit-scrollbar { width: 4px; }
#apiChat::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

/* ── Filter chips ── */
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  background: var(--panel2); border: 1px solid var(--line);
  color: var(--muted); padding: 6px 12px; border-radius: 999px;
  cursor: pointer; font-size: 12px; transition: all 0.15s ease;
}
.chip:hover { border-color: var(--accent-border); color: var(--accent); }
.chip.active { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); font-weight: 600; }

/* ── Hidden legacy ── */
.theme-cycle { display: none !important; }
.sidebar-section { display: flex; flex-direction: column; gap: 5px; }

/* ── Mobile ── */
@media (max-width: 860px) {
  body { display: flex !important; flex-direction: column !important; overflow-x: hidden; }

  #sidebar {
    position: sticky !important; top: 0 !important; z-index: 40 !important;
    width: 100% !important; height: auto !important;
    padding: 10px 10px 8px !important;
    border-right: none !important; border-bottom: 1px solid var(--line) !important;
    display: flex !important; flex-direction: row !important;
    flex-wrap: wrap !important; gap: 5px !important;
    background: var(--sidebar) !important;
  }

  #brand, #tagline, .sidebar-section, .theme-toggle-wrap { display: none !important; }

  #sidebar .nav-item {
    flex: 0 0 calc(33.333% - 5px) !important;
    text-align: center !important; white-space: nowrap !important;
    font-size: 12px !important; padding: 7px 4px !important; border-radius: 10px !important;
  }

  #main { padding: 12px 12px 18px !important; }
  #image-wrapper { height: 300px; }
  #heroWrap { max-width: 100%; }
  .view { padding: 14px; border-radius: 12px; }
  .btn { padding: 7px 10px; font-size: 12px; }
  .grid2 { grid-template-columns: 1fr; }
  .embed { height: 62vh !important; }
  .split { flex-direction: column; }
  .pane { min-width: unset; }
  .cal-day { min-height: 78px; padding: 8px; }
  .cal-title { display: none; }
  .cal-mood { width: 40px; height: 40px; font-size: 20px; }
}

/* ── Scrollbar (desktop) ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-border); }

/* ===== 今日记录 - Diary Tabs ===== */
.diary-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.diary-tab {
  padding: 8px 18px;
  border: none;
  border-radius: 20px 20px 0 0;
  background: rgba(0,0,0,0.05);
  color: #666;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.18s;
}
.diary-tab.active {
  background: var(--card-bg, #fff);
  color: var(--accent, #ec407a);
  font-weight: 600;
  box-shadow: 0 -2px 8px rgba(236,64,122,0.10);
}
.diary-tab:hover:not(.active) {
  background: rgba(236,64,122,0.08);
}
.diary-tab-panel {
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity:0; transform: translateY(4px); } to { opacity:1; transform: none; } }

/* ===== 100件小事 - 简单列表 ===== */
.things-simple-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.things-simple-item {
  padding: 10px 4px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.things-simple-item:last-child { border-bottom: none; }
.things-num {
  color: var(--accent, #ec407a);
  font-size: 12px;
  opacity: 0.6;
  min-width: 26px;
  padding-top: 2px;
}
.things-simple-item .muse-note-small {
  font-size: 12px;
  opacity: 0.55;
  margin-top: 2px;
}
.things-tag-chip {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(236,64,122,0.08);
  color: var(--accent, #ec407a);
  margin-left: 6px;
}

/* ===== CALENDAR - Compact redesign ===== */
.cal-day {
  min-height: 60px !important;
  padding: 6px 5px 4px !important;
}
.cal-num { font-size: 12px !important; top: 5px !important; left: 6px !important; }
.cal-mood {
  width: 26px !important; height: 26px !important;
  font-size: 14px !important; margin: 18px auto 2px !important;
}
.cal-mood img { width: 20px !important; height: 20px !important; }
.cal-title { font-size: 10px !important; max-height: 2em !important; }
.cal-badge { font-size: 9px !important; padding: 1px 4px !important; top: 4px !important; right: 4px !important; }
.cal-grid { gap: 5px !important; }
.cal-week { gap: 5px !important; margin-bottom: 6px !important; }

/* ===== NOTES - Title + collapsible + markdown ===== */
.note-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 6px 0;
  overflow: hidden;
  background: var(--panel2);
}
.note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  gap: 10px;
}
.note-header:hover { background: var(--accent-bg); }
.note-title-text {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-toggle { font-size: 13px; opacity: 0.5; transition: transform 0.2s; }
.note-toggle.open { transform: rotate(180deg); }
.note-body {
  padding: 0 14px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.2s;
}
.note-body.open { max-height: 600px; padding: 0 14px 14px; }
.note-body-inner {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
  border-top: 1px solid var(--line);
  padding-top: 10px;
  white-space: pre-wrap;
}
/* Markdown in notes */
.note-body-inner h1,.note-body-inner h2,.note-body-inner h3 { margin: 8px 0 4px; font-size: 14px; }
.note-body-inner strong { font-weight: 700; }
.note-body-inner em { font-style: italic; }
.note-body-inner code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; font-family: monospace; font-size: 12px; }
.note-body-inner pre { background: var(--panel2); padding: 8px; border-radius: 8px; overflow-x: auto; margin: 6px 0; }
.note-body-inner blockquote { border-left: 3px solid var(--accent); padding-left: 10px; opacity: 0.75; margin: 6px 0; }
.note-body-inner ul,.note-body-inner ol { padding-left: 18px; margin: 4px 0; }
.note-body-inner li { margin: 2px 0; }
.note-done .note-title-text { text-decoration: line-through; opacity: 0.5; }
.note-done-badge { font-size: 11px; opacity: 0.5; white-space: nowrap; }
.note-add-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.note-input-wrap { flex: 1; display: flex; flex-direction: column; gap: 6px; }

/* ===== RECS - Collapsible sections ===== */
.recs-section-header {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; padding: 8px 0; user-select: none;
}
.recs-section-header:hover { opacity: 0.75; }
.recs-section-body { overflow: hidden; transition: max-height 0.3s ease; }
.recs-done-list { font-size: 12px; opacity: 0.6; margin-top: 4px; }

/* ===== MEDIA - upload grid ===== */
.media-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.media-item {
  position: relative; width: 160px; border-radius: 12px;
  overflow: hidden; border: 1px solid var(--line); background: var(--panel2);
}
.media-item img { width: 160px; height: 120px; object-fit: cover; display: block; }
.media-item-cap { font-size: 12px; padding: 5px 8px; }
.media-item-del {
  position: absolute; top: 5px; right: 5px;
  background: rgba(0,0,0,0.55); color: #fff;
  border: none; border-radius: 50%; width: 24px; height: 24px;
  cursor: pointer; font-size: 13px; line-height: 24px; text-align: center;
}

/* ===== HOME - backup widget ===== */
.home-backup-bar {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; opacity: 0.7; margin-top: 8px;
}

/* ===== FINANCE - stats bar ===== */
.fin-stat-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.fin-stat-chip {
  background: var(--accent-bg); border: 1px solid var(--accent-border);
  border-radius: 20px; padding: 4px 12px; font-size: 13px; color: var(--accent);
}

/* ===== Inspiration Grid ===== */
.insp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.insp-card {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.insp-label {
  font-size: 11px;
  opacity: 0.55;
  margin-bottom: 4px;
}
.insp-val {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  min-height: 18px;
}

/* ── Home Mini Calendar ── */
.home-mini-cal { margin-top: 14px; }
.home-mini-cal .mini-cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.home-mini-cal .mini-cal-title {
  font-family: var(--font-head); font-size: 15px; font-weight: 600;
}
.mini-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
}
.mini-cal-wday {
  text-align: center; font-size: 11px; color: var(--muted);
  padding: 2px 0 6px; font-weight: 600;
}
.mini-cal-day {
  aspect-ratio: 1; border-radius: 8px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer;
  font-size: 12px; transition: background 0.15s; position: relative;
  background: var(--panel2); border: 1px solid transparent;
}
.mini-cal-day:hover { background: var(--accent-bg); border-color: var(--accent-border); }
.mini-cal-day.today { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.mini-cal-day.empty { background: transparent; cursor: default; border: none; }
.mini-cal-day .mc-num { font-size: 11px; line-height: 1; }
.mini-cal-day .mc-mood { font-size: 15px; line-height: 1; margin-top: 2px; }
.mini-cal-day.has-entry { background: var(--accent-bg); }
.mini-cal-btn { background: none; border: none; cursor: pointer; font-size: 15px;
  color: var(--muted); padding: 2px 8px; border-radius: 8px; }
.mini-cal-btn:hover { color: var(--text); background: var(--accent-bg); }

/* ── Diary Mini Calendar ── */
.diary-mini-cal { margin-bottom: 14px; }
.diary-mini-cal .mini-cal-title { font-size: 14px; }

/* ── Fortune / Tarot Cards ── */
.fortune-card, .tarot-card {
  background: var(--panel2); border-radius: var(--radius);
  border: 1px solid var(--accent-border); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.fortune-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  padding: 3px 10px; border-radius: 20px;
}
.fortune-badge.daji { background: rgba(255,215,0,0.15); color: #c8940a; }
.fortune-badge.zhongji { background: rgba(201,89,110,0.12); color: var(--accent); }
.fortune-badge.ping { background: var(--accent-bg); color: var(--muted); }
.fortune-keyword {
  font-size: 22px; font-family: var(--font-head); font-weight: 700;
  color: var(--accent); line-height: 1;
}
.fortune-text {
  font-size: 14px; line-height: 1.85; color: var(--text);
  font-family: var(--font-head); font-style: italic;
  min-height: 48px;
}
.tarot-card-name {
  font-family: var(--font-head); font-size: 18px; font-weight: 600;
  color: var(--accent2); display: flex; align-items: center; gap: 8px;
}
.tarot-orientation {
  font-size: 11px; padding: 2px 8px; border-radius: 12px;
  background: var(--accent-bg); color: var(--muted);
}
.tarot-text {
  font-size: 14px; line-height: 1.85; color: var(--text);
  font-family: var(--font-head); font-style: italic; min-height: 48px;
}
.tarot-flip-wrap {
  perspective: 600px; height: 120px; cursor: pointer; margin: 0 auto; width: 80px;
}
.tarot-flip-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform 0.5s ease;
}
.tarot-flip-inner.flipped { transform: rotateY(180deg); }
.tarot-face, .tarot-back {
  position: absolute; width: 100%; height: 100%;
  backface-visibility: hidden; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; border: 1.5px solid var(--accent-border);
}
.tarot-back { background: linear-gradient(135deg,#1a0533,#2e0f4a); }
.tarot-face { transform: rotateY(180deg); background: var(--panel2); font-size: 28px; }
.tarot-flip-hint { font-size: 11px; color: var(--muted); text-align: center; margin-top: 4px; }
.shake-btn {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
}

/* ══════════════════════════════════════
   流年记事 · 统一日历 新增样式
   ══════════════════════════════════════ */

/* Clara 记录小点（日历格底部）*/
.cal-clara-dots {
  position: absolute; bottom: 6px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 3px;
  font-size: 10px; line-height: 1;
}

/* 日面板 */
.day-panel {
  border: 2px solid var(--accent-border) !important;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.day-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.day-panel-title {
  font-family: var(--font-head); font-size: 16px; font-weight: 700;
  color: var(--accent);
}

/* 去年的今天 */
.last-year-card {
  margin: 12px 0; padding: 12px 14px;
  border-radius: 12px; border: 1px dashed var(--accent-border);
  background: var(--accent-bg);
}
.last-year-label {
  font-size: 11px; opacity: .65; margin-bottom: 5px;
}
.last-year-title {
  font-weight: 700; font-size: 13px; color: var(--accent); margin-bottom: 4px;
}
.last-year-body {
  font-size: 12.5px; line-height: 1.7; opacity: .85;
  max-height: 80px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}

/* 心情热力图 */
:root {
  --hm-0: rgba(180,180,180,0.15);
  --hm-1: rgba(160,210,170,0.35);
  --hm-2: rgba(100,185,130,0.55);
  --hm-3: rgba(60,165,110,0.75);
  --hm-4: rgba(30,140,90,0.92);
  --hm-sad: rgba(100,140,200,0.55);
  --hm-angry: rgba(200,90,90,0.55);
}
body.night {
  --hm-1: rgba(120,200,155,0.3);
  --hm-2: rgba(80,175,125,0.5);
  --hm-3: rgba(50,155,105,0.7);
  --hm-4: rgba(30,135,90,0.9);
}
.mood-heatmap {
  display: flex; gap: 3px; flex-wrap: nowrap; overflow-x: auto;
  padding-bottom: 4px;
}
.hm-week { display: flex; flex-direction: column; gap: 3px; }
.hm-cell {
  width: 13px; height: 13px; border-radius: 3px;
  background: var(--hm-0); cursor: pointer;
  transition: transform 0.1s;
  position: relative;
}
.hm-cell:hover { transform: scale(1.4); z-index: 2; }
.mood-heatmap-legend {
  display: flex; align-items: center; gap: 5px; margin-top: 8px; flex-wrap: wrap;
}
.mood-heatmap-legend .hm-cell { cursor: default; }
.mood-heatmap-legend .hm-cell:hover { transform: none; }

/* 心情 emoji 排行 */
.mood-emoji-ranking {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.mood-emoji-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel2);
  font-size: 14px;
}
.mood-emoji-count { font-size: 12px; opacity: .7; }

/* 统计格子 */
.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.stat-block {
  text-align: center; padding: 14px 10px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--panel2);
}
.stat-num {
  font-family: var(--font-head); font-size: 28px; font-weight: 800;
  color: var(--accent); line-height: 1.1;
}
.stat-label { font-size: 12px; opacity: .7; margin-top: 4px; }

/* 近30天学习条 */
.study-strip {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.study-chip {
  width: 18px; height: 18px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--panel2);
  cursor: pointer; transition: transform 0.1s;
  position: relative;
}
.study-chip.has-study { background: var(--hm-3); border-color: var(--hm-4); }
.study-chip:hover { transform: scale(1.3); z-index: 2; }

/* 心情复盘 tab 按钮 */
.mood-review-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hm-cell { width: 10px; height: 10px; }
  .study-chip { width: 14px; height: 14px; }
}

/* 有Clara记录的日历格 - 左侧小亮条 */
.cal-day.has-clara {
  border-left: 3px solid var(--accent-border);
}

/* 首页 · 今日一句话卡片 */
.home-today-quote {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--accent-border);
  background: var(--accent-bg);
}
.htq-label {
  font-size: 11px; opacity: .6; margin-bottom: 5px; letter-spacing: .03em;
}
.htq-title {
  font-family: var(--font-head); font-size: 14px; font-weight: 700;
  color: var(--accent); margin-bottom: 5px; line-height: 1.3;
}
.htq-text {
  font-size: 12.5px; line-height: 1.75; opacity: .85;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 今天的日历格高亮 */
.cal-day.is-today {
  border-color: var(--accent) !important;
  background: var(--accent-bg) !important;
}
.cal-day.is-today .cal-num {
  color: var(--accent);
}
.cal-day.is-today::after {
  content: '今';
  position: absolute; bottom: 5px; right: 7px;
  font-size: 9px; font-weight: 700;
  color: var(--accent); opacity: 0.6;
}
