/* ═══════════ 设计变量 ═══════════ */
:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --border: #e4e7ec;
  --text: #1f2329;
  --text2: #5f6672;
  --text3: #98a2b3;
  --accent: #2f6bff;
  --accent-weak: #eef2ff;
  --red: #e5484d;
  --orange: #f08c1a;
  --blue: #3b82f6;
  --gray: #94a3b8;
  --purple: #8b5cf6;
  --radius: 10px;
  --shadow: 0 8px 30px rgba(31, 35, 41, .12);
  --hol: #e5484d;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  display: flex;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
.flex1 { flex: 1; }

/* ═══════════ 图标基元 ═══════════ */
.ic { display: inline-flex; vertical-align: -3px; }
.ic svg { display: block; }

/* ═══════════ 左侧栏 ═══════════ */
#sidebar {
  width: 280px; min-width: 280px; height: 100%;
  background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 30;
}
.sb-top { padding: 16px 16px 12px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.brand .ic { color: var(--accent); }
.mode-switch { display: flex; background: var(--bg); border-radius: var(--radius); padding: 3px; gap: 3px; }
.mode-btn {
  flex: 1; border: 0; background: transparent; border-radius: 8px;
  padding: 7px 0; font-size: 14px; color: var(--text2); transition: .15s;
}
.mode-btn.active { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.cloud-status { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--text3); }
.cloud-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--gray); flex: none; }
.cloud-dot.online { background: #22a06b; }
.cloud-dot.connecting { background: var(--orange); }
.cloud-dot.error { background: var(--red); }

.sb-mid { flex: 1; overflow-y: auto; padding: 12px 16px; }
.sb-sec { margin-bottom: 18px; }
.sb-sec-t { font-size: 12px; font-weight: 600; color: var(--text3); margin-bottom: 8px; letter-spacing: .5px; }
.sb-sec-t span { font-weight: 400; }
.sb-link { cursor: pointer; transition: .12s; }
.sb-link:hover { color: var(--accent); }
.sb-more { font-weight: 400; }
.sb-list { display: flex; flex-direction: column; gap: 4px; }
.sb-item {
  display: flex; align-items: flex-start; gap: 8px; width: 100%;
  border: 0; background: transparent; text-align: left; border-radius: 8px;
  padding: 6px 8px; font-size: 13px; color: var(--text); transition: .12s; cursor: pointer;
}
.sb-item:hover { background: var(--bg); }
.sb-item .ic { margin-top: 1px; flex: none; }
.sb-item-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-item-meta { font-size: 11px; color: var(--text3); flex: none; }
.sb-item.is-overdue .sb-item-meta { color: var(--red); }
.sb-empty { font-size: 12px; color: var(--text3); padding: 4px 8px; }

.sb-bottom { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.search-box {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg); border-radius: var(--radius); padding: 0 10px;
}
.search-box:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }
.search-ic { color: var(--text3); display: flex; }
.search-box input { flex: 1; border: 0; background: transparent; padding: 9px 0; outline: none; min-width: 0; }
.search-box button { border: 0; background: transparent; color: var(--text3); font-size: 16px; padding: 4px; }
.sb-tools { display: flex; gap: 8px; }
.sb-tools .btn { flex: 1; }

/* ═══════════ 通用控件 ═══════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: var(--radius); padding: 8px 14px; font-size: 14px; transition: .15s;
}
.btn:hover { border-color: var(--text3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text2); }
.btn.ghost:hover { background: var(--bg); color: var(--text); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-ghost { color: var(--red); border-color: transparent; background: transparent; }
.btn.danger-ghost:hover { background: #fdf0f0; border-color: transparent; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 0; background: transparent;
  border-radius: 8px; color: var(--text2); transition: .12s;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.seg { display: flex; background: var(--bg); border-radius: var(--radius); padding: 3px; gap: 2px; }
.seg-btn {
  border: 0; background: transparent; border-radius: 8px; padding: 6px 14px;
  font-size: 13px; color: var(--text2); transition: .15s;
}
.seg-btn.active { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ═══════════ 主区与顶栏 ═══════════ */
#main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
#topbar {
  height: 56px; flex: none; display: flex; align-items: center; gap: 8px;
  padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--border);
}
#menuBtn { display: none; }
#rangeTitle { font-size: 16px; font-weight: 700; min-width: 0; white-space: nowrap; }
#viewRoot { flex: 1; overflow: auto; position: relative; }

