/* =====================================================================
   Flow OS · Components — "Quiet System"
   全部组件去 AI 味：扁平实心表面 + 发丝边框，主操作为墨黑，
   信号色朱红；分类色去饱和；编辑感字体用于标题与数字。
   ===================================================================== */

/* ===== Card（扁平、靠表面阶梯 + 发丝边框抬起；顶边极淡白高光） ===== */
.card, .glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: inset 0 1px 0 rgba(247,248,248,0.04);
  padding: var(--space-5);
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out), transform .2s var(--ease-out);
  position: relative;
}
.card:hover, .glass-card:hover {
  border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(247,248,248,0.06);
  transform: translateY(-2px);
}

/* ===== Buttons ===== */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  min-height:var(--ctrl-h); padding:0 16px;
  border-radius:var(--radius-xs); border:1px solid var(--border); background:var(--surface);
  color:var(--text-secondary); font-size:var(--fs-2); font-weight:500; cursor:pointer; white-space:nowrap;
  font-family: var(--font-sans);
  transition: background .15s var(--ease-out), border-color .15s var(--ease-out), color .15s var(--ease-out), transform .12s var(--ease-out), box-shadow .15s var(--ease-out);
}
.btn:hover { border-color:var(--border-strong); color:var(--text-primary); background:var(--surface-3); }
.btn:active { transform:scale(.985); }

.btn-primary { background:var(--primary); color:var(--on-primary); border-color:var(--primary); box-shadow:var(--shadow-sm); }
.dark .btn-primary { color:var(--on-primary); border-color:var(--border-strong); }
.btn-primary:hover { background:var(--primary-hover); color:var(--on-primary); border-color:var(--primary-hover); box-shadow:var(--shadow-md); }
.dark .btn-primary:hover { color:var(--on-primary); border-color:var(--border-strong); }
.btn-primary:active { transform:scale(.985); background:var(--primary-press); }

.btn-secondary { background:var(--surface); color:var(--text-primary); border-color:var(--border); }
.btn-secondary:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-weak); }

.btn-ghost { background:transparent; border-color:transparent; color:var(--text-secondary); }
.btn-ghost:hover { background:var(--surface-3); color:var(--text-primary); }

.btn-danger { background:transparent; color:var(--danger); border-color:var(--danger-weak); }
.btn-danger:hover { background:var(--danger-weak); color:var(--danger); border-color:var(--danger); }

.btn-sm { min-height:var(--ctrl-h-sm); padding:0 12px; font-size:var(--fs-1); border-radius:var(--radius-2xs); }

/* ===== Modal ===== */
.modal-overlay {
  position:fixed; inset:0; background:rgba(20,19,15,0.32);
  z-index:9999; display:none; align-items:center; justify-content:center; padding:20px;
}
.modal-overlay.active { display:flex; }
.modal {
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-xl);
  max-width:480px; width:100%; max-height:90dvh; overflow-y:auto;
  box-shadow:var(--shadow-lg); padding:var(--space-5);
  opacity:0; transform:translateY(12px) scale(.985);
}
.modal-overlay.active .modal { animation:modalIn .28s var(--ease-out) both; }
@keyframes modalIn { from{opacity:0; transform:translateY(12px) scale(.985);} to{opacity:1; transform:none;} }
.modal-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.modal-title { font-family:var(--font-display); font-size:19px; font-weight:600; letter-spacing:-0.02em; font-optical-sizing:auto; }
.modal-close { background:none; border:none; font-size:20px; cursor:pointer; color:var(--text-muted); }
.modal-close:hover { color:var(--text-primary); }
.modal-footer { display:flex; justify-content:flex-end; gap:10px; margin-top:20px; padding-top:16px; border-top:1px solid var(--border); }

/* ===== Form ===== */
.form-group { margin-bottom:var(--space-3); }
.form-label { display:block; font-size:var(--fs-2); font-weight:600; margin-bottom:4px; color:var(--text-secondary); }
.form-input, .form-select, .form-textarea {
  width:100%; padding:10px 14px; border:1px solid var(--border); border-radius:var(--radius-sm);
  font-size:var(--fs-3); outline:none; transition: .15s var(--ease-out); background:var(--surface-2); color:var(--text-primary);
  font-family: var(--font-sans);
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color:var(--accent); box-shadow:var(--shadow-focus); }
.form-textarea { resize:vertical; min-height:60px; }
#dailyTomorrow { min-height:52px; line-height:1.5; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }

/* 内容录入类输入限宽 */
.journal-compose .form-input, .journal-title-input, .journal-content,
.daily-topgoal-input .form-input, .daily-task-input .form-input, .daily-search input,
.task-top-row .form-input, .task-top-chips .task-search,
.weekly-field .form-textarea, .form-row .form-input, .form-row .form-select,
.bz-quickadd-input { max-width:600px; }

