/* ============================================================
   信源引擎 · 静态原型样式
   B 端企业风格：主色蓝、浅灰底、白色卡片、1px 分隔线
   ============================================================ */

:root {
  --blue: #1b63d6;
  --blue-dark: #1550b0;
  --blue-light: #eaf1fc;
  --blue-border: #c9dcf8;
  --text: #1f2733;
  --text-2: #4a5666;
  --text-3: #7b8798;
  --text-4: #9aa5b4;
  --line: #e4e8ef;
  --line-2: #eef1f6;
  --bg: #f4f6fa;
  --white: #ffffff;
  --green: #1f8a5b;
  --green-bg: #e8f6ef;
  --amber: #b26a00;
  --amber-bg: #fdf3e2;
  --red: #c23b3b;
  --red-bg: #fbeaea;
  --cyan: #0f7a8a;
  --cyan-bg: #e6f5f7;
  --gray-bg: #f0f2f6;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(31, 39, 51, 0.04);
  --nav-w: 222px;
  --top-h: 56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, p { margin: 0; }

/* ---------- 布局 ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--nav-w);
  flex: 0 0 var(--nav-w);
  background: #0f1c2e;
  color: #c7d2e0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex: 0 0 auto;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 0.5px; }
.brand-sub { color: #7f8ea3; font-size: 11px; }

.nav { padding: 12px 0 24px; flex: 1; }
.nav-group { margin-bottom: 6px; }
.nav-group-title {
  padding: 8px 18px 4px;
  font-size: 11px;
  color: #6d7c90;
  letter-spacing: 1px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: #c7d2e0;
  cursor: pointer;
  border-left: 3px solid transparent;
  font-size: 13.5px;
  user-select: none;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav-item.active {
  background: rgba(27, 99, 214, 0.18);
  border-left-color: #4d8bf0;
  color: #fff;
}
.nav-item svg { flex: 0 0 auto; opacity: 0.85; }
.nav-item.active svg { opacity: 1; }
.nav-label { flex: 1; }
.nav-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #c23b3b;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.nav-badge.muted { background: #33445c; color: #c7d2e0; }

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--top-h);
  flex: 0 0 var(--top-h);
  background: var(--white);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.crumb { font-size: 15px; font-weight: 600; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-divider { width: 1px; height: 18px; background: var(--line); }
.env-tag {
  font-size: 12px;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 7px;
  background: #fafbfd;
}
.user-name { font-size: 13px; color: var(--text-2); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue-light); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.nav-toggle { display: none; }
.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  width: 30px; height: 30px;
  border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { border-color: var(--blue-border); color: var(--blue); }

.view {
  padding: 20px;
  flex: 1;
  min-width: 0;
}

/* ---------- 通用组件 ---------- */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.page-title { font-size: 18px; font-weight: 600; }
.page-desc { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-2);
}
.card-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-title .sub { font-size: 12px; color: var(--text-3); font-weight: 400; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }
.card-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--line-2);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #fcfdff;
  border-radius: 0 0 var(--radius) var(--radius);
}

.grid { display: grid; gap: 16px; }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }

