/* ==========================================================================
   工作记录 · 日常工作事件记录软件
   ========================================================================== */

:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --line: #e8eaf2;
  --line-strong: #d9dce7;
  --text: #1d2230;
  --text-2: #4d5568;
  --muted: #8a91a5;
  --primary: #4b63e6;
  --primary-strong: #3a50c9;
  --primary-soft: #edf0ff;
  --ok: #1d9b6c;
  --ok-soft: #e8f7f0;
  --warn: #dd8a12;
  --warn-soft: #fdf3e1;
  --danger: #d94a4f;
  --danger-soft: #fdecec;
  --sidebar: #1a1e2c;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(26, 31, 48, 0.06);
  --shadow-lg: 0 24px 60px rgba(20, 25, 45, 0.22);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }

[hidden] { display: none !important; }

/* ---------- 侧边导航 ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  background: linear-gradient(180deg, #1c2132 0%, #171a26 100%);
  color: #fff;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 6px 22px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: linear-gradient(135deg, #5b76ff, #7c5cff);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(91, 118, 255, 0.35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.brand-text strong { font-size: 15px; font-weight: 650; letter-spacing: 0.02em; }
.brand-text span { font-size: 10.5px; color: #8d95ad; letter-spacing: 0.06em; margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 3px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  color: #a6adc2;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #e8ecf8; }

.nav-item.active {
  background: rgba(91, 118, 255, 0.18);
  color: #fff;
  box-shadow: inset 3px 0 0 #6b83ff;
}

.nav-item.active .nav-icon { color: #93a7ff; }

.nav-icon { width: 18px; height: 18px; flex: none; color: #7f879e; transition: color 0.16s; }

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 10px;
  background: #4b63e6;
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  display: grid;
  place-items: center;
  line-height: 1;
}

.nav-sep { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 12px 8px; }

.sidebar-foot { margin-top: auto; padding: 14px 9px 2px; color: #6c7489; font-size: 11px; }
.foot-row { display: flex; align-items: center; gap: 7px; color: #99a1b7; font-size: 11.5px; }
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: #3ecf8e; box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.14); }
.sidebar-foot p { margin-top: 6px; padding-left: 13px; }

/* ---------- 主区域 ---------- */

.main {
  margin-left: 232px;
  min-height: 100vh;
  padding: 28px 32px 64px;
}

.view { max-width: 1180px; margin: 0 auto; animation: rise 0.28s ease both; }

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

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.view-title h1 { font-size: 23px; font-weight: 650; letter-spacing: -0.01em; }
.view-sub { margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.head-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s, border-color 0.16s, color 0.16s, box-shadow 0.16s;
}

.btn:hover { background: var(--primary-strong); }
.btn:active { transform: translateY(0.5px); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--surface-2); border-color: #c5c9d8; }

.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: #e2e7ff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c33b40; }

.btn-sm { height: 29px; padding: 0 11px; font-size: 12px; border-radius: 7px; }

.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  border-radius: 8px;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

.link-btn {
  border: none;
  background: none;
  color: var(--primary);
  font-size: 12.5px;
  cursor: pointer;
  padding: 3px 2px;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- 表单控件 ---------- */

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  padding: 8px 11px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input, .select { height: 36px; }
.textarea { resize: vertical; min-height: 76px; line-height: 1.6; }

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(75, 99, 230, 0.12);
}

.input::placeholder, .textarea::placeholder { color: #b2b7c6; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237a8299' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
  cursor: pointer;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }
.field > label, .field-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 4px;
}
.req { color: var(--danger); }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.form-error {
  display: none;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
}
.form-error.show { display: block; }

.inline-add { display: flex; gap: 6px; }
.inline-add .input { flex: 1; }

/* 标签勾选 */
.tag-checks { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  background: #fff;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
}
.tag-check input { display: none; }
.tag-check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.tag-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ---------- 通用卡片与列表 ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(22, 27, 45, 0.035);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.card-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-title .count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 1px 7px;
  border-radius: 9px;
}
.card-body { padding: 16px 18px; }

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--surface-2); }

