/* ========== Design tokens ========== */
:root {
  --paper: #F4F1EA;
  --card: #FFFFFF;
  --ink: #1B2430;
  --muted: #6B7280;
  --line: #E5E0D6;
  --accent: #0F766E;
  --accent-soft: #E6F3F1;
  --accent-hover: #0B5F59;
  --amber: #C27803;
  --amber-soft: #FFF4E0;
  --brick: #B5453A;
  --brick-soft: #FBECEA;
  --indigo: #4C5FD5;
  --indigo-soft: #EEF0FF;
  --shadow: 0 1px 2px rgba(27,36,48,.04), 0 4px 12px rgba(27,36,48,.04);
  --shadow-lg: 0 8px 28px rgba(27,36,48,.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --font: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Inter", system-ui, sans-serif;
  --font-en: "Inter", "SF Pro Text", system-ui, sans-serif;
  --topbar-h: 56px;
  --sidebar-w: 232px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--accent); text-decoration: none; }
table { border-collapse: collapse; width: 100%; }
img { max-width: 100%; display: block; }

/* ========== App chrome ========== */
.app { min-height: 100%; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 212px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-soft);
  display: grid; place-items: center;
}
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.brand-sub {
  font-family: var(--font-en);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.topbar-search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 12px;
  transition: .15s;
}
.topbar-search:focus-within {
  background: var(--card);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.topbar-search input {
  border: none; outline: none; background: transparent; width: 100%;
  font-size: 13px;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; color: var(--muted);
  position: relative;
}
.icon-btn:hover { background: var(--paper); color: var(--ink); }
.badge-dot {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--brick); color: #fff;
  font-size: 10px; font-weight: 600;
  border-radius: 999px; display: grid; place-items: center;
  font-family: var(--font-en);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #0F766E, #14919B);
  color: #fff; font-size: 13px; font-weight: 600;
  display: grid; place-items: center;
}

.shell { display: flex; flex: 1; width: 100%; min-height: calc(100vh - var(--topbar-h)); }

.sidebar {
  width: var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 13.5px; font-weight: 500;
  transition: .15s; text-align: left; width: 100%;
}
.nav-item:hover { background: var(--paper); color: var(--ink); }
.nav-item.active {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.nav-pill {
  margin-left: auto;
  font-family: var(--font-en);
  font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
  background: var(--paper); color: var(--muted);
}
.nav-pill.amber { background: var(--amber-soft); color: var(--amber); }
.nav-pill.indigo { background: var(--indigo-soft); color: var(--indigo); }
.nav-item.active .nav-pill { background: #fff; color: var(--accent); }

.sidebar-foot { margin-top: auto; padding: 12px 4px 4px; }
.cloud-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.cloud-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--ink);
  margin-bottom: 6px;
}
.cloud-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cloud-card p { font-size: 11px; color: var(--muted); line-height: 1.5; }

.main {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 28px 32px 56px;
  /* 撑满侧栏右侧全部空间，避免宽屏右侧留白 */
  max-width: none;
  margin: 0;
}

