/* ============================================================
   AeroTodo · 样式（移动端优先 · 简约航空蓝）
   ============================================================ */
:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --line: #e6eaf1;
  --primary: #1d5fa8;
  --primary-dark: #164a83;
  --primary-light: #e9f1fb;
  --text: #223047;
  --text-2: #5c6b7f;
  --text-3: #96a2b4;
  --red: #e5484d;
  --amber: #e8941f;
  --green: #2ea873;
  --blue: #1d5fa8;
  --gray: #8d99a8;
  --red-bg: #fdecec;
  --amber-bg: #fdf3e2;
  --green-bg: #e7f6ee;
  --blue-bg: #e9f1fb;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(24, 48, 80, .07);
  --radius-lg: 18px;
}

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

/* hidden 属性必须真正隐藏（防止被 display:flex/grid 等显式 display 覆盖） */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; overflow-y: scroll; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 10px 18px;
  font-size: 14px; font-weight: 600; color: #fff; background: var(--primary);
  min-height: 42px; transition: background .15s, transform .05s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #eef2f8; color: var(--text-2); }
.btn-ghost:hover { background: #e2e8f2; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #c93a3f; }
.btn-block { width: 100%; }
.btn-mini { padding: 6px 12px; min-height: 36px; font-size: 13px; border-radius: 8px; white-space: nowrap; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 18px;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(29, 95, 168, .14), transparent 60%),
    radial-gradient(900px 420px at -10% 110%, rgba(46, 168, 115, .10), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--card);
  border-radius: var(--radius-lg); padding: 36px 28px 28px;
  box-shadow: 0 18px 50px rgba(24, 48, 80, .12);
}
.login-logo { display: flex; justify-content: center; color: var(--primary); margin-bottom: 14px; }
.login-card h1 { font-size: 21px; text-align: center; letter-spacing: .5px; }
.login-sub { font-size: 13px; color: var(--text-3); text-align: center; margin: 6px 0 24px; }
.login-card label { display: block; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; }
.login-card input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fafbfd;
}
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 95, 168, .12); background: #fff; }
.login-card .btn { margin-top: 20px; }
.login-error { color: var(--red); font-size: 13px; margin-top: 12px; text-align: center; }
.login-foot { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 20px; }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1500px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; margin-right: auto; overflow: hidden; }
.brand-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.brand-text { font-size: 17px; font-weight: 700; color: var(--primary-dark); display: flex; align-items: baseline; gap: 7px; white-space: nowrap; min-width: 0; overflow: hidden; }
.brand-text small { font-size: 11px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-btn {
  position: relative; width: 40px; height: 40px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-2); display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--primary-light); color: var(--primary); }