.task-check {
  flex: none;
  width: 19px;
  height: 19px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  color: transparent;
  font-size: 11px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.16s;
}
.task-check:hover { border-color: var(--ok); color: var(--ok); }
.task-row.done .task-check { background: var(--ok); border-color: var(--ok); color: #fff; }

.task-main { flex: 1; min-width: 0; cursor: pointer; }
.task-title { font-size: 13.5px; font-weight: 500; color: var(--text); word-break: break-word; }
.task-row.done .task-title { color: var(--muted); text-decoration: line-through; }
.task-row.canceled .task-title { color: var(--muted); }

.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
}
.task-meta .sep { width: 1px; height: 9px; background: var(--line-strong); }

.task-side { display: flex; align-items: center; gap: 8px; flex: none; margin-top: 1px; }

.row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.task-row:hover .row-actions, .problem-row:hover .row-actions, .tag-row:hover .row-actions { opacity: 1; }

.mini-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.mini-btn:hover { background: #eceefa; color: var(--primary); }
.mini-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* 优先级标记 */
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.prio::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.prio-high { color: var(--danger); }
.prio-medium { color: var(--warn); }
.prio-low { color: var(--ok); }

/* 标签 / 状态 chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px;
  white-space: nowrap;
}
.chip .tag-dot { width: 6px; height: 6px; }
.chip-primary { background: var(--primary-soft); border-color: #dce2ff; color: var(--primary-strong); }
.chip-ok { background: var(--ok-soft); border-color: #cdede0; color: #147d56; }
.chip-warn { background: var(--warn-soft); border-color: #f3e2c1; color: #a96a08; }
.chip-danger { background: var(--danger-soft); border-color: #f6d3d4; color: #bc3a3f; }
.chip-muted { background: var(--surface-2); color: var(--muted); }

/* 到期标记 */
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.due.overdue { color: var(--danger); font-weight: 500; }
.due.today { color: var(--warn); font-weight: 500; }

/* 空状态 */
.empty { padding: 34px 18px; text-align: center; color: var(--muted); font-size: 12.5px; }
.empty-mark {
  width: 40px; height: 40px; margin: 0 auto 9px; border-radius: 12px;
  background: var(--surface-2); color: #b3b9c9; display: grid; place-items: center;
}
.empty-mark svg { width: 18px; height: 18px; }

/* ---------- 看板 ---------- */

.quick-add { display: flex; gap: 8px; align-items: center; }
.quick-add .input { height: 36px; min-width: 220px; }
.quick-add .btn { height: 36px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: #dfe3f0; }
.stat-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent, var(--primary));
  opacity: 0.85;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-name { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-num { font-size: 27px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; }
.stat-foot { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.stat-foot strong { color: var(--text-2); font-weight: 600; }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.reminder-strip {
  border: 1px solid #f1cfd1;
  background: #fffafa;
  border-radius: var(--radius);
  padding: 14px 18px 6px;
  margin-bottom: 18px;
}
.reminder-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b53d42;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.reminder-head .count {
  font-size: 11px;
  background: #f9dedf;
  color: #b53d42;
  padding: 1px 7px;
  border-radius: 9px;
}
.reminder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px dashed #f3dcdd;
  font-size: 12.5px;
}
.reminder-item:first-of-type { border-top: none; }
.reminder-main { flex: 1; min-width: 0; }
.reminder-title { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reminder-meta { color: var(--muted); font-size: 11px; margin-top: 1px; }
.reminder-tag {
  flex: none;
  font-size: 10.5px;
  color: #b53d42;
  background: #f9dedf;
  padding: 1px 7px;
  border-radius: 8px;
}
.reminder-actions { display: flex; gap: 4px; flex: none; }

.banner-tip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 16px;
  margin-bottom: 18px;
  border: 1px solid #dfe4fb;
  background: #f7f9ff;
  border-radius: 12px;
  font-size: 12.5px;
  color: var(--text-2);
}
.banner-tip strong { color: var(--text); font-weight: 600; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 20px 0 10px;
}
.section-head h2 { font-size: 14px; font-weight: 600; }
.section-head .link-btn { font-size: 12px; }

.overdue-group { border-top: 1px dashed var(--line-strong); background: #fffdf7; }
.overdue-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  font-size: 11.5px;
  color: #a96a08;
}

/* ---------- 事项筛选 ---------- */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.filter-bar .search { position: relative; flex: 1; min-width: 190px; }
.filter-bar .search .input { padding-left: 32px; }
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
}
.filter-bar .select { width: auto; min-width: 104px; }
.filter-bar .date-filter { width: auto; min-width: 132px; flex: 0 0 auto; }
.filter-sep { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.filter-count { font-size: 12px; color: var(--muted); margin-left: auto; padding-right: 2px; }

/* ---------- 关注事项 ---------- */

.concern-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }

.concern-card { padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 9px; cursor: pointer; transition: box-shadow 0.18s, transform 0.18s; }
.concern-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.concern-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.concern-name { font-size: 14.5px; font-weight: 600; line-height: 1.4; word-break: break-word; }
.concern-desc { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.concern-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.concern-latest {
  border-top: 1px dashed var(--line);
  padding-top: 9px;
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  gap: 7px;
  align-items: flex-start;
}
.concern-latest .dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); margin-top: 7px; }
.concern-latest span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.concern-actions { display: flex; gap: 6px; margin-top: 1px; }

