/* ============================================================
   每日事项跟踪 · UI 设计规范 v1.0
   深藏青 + 米金点缀 · 衬线标题 / 无衬线正文 · 公文气质
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #1d2b3e;
  --ink-2: #3c4a5e;
  --muted: #77859a;
  --line: #e4e9f0;
  --line-2: #eef2f7;
  --brand: #1b3a63;
  --brand-2: #2a5688;
  --brand-soft: #eaf0f8;
  --accent: #b5894b;
  --ok: #16805a;
  --ok-soft: #e7f5ee;
  --no: #c33c31;
  --no-soft: #fcecea;
  --warn: #b4771c;
  --warn-soft: #fff5e3;
  --shadow: 0 2px 14px rgba(25, 48, 82, .055);
  --shadow-lg: 0 12px 40px rgba(20, 40, 70, .16);
  --r: 12px;
  --r-sm: 8px;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 650; font-family: var(--serif); }
p { margin: 0 0 .7em; }
p:last-child { margin-bottom: 0; }
small { font-size: 12px; }
button, input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- 防溢出 ---------- */
.main, .card, .stats-grid > *, .check-layout > *, .form-row > *, .list-row > *,
.topbar-inner, .page-head, .draft-item, .preset-option, .list > *, .list-row-main {
  min-width: 0;
}
.card, .list, .list-row-title, .draft-item > span { overflow-wrap: anywhere; }

/* ---------- 登录页（左右分屏） ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.auth-shell {
  width: 100%;
  max-width: 1180px;
  min-height: 660px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--surface);
  box-shadow: 0 0 60px rgba(20, 40, 70, .08);
  overflow: hidden;
}
.auth-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 44px 48px;
  background: linear-gradient(155deg, #1b3a63, #122b4b 60%, #0d2039);
  color: #fff;
  overflow: hidden;
}
.auth-aside::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -70px;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(233, 217, 182, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(233, 217, 182, .05), 0 0 0 68px rgba(233, 217, 182, .035);
  pointer-events: none;
}
.auth-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth-logo { width: 38px; height: 38px; flex: 0 0 auto; object-fit: contain; border-radius: 8px; }
.auth-brand-name { font-family: var(--serif); font-size: 19px; letter-spacing: .05em; }
.auth-brand-sub { font-size: 11px; color: #9fb6d0; letter-spacing: .08em; margin-top: 2px; }
.auth-body { margin: auto 0; position: relative; z-index: 1; }
.auth-eyebrow {
  font-size: 11px;
  letter-spacing: .28em;
  color: #cbb083;
  margin-bottom: 18px;
}
.auth-aside h1 {
  font-size: 40px;
  line-height: 1.4;
  font-weight: 650;
  letter-spacing: .04em;
  margin: 0 0 18px;
}
.auth-lead {
  font-size: 14px;
  line-height: 1.9;
  color: #c3d2e4;
  max-width: 340px;
  margin: 0 0 30px;
}
.feature-list { display: flex; flex-direction: column; gap: 14px; }
.feature { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: #d8e3f0; }
.feature-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid rgba(233, 217, 182, .45);
  border-radius: 6px;
  color: #e9d9b6;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
}
.auth-foot { font-size: 11.5px; color: #8ba2bd; position: relative; z-index: 1; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: 100%; max-width: 340px; }
.auth-card h2 { font-size: 26px; margin-bottom: 8px; }
.auth-card .auth-desc { font-size: 13px; color: var(--muted); margin-bottom: 26px; }
.auth-card .input { margin-bottom: 16px; }
.auth-tip { font-size: 12px; color: var(--muted); text-align: center; margin-top: 18px; }
.error-text { color: var(--no); font-size: 12.5px; min-height: 18px; margin: 8px 0 0; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 246, 249, .94);
  backdrop-filter: blur(8px);
  padding: 14px 22px 0;
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-mark { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; }
.brand-mark img { width: 34px; height: 34px; object-fit: contain; border-radius: 7px; }
.brand-name { font-family: var(--serif); font-size: 18px; letter-spacing: .06em; font-weight: 650; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.tabs { flex: 1; display: flex; align-items: stretch; justify-content: center; gap: 2px; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .16s, border-color .16s;
}
.tab:hover { color: var(--brand-2); }
.tab.active { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
#manage-btn.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }

/* ---------- 容器 / 页头 / 页脚 ---------- */
.main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 22px 60px;
  min-height: calc(100vh - 140px);
}
.page { display: none; }
.page.active { display: block; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.page-head h1 { font-size: 23px; letter-spacing: .02em; }
.page-head p { margin: 4px 0 0; }
.footer {
  border-top: 1px solid var(--line);
  padding: 18px 22px;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}
.date-input {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  flex: 0 0 auto;
}
.date-input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(42, 86, 136, .1); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.card-head h3 { font-family: inherit; font-size: 15.5px; font-weight: 650; }
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line-2);
  margin-top: 16px;
  padding-top: 16px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.5;
  cursor: pointer;
  background: var(--line-2);
  color: var(--ink-2);
  transition: all .16s;
  white-space: nowrap;
  touch-action: manipulation;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(25, 48, 82, .1); }
