/* ============================================================
 * 信息安全部工作台 — 样式
 * 设计基准：14px 正文 / 8px 栅格 / 冷灰底 + 单一蓝色主色
 * ============================================================ */

:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --border: #e6e8ee;
  --border-strong: #d7dbe3;

  --text: #101828;
  --text-soft: #475467;
  --muted: #667085;
  --muted-light: #98a2b3;

  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff4ff;

  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --ok: #027a48;
  --ok-soft: #ecfdf3;
  --purple: #6941c6;
  --purple-soft: #f4f3ff;

  --radius: 10px;
  --radius-sm: 8px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, 0.18);
  --sidebar: 228px;
  --topbar: 64px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--text); }
::selection { background: #dbe7ff; }
body.no-scroll { overflow: hidden; }

svg { display: block; }

/* ---------------- 布局 ---------------- */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.brand { padding: 20px 18px 16px; border-bottom: 1px solid var(--border); }
.brand-title { font-size: 16px; font-weight: 600; line-height: 1.4; letter-spacing: 0.2px; }
.brand-sub { font-size: 12px; color: var(--muted-light); margin-top: 3px; letter-spacing: 0.2px; }
.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  background: linear-gradient(160deg, #3b82f6, #1d4ed8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.nav-label {
  font-size: 11px;
  color: var(--muted-light);
  letter-spacing: 0.6px;
  padding: 4px 10px 8px;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 11px;
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 14px;
  margin-bottom: 3px;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: #f2f4f7; color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--primary-dark);
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; }
.nav-item span.lbl { flex: 1; }

.nav-count {
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.nav-count.show { display: inline-flex; }
.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  display: none;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12);
}
.nav-dot.show { display: inline-block; }