.metric {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.metric-label { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.metric-value { font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: 0.2px; }
.metric-value .unit { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 3px; }
.metric-foot { font-size: 12px; color: var(--text-3); }
.metric-foot .up { color: var(--green); }
.metric-foot .down { color: var(--red); }
.metric.primary { border-top: 2px solid var(--blue); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--blue-border); color: var(--blue); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-danger { background: #fff; border-color: #e6b6b6; color: var(--red); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--blue); }
.btn-ghost:hover { background: var(--blue-light); }
.btn-sm { height: 27px; padding: 0 9px; font-size: 12.5px; }
.btn-lg { height: 38px; padding: 0 18px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

.link-btn {
  border: 0; background: none; color: var(--blue); cursor: pointer;
  padding: 0; font-size: 13px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 7px;
  border-radius: 3px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-gray { background: var(--gray-bg); color: var(--text-2); }
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-cyan { background: var(--cyan-bg); color: var(--cyan); }
.badge-line { background: #fff; border-color: var(--line); color: var(--text-3); }
.badge-dot::before {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; display: inline-block;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 8px;
  border-radius: 3px;
  background: #f5f7fa;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.chip.ok { background: var(--green-bg); border-color: #cbe8da; color: var(--green); }
.chip.warn { background: var(--amber-bg); border-color: #f2dfc0; color: var(--amber); }
.chip.bad { background: var(--red-bg); border-color: #efcccc; color: var(--red); }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row.full { grid-column: 1 / -1; }
.form-label { font-size: 13px; color: var(--text-2); }
.form-label .req { color: var(--red); margin-left: 2px; }
.form-hint { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  padding: 0 10px;
  height: 32px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(27, 99, 214, 0.10);
}
.input[readonly] { background: #f7f8fa; color: var(--text-2); }
.input.mono { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; }
.field-error { font-size: 12px; color: var(--red); min-height: 18px; }

.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form .input, .inline-form .select { width: auto; min-width: 150px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-2);
  background: #fafbfd;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-size: 12.5px;
}
.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
  color: var(--text);
}
.table tbody tr:hover { background: #fafcff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .nowrap { white-space: nowrap; }
.table .col-actions { white-space: nowrap; text-align: right; }
.table .muted { color: var(--text-3); }
.table .title-cell { max-width: 320px; }
.table .ellipsis {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 320px;
}

/* 标签页 */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.tab {
  padding: 9px 14px 10px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  user-select: none;
  background: none;
  border-top: 0; border-left: 0; border-right: 0;
}
.tab:hover { color: var(--blue); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.tab .count { font-size: 12px; color: var(--text-3); margin-left: 4px; }
.tab.active .count { color: var(--blue); }

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
}
.segmented button {
  border: 0;
  background: #fff;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-2);
  border-right: 1px solid var(--line);
}
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }

/* 筛选栏 */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-2);
}
.filters .form-row { min-width: 140px; }
.filters .form-row.wide { min-width: 220px; }
.filters .input, .filters .select { height: 30px; }
.filters .spacer { flex: 1; }

/* 空态 */
.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.empty-title { color: var(--text-2); font-size: 14px; margin-bottom: 6px; }
.empty svg { color: #c3ccd9; margin-bottom: 10px; }

/* 提示条 */
.notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 4px;
  background: #fafbfd;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.6;
}
.notice.blue { background: var(--blue-light); border-color: var(--blue-border); color: #23539c; }
.notice.amber { background: var(--amber-bg); border-color: #f0ddba; color: #8a5500; }
.notice.red { background: var(--red-bg); border-color: #efcccc; color: #9d2f2f; }
.notice.green { background: var(--green-bg); border-color: #cbe8da; color: #176b47; }
.notice svg { flex: 0 0 auto; margin-top: 2px; }

/* ---------- 工作台 ---------- */
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
}
.todo-item:last-child { border-bottom: 0; }
.todo-item:hover { background: #fafcff; }
.todo-ico {
  width: 30px; height: 30px; border-radius: 5px;
  background: var(--blue-light); color: var(--blue);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-size: 13.5px; color: var(--text); }
.todo-sub { font-size: 12px; color: var(--text-3); }
.todo-count { font-size: 18px; font-weight: 600; color: var(--text); padding: 0 4px; }
.todo-arrow { color: var(--text-4); }

.activity { list-style: none; margin: 0; padding: 4px 0; }
.activity li {
  display: flex;
  gap: 10px;
  padding: 9px 16px;
  font-size: 12.5px;
  color: var(--text-2);
}
.activity .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue); margin-top: 7px; flex: 0 0 auto;
}
.activity .time { color: var(--text-4); font-size: 11.5px; white-space: nowrap; margin-left: auto; }

.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-row { display: flex; align-items: center; gap: 10px; }
.funnel-name { width: 68px; font-size: 12.5px; color: var(--text-2); flex: 0 0 auto; }
.funnel-bar-wrap { flex: 1; height: 22px; background: #f3f5f9; border-radius: 3px; overflow: hidden; }
.funnel-bar { height: 100%; background: var(--blue); opacity: 0.85; }
.funnel-bar.s2 { opacity: 0.72; }
.funnel-bar.s3 { opacity: 0.6; }
.funnel-bar.s4 { opacity: 0.48; }
.funnel-bar.s5 { opacity: 0.36; }
.funnel-val { width: 52px; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---------- 写作 ---------- */
.writing-layout {
  display: grid;
  grid-template-columns: 190px 360px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  min-height: calc(100vh - 136px);
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.panel-head {
  height: 44px;
  flex: 0 0 44px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
  font-weight: 600;
}
.panel-head .sub { font-weight: 400; color: var(--text-3); font-size: 12px; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; }
.panel-foot { border-top: 1px solid var(--line-2); padding: 10px; background: #fcfdff; }

.history-list { list-style: none; margin: 0; padding: 6px; }
.history-item {
  padding: 9px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 2px;
}
.history-item:hover { background: #f6f8fb; }
.history-item.active { background: var(--blue-light); }
.history-title { font-size: 13px; color: var(--text); line-height: 1.4; }
.history-meta { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }

.chat-body { padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; flex-direction: column; gap: 4px; max-width: 100%; }
.msg-user { align-items: flex-end; }
.msg-bubble {
  padding: 9px 11px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.65;
  background: #f4f6fa;
  color: var(--text);
  max-width: 94%;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-user .msg-bubble { background: var(--blue); color: #fff; }
.msg-time { font-size: 11px; color: var(--text-4); }
.msg-card {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px;
  background: #fff;
  font-size: 12.5px;
  line-height: 1.7;
}
.msg-card .row { display: flex; justify-content: space-between; gap: 10px; }
.msg-card .row .k { color: var(--text-3); }
.msg-card .row .v { color: var(--text); font-variant-numeric: tabular-nums; }

.chat-compose { border-top: 1px solid var(--line-2); padding: 10px; }
.compose-row { display: flex; gap: 6px; margin-bottom: 6px; }
.compose-row .select { height: 30px; font-size: 12.5px; }
.chat-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  min-height: 62px;
  resize: none;
  outline: none;
  font-size: 13px;
  line-height: 1.6;
}
.chat-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27,99,214,.08); }
.compose-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.compose-hint { font-size: 11.5px; color: var(--text-4); }

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.preview-scroll { padding: 18px 22px 24px; }
.doc-title { font-size: 21px; font-weight: 600; line-height: 1.45; margin-bottom: 10px; }
.doc-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.doc-summary {
  background: #f7f9fc;
  border-left: 3px solid var(--blue);
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 16px;
  border-radius: 0 4px 4px 0;
}
.doc-body h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line-2);
}
.doc-body h3 { font-size: 14px; font-weight: 600; margin: 14px 0 5px; color: #2c3a4d; }
.doc-body p { font-size: 13.5px; line-height: 1.9; margin: 0 0 9px; color: #2b3545; }
.doc-body ul { margin: 4px 0 10px; padding-left: 20px; }
.doc-body li { font-size: 13.5px; line-height: 1.9; color: #2b3545; }
.doc-body blockquote { margin: 0; }

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  background: #fbfcfe;
}
.mini-metric { text-align: left; }
.mini-metric .k { font-size: 11.5px; color: var(--text-3); }
.mini-metric .v { font-size: 15px; font-weight: 600; margin-top: 1px; }
.mini-metric .v.ok { color: var(--green); }
.mini-metric .v.bad { color: var(--red); }
.mini-metric .hint { font-size: 11px; color: var(--text-4); }

/* ---------- 审核 ---------- */
.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 14px;
  align-items: start;
}
.review-doc { max-height: calc(100vh - 240px); }
.checklist { max-height: calc(100vh - 300px); overflow-y: auto; }
.check-group + .check-group { border-top: 1px solid var(--line-2); }
.check-group-head {
  padding: 9px 14px;
  background: #fafbfd;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
}
.check-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
}
.check-item:last-child { border-bottom: 0; }
.check-top { display: flex; align-items: flex-start; gap: 8px; }
.check-name { flex: 1; font-size: 13px; line-height: 1.5; }
.check-name .code { color: var(--text-4); font-size: 11.5px; margin-right: 4px; }
.check-std { font-size: 11.5px; color: var(--text-3); margin: 4px 0 0 0; line-height: 1.55; }
.check-note { font-size: 11.5px; color: var(--text-2); background: #f7f9fc; border-radius: 3px; padding: 3px 6px; margin-top: 5px; }
.check-note.bad { background: var(--red-bg); color: #9d2f2f; }
.check-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.radio-pill {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-3);
  border-radius: 3px;
  font-size: 11.5px;
  height: 23px;
  padding: 0 7px;
  cursor: pointer;
}
.radio-pill:hover { border-color: var(--blue-border); color: var(--blue); }
.radio-pill.on-pass { background: var(--green-bg); border-color: #b9dfcd; color: var(--green); font-weight: 600; }
.radio-pill.on-fail { background: var(--red-bg); border-color: #e8bcbc; color: var(--red); font-weight: 600; }
.radio-pill.on-na { background: var(--gray-bg); border-color: #d5dbe5; color: var(--text-2); font-weight: 600; }
.radio-pill:disabled { opacity: 0.72; cursor: default; }
.method-tag { font-size: 11px; color: var(--text-4); flex: 0 0 auto; }

.review-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
  position: sticky;
  bottom: 0;
}
.review-progress { font-size: 12.5px; color: var(--text-3); }
.review-progress b { color: var(--text); }

/* ---------- 发布 ---------- */
.platform-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.platform-tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  padding: 6px 11px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--text-2);
}
.platform-tab.active { border-color: var(--blue); background: var(--blue-light); color: var(--blue); font-weight: 600; }
.publish-item { padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.publish-item:last-child { border-bottom: 0; }
.publish-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.publish-abs {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 9px;
}
.publish-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.preview-platform {
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
}
.preview-platform .pp-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  background: #fafbfd;
}
.pp-platform { font-size: 11.5px; color: var(--text-3); margin-bottom: 4px; }
.pp-title { font-size: 18px; font-weight: 600; line-height: 1.45; }
.pp-summary {
  margin: 10px 16px 0;
  padding: 9px 11px;
  background: #f7f9fc;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.7;
}

/* ---------- 校验 / 报表 ---------- */
.chart-block { padding: 16px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-label { width: 96px; font-size: 12.5px; color: var(--text-2); flex: 0 0 auto; }
.bar-track { flex: 1; height: 18px; background: #f3f5f9; border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--blue); border-radius: 3px; }
.bar-fill.alt { background: #5b8fe0; }
.bar-fill.alt2 { background: #8fb2e8; }
.bar-val { width: 78px; text-align: right; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; flex: 0 0 auto; }

.day-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 150px;
  padding: 8px 4px 0;
}
.day-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.day-bar { width: 60%; max-width: 42px; background: var(--blue); border-radius: 2px 2px 0 0; min-height: 2px; }
.day-bar.zero { background: #dfe5ee; }
.day-val { font-size: 11.5px; color: var(--text-3); }
.day-name { font-size: 11.5px; color: var(--text-3); }

.kv-list { display: grid; grid-template-columns: 150px minmax(0, 1fr); font-size: 13px; }
.kv-list .k, .kv-list .v { padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
.kv-list .k { color: var(--text-3); background: #fbfcfe; }
.kv-list .v { color: var(--text); word-break: break-all; }
.kv-list .k:last-of-type, .kv-list .v:last-of-type { border-bottom: 0; }

.hash { font-family: Consolas, "Courier New", monospace; font-size: 12px; color: var(--text-2); }

/* ---------- 规则集布局（预留） ---------- */
.ruleset-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 14px; align-items: start; }
.ruleset-list { padding: 6px; }
.ruleset-item {
  padding: 10px 11px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
}
.ruleset-item:hover { background: #f7f9fc; }
.ruleset-item.active { background: var(--blue-light); border-color: var(--blue-border); }
.ruleset-item .name { font-size: 13.5px; color: var(--text); }
.ruleset-item .meta { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.ruleset-editor {
  width: 100%;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
  font-family: Consolas, "Courier New", "Microsoft YaHei", monospace;
  font-size: 12.5px;
  line-height: 1.8;
  resize: vertical;
  outline: none;
}
.ruleset-editor:focus { border-color: var(--blue); }

/* ---------- 模态 / 提示 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 38, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px;
  z-index: 100;
  overflow-y: auto;
}
.modal {
  background: #fff;
  border-radius: 6px;
  width: 720px;
  max-width: 100%;
  box-shadow: 0 8px 30px rgba(16, 24, 38, 0.18);
  animation: modalIn 0.16s ease-out;
}
.modal.wide { width: 960px; }
.modal.narrow { width: 520px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-body { padding: 18px; max-height: calc(100vh - 240px); overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #fcfdff;
  border-radius: 0 0 6px 6px;
}
.modal-close {
  border: 0; background: none; cursor: pointer; color: var(--text-3);
  width: 28px; height: 28px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: #f2f4f8; color: var(--text); }

#toast-root {
  position: fixed;
  top: 68px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 10px 14px;
  border-radius: 5px;
  background: #1f2b3a;
  color: #fff;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 6px 18px rgba(16, 24, 38, 0.22);
  animation: toastIn 0.18s ease-out;
}
.toast.ok { background: #1b6b4a; }
.toast.err { background: #a53434; }
.toast.info { background: #1f4e8f; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 小工具 */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-gap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.text-right { text-align: right; }
.divider { height: 1px; background: var(--line-2); margin: 12px 0; }
.scroll-y { overflow-y: auto; }
.code-inline {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  background: #f4f6fa;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
}
pre.code-block {
  background: #0f1c2e;
  color: #d7e2f0;
  border-radius: 5px;
  padding: 14px 16px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.75;
  overflow-x: auto;
  margin: 0;
  white-space: pre;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1500px) {
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .writing-layout { grid-template-columns: 170px 320px minmax(0, 1fr); }
  .review-layout { grid-template-columns: minmax(0, 1fr) 380px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 1080px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .18s; }
  .sidebar.open { transform: translateX(0); }
  .nav-toggle { display: inline-flex; }
  .writing-layout { grid-template-columns: 320px minmax(0, 1fr); }
  .writing-layout .panel-history { display: none; }
  .review-layout { grid-template-columns: 1fr; }
  .review-doc, .checklist { max-height: none; }
}
@media (max-width: 760px) {
  .view { padding: 12px; }
  .grid-6, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .writing-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .ruleset-layout { grid-template-columns: 1fr; }
}

/* ============================================================
   周报 · 电脑版
   ============================================================ */
.wr-toolbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.wr-kicker { font-size: 12px; color: var(--blue); letter-spacing: 1px; font-weight: 600; }
.wr-title { font-size: 22px; font-weight: 700; line-height: 1.3; margin: 2px 0; }
.wr-sub { font-size: 12px; color: var(--text-3); }
.wr-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.wr-hero {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: var(--white); border: 1px solid var(--line); border-radius: 8px;
  padding: 18px 22px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.wr-ring {
  --p: 0;
  width: 126px; height: 126px; border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(var(--blue) calc(var(--p) * 1%), #e8edf6 0);
  display: flex; align-items: center; justify-content: center;
}
.wr-ring > div {
  width: 96px; height: 96px; border-radius: 50%; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.wr-ring b { font-size: 26px; line-height: 1.1; color: var(--text); }
.wr-ring span { font-size: 11px; color: var(--text-3); }
.wr-ring.big { width: 150px; height: 150px; }
.wr-ring.big > div { width: 114px; height: 114px; }
.wr-ring.big b { font-size: 32px; }

.wr-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; flex: 1; min-width: 320px; }
.wr-kpi { border: 1px solid var(--line-2); border-radius: 7px; padding: 10px 13px; background: #fbfcfe; }
.wr-kpi .k { font-size: 12px; color: var(--text-3); }
.wr-kpi .v { font-size: 26px; font-weight: 800; line-height: 1.2; color: var(--text); }
.wr-kpi .f { font-size: 11px; color: var(--text-4); margin-top: 2px; }

.wr-h2 {
  font-size: 16px; font-weight: 700; line-height: 1.35;
  margin: 26px 0 12px; padding-left: 10px; border-left: 3px solid var(--blue);
}
.wr-hero + .wr-h2 { margin-top: 0; }

.wr-prod { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.wr-pcard {
  background: var(--white); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; box-shadow: var(--shadow); min-width: 0;
}
.wr-pcard .k { font-size: 12px; color: var(--text-3); }
.wr-pcard .v { font-size: 30px; font-weight: 800; line-height: 1.15; margin-top: 2px; }
.wr-pcard .v small { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 3px; }
.wr-pcard .rows { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 11px; color: var(--text-3); }
.wr-pcard .dual { display: flex; gap: 22px; margin-top: 2px; }
.wr-pcard .dual b { display: block; font-size: 24px; font-weight: 800; line-height: 1.2; }
.wr-pcard .dual span { font-size: 11px; color: var(--text-3); }

.wr-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.wr-2col.wr-gap { margin-top: 4px; }
.wr-2col > section { min-width: 0; }
.wr-panel {
  background: var(--white); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; overflow-x: auto;
}
.wr-phead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.wr-phead b { font-size: 13.5px; }
.wr-phead span { font-size: 11.5px; color: var(--text-3); }
.wr-note {
  margin-top: 10px; background: #f7f9fd; border: 1px dashed #d4dceb; border-radius: 6px;
  padding: 9px 12px; font-size: 11.5px; color: #4a5a72; line-height: 1.7;
}
.wr-empty { color: var(--text-3); font-size: 12.5px; padding: 16px 0; line-height: 1.8; }
.wr-more { font-size: 11.5px; color: var(--text-3); padding-top: 6px; }

.wr-concl { margin: 0; padding-left: 22px; }
.wr-concl li { margin-bottom: 9px; }
.wr-concl b { display: block; font-size: 13px; color: var(--text); }
.wr-concl span { font-size: 12.5px; color: var(--text-2); line-height: 1.7; }

.wr-trend { display: flex; gap: 8px; align-items: flex-end; height: 150px; padding: 8px 2px 0; }
.wr-day { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align: center; }
.wr-day .v { font-size: 10.5px; color: var(--text-3); height: 14px; }
.wr-day .bar {
  width: 60%; max-width: 38px; background: #e8edf6; border-radius: 3px 3px 0 0;
  display: flex; align-items: flex-end; overflow: hidden;
}
.wr-day .bar i { display: block; width: 100%; background: var(--blue); border-radius: 3px 3px 0 0; min-height: 2px; }
.wr-day .d { font-size: 9.5px; color: var(--text-4); margin-top: 4px; }

.wr-alert { border-left: 3px solid var(--amber); background: var(--amber-bg); border-radius: 4px; padding: 9px 12px; margin-bottom: 8px; }
.wr-alert.warn { border-color: var(--amber); background: var(--amber-bg); }
.wr-alert.danger { border-color: var(--red); background: var(--red-bg); }
.wr-alert .t { font-weight: 700; font-size: 12.5px; }
.wr-alert .d { font-size: 11.5px; color: var(--text-2); margin-top: 2px; line-height: 1.6; }

.wr-ans { border-bottom: 1px solid var(--line-2); padding: 11px 0; }
.wr-ans:last-child { border-bottom: 0; }
.wr-ans .q { font-size: 13px; font-weight: 600; line-height: 1.5; }
.wr-ans .m { font-size: 11px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 2px 0; }
.wr-ans .p { font-size: 12px; color: var(--text-2); line-height: 1.65; margin: 3px 0 6px; }
.wr-ans-meta { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.wr-ans-full {
  white-space: pre-wrap; font-size: 13px; line-height: 1.85; color: var(--text);
  background: #f7f9fc; border: 1px solid var(--line-2); border-radius: 6px;
  padding: 12px 14px; max-height: 50vh; overflow-y: auto;
}

.wr b.good, .wrm b.good { color: var(--green); }
.wr b.mid, .wrm b.mid { color: var(--amber); }
.wr b.low, .wrm b.low { color: var(--red); }

/* 竞品清单 */
.cmp-wrap { display: flex; flex-direction: column; gap: 10px; }
.cmp-form { display: flex; gap: 8px; flex-wrap: wrap; }
.cmp-form .input { flex: 1; min-width: 180px; }
.cmp-tip {
  font-size: 11.5px; color: var(--text-3); background: #f7f9fd;
  border: 1px dashed #d4dceb; border-radius: 5px; padding: 8px 10px; line-height: 1.6;
}
.cmp-ops { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cmp-ops .btn-xs { height: 28px; padding: 0 10px; }
.btn-xs { height: 28px; padding: 0 9px; font-size: 12px; }

/* ============================================================
   周报 · 手机版
   ============================================================ */
.wrm { max-width: 560px; margin: 0 auto; padding-bottom: 24px; }
.wrm .wr-toolbar { padding: 0 2px 12px; }
.wrm .wr-title { font-size: 20px; }
.wrm .wr-actions { width: 100%; }
.wrm .wr-actions .btn { flex: 1 1 auto; }

.wrm-cover {
  background: linear-gradient(160deg, #1b63d6, #1250b4);
  border-radius: 14px; padding: 22px 18px 18px; margin-bottom: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  box-shadow: 0 8px 22px rgba(21, 80, 176, 0.22);
}
.wrm-cover .wr-ring { background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, 0.22) 0); }
.wrm-cover .wr-ring > div { background: #1b63d6; }
.wrm-cover .wr-ring b { color: #fff; }
.wrm-cover .wr-ring span { color: rgba(255, 255, 255, 0.75); }
.wrm-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.wrm-chips .chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: auto; padding: 8px 4px; background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 8px;
  color: #fff; white-space: normal;
}
.wrm-chips .chip b { font-size: 20px; font-weight: 800; line-height: 1.2; }
.wrm-chips .chip span { font-size: 10.5px; color: rgba(255, 255, 255, 0.78); }

.wrm-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow);
  overflow-x: auto;
}
.wrm-card h3 {
  font-size: 14.5px; font-weight: 700; line-height: 1.35;
  margin: 0 0 10px; padding-left: 9px; border-left: 3px solid var(--blue);
}
.wrm-card .wr-prod { grid-template-columns: 1fr 1fr; }
.wrm-card .wr-2col { grid-template-columns: 1fr; }
.wrm-card .wr-panel { border: 0; box-shadow: none; padding: 0; overflow: visible; }
.wrm-card .wr-panel + .wr-panel { margin-top: 12px; }
.wrm-card .table th, .wrm-card .table td { padding: 8px 7px; font-size: 12px; }
.wrm-card .wr-trend { height: 130px; }
.wrm-card .wr-note { margin-top: 10px; }

@media (max-width: 1280px) {
  .wr-prod { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .wr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wr-2col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .wrm-card .wr-prod { grid-template-columns: 1fr 1fr; }
}

@media print {
  .sidebar, .topbar, #toast-root, .wr-actions { display: none !important; }
  .app-shell { display: block; }
  .view { padding: 0; }
  body { background: #fff; }
  .wr-panel, .wr-pcard, .wr-hero { box-shadow: none; }
}