/* ========== Typography helpers ========== */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.page-title { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.page-desc { color: var(--muted); font-size: 13.5px; margin-top: 6px; max-width: 640px; }
.section-title {
  font-size: 18px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.section-title .hint {
  font-size: 12px; font-weight: 400; color: var(--muted);
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.en { font-family: var(--font-en); font-variant-numeric: tabular-nums; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 550;
  transition: .15s;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary {
  background: var(--card); color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover:not(:disabled) { background: var(--paper); }
.btn-ghost {
  background: transparent; color: var(--muted);
}
.btn-ghost:hover:not(:disabled) { background: var(--paper); color: var(--ink); }
.btn-danger {
  background: var(--brick-soft); color: var(--brick);
}
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: var(--radius-xs); }
.btn-lg { height: 44px; padding: 0 22px; font-size: 14.5px; }

/* ========== Cards ========== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 20px 22px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.card-body { padding: 20px; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }

/* ========== Tags / badges ========== */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 8px;
  border-radius: var(--radius-xs);
  font-size: 12px; font-weight: 500;
  background: var(--paper); color: var(--muted);
  white-space: nowrap;
}
.tag-accent { background: var(--accent-soft); color: var(--accent); }
.tag-amber { background: var(--amber-soft); color: var(--amber); }
.tag-brick { background: var(--brick-soft); color: var(--brick); }
.tag-indigo { background: var(--indigo-soft); color: var(--indigo); }
.tag-outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* ========== Stats / dashboard ========== */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  border-radius: var(--radius);
  padding: 20px 22px;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute; right: -20px; top: -20px;
  width: 100px; height: 100px; border-radius: 50%;
  background: currentColor; opacity: .06;
}
.stat-amber { background: var(--amber-soft); color: var(--amber); border-color: #F0DFC0; }
.stat-accent { background: var(--accent-soft); color: var(--accent); border-color: #C5E3DF; }
.stat-brick { background: var(--brick-soft); color: var(--brick); border-color: #EED2CE; }
.stat-label {
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.stat-value {
  font-family: var(--font-en);
  font-size: 36px; font-weight: 650;
  letter-spacing: -.03em;
  margin: 8px 0 4px;
  color: var(--ink);
  line-height: 1;
}
.stat-desc { font-size: 12px; opacity: .85; }
.stat-card .go {
  margin-top: 14px;
  font-size: 12.5px; font-weight: 600;
  color: inherit;
  display: inline-flex; align-items: center; gap: 4px;
}

.kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.kpi-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.kpi-value {
  font-family: var(--font-en);
  font-size: 24px; font-weight: 650;
  letter-spacing: -.02em;
}
.kpi-delta { font-size: 11.5px; margin-top: 4px; color: var(--accent); font-weight: 500; }

/* ========== Tables ========== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}
table.data {
  background: var(--card);
  font-size: 13px;
}
table.data th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #FAFAF7;
  white-space: nowrap;
}
table.data td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #FCFBF8; }
.cell-title { font-weight: 550; color: var(--ink); }
.cell-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ========== Forms ========== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-label {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 6px;
}
.form-label .req {
  color: var(--brick); font-size: 11px;
}
.form-hint { font-size: 11.5px; color: var(--muted); }
.form-input, .form-select, .form-textarea {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: var(--card);
  outline: none;
  transition: .15s;
  width: 100%;
}
.form-textarea {
  height: auto;
  min-height: 110px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.6;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.checkbox-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  transition: .15s;
}
.checkbox-row:hover { border-color: #cfc8ba; }
.checkbox-row.checked {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.checkbox-row input { margin-top: 3px; accent-color: var(--accent); }
.checkbox-row .t { font-weight: 550; font-size: 13px; }
.checkbox-row .d { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ========== Progress ========== */
.progress {
  height: 8px;
  background: var(--paper);
  border-radius: 999px;
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .6s ease;
}
.progress.amber > i { background: var(--amber); }
.progress.indigo > i { background: var(--indigo); }
.progress-brick > i { background: var(--brick); }

.score {
  display: inline-flex; align-items: center; gap: 8px;
}
.score-bar {
  width: 56px; height: 6px;
  background: var(--paper); border-radius: 999px; overflow: hidden;
}
.score-bar > i {
  display: block; height: 100%;
  border-radius: 999px;
  background: var(--accent);
}
.score-num {
  font-family: var(--font-en);
  font-weight: 650;
  font-size: 13px;
}
.score-high .score-bar > i { background: var(--accent); }
.score-mid .score-bar > i { background: var(--amber); }
.score-low .score-bar > i { background: var(--brick); }

/* ========== Pipeline / home activity ========== */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 13px; font-weight: 600;
}
.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; line-height: 1.5; }
.activity-text strong { font-weight: 600; }
.activity-time { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.task-mini {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  transition: .15s;
}
.task-mini:hover { border-color: #cfc8ba; box-shadow: var(--shadow); }
.task-mini .meta { flex: 1; min-width: 0; }
.task-mini .name { font-weight: 600; font-size: 13.5px; }
.task-mini .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ========== Dual source panel ========== */
.source-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.source-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.source-title {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px;
}
.source-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
}
.source-body { padding: 20px; }

.search-progress-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.search-progress-item:last-child { border-bottom: none; }
.source-url {
  font-family: var(--font-en);
  font-size: 11.5px;
  color: var(--muted);
  word-break: break-all;
}

/* ========== Develop / letter review ========== */
.letter-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}
.letter-paper {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.letter-meta {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #FAFAF7;
}
.letter-body {
  padding: 22px 24px;
  font-family: var(--font-en), var(--font);
  font-size: 13.5px;
  line-height: 1.75;
  white-space: pre-wrap;
}
.letter-body .zh {
  font-family: var(--font);
}
.checklist-item {
  display: flex; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  cursor: pointer;
  transition: .15s;
}
.checklist-item.checked {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.checklist-item .box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--card);
}
.checklist-item.checked .box {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.checklist-item .label { font-size: 13px; font-weight: 550; }
.checklist-item .desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ========== Inbox ========== */
.inbox-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  min-height: 560px;
}
.inbox-list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.inbox-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: .12s;
}
.inbox-item:hover { background: #FCFBF8; }
.inbox-item.active {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding-left: 13px;
}
.inbox-item .from { font-weight: 600; font-size: 13px; }
.inbox-item .snippet {
  font-size: 12px; color: var(--muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.inbox-item .foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
}
.inbox-detail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ai-panel {
  background: var(--indigo-soft);
  border: 1px solid #D8DCFF;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.ai-panel h4 {
  font-size: 13px; font-weight: 650;
  color: var(--indigo);
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
}
.ai-panel .kv {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px 12px;
  font-size: 13px;
}
.ai-panel .k { color: var(--muted); font-size: 12px; }
.ai-panel ul {
  margin: 8px 0 0 18px;
  font-size: 13px;
}
.ai-panel li { margin-bottom: 4px; }

.intent-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* ========== Schedule / timeline ========== */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 9px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--line);
}
.tl-item {
  position: relative;
  padding-bottom: 24px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -28px; top: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--accent);
  display: grid; place-items: center;
}
.tl-dot.amber { border-color: var(--amber); }
.tl-dot.brick { border-color: var(--brick); }
.tl-dot.indigo { border-color: var(--indigo); }
.tl-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.tl-date {
  font-family: var(--font-en);
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 4px;
}

/* ========== Empty / loading ========== */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty .icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--paper);
  display: grid; place-items: center;
}