/* ===== Toast ===== */
#toastContainer { position:fixed; bottom:calc(24px + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); z-index:99999; display:flex; flex-direction:column; gap:8px; pointer-events:none; }
.toast {
  background:var(--primary); color:var(--on-primary); padding:10px 20px; border-radius:var(--radius-sm);
  font-size:var(--fs-2); font-weight:500; box-shadow:var(--shadow-md);
  animation:toastIn .3s var(--ease-out); pointer-events:auto;
}
.dark .toast { color:var(--on-primary); }
.toast.success { background:var(--success); color:#fff; }
.toast.error { background:var(--danger); color:#fff; }
@keyframes toastIn { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }

/* ===== Sync Status ===== */
.sync-badge {
  font-size:var(--fs-1); padding:4px 12px; border-radius:var(--radius-pill); background:var(--surface-3); color:var(--text-muted);
  display:inline-flex; align-items:center; gap:6px; font-weight:500; border:1px solid var(--border);
}
.sync-badge.success { background:var(--success-weak); color:var(--success); }
.sync-badge.syncing { background:var(--accent-weak); color:var(--accent); }
.sync-badge.locked { background:var(--danger-weak); color:var(--danger); }
.sync-badge.error { background:var(--danger-weak); color:var(--danger); }
.sync-badge.local { background:var(--warning-weak); color:var(--warning); }

/* ===== Filter chips ===== */
.filter-chip { background:var(--surface-3); border:1px solid var(--border); border-radius:var(--radius-pill); padding:4px 14px; font-size:var(--fs-2); cursor:pointer; transition: all .15s var(--ease-out); color:var(--text-muted); }
.filter-chip.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.dark .filter-chip.active { color:var(--on-primary); }
#timerNoteFilterBtn.active { background:var(--accent); color:var(--on-primary); border-color:var(--accent); }

/* ===== Color picker ===== */
.color-picker { display:flex; gap:8px; flex-wrap:wrap; }
.color-option { width:28px; height:28px; border-radius:50%; cursor:pointer; border:2px solid transparent; transition: .15s var(--ease-out); }
.color-option.active { border-color:var(--text-primary); transform:scale(1.1); }

/* ===== Password Vault ===== */
.pwd-item {
  display:flex; align-items:center; gap:16px; padding:16px 20px;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  margin-bottom:10px; transition: border-color .15s var(--ease-out), transform .15s var(--ease-out);
}
.pwd-item:hover { border-color:var(--border-strong); transform:translateX(3px); }
.pwd-site { font-weight:600; min-width:140px; }
/* 网页跳转按钮：紧凑图标按钮，桌面/移动端都小巧，不撑大行高 */
.pwd-web-btn {
  display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto;
  width:26px; height:26px; padding:0; border-radius:var(--radius-2xs);
  border:1px solid var(--border); background:var(--surface-2); color:var(--text-secondary);
  font-size:.7rem; cursor:pointer; transition:background .15s var(--ease-out), color .15s var(--ease-out), border-color .15s var(--ease-out);
}
.pwd-web-btn:hover { background:var(--accent-weak); color:var(--accent); border-color:var(--accent); }
.pwd-field { flex:1; display:flex; align-items:center; gap:8px; min-width:0; }
.pwd-value {
  flex:1; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-2xs);
  padding:6px 10px; font-size:var(--fs-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.pwd-cat-chip { display:inline-flex; align-items:stretch; border-radius:var(--radius-2xs); overflow:hidden; }
.pwd-cat-chip .btn-sm { border-radius:var(--radius-2xs); }

/* ===== Timer ===== */
.timer-box { container-type:inline-size; container-name:timerbox; }
.timer-digit {
  font-family:var(--font-sans); font-weight:800; font-size:clamp(2.4rem, 18cqi, 7rem);
  line-height:1.05; color:var(--success); text-align:center; letter-spacing:.01em;
  font-variant-numeric:tabular-nums;
}
.timer-pulse { animation:pulseGlow 2.5s infinite ease-in-out; }
@keyframes pulseGlow { 0%{transform:scale(1)} 50%{transform:scale(1.02)} 100%{transform:scale(1)} }
.timer-btn {
  border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:4px;
  border-radius:var(--radius); font-weight:600; width:100%; height:100%;
  font-size:clamp(.72rem, 3.6cqi, 1.1rem);
  padding:clamp(8px, 2.6cqi, 16px) clamp(4px, 1cqi, 10px);
  font-family:var(--font-sans);
}
.timer-btn-primary { background:var(--success); color:#fff; }
.timer-btn-primary:hover { background:var(--success-press); }
.timer-btn-warn { background:var(--warning); color:#fff; }
.timer-note-input { width:100%; height:100%; text-align:center; padding-left:26px; padding-right:8px;
  font-size:clamp(.7rem, 2.6cqi, 1rem); background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--text-primary); }
.timer-top-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.timer-bottom-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.timer-top-grid > .glass-card, .timer-bottom-grid > .glass-card { min-width:0; }
@media (max-width:900px) { .timer-top-grid, .timer-bottom-grid { grid-template-columns:1fr; } }
.time-filter-group { background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-sm); }
.tm-note-item { padding:6px 14px; font-size:var(--fs-1); cursor:pointer; display:flex; justify-content:space-between; align-items:center; gap:12px; transition: background .15s var(--ease-out); border-radius:var(--radius-xs); }
.tm-note-item:hover { background:var(--surface-3); }
.tm-note-item.active-filter { background:var(--success); color:#fff; }
.tm-note-item .tm-color-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; display:inline-block; }
.tm-note-item .badge { font-size:.6rem; background:var(--surface-3); color:var(--text-muted); padding:1px 6px; border-radius:var(--radius-xs); }
.tm-note-item.active-filter .badge { background:rgba(255,255,255,0.3); color:#fff; }
.tm-rec-row { border-bottom:1px solid var(--border); transition: background .15s var(--ease-out); }
.tm-rec-row:hover { background:var(--success-weak); }
.tm-rec-row td { color:var(--text-secondary); }
.tm-note-editable { width:80px; background:transparent; border:none; border-bottom:1px dashed var(--border); font-size:var(--fs-2); padding:2px 4px; outline:none; transition: border-color .15s var(--ease-out); color:inherit; font-family:var(--font-sans); }
.tm-note-editable:focus { border-bottom-color:var(--success); }
.tm-del-btn { color:var(--danger); cursor:pointer; padding:4px; transition: color .15s var(--ease-out); background:none; border:none; }
.tm-del-btn:hover { color:var(--danger-press); }
#timerRecordsScroll thead tr { background:var(--surface-2); }
#timerCustomPanel, #timerPieCustomPanel, #timerTrendCustomPanel { background:var(--surface-2); }
.time-filter-group .filter-chip:not(.active) { background:var(--surface-3); border-color:var(--border); color:var(--text-muted); }
.tm-note-item[data-note="__all__"] { border-bottom:1px solid var(--border); }

/* ===== Calendar ===== */
.fc-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:1px; background:var(--border); border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; }
.fc-cell { background:var(--surface); min-height:80px; padding:6px; cursor:pointer; transition: .15s var(--ease-out); }
.fc-cell:hover { background:var(--surface-3); }
.fc-cell.today { background:var(--accent-weak); }
.fc-cell.other-month { background:var(--surface-2); color:var(--text-muted); }
.fc-cell.weekend .fc-day-num { color:var(--danger); }
.fc-day-num { font-size:var(--fs-2); font-weight:600; width:26px; height:26px; display:flex; align-items:center; justify-content:center; border-radius:50%; }
.fc-cell.today .fc-day-num { background:var(--accent); color:#fff; }
.dark .fc-cell.today .fc-day-num { color:var(--on-primary); }
.fc-lunar { font-size:.65rem; color:var(--text-muted); margin-top:2px; }
.fc-event-dot { font-size:.65rem; padding:1px 6px; border-radius:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; background:var(--accent-weak); color:var(--accent); }
.solar-term { color:var(--accent); }
.festival { color:var(--danger); }

/* ===== Mind Map ===== */
/* 思维导图主题变量：提升到 :root/.dark 与 .light 全局作用域。
   原因：属性面板被 portal 到 document.body（脱离 #mod-mindmap 作用域），若变量仍定义在 #mod-mindmap 内，
   面板会因 var(--mm-*) 解析不到而背景透明。提升到全局后，模块内与 portaled 面板均可继承主题色。 */
:root,
.dark {
  --mm-bg-panel: #0f1011; --mm-text-primary: #f7f8f8; --mm-text-secondary: #d0d6e0;
  --mm-text-muted: #8a8f98; --mm-bg-canvas: #010102; --mm-bg-muted: #141516; --mm-bg-hover: #18191a;
  --mm-border: #23252a; --mm-shadow-sm: 0 1px 3px rgba(0,0,0,0.4); --mm-shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --mm-shadow-lg: 0 8px 24px rgba(0,0,0,0.6); --mm-transition: 0.2s var(--ease-out); --mm-primary-light: var(--accent-weak);
  --mm-primary-dark: var(--accent-hover);
}
#mod-mindmap { height: calc(100dvh - 130px); }
#mod-mindmap.active { display: flex; flex-direction: column; }
#mod-mindmap .mm-toolbar { display:flex; align-items:center; gap:6px; padding:8px 12px; background:var(--mm-bg-panel); border:1px solid var(--mm-border); border-radius:var(--radius-sm); margin-bottom:8px; flex-shrink:0; flex-wrap:wrap; }
#mod-mindmap .mm-toolbar-group { display:flex; align-items:center; gap:2px; }
#mod-mindmap .mm-toolbar-divider { width:1px; height:24px; background:var(--mm-border); margin:0 4px; flex-shrink:0; }
#mod-mindmap .mm-toolbar-btn { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border:none; background:transparent; border-radius:var(--radius-2xs); cursor:pointer; color:var(--mm-text-secondary); transition: all var(--mm-transition) var(--ease-out); flex-shrink:0; font-size:14px; }
#mod-mindmap .mm-toolbar-btn:hover { background:var(--mm-bg-muted); color:var(--mm-text-primary); }
#mod-mindmap .mm-toolbar-btn:active { transform:scale(0.92); }
#mod-mindmap .mm-toolbar-btn:disabled { opacity:0.3; cursor:not-allowed; }
#mod-mindmap .mm-toolbar-btn.active { background:var(--mm-primary-light); color:var(--accent); }
#mod-mindmap .mm-toolbar-btn.primary { background:var(--accent); color:#fff; width:auto; padding:0 14px; gap:6px; font-size:13px; font-weight:500; }
.dark #mod-mindmap .mm-toolbar-btn.primary { color:var(--on-primary); }
#mod-mindmap .mm-toolbar-btn.primary:hover { background:var(--mm-primary-dark); }
#mod-mindmap .mm-toolbar-btn.has-text { width:auto; padding:0 12px; gap:6px; white-space:nowrap; font-size:13px; font-weight:500; }
#mod-mindmap .mm-toolbar-btn.danger { color:var(--danger); }
#mod-mindmap .mm-toolbar-btn.danger:hover { background:var(--danger-weak); color:var(--danger); }
#mod-mindmap .mm-zoom-display { min-width:44px; height:34px; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:500; color:var(--mm-text-secondary); border-radius:var(--radius-2xs); cursor:pointer; transition: all var(--mm-transition) var(--ease-out); font-variant-numeric:tabular-nums; }
#mod-mindmap .mm-zoom-display:hover { background:var(--mm-bg-muted); color:var(--mm-text-primary); }
#mod-mindmap .mm-search-box { position:relative; flex:1; max-width:200px; margin:0 8px; }
#mod-mindmap .mm-search-box input { width:100%; height:34px; padding:0 28px 0 32px; border:1px solid var(--mm-border); border-radius:var(--radius-2xs); background:var(--mm-bg-muted); color:var(--mm-text-primary); font-size:13px; outline:none; transition: all var(--mm-transition) var(--ease-out); font-family:var(--font-sans); }
#mod-mindmap .mm-search-box input:focus { border-color:var(--accent); background:var(--mm-bg-panel); box-shadow:0 0 0 3px var(--mm-primary-light); }
#mod-mindmap .mm-search-box input::placeholder { color:var(--mm-text-muted); }
#mod-mindmap .mm-search-icon { position:absolute; left:10px; top:50%; transform:translateY(-50%); color:var(--mm-text-muted); pointer-events:none; font-size:13px; }
#mod-mindmap .mm-clear-btn { position:absolute; right:4px; top:50%; transform:translateY(-50%); width:24px; height:24px; border:none; background:transparent; border-radius:50%; cursor:pointer; color:var(--mm-text-muted); display:flex; align-items:center; justify-content:center; transition: all var(--mm-transition) var(--ease-out); font-size:12px; }
#mod-mindmap .mm-clear-btn:hover { background:var(--mm-bg-muted); color:var(--mm-text-primary); }
#mod-mindmap .mm-toolbar-spacer { flex:1; }
#mod-mindmap [data-tooltip]:hover::after { content:attr(data-tooltip); position:absolute; top:calc(100% + 6px); left:50%; transform:translateX(-50%); padding:4px 10px; background:#1b1d22; color:var(--text-primary); font-size:11px; white-space:nowrap; border-radius:var(--radius-2xs); z-index:1000; pointer-events:none; line-height:1.4; box-shadow:var(--mm-shadow-md); font-weight:400; border:1px solid var(--border-strong); }
.dark #mod-mindmap [data-tooltip]:hover::after { color:var(--text-primary); }
#mod-mindmap [data-tooltip]:hover::before { content:''; position:absolute; top:calc(100% + 1px); left:50%; transform:translateX(-50%); border:5px solid transparent; border-bottom-color:#1b1d22; z-index:1000; pointer-events:none; }
.dark #mod-mindmap [data-tooltip]:hover::before { border-bottom-color:#1b1d22; }
#mod-mindmap .mm-canvas-container { flex:1; position:relative; overflow:hidden; background:var(--mm-bg-canvas); cursor:grab; border-radius:var(--radius-sm); border:1px solid var(--mm-border); min-height:300px; }
#mod-mindmap .mm-canvas-container.grabbing { cursor:grabbing; }
#mod-mindmap .mm-canvas-container.selecting { cursor:crosshair; }
#mod-mindmap .mm-canvas-bg { position:absolute; top:0; left:0; width:100%; height:100%; pointer-events:none; background-image:radial-gradient(circle, var(--mm-border) 1px, transparent 1px); background-size:20px 20px; opacity:0.7; z-index:0; }
#mod-mindmap .mm-canvas-bg.hidden { display:none; }
#mod-mindmap .mm-canvas-world { position:absolute; top:0; left:0; transform-origin:0 0; will-change:transform; z-index:1; }
#mod-mindmap .mm-connections-svg { position:absolute; top:0; left:0; width:10000px; height:10000px; pointer-events:none; overflow:visible; }
#mod-mindmap .mm-connections-svg path { fill:none; stroke-width:2.5; stroke-linecap:round; opacity:0.55; }
#mod-mindmap .mm-node { position:absolute; min-width:48px; max-width:420px; min-height:32px; background:var(--mm-bg-panel); border:2px solid var(--accent); border-radius:var(--radius-xs); padding:6px 16px; cursor:move; user-select:none; box-shadow:var(--mm-shadow-sm); transition: box-shadow var(--mm-transition) var(--ease-out), transform var(--mm-transition) var(--ease-out), border-color var(--mm-transition) var(--ease-out); display:flex; align-items:center; gap:6px; z-index:1; }
#mod-mindmap .mm-node:hover { box-shadow:var(--mm-shadow-md); z-index:2; }
#mod-mindmap .mm-node.selected { box-shadow:0 0 0 3px var(--mm-primary-light), 0 8px 24px var(--accent-glow); z-index:3; transform:translateY(-1px); }
#mod-mindmap .mm-node.dimmed { opacity:0.25; }
#mod-mindmap .mm-node.matched { box-shadow:0 0 0 3px var(--accent-glow), var(--mm-shadow-md); }
#mod-mindmap .mm-node .mm-node-text { flex:1; font-family:var(--font-sans); font-size:14px; font-weight:500; color:var(--mm-text-primary); line-height:1.5; overflow-wrap:break-word; word-break:keep-all; white-space:pre-wrap; padding:2px 0; }
#mod-mindmap .mm-collapse-btn { position:absolute; left:-13px; top:50%; transform:translateY(-50%); width:26px; height:26px; border:2px solid var(--mm-border); border-radius:50%; background:var(--mm-bg-panel); color:var(--mm-text-muted); cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; z-index:3; transition: all var(--mm-transition) var(--ease-out); box-shadow:var(--mm-shadow-sm); }
#mod-mindmap .mm-collapse-btn:hover, #mod-mindmap .mm-collapse-btn:active { background:var(--accent); color:#fff; border-color:var(--accent); }
.dark #mod-mindmap .mm-collapse-btn:hover { color:var(--on-primary); }
#mod-mindmap .mm-note-badge { position:absolute; top:-8px; right:-8px; width:20px; height:20px; border-radius:50%; background:var(--warning-weak); color:var(--warning); display:flex; align-items:center; justify-content:center; font-size:10px; cursor:help; z-index:2; box-shadow:var(--mm-shadow-sm); border:1px solid var(--warning); }
#mod-mindmap .mm-note-tooltip { display:none; position:absolute; bottom:calc(100% + 6px); right:0; min-width:160px; max-width:280px; padding:8px 12px; background:#1b1d22; color:var(--text-primary); font-size:12px; line-height:1.5; border-radius:var(--radius-2xs); white-space:pre-wrap; word-break:break-word; z-index:100; pointer-events:none; box-shadow:var(--mm-shadow-lg); border:1px solid var(--border-strong); }
.dark #mod-mindmap .mm-note-tooltip { color:var(--text-primary); }
@keyframes mmNodeAppear { from { opacity:0; transform:scale(0.85); } to { opacity:1; transform:scale(1); } }
#mod-mindmap .mm-node.animate-in { animation:mmNodeAppear 0.2s ease-out; }
#mod-mindmap .mm-box-select { position:absolute; border:1.5px solid var(--accent); background:var(--accent-weak); border-radius:var(--radius-2xs); pointer-events:none; z-index:100; }
.mm-panel-overlay { display:none; position:fixed; inset:0; background:rgba(20,19,15,0.3); z-index:40; opacity:0; transition: opacity 0.25s var(--ease-out); }
.mm-panel-overlay.show { display:block; opacity:1; }
.mm-property-panel { position:fixed; right:0; top:56px; bottom:0; width:260px; display:flex; flex-direction:column; background:var(--mm-bg-panel); border-left:1px solid var(--mm-border); transform:translateX(0); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); z-index:60; box-shadow:var(--mm-shadow-md); }
.mm-property-panel:not(.open) { transform:translateX(100%); }
@media (max-width:768px) { .mm-property-panel { top:0; width:85vw; max-width:340px; z-index:60; } }
.mm-panel-header { display:flex; align-items:center; justify-content:space-between; height:44px; padding:0 14px; border-bottom:1px solid var(--mm-border); flex-shrink:0; }
.mm-panel-title { font-size:14px; font-weight:600; color:var(--mm-text-primary); }
.mm-panel-close { width:32px; height:32px; border:none; background:transparent; border-radius:var(--radius-2xs); cursor:pointer; color:var(--mm-text-muted); display:flex; align-items:center; justify-content:center; transition: all 0.2s var(--ease-out); font-size:16px; }
.mm-panel-close:hover { background:var(--mm-bg-muted); color:var(--mm-text-primary); }
.mm-panel-body { flex:1; overflow-y:auto; padding:14px; }
.mm-panel-body::-webkit-scrollbar { width:4px; }
.mm-panel-body::-webkit-scrollbar-thumb { background:var(--mm-border); border-radius:4px; }
.mm-panel-empty { display:flex; align-items:center; justify-content:center; height:100%; color:var(--mm-text-muted); font-size:13px; }
.mm-panel-section { margin-bottom:14px; }
.mm-panel-section:last-child { margin-bottom:0; }
.mm-panel-section-title { display:flex; align-items:center; gap:8px; font-size:11px; font-weight:600; color:var(--mm-text-muted); margin-bottom:10px; text-transform:uppercase; letter-spacing:0.5px; }
.mm-panel-textarea { width:100%; min-height:60px; padding:10px 14px; border:1.5px solid var(--mm-border); border-radius:var(--radius-2xs); background:var(--mm-bg-panel); color:var(--mm-text-primary); font-size:13px; font-family:inherit; resize:vertical; outline:none; transition: all 0.2s var(--ease-out); line-height:1.6; }
.mm-panel-textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--mm-primary-light); }
.mm-panel-textarea::placeholder { color:var(--mm-text-muted); }
.mm-panel-divider { height:1px; background:var(--mm-border); margin:16px 0; }
.mm-color-picker { display:flex; flex-wrap:wrap; gap:6px; }
.mm-color-swatch { width:28px; height:28px; border-radius:50%; border:2.5px solid transparent; cursor:pointer; transition: all 0.2s var(--ease-out); box-shadow:0 1px 3px rgb(26 24 20 / 0.06); flex-shrink:0; }
.mm-color-swatch:hover { transform:scale(1.12); box-shadow:var(--mm-shadow-md); }
.mm-color-swatch.active { border-color:var(--mm-text-primary); transform:scale(1.12); box-shadow:0 0 0 2px var(--mm-bg-panel), 0 0 0 4px var(--mm-text-primary); }
.mm-color-swatch.custom { position:relative; border:1.5px solid var(--mm-border); overflow:hidden; background:conic-gradient(red,yellow,lime,aqua,blue,magenta,red); }
.mm-color-swatch.custom input[type="color"] { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.mm-panel-save-btn { width:100%; height:40px; display:flex; align-items:center; justify-content:center; gap:8px; border:none; border-radius:var(--radius-2xs); background:var(--accent); color:#fff; font-size:13px; font-weight:500; cursor:pointer; transition: all 0.2s var(--ease-out); font-family:var(--font-sans); }
.dark .mm-panel-save-btn { color:var(--on-primary); }
.mm-panel-save-btn:hover { background:var(--accent-hover); }
.mm-panel-save-btn:active { transform:scale(0.97); }
#mod-mindmap .mm-status-bar { position:absolute; bottom:12px; left:12px; display:flex; align-items:center; gap:14px; padding:6px 14px; background:var(--mm-bg-panel); border:1px solid var(--mm-border); border-radius:var(--radius-2xs); font-size:11px; color:var(--mm-text-muted); box-shadow:var(--mm-shadow-sm); z-index:10; }
#mod-mindmap .mm-status-bar .mm-sep { width:1px; height:14px; background:var(--mm-border); }
#mod-mindmap .mm-status-bar .mm-stat-item { display:flex; align-items:center; gap:4px; }
#mod-mindmap .mm-status-bar .mm-stat-value { font-weight:600; color:var(--mm-text-primary); }
.mm-inline-editor { animation:mmEditorIn 0.15s ease-out; }
@keyframes mmEditorIn { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }
.mm-inline-editor-textarea { word-break:break-all; white-space:pre-wrap; font-family:inherit; }
.mm-inline-editor-btn { padding:6px 16px; border:none; border-radius:var(--radius-2xs); font-size:12px; font-weight:500; cursor:pointer; transition: all 0.2s var(--ease-out); font-family:var(--font-sans); }
.mm-inline-editor-btn:hover { filter:brightness(1.05); }
.mm-inline-editor-btn:active { transform:scale(0.95); }
.mm-inline-editor-btn-cancel { background:var(--mm-bg-muted); color:var(--mm-text-muted); }
.mm-inline-editor-btn-cancel:hover { background:var(--mm-bg-hover); }
.mm-inline-editor-btn-save { background:var(--accent); color:#fff; }
.dark .mm-inline-editor-btn-save { color:var(--on-primary); }
.mm-inline-editor-btn-save:hover { background:var(--accent-hover); }

/* ===== Habit (打卡) ===== */
.habit-day { width:32px; height:32px; border-radius:var(--radius-xs); display:flex; align-items:center; justify-content:center; font-size:var(--fs-1); font-weight:600; background:var(--surface-2); transition: .1s var(--ease-out); cursor:pointer; color:var(--text-muted); border:1px solid var(--border); }
.habit-day.checked { background:var(--success); color:#fff; border-color:var(--success); }
.habit-day.skipped { background:var(--warning); color:#fff; border-color:var(--warning); }
.habit-day.failed { background:var(--danger); color:#fff; border-color:var(--danger); }
.habit-day.today-hl { outline:2px solid var(--accent); outline-offset:2px; }
.habit-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 12px 12px; transition: border-color .1s var(--ease-out); margin-bottom:10px; position:relative; }
.habit-card:hover { border-color:var(--border-strong); }
.habit-stat-card { background:var(--surface); border-radius:var(--radius); padding:10px 4px; text-align:center; border:1px solid var(--border); }
.habit-stat-card .stat-value { font-size:1.1rem; font-weight:700; line-height:1.2; color:var(--text-primary); display:flex; align-items:center; justify-content:center; font-variant-numeric:tabular-nums; }
.habit-stat-card .stat-label { font-size:.6rem; color:var(--text-muted); font-weight:500; margin-top:2px; }
.habit-status-btn { padding:4px 8px; border-radius:var(--radius-pill); font-size:var(--fs-1); font-weight:600; border:2px solid transparent; touch-action:manipulation; user-select:none; min-width:34px; text-align:center; background:var(--surface-2); color:var(--text-muted); border-color:var(--border); transition: .1s var(--ease-out); cursor:pointer; }
.habit-status-btn:active { transform:scale(.92); }
.habit-status-btn.active-check { background:var(--success); color:#fff; border-color:var(--success); }
.habit-status-btn.active-skip { background:var(--warning); color:#fff; border-color:var(--warning); }
.habit-status-btn.active-fail { background:var(--danger); color:#fff; border-color:var(--danger); }
.habit-badge { background:var(--surface-3); padding:2px 8px; border-radius:var(--radius-pill); font-size:.65rem; font-weight:600; color:var(--text-secondary); display:inline-flex; align-items:center; gap:3px; }
.habit-icon-trigger { display:flex; align-items:center; gap:10px; padding:10px 14px; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius); cursor:pointer; transition: .1s var(--ease-out); font-size:var(--fs-3); color:var(--text-secondary); }
.habit-icon-trigger:hover { border-color:var(--border-strong); }
.habit-menu-dropdown { background:var(--surface); border-radius:var(--radius); box-shadow:var(--shadow-lg); border:1px solid var(--border); min-width:120px; padding:4px 0; }
.habit-menu-dropdown .menu-item { padding:8px 14px; font-size:var(--fs-1); color:var(--text-primary); cursor:pointer; width:100%; border:none; background:transparent; display:flex; align-items:center; gap:10px; font-family:var(--font-sans); }
.habit-menu-dropdown .menu-item:hover { background:var(--surface-3); }
.habit-menu-dropdown .menu-item.danger { color:var(--danger); }

/* ===== Notes ===== */
.note-sidebar { width:280px; flex-shrink:0; border-right:1px solid var(--border); overflow-y:auto; padding:12px; background:var(--surface); }
.note-item { padding:12px; border-radius:var(--radius-sm); cursor:pointer; margin-bottom:6px; transition: .15s var(--ease-out); border:1px solid transparent; }
.note-item:hover { background:var(--accent-weak); }
.note-item.active { background:var(--accent-weak); border-color:var(--accent); }
.note-editor { flex:1; display:flex; flex-direction:column; padding:20px; align-items:center; }
.note-editor > * { width:100%; max-width:680px; }
.note-title-input { font-family:var(--font-display); font-size:1.6rem; font-weight:600; border:none; outline:none; background:transparent; width:100%; max-width:680px; margin:0 auto 12px; color:inherit; letter-spacing:-0.02em; font-optical-sizing:auto; }
.note-content-area { flex:1; width:100%; max-width:680px; margin:0 auto; border:none; outline:none; background:transparent; resize:none; font-size:var(--fs-3); line-height:1.7; color:inherit; font-family:var(--font-sans); }

/* ============================================================
   Flow Brain · 首页聚合区
   ============================================================ */
.brain-header { display:flex; justify-content:space-between; align-items:flex-end; gap:12px; margin-bottom:20px; flex-wrap:wrap; position:relative; }
.brain-header-main { min-width:0; }
.brain-date { font-family:var(--font-display); font-size:clamp(2rem, 4vw, 2.9rem); font-weight:600; color:var(--text-primary); letter-spacing:-0.035em; font-optical-sizing:auto; line-height:1.02; }
.brain-greeting { font-size:var(--fs-3); color:var(--text-secondary); margin-top:6px; }

/* ===== 签名绘制线：首屏 hero 下方一道朱红发丝，载入时从左向右绘制 ===== */
.brain-draw { height:2px; width:100%; max-width:160px; margin:14px 0 4px; position:relative; overflow:hidden; border-radius:2px; background:var(--border); }
.brain-draw::after {
  content:""; position:absolute; inset:0; transform-origin:left center;
  background:var(--accent);
  animation: brainDraw 1.1s var(--ease-out) .25s both;
}
@keyframes brainDraw { from { transform:scaleX(0); } to { transform:scaleX(1); } }

.bw-progress { height:6px; border-radius:var(--radius-2xs); background:var(--surface-3); overflow:hidden; }
.bw-progress-bar { height:100%; border-radius:var(--radius-2xs); transition: width .4s var(--ease-out); }
.bw-task { display:flex; align-items:center; gap:8px; }
.bw-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; background:var(--text-muted); }
.bw-dot.on { background:var(--success); }
.bw-task-text { color:var(--text-secondary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:flex; flex-direction:column; }
.bw-task-text.done { text-decoration:line-through; color:var(--text-muted); }
.bw-sub { font-size:.68rem; color:var(--text-muted); }

/* ============================================================
   Daily · 每日计划
   ============================================================ */
.daily-header { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.daily-date { font-family:var(--font-display); font-size:1.3rem; font-weight:600; color:var(--text-primary); letter-spacing:-0.02em; font-optical-sizing:auto; }
.daily-greeting { font-size:var(--fs-2); color:var(--text-muted); margin-top:2px; }
.daily-header-left { display:flex; flex-direction:column; gap:2px; min-width:0; }
.daily-header-right { display:flex; align-items:center; gap:16px; flex-wrap:wrap; justify-content:flex-end; }
.daily-energy-inline { display:flex; align-items:center; gap:4px; }
.daily-status-label { font-size:var(--fs-2); font-weight:600; color:var(--text-muted); }
.daily-energy-btn {
  font-size:1.25rem; background:transparent; border:2px solid transparent; border-radius:var(--radius-xs);
  width:30px; height:30px; cursor:pointer; transition: .12s var(--ease-out); filter:grayscale(.55); opacity:.4;
}
.daily-energy-btn:hover { transform:scale(1.1); opacity:1; filter:none; }
.daily-energy-btn.active { border-color:rgba(63,157,106,0.6); background:var(--success-weak); opacity:1; filter:none; box-shadow:0 2px 8px var(--success-weak); }
.daily-energy-btn:not(.active) { opacity:.4; filter:grayscale(.55); }
.daily-mood-pick { display:flex; gap:2px; flex-wrap:wrap; }
.daily-mood-btn {
  font-size:1.05rem; background:transparent; border:2px solid transparent; border-radius:var(--radius-sm);
  width:34px; height:34px; cursor:pointer; transition: .12s var(--ease-out); filter:grayscale(0.4); opacity:.7;
}
.daily-mood-btn:hover { transform:scale(1.1); opacity:1; filter:none; }
.daily-mood-btn.active { border-color:var(--accent); background:var(--accent-weak); opacity:1; filter:none; }

.daily-section { margin-bottom:var(--space-4); padding:var(--space-4); border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); }
.daily-section-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:var(--space-3); }
.daily-section-head h3 { font-size:var(--fs-3); font-weight:700; display:flex; align-items:center; gap:6px; }
.daily-count { font-size:var(--fs-1); color:var(--text-muted); background:var(--surface-3); padding:2px 10px; border-radius:var(--radius-pill); }
.daily-topgoal-input, .daily-task-input { display:flex; gap:8px; margin-bottom:10px; flex-wrap:wrap; }
.daily-task-input .form-input { flex:1; min-width:160px; }
.daily-search { position:relative; margin-bottom:12px; }
.daily-search i { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--text-muted); font-size:var(--fs-1); }
.daily-search input { width:100%; padding:8px 12px 8px 32px; border:1px solid var(--border); border-radius:var(--radius-xs); font-size:var(--fs-2); outline:none; background:var(--surface-2); color:var(--text-primary); font-family:var(--font-sans); }
.daily-search input:focus { border-color:var(--accent); }
.daily-list { display:flex; flex-direction:column; gap:8px; }
.daily-item {
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:var(--radius-sm);
  background:var(--surface); border:1px solid var(--border); transition: .12s var(--ease-out);
}
.daily-item:hover { border-color:var(--border-strong); }
.daily-item.done .daily-text { text-decoration:line-through; color:var(--text-muted); }
.daily-item.dragging { opacity:.4; }
.drag-handle { cursor:grab; color:var(--text-muted); font-size:var(--fs-3); user-select:none; }
.daily-check {
  width:20px; height:20px; border-radius:50%; border:2px solid var(--border); background:transparent;
  cursor:pointer; flex-shrink:0; color:#fff; font-size:var(--fs-1); font-weight:700; line-height:1; display:flex; align-items:center; justify-content:center;
}
.daily-check:hover { border-color:var(--success); }
.daily-item.done .daily-check { background:var(--success); border-color:var(--success); }
.daily-text { flex:1; min-width:0; font-size:var(--fs-3); color:var(--text-secondary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.daily-prio { width:20px; height:20px; border-radius:var(--radius-2xs); color:#fff; font-size:.65rem; font-weight:700; cursor:pointer; flex-shrink:0; border:none; display:flex; align-items:center; justify-content:center; }
.daily-badges { display:flex; gap:4px; flex-wrap:wrap; flex-shrink:0; }
.daily-chip { font-size:.65rem; padding:2px 7px; border-radius:var(--radius-xs); background:var(--surface-3); color:var(--text-muted); white-space:nowrap; }
.daily-chip.deadline { background:var(--warning-weak); color:var(--warning); }
.daily-chip.cat { background:var(--violet-weak); color:var(--violet); }
.daily-chip.habit { background:var(--success-weak); color:var(--success); }
.daily-chip.focus { background:var(--accent-weak); color:var(--accent); }
.daily-chip.note { background:var(--warning-weak); color:var(--warning); }
.daily-actions { display:flex; gap:2px; flex-shrink:0; }
.daily-act { background:transparent; border:none; color:var(--text-muted); cursor:pointer; padding:4px 6px; border-radius:var(--radius-2xs); font-size:var(--fs-2); transition: .12s var(--ease-out); }
.daily-act:hover { background:var(--accent-weak); color:var(--accent); }
.daily-act.del:hover { background:var(--danger-weak); color:var(--danger); }
.daily-del { background:transparent; border:none; color:var(--text-muted); cursor:pointer; padding:4px 6px; border-radius:var(--radius-2xs); }
.daily-del:hover { color:var(--danger); }
.daily-empty { text-align:center; padding:20px 0; color:var(--text-muted); }
.daily-empty i { font-size:2rem; color:var(--text-muted); display:block; margin-bottom:6px; }
.daily-empty-inline { color:var(--text-muted); font-size:var(--fs-2); padding:8px 4px; text-align:center; }
.daily-two-col { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.daily-two-col .form-textarea { min-height:90px; }
@media (max-width:768px) { .daily-two-col { grid-template-columns:1fr; } }

/* ===== 本周 7 天看板 ===== */
.plan-week { display:grid; grid-template-columns:repeat(7,1fr); gap:8px; }
@media (max-width:900px) { .plan-week { grid-template-columns:repeat(3,1fr); } }
@media (max-width:768px) {
  .plan-week { display:flex; flex-wrap:nowrap; overflow-x:auto; gap:10px; padding-bottom:8px; scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch; }
  .plan-day { flex:0 0 auto; width:72vw; max-width:260px; scroll-snap-align:start; }
}
.plan-day { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:8px; display:flex; flex-direction:column; min-height:120px; transition: border-color .15s var(--ease-out); }
.plan-day:hover { border-color:var(--border-strong); }
.plan-day-today { border-color:var(--violet); box-shadow:0 0 0 2px var(--violet-weak); }
.plan-day-head { display:flex; justify-content:space-between; align-items:center; font-size:var(--fs-2); font-weight:700; color:var(--text-secondary); margin-bottom:6px; }
.plan-day-date { font-size:.66rem; color:var(--text-muted); font-weight:600; }
.plan-day-list { flex:1; display:flex; flex-direction:column; gap:5px; }
.plan-task { display:flex; align-items:center; gap:5px; padding:5px 6px; border-radius:var(--radius-2xs); background:var(--violet-weak); font-size:var(--fs-1); cursor:grab; }
.plan-task:active { cursor: grabbing; }
.plan-task-dragging { opacity: .45; }
.plan-task.done { opacity:.55; text-decoration:line-through; }
.plan-task.done .plan-task-title { text-decoration:line-through; }
.plan-check { width:20px; height:20px; border-radius:50%; border:1.5px solid var(--border); background:transparent; color:var(--success); cursor:pointer; flex-shrink:0; font-size:.6rem; line-height:1; display:flex; align-items:center; justify-content:center; }
.plan-task.done .plan-check { border-color:var(--success); background:var(--success); color:#fff; }
.plan-task-title { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text-secondary); }
.plan-task-actions { display:flex; gap:1px; flex-shrink:0; }
.plan-act { background:transparent; border:none; color:var(--text-muted); cursor:pointer; padding:1px 3px; border-radius:var(--radius-2xs); font-size:var(--fs-1); }
.plan-act:hover { background:var(--violet-weak); color:var(--violet); }
.plan-act.del:hover { background:var(--danger-weak); color:var(--danger); }
.plan-add { margin-top:6px; border:1px dashed var(--border); background:transparent; color:var(--text-muted); border-radius:var(--radius-2xs); padding:4px; font-size:var(--fs-1); cursor:pointer; transition: .12s var(--ease-out); }
.plan-add:hover { border-color:var(--violet); color:var(--violet); }
.plan-empty { text-align:center; color:var(--text-muted); font-size:var(--fs-3); padding:8px 0; }
.plan-day.drag-over { outline: 2px dashed var(--accent); outline-offset: -4px; background:var(--accent-weak); }

/* ============================================================
   Weekly · 每周总结
   ============================================================ */
.weekly-section { padding:var(--space-4); border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); }
.weekly-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:var(--space-3); margin-bottom:var(--space-4); }
.weekly-stat { text-align:center; padding:14px 8px; background:var(--surface-2); border-radius:var(--radius); border:1px solid var(--border); }
.ws-val { font-family:var(--font-display); font-size:1.5rem; font-weight:600; color:var(--text-primary); font-variant-numeric:tabular-nums; letter-spacing:-0.02em; }
.ws-label { font-size:var(--fs-1); color:var(--text-muted); margin-top:2px; }
.ws-sub { font-size:.68rem; color:var(--text-muted); }
.weekly-fields { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; }
.weekly-field { display:flex; flex-direction:column; gap:4px; }
.weekly-field label { font-size:var(--fs-2); font-weight:600; color:var(--text-secondary); }
.weekly-field .form-textarea { min-height:84px; font-size:var(--fs-2); }
.weekly-hist { padding:10px 0; border-bottom:1px solid var(--border); }
.weekly-hist-range { font-size:var(--fs-2); font-weight:600; color:var(--text-secondary); }
.weekly-hist-stats { display:flex; gap:12px; font-size:var(--fs-1); color:var(--text-muted); margin:3px 0; }
.weekly-hist-ach { font-size:var(--fs-1); color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media (max-width:768px) { .weekly-stats { grid-template-columns:repeat(2,1fr); } .weekly-fields { grid-template-columns:1fr; } }


/* ============================================================
   Journal · 日记
   ============================================================ */
.journal-header { display:flex; justify-content:space-between; align-items:flex-end; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.journal-today-hint { font-size:var(--fs-2); font-weight:600; color:var(--text-muted); }
.journal-compose { padding:var(--space-4); margin-bottom:var(--space-4); border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); }
.journal-title-input { width:100%; margin-bottom:8px; font-family:var(--font-display); font-size:1.3rem; font-weight:600; letter-spacing:-0.02em; }
.journal-content { width:100%; min-height:64px; resize:vertical; font-size:var(--fs-3); margin-bottom:14px; }
.journal-fixed-tags-label { font-size:var(--fs-1); font-weight:600; color:var(--text-muted); margin-bottom:6px; }
.journal-fixed-tags { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:14px; }
.journal-fixed-tag {
  font-size:var(--fs-1); font-weight:600; padding:5px 12px; border-radius:var(--radius-pill); cursor:pointer;
  border:1px solid transparent; background:var(--surface-3); color:var(--text-muted); transition: .12s var(--ease-out);
}
.journal-fixed-tag:hover { border-color:var(--pink); color:var(--pink); }
.journal-fixed-tag.active { background:var(--pink-weak); color:var(--pink); border-color:var(--pink); }
.journal-fixed-tag.custom { background:var(--pink-weak); color:var(--pink); border-color:var(--pink); }
.journal-fixed-tag.custom i { font-size:.66rem; margin-left:2px; }
.journal-tag-add { display:flex; gap:8px; margin-top:8px; }
.journal-tag-add .form-input { flex:1; min-height:34px; height:34px; }
.journal-tag-add .btn-sm { flex:0 0 auto; }
.journal-tags-empty { font-size:var(--fs-1); color:var(--text-muted); font-weight:500; }
.journal-compose-foot { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.journal-save-hint { font-size:var(--fs-1); color:var(--text-muted); }
.journal-toolbar { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.journal-tags-filter { display:flex; gap:6px; flex-wrap:wrap; flex:1; }
.journal-tag-filter {
  font-size:var(--fs-1); font-weight:600; padding:4px 10px; border-radius:var(--radius-pill); cursor:pointer;
  border:1px solid transparent; background:var(--surface-3); color:var(--text-muted); transition: .12s var(--ease-out);
}
.journal-tag-filter span { opacity:.7; font-weight:500; }
.journal-tag-filter.active { background:var(--pink-weak); color:var(--pink); border-color:var(--pink); }
.journal-search { max-width:220px; min-width:120px; }
.journal-timeline { display:flex; flex-direction:column; gap:18px; }
.journal-bucket-title { font-size:var(--fs-2); font-weight:700; color:var(--text-muted); margin-bottom:8px; padding-left:4px; border-left:3px solid var(--pink); }
.journal-bucket { display:flex; flex-direction:column; gap:10px; }
.journal-bucket-items { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 320px)); gap:12px; align-items:start; justify-content:start; }
.journal-entry { padding:14px; border-radius:var(--radius); background:var(--surface); border:1px solid var(--border); transition: .12s var(--ease-out); }
.journal-entry:hover { border-color:var(--border-strong); }
.journal-entry-head { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.journal-type-chip { font-size:.68rem; font-weight:600; padding:3px 9px; border-radius:var(--radius-pill); background:color-mix(in srgb, var(--c) 16%, transparent); color:var(--c); white-space:nowrap; }
.journal-entry-title { font-size:var(--fs-3); font-weight:700; color:var(--text-secondary); flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.journal-related { color:var(--text-muted); font-size:var(--fs-1); }
.journal-del { background:transparent; border:none; color:var(--text-muted); cursor:pointer; padding:2px 6px; border-radius:var(--radius-2xs); }
.journal-del:hover { color:var(--danger); }
.journal-edit { background:transparent; border:none; color:var(--text-muted); cursor:pointer; padding:2px 6px; border-radius:var(--radius-2xs); margin-left:auto; }
.journal-edit:hover { color:var(--accent); }
.journal-edit-form { display:flex; flex-direction:column; gap:12px; }
.journal-edit-form .journal-fixed-tags-label:first-of-type { margin-top:4px; }
.journal-entry-content { font-size:.86rem; color:var(--text-secondary); line-height:1.6; white-space:pre-wrap; word-break:break-word; }
.journal-entry-foot { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:8px; font-size:var(--fs-1); color:var(--text-muted); }
.journal-tag { padding:2px 8px; border-radius:var(--radius-xs); background:var(--pink-weak); color:var(--pink); }
.journal-stars { color:var(--warning); letter-spacing:1px; }
.journal-mood { font-size:var(--fs-3); }
.journal-date { margin-left:auto; }
.journal-empty { text-align:center; padding:40px 0; color:var(--text-muted); }
.journal-empty i { font-size:2.4rem; color:var(--text-muted); display:block; margin-bottom:10px; }
@media (max-width:768px) { .journal-compose-foot { flex-wrap:wrap; } .journal-search { max-width:none; width:100%; } .journal-bucket-items { grid-template-columns:1fr; } }

/* ===== 侧栏分组（5.0） ===== */
.nav-group { margin-top:8px; }
.nav-group-title { font-size:var(--fs-1); font-weight:600; color:var(--text-muted); padding:10px 16px 4px; letter-spacing:.06em; text-transform:uppercase; cursor:pointer; display:flex; align-items:center; justify-content:space-between; user-select:none; }
.nav-group-title i { transition: transform .2s var(--ease-out); font-size:.7rem; opacity:.55; }
.nav-group-tools > .nav-group-title { cursor:pointer; display:flex; align-items:center; justify-content:space-between; }
#navCore.collapsed, #navTools.collapsed { display:none; }
.weekly-fields.collapsed { display:none; }
.weekly-fields-head:hover { color:var(--text-primary); }

/* ===== 6.0 Flow Brain 首页三区 ===== */
.brain-card { padding:var(--space-4); }
.brain-q-title { font-size:var(--fs-3); font-weight:700; color:var(--text-secondary); margin-bottom:10px; display:flex; align-items:center; gap:8px; }
.brain-zone { display:flex; flex-direction:column; gap:0; }
.bz-row { display:flex; align-items:center; gap:10px; padding:11px 2px; border-bottom:1px solid var(--border); }
.bz-row:last-child { border-bottom:none; }
.bz-row.done .bz-text { text-decoration:line-through; color:var(--text-muted); }
.bz-check { width:20px; height:20px; border-radius:50%; border:2px solid var(--border); display:inline-flex; align-items:center; justify-content:center; font-size:var(--fs-1); color:white; flex:0 0 auto; cursor:pointer; transition: border-color .12s var(--ease-out), background .12s var(--ease-out); }
.bz-check:hover { border-color:var(--success); }
.bz-check.on { background:var(--success); border-color:var(--success); }
.bz-dot { width:8px; height:8px; border-radius:50%; background:var(--violet); flex:0 0 auto; }
.bz-text { flex:1; font-size:var(--fs-2); color:var(--text-secondary); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bz-tag { font-size:.65rem; padding:2px 8px; border-radius:var(--radius-xs); background:var(--success-weak); color:var(--success); flex:0 0 auto; }
.bz-rel { font-size:var(--fs-1); color:var(--text-muted); font-weight:600; flex:0 0 auto; min-width:48px; }
.bz-anniv { font-size:var(--fs-2); flex:0 0 auto; line-height:1; }
.bz-time { font-size:var(--fs-1); color:var(--text-muted); flex:0 0 auto; }
.bz-more { font-size:var(--fs-2); color:var(--violet); cursor:pointer; padding:4px 2px; }
.bz-more:hover { text-decoration:underline; }
.bz-empty { font-size:var(--fs-2); color:var(--text-muted); padding:18px 14px; text-align:center; background:var(--surface-2); border:1px dashed var(--border); border-radius:var(--radius-sm); }
.bz-empty i { font-size:1.6rem; display:block; margin-bottom:8px; color:var(--accent); opacity:.7; }
.bz-empty p { margin:0 0 3px; font-weight:600; color:var(--text-secondary); }
.bz-empty span { display:block; font-size:var(--fs-2); color:var(--text-muted); line-height:1.6; }
.bz-edit { font-size:var(--fs-1); color:var(--text-muted); cursor:pointer; flex:0 0 auto; padding:2px 6px; border-radius:var(--radius-2xs); transition: .12s var(--ease-out); }
.bz-edit:hover { color:var(--accent); background:var(--accent-weak); }

/* ===== 6.0 首页区：本周主题 / 今日重点 / 本周计划 / 未来30天 ===== */
.brain-theme { font-size:var(--fs-3); color:var(--text-secondary); margin-top:10px; font-weight:600; }
.brain-theme-label { font-size:var(--fs-1); color:var(--success); margin-right:8px; font-weight:700; }
.brain-theme-empty { font-size:var(--fs-2); color:var(--text-muted); font-weight:400; }

/* ===== 首页三区网格（恢复原两列布局，第三块横跨整行） ===== */
.brain-grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:20px; }
.brain-grid .brain-card:nth-child(3) { grid-column: 1 / -1; }

/* ===== 首页：AI 快捷入口 ===== */
.brain-ai-btn {
  display:inline-flex; align-items:center; gap:8px; flex:0 0 auto;
  padding:10px 18px; border-radius:var(--radius-pill);
  border:1px solid var(--border); background:var(--surface); color:var(--accent);
  font-weight:700; font-size:var(--fs-2); cursor:pointer; white-space:nowrap;
  box-shadow:var(--shadow-sm); transition:all .18s var(--ease-out);
}
.brain-ai-btn:hover { background:var(--accent-weak); border-color:var(--accent); transform:translateY(-1px); }
.brain-ai-btn i { font-size:var(--fs-3); }

/* ===== 首页：今日许昌天气 ===== */
.brain-weather { margin-top:20px; margin-bottom:0; }
.brain-weather .brain-q-title { margin-bottom:12px; }
/* 首页天气缩小版：移入网格首格（原"今日重点"位置） */
.brain-grid .brain-weather-inline { padding:var(--space-3); }
.brain-grid .brain-weather-inline .brain-q-title { margin-bottom:8px; font-size:var(--fs-2); }
.brain-grid .brain-weather-inline .brain-weather-summary { gap:10px; margin-bottom:8px; }
.brain-grid .brain-weather-inline .brain-weather-icon { font-size:2rem; }
.brain-grid .brain-weather-inline .brain-weather-temp { font-size:1.5rem; }
.brain-grid .brain-weather-inline .brain-weather-desc { font-size:var(--fs-1); }
.brain-grid .brain-weather-inline .brain-weather-chips { gap:5px; margin:8px 0 8px; }
.brain-grid .brain-weather-inline .brain-weather-chip { font-size:11px; padding:2px 7px; }
.brain-grid .brain-weather-inline .brain-weather-sun { gap:12px; margin:0 0 8px; }
.brain-grid .brain-weather-inline .brain-weather-more { margin-top:0; }
.brain-weather-refresh {
  margin-left:auto; width:30px; height:30px; border-radius:50%;
  border:1px solid var(--border); background:var(--surface-2); color:var(--text-muted);
  cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
  font-size:var(--fs-2); transition:all .15s var(--ease-out);
}
.brain-weather-refresh:hover { color:var(--accent); border-color:var(--accent); background:var(--accent-weak); }
.brain-weather-body { font-size:var(--fs-2); color:var(--text-secondary); line-height:1.7; }
.brain-weather-loading { color:var(--text-muted); }
.brain-weather-summary { display:flex; align-items:center; gap:14px; margin-bottom:10px; }
.brain-weather-icon { font-size:2.6rem; color:var(--accent); flex:0 0 auto; line-height:1; }
.brain-weather-now { display:flex; flex-direction:column; }
.brain-weather-temp { font-size:2rem; font-weight:700; color:var(--text-primary); line-height:1; }
.brain-weather-desc { font-size:var(--fs-2); color:var(--text-secondary); margin-top:4px; }
/* 指标改为统一小药丸标签，与其它模块（.bz-tag）风格对齐 */
.brain-weather-chips { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0 12px; }
.brain-weather-chip {
  display:inline-flex; align-items:baseline; gap:4px;
  font-size:var(--fs-1); color:var(--text-muted);
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:var(--radius-xs); padding:3px 9px; line-height:1.55;
  white-space:nowrap;
}
.brain-weather-chip b { color:var(--text-secondary); font-weight:600; }
/* 日出 / 日落 */
.brain-weather-sun { display:flex; flex-wrap:wrap; gap:18px; margin:0 0 12px; font-size:var(--fs-1); color:var(--text-secondary); }
.brain-weather-sun span { display:inline-flex; align-items:center; gap:6px; }
.brain-weather-sun i { color:var(--accent); font-size:.95rem; }
.brain-weather-more { margin-top:2px; }
.brain-weather-link { font-size:var(--fs-1); color:var(--accent); cursor:pointer; transition:opacity .15s var(--ease-out); }
.brain-weather-link:hover { opacity:.78; text-decoration:underline; }
.brain-weather-brief { border-top:1px solid var(--border); padding-top:12px; margin-top:4px; }
.brain-weather-brief b { color:var(--text-primary); }
.brain-weather-note {
  margin-top:8px; font-size:var(--fs-1); color:var(--text-muted); line-height:1.6;
  background:var(--surface-2); border:1px dashed var(--border); border-radius:var(--radius-sm); padding:10px 12px;
}
.brain-weather-note i { color:var(--accent); margin-right:4px; }
.brain-weather-src {
  margin-top:10px; font-size:11px; color:var(--text-muted); opacity:.75; letter-spacing:.2px;
  display:flex; align-items:center; gap:4px;
}
.brain-weather-src::before { content:"\f0ec"; font-family:"Font Awesome 6 Free"; font-weight:900; font-size:10px; opacity:.8; }
.brain-weather-actions { margin-top:12px; }
.brain-weather-ai-btn {
  display:inline-flex; align-items:center; gap:6px; cursor:pointer;
  font-size:var(--fs-1); color:var(--accent);
  background:var(--accent-weak); border:1px solid var(--accent-weak);
  border-radius:var(--radius-sm); padding:6px 12px; transition:.15s;
}
.brain-weather-ai-btn:hover { border-color:var(--accent); }
.brain-weather-ai-btn i { font-size:.85em; }

/* ===== 工具：天气（7天预报 + 详细信息） ===== */
.ww-wrap { max-width:900px; margin:0 auto; padding:4px 2px; }
.ww-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.ww-city-pick { display:flex; align-items:center; gap:8px; }
.ww-city-pick > i { color:var(--accent); font-size:1.05rem; }
.ww-city-select { font-size:1rem; font-weight:700; color:var(--text-primary); background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-pill); padding:7px 10px; max-width:200px; cursor:pointer; transition:all .18s var(--ease-out); }
.ww-city-select:hover { border-color:var(--accent); }
.ww-city-select:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-weak); }
.ww-city-add { background:var(--surface-2); border:1px solid var(--border); color:var(--text-secondary); width:32px; height:32px; border-radius:var(--radius-pill); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; transition:all .18s var(--ease-out); }
.ww-city-add:hover { border-color:var(--accent); color:var(--accent); }
.ww-refresh { background:var(--surface-2); border:1px solid var(--border); color:var(--text-secondary); width:38px; height:38px; border-radius:var(--radius-pill); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; transition:all .18s var(--ease-out); }
.ww-refresh:hover { border-color:var(--accent); color:var(--accent); }

.ww-current { display:flex; align-items:center; gap:18px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-xl); padding:22px 24px; margin-bottom:24px; }
.ww-cur-icon { font-size:3.4rem; color:var(--accent); flex:0 0 auto; line-height:1; }
.ww-cur-main { display:flex; flex-direction:column; }
.ww-cur-temp { font-size:2.7rem; font-weight:700; color:var(--text-primary); line-height:1; }
.ww-cur-desc { font-size:1.1rem; color:var(--text-secondary); margin-top:4px; }
.ww-cur-sub { font-size:.85rem; color:var(--text-muted); margin-top:6px; }

.ww-section-title { font-size:.95rem; font-weight:700; color:var(--text-secondary); margin:0 0 12px; }
.ww-forecast { display:grid; grid-template-columns:repeat(7, minmax(0,1fr)); gap:10px; margin-bottom:28px; }
.ww-day { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 8px; text-align:center; display:flex; flex-direction:column; align-items:center; gap:6px; }
.ww-day-name { font-weight:700; color:var(--text-primary); font-size:.9rem; }
.ww-day-date { font-size:.72rem; color:var(--text-muted); }
.ww-day-icon { font-size:1.55rem; color:var(--accent); }
.ww-day-temp { font-size:.85rem; white-space:nowrap; }
.ww-hi { color:var(--text-primary); font-weight:600; }
.ww-lo { color:var(--text-muted); margin-left:4px; }
.ww-day-precip { font-size:.72rem; color:var(--accent); display:flex; align-items:center; gap:3px; }

.ww-details { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px,1fr)); gap:10px; }
.ww-detail { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:12px 14px; }
.ww-detail-label { font-size:.78rem; color:var(--text-muted); margin-bottom:4px; }
.ww-detail-val { font-size:1.05rem; font-weight:600; color:var(--text-primary); }

.ww-loading, .ww-error { color:var(--text-muted); padding:20px; text-align:center; }
.ww-error i { color:var(--danger); margin-right:4px; }

@media (max-width:640px) {
  .ww-forecast { grid-template-columns:none; grid-auto-flow:column; grid-auto-columns:84px; overflow-x:auto; padding-bottom:6px; }
  .ww-cur-temp { font-size:2.2rem; }
  .ww-cur-icon { font-size:2.8rem; }
}

/* ===== 总结模块 ===== */
.summary-wrap { display:flex; flex-direction:column; gap:14px; }
.summary-head { display:flex; justify-content:flex-end; }
.summary-list { display:flex; flex-direction:column; gap:10px; }
.summary-empty { color:var(--text-muted); font-size:var(--fs-1); padding:24px 0; text-align:center; background:var(--surface-2); border:1px dashed var(--border); border-radius:var(--radius); }
.summary-item { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:12px 14px; cursor:pointer; transition:.15s; }
.summary-item:hover { border-color:var(--accent); background:var(--surface-2); }
.summary-item-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.summary-item-title { font-weight:600; color:var(--text-primary); }
.summary-item-type { font-size:11px; color:var(--text-muted); background:var(--surface-2); border:1px solid var(--border); border-radius:999px; padding:1px 8px; flex:0 0 auto; }
.summary-item-meta { margin-top:4px; font-size:var(--fs-1); color:var(--text-muted); }

/* ===== 6.1 Today Lens 快速捕捉 ===== */
.bz-quickadd { display:flex; align-items:center; gap:8px; margin-top:12px; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius); padding:6px 10px; }
.bz-quickadd-input {
  flex:1; height:36px; border-radius:var(--radius-xs); border:1px solid var(--border);
  background:transparent; padding:0 12px; font-size:var(--fs-2); color:var(--text-secondary);
  transition: .15s var(--ease-out); outline:none; font-family:var(--font-sans);
}
.bz-quickadd-input::placeholder { color:var(--text-muted); }
.bz-quickadd-input:focus { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-weak); }
.bz-quickadd .btn-sm { height:36px; padding:0 12px; border-radius:var(--radius-xs); flex:0 0 auto; }
#brainZoneToday .bz-row { cursor:pointer; transition: background .12s var(--ease-out), transform .08s var(--ease-out); }
#brainZoneToday .bz-row:hover { border-color:var(--success); }
#brainZoneToday .bz-row:active { transform:scale(.992); }
.bz-plan-goal { font-size:var(--fs-2); color:var(--text-secondary); background:var(--success-weak); border:1px solid var(--success-weak); border-radius:var(--radius-xs); padding:8px 12px; margin-bottom:10px; }
.bz-plan-goal-label { font-size:var(--fs-1); color:var(--success); font-weight:700; margin-right:8px; }
.bz-plan-days { display:flex; flex-direction:column; gap:8px; }
.bz-plan-day { border:1px solid var(--border); border-radius:var(--radius-sm); padding:10px 14px; background:var(--surface); transition: border-color .15s var(--ease-out); }
.bz-plan-day-today { border-color:var(--success); box-shadow:0 0 0 1px var(--success-weak); background:var(--success-weak); }
.bz-plan-day-head { display:flex; align-items:baseline; gap:8px; margin-bottom:6px; }
.bz-plan-day-head .bz-plan-add { margin-left:auto; width:22px; height:22px; border-radius:50%; border:1px solid var(--border); background:transparent; color:var(--text-muted); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; font-size:.7rem; flex-shrink:0; transition: .12s var(--ease-out); }
.bz-plan-day-head .bz-plan-add:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-weak); }
.bz-plan-day-label { font-size:var(--fs-2); font-weight:700; color:var(--text-primary); }
.bz-plan-day-date { font-size:var(--fs-1); color:var(--text-muted); font-weight:500; }
.bz-plan-day-tasks { display:flex; flex-direction:column; gap:4px; }
.bz-plan-task { display:flex; align-items:center; gap:8px; font-size:var(--fs-2); color:var(--text-secondary); }
.bz-plan-task.done .bz-plan-task-title { text-decoration:line-through; color:var(--text-muted); }
.bz-plan-task-title { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bz-plan-empty { font-size:var(--fs-2); color:var(--text-muted); padding:4px 0; }
.bz-plan-backlog { margin-top:10px; border-top:1px dashed var(--border); padding-top:8px; }
.bz-plan-backlog-head { font-size:var(--fs-1); color:var(--text-muted); font-weight:600; margin-bottom:5px; }
.bz-plan-count { background:var(--violet-weak); color:var(--violet); border-radius:var(--radius-2xs); padding:1px 7px; font-size:var(--fs-1); }
.brain-zone .bz-plan-days { display:grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.brain-zone .bz-plan-day { padding: 10px 12px; border-left: 3px solid var(--border); }
.brain-zone .bz-plan-day-today { border-left-color: var(--success); }

/* ===== 7.0 任务库 ===== */
.task-item { display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); }
.task-item-done { opacity:.6; }
.task-item-main { flex:1; min-width:0; }
.task-item-title { font-size:var(--fs-3); font-weight:600; color:var(--text-secondary); }
.task-item-actions { display:flex; gap:4px; flex:0 0 auto; }
.task-search { width:100%; }
.task-chip { border:1px solid var(--border); background:var(--surface-2); color:var(--text-muted); padding:5px 12px; border-radius:var(--radius-xs); font-size:var(--fs-2); font-weight:600; cursor:pointer; transition: .15s var(--ease-out); }
.task-chip:hover { color:var(--text-secondary); border-color:var(--border-strong); }
.task-chip.active { background:var(--accent); border-color:var(--accent); color:#fff; }
.dark .task-chip.active { color:var(--on-primary); }

/* 日期分组 */
.task-group { margin-top:14px; }
.task-group:first-child { margin-top:0; }
.task-group-head { display:flex; align-items:center; justify-content:space-between; font-size:var(--fs-2); font-weight:700; color:var(--text-muted); padding:2px 4px 8px; letter-spacing:.04em; cursor:pointer; user-select:none; }
.task-group-cnt { font-size:var(--fs-1); color:var(--text-muted); font-weight:600; }
.task-group .task-item + .task-item { margin-top:8px; }
.task-top { padding:var(--space-4); display:flex; flex-direction:column; gap:var(--space-3); border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); }
.task-top-row { display:flex; gap:8px; align-items:center; }
.task-top-row .form-input { flex:1; min-width:0; }
.task-top-chips { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.task-top-chips .task-search { flex:1; min-width:120px; }
.task-group-caret { font-size:.68rem; color:var(--text-muted); transition: transform .15s var(--ease-out); margin-right:2px; }
.task-group.collapsed .task-group-caret { transform:rotate(-90deg); }
.task-group-label { flex:1; }
.task-group-body { margin-top:8px; }
.task-group.collapsed .task-group-body { display:none; }
.task-check { flex:0 0 auto; width:20px; height:20px; border-radius:50%; border:2px solid var(--border); background:transparent; cursor:pointer; transition: .15s var(--ease-out); position:relative; }
.task-check:hover { border-color:var(--success); }
.task-item-done .task-check { border-color:var(--success); background:var(--success); }
.task-item-done .task-check::after { content:''; position:absolute; left:6px; top:1px; width:5px; height:10px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg); }
.task-date-label { font-size:var(--fs-1); color:var(--text-muted); margin-top:2px; }

/* ===== 5.0 计划视图切换（今天/明天/本周） ===== */
.daily-tabs { display:flex; gap:6px; margin-bottom:14px; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius); padding:4px; }
.daily-tab { flex:1; border:none; background:transparent; padding:8px 0; border-radius:var(--radius-xs); font-size:var(--fs-2); font-weight:600; color:var(--text-muted); cursor:pointer; transition: .15s var(--ease-out); }
.daily-tab.active { background:var(--accent); color:#fff; box-shadow:var(--shadow-sm); }
.dark .daily-tab.active { color:var(--on-primary); }

/* ===== 5.0 本周计划池 + 概览 ===== */
.wo-block { margin-top:14px; }
.wo-summary { display:flex; align-items:baseline; gap:10px; }
.wo-summary-num { font-family:var(--font-display); font-size:1.5rem; font-weight:600; color:var(--text-primary); font-variant-numeric:tabular-nums; letter-spacing:-0.02em; }
.wo-summary-rate { font-size:var(--fs-2); color:var(--text-muted); }
.wo-bar { height:8px; background:var(--violet-weak); border-radius:var(--radius-2xs); overflow:hidden; margin:8px 0 14px; }
.wo-bar-fill { height:100%; border-radius:var(--radius-2xs); transition: width .2s var(--ease-out); }
.wo-empty { font-size:var(--fs-2); color:var(--text-muted); margin-top:10px; }
.wo-days { display:grid; grid-template-columns:repeat(7,1fr); gap:8px; }
.wo-day { text-align:center; }
.wo-day-label { font-size:var(--fs-1); color:var(--text-muted); margin-bottom:6px; }
.wo-day-bar { height:48px; background:var(--violet-weak); border-radius:var(--radius-2xs); display:flex; align-items:flex-end; overflow:hidden; }
.wo-day-fill { width:100%; border-radius:var(--radius-2xs) 8px 0 0; }
.wo-day-empty .wo-day-bar { background:var(--surface-3); }
.wo-day-meta { font-size:.66rem; color:var(--text-muted); margin-top:4px; }
.wo-day-today .wo-day-label { color:var(--violet); font-weight:700; }
.wo-day-today .wo-day-bar { box-shadow:0 0 0 2px var(--violet-weak); }
@media (max-width:480px){ .wo-days { gap:4px; } .wo-day-label { font-size:.58rem; } .wo-day-bar { height:36px; } }

/* ===== 5.0 本周成长报告 ===== */
.weekly-report { background:var(--surface); border:1px solid var(--border); border-left:3px solid var(--success); border-radius:var(--radius); padding:14px; margin-bottom:14px; }
.gr-sentence { font-size:.86rem; color:var(--text-secondary); line-height:1.7; }
.gr-sentence b { color:var(--success); }
.gr-highlights { margin-top:12px; border-top:1px dashed var(--border); padding-top:10px; }
.gr-h-title { font-size:var(--fs-1); font-weight:600; color:var(--text-muted); margin-bottom:6px; }
.gr-item { display:flex; align-items:center; gap:8px; padding:4px 0; font-size:var(--fs-2); color:var(--text-secondary); }
.gr-ico { width:18px; text-align:center; }
.gr-empty { font-size:var(--fs-2); color:var(--text-muted); }

/* ===== 6.1 总结·成长分析中心 ===== */
.weekly-tabs { display:flex; gap:6px; padding:4px; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-sm); margin-bottom:14px; }
.weekly-tab { flex:1; border:none; background:transparent; color:var(--text-muted); padding:8px 10px; border-radius:var(--radius-xs); font-size:var(--fs-2); font-weight:600; cursor:pointer; transition: .15s var(--ease-out); }
.weekly-tab:hover { color:var(--text-secondary); }
.weekly-tab.active { background:var(--accent-weak); color:var(--accent); box-shadow:var(--shadow-sm); }
.weekly-note-preview { font-size:var(--fs-2); color:var(--text-secondary); background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-xs); padding:10px 12px; white-space:pre-wrap; line-height:1.6; max-height:160px; overflow:auto; }