/* 时间线 */
.timeline { position: relative; padding-left: 22px; margin-top: 4px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 7px;
  bottom: 8px;
  width: 2px;
  background: var(--line);
}
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item:last-child { padding-bottom: 2px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #b8c1f2;
}
.tl-item.latest::before { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(75, 99, 230, 0.12); }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-time { font-size: 11px; color: var(--muted); }
.tl-content { font-size: 12.5px; color: var(--text-2); margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.tl-status { margin-top: 4px; }

/* ---------- 问题记录 ---------- */

.stat-mini-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-mini {
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.stat-mini:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.stat-mini.active { border-color: var(--primary); background: #fbfcff; }
.stat-mini .num { font-size: 20px; font-weight: 650; line-height: 1.2; }
.stat-mini .lbl { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.stat-mini .num.open { color: var(--danger); }
.stat-mini .num.processing { color: var(--warn); }
.stat-mini .num.resolved { color: var(--ok); }

.problem-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}
.problem-row:last-child { border-bottom: none; }
.problem-row:hover { background: var(--surface-2); }
.problem-main { flex: 1; min-width: 0; cursor: pointer; }
.problem-title { font-size: 13.5px; font-weight: 500; word-break: break-word; }
.problem-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.severity-bar { width: 3px; align-self: stretch; border-radius: 2px; flex: none; margin: 2px 0; }
.sev-high { background: #e0696d; }
.sev-medium { background: #e7b158; }
.sev-low { background: #6ec4a8; }

.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin-bottom: 16px; }
.meta-item { font-size: 12.5px; display: flex; gap: 8px; align-items: baseline; }
.meta-item .k { color: var(--muted); min-width: 56px; flex: none; font-size: 12px; }
.meta-item .v { color: var(--text-2); word-break: break-word; }

.detail-desc { font-size: 13px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.detail-label { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 16px 0 7px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.related-list { display: flex; flex-wrap: wrap; gap: 7px; }
.related-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
}
.related-item:hover { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); }

.checkbox-list {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 5px 4px;
  background: #fff;
}
.checkbox-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.checkbox-row:hover { background: var(--surface-2); }
.checkbox-row input { margin-top: 3px; accent-color: var(--primary); }
.checkbox-row .small { font-size: 11px; color: var(--muted); margin-left: auto; padding-left: 8px; white-space: nowrap; }

/* ---------- 问题附件 ---------- */

.attach-list { display: flex; flex-direction: column; gap: 8px; }
.attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}
.attach-thumb {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 7px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  text-decoration: none;
}
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-thumb.file { color: var(--primary); background: var(--primary-soft); border-color: transparent; letter-spacing: 0.5px; }
.attach-info { min-width: 0; flex: 1; }
.attach-name { font-size: 12.5px; color: var(--text-2); word-break: break-all; }
.attach-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.attach-ops { flex: none; display: flex; gap: 6px; align-items: center; }
.attach-ops .mini-btn { text-decoration: none; }
.attach-actions { display: flex; align-items: center; gap: 9px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- 本周 / 本月待办 ---------- */

.plan-progress { padding: 0 16px 12px; }
.plan-progress-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.plan-progress-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width 0.2s ease; }
.plan-tip { margin: 10px 2px 0; }

/* ---------- 设置 ---------- */

.settings-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 920px; }
.settings-card .card-body { padding: 4px 18px; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: none; }
.setting-info { min-width: 0; }
.setting-name { font-size: 13.5px; font-weight: 500; }
.setting-desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.setting-ctrl { flex: none; display: flex; align-items: center; gap: 8px; }
.setting-ctrl .input, .setting-ctrl .select { width: 118px; height: 34px; }
.setting-ctrl .input.time { width: 104px; padding: 6px 9px; }
.quiet-sep { color: var(--muted); font-size: 12px; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 40px; height: 23px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: #cfd3df;
  transition: background 0.2s;
  cursor: pointer;
}
.switch span::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 25, 45, 0.25);
  transition: transform 0.2s;
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(17px); }

.tag-manage { display: flex; flex-direction: column; }
.tag-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.tag-row:last-child { border-bottom: none; }
.tag-row .tag-dot { width: 10px; height: 10px; }
.tag-row .tag-count { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.tag-row .row-actions { opacity: 0; }
.tag-color-input {
  width: 30px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.data-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px 0 6px; }
.data-stat { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.data-stat .n { font-size: 18px; font-weight: 650; }
.data-stat .l { font-size: 11px; color: var(--muted); }
.data-actions { display: flex; gap: 9px; flex-wrap: wrap; padding: 10px 0 16px; }

.danger-zone { border-color: #f2d4d5; background: #fffbfb; }
.danger-zone .setting-name { color: #b53d42; }

.perm-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.perm-status .dot { width: 7px; height: 7px; border-radius: 50%; background: #c2c6d3; }
.perm-status.granted { color: #147d56; }
.perm-status.granted .dot { background: var(--ok); }
.perm-status.denied { color: var(--danger); }
.perm-status.denied .dot { background: var(--danger); }

/* ---------- 弹窗 / 提示 ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(18, 22, 35, 0.45);
  backdrop-filter: blur(2px);
  animation: fade 0.18s ease;
}

.modal {
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  max-height: 88vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  overflow: hidden;
}
.modal.wide { width: min(800px, 100%); }
.modal.narrow { width: min(430px, 100%); }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 12px;
}
.modal-head h2 { font-size: 16.5px; font-weight: 650; line-height: 1.4; }
.modal-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.modal-body { padding: 4px 22px 20px; overflow: auto; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 13px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-thumb { background: #d8dbe6; border-radius: 4px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 9px 16px;
  border-radius: 10px;
  background: #212636;
  color: #fff;
  font-size: 12.5px;
  box-shadow: 0 10px 30px rgba(20, 25, 45, 0.22);
  animation: rise 0.22s ease both;
}
.toast.success { background: #157a53; }
.toast.error { background: #b33a3f; }

/* ---------- 响应式 ---------- */

@media (max-width: 1024px) {
  .panel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 14px 16px 10px;
    background: linear-gradient(135deg, #1c2132, #171a26);
  }
  .brand { padding: 0 0 12px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 2px; padding-bottom: 2px; }
  .nav-item { padding: 8px 11px; font-size: 12.5px; white-space: nowrap; }
  .nav-item.active { box-shadow: inset 0 -2px 0 #6b83ff; }
  .nav-sep { display: none; }
  .sidebar-foot { display: none; }
  .main { margin-left: 0; padding: 20px 16px 48px; }
}

@media (max-width: 640px) {
  .view-head { align-items: flex-start; }
  .quick-add { width: 100%; }
  .quick-add .input { min-width: 0; }
  .stat-grid { grid-template-columns: 1fr; gap: 10px; }
  .stat-mini-row { grid-template-columns: repeat(2, 1fr); }
  .stat-mini:last-child { grid-column: span 2; }
  .form-grid { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
  .data-stats { grid-template-columns: 1fr 1fr; }
  .row-actions { opacity: 1; }
  .filter-bar .select { flex: 1; min-width: 0; }
  .modal-overlay { padding: 10px; }
  .modal-body { padding: 4px 16px 16px; }
  .modal-head { padding: 16px 16px 10px; }
  .modal-foot { padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