.btn:active { transform: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-success { background: var(--brand); color: #fff; }
.btn-success:hover { background: var(--brand-2); }
.btn-danger { background: var(--surface); color: var(--no); border-color: #f0c9c5; }
.btn-danger:hover { background: var(--no-soft); }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand-2); color: var(--brand-2); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ---------- 表单 ---------- */
.form-row { display: flex; gap: 12px; align-items: flex-end; }
.input, .select {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(42, 86, 136, .1); }
.select { flex: 0 0 160px; }
.weight-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.weight-toggle input { width: 15px; height: 15px; accent-color: var(--brand); }
.preset-toggle { margin-top: 12px; }
.text-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  margin-top: 16px;
}
.text-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.text-field > span { font-size: 12.5px; color: var(--ink-2); }
.text-field .input { flex: 0 0 auto; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--brand-soft);
  color: var(--brand);
}
.weight-tag {
  display: inline-block;
  background: var(--warn-soft);
  color: var(--accent);
  border: 1px solid #e7d6b8;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 5px;
  vertical-align: 1px;
  margin-right: 3px;
}
.source-tag {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: 1px;
  margin-right: 3px;
}
.rollover-tag {
  background: var(--no-soft);
  color: var(--no);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 5px;
  margin-left: 5px;
}

/* ---------- 列表 / 状态 ---------- */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line-2);
}
.list-row:last-child { border-bottom: 0; }
.list-row-main { flex: 1; }
.list-row-title { font-size: 14px; color: var(--ink); }
.list-row-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.list-row-actions { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.status-pill { font-size: 11.5px; padding: 3px 9px; border-radius: 20px; font-weight: 600; white-space: nowrap; }
.status-todo { background: var(--line-2); color: var(--muted); }
.status-done { background: var(--ok-soft); color: var(--ok); }
.status-undone { background: var(--no-soft); color: var(--no); }
.empty { text-align: center; color: var(--muted); padding: 46px 20px; font-size: 13.5px; }
.empty-sm { padding: 14px 10px; }
.preset-empty { display: block; padding: 10px 0; }

/* ---------- 早会录入：草稿 / 步进器 ---------- */
.draft-list { margin-top: 12px; }
.draft-group { margin-bottom: 10px; }
.draft-group-title { font-size: 12.5px; font-weight: 600; color: var(--brand); margin-bottom: 6px; }
.draft-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: var(--brand-soft);
  border-radius: var(--r-sm);
  margin-bottom: 5px;
  font-size: 14px;
}
.draft-actions { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.draft-item .remove { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }
.draft-item .remove:hover { color: var(--no); }
.weight-switch {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
}
.weight-switch.on { background: var(--warn-soft); color: var(--accent); border-color: #e7d6b8; font-weight: 600; }

.preset-picker {
  margin-top: 12px;
  padding: 6px 12px;
  background: var(--line-2);
  border-radius: var(--r-sm);
  max-height: 260px;
  overflow-y: auto;
}
.preset-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 4px;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}
.preset-option:last-child { border-bottom: 0; }
.preset-option-text { flex: 1; min-width: 0; }
.stepper { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.step-btn {
  width: 28px; height: 28px; line-height: 1;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--brand);
  font-size: 16px; font-weight: 600; cursor: pointer;
}
.step-btn:hover:not(:disabled) { background: var(--brand-soft); border-color: var(--brand-2); }
.step-btn:disabled { opacity: .35; cursor: not-allowed; }
.step-num { min-width: 18px; text-align: center; font-size: 14px; font-weight: 600; color: var(--ink); }

/* ---------- 夕会检查 ---------- */
.check-layout { display: flex; gap: 18px; align-items: flex-start; }
.check-sidebar {
  flex: 0 0 180px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 12px;
}
.check-sidebar-title { font-size: 11px; letter-spacing: .07em; color: var(--muted); padding: 2px 8px 8px; font-weight: 600; }
.check-advisor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 3px;
  border-left: 3px solid transparent;
}
.check-advisor:hover { background: var(--line-2); }
.check-advisor.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; border-left-color: var(--brand); }
.check-advisor .count { font-size: 12px; color: var(--muted); }
.check-main { flex: 1; min-width: 0; }
.check-detail h3 { margin-bottom: 16px; font-size: 19px; }
.check-item { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.check-item:last-child { border-bottom: 0; }
.check-item-content { font-size: 14px; margin-bottom: 10px; }
.check-item-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.check-item-actions .btn { padding: 7px 14px; font-size: 13px; }
.check-item-actions .btn.active-done { background: var(--brand); color: #fff; border-color: var(--brand); }
.check-item-actions .btn.active-undone { background: var(--no); color: #fff; border-color: var(--no); }
.reason-row { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.reason-row .input { padding: 8px 10px; font-size: 13px; }
.rollover-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.rollover-label input { width: 15px; height: 15px; accent-color: var(--brand); }
.undone-note { font-size: 12px; color: var(--no); margin-top: 8px; }

/* ---------- 看板 / 统计 ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 15px 16px;
}
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 25px; font-weight: 680; letter-spacing: -.02em; margin-top: 4px; color: var(--ink); }
.stat-value.success { color: var(--ok); }
.stat-value.danger { color: var(--no); }
.rate-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
.rate-head strong { font-size: 16px; color: var(--brand); font-weight: 680; }
.progress { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #4b7cb5); border-radius: 999px; transition: width .25s; }
.board-advisor-name { font-weight: 600; }
.board-advisor-bar { flex: 0 0 140px; height: 7px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.board-advisor-bar > div { height: 100%; background: linear-gradient(90deg, var(--brand), #4b7cb5); border-radius: 999px; }
.board-advisor-rate { font-size: 13px; color: var(--muted); width: 44px; text-align: right; flex: 0 0 auto; }

/* ---------- 顾问评分 ---------- */
.rating-row { cursor: pointer; }
.rating-row:hover .list-row-title { color: var(--brand); }
.rating-score { font-size: 20px; font-weight: 680; color: var(--brand); letter-spacing: -.02em; min-width: 52px; text-align: right; }
.rating-score.muted { font-size: 15px; color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 999;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ≤1100 ---------- */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 响应式 ≤760 ---------- */
@media (max-width: 760px) {
  .topbar { position: static; backdrop-filter: none; background: var(--bg); padding: 12px 12px 0; }
  .topbar-inner { flex-wrap: wrap; gap: 8px 14px; padding: 10px 14px; }
  .brand { order: 0; }
  .brand-sub { display: none; }
  .topbar-actions { order: 1; margin-left: auto; }
  .tabs { order: 2; flex: 1 0 100%; }
  .tab { flex: 1 0 auto; justify-content: center; padding: 10px 8px; font-size: 13px; }
  .btn-sm { min-height: 34px; padding: 8px 12px; }
  .main { padding: 18px 14px 50px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head h1 { font-size: 22px; }
  .date-input { width: 100%; }
  .form-row { flex-direction: column; align-items: stretch; }
  .text-form { grid-template-columns: 1fr; }
  .select { flex: 1 1 auto; width: 100%; }
  .input, .select, .date-input, .reason-row .input { font-size: 16px; }
  .card { padding: 16px; }
  .card-footer { flex-direction: column; align-items: stretch; }
  .card-footer .btn { width: 100%; }
  .check-layout { flex-direction: column; }
  .check-sidebar { flex: 1 1 auto; width: 100%; }
  .check-advisor-list { display: flex; flex-wrap: wrap; gap: 6px; }
  .check-advisor { margin-bottom: 0; padding: 8px 11px; background: var(--line-2); }
  .check-main { width: 100%; }
  .reason-row { flex-wrap: wrap; }
  .reason-row .input { flex: 1 1 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .board-advisor-bar { flex: 0 0 80px; }
  .footer { padding: 16px 14px; flex-direction: column; }
  .auth-shell { grid-template-columns: 1fr; min-height: 100vh; max-width: none; box-shadow: none; }
  .auth-aside { display: none; }
  .auth-panel { padding: 30px 22px; min-height: 100vh; }
}

/* ---------- 响应式 ≤420 ---------- */
@media (max-width: 420px) {
  .main { padding: 14px 10px 46px; }
  .card { padding: 14px; }
  .page-head h1 { font-size: 20px; }
  .brand-name { font-size: 16px; }
  .stat-value { font-size: 21px; }
  .rating-score { font-size: 18px; }
  .tab { font-size: 12.5px; padding: 10px 6px; }
}

/* ---------- 打印 ---------- */
@media print {
  .topbar, .footer, .toast, .btn, .tabs { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .main { padding: 0; }
}
