:root {
  --bg: #ffffff;
  --bg-side: #f7f6f3;
  --bg-hover: #efeee9;
  --border: #e6e4de;
  --text: #2c2c2a;
  --text-2: #6b6a65;
  --text-3: #9a9992;
  --blue: #378add;
  --blue-dark: #185fa5;
  --blue-soft: #e6f1fb;
  --red: #d85a30;
  --orange: #ba7517;
  --green: #1d9e75;
  --purple: #534ab7;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

#app { display: flex; height: 100vh; overflow: hidden; }

/* ---------- 侧边栏 ---------- */
#sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: var(--bg-side);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 10px;
}
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: .5px; }
/* 品牌行的放大镜：点一下进搜索页，跟搜索条里的那颗对齐 */
.brand-search {
  font-size: 15px; line-height: 1; padding: 6px 8px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; min-width: 30px;
}
.brand-search:hover { background: var(--blue-soft); color: var(--blue-dark); }

.sidebar-foot { margin-top: auto; padding: 12px 8px 16px; border-top: 1px solid var(--border); }

.section { padding: 6px 8px; }
.section + .section { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px 6px;
  font-size: 12px; color: var(--text-3);
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 8px;
  cursor: pointer; color: var(--text);
  user-select: none;
}
.nav-item:hover { background: var(--bg-hover); }
.nav-item.active { background: #e8e7e1; font-weight: 500; }
.nav-icon { width: 16px; text-align: center; font-size: 13px; }
/* 左下角「设置」图标放大一点，方便点击 */
#settingsBtn .nav-icon { width: 22px; font-size: 21px; line-height: 1; }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 12px; color: var(--text-3); }

/* 清单标识：改成带颜色的竖条（原来 8px 圆点，跟标签区的圆点混在一起太吵） */
.dot {
  width: 3px; height: 15px; border-radius: 2px; flex: 0 0 3px;
  background: var(--red);   /* 颜色由行内 style 覆盖，这里只是兜底 */
}

.tag-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px; }
.tag-chip {
  padding: 3px 9px; border-radius: 20px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 12px; cursor: pointer;
}
.tag-chip:hover { background: var(--bg-hover); }
.tag-chip.active { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-dark); }

.icon-btn {
  border: none; background: transparent; cursor: pointer;
  color: var(--text-2); font-size: 16px; line-height: 1;
  padding: 5px 7px; border-radius: 6px;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ---------- 主区 ---------- */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

#topbar {
  height: 52px; flex: 0 0 52px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px; border-bottom: 1px solid var(--border);
}
/* 标题不再吃掉整行剩余空间（原来 flex:1），右边的提示条和番茄钟才好靠右排 */
#viewTitle {
  flex: 0 1 auto; min-width: 0; margin: 0;
  font-size: 16px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
#menuBtn { display: none; }

.badge {
  background: #fcebeb; color: #a32d2d;
  font-size: 12px; padding: 3px 9px; border-radius: 20px;
  border: 1px solid #f0cfcf; cursor: pointer; font-family: inherit;
  line-height: 1.5;
}
.badge:hover { background: #f9dcdc; }
.pomo-btn { font-size: 17px; line-height: 1; }

#listMode, #calendarMode, #statsMode {
  flex: 1; overflow-y: auto; padding: 14px 18px 40px;
}
.hidden { display: none !important; }

/* ---------- 快速添加 ---------- */
/* 上面一行 = 快加(3) + 倒数日(2)，比例与间距跟下面概览卡一致 → 左右边界对齐 */
.top-row { display: flex; gap: 12px; align-items: stretch; margin-bottom: 16px; }
.quick-add {
  flex: 3 1 0; min-width: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 0;
}
.qa-row { display: flex; align-items: center; gap: 10px; }
.qa-circle {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--text-3); flex: 0 0 16px;
}
#quickInput {
  flex: 1; border: none; outline: none; font-size: 15px; padding: 5px 0;
  background: transparent; color: var(--text);
  font-family: inherit;
}
#quickInput::placeholder { color: var(--text-3); }

.qa-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--border);
}
.qa-meta select, .qa-meta input {
  border: 1px solid var(--border); border-radius: 7px;
  padding: 5px 8px; font-size: 13px; background: var(--bg); color: var(--text);
  font-family: inherit;
}
#qaTags { flex: 1; min-width: 120px; }

/* ---------- 右边那块：倒数日 · 纪念日 ---------- */
/* 内边距跟下面的概览卡完全一样，左右两块的内沿才会跟「今日待办」「未来 7 天」对上 */
.qa-side {
  flex: 2 1 0; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); padding: 12px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.cd-list { flex: 1; min-height: 0; display: flex; }
/* 首屏那块是一个格子容器（横排正好），管理面板这边要一条一行 —— 不改就会把所有行都挤到一行里 */
#remList { flex-direction: column; }