/* ===== 6.1 思维导图·方向反馈面板 ===== */
.mm-fb-list { display:flex; flex-direction:column; gap:10px; max-height:60vh; overflow:auto; }
.mm-fb-item { border:1px solid var(--border); border-radius:var(--radius-sm); padding:10px 12px; background:var(--surface); }
.mm-fb-item.read { opacity:.6; }
.mm-fb-head { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.mm-fb-period { font-size:var(--fs-1); font-weight:700; color:var(--violet); background:var(--violet-weak); padding:2px 8px; border-radius:var(--radius-2xs); }
.mm-fb-range { font-size:var(--fs-1); color:var(--text-muted); flex:1; }
.mm-fb-del { border:none; background:transparent; color:var(--text-muted); cursor:pointer; font-size:var(--fs-2); padding:2px 4px; border-radius:var(--radius-2xs); transition: .12s var(--ease-out); }
.mm-fb-del:hover { color:var(--danger); background:var(--danger-weak); }
.mm-fb-summary { font-size:var(--fs-2); color:var(--text-secondary); line-height:1.6; }
.mm-fb-empty { font-size:var(--fs-2); color:var(--text-muted); text-align:center; padding:24px 12px; line-height:1.8; }

/* ===== 5.0 模块边界说明 ===== */
.module-boundary-note { background:var(--violet-weak); border:1px solid var(--border); border-left:3px solid var(--violet); border-radius:var(--radius-xs); padding:10px 12px; font-size:var(--fs-2); color:var(--text-secondary); line-height:1.6; margin-bottom:14px; }
.module-boundary-note b { color:var(--violet); }
.module-boundary-note { cursor:default; }
.module-boundary-note summary { cursor:pointer; list-style:none; display:flex; align-items:center; gap:6px; font-weight:600; color:var(--text-secondary); }
.module-boundary-note summary::-webkit-details-marker { display:none; }
.module-boundary-note summary::marker { content:''; }
.module-boundary-note > p { margin:8px 0 0; font-weight:400; }

/* 模块卡片收敛到统一表面/边框（结构不变） */
.habit-card, .daily-item, .inbox-item, .journal-entry, .task-item, .plan-day,
.pwd-item, .weekly-stat, .bz-stat, .mm-fb-item, .module-boundary-note {
  background:var(--surface); border:1px solid var(--border);
}

/* 顶栏右侧日期 */
.top-date { margin-left:auto; font-size:var(--fs-2); color:var(--text-muted); white-space:nowrap; padding-right:4px; }

/* 设置弹窗结构类 */
.setting-actions { display:flex; align-items:center; gap:8px; margin-top:8px; flex-wrap:wrap; }
.setting-hint { font-size:var(--fs-1); color:var(--text-muted); margin-top:6px; line-height:1.5; }
.setting-divider { margin-top:16px; border-top:1px solid var(--border); padding-top:16px; }

/* Task: 加入今日 快捷操作 */
.task-today-btn { flex:0 0 auto; width:32px; height:32px; border:none; background:transparent; color:var(--text-muted); border-radius:var(--radius-xs); cursor:pointer; font-size:var(--fs-2); display:inline-flex; align-items:center; justify-content:center; transition: .15s var(--ease-out); }
.task-today-btn:hover { color:var(--warning); background:var(--warning-weak); }


/* ===== 排版：标题防难看断行（taste: 强层级、对齐讲究） ===== */
.sidebar-logo-text, .top-title, .modal-title, .brain-date, .daily-date, .ws-val, .wo-summary-num { text-wrap: balance; }

/* ===== 无障碍：尊重「减少动态效果」偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================================
   Quiet System · 模块再设计（计时器 / 日记 / 密码箱 / 习惯）
   说明：JS 结构不可改，以下均为在既有 class 上的「视觉再设计」覆盖层。
   置于文件末尾，同特异度下以源码顺序取胜；覆盖内联 padding 用 !important。
   ===================================================================== */

/* ---------- 计时器：聚焦英雄，消除空洞、数字随框缩放 ---------- */
.timer-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(12px, 2.2vh, 26px);
  padding: clamp(30px, 5vh, 56px) clamp(22px, 3vw, 44px) !important;
  min-height: clamp(300px, 42vh, 420px);
  position: relative;
}
.timer-box::after {
  content: "点开始，进入心流";
  font-size: var(--fs-1);
  color: var(--text-muted);
  margin-top: clamp(2px, 1vh, 8px);
}
.timer-digit {
  font-family: var(--font-sans);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: clamp(3.4rem, 30cqi, 12rem);
  line-height: .9;
  letter-spacing: -.02em;
  color: var(--success);
  text-wrap: balance;
}
.timer-box > div:last-child { width: 100%; max-width: 460px; }
.timer-btn { border-radius: var(--radius-pill); }
.timer-btn-primary { background: var(--accent); color: #fff; }
.timer-btn-primary:hover { background: var(--accent-hover); }
.timer-btn-warn { background: var(--surface-3); color: var(--text-primary); }
.timer-btn-warn:hover { background: var(--border-strong); }
.timer-note-input { border-radius: var(--radius-pill); }

/* ---------- 日记：编辑感再设计 ---------- */
.journal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.journal-count-badge {
  font-family: var(--font-sans); font-weight: 700; font-size: var(--fs-1);
  padding: 5px 14px; border-radius: var(--radius-pill);
  background: var(--accent-weak); color: var(--accent); border: 1px solid var(--accent-press);
}
.journal-compose { padding: clamp(18px, 2.4vw, 28px); border-radius: var(--radius-xl); border-color: var(--border-strong); }
.journal-title-input { font-family: var(--font-display); font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 600; letter-spacing: -.02em; }
.journal-content { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 12px 14px; }
.journal-fixed-tags-label { text-transform: uppercase; letter-spacing: .12em; font-size: var(--fs-1); }
.journal-fixed-tag, .journal-tag-filter { border-radius: var(--radius-pill); }
.journal-toolbar { padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; }
.journal-bucket-title { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 700; color: var(--text-muted); border-left: 3px solid var(--pink); padding-left: 10px; }
.journal-entry { border-radius: var(--radius); padding: 16px 18px; transition: transform .18s var(--ease-out), border-color .18s var(--ease-out), box-shadow .18s var(--ease-out); }
.journal-entry:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.journal-entry-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; color: var(--text-primary); letter-spacing: -.01em; }
.journal-entry-content { font-size: .9rem; }
.journal-type-chip { border-radius: var(--radius-pill); font-weight: 600; }