/* ═══════════ 月视图（台历） ═══════════ */
.mwrap { display: flex; flex-direction: column; height: 100%; }
.mhead { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); background: var(--panel); }
.mhead div { padding: 8px 0; text-align: center; font-size: 12px; color: var(--text2); }
.mhead div:first-child { color: var(--red); }   /* 周一 */
.mhead div:last-child { color: var(--accent); } /* 周日 */
.mgrid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(6, minmax(96px, 1fr)); background: var(--border); gap: 1px; }
.cell { background: var(--panel); padding: 4px 6px; overflow: hidden; position: relative; min-width: 0; }
.cell.other-month { background: #fafbfc; }
.cell.other-month .dnum { color: var(--text3); }
.cell.hol-day { background: #fffafa; }
.cell.drag-over { outline: 2px dashed var(--accent); outline-offset: -3px; }
.cell-hd { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; }
.dnum { font-size: 14px; font-weight: 600; }
.dnum.today-n { background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 7px; }
.hol-tag { font-size: 10px; border-radius: 4px; padding: 0 4px; line-height: 16px; color: #fff; background: var(--hol); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 64px; }
.hol-tag.ban { background: #64748b; } /* 调休上班 */
.cell-add {
  margin-left: auto; border: 0; background: transparent; color: var(--text3);
  width: 20px; height: 20px; border-radius: 6px; display: none; align-items: center; justify-content: center;
}
.cell:hover .cell-add { display: inline-flex; }
.cell-add:hover { background: var(--accent-weak); color: var(--accent); }
.chips { display: flex; flex-direction: column; gap: 2px; }
.chip {
  display: flex; align-items: center; gap: 4px; min-width: 0;
  border: 0; background: var(--bg); border-radius: 6px; padding: 2px 6px;
  font-size: 12px; color: var(--text); text-align: left; cursor: pointer; transition: .12s;
}
.chip:hover { filter: brightness(.96); }
.chip:active { cursor: grabbing; }
.chip .ic { flex: none; }
.chip-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-time { font-size: 10px; color: var(--text3); flex: none; }
.chip-more { border: 0; background: transparent; color: var(--text3); font-size: 11px; text-align: left; padding: 1px 6px; }
.chip-more:hover { color: var(--accent); }
/* 重要等级左边框 */
.chip.cl-red { border-left: 3px solid var(--red); }
.chip.cl-orange { border-left: 3px solid var(--orange); }
.chip.cl-blue { border-left: 3px solid var(--blue); }
.chip.cl-gray { border-left: 3px solid var(--gray); }
.chip.cl-red .ic, .sb-item.cl-red .ic { color: var(--red); }
.chip.cl-orange .ic, .sb-item.cl-orange .ic { color: var(--orange); }
.chip.cl-blue .ic, .sb-item.cl-blue .ic { color: var(--blue); }
.chip.cl-gray .ic, .sb-item.cl-gray .ic { color: var(--gray); }
.chip-done { opacity: .55; }
.chip-done .chip-t { text-decoration: line-through; }

/* ═══════════ 周视图 ═══════════ */
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); height: 100%; min-width: 900px; }
.wcol { background: var(--panel); display: flex; flex-direction: column; min-width: 0; }
.wcol-hd { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--border); }
.wcol-hd .wd { font-size: 12px; color: var(--text2); }
.wcol-hd .wd-d { font-size: 18px; font-weight: 700; }
.wcol.is-today .wd-d { color: var(--accent); }
.wcol-hd .hol-tag { display: inline-block; margin-top: 2px; }
.wcol-bd { flex: 1; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.wcol-bd .chip { padding: 6px; }

/* ═══════════ 日视图 ═══════════ */
.day-view { max-width: 860px; margin: 0 auto; padding: 20px 16px 60px; }
.day-head { margin-bottom: 16px; }
.day-head h2 { font-size: 22px; }
.day-head .day-sub { color: var(--text2); font-size: 13px; margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.day-list { display: flex; flex-direction: column; gap: 8px; }
.day-card {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; transition: .15s;
}
.day-card:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(47,107,255,.08); }
.done-cb {
  width: 20px; height: 20px; flex: none; margin-top: 1px;
  border: 2px solid var(--gray); border-radius: 99px; background: #fff;
  display: flex; align-items: center; justify-content: center; color: #fff; padding: 0;
}
.done-cb.on { background: var(--accent); border-color: var(--accent); }
.dc-body { flex: 1; min-width: 0; }
.dc-title { font-weight: 600; font-size: 15px; }
.day-card.is-done .dc-title { text-decoration: line-through; color: var(--text3); }
.dc-meta { font-size: 12px; color: var(--text3); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dc-meta .ic { vertical-align: -2px; }
.dc-snip { font-size: 13px; color: var(--text2); margin-top: 6px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.day-empty { text-align: center; color: var(--text3); padding: 60px 0; }

/* ═══════════ 模态 ═══════════ */
.modal {
  position: fixed; inset: 0; background: rgba(31,35,41,.45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal[hidden] { display: none; }
.modal-box {
  background: var(--panel); border-radius: 14px; box-shadow: var(--shadow);
  width: min(680px, 94vw); max-height: 88vh; display: flex; flex-direction: column;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 16px 20px 0; }
.modal-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex: 1; }
.modal-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }

/* ═══════════ 编辑器表单 ═══════════ */
.editor-box { width: min(680px, 94vw); }
.form-grid { display: flex; flex-direction: column; gap: 14px; }
.f-title input {
  width: 100%; border: 0; border-bottom: 1px solid var(--border);
  font-size: 20px; font-weight: 700; padding: 4px 0 10px; outline: none; background: transparent;
}
.f-title input:focus { border-bottom-color: var(--accent); }
.f-row { display: flex; gap: 12px; flex-wrap: wrap; }
.f-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f-field > label { font-size: 12px; color: var(--text3); }
.f-field input, .f-field select {
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; background: #fff; outline: none;
}
.f-field input:focus, .f-field select:focus { border-color: var(--accent); }
.f-mode { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; width: fit-content; }
.f-mode button { border: 0; background: #fff; padding: 6px 16px; font-size: 13px; color: var(--text2); }
.f-mode button.active { background: var(--accent); color: #fff; }
.icon-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 1px solid var(--border); background: #fff; border-radius: 10px;
  padding: 8px 10px; font-size: 12px; color: var(--text2); min-width: 64px; transition: .12s;
}
.icon-opt .ic { color: var(--text2); }
.icon-opt.active { border-color: var(--accent); background: var(--accent-weak); color: var(--accent); }
.icon-opt.active .ic { color: var(--accent); }
.color-row { display: flex; gap: 10px; flex-wrap: wrap; }
.color-opt {
  display: flex; align-items: center; gap: 6px; border: 1px solid var(--border);
  border-radius: 99px; padding: 5px 12px; font-size: 13px; background: #fff; color: var(--text2);
}
.color-opt i { width: 12px; height: 12px; border-radius: 99px; display: inline-block; }
.color-opt.active { border-width: 2px; font-weight: 600; color: var(--text); padding: 4px 11px; }
.repeat-banner {
  background: #fff8e6; border: 1px solid #f5d98a; color: #8a6d1a;
  border-radius: 8px; padding: 8px 12px; font-size: 13px; display: flex; align-items: center; gap: 6px;
}

/* ═══════════ 富文本 ═══════════ */
.rich { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.rich-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--border); background: #fafbfc; }
.rich-btn {
  border: 0; background: transparent; border-radius: 6px; width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text2);
}
.rich-btn:hover { background: var(--accent-weak); color: var(--accent); }
.rich-area { min-height: 140px; max-height: 300px; overflow-y: auto; padding: 12px 14px; outline: none; line-height: 1.7; }
.rich-area:empty::before { content: attr(data-placeholder); color: var(--text3); }
.rich-area blockquote { border-left: 3px solid var(--border); padding-left: 10px; color: var(--text2); margin: 6px 0; }
.rich-area h2 { font-size: 18px; margin: 8px 0 4px; }
.rich-area ul, .rich-area ol { padding-left: 22px; }

/* ═══════════ 报告筛选器 ═══════════ */
.report-box { width: min(760px, 94vw); }
.rep-filters { display: flex; flex-direction: column; gap: 8px; padding: 12px 20px 0; }
.rep-filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rf-label { font-size: 12px; color: var(--text3); width: 34px; flex: none; }
.rf-dash { color: var(--text3); }
.rep-filter-row input[type="date"] { border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; font-size: 13px; }
.cat-checks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cat-check {
  display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border);
  border-radius: 99px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--text2); transition: .12s;
}
.cat-check input { accent-color: var(--accent); margin: 0; }
.cat-check:has(input:checked) { border-color: var(--accent); background: var(--accent-weak); color: var(--accent); }
.rep-group-t { font-size: 12px; color: var(--text3); margin: 0 2px 0 6px; }
.rep-mode-part { border: 1px solid var(--border); border-radius: 10px; padding: 0 14px 14px; margin-bottom: 12px; }
.rep-mode-hd { font-weight: 700; padding: 12px 0 8px; display: flex; align-items: center; gap: 6px; }
.rep-sub-t { font-weight: 600; margin: 12px 0 4px; font-size: 14px; }
.report-tabs { display: flex; gap: 4px; padding: 12px 20px 0; }
.report-tabs .seg-btn { background: var(--bg); border-radius: 8px; padding: 6px 14px; }
.report-tabs .seg-btn.active { background: var(--accent); color: #fff; font-weight: 600; }
.report-nav { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px 0; }
.report-range { font-weight: 700; font-size: 15px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat-card { background: var(--bg); border-radius: var(--radius); padding: 10px 12px; }
.stat-val { font-size: 19px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text3); margin-top: 2px; }
.rep-sec { margin-bottom: 18px; }
.rep-sec-t { font-weight: 700; margin-bottom: 8px; border-left: 3px solid var(--accent); padding-left: 8px; display: flex; align-items: center; gap: 6px; }
.rep-hint { color: var(--text2); font-size: 13px; margin-top: 6px; }
.pbar { background: var(--bg); border-radius: 99px; height: 10px; overflow: hidden; }
.pbar-in { background: var(--accent); height: 100%; border-radius: 99px; transition: width .4s; }
.cat-bars { display: flex; flex-direction: column; gap: 6px; }
.cat-bar-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.cat-bar-name { width: 110px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-bar-name i { color: var(--text3); font-style: normal; font-size: 11px; }
.cat-bar { flex: 1; background: var(--bg); border-radius: 99px; height: 12px; overflow: hidden; }
.cat-bar-in { height: 100%; border-radius: 99px; }
.c-work { background: var(--accent); }
.c-personal { background: var(--purple); }
.cat-bar-n { width: 30px; color: var(--text2); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-mini { border: 1px solid var(--border); border-radius: 99px; padding: 2px 10px; font-size: 12px; color: var(--text2); }
.rep-list { list-style: none; }
.rep-list li { margin: 7px 0; font-size: 14px; }
.rep-list em { color: var(--text3); font-style: normal; font-size: 12px; margin-left: 6px; }
.rep-more { color: var(--text3); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 6px; }
.cl-dot-red { background: var(--red); }
.cl-dot-orange { background: var(--orange); }
.cl-dot-blue { background: var(--blue); }
.cl-dot-gray { background: var(--gray); }
.rep-empty { background: var(--accent-weak); color: var(--accent); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }
.rep-ai { border: 1px dashed #c9d4f5; border-radius: var(--radius); padding: 12px; }
.rep-ai .btn { margin-top: 10px; }
.ai-out { margin-top: 10px; font-size: 14px; line-height: 1.8; }
.ai-out h3 { font-size: 15px; margin: 12px 0 4px; }
.ai-out h4 { font-size: 14px; margin: 10px 0 4px; }
.ai-out ul, .ai-out ol { padding-left: 20px; margin: 6px 0; }
.ai-out p { margin: 6px 0; }
.ai-loading, .ai-err { color: var(--text2); font-size: 13px; padding: 8px 0; }
.ai-err { color: var(--red); }

/* ═══════════ 设置 ═══════════ */
.settings-box { width: min(560px, 94vw); }
.set-sec { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.set-sec-t { font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.set-desc { font-size: 12px; color: var(--text3); line-height: 1.7; margin-bottom: 10px; }
.set-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.set-row label { font-size: 12px; color: var(--text2); }
.set-row input { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; outline: none; }
.set-row input:focus { border-color: var(--accent); }
.set-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.set-state { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); margin-bottom: 10px; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0; background: var(--gray); border-radius: 99px; transition: .2s; cursor: pointer;
}
.switch i::before {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 99px;
  background: #fff; top: 3px; left: 3px; transition: .2s;
}
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::before { transform: translateX(18px); }
.set-inline { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.set-inline span { font-size: 14px; }

/* ═══════════ 灵感白板 ═══════════ */
.notes-box { width: min(640px, 94vw); }
.nb-item { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.nb-head {
  display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: #fff;
  padding: 10px 12px; cursor: pointer; text-align: left; transition: .12s;
}
.nb-head:hover { background: var(--bg); }
.nb-head .ic:first-child { color: var(--purple); }
.nb-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.nb-time { font-size: 11px; color: var(--text3); flex: none; }
.nb-head .chev { color: var(--text3); transition: transform .2s; }
.nb-item.open .chev { transform: rotate(180deg); }
.nb-body { border-top: 1px solid var(--border); background: #fafbfc; padding: 10px 12px; }
.nb-content { font-size: 13px; line-height: 1.7; color: var(--text2); max-height: 220px; overflow-y: auto; }
.nb-content p { margin: 4px 0; }
.nb-content ul, .nb-content ol { padding-left: 20px; }
.nb-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.nb-actions .btn { padding: 5px 10px; font-size: 12px; }

/* ═══════════ 帮助 ═══════════ */
.help-box { width: min(600px, 94vw); }
.help-sec h4 { margin: 14px 0 6px; font-size: 14px; color: var(--text); }
.help-sec h4:first-child { margin-top: 0; }
.help-sec p, .help-sec li { font-size: 13px; color: var(--text2); line-height: 1.9; }
.help-sec ul { padding-left: 18px; }
.help-sec b { color: var(--text); }

/* ═══════════ 确认框 / 菜单 / 提示 ═══════════ */
.confirm-box { width: min(360px, 90vw); padding: 20px; }
.confirm-text { font-size: 15px; line-height: 1.6; margin-bottom: 18px; }
.confirm-btns { display: flex; justify-content: flex-end; gap: 10px; }
#ctxMenu {
  position: fixed; z-index: 200; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow); padding: 6px; min-width: 150px;
}
#ctxMenu button {
  display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent;
  padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--text); text-align: left;
}
#ctxMenu button:hover { background: var(--bg); }
#ctxMenu button.danger { color: var(--red); }
.pop-date {
  position: fixed; z-index: 210; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow); padding: 12px; display: flex; gap: 8px; align-items: center;
}
/* 日期选择对话框（复制/移至工作台等） */
.date-box { width: min(360px, 92vw); }
.date-box input[type="date"] {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 10px; font-size: 14px; outline: none;
}
.date-box input[type="date"]:focus { border-color: var(--accent); }
.dp-quick { display: flex; gap: 8px; margin-bottom: 12px; }
.dp-quick .btn { flex: 1; padding: 7px 0; font-size: 13px; }
.dp-hint { font-size: 12px; color: var(--text3); margin-top: 8px; min-height: 16px; }

/* 导出选项对话框 */
.export-box { width: min(420px, 92vw); }
.ep-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.export-box input[type="date"] { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.pop-date input { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
#toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%);
  background: rgba(31,35,41,.92); color: #fff; border-radius: 99px;
  padding: 9px 18px; font-size: 13px; z-index: 300; max-width: 80vw; text-align: center;
}
.pulse { animation: pulse 1.6s ease 2; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47,107,255,0); }
  40% { box-shadow: 0 0 0 4px rgba(47,107,255,.35); }
}

/* ═══════════ 抽屉（移动端） ═══════════ */
#scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; opacity: 0; pointer-events: none; transition: .2s; }

/* ═══════════ 响应式 ═══════════ */
@media (max-width: 900px) {
  #sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: none;
  }
  body.drawer-open #sidebar { transform: translateX(0); box-shadow: var(--shadow); }
  body.drawer-open #scrim { opacity: 1; pointer-events: auto; }
  #menuBtn { display: inline-flex; }
  #topbar { padding: 0 10px; }
  .mgrid { grid-template-rows: repeat(6, minmax(72px, 1fr)); }
  .chip { font-size: 11px; padding: 1px 4px; }
  .chip-time { display: none; }
  #rangeTitle { font-size: 14px; }
  #addBtn { padding: 8px 10px; }
  .seg-btn { padding: 6px 10px; }
}
@media (max-width: 640px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal-box { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; animation: up .2s ease; }
  @keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  .f-row { flex-direction: column; }
  .f-field { width: 100%; }
  .f-field input, .f-field select { width: 100%; }
}
@media (min-width: 901px) {
  .day-view { overflow-y: auto; height: 100%; }
}