.sidebar-foot { border-top: 1px solid var(--border); padding: 12px 14px; }
.user { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  background: #e8efff;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
}
.user-info { min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--muted-light); }
.foot-actions { display: flex; gap: 2px; margin-left: -6px; }

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-left { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.topbar h1 { font-size: 16px; font-weight: 600; margin: 0; line-height: 1.2; letter-spacing: 0; white-space: nowrap; }
.page-sub { font-size: 12.5px; color: var(--muted); margin-top: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.content { width: 100%; max-width: 1680px; padding: 24px 36px 64px; }

/* 高分辨率适配：2K 及以上放宽版心 */
@media (min-width: 2100px) {
  .content { max-width: 1980px; padding: 28px 44px 72px; }
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 15px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.btn:hover { background: #f9fafb; border-color: #b9c0cc; }
.btn:active { background: #f2f4f7; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn svg { width: 15px; height: 15px; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, 0.24); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-primary:active { background: #1e40af; }

.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f2f4f7; color: var(--text); border-color: transparent; }

.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 6px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-block { width: 100%; }

/* ---------------- 卡片 ---------------- */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }
.card-count { font-size: 12.5px; font-weight: 400; color: var(--muted); }

/* ---------------- 统计卡 ---------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 17px 12px;
  cursor: pointer;
  transition: border-color 0.14s, box-shadow 0.14s, transform 0.14s;
}
.stat:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1); transform: translateY(-1px); }
.stat.sa-orange { border-top: 3px solid #f79009; }
.stat.sa-blue { border-top: 3px solid var(--primary); }
.stat.sa-purple { border-top: 3px solid #7c3aed; }
.stat.sa-green { border-top: 3px solid var(--ok); }
.stat.sa-gray { border-top: 3px solid var(--border-strong); }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-num {
  margin-top: 2px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.stat-num.t-gray { color: var(--text); }
.stat-num.t-orange { color: #d97706; }
.stat-num.t-blue { color: #2563eb; }
.stat-num.t-purple { color: #7c3aed; }
.stat-num.t-green { color: #059669; }
.stat-num.t-red { color: var(--danger); }

/* ---------------- 标签 ---------------- */

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
}
.b-status-todo { background: #fffaeb; color: #b54708; }
.b-status-doing { background: #eff8ff; color: #175cd3; }
.b-status-verify { background: #f4f3ff; color: #6941c6; }
.b-status-done { background: #ecfdf3; color: #027a48; }
.b-status-cancel { background: #f2f4f7; color: #667085; }

.b-pri-high { background: #fef3f2; color: #b42318; }
.b-pri-mid { background: #fffaeb; color: #b54708; }
.b-pri-low { background: #f2f4f7; color: #667085; }

.b-type-ext { background: #eef2ff; color: #4338ca; }
.b-type-int { background: #f0fdfa; color: #0f766e; }

.b-plain { background: #f2f4f7; color: #475467; }
.b-over { background: #fef3f2; color: #b42318; }

.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* ---------------- 表格 ---------------- */

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: #fcfcfd;
}
table.tbl td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f2f5;
  vertical-align: middle;
}
table.tbl tbody tr.row { cursor: pointer; transition: background 0.1s; }
table.tbl tbody tr.row:hover { background: #f8fafc; }
table.tbl tbody tr.row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
table.tbl tbody tr:last-child td { border-bottom: none; }

.row-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 420px;
}
tr.row:hover .row-title { color: var(--primary-dark); }
.row-meta { margin-top: 2px; font-size: 12px; color: var(--muted-light); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-meta .sep { color: #d0d5dd; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .btn { opacity: 0; pointer-events: none; transition: opacity 0.12s; }
tr.row:hover .row-actions .btn { opacity: 1; pointer-events: auto; }
tr.row:focus-within .row-actions .btn { opacity: 1; pointer-events: auto; }

.cell-code { font-size: 12.5px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: -0.2px; }
.nowrap { white-space: nowrap; }
.text-danger { color: var(--danger); }
.text-muted { color: var(--muted); }

/* ---------------- 空状态 ---------------- */

.empty-state, .list-empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--muted-light);
  font-size: 14px;
}
.empty-state .big, .list-empty .big { font-size: 15px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.empty-line { padding: 18px 0; color: var(--muted-light); font-size: 13px; }

/* ---------------- 筛选栏 ---------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 11px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}
.filters .spacer { flex: 1; }
.filters-in-card {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  margin-bottom: 0;
  box-shadow: none;
  background: var(--panel);
  padding: 11px 14px;
}

.input, .select, .textarea {
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-light); }
.input:hover, .select:hover, .textarea:hover { border-color: #b9c0cc; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.input-search { width: 240px; padding-left: 30px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px center; }
.select { padding-right: 6px; cursor: pointer; }
.select-sm { height: 32px; font-size: 13.5px; border-radius: 6px; }
.textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.65; width: 100%; display: block; }

.checkbox { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-soft); cursor: pointer; user-select: none; }
.checkbox input { margin: 0; accent-color: var(--primary); }

/* ---------------- 分页 ---------------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}
.pager-actions { display: flex; gap: 6px; }

/* ---------------- 首页 ---------------- */

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid #f4f5f7;
  cursor: pointer;
  transition: background 0.1s;
}
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: #f8fafc; }
.pri-bar { width: 3px; height: 30px; border-radius: 2px; background: #e4e7ec; flex: 0 0 3px; }
.pri-bar.high { background: #f04438; }
.pri-bar.mid { background: #f79009; }
.pri-bar.low { background: #d0d5dd; }
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-title.text-danger { font-weight: 600; }
.row-desc { font-size: 12px; color: var(--muted-light); margin-top: 2px; max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-desc .sep { margin: 0 5px; }
.todo-meta { margin-top: 3px; font-size: 13px; color: var(--muted-light); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.todo-side { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

/* 我的待办：三列看板（对齐参考工作台） */
.todo-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.todo-cols .todo-item { padding: 9px 4px; }
@media (max-width: 1100px) { .todo-cols { grid-template-columns: 1fr; } }

/* 抽屉快捷记录行（对齐参考工作台） */
.log-add { display: flex; gap: 8px; margin-top: 10px; }
.log-add input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
}
.log-add input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.due-inline { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.due-inline.over { color: var(--danger); font-weight: 600; }
.due-inline.soon { color: #d97706; font-weight: 500; }

/* ---------------- 详情抽屉 ---------------- */

.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.4);
  z-index: 80;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.drawer-mask.open { opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(660px, 94vw);
  background: #fff;
  z-index: 81;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(16, 24, 40, 0.16);
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }

.drawer-head {
  padding: 16px 22px 15px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.drawer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.drawer-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); letter-spacing: -0.2px; }
.drawer-actions { display: flex; align-items: center; gap: 6px; }
.drawer-title { margin: 0 0 9px; font-size: 19px; font-weight: 600; line-height: 1.45; letter-spacing: -0.2px; }
.drawer-close {
  width: 30px; height: 30px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 21px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.drawer-close:hover { background: #f2f4f7; color: var(--text); }

.drawer-body { flex: 1; overflow-y: auto; padding: 16px 22px 40px; }

.quick-panel {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 20px;
}
.qrow { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.qrow + .qrow { margin-top: 5px; }
.qlabel { flex: 0 0 58px; font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  height: 27px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.chip:hover { border-color: #c2cbd9; }
.chip.active { font-weight: 600; }
.chip.active.t-todo { background: #fffaeb; border-color: #fedf89; color: #b54708; }
.chip.active.t-doing { background: #eff8ff; border-color: #b2ddff; color: #175cd3; }
.chip.active.t-verify { background: #f4f3ff; border-color: #d9d6fe; color: #6941c6; }
.chip.active.t-done { background: #ecfdf3; border-color: #a6f4c5; color: #027a48; }
.chip.active.t-cancel { background: #f2f4f7; border-color: #d0d5dd; color: #475467; }

.date-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.date-btn:hover { border-color: #b9c0cc; }
.date-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.date-btn svg { width: 14px; height: 14px; color: var(--muted); }
.date-btn .empty-text { color: var(--muted-light); }
.due-flag { font-style: normal; font-size: 11.5px; color: var(--warn); background: var(--warn-soft); padding: 0 6px; border-radius: 4px; height: 18px; display: inline-flex; align-items: center; }
.due-flag.red { color: var(--danger); background: var(--danger-soft); }

.drawer-section { margin-bottom: 22px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.sec-title { margin: 0; font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.sec-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: #f2f4f7;
  border-radius: 9px;
  padding: 0 7px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  font-variant-numeric: tabular-nums;
}
.desc { font-size: 14.5px; color: var(--text-soft); white-space: pre-wrap; word-break: break-word; line-height: 1.75; }
.desc.empty { color: var(--muted-light); }

.kv {
  margin: 0;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px 12px;
  font-size: 14px;
  background: var(--panel-soft);
  border-radius: 9px;
  padding: 12px 14px;
}
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* ---------------- 时间线 ---------------- */

.timeline { position: relative; }
.tl-item { position: relative; padding: 0 0 18px 24px; }
.tl-item::before {
  content: '';
  position: absolute;
  left: 4px; top: 15px; bottom: 0;
  width: 1px;
  background: var(--border);
}
.tl-item:last-child::before { display: none; }
.tl-item:last-child { padding-bottom: 4px; }
.tl-dot {
  position: absolute;
  left: 0; top: 5px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #93b4f5;
}
.tl-item:first-child .tl-dot { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.tl-user { font-size: 14px; font-weight: 600; }
.tl-time { font-size: 12.5px; color: var(--muted-light); font-variant-numeric: tabular-nums; }
.tl-content { font-size: 14.5px; white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.tl-result {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 6px;
  padding: 7px 10px;
  background: var(--panel-soft);
  border-left: 2px solid #d0d5dd;
  border-radius: 0 5px 5px 0;
  white-space: pre-wrap;
}
.tl-result b { color: var(--muted); font-weight: 500; }

/* ---------------- 附件 ---------------- */

.att-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.att-thumb {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  cursor: zoom-in;
  display: block;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.att-thumb:hover { border-color: #9dbcf7; box-shadow: 0 3px 10px rgba(37, 99, 235, 0.14); }
.file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: var(--text-soft);
  max-width: 260px;
}
.file-link:hover { border-color: #b2ccfb; color: var(--primary); background: var(--primary-soft); }
.file-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 处理记录表单 ---------------- */

.record-form {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
}
.record-form[hidden] { display: none; }
.record-form .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.record-form .row .spacer { flex: 1; }
.record-form .file-input { height: 30px; padding: 3px 6px; font-size: 12px; max-width: 230px; border-radius: 6px; }
.record-form .file-input::file-selector-button {
  margin-right: 8px;
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--text-soft);
  font-size: 12px;
  cursor: pointer;
}

/* ---------------- 弹窗 ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.44);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 52px 16px;
  z-index: 100;
  overflow-y: auto;
  animation: fadeIn 0.14s ease-out;
}
.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 680px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.16s ease-out;
  margin-bottom: 40px;
}
.modal.narrow { max-width: 520px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { transform: translateY(-8px) scale(0.99); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px 22px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 22px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  border-radius: 0 0 12px 12px;
}
.modal-close {
  width: 30px; height: 30px;
  border: none; background: transparent; border-radius: 7px;
  font-size: 20px; line-height: 1; color: var(--muted-light);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: #f2f4f7; color: var(--text); }

.field { margin-bottom: 13px; }
.field:last-child { margin-bottom: 0; }
.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.date-input { display: flex; align-items: center; gap: 4px; }

/* ---------------- 日期选择器 ---------------- */

.dp {
  position: fixed;
  z-index: 130;
  width: 282px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 12px;
  animation: pop 0.12s ease-out;
}
.dp-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.dp-chip {
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
}
.dp-chip:hover { border-color: #b2ccfb; color: var(--primary); background: var(--primary-soft); }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-title { font-size: 13px; font-weight: 600; }
.dp-nav {
  width: 26px; height: 26px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.dp-nav:hover { background: #f2f4f7; color: var(--text); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.dp-dow { text-align: center; font-size: 11px; color: var(--muted-light); padding: 4px 0 5px; }
.dp-day {
  height: 31px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.dp-day:hover { background: #f2f4f7; }
.dp-day.out { color: #c4cad4; }
.dp-day.today { color: var(--primary); font-weight: 600; box-shadow: inset 0 0 0 1px #b2ccfb; }
.dp-day.sel { background: var(--primary); color: #fff; font-weight: 600; box-shadow: none; }
.dp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  margin-top: 9px;
  padding-top: 8px;
}
.dp-link { border: none; background: none; font-size: 12.5px; color: var(--muted); cursor: pointer; padding: 3px 4px; border-radius: 4px; }
.dp-link:hover { color: var(--primary); background: var(--primary-soft); }

/* ---------------- 登录页 ---------------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2f8;
  background-image: radial-gradient(circle at 15% 20%, rgba(37, 99, 235, 0.08), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(37, 99, 235, 0.06), transparent 40%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 384px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 30px 26px;
  box-shadow: 0 12px 40px rgba(16, 24, 40, 0.1);
}
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.login-title { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; }
.login-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.login-card .field { margin-bottom: 14px; }
.login-card .input { width: 100%; height: 40px; }
.login-card .btn { width: 100%; height: 40px; margin-top: 4px; }
.login-error {
  display: none;
  background: var(--danger-soft);
  border: 1px solid #fecdca;
  color: #b42318;
  font-size: 12.5px;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.login-error.show { display: block; }
.login-foot { text-align: center; font-size: 12px; color: var(--muted-light); margin-top: 18px; }
.login-foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.login-foot a:hover { color: var(--text); }

/* ---------------- Toast ---------------- */

#toast-host {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: #101828;
  color: #fff;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.24);
  animation: toastIn 0.16s ease-out;
  max-width: 80vw;
  display: flex;
  align-items: center;
  gap: 7px;
}
.toast.error { background: #b42318; }
.toast.ok { background: #05603a; }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- 其它 ---------------- */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.seg {
  display: flex;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.seg-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: #fff; color: var(--primary-dark); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1); }
.tab {
  position: relative;
  padding: 9px 14px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  background: none;
  border-top: 0; border-left: 0; border-right: 0;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }

.hint { font-size: 12.5px; color: var(--muted-light); margin-top: 5px; line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.spin {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d4d8e0; border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b9c0cc; background-clip: content-box; }

/* ---------------- 补充状态与行内操作 ---------------- */

.due-soon { color: #b54708; }

table.tbl tbody tr.row.active { background: #f3f7ff; }
table.tbl tbody tr.row.active td:first-child { box-shadow: inset 3px 0 0 var(--primary); }

.quick-cell { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }

/* 手机端悬浮新建按钮（桌面隐藏，≤820px 显示） */
.fab {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 24px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
  z-index: 60;
}
.fab:active { transform: scale(0.95); }
.fab svg { width: 24px; height: 24px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .sidebar {
    position: static;
    width: 100%;
    flex: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .layout { display: block; }
  .main { margin-left: 0; }
  .brand { padding: 12px 14px 10px; }
  .brand-title { font-size: 15px; }
  .nav { display: flex; overflow-x: auto; padding: 6px 8px; gap: 2px; -webkit-overflow-scrolling: touch; }
  .nav-label { display: none; }
  .nav-item { white-space: nowrap; margin: 0 3px 0 0; height: 34px; font-size: 13.5px; }
  .sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; }
  .user { margin-bottom: 0; }
  .foot-actions { margin-left: 0; }
  .content { padding: 12px 12px 92px; }
  .topbar { padding: 0 14px; height: 50px; }
  .topbar-left { gap: 8px; }
  .topbar h1 { font-size: 15.5px; }
  .topbar-actions { display: none; }
  .page-sub { font-size: 12px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; margin-bottom: 12px; }
  .stat { padding: 12px 14px; }
  .stat-num { font-size: 24px; }
  .home-grid, .home-grid-v2 { grid-template-columns: 1fr; gap: 12px; }
  .todo-item { padding: 10px 14px; gap: 10px; }
  .todo-title { white-space: normal; }
  .todo-meta { gap: 6px; font-size: 12px; }
  .filters { gap: 6px; padding: 8px; }
  .filters .input, .filters .select { flex: 1 1 44%; min-width: 0; }
  .input-search { width: 100%; flex-basis: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  /* 16px 以上避免 iOS 聚焦自动放大 */
  .input, .select, .textarea { font-size: 16px; }
  .drawer { width: 100%; }
  .drawer-body { padding: 14px 14px 40px; }
  .drawer-head { padding: 12px 14px 11px; }
  .drawer-title { font-size: 17px; }
  .modal-body { padding: 14px; }
  .modal-head { padding: 13px 14px; }
  .modal-foot { padding: 11px 14px; }
  table.tbl { min-width: 640px; }
  .fab { display: flex; }
}

/* ---------------- 首页 V2：色条 / 区块图标 / 计数胶囊 / 到期标签 ---------------- */

.section-card { position: relative; overflow: hidden; }
.section-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.section-card.accent-blue::before { background: var(--primary); }
.section-card.accent-red::before { background: #f04438; }
.section-card.accent-gray::before { background: #d0d5dd; }

.section-card .card-head { padding-left: 21px; }
.section-card .todo-item, .section-card .table-wrap { padding-left: 3px; }

.sec-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
}
.sec-icon svg { width: 14px; height: 14px; }
.sec-icon.i-blue { background: #eff6ff; color: #2563eb; }
.sec-icon.i-red { background: #fef3f2; color: #d92d20; }
.sec-icon.i-gray { background: #f2f4f7; color: #667085; }

.pill-count {
  font-size: 12.5px;
  font-weight: 500;
  padding: 1px 9px;
  border-radius: 9px;
  line-height: 1.5;
}
.pill-count.p-blue { background: #eff6ff; color: #2563eb; }
.pill-count.p-red { background: #fef3f2; color: #b42318; }
.pill-count.p-gray { background: #f2f4f7; color: #667085; }

.due-chip {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 5px;
  font-weight: 500;
  white-space: nowrap;
}
.due-chip.over { background: #fef3f2; color: #b42318; }
.due-chip.soon { background: #fffaeb; color: #b54708; }
.due-chip.today { background: #fff7e6; color: #b54708; border: 1px solid #fedf89; }

.home-grid-v2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

/* ---------------- 高分辨率适配（1080P / 2K） ---------------- */
@media (min-width: 1600px) {
  .stat-grid { gap: 14px; }
  .stat { padding: 17px 20px 15px; }
  .stat-num { font-size: 32px; }
  .stat-label { font-size: 13.5px; }
  .todo-item { padding: 13px 20px; }
  .todo-title { font-size: 15px; }
  .home-grid-v2 { gap: 18px; }
}
@media (min-width: 2100px) {
  body { font-size: 16px; }
  input, select, textarea { font-size: 15.5px; }
  .stat-num { font-size: 34px; }
  .todo-title { font-size: 15.5px; }
  .home-grid-v2 { gap: 20px; }
}

/* ---------------- 分享 ---------------- */
.share-url-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
}
.share-url-box .url {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f1f2f5;
  font-size: 13px;
}
.share-item:last-child { border-bottom: none; }
.share-item .u { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--text-soft); }

/* ---------------- 外部分享页 ---------------- */
.share-page { min-height: 100vh; background: #f5f6f8; padding: 40px 16px; }
.share-card {
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #e6e8ee;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  padding: 26px 28px 22px;
}
.share-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; font-size: 13px; color: #667085; }
.share-title { margin: 0 0 6px; font-size: 19px; font-weight: 600; line-height: 1.45; color: #101828; }
.share-info { background: #f8fafc; border-radius: 8px; padding: 13px 15px; font-size: 14px; color: #475467; line-height: 1.9; margin-bottom: 18px; }
.share-tl { border-left: 2px solid #e6e8ee; margin-left: 5px; padding-left: 16px; }
.share-tl-item { padding-bottom: 16px; position: relative; }
.share-tl-item::before {
  content: '';
  position: absolute;
  left: -21.5px; top: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #93b4f5;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #93b4f5;
}
.share-tl-item:first-child::before { background: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.share-tl-item:last-child { padding-bottom: 4px; }
.share-tl-time { font-size: 12.5px; color: #98a2b3; }
.share-tl-text { font-size: 14.5px; color: #101828; white-space: pre-wrap; word-break: break-word; line-height: 1.7; margin-top: 2px; }
.share-tl-result { font-size: 13px; color: #475467; margin-top: 5px; padding: 6px 10px; background: #f8fafc; border-left: 2px solid #d0d5dd; border-radius: 0 5px 5px 0; white-space: pre-wrap; }
.share-foot { text-align: center; font-size: 12.5px; color: #98a2b3; margin-top: 16px; }
.share-empty { text-align: center; padding: 30px 0; color: #98a2b3; font-size: 14px; }

@media (max-width: 820px) {
  .home-grid-v2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