/* ---------- 密码箱：凭证卡片再设计 ---------- */
.pwd-item {
  display: flex; align-items: center; gap: clamp(14px, 2vw, 22px);
  padding: 16px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); flex-wrap: wrap;
  transition: border-color .15s var(--ease-out), transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.pwd-item:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pwd-site { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; color: var(--text-primary); min-width: 150px; }
.pwd-field { flex: 1 1 220px; display: flex; align-items: center; gap: 10px; }
.pwd-field > span:first-child { font-size: .7rem !important; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); min-width: 42px; }
.pwd-value { font-family: var(--font-sans); font-variant-numeric: tabular-nums; font-size: var(--fs-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pwd-item > div:last-child { margin-left: auto; }
.pwd-cat-chip .btn, #pwdCategoryFilter .btn { border-radius: var(--radius-pill); }

/* ---------- 习惯：打卡再设计 ---------- */
.habit-stat-card { border-radius: var(--radius); padding: 14px 6px; background: var(--surface); border: 1px solid var(--border); }
.habit-stat-card .stat-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; }
.habit-card { border-radius: var(--radius); padding: 16px 18px; transition: border-color .15s var(--ease-out), transform .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.habit-card:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.habit-day { width: 28px; height: 28px; border-radius: var(--radius-2xs); font-size: var(--fs-1); }
.habit-day.checked { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.habit-status-btn { border-radius: var(--radius-pill); }
.habit-badge { background: var(--surface-3); }

/* ---------- 深色模式：主操作按钮在暗底下的「抬升感」（仍保持薰衣草蓝 CTA） ---------- */
.dark .btn-primary {
  background: var(--primary);
  border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 10px rgba(0, 0, 0, 0.35);
}
.dark .btn-primary:hover { background: var(--primary-hover); border-color: var(--border-strong); }
.dark .lock-btn { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 10px rgba(0, 0, 0, 0.35); }

/* =====================================================================
   Quiet System · 模块再设计（续）— 全面推进
   Daily / 计划看板 / Inbox / Notes / 任务库 / 日历 / 周报
   原则：JS 结构零改动；沿用既有分类色（紫=计划/收集、粉=日记、绿=完成、
   朱红=全局信号）；统一「悬停抬升 + 发丝边框」交互语言，强化编辑感层级
   与邀约式交互态。覆盖层置于文件末尾，同特异度以源码顺序取胜。
   ===================================================================== */

/* ---------- Daily · 每日计划 ---------- */
.daily-item {
  position: relative;
  transition: border-color .12s var(--ease-out), transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.daily-item:hover { transform: translateY(-1px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.daily-check { transition: border-color .12s var(--ease-out), background .12s var(--ease-out), box-shadow .12s var(--ease-out); }
.daily-item.done .daily-check { box-shadow: 0 2px 8px var(--success-weak); }
.daily-prio { box-shadow: var(--shadow-sm); font-weight: 700; }
.daily-chip { font-weight: 600; }
.daily-mood-btn, .daily-energy-btn { border-radius: var(--radius-2xs); }

/* ---------- 本周 7 天看板（计划） ---------- */
.plan-week { gap: 10px; }
.plan-day {
  position: relative;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out), transform .15s var(--ease-out);
}
.plan-day:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.plan-day-today { background: var(--violet-weak); border-color: var(--violet); box-shadow: 0 2px 10px var(--violet-weak); }
.plan-task { transition: background .14s var(--ease-out), color .14s var(--ease-out); cursor: grab; }
.plan-task:hover { background: var(--violet); }
.plan-task:hover .plan-task-title { color: #fff; }
.plan-task:hover .plan-check { border-color: rgba(255, 255, 255, 0.75); color: #fff; }
.plan-day.drag-over { box-shadow: 0 0 0 2px var(--accent); outline: none; }

/* ---------- Weekly · 周报统计卡 ---------- */
.weekly-stat { transition: border-color .15s var(--ease-out), transform .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.weekly-stat:hover { transform: translateY(-1px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.weekly-report { background: var(--surface); border-left: 3px solid var(--success); }
.weekly-tab.active { font-weight: 700; }

/* ---------- Inbox · 收集箱 ---------- */
.inbox-item {
  position: relative;
  transition: border-color .12s var(--ease-out), transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.inbox-item:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.inbox-capture { border-radius: var(--radius-xl); border-color: var(--border-strong); }
.inbox-type-btn, .inbox-tab { font-weight: 600; }
.inbox-tab.active, .inbox-type-btn.active { box-shadow: var(--shadow-sm); }
.inbox-tag { font-weight: 600; }

/* ---------- Notes · 笔记 ---------- */
.note-item { position: relative; transition: background .15s var(--ease-out), border-color .15s var(--ease-out); }
.note-item:hover { background: var(--surface-3); }
.note-item.active { box-shadow: inset 3px 0 0 var(--accent); }
.note-title-input { letter-spacing: -.02em; }

/* ---------- Task · 任务库 ---------- */
.task-item {
  position: relative;
  transition: border-color .15s var(--ease-out), transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.task-item:hover { transform: translateY(-1px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.task-check { transition: border-color .15s var(--ease-out), background .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.task-item-done .task-check { box-shadow: 0 2px 8px var(--success-weak); }
.task-group-head { font-size: var(--fs-1); letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }

/* ---------- Calendar · 日历 ---------- */
.fc-cell:hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.fc-cell.today { box-shadow: 0 0 0 1px var(--accent); }
.fc-event-dot { font-weight: 600; }

/* =====================================================================
   Quiet System · 动效层（克制 · MOTION≈3）
   原则：hover / 聚焦 / 模块入场为主，绝不做线性 ease 与泛滥动效；
   入场仅作用于模块面板的「顶层区块」，不作用于每次 render 重绘的内部列表，
   以免勾选/刷新时 flicker。统一使用设计系统缓动曲线。
   尊重 prefers-reduced-motion（文件末尾已全局收敛时长）。
   ===================================================================== */

/* 模块切换：面板内顶层区块依次轻微上浮 + 淡入（错峰，营造「呼吸到位」感） */
.module-panel.active > * {
  animation: panelRise .5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.module-panel.active > *:nth-child(1) { animation-delay: .02s; }
.module-panel.active > *:nth-child(2) { animation-delay: .06s; }
.module-panel.active > *:nth-child(3) { animation-delay: .10s; }
.module-panel.active > *:nth-child(4) { animation-delay: .14s; }
.module-panel.active > *:nth-child(5) { animation-delay: .18s; }
.module-panel.active > *:nth-child(6) { animation-delay: .22s; }
.module-panel.active > *:nth-child(n+7) { animation-delay: .26s; }
@keyframes panelRise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 导航项：悬停轻微右移 + 信号感（替代生硬背景切换） */
.nav-item { transition: background .18s var(--ease-out), color .18s var(--ease-out), transform .18s cubic-bezier(0.22, 1, 0.36, 1); }
.nav-item:hover { transform: translateX(3px); }
.nav-item.active:hover { transform: translateX(2px); }

/* 图标按钮：按下回弹（轻微 spring），强化触感 */
.btn-sm, .daily-act, .inbox-act, .plan-act, .bz-edit, .journal-del, .daily-del,
.inbox-conv, .habit-menu-dropdown .menu-item, .tm-del-btn, .task-today-btn {
  transition: background .15s var(--ease-out), color .15s var(--ease-out),
              border-color .15s var(--ease-out), transform .12s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-sm:active, .daily-act:active, .inbox-act:active, .plan-act:active,
.bz-edit:active, .journal-del:active, .daily-del:active, .inbox-conv:active,
.tm-del-btn:active, .task-today-btn:active { transform: scale(.9); }

/* 注：列表项（.inbox-item/.pwd-item/.daily-item 等）由 .render() 频繁重建，
   若对其施加 animation 会在每次勾选/刷新时重放造成 flicker；故仅让「顶层区块」
   在模块切换时错峰上浮，列表项保留 hover 抬升（transition，无 flicker）即可。 */

/* =====================================================================
   Quiet System · Light Theme overrides
   仅修复「硬编码深底假设」的细节，其余组件全部跟随 .light 令牌自动翻色。
   · 卡片顶边高光：浅底用极淡暗高光，避免深底的白色高光在白卡上隐形。
   · 思维导图：浅色画布 / 面板 / 提示气泡（原 #0f1011 / #1b1d22 为深底硬编码）。
   · 模态 / 命令面板浮层保留中性深色 scrim（两端通用，符合惯例）。
   ===================================================================== */

/* 卡片顶边高光反色 */
.light .card, .light .glass-card { box-shadow: inset 0 1px 0 rgba(16, 17, 20, 0.04); }
.light .card:hover, .light .glass-card:hover { box-shadow: inset 0 1px 0 rgba(16, 17, 20, 0.06), var(--shadow-md); }

/* 思维导图：浅色模式变量（提升为全局 .light，使 portal 到 body 的属性面板也能继承浅色主题） */
.light {
  --mm-bg-panel: #ffffff;
  --mm-text-primary: #1a1b1e;
  --mm-text-secondary: #3c4046;
  --mm-text-muted: #6b7280;
  --mm-bg-canvas: #f4f5f7;
  --mm-bg-muted: #f1f2f5;
  --mm-bg-hover: #e9ebef;
  --mm-border: #e4e6ea;
  --mm-shadow-sm: 0 1px 3px rgba(16, 17, 20, 0.10);
  --mm-shadow-md: 0 4px 12px rgba(16, 17, 20, 0.12);
  --mm-shadow-lg: 0 8px 24px rgba(16, 17, 20, 0.16);
}
.light #mod-mindmap [data-tooltip]:hover::after { background:#ffffff; color:#1a1b1e; border-color:#e4e6ea; }
.light #mod-mindmap [data-tooltip]:hover::before { border-bottom-color:#ffffff; }
.light #mod-mindmap .mm-note-tooltip { background:#ffffff; color:#1a1b1e; border-color:#e4e6ea; }

/* 焦点环：更顺滑的朱红信号（键盘可达性 + 设计一致） */
.btn:focus-visible, .nav-item:focus-visible,
.lock-btn:focus-visible, .form-input:focus-visible, .form-select:focus-visible,
.form-textarea:focus-visible, .filter-chip:focus-visible, .daily-check:focus-visible,
.task-check:focus-visible, .bz-check:focus-visible, .habit-day:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* =====================================================================
   动效增强 · Motion Enhancement（在 Quiet System 之上叠加表现力特效）
   仅作用于静态结构 / 状态切换，避免对 render 频繁重建的列表项使用 animation。
   ===================================================================== */

/* 1. 背景保持纯深底：无氛围渐变（遵循 DESIGN.md，不引入环境渐变 / 聚光） */

/* 2. 首页 Brain 卡片：逐张浮入（错峰，配合面板入场） */
.brain-grid .brain-card { animation: fx-brainIn .5s cubic-bezier(0.22,1,0.36,1) both; }
.brain-grid .brain-card:nth-child(1) { animation-delay: .08s; }
.brain-grid .brain-card:nth-child(2) { animation-delay: .14s; }
.brain-grid .brain-card:nth-child(3) { animation-delay: .20s; }
@keyframes fx-brainIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 3. 主操作按钮：高光横扫（hover 时光带划过，克制记忆点） */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -130%; width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.30), transparent);
  transform: skewX(-20deg); transition: left .6s var(--ease-out); pointer-events: none;
}
.btn-primary:hover::after { left: 150%; }

/* 4. 专注计时器：绿色柔光（数字改绿后的信号光晕，运行时呼吸） */
.timer-digit { text-shadow: 0 0 22px rgba(63,157,106,0.18); }
.dark .timer-digit { text-shadow: 0 0 22px rgba(79,179,126,0.22); }
.timer-pulse { animation: pulseGlow 2.5s infinite ease-in-out, fx-digitGlow 2.6s var(--ease-in-out) infinite; }
@keyframes fx-digitGlow {
  0%, 100% { text-shadow: 0 0 16px rgba(63,157,106,0.16); }
  50%      { text-shadow: 0 0 38px rgba(63,157,106,0.42); }
}
.dark .timer-pulse { animation: pulseGlow 2.5s infinite ease-in-out, fx-digitGlowDark 2.6s var(--ease-in-out) infinite; }
@keyframes fx-digitGlowDark {
  0%, 100% { text-shadow: 0 0 18px rgba(79,179,126,0.18); }
  50%      { text-shadow: 0 0 40px rgba(79,179,126,0.46); }
}

/* 5. 导航激活条：切换模块时朱红指示条自上而下展开（保留垂直居中） */
.nav-item.active::before { animation: fx-navBar .3s var(--ease-out) both; }
@keyframes fx-navBar {
  from { transform: translateY(-50%) scaleY(0); }
  to   { transform: translateY(-50%) scaleY(1); }
}

/* 6. 习惯统计卡：悬停数值轻跳 + 朱红高亮 */
.habit-stat-card .stat-value { transition: transform .2s var(--ease-out), color .2s var(--ease-out); }
.habit-stat-card:hover .stat-value { transform: scale(1.08); color: var(--accent); }

/* 7. 勾选圈：按下回弹（transition，无 flicker） */
.task-check, .bz-check, .plan-check, .daily-check {
  transition: transform .16s cubic-bezier(0.34,1.56,0.64,1), background .2s var(--ease-out), border-color .2s var(--ease-out);
}
.task-check:active, .bz-check:active, .plan-check:active, .daily-check:active { transform: scale(.82); }

/* 8. 跳转链接：悬停朱红 */
.bz-more { transition: color .18s var(--ease-out), opacity .18s var(--ease-out); cursor: pointer; }
.bz-more:hover { color: var(--accent); }

/* 9. 侧边栏折叠：更顺滑的宽度 / 位移过渡 */
#sidebar { transition: width .32s var(--ease-drawer), transform .32s var(--ease-drawer); }

/* 10. 尊重「减少动态」偏好：关闭新增动画 */
@media (prefers-reduced-motion: reduce) {
  body::before, .brain-grid .brain-card, .btn-primary::after,
  .timer-pulse, .nav-item.active::before { animation: none !important; }
  .habit-stat-card:hover .stat-value { transform: none; }
}


/* =====================================================================
   Markdown 渲染样式（.md / .md-preview）
   - 由 js/core/FlowMarkdown.js 产出，安全（已转义）
   - 同时用于：日记时间线内容、笔记预览面板
   ===================================================================== */
.md { white-space: normal; word-wrap: break-word; overflow-wrap: anywhere;
  font-size: .88rem; line-height: 1.72; color: var(--text-secondary); }

.md > :first-child { margin-top: 0; }
.md > :last-child  { margin-bottom: 0; }

.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 {
  color: var(--text-primary); font-weight: 700; line-height: 1.3; margin: .9em 0 .45em;
}
.md h1 { font-size: 1.5em; }
.md h2 { font-size: 1.3em; }
.md h3 { font-size: 1.14em; }
.md h4 { font-size: 1em; }
.md h5, .md h6 { font-size: .92em; color: var(--text-secondary); }

.md p { margin: .5em 0; }
.md ul, .md ol { margin: .5em 0; padding-left: 1.5em; }
.md li { margin: .22em 0; }
.md ul { list-style: disc; }
.md ol { list-style: decimal; }

.md blockquote {
  margin: .7em 0; padding: .45em .9em; border-left: 3px solid var(--accent);
  background: var(--accent-tint); color: var(--text-secondary); border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
.md blockquote p { margin: .2em 0; }

.md code {
  font-family: var(--font-mono); font-size: .86em;
  background: var(--surface-3); padding: .12em .42em; border-radius: var(--radius-2xs);
  border: 1px solid var(--border);
}
.md pre {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; overflow-x: auto; margin: .7em 0;
}
.md pre code { background: none; border: none; padding: 0; font-size: .85em; }

.md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.md a:hover { color: var(--accent-hover); }

.md hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }
.md strong { font-weight: 700; color: var(--text-primary); }
.md em { font-style: italic; }

/* 笔记预览面板容器 */
.md-preview {
  flex: 1; width: 100%; max-width: 680px; margin: 0 auto;
  padding: 4px 2px; overflow-y: auto; color: var(--text);
}

/* 编辑/预览切换按钮（日记、笔记通用） */
.md-toggle-btn {
  font-size: .72rem; padding: 4px 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-secondary);
  cursor: pointer; transition: all .18s var(--ease-out); white-space: nowrap;
}
.md-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.md-toggle-btn.active { background: var(--accent-weak); border-color: var(--accent); color: var(--accent); }

/* 笔记：排序选择 */
.note-sort-select { font-size:.72rem; padding:4px 8px; border-radius:var(--radius-pill); border:1px solid var(--border); background:var(--surface-2); color:var(--text-secondary); cursor:pointer; max-width:120px; }
.note-sort-select:hover { border-color: var(--accent); color: var(--accent); }

/* 笔记：一级标题下方内容可折叠 */
.md-sec { margin:.2em 0; }
.md-sec-head { cursor: pointer; user-select: none; display: flex; align-items: baseline; gap: 8px; }
.md-sec-head:hover { color: var(--accent); }
.md-sec-toggle { font-size:.7em; color: var(--text-muted); flex: 0 0 auto; transition: transform .15s var(--ease-out); transform: translateY(1px); }

/* 笔记：全屏阅读模式 */
.note-fullscreen { position: fixed; inset: 0; z-index: 9999; background: var(--bg); display: flex; flex-direction: column; }
.note-fullscreen-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 22px; border-bottom:1px solid var(--border); background: var(--surface); }
.note-fullscreen-title { font-size:1.05rem; font-weight:700; color:var(--text-primary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.note-fullscreen-actions { display:flex; gap:8px; flex:0 0 auto; }
.note-fullscreen-body { flex:1; overflow-y:auto; padding:32px 20px; }
.note-fs-md { max-width:760px; margin:0 auto; }

/* =====================================================================
   星期五 模块
   ===================================================================== */
.ai-wrap { display: flex; flex-direction: column; height: calc(100dvh - 130px); max-width: 820px; margin: 0 auto; }
.ai-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 14px; }
.ai-head-title { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.ai-head-title i { color: var(--accent); }
.ai-gear { width: 38px; height: 38px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface-2); color: var(--text-secondary); cursor: pointer; font-size: .95rem; transition: all .18s var(--ease-out); }
.ai-gear:hover { border-color: var(--accent); color: var(--accent); }

.ai-log { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 4px; display: flex; flex-direction: column; gap: 12px; }
.ai-empty { text-align: center; color: var(--text-muted); padding: 40px 20px; }
.ai-empty i { font-size: 2.4rem; color: var(--accent); opacity: .7; margin-bottom: 12px; display: block; }
.ai-empty p { font-size: .9rem; line-height: 1.6; max-width: 360px; margin: 0 auto; }

.ai-msg { display: flex; }
.ai-msg.user { justify-content: flex-end; }
.ai-msg.assistant { justify-content: flex-start; }
.ai-bubble { max-width: 82%; padding: 11px 15px; border-radius: var(--radius-lg); font-size: .92rem; line-height: 1.6; word-break: break-word; }
.ai-msg.user .ai-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.ai-msg.assistant .ai-bubble { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 6px; }
.ai-msg.system { justify-content: flex-start; }
.ai-sys { font-size: .78rem; color: var(--success); background: var(--success-weak); border: 1px solid color-mix(in srgb, var(--success) 25%, transparent); padding: 5px 11px; border-radius: var(--radius-pill); }

.ai-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 2px; }
.ai-chip { font-size: .78rem; padding: 6px 12px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); cursor: pointer; transition: all .18s var(--ease-out); }
.ai-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }

.ai-input-row { display: flex; gap: 10px; align-items: flex-end; padding: 6px 2px 0; }
.ai-input-row .form-input { flex: 1; resize: none; }
.ai-input-row .btn-primary { flex: 0 0 auto; height: 44px; width: 48px; display: inline-flex; align-items: center; justify-content: center; }
.ai-input-row .btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.ai-hint { text-align: center; font-size: .7rem; color: var(--text-muted); padding-top: 8px; }

.ai-set-hint { font-size: .78rem; color: var(--text-muted); line-height: 1.6; margin-top: 6px; }
.ai-set-hint code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); }

/* 长期记忆管理列表 */
.mem-list { max-height: 240px; overflow-y: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 7px; }
.mem-empty { font-size: .82rem; color: var(--text-muted); padding: 10px 2px; }
.mem-item { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.mem-cat { flex: 0 0 auto; font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #fff; background: var(--accent); text-transform: capitalize; }
.mem-cat-profile { background: #4a8fc0; }
.mem-cat-preference { background: #5e6ad2; }
.mem-cat-goal { background: #e08a3c; }
.mem-cat-habit { background: #2f9e6f; }
.mem-cat-project { background: #c0506a; }
.mem-cat-insight { background: #8a6dc4; }
.mem-body { flex: 1; min-width: 0; }
.mem-content { font-size: .85rem; color: var(--text); line-height: 1.45; }
.mem-meta { font-size: .7rem; color: var(--text-muted); margin-top: 3px; }
.mem-del { flex: 0 0 auto; background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: .85rem; padding: 2px 4px; border-radius: 6px; }
.mem-del:hover { color: var(--danger); background: var(--danger-weak); }

/* 移动端：让聊天区更贴合 */
@media (max-width: 768px) {
  .ai-wrap { height: calc(100dvh - 118px); }
  .ai-bubble { max-width: 90%; }
}