/* ---------- 倒数日 · 纪念日的勋章竖条（锁死一行 6 格，整排撑满这块的高度） ---------- */
/* 关键：勋章排跟着左边「新增任务」那块一起高（拉伸），两块上下沿永远齐平，不会一高一矮 */
.cd-grid {
  flex: 1; min-height: 78px;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px;
}
.cd-badge {
  position: relative; text-align: center; overflow: hidden;
  /* 上沿那道粗边是「勋章条」的分色带 */
  border: 1px solid var(--border); border-top: 2px solid var(--blue);
  border-radius: 8px; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 5px 3px;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.cd-badge:hover {
  transform: translateY(-2px); border-color: var(--blue);
  box-shadow: 0 4px 10px rgba(15, 23, 42, .08);
}
/* 勋章面上那枚圆章 */
.cd-ico {
  flex: none; width: 23px; height: 23px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #fff, #f2efe8);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .07);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1;
}
.cd-days { font-size: 17px; font-weight: 600; line-height: 1; color: var(--blue); }
.cd-days small { font-size: 10.5px; font-weight: 400; color: var(--text-3); margin-left: 1px; }
.cd-name {
  font-size: 11px; color: var(--text-2); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 按农历记的那条：名字下面再补一行「农历八月十五」，光挂个「农历」小标看不出是几号 */
.cd-sub {
  font-size: 9.5px; line-height: 1.3; color: #b5715f;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cd-badge.soon .cd-sub { color: #a8574e; }
/* 7 天以内：整枚勋章换暖红调 */
.cd-badge.soon { border-top-color: #cf3b2b; background: #fff8f7; }
.cd-badge.soon .cd-ico { background: radial-gradient(circle at 50% 35%, #fff, #fdeee9); }
.cd-badge.soon .cd-days { color: #cf3b2b; }
.cd-badge.soon .cd-name { color: #a8574e; }
/* 日子已经过去的一次性倒数日（多半是置顶钉住的才会留在这儿）：
   淡化 + 降饱和，让人一眼看出「这条不再倒数了」。只降透明度，不刷成中性灰。 */
.cd-badge.past { border-top-color: var(--border); opacity: .55; filter: saturate(.45); }
.cd-badge.past:hover { opacity: .85; transform: none; box-shadow: none; border-color: var(--border); }
.cd-badge.past .cd-days { color: var(--text-3); font-size: 14px; font-weight: 500; }
/* 管理面板里那条：文字已经是「已过」，这里只跟着淡化 */
.cd-row.past { opacity: .5; }
.cd-row.past:hover { opacity: .8; }
/* 这条是按农历记的：名字后面挂个小标，免得只看天数不知道它每年公历都不一样的 */
.cd-lunar {
  font-style: normal; font-size: 9px; line-height: 1.4;
  color: #a8574e; background: #fdf1ee; border-radius: 4px; padding: 0 3px; margin-left: 3px;
  vertical-align: 1px;
}
/* 记的东西没满 6 格：第一个空位是可点的「+」，剩下的才是纯占位虚线框 */
.cd-slot-add {
  border: 1px dashed #c9d6e4; border-top: 2px solid var(--blue);
  border-radius: 8px; background: rgba(47, 120, 220, .03);
  color: var(--blue); font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  transition: background .12s ease, border-color .12s ease;
}
.cd-slot-add:hover { background: #eef4fd; border-color: var(--blue); }
.cd-slot-add-ico { font-size: 22px; line-height: 1; font-weight: 600; }
.cd-slot-add-txt { font-size: 11px; color: var(--text-3); }
.cd-slot {
  border: 1px dashed var(--border); border-top: 2px dashed var(--border);
  border-radius: 8px; background: rgba(15, 23, 42, .015);
}

/* 下面这几个是管理面板里用的（行内布局），跟勋章没关系 */
.cd-main { flex: 1; min-width: 0; }
.cd-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.cd-empty { font-size: 12.5px; color: var(--text-3); padding: 10px 0; }

/* 管理面板里的行：一条占一整行，横着一次排完（图标 + 名字 + 日期/农历 + 还剩几天 + 置顶 + 删除） */
.cd-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); font-size: 13px; margin-bottom: 6px;
}
.cd-ico-mini {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: #f4f1ea; display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1;
}
.cd-row .cd-main {                 /* 名字和日期并排在一行里，不折成两行，一条就是一整行 */
  flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px;
}
.cd-row .cd-title {
  font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cd-row .cd-when {
  flex: 0 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11.5px; color: var(--text-3);
}
.cd-row .cd-days {
  flex: none; font-size: 11px; color: var(--text-3);
  background: #f2f0ea; border-radius: 6px; padding: 2px 6px;
}
.cd-row .cd-pin {
  flex: none; width: 26px; height: 26px; padding: 0; border-radius: 50%;
  color: #b6bec8; transition: background .12s ease, color .12s ease;
}
.cd-row .cd-pin:hover { color: var(--blue); background: #eef4fc; }
/* 置顶的行：除了蓝底白星，行里再挂一个「置顶」小标，扫一眼就知道谁钉在最前 */
.cd-pintag {
  flex: none; font-size: 10px; line-height: 1.5; color: var(--blue);
  background: #dce9f9; border-radius: 5px; padding: 1px 5px;
}
/* 置顶的行：蓝底白星 + 左边一道蓝竖条 + 名字加粗，一眼就看出钉在最前 */
.cd-row.pinned { border-color: #c2d8f0; background: #f7fbff; box-shadow: inset 3px 0 0 var(--blue); }
.cd-row.pinned .cd-title { font-weight: 600; color: #1c4d8f; }
.cd-row.pinned .cd-days { color: #1c4d8f; background: #dce9f9; }
.cd-pin.on {
  color: #fff; background: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 120, 220, .18), 0 1px 3px rgba(47, 120, 220, .45);
}
.cd-pin.on:hover { background: #1c62b8; color: #fff; }
.cd-row .cd-del { flex: none; }
/* 列表下面那条：一条一行摆不下时，用这个下拉决定再摊开多少条 */
.rem-more {
  display: flex; align-items: center; gap: 8px;
  margin-top: 2px; padding-top: 8px; border-top: 1px dashed var(--border);
}
.rem-more .rem-cfg-select { flex: none; margin: 0; }
/* 管理面板里「按农历」那两个下拉 + 换算结果 */
.rem-lunar { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; }
.rem-lunar-label { flex: none; font-size: 12.5px; color: var(--text-2); }
.rem-lunar select {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 7px;
  padding: 5px 8px; font-size: 13px; background: #fff;
  color: var(--text); font-family: inherit; cursor: pointer;
}
.rem-lunar-out {
  font-size: 11.5px; color: var(--blue); background: #eef4fc;
  border-radius: 6px; padding: 4px 8px; margin: 5px 0 2px;
}
/* 管理面板里「首屏显示多少天以内」那一行 */
.rem-cfg {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 8px 0 2px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg);
}
.rem-cfg-label { font-size: 12.5px; color: var(--text-2); }
.rem-cfg-select {
  border: 1px solid var(--border); border-radius: 7px; padding: 4px 8px;
  font-size: 12.5px; background: #fff; color: var(--text); font-family: inherit; cursor: pointer;
}
.rem-cfg-hint { font-size: 11.5px; color: var(--text-3); }
.cd-form-row { display: flex; gap: 8px; margin: 10px 0 6px; }
.cd-form-row select, .cd-form-row input {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 8px; font-size: 13px; background: var(--bg); color: var(--text); font-family: inherit;
}
.rem-chk { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }

/* ---------- 「全部」页的搜索条（顶掉快速添加栏）---------- */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 9px 12px; margin-bottom: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.search-bar:focus-within {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}
.search-bar .search-icon { font-size: 15px; line-height: 1; opacity: .75; flex: 0 0 auto; }
#searchInput {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 15px; color: var(--text); font-family: inherit; padding: 2px 0;
}
#searchInput::placeholder { color: var(--text-3); }
.search-clear {
  border: none; background: #eceae3; color: var(--text-2);
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 12px; line-height: 1; cursor: pointer; flex: 0 0 22px;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.search-clear:hover { background: #ddd9ce; color: var(--text-1); }
.search-count { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* 搜索命中的关键字标黄，一眼看出为什么这条被搜出来 */
mark.hl {
  background: #ffe9a8; color: inherit; border-radius: 3px; padding: 0 1px;
}
.task.done mark.hl { background: #f0e6c8; }

/* 父任务只是因为子任务才被搜出来时，行首给个小提示 */
.hit-note {
  display: inline-block; margin-left: 6px; font-size: 12px;
  color: #a16207; background: #fdf3d6; border-radius: 5px; padding: 1px 6px;
}

.btn-primary {
  background: var(--blue); color: #fff; border: none;
  border-radius: 7px; padding: 6px 14px; font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-danger { background: #fcebeb; color: #a32d2d; border: none;
  border-radius: 7px; padding: 6px 14px; font-size: 13px; cursor: pointer; font-family: inherit; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 14px; font-size: 13px; cursor: pointer; font-family: inherit; }

/* ---------- 任务列表 ---------- */
.group-title {
  font-size: 12px; color: var(--text-3); margin: 16px 0 6px; padding-left: 2px;
}
.group-title:first-child { margin-top: 0; }

.task {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  border-bottom: 1px solid #f2f1ec;
}
.task:hover { background: #faf9f6; }

.task-check {
  width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px;
  border: 1.5px solid var(--text-3); border-radius: 50%;
  cursor: pointer; position: relative;
}
.task-check.p3 { border-color: var(--red); }
.task-check.p2 { border-color: var(--orange); }
.task-check.p1 { border-color: var(--blue); }
.task-check:hover { background: var(--blue-soft); }
.task-check.done { background: var(--green); border-color: var(--green); }
.task-check.done::after {
  content: ""; position: absolute; left: 5px; top: 2px;
  width: 4px; height: 8px; border: solid #fff; border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
}

.task-body { flex: 1; min-width: 0; }
/* 行尾操作区：平时透明占位（不跳布局），鼠标停在这行才浮出来 */
.task-ops {
  display: flex; align-items: center; gap: 2px; flex: 0 0 auto;
  opacity: 0; transition: opacity .12s ease;
}
.task:hover .task-ops, .task-ops:focus-within { opacity: 1; }
.task-op {
  width: 24px; height: 24px; line-height: 24px; text-align: center;
  border-radius: 6px; cursor: pointer; user-select: none;
  color: var(--text-2); font-size: 14px;
  background: transparent;
  transition: background .12s ease, color .12s ease;
}
.task-op:hover { background: var(--bg-hover); color: var(--text); }
/* 编辑 = 蓝：整块随「鼠标停在行上」浮出，所以浮出就给蓝色，别等悬停才上色 */
.task-op.edit { color: var(--blue); }
.task-op.edit:hover { background: var(--blue-soft); color: var(--blue-dark); }
/* 删除 = 红：跟编辑一眼分得开；悬停变实心红底白字，提示这是破坏性动作 */
.task-op.danger { color: #c1503a; }
.task-op.danger:hover { background: #cd3f22; color: #fff; }
/* 已完成的条目：色相仍是蓝 / 红（别退回灰色，否则看着像没上色），只淡一档，
   鼠标压上去恢复饱和。其余状态跟未完成的行完全一致 */
.task.done .task-op.edit { color: #6fa8dd; }
.task.done .task-op.danger { color: #cf7a66; }
.task.done .task-op.edit:hover { background: var(--blue-soft); color: var(--blue-dark); }
.task.done .task-op.danger:hover { background: #cd3f22; color: #fff; }
/* 触屏没有 hover，按钮得一直露着，否则手机上根本点不到 */
@media (hover: none) { .task-ops { opacity: 1; } }
.task-title { line-height: 1.45; word-break: break-word; }
.task.done .task-title { color: var(--text-3); text-decoration: line-through; }
.task-note { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.task-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--text-2); }
.meta-item.overdue { color: #a32d2d; }
.meta-item.today { color: var(--red); font-weight: 500; }
.list-pill { display: inline-flex; align-items: center; gap: 5px; }
/* 任务行里的是短一点的竖条，别太长压住行高 */
.list-pill .dot { height: 11px; }
.pri-pill { padding: 0 6px; border-radius: 4px; font-size: 11px; }
.pri-3 { background: #faece7; color: #993c1d; }
.pri-2 { background: #faeeda; color: #854f0b; }
.pri-1 { background: var(--blue-soft); color: var(--blue-dark); }
/* 标签胶囊的背景色由 JS 按标签配色写进来（none 兜底 #888780），
   一眼能看出这个标签名在系统里有没有配色、配的什么色 */
.repeat-pill { color: var(--text-3); }

.task-children { margin-left: 27px; border-left: 1px solid var(--border); padding-left: 10px; }
/* 有子任务的行首小三角：点一下整块收起 / 展开，不用的时候不占位 */
.sub-caret {
  display: inline-block; width: 24px; height: 24px; line-height: 24px;
  margin-right: 4px; margin-top: -4px;
  color: var(--blue-dark); background: #eef2fb;
  font-size: 17px; font-weight: 700; text-align: center;
  border-radius: 7px; cursor: pointer; user-select: none; vertical-align: middle;
  transition: transform .12s ease, background .12s ease;
}
.sub-caret::before { content: "▾"; }
.sub-caret.folded { transform: rotate(-90deg); }
.sub-caret:hover { background: #dde7fa; color: var(--blue-dark); }

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

/* ---------- 日历 ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
/* 日历页顶部整行（标题/待处理/番茄钟）隐藏，菜单按钮只在窄屏补回来 */
.cal-menu { display: none; }
#calTitle { font-weight: 600; min-width: 110px; text-align: center; }

/* 日历页顶部的随机使用提示：点一下换一条，✎ 进管理页 */
.cal-tip {
  margin-left: auto; min-width: 0; max-width: 48%;
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 11px; background: var(--bg); font-family: inherit;
  font-size: 11.5px; color: var(--text-2); cursor: pointer; text-align: left;
}
.cal-tip:hover { border-color: var(--blue); color: var(--blue); }
.cal-tip-label { flex: 0 0 auto; color: var(--blue); }
.cal-tip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 「今天」页那条：跟着日历页的版式，挤在第一行右端、番茄钟左边 */
#topbar .cal-tip { margin-left: auto; max-width: 42%; }
/* 提示条在就贴着它排，没有提示条时（.hidden）才由这行把右边那组推到最右 */
#topbar .topbar-right { margin-left: 0; }
#listTip.hidden + .topbar-right { margin-left: auto; }
.list-tip-admin {
  flex: 0 0 auto; border: 0; background: transparent;
  padding: 0 2px; height: auto; line-height: 1;
}

/* ---------- 标签：任务列表 / 新增面板里都按颜色铺成小胶囊 ---------- */
/* ---------- 回收站 ---------- */
.trash-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin: 0 16px 10px;
  background: rgba(226, 76, 76, 0.07);
  border: 1px solid rgba(226, 76, 76, 0.22); border-radius: 10px;
}
.trash-tip { font-size: 12px; color: #8a3b3b; flex: 1; }
.btn-ghost {
  border: 1px solid #dedee5; background: #fff; color: #5f5f6b;
  border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.btn-ghost:hover { color: #E24C4C; border-color: rgba(226, 76, 76, 0.5); }

.trash-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; }
.trash-row + .trash-row { border-top: 1px solid #efeff4; }
.trash-main { flex: 1; min-width: 0; }
.trash-title { font-size: 14px; }
.trash-meta { font-size: 11.5px; color: #9a9aa5; margin-top: 2px; }
.trash-ops { display: flex; gap: 6px; flex: 0 0 auto; }
.trash-btn {
  border: 1px solid #dedee5; background: #fff; border-radius: 7px;
  padding: 3px 9px; font-size: 12px; cursor: pointer; color: #5f5f6b; white-space: nowrap;
}
.trash-btn.restore { color: #1D9E75; border-color: rgba(29, 158, 117, 0.45); }
.trash-btn.restore:hover { background: rgba(29, 158, 117, 0.08); }
.trash-btn.purge { color: #E24C4C; border-color: rgba(226, 76, 76, 0.4); }
.trash-btn.purge:hover { background: rgba(226, 76, 76, 0.08); }
.trash-sub { background: rgba(0, 0, 0, 0.015); }
.trash-sub .trash-title { font-size: 13px; color: #5f5f6b; }
.trash-empty { padding: 28px 12px; text-align: center; color: #9a9aa5; font-size: 13px; }

/* ---------- 标签管理 ----------
   行首不再挂大圆点（满屏圆点太吵），颜色只由下面调色板的选中态表示：
   备选的小（15px），当前用的那颗放大到 22px + 深描边，一眼看得出。 */
/* 标签管理 + 清单管理共用一套行样式（.tag-mgr-* 与 .list-mgr-* 长得一样） */
.tag-mgr, .list-mgr { display: flex; flex-direction: column; gap: 9px; }
.tag-mgr-row, .list-mgr-row {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 8px; border: 1px solid #ececf1; border-radius: 9px;
}
.tag-mgr-count, .list-mgr-count { font-size: 11px; color: #9a9aa5; flex: 0 0 auto; }
.tag-mgr-edit, .list-mgr-edit {
  flex: 1; min-width: 0; padding: 6px 8px; font-size: 13.5px;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: var(--text); font-family: inherit;
}
.tag-mgr-edit:hover, .list-mgr-edit:hover { background: var(--bg-hover); }
.tag-mgr-edit:focus, .list-mgr-edit:focus { background: var(--bg); border-color: #dedee5; outline: none; }
.tag-mgr-del, .list-mgr-del {
  border: 0; background: transparent; color: #9a9aa5;
  cursor: pointer; font-size: 15px; padding: 0 4px; flex: 0 0 auto;
}
.tag-mgr-del:hover, .list-mgr-del:hover { color: #E24C4C; }
.list-mgr-up, .list-mgr-down {
  border: 0; background: transparent; color: #b6b6c0;
  cursor: pointer; font-size: 10px; line-height: 1; padding: 2px 3px; flex: 0 0 auto;
}
.list-mgr-up:hover, .list-mgr-down:hover { color: var(--text); background: var(--bg-hover); border-radius: 5px; }
.list-mgr-up:disabled, .list-mgr-down:disabled { opacity: .3; cursor: default; }
/* 侧边栏标题栏里放多个按钮（＋ 新建 / ✎ 管理） */
.head-ops { display: inline-flex; align-items: center; gap: 2px; }
.tag-mgr-add { display: flex; gap: 8px; margin-top: 12px; }
.tag-mgr-add input { flex: 1; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 6px 2px; }
.swatch-dot {
  width: 15px; height: 15px; border-radius: 5px; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}
.swatch-dot:hover { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), 0 0 0 2px rgba(0, 0, 0, .16); }
.swatch-dot.on {
  width: 22px; height: 22px; border-radius: 7px;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.4px #1f1f1d;
}

.tag-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 9px; border-radius: 999px;
  font-size: 11.5px; line-height: 17px; color: #fff;
  white-space: nowrap; border: 1px solid rgba(255, 255, 255, 0.35);
}
.tag-preview {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px; min-height: 0;
}
.tag-preview:empty { display: none; }

/* gap 统一由 --gap 变量控制，改这个变量，JS 画的跨天横条位置会自动跟着变 */
.cal-dow-row, .cal-cells { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--gap); }
.cal-dow { text-align: center; font-size: 12px; color: var(--text-3); padding: 4px 0; }
/* 周六、周日本身就是休息日：表头这两个字标红，一眼看出周末列 */
.cal-dow.weekend { color: #d0453b; font-weight: 600; }
.cal-body {
  position: relative;
  --cell-h: 156px;   /* 一格大约放得下 6 条 */
  --gap: 0px;        /* 天与天之间不留缝，跨天的任务看起来就是一整条 */
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.cal-cells { grid-auto-rows: var(--cell-h); }

.cal-cell {
  border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 5px 7px; background: var(--bg); cursor: pointer; overflow: hidden;
  position: relative;   /* 让「休 / 班」角标能贴住格子右上角 */
  transition: background .12s ease, box-shadow .12s ease;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cells > .cal-cell:nth-last-child(-n+7) { border-bottom: 0; }
/* 鼠标移到某一天：整格淡蓝 + 内描边，把「这一格可点」说出来（第 33 轮） */
.cal-cell:hover { background: #f4f8fe; box-shadow: inset 0 0 0 2px #d3e2f3; }
.cal-cell.other { background: #fbfaf7; color: var(--text-3); }
.cal-cell.other:hover { background: #eef4fc; }
.cal-cell.today { border-color: var(--blue); background: var(--blue-soft); }
.cal-cell.today:hover { background: #dcebf9; box-shadow: inset 0 0 0 2px #b4d2ee; }
.cal-daynum {
  font-size: 11.5px; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px;
  cursor: pointer; box-sizing: border-box;
  /* 常态也有一圈淡框：让日期看起来就是一颗「可点的小按钮」，不只是个数字 */
  box-shadow: 0 0 0 1px var(--border);
  transition: background .12s ease, color .12s ease, box-shadow .12s ease;
}
/* 周末格里，日期数字也标红（悬停时下面的 hover 规则在后，会把它盖成蓝字） */
.cal-daynum.weekend { color: #c9503f; }
.cal-cell.today .cal-daynum.weekend { color: #fff; }  /* 今天格是实心蓝底，白字 */
/* 日期数字本身：hover 变成一颗浅蓝胶囊 + 深蓝粗体字 */
.cal-daynum:hover {
  background: #cfe1f5; color: var(--blue-dark); font-weight: 600;
  box-shadow: 0 0 0 1px #a9c7e6;
}
.cal-cell.today .cal-daynum {
  background: var(--blue); color: #fff; font-weight: 600; box-shadow: none;
}
.cal-cell.today .cal-daynum:hover {
  background: var(--blue-dark); box-shadow: 0 0 0 1px var(--blue-dark);
}

/* 节假日 / 调休角标：放假挂绿底「休」，调休上班挂橙底「班」。
   不用图片：纯 CSS 徽章不依赖外网、高清屏不糊、改色只动一个值。
   做成小圆片贴在日期数字右上角（跟日历 App 一个位置），字比日期小一号；
   pointer-events:none 免得挡住点格子，所以提示文字挂到整格上。 */
.cal-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; padding: 0; box-sizing: border-box;
  border-radius: 50%; font-size: 9px; font-weight: 600; line-height: 1;
  color: #fff; pointer-events: none; white-space: nowrap;
}
/* 格子里的休/班：再小一号（12px），挂到缩小后的日期圈右上角。
   top 只敢上探 4px —— 再往上就会被 .cal-cell 的 overflow:hidden 切掉半圆（第 37 轮踩过）。
   白边（0 0 0 1.5px #fff）把角标和日期圈隔开，圈看起来才是「完整的一圈」。 */
.cal-daywrap > .cal-badge {
  position: absolute; top: -4px; right: -5px; width: 12px; height: 12px;
  font-size: 8px;
  box-shadow: 0 0 0 1.5px #fff, 0 1px 2px rgba(15, 23, 42, .28);
}
.cal-badge.off { background: #2f9e63; }
.cal-badge.work { background: #e06a3d; }
/* 图例里的角标跟文字并排，留原来的尺寸看得清 */
.cal-legend-item .cal-badge { width: 16px; height: 16px; font-size: 9.5px; }

/* 格子头一行：左边日期数字（休/班 圆角标挂在它右上角），右边节日名（绿）+ 阴历（灰） */
.cal-dayhead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 4px; height: 20px;
  overflow: visible;   /* 别裁：挂在日期圈角上的休/班 小圆片得整颗露出来 */
}
.cal-daywrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.cal-fest, .cal-lunar {
  flex: 0 0 auto; font-size: 11px; line-height: 20px; white-space: nowrap;
}
/* 特殊节日名：绿色，一眼看出这天过什么节 */
.cal-fest { color: #2f9e63; font-weight: 600; }
/* 阴历（农历）日期，跟在节日名后面，颜色淡一点 */
.cal-lunar { color: #a8a091; }

/* 日历头下面的小图例，说清楚两个角标什么意思 */
.cal-legend {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px;
  font-size: 11.5px; color: var(--text-3); padding: 0 2px 8px;
}
.cal-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend-item .cal-badge { box-shadow: 0 0 0 1px rgba(15, 23, 42, .1); }
.day-head #dayBadge { display: inline-flex; align-items: center; }

/* 当天任务列表弹窗 */
.day-head { display: flex; align-items: center; gap: 8px; }
.day-date { font-size: 13px; color: var(--text-2); font-weight: 400; }
.day-list { display: flex; flex-direction: column; }
.day-empty { font-size: 13px; color: var(--text-3); padding: 18px 0; text-align: center; }

.cal-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
/* 条本身 16px 高：跟 drawCalendarBars 里的 BAR_VIS 对上，条间那 2px 缝（第 52 轮） */
.cal-bar {
  position: absolute; height: 16px; line-height: 16px; font-size: 11px;
  padding: 0 6px; color: #fff; cursor: pointer; pointer-events: auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-radius: 4px; box-sizing: border-box;
}
.cal-bar:hover { filter: brightness(1.08); }
.cal-bar.done { opacity: .45; text-decoration: line-through; }
/* 「还有 N 项」按链接处理：可以点，点了就是当天全部任务 */
.cal-more {
  position: absolute; height: 16px; line-height: 16px; font-size: 10.5px;
  color: var(--text-3); padding-left: 6px; cursor: pointer; pointer-events: auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box;
}
.cal-more::before { content: "‹ "; }
.cal-more:hover { color: var(--blue); text-decoration: underline; }

/* ---------- 首页概览 ---------- */
.overview { display: flex; gap: 12px; margin-bottom: 16px; align-items: stretch; }
.ov-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; min-width: 0; display: flex; flex-direction: column;
}
/* 左列（过期任务 + 今日待办）占三份，右边的未来 7 天占两份 */
.ov-col-left { flex: 3 1 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ov-card.ov-today { flex: 1 1 auto; }   /* 在左列里铺满剩余高度 */
.ov-card.ov-week { flex: 2 1 0; }
.ov-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.ov-num { font-size: 30px; font-weight: 600; line-height: 1; color: var(--text); }
.ov-label { font-size: 12px; color: var(--text-3); }
.ov-sub { font-size: 11.5px; color: #a32d2d; margin-top: 3px; }
/* 两块都向下铺开，内容有多少显示多少，不再内部滚动 */
.ov-task-list { flex: 1; overflow: visible; }
.ov-card { min-height: 240px; }
.ov-task-list .task { padding: 6px 2px; }
.ov-task-list .task-title { font-size: 13.5px; }
.ov-task-list .group-title { font-size: 11.5px; padding: 8px 0 3px; }
.ov-row {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; padding: 3px 0; border-top: 1px solid var(--border);
}
.ov-row:first-child { border-top: 0; }
.ov-row-time { color: var(--text-3); flex: 0 0 38px; font-variant-numeric: tabular-nums; }
.ov-row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-row-title.done { color: var(--text-3); text-decoration: line-through; }
.ov-dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; align-self: center; }
.ov-overdue { color: #a32d2d; }

/* 「过期任务」卡片：压在今日待办上方，只占左列宽度，红边、可折叠 */
.overdue-card {
  flex: 0 0 auto;                 /* 按内容高度，不跟着拉伸 */
  border: 1px solid #e7b7b7; border-left: 3px solid #a32d2d;
  border-radius: var(--radius); padding: 12px 16px;
  background: #fdf5f5;
}
.overdue-card .od-head {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
}
.od-chevron { color: #a32d2d; font-size: 13px; transition: transform .15s ease; }
.od-chevron.collapsed { transform: rotate(-90deg); }
.od-num { font-size: 26px; font-weight: 700; color: #a32d2d; line-height: 1; }
.od-label { font-size: 14px; color: #a32d2d; font-weight: 600; }
.od-hint { margin-left: auto; font-size: 11px; color: var(--text-3); }
.od-list { margin-top: 8px; }
.od-list.collapsed { display: none; }
.od-list .task { padding: 6px 2px; }
.od-list .task-title { font-size: 13.5px; }
.od-list .group-title { font-size: 11.5px; padding: 8px 0 3px; }
.ov-empty { font-size: 12px; color: var(--text-3); padding: 4px 0; }
.ov-day-block { padding-bottom: 2px; }
.ov-day-date {
  font-size: 11.5px; color: var(--text-2); font-weight: 500;
  padding: 5px 0 1px; border-top: 1px solid var(--border);
}
.ov-day-block:first-child .ov-day-date { border-top: 0; padding-top: 0; }

/* ---------- 标签颜色 ---------- */
.tag-colors { display: flex; flex-direction: column; gap: 8px; }
.tag-color-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.tag-color-row > .tc-name { flex: 0 0 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch { width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--border); cursor: pointer; flex: 0 0 18px; }
.swatch.active { box-shadow: 0 0 0 2px var(--text); }
.hint.small { font-size: 11px; padding: 6px 9px; margin-bottom: 12px; }

/* ---------- 统计 ---------- */
.stat-cards { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.stat-card {
  flex: 1; min-width: 110px; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.stat-num { font-size: 24px; font-weight: 600; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.chart-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.chart-title { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; background: var(--blue); border-radius: 3px 3px 0 0; min-height: 2px; max-height: 100px; }
.bar-num { font-size: 10px; color: var(--text-3); }
.bar-label { font-size: 9px; color: var(--text-3); writing-mode: initial; }

.report-preview {
  background: var(--bg-side); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; font-size: 12px; line-height: 1.6; white-space: pre-wrap;
  font-family: inherit; margin: 10px 0; max-height: 300px; overflow-y: auto;
}

/* 统计页：生成周报按钮行 + 下载周工作要点控件 */
.report-actions { display: flex; gap: 8px; margin: 4px 0 0; }
.report-dl { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.report-dl .chart-title { margin-bottom: 8px; }
.dl-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wk-sel { padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text); font-size: 13px; }
#wkDlBtn { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- 抽屉与遮罩 ---------- */
.mask { position: absolute; inset: 0; background: rgba(44,44,42,.25); z-index: 40; }

.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 380px; max-width: 92vw;
  background: var(--bg); border-left: 1px solid var(--border); z-index: 50;
  display: flex; flex-direction: column;
}
/* 居中弹窗变体：新增任务用它，详情/编辑仍保持右侧通栏抽屉 */
.drawer.modal {
  top: 50%; left: 50%; right: auto; bottom: auto;
  transform: translate(-50%, -50%);
  width: 460px; max-width: calc(100vw - 32px); max-height: calc(100vh - 64px);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 48px rgba(44, 44, 42, .22);
  overflow: hidden;
}
.drawer.modal .drawer-body { padding-bottom: 18px; }

.drawer-head {
  height: 52px; flex: 0 0 52px; display: flex; align-items: center; gap: 10px;
  padding: 0 12px; border-bottom: 1px solid var(--border); font-weight: 600;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px 30px; }
.drawer-body.center { text-align: center; }

.d-title {
  width: 100%; border: none; outline: none; font-size: 16px; font-weight: 600;
  padding: 6px 0; margin-bottom: 10px; color: var(--text); font-family: inherit;
  background: transparent;
}
/* 新增面板：清单选择 + 详情区 */
/* 清单 + 标题同一行：新增面板与详情抽屉共用 */
.title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.mini-list {
  width: 64px; flex: 0 0 64px; border: 1px solid var(--border); border-radius: 7px;
  padding: 5px 4px; font-size: 13px; background: var(--bg); color: var(--text);
  font-family: inherit; outline: none;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
.title-row .d-title {
  margin-bottom: 0; flex: 1; min-width: 0;
  border-bottom: 1px solid var(--border); padding: 6px 2px;
}
.title-row .d-title:focus { border-bottom-color: var(--blue); }
.title-row .d-title::placeholder {
  font-size: 12.5px; font-weight: 400; color: var(--text-3);
}
.note-block {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px 10px; margin-bottom: 12px; background: var(--bg);
}
.note-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px;
}
.note-label { font-size: 12px; color: var(--text-3); }
.sub-btn {
  border: 1px solid var(--border); background: var(--bg-soft, #f7f6f2);
  color: var(--text-2); border-radius: 6px; padding: 3px 9px; font-size: 12px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  font-family: inherit;
}
.sub-btn:hover { color: var(--text); background: #efeee9; }
.sub-btn.active { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.sub-icon { font-size: 13px; line-height: 1; }
.note-block textarea {
  width: 100%; box-sizing: border-box; border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 9px; font-size: 13px;
  background: var(--bg); color: var(--text); font-family: inherit;
  outline: none; resize: vertical;
}
/* 提示文字统一比正文小一号、颜色更浅，避免和真实输入内容混淆 */
.drawer-body ::placeholder { font-size: 12px; font-weight: 400; color: var(--text-3); }
.child-wrap { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.child-wrap input {
  border: 1px solid var(--border); border-radius: 7px; padding: 5px 8px;
  font-size: 13px; font-family: inherit; background: var(--bg); color: var(--text);
}

/* 「某一天 / 时间段」二选一开关 */
.seg {
  display: inline-flex; border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; margin-bottom: 12px;
}
.seg-btn {
  border: 0; background: var(--bg); color: var(--text-2);
  padding: 5px 15px; font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.seg-btn.active { background: var(--blue); color: #fff; }

.d-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.d-row > span { width: 62px; flex: 0 0 62px; color: var(--text-2); }
.d-row.col { flex-direction: column; align-items: stretch; gap: 5px; }
.d-row.col > span { width: auto; }

/* 子任务 */
.child-list { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.child-list input {
  border: 1px solid var(--border); border-radius: 7px; padding: 5px 8px;
  font-size: 13px; font-family: inherit; background: var(--bg); color: var(--text);
}
.child-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 13px; background: var(--bg);
}
.child-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.child-title.done { color: var(--text-3); text-decoration: line-through; }
.d-row select, .d-row input, .d-row textarea {
  flex: 1; border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 9px; font-size: 13px; background: var(--bg); color: var(--text);
  font-family: inherit; outline: none;
}
.d-row textarea { resize: vertical; }
.drawer-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

#detailStatus { font-size: 13px; font-weight: 400; color: var(--text-2); }

/* 使用提示管理 */
.tip-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.tip-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg);
}
.tip-row.off { background: var(--bg-side); }
.tip-cat {
  flex: 0 0 74px; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 4px; font-size: 12px; font-family: inherit;
  background: var(--bg); color: var(--text); outline: none; cursor: pointer;
}
.tip-cat-text {
  flex: 0 0 74px; font-size: 12px; color: var(--text-3);
  padding: 4px 2px; line-height: 1.5; text-align: center;
}
.tip-text {
  flex: 1; min-width: 0; border: 0; outline: none; resize: none;
  background: transparent; font-family: inherit;
  font-size: 12.5px; line-height: 1.55; color: var(--text); padding: 2px 0;
  overflow: hidden;
}
.tip-text[readonly] { cursor: default; }
.tip-row.off .tip-text { color: var(--text-3); }
.tip-switch {
  flex: 0 0 auto; width: 34px; height: 18px; border-radius: 9px;
  border: 0; background: #d3d1c7; position: relative; cursor: pointer; padding: 0;
}
.tip-switch.on { background: var(--blue); }
.tip-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
}
.tip-switch.on::after { left: 18px; }
.tip-add { width: 100%; padding: 7px; margin-bottom: 10px; }
/* 刚点「新增一条」出来的那行：淡蓝描边，明确告诉人「录这儿」 */
.tip-row.is-new { border-color: var(--blue); background: var(--blue-soft); }

.pomo-task { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.pomo-time { font-size: 56px; font-weight: 200; letter-spacing: 2px; margin: 20px 0; }
.pomo-round { font-size: 12px; color: var(--text-3); margin-bottom: 20px; }
.pomo-set { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 20px; }
.pomo-set-label { font-size: 13px; color: var(--text-2); }
.pomo-min { width: 64px; padding: 6px 8px; text-align: center; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 14px; }
.pomo-select { width: 100%; margin-top: 16px; padding: 7px; border: 1px solid var(--border);
  border-radius: 7px; background: var(--bg); color: var(--text); font-family: inherit; font-size: 13px; }

.hint {
  background: var(--bg-side); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 12px; line-height: 1.65; color: var(--text-2); margin-bottom: 14px;
}
.s-result { margin-top: 12px; font-size: 12px; color: var(--text-2); word-break: break-all; }

.toast {
  position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: #2c2c2a; color: #fff; padding: 9px 18px; border-radius: 20px;
  font-size: 13px; z-index: 90; pointer-events: none;
}

/* ---------- 手机适配 ---------- */
/* ---------- 登录 ---------- */
.login-wrap {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-side);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 26px 24px 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,.06);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-logo {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
}
.login-title { font-size: 17px; font-weight: 600; }
.login-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 5px; }
.field input {
  width: 100%; padding: 9px 11px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
  color: var(--text); font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--blue); }
/* 密码框右边那颗小眼睛：点一下把小圆点变明文，输错在哪一位当场就能看出来
   （昊哥提的痛点：全是圆点，密码错了根本看不出来错在哪） */
.pw-wrap { position: relative; display: block; }
/* 密码框在两种容器里，都得把继承来的样式拨回去：
   .d-row > span 会被套上「标签固定 62px 宽」；.field > span 会继承 12px 小字、灰色和下边距 */
.d-row > .pw-wrap { flex: 1; width: auto; }
.field > .pw-wrap { margin-bottom: 0; font-size: inherit; color: inherit; }
/* 用两级选择器压住 .d-row input / .field input 原本的 padding */
.d-row .pw-wrap > input, .field .pw-wrap > input { padding-right: 34px; width: 100%; }
.pw-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--text-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s ease, color .12s ease;
}
.pw-eye:hover { background: var(--bg-hover); color: var(--text-2); }
.pw-eye:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.pw-eye.on { color: var(--blue); }            /* 明文状态：图标转蓝，再压一道斜杠表示「点我藏起来」 */
.pw-eye.on::after {
  content: ""; position: absolute; left: 4px; top: 50%;
  width: 17px; height: 1.5px; background: currentColor;
  border-radius: 1px; transform: rotate(-45deg);
}
.btn-primary.block { width: 100%; padding: 10px; margin-top: 4px; }
.login-err {
  min-height: 18px; margin-top: 10px; font-size: 12.5px;
  color: var(--red); text-align: center;
}
.login-foot { margin-top: 10px; font-size: 11.5px; color: var(--text-3); text-align: center; }

/* ---------- 侧边栏账号区 ---------- */
.user-box {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; margin-bottom: 4px;
  border-radius: 8px; background: var(--bg-hover);
  cursor: pointer;
}
.user-box:hover { background: var(--border); }
.user-avatar {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-meta #userName {
  font-size: 13px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-role { font-size: 10.5px; color: var(--text-3); }

.drawer-section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.drawer-section:last-child { border-bottom: 0; margin-bottom: 0; }
.user-list { margin: 8px 0 12px; }
.user-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 7px; background: var(--bg-hover);
  margin-bottom: 5px; font-size: 12.5px;
}
.user-row .ur-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .ur-role { font-size: 10.5px; color: var(--text-3); }
.user-row.is-me { box-shadow: inset 0 0 0 1px var(--blue); }
.ur-del {
  border: 0; background: transparent; color: var(--text-3);
  cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px; border-radius: 5px;
}
.ur-del:hover { background: #fdeceb; color: var(--red); }

@media (max-width: 820px) {
  #menuBtn, #settingsMenuBtn { display: block; }
  #sidebar {
    position: absolute; left: 0; top: 0; bottom: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 2px 0 12px rgba(0,0,0,.06);
  }
  #sidebar.open { transform: translateX(0); }
  #listMode, #calendarMode, #statsMode { padding: 12px 12px 40px; }
  .qa-meta { gap: 6px; }
  .bar-chart { height: 90px; }
  .cal-body { --cell-h: 108px; }
  /* 手机上每格只有几十像素宽，头一行塞不下节日名和阴历，直接不显示（省得挤成一团） */
  .cal-fest, .cal-lunar { display: none; }
  .cal-menu { display: block; }
  .drawer.modal { width: calc(100vw - 24px); max-height: calc(100vh - 40px); }
  .cal-bar { height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
  .overview { flex-direction: column; }
  .ov-card:first-child, .ov-card:last-child { flex: 1 1 auto; }
  .ov-card { min-height: 0; }
  #topbar { padding: 0 10px; }
  /* 窄屏上下摆，别把新增挤成一条缝 */
  .top-row { flex-direction: column; }
  .quick-add, .qa-side { flex: 1 1 auto; }
  /* 6 格在窄屏挤成一团，改成 3 个一行（上下两行，高度按勋章自然撑开） */
  .cd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto; min-height: 168px; }
  .cd-ico { width: 28px; height: 28px; font-size: 15px; }
  .cd-days { font-size: 18px; }
}

/* ---------- 设置页（独立页面 + 标签页） ---------- */
#settingsMode { overflow-y: auto; padding: 18px 22px 48px; }
.settings-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.settings-title { font-size: 18px; font-weight: 600; flex: 1; }
#settingsMenuBtn { display: none; }

.tabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.tab {
  appearance: none; -webkit-appearance: none;
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 14px; font-size: 13px; font-family: inherit;
  color: var(--text-3); cursor: pointer;
}
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--text); font-weight: 600; border-bottom-color: var(--blue); }

.tab-pane { display: none; max-width: 720px; }
.tab-pane.active { display: block; }

/* 开关 */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  display: inline-block; width: 40px; height: 22px; border-radius: 11px;
  background: var(--border); transition: background .15s;
}
.switch-knob {
  display: block; width: 18px; height: 18px; margin: 2px;
  border-radius: 50%; background: #fff; transition: transform .15s;
}
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track .switch-knob { transform: translateX(18px); }

.int-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.int-head .chart-title { margin-bottom: 0; }

.token-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.token-input {
  flex: 1; min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
  color: var(--text-2); background: var(--bg-side);
  border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px;
}
.token-row .btn-ghost { flex: 0 0 auto; white-space: nowrap; }

/* 底部备案信息：管理员在设置「网站信息」里填了才显示 */
.site-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 8px 16px; text-align: center;
  font-size: 12px; line-height: 1.5; color: var(--text-2);
  background: var(--bg-side); border-top: 1px solid var(--border);
}
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .sf-sep { margin: 0 6px; opacity: .55; }
/* 给主内容留出底部空间，免得备案条盖住最后一条任务 */
main { padding-bottom: 42px; }