/* ========== Modal ========== */
.modal-root {
  position: fixed; inset: 0;
  z-index: 100;
  display: grid; place-items: center;
  padding: 24px;
}
.modal-root[hidden] { display: none; }
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(27, 36, 48, .42);
  backdrop-filter: blur(2px);
}
.modal {
  position: relative;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: min(640px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  animation: modalIn .18s ease;
}
.modal.wide { width: min(820px, 100%); }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  padding: 20px 24px 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.modal-title { font-size: 18px; font-weight: 650; }
.modal-desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.modal-body { padding: 20px 24px; }
.modal-foot {
  padding: 16px 24px 22px;
  display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  background: var(--card);
}

/* ========== Toast ========== */
.toast-wrap {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease;
  max-width: 360px;
}
.toast.success { background: var(--accent); }
.toast.warn { background: var(--amber); }
.toast.error { background: var(--brick); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ========== Tabs / filters ========== */
.tabs {
  display: inline-flex;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.tab {
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
}
.tab.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(27,36,48,.06);
}

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 16px;
}
.filter-bar .form-input,
.filter-bar .form-select {
  width: auto;
  min-width: 140px;
  height: 36px;
  font-size: 13px;
}

/* ========== Match chips ========== */
.match-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}

/* ========== Confirm strip ========== */
.confirm-strip {
  display: flex; align-items: center; gap: 12px;
  background: var(--amber-soft);
  border: 1px solid #F0DFC0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: #8A5A02;
}
.confirm-strip .icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
  color: var(--amber);
}


/* 超宽屏：更多列利用横向空间 */
@media (min-width: 1500px) {
  .grid-2.develop-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi-row { grid-template-columns: repeat(4, 1fr); }
  .letter-grid { grid-template-columns: 1.25fr 0.9fr; }
  .inbox-layout { grid-template-columns: 360px 1fr; }
}

/* ========== Responsive ========== */
@media (max-width: 1100px) {
  .stat-grid, .grid-3, .kpi-row { grid-template-columns: 1fr 1fr; }
  .letter-grid, .inbox-layout, .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 20px 16px 40px; }
}
@media (max-width: 720px) {
  .stat-grid, .grid-3, .kpi-row, .grid-4 { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
  .brand-text .brand-sub { display: none; }
}

/* ========== Login ========== */
.login-mask {
  position: fixed; inset: 0;
  background: linear-gradient(145deg, #1B2430 0%, #0F766E 100%);
  display: grid; place-items: center;
  z-index: 300;
}
.login-card {
  width: min(400px, 92vw);
  background: var(--card);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.login-brand { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.login-sub { color: var(--muted); font-size: 13px; margin: 6px 0 22px; }

/* ========== Loading ========== */
.loading-spin {
  width: 36px; height: 36px;
  margin: 0 auto;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