.badge-dot {
  position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* 用户菜单 */
.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 8px; border: 0; background: transparent;
  padding: 5px 6px; border-radius: 10px;
}
.user-chip:hover { background: var(--primary-light); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-name { font-size: 14px; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caret { color: var(--text-3); font-size: 11px; }
.user-dropdown {
  position: absolute; right: 0; top: 46px; min-width: 170px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(24, 48, 80, .14); overflow: hidden; z-index: 60;
}
.ud-item { padding: 11px 16px; font-size: 14px; cursor: pointer; }
.ud-item:hover { background: var(--primary-light); color: var(--primary); }
.ud-danger { color: var(--red); }
.ud-danger:hover { background: var(--red-bg); }
.ud-divider { height: 1px; background: var(--line); }

/* ---------- 主内容 ---------- */
.main { max-width: 1500px; margin: 0 auto; padding: 14px 16px 110px; }

/* 任务范围切换（全部任务 / 我的任务） */
.scope-tabs {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.scope-tab-group {
  display: inline-flex; background: #e8edf5; border-radius: 12px; padding: 4px; gap: 4px;
}
.scope-tab {
  border: 0; background: transparent; color: var(--text-2);
  font-size: 14px; font-weight: 600; padding: 9px 22px; border-radius: 9px;
  min-height: 40px; transition: all .15s; white-space: nowrap;
}
.scope-tab.active { background: var(--primary); color: #fff; box-shadow: 0 3px 10px rgba(29, 95, 168, .25); }
.scope-assignee { display: flex; gap: 8px; flex-wrap: wrap; }
.scope-assignee select {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 10px; padding: 9px 12px; font-size: 14px; min-height: 42px;
  box-shadow: var(--shadow); min-width: 132px; max-width: 220px;
}

/* 只读模式提示条 */
.guest-banner {
  max-width: 1500px; margin: 10px auto 0; padding: 9px 16px;
  background: linear-gradient(90deg, rgba(29, 95, 168, .10), rgba(29, 95, 168, .04));
  border: 1px solid rgba(29, 95, 168, .18); border-radius: 12px;
  font-size: 13px; color: var(--primary-dark);
}
.guest-banner a { color: var(--primary); font-weight: 700; }
.login-back { text-align: center; margin-top: 16px; }
.login-back a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 28px; font-size: 13.5px; font-weight: 600;
  color: var(--primary); background: #fff;
  border: 1.5px solid var(--primary); border-radius: 10px; text-decoration: none;
  transition: all .2s;
}
.login-back a:hover { background: var(--primary); color: #fff; }

/* 统计区 */
.stat-cards {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 12px;
}
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 14px 8px 12px;
  text-align: center; box-shadow: var(--shadow);
}
.stat-num { font-size: 24px; font-weight: 800; color: var(--primary-dark); line-height: 1.15; }
.stat-label { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.stat-card-warn { background: linear-gradient(160deg, #fff, #fdf1f1); }
.stat-card-warn .stat-num { color: var(--red); }
/* 待回执卡：完成类，琥珀色柔和提示（不用红色） */
.stat-cards-inline .stat-card-await { background: linear-gradient(160deg, #fff, #fdf6ea); }
.stat-card-await .stat-num { color: var(--amber); }
/* 统计卡：点击即筛选 */
.stat-click { cursor: pointer; transition: transform .1s, box-shadow .1s; }
.stat-click:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(24, 48, 80, .12); }
.stat-click:active { transform: scale(.97); }

.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.chart-row-single { grid-template-columns: 1fr; }
.chart-card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); position: relative;
}
.chart-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 12px; padding-right: 34px; }
/* 状态分布折叠按钮（右上角，主题蓝色） */
.chart-fold-btn {
  position: absolute; top: 10px; right: 12px;
  width: 30px; height: 30px; border: none; border-radius: 8px; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 23px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(29, 95, 168, .28);
  transition: transform .15s, background .15s;
  padding: 0;
}
.chart-fold-btn::before {
  content: '▾'; transform: translateY(-1px); display: block;
  transition: transform .15s;
}
.chart-fold-btn:hover { background: var(--primary-dark); }
.chart-fold-btn.collapsed { background: var(--primary-light); color: var(--primary); box-shadow: none; }
.chart-fold-btn.collapsed::before { transform: translateY(-1px) rotate(180deg); }

/* 状态分布卡内：第一排 总任务/已完成（大框各占 2 列），第二排 未开始/进行中/待回执/已超期（小框各 1 列） */
.stat-cards-inline {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  flex: 1 1 320px; min-width: 0;
}
.stat-cards-inline .stat-card {
  padding: 10px 4px 9px; border-radius: 10px;
  background: linear-gradient(160deg, #f7fafd, #fff);
  box-shadow: inset 0 0 0 1px #e8eef5;
}
.stat-cards-inline .stat-num { font-size: 20px; }
.stat-cards-inline .stat-label { font-size: 11.5px; color: var(--text); }
.stat-cards-inline .stat-major { grid-column: span 2; }
.stat-cards-inline .stat-mini { padding: 6px 4px 5px; border-radius: 8px; }
.stat-cards-inline .stat-mini .stat-num { font-size: 16px; }
.stat-cards-inline .stat-mini .stat-label { font-size: 10.5px; margin-top: 2px; }
/* 统计数字颜色与任务列表状态圆点一致且加深：未开始深灰蓝 / 进行中深蓝 / 待回执深琥珀 / 已完成深绿 / 已超期深红 */
.stat-cards-inline .st-done .stat-num { color: #177a52; }
.stat-cards-inline .st-dot0 .stat-num { color: #5c6b7f; }
.stat-cards-inline .st-dot1 .stat-num { color: #164a83; }
.stat-cards-inline .st-dot3 .stat-num { color: #a86a08; }
.stat-cards-inline .st-dot-over .stat-num { color: #c23035; }

.donut-wrap { position: relative; width: 128px; height: 128px; margin: 0 auto; }
.donut {
  width: 128px; height: 128px; border-radius: 50%;
  background: conic-gradient(#e8f6f0 0deg, #e8f6f0 360deg);
  border: 2px solid #dfe6ef;
  box-shadow: inset 0 0 0 2px #fff;
}
.donut-center {
  position: absolute; inset: 18px; border-radius: 50%; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut-rate { font-size: 22px; font-weight: 800; color: var(--primary-dark); }
.donut-rate-label { font-size: 11px; color: var(--text-3); }

.prio-bars { display: flex; flex-direction: column; gap: 12px; padding: 6px 0; }
.prio-row { display: flex; align-items: center; gap: 10px; border-radius: 8px; padding: 4px 6px; margin: 0 -6px; cursor: pointer; transition: background .2s; }
.prio-row:hover { background: #f2f5fa; }
.prio-row.active { background: #edf3fb; box-shadow: inset 0 0 0 1.5px rgba(29, 95, 168, .45); }
.prio-tag {
  width: 42px; text-align: center; font-size: 12px; font-weight: 700;
  border-radius: 6px; padding: 3px 0; flex-shrink: 0;
}
.prio-1 { background: var(--red-bg); color: var(--red); }
.prio-2 { background: var(--amber-bg); color: var(--amber); }
.prio-3 { background: var(--green-bg); color: var(--green); }
.prio-track { flex: 1; height: 9px; background: #eef1f6; border-radius: 6px; overflow: hidden; }
.prio-fill { height: 100%; border-radius: 6px; transition: width .4s; }
.prio-fill.p1 { background: var(--red); }
.prio-fill.p2 { background: var(--amber); }
.prio-fill.p3 { background: var(--green); }
.prio-count { font-size: 13px; font-weight: 700; color: var(--text-2); min-width: 20px; text-align: right; }

/* 状态分布：左侧统计卡（2 排）+ 右侧完成率圆环 */
.status-layout { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.status-layout .donut-wrap { flex-shrink: 0; margin: 0; }
@media (max-width: 640px) {
  .status-layout { justify-content: center; }
  .status-layout .donut-wrap { margin: 4px auto 0; }
}
/* 快捷筛选（全部/未完成/已超期/进行中/待回执/已删除）：手机端 3×2 */
@media (max-width: 720px) {
  .filter-actions.quick-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .filter-actions.quick-chips .chip { text-align: center; justify-content: center; }
}

/* 内联筛选下拉（类别/状态/优先级/排序/制单人） */
.filter-actions.inline-filters { width: 100%; padding-top: 2px; }
.scope-sel, .fsel {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 10px; padding: 7px 10px; font-size: 13px; min-height: 38px;
  box-shadow: var(--shadow); max-width: 190px; min-width: 0;
}
.fsel { flex: 1 1 130px; }
.scope-sel { min-width: 92px; }
@media (max-width: 640px) {
  .filter-actions.inline-filters .fsel { flex: 1 1 44%; max-width: none; }
  .filter-actions.inline-filters #btn-reset-filter { flex: 1 1 44%; max-width: none; justify-content: center; }
  .scope-sel { flex: 1 1 44%; max-width: none; }
}

/* 筛选栏 */
.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.search-row { display: flex; gap: 10px; flex: 1 1 100%; align-items: center; }
.search-box {
  flex: 1 1 260px; display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; min-height: 42px; color: var(--text-3);
  box-shadow: var(--shadow);
}
.search-box input { border: 0; background: transparent; flex: 1; min-width: 0; }
.search-box input[readonly] { background: transparent; color: var(--text-1); cursor: text; }
.search-clear {
  flex-shrink: 0; width: 22px; height: 22px; line-height: 1; border: 0; border-radius: 50%;
  background: var(--line); color: var(--text-2); font-size: 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; order: 3;
}
.search-clear:hover { background: var(--primary); color: #fff; }
/* 诱饵输入框：不可见，仅供浏览器自动填充吸收 */
.decoy-autofill {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px;
  opacity: 0.01; border: 0; padding: 0; margin: 0; pointer-events: none;
}
.btn-new { flex-shrink: 0; white-space: nowrap; }
.filter-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-actions.right { margin-left: auto; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  border-radius: 20px; padding: 7px 14px; font-size: 13px; font-weight: 500;
  transition: all .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.chip-warn.active { background: var(--red); border-color: var(--red); }
.chip.chip-blue { background: var(--blue-bg); color: var(--blue); border-color: transparent; }
.chip.chip-blue.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip.chip-red { background: var(--red-bg); color: var(--red); border-color: transparent; }
.chip.chip-red.active { background: var(--red); border-color: var(--red); color: #fff; }
.chip.chip-amber { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.chip.chip-amber.active { background: var(--amber); border-color: var(--amber); color: #fff; }
.filter-count {
  background: var(--red); color: #fff; border-radius: 9px;
  min-width: 17px; height: 17px; font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* 可见性选择（新建 / 编辑任务） */
.vis-select { display: flex; gap: 8px; flex-wrap: wrap; }
.vis-opt {
  flex: 1 1 80px; border: 1.5px solid var(--line); background: #fff;
  border-radius: 10px; padding: 9px 6px; font-size: 13.5px; font-weight: 600;
  color: var(--text-2); cursor: pointer; transition: all .15s; min-height: 42px;
}
.vis-opt.vis-public.active { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.vis-opt.vis-private.active { border-color: var(--gray); background: #eef1f6; color: var(--gray); }
.vis-opt.vis-group.active { border-color: var(--blue); background: var(--blue-bg); color: var(--blue); }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.profile-group { font-size: 14px; font-weight: 600; color: var(--primary-dark); }

/* 可见性徽标 */
.badge-vis-pub { background: var(--green-bg); color: var(--green); }
.badge-vis-pri { background: #eef1f6; color: var(--gray); }
.badge-vis-grp { background: var(--blue-bg); color: var(--blue); }

/* 分组列表（管理弹窗） */
.group-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 4px;
  border-bottom: 1px solid var(--line);
}
.group-item .gi-name { flex: 1; font-size: 14px; font-weight: 600; min-width: 0; }
.group-item .gi-meta { font-size: 12px; color: var(--text-3); }
.group-item .btn { flex-shrink: 0; }

/* ---------- 任务卡片 ---------- */
.tasklist { display: grid; grid-template-columns: 1fr; gap: 12px; }
.task-card {
  background: var(--card); border-radius: var(--radius); padding: 14px 14px 12px;
  box-shadow: var(--shadow); border-left: 4px solid var(--gray);
  transition: transform .1s;
}
.task-card.prio-1 { border-left-color: var(--red); }
.task-card.prio-2 { border-left-color: var(--amber); }
.task-card.prio-3 { border-left-color: var(--green); }
.task-card.is-overdue { box-shadow: 0 2px 14px rgba(229, 72, 77, .16); }
.task-card.is-done { opacity: .72; }

/* 已完成任务折叠卡片：仅标题 / 分类 / 负责人 / 开始·完成，最多 2 排 */
.task-card.is-collapsed { padding: 10px 14px 10px; }
.task-card.is-collapsed .tc-top { margin-bottom: 6px; }
.task-card.is-collapsed .tc-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-card.is-collapsed .tc-meta { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-bottom: 8px; }

.tc-top { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.tc-title { flex: 1; font-size: 15px; font-weight: 600; word-break: break-all; }
.tc-title.done { text-decoration: line-through; color: var(--text-3); }
.tc-title .tc-pseq { font-size: 11px; color: var(--text-3); font-weight: 500; margin-left: 6px; }
.tc-title .tc-pseq.hot { color: var(--primary); font-weight: 700; }

/* v1.6 紧凑任务卡：第一排 标题 | 分类 | 负责人 | 时间…；第二排 状态 + 进度 + 操作 */
.tc-top-compact {
  display: flex; align-items: center; gap: 7px; flex-wrap: nowrap;
  overflow: hidden; white-space: nowrap; margin-bottom: 7px;
}
.tc-top-compact .tc-title {
  flex: 0 1 auto; max-width: 46%; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis;
}
.tc-top-compact .tc-sep { color: #c3ccd8; font-size: 12px; flex-shrink: 0; }
.tc-top-compact .tc-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-2); flex-shrink: 0;
}
.tc-top-compact .tc-chip svg { color: var(--text-3); }
.tc-top-compact .badge { flex-shrink: 0; }
.tc-row2 { display: flex; align-items: center; gap: 8px; }
.tc-row2 .tc-progress {
  flex: 1 1 120px; min-width: 0; margin-bottom: 0;
  font-size: 12.5px; padding: 5px 10px;
  display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.tc-row2 .tc-progress b {
  min-width: 22px; height: 17px; padding: 0 5px; font-size: 11px; margin-right: 5px;
}
.tc-row2 .tc-actions { flex-wrap: nowrap; }
.tc-row2 .btn { min-height: 30px; padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.tc-row2 .tc-spacer { flex: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; border-radius: 8px; padding: 3px 9px; white-space: nowrap;
}
.badge-pri-1 { background: var(--red-bg); color: var(--red); }
.badge-pri-2 { background: var(--amber-bg); color: var(--amber); }
.badge-pri-3 { background: var(--green-bg); color: var(--green); }
.badge-st-0 { background: #eef1f6; color: var(--gray); }
.badge-st-1 { background: var(--blue-bg); color: var(--blue); }
.badge-st-2 { background: var(--green-bg); color: var(--green); }
.badge-st-3 { background: var(--amber-bg); color: var(--amber); }
.badge-due { background: #f0f3f8; color: var(--text-2); }
.badge-due.warn { background: var(--amber-bg); color: var(--amber); }
.badge-due.over { background: var(--red-bg); color: var(--red); }
.badge-due.ok { background: var(--green-bg); color: var(--green); }

.tc-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.tc-meta .m { display: inline-flex; align-items: center; gap: 5px; }
.tc-meta svg { color: var(--text-3); flex-shrink: 0; }

.tc-progress {
  font-size: 13px; color: #c25e00;
  background: transparent;
  border: 1.5px solid rgba(255, 138, 0, .5);
  border-radius: 8px; padding: 7px 10px; margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tc-progress b {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 20px; padding: 0 6px; margin-right: 6px;
  background: #ff8a00; color: #fff; border-radius: 6px; font-size: 12px; font-weight: 700;
}
.tc-progress .tc-pseq { color: #e07600; font-weight: 600; }
.tc-progress .empty { color: var(--text-3); background: #f7f9fc; border: 1px solid transparent; }
.tc-progress.empty-box { background: #f7f9fc; border-color: transparent; color: var(--text-2); }

.tc-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tc-actions .btn { min-height: 34px; padding: 6px 13px; font-size: 13px; border-radius: 8px; }
/* 详情：浅蓝底；进度：实蓝底（主操作） */
.btn-detail { background: rgba(29, 95, 168, .10); color: var(--primary); border: 1px solid rgba(29, 95, 168, .35); }
.btn-detail:hover { background: rgba(29, 95, 168, .18); }
/* 已完成任务：进度锁定（灰色不可点，仅可查看） */
.btn.is-prog-lock {
  background: #e3e7ee !important; color: #9aa3b2 !important;
  cursor: not-allowed; box-shadow: none; pointer-events: none;
}
.tc-spacer { flex: 1; }

/* 状态选择弹层 */
.status-pop {
  position: fixed; z-index: 200; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(24, 48, 80, .16); overflow: hidden; min-width: 150px;
}
.status-opt { display: flex; align-items: center; gap: 8px; padding: 11px 14px; font-size: 14px; cursor: pointer; }
.status-opt:hover { background: var(--primary-light); }
.status-opt .dot { width: 10px; height: 10px; border-radius: 50%; }

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

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 30, 50, .5);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal[hidden] { display: none; }
.modal-box {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: #fff; border-radius: 18px 18px 0 0;
  animation: slideUp .22s ease;
}
.modal-small { max-width: 420px; }
.modal-wide { max-width: 640px; }
@keyframes slideUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fff; z-index: 5;
}
.modal-head h3 { font-size: 16px; }
.modal-close { border: 0; background: #eef2f8; color: var(--text-2); width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }
.modal-body { padding: 16px 18px; }
.modal-foot {
  display: flex; gap: 10px; padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff;
}
.modal-foot .btn { flex: 1; }

.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field > label em { color: var(--red); font-style: normal; }
.field input[type="text"], .field input[type="password"], .field input[type="datetime-local"],
.field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: #fafbfd;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 95, 168, .1); background: #fff;
}
.field textarea { resize: vertical; min-height: 44px; }
.due-row { display: flex; gap: 8px; align-items: stretch; }
.due-row input { flex: 1 1 auto; min-width: 0; }
.due-row .btn { flex-shrink: 0; height: 44px; align-self: center; }
@media (max-width: 520px) {
  .due-row { flex-wrap: wrap; }
  .due-row .btn { height: 40px; }
}
/* 管理列表分页：上一页 / 下一页 */
.list-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.pager-info { font-size: 12.5px; font-weight: 600; color: var(--text-2); }

.row-gap { display: flex; gap: 8px; align-items: center; }
.row-gap select { flex: 1; }
.row-gap .btn { flex-shrink: 0; }

/* 优先级选择 */
.prio-select { display: flex; gap: 10px; }
.prio-opt {
  flex: 1; padding: 10px 0; border-radius: 10px; border: 1.5px solid var(--line);
  font-size: 14px; font-weight: 600; background: #fff;
}
.prio-opt.prio-1 { color: var(--red); }
.prio-opt.prio-2 { color: var(--amber); }
.prio-opt.prio-3 { color: var(--green); }
.prio-opt.active.prio-1 { background: var(--red-bg); border-color: var(--red); }
.prio-opt.active.prio-2 { background: var(--amber-bg); border-color: var(--amber); }
.prio-opt.active.prio-3 { background: var(--green-bg); border-color: var(--green); }

/* 任务详情 */
.dt-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.dt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.dt-meta .m { display: flex; gap: 6px; }
.dt-meta .m b { color: var(--text); font-weight: 600; }
.dt-notes {
  background: #f7f9fc; border-radius: 10px; padding: 10px 12px; font-size: 13px;
  color: var(--text-2); margin-bottom: 14px; white-space: pre-wrap;
}
.dt-section { margin-bottom: 16px; }
.dt-section-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.seq-badge {
  background: #ff8a00; color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 6px; padding: 2px 7px; margin-left: 6px;
}
.dt-current {
  background: rgba(255, 138, 0, .08); border: 1px solid rgba(255, 138, 0, .30); border-radius: 10px;
  padding: 12px 14px; font-size: 14px; white-space: pre-wrap;
}
.dt-history-view {
  background: #f7f9fc; border: 1px dashed var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: 14px; margin-top: 8px; white-space: pre-wrap;
  text-decoration: line-through; color: var(--text-2);
}
/* 历史进度下拉（美化：主题蓝、圆角、自定义箭头） */
.hist-select-wrap { position: relative; margin-bottom: 4px; }
.hist-select-wrap::after {
  content: '▾'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--primary); font-size: 12px; pointer-events: none; transition: transform .15s;
}
.hist-select-wrap select {
  width: 100%; appearance: none; -webkit-appearance: none; -moz-appearance: none;
  border: 1.5px solid #cfe0f4; background: var(--primary-light);
  color: var(--text); border-radius: 10px; padding: 9px 34px 9px 12px;
  font-size: 13px; font-weight: 600; cursor: pointer; min-height: 38px; outline: none;
  box-shadow: 0 1px 3px rgba(15, 36, 56, .06);
  transition: border-color .15s, box-shadow .15s;
}
.hist-select-wrap select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 95, 168, .12); }
.hist-select-wrap select option { color: var(--text); background: #fff; font-weight: 400; }
.dt-history-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.hist-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  font-size: 13px; display: flex; flex-direction: column; gap: 4px;
}
.hist-item.current { border-color: #cfe0f4; background: var(--primary-light); }
.hist-item.historical { text-decoration: line-through; color: var(--text-2); background: #f7f9fc; }
.hist-item .hi-head { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); }
.hist-item .hi-head b { color: var(--primary-dark); font-size: 12px; }
.hist-item.historical .hi-head b { color: var(--text-3); }
.hist-item .hi-content { word-break: break-all; }
.dt-history-view { display: none; }

/* 历史进度折叠区 */
.dt-collapse {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #f2f5fa; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-2);
  min-height: 42px; cursor: pointer;
}
.dt-collapse .dt-caret { color: var(--text-3); font-size: 14px; transition: transform .15s; }
.dt-collapse-body { margin-top: 10px; }

/* 进度编辑框 */
.progress-edit { display: flex; flex-direction: column; gap: 10px; }
.progress-edit textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  background: #fafbfd; resize: vertical; font-size: 14px; line-height: 1.5;
  box-shadow: inset 0 1px 2px rgba(24, 48, 80, .04);
}
.progress-edit textarea:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-light); }
/* 制单人只读输入 + 负责人锁定提示 + 进度完成勾选 */
.field input[readonly] { background: #f4f6fa; color: var(--text-2); cursor: default; }
.lab-note { margin-left: 8px; font-size: 12px; color: var(--text-3); font-style: normal; }
.check-line {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600;
  color: var(--text-2); padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fafbfd; cursor: pointer; user-select: none; transition: all .15s; align-self: flex-start;
}
.check-line input { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; margin: 0; }
.check-line.on { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.dt-addprogress .btn, .progress-edit .btn { align-self: flex-end; }

/* 简化进度弹窗 */
.pf-current-block { margin-bottom: 16px; }
.pf-current-label { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.pf-current {
  background: var(--primary-light); border: 1px solid #cfe0f4; border-radius: 10px;
  padding: 12px 14px; font-size: 14px; white-space: pre-wrap;
}
.pf-actions { display: flex; align-items: center; gap: 8px; }

/* 已删除任务 */
.task-card.is-deleted { opacity: .62; filter: grayscale(.4); }
.task-card.is-deleted .tc-title.done { text-decoration: line-through; }
.badge-del {
  background: #eef0f3; color: var(--text-3); border: 1px solid var(--line);
  border-radius: 999px; font-size: 11.5px; font-weight: 600; padding: 3px 10px;
}
/* 弱化删除按钮（主页 / 进度弹窗） */
.btn-del-soft { color: var(--text-3); background: transparent; border-color: transparent; }
.btn-del-soft:hover { color: var(--red); background: var(--red-bg); border-color: var(--red); }

/* 已删除筛选 chip */
.chip-gray { background: #eef0f3; color: var(--text-2); border-color: transparent; }
.chip-gray.active { background: #5b6472; color: #fff; }

/* 提醒：全部未完成任务列表，按到期时间 */
.modal-reminder .modal-body { max-height: 62vh; overflow-y: auto; }
.r-kind.normal { background: #eef2f7; color: var(--text-2); }

/* 管理页 */
.tabs { display: flex; gap: 6px; padding: 12px 18px 0; }
.tab {
  border: 0; background: #eef2f8; color: var(--text-2); font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: 10px 10px 0 0;
}
.tab.active { background: var(--primary); color: #fff; }
.admin-add { display: flex; flex-direction: column; gap: 8px; background: #f7f9fc; border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.admin-add input, .admin-add select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: #fafbfd; font-size: 14px; color: var(--text-1); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.admin-add input:focus, .admin-add select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 95, 168, .1); background: #fff;
}
.admin-add .inline-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.inline-check input { width: 16px; height: 16px; }
.member-item, .cat-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 6px;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.member-item:last-child, .cat-item:last-child { border-bottom: 0; }
.mi-info { flex: 1; min-width: 0; }
.mi-name { font-weight: 600; }
.mi-name .admin-flag { font-size: 11px; background: var(--primary-light); color: var(--primary); border-radius: 5px; padding: 1px 6px; margin-left: 6px; }
.mi-sub { font-size: 12px; color: var(--text-3); }
.mi-ops { display: flex; gap: 6px; }
.mi-ops .btn-mini { padding: 5px 10px; font-size: 12px; min-height: 30px; }
.visibility-tag { font-size: 11px; border-radius: 5px; padding: 1px 6px; margin-left: 6px; }
.visibility-tag.on { background: var(--green-bg); color: var(--green); }
.visibility-tag.off { background: #eef1f6; color: var(--gray); }

/* 开关 */
.switch-row { display: flex; align-items: center; justify-content: space-between; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.switch { position: relative; display: inline-block; width: 48px; height: 27px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: #cdd6e2; border-radius: 14px; transition: .2s;
}
.slider::before {
  content: ""; position: absolute; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(21px); }

/* 预警弹窗 */
.modal-reminder .reminder-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
}
.reminder-item .r-kind { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 8px; flex-shrink: 0; }
.r-kind.overdue { background: var(--red-bg); color: var(--red); }
.r-kind.soon { background: var(--amber-bg); color: var(--amber); }
.reminder-item .r-info { flex: 1; min-width: 0; }
.reminder-item .r-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reminder-item .r-sub { font-size: 12px; color: var(--text-3); }
.reminder-empty { text-align: center; color: var(--green); font-size: 14px; padding: 16px 0; }

/* 编辑成员弹窗 */
.edit-user-row { display: flex; gap: 8px; margin-bottom: 8px; }
.edit-user-row input { flex: 1; }

/* Toast */
#toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; width: 90%; max-width: 380px; pointer-events: none; }
.toast {
  background: rgba(30, 45, 65, .92); color: #fff; font-size: 13.5px;
  border-radius: 10px; padding: 10px 18px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  animation: toastIn .2s ease;
  text-align: center; max-width: 100%;
}
.toast.err { background: rgba(190, 55, 60, .95); }
.toast.ok { background: rgba(34, 139, 92, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 桌面适配 ---------- */
@media (min-width: 768px) {
  .modal { align-items: center; padding: 24px; }
  .modal-box { border-radius: var(--radius-lg); max-height: 88vh; }
  .main { padding-top: 18px; }
  .stat-cards { gap: 12px; }
}
@media (max-width: 520px) {
  .filterbar { align-items: stretch; }
  .search-row { flex-wrap: wrap; }
  .btn-new { width: 100%; }
  .scope-tabs { justify-content: center; }
  .stat-num { font-size: 20px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .stat-cards:not(.stat-cards-inline) .stat-card:nth-child(5) { grid-column: span 2; }
  .chart-row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .chart-row { grid-template-columns: 1fr; }
  /* 顶部栏一排显示（手机端：图标与字体缩小，不换行） */
  .topbar-inner { padding: 8px 10px; gap: 6px; }
  .brand { gap: 6px; }
  .brand-icon { width: 30px; height: 30px; border-radius: 8px; }
  .brand-text { font-size: 15px; gap: 5px; }
  .brand-text small { font-size: 10.5px; }
  .icon-btn { width: 34px; height: 34px; }
  .badge-dot { top: 3px; right: 3px; min-width: 15px; height: 15px; font-size: 9px; }
  .user-chip { padding: 3px 4px; gap: 5px; }
  .avatar { width: 26px; height: 26px; font-size: 12px; }
  .user-name { max-width: 56px; font-size: 13px; }
  .caret { display: none; }
  /* 任务卡底部按钮一排显示：状态徽标 + 删除 + 编辑 + 详情 + 进度 */
  .tc-actions { flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 2px; }
  .tc-actions .btn { min-height: 32px; padding: 5px 10px; font-size: 12.5px; white-space: nowrap; flex-shrink: 0; }
  .tc-actions .badge { flex-shrink: 0; }
  .tc-spacer { min-width: 6px; flex-shrink: 0; }
}

/* ============================================================
   v1.4.8 · 品牌 Logo + 今日待办
   ============================================================ */
/* 品牌 Logo（点击返回 /todo/ 首页） */
.brand { text-decoration: none; color: inherit; cursor: pointer; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px; object-fit: cover; flex-shrink: 0; display: block;
  box-shadow: 0 1px 4px rgba(15, 36, 56, .18);
}
.login-logo-img {
  width: 56px; height: 56px; border-radius: 14px; object-fit: cover;
  box-shadow: 0 4px 14px rgba(15, 36, 56, .18);
}
.login-logo-svg {
  width: 56px; height: 56px; border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15, 36, 56, .18);
}

/* 我的待办面板 */
.today-panel { max-width: 1500px; margin: 0 auto; padding: 4px 16px 28px; }
.td-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0 8px; }
.td-subline {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 15px; font-weight: 700; color: var(--primary);
}
.td-motto {
  font-size: 13px; font-weight: 500; color: var(--primary);
  background: var(--primary-light); border-radius: 999px; padding: 3px 10px;
}
.td-add {
  display: flex; gap: 10px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  margin: 6px 0 18px; box-shadow: 0 1px 3px rgba(15, 36, 56, .05);
}
.td-add input {
  flex: 1 1 220px; min-width: 0; height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 14px; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.td-add input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 95, 168, .12); }
.td-add .btn { height: 40px; flex-shrink: 0; }
.td-section { margin-bottom: 22px; }
.td-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 10px;
}
.td-count {
  min-width: 20px; height: 20px; padding: 0 7px; border-radius: 10px;
  background: var(--primary-light); color: var(--primary); font-size: 11.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.td-list { display: flex; flex-direction: column; gap: 8px; }
.td-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid transparent;
  border-radius: 12px; padding: 11px 14px; box-shadow: 0 1px 3px rgba(15, 36, 56, .05);
}
.td-item.td-task { border-left-color: var(--primary); }
.td-item.prio-1 { border-left-color: var(--red); }
.td-item.prio-2 { border-left-color: var(--amber); }
.td-item.prio-3 { border-left-color: var(--green); }
.td-item-main { flex: 1; min-width: 0; }
.td-item-title { font-size: 14px; font-weight: 600; color: var(--text); word-break: break-all; }
.td-item-content {
  font-size: 12.5px; font-weight: 600; color: #c25e00; word-break: break-all;
  background: none; border: none; padding: 0;
}
/* 提醒徽章与进度内容同一排：徽章在前，内容紧随其后 */
.td-item-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 3px;
}
.td-item-row .td-item-sub { margin-top: 0; }
.td-item-sub {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-3);
}
/* 时间/状态提醒小框 */
.td-time {
  display: inline-flex; align-items: center;
  background: var(--primary-light); color: var(--primary);
  font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 1px 8px;
}
.td-overdue {
  display: inline-flex; align-items: center;
  background: var(--red-bg); color: var(--red);
  font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 1px 8px;
}
.td-done-tag {
  display: inline-flex; align-items: center;
  background: #eef1f6; color: var(--gray);
  font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 1px 8px;
}
.td-item-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.td-item-actions .btn { min-height: 32px; padding: 5px 14px; font-size: 13px; border-radius: 8px; }
.td-item.done { opacity: .62; background: #fafbfc; }
.td-item.done .td-item-title { text-decoration: line-through; color: var(--text-3); }
.td-readonly { font-size: 12px; color: var(--text-3); }
.td-empty {
  background: var(--card); border: 1px dashed var(--line); border-radius: 12px;
  padding: 18px; text-align: center; font-size: 13px; color: var(--text-3);
}
@media (max-width: 760px) {
  .today-panel { padding: 4px 12px 24px; }
  .td-add { flex-direction: column; }
  .td-add input { flex: 1 1 auto; }
  .td-item { flex-direction: column; align-items: stretch; gap: 8px; }
  .td-item-actions { justify-content: flex-end; }
  .td-head { gap: 6px; }
}
@media (max-width: 720px) {
  .brand-logo { width: 28px; height: 28px; border-radius: 8px; }
  .login-logo-img { width: 48px; height: 48px; border-radius: 12px; }
  .login-logo-svg { width: 48px; height: 48px; border-radius: 12px; }
}

/* ============================================================
   v1.6.0 · 紧凑任务卡 / 状态分布单卡 / 我的待办增强 / 申请审核
   ============================================================ */
/* 手机端：紧凑任务卡两排（标题行可横向滚动，第二排按钮自适应） */
@media (max-width: 720px) {
  .task-card { padding: 10px 12px 10px; }
  .tc-top-compact { gap: 5px; }
  .tc-top-compact .tc-title { max-width: 100%; flex: 0 1 100%; }
  .tc-top-compact { flex-wrap: wrap; row-gap: 4px; }
  .tc-row2 { flex-wrap: wrap; row-gap: 6px; }
  .tc-row2 .tc-progress { flex: 1 1 100%; order: -1; }
  .tc-row2 .btn { min-height: 30px; padding: 4px 9px; font-size: 12px; }
}

/* 我的待办：添加行（优先级下拉 / 本周完成勾选并排） */
.td-prio-row { display: contents; }
.td-add select#td-priority {
  flex: 0 0 auto; height: 40px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; color: var(--text);
  outline: none; background: #fff; cursor: pointer;
}
.td-add .td-weekdue {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.td-add .td-weekdue.on {
  border-color: var(--primary); background: var(--primary-light); color: var(--primary);
}
.td-weekdue input { width: 15px; height: 15px; accent-color: var(--primary); margin: 0; }
@media (max-width: 760px) {
  .td-prio-row { display: flex; width: 100%; gap: 10px; align-items: center; }
  .td-prio-row select#td-priority { flex: 1 1 auto; width: auto; min-width: 0; }
  .td-prio-row .td-weekdue { flex: 0 0 auto; width: auto; }
}

/* 琐事项：优先级徽章 */
.td-pri-badge { font-size: 10.5px; padding: 1px 6px; border-radius: 6px; margin-right: 6px; }
.td-item-title .badge { vertical-align: middle; }

/* 今日毕标记 */
.td-done-today {
  display: inline-flex; align-items: center;
  background: var(--green-bg); color: var(--green);
  font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 1px 8px;
}

/* 本周待办 */
.td-week-title { color: #7a5b0e; }
.td-week-hint { font-size: 11.5px; color: var(--text-3); font-weight: 400; margin-left: 4px; }
.td-week-tag {
  display: inline-flex; align-items: center;
  background: var(--amber-bg); color: var(--amber);
  font-size: 10.5px; font-weight: 700; border-radius: 6px; padding: 1px 7px; margin-left: 6px;
}
.td-item.td-week { border-left-color: var(--amber); }

/* 琐事历史（折叠 / 分页 / 日期过滤 / 下载） */
.td-history-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  font-size: 14px; font-weight: 700; color: var(--text);
  background: none; border: none; padding: 0; cursor: pointer; margin: 0 0 10px;
}
.td-history-head:hover { color: var(--primary); }
.td-caret { font-size: 12px; color: var(--text-3); transition: transform .15s; }
.td-history-body {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  background: #fcfdfe; margin-bottom: 6px;
}
.td-history-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
}
.td-history-toolbar select {
  height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; color: var(--text); outline: none; background: #fff;
}
.td-history-toolbar .pager-info { font-size: 12.5px; color: var(--text-2); }
/* 琐事历史：日历日期选择 */
.td-hist-day-wrap { position: relative; }
.td-hist-day-btn {
  height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; color: var(--text); background: #fff; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.td-hist-day-btn:hover { border-color: var(--primary); color: var(--primary); }
.td-hist-cal {
  position: absolute; top: 36px; left: 0; z-index: 60;
  width: 248px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(20, 40, 70, .14); padding: 10px;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-nav {
  width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--text-2); font-size: 16px; cursor: pointer; line-height: 1;
}
.cal-nav:hover { border-color: var(--primary); color: var(--primary); }
.cal-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.cal-week {
  display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px;
}
.cal-week span {
  text-align: center; font-size: 11px; color: var(--text-3); padding: 3px 0;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-cell {
  position: relative; height: 30px; border: 0; border-radius: 8px; background: transparent;
  font-size: 12.5px; color: var(--text); cursor: pointer; padding: 0;
}
.cal-cell:hover { background: #eef3fa; }
.cal-cell.empty { pointer-events: none; }
.cal-cell.sel { background: var(--primary); color: #fff; font-weight: 700; }
.cal-dot {
  position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--amber); display: block;
}
.cal-cell.sel .cal-dot { background: #fff; }
.cal-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line);
}
.cal-hint { font-size: 11px; color: var(--text-3); }
.cal-hint::before { content: '●'; color: var(--amber); margin-right: 4px; }
@media (max-width: 640px) {
  .td-hist-cal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 272px; }
}
.btn-mini { min-height: 30px; padding: 4px 11px; font-size: 12.5px; border-radius: 8px; }
/* 任务列表翻页条 */
.task-pager {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 16px 0 4px; padding-top: 4px;
}
.task-pager .pager-info { font-size: 13px; font-weight: 600; color: var(--text-2); min-width: 52px; text-align: center; }
.task-pager .btn:disabled { opacity: .38; cursor: not-allowed; }
.task-pager .btn:not(:disabled):hover { border-color: var(--primary); color: var(--primary); }
.td-hist-item { box-shadow: none; background: #fff; }
.td-hist-item .td-item-actions { gap: 4px; }

/* 琐事详情弹窗 */
#tdd-hist-list .hist-item { margin-bottom: 8px; }
#tdd-hist-list .hist-item .hi-content { font-size: 13.5px; }

/* 个人设置：分类/分组申请 */
.req-apply-block { margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--line); }
.req-apply-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.req-apply-row select {
  height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13.5px; color: var(--text); outline: none; background: #fff; flex: 0 0 90px;
}
.req-apply-row input { flex: 1 1 160px; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 13.5px; outline: none; }
.req-apply-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 95, 168, .12); }
.req-apply-row .btn { height: 38px; }

/* 状态分布：手机端 3 列 2 排 6 个（总任务/已完成/未开始 · 进行中/待回执/已超期） */
@media (max-width: 720px) {
  .stat-cards.stat-cards-inline { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-cards.stat-cards-inline .stat-card { padding: 10px 4px; }
  .stat-cards.stat-cards-inline .stat-major { grid-column: auto; }
  .stat-cards.stat-cards-inline .stat-num { font-size: 18px; }
  .stat-cards.stat-cards-inline .stat-mini .stat-num { font-size: 15px; }
  .chart-row-single .chart-title { margin-bottom: 10px; }
}
