/* 市场地位分析 · 方案 A：NASA 图形标准 + 检测报告
   白底黑字、粗黑分隔线、只用一个红色（品牌、主按钮、正在进行的那一步）；
   判定用双线印章（可做 / 需调整 / 风险），证据用编号（E3）一路追到出处。 */
:root {
  --ink: #0b0b0c;
  --ink-2: #3a3f45;
  --muted: #545a61;
  --line: #d9dce0;
  --line-2: #e6e8eb;
  --soft: #f3f4f6;
  --red: #e03a2f;
  --red-dark: #b8291f;
  --ok: #0e6b47;
  --adj: #9a4f00;
  --risk: #b3141e;
  --num: 'Bahnschrift', 'DIN Alternate', 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  --sans: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', 'Segoe UI', sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--red); color: #fff; }
input, textarea { caret-color: var(--red); }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }

/* —— 顶栏 —— */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 0 64px; min-height: 72px; border-bottom: 2px solid var(--ink); background: #fff; }
.topbar.dark { background: var(--ink); color: #fff; }
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; }
.brand-mark { font-family: var(--num); font-weight: 700; font-size: 26px; color: var(--red); letter-spacing: -0.01em; }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-portal { font-size: 12px; padding: 0 8px; border: 1px solid currentColor; }
.topnav { display: flex; flex-wrap: wrap; gap: 4px; }
.topnav a { display: flex; align-items: center; min-height: 44px; padding: 0 16px; color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--ink); }
.topnav a.active { color: var(--ink); font-weight: 700; box-shadow: inset 0 -3px 0 var(--red); }
.dark .topnav a { color: #c4c8cd; }
.dark .topnav a:hover, .dark .topnav a.active { color: #fff; }
.who { display: flex; align-items: center; gap: 16px; color: var(--muted); }
.dark .who { color: #c4c8cd; }
.who .btn.link { color: inherit; font-weight: 400; }
.who .btn.link:hover { color: var(--red); }

/* —— 页面 —— */
.page { padding: 48px 64px 80px; width: 100%; max-width: 1440px; margin: 0 auto; display: flex; flex-direction: column; gap: 40px; }
.page > * { margin: 0; }
h1 { font-size: 40px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; margin: 0; }
h2 { font-size: 18px; font-weight: 700; margin: 0; }
.lead { color: var(--muted); margin: 8px 0 0; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.back { align-self: flex-start; font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: -24px; }
.meta { font-size: 12px; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.warn-text { color: var(--adj); }
.empty { padding: 48px 0; color: var(--muted); }
.split { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.split > .grow { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 40px; }
.split > .side { flex: 1 1 300px; min-width: 0; }

/* 分区：上方一条粗黑线 */
.sec, .card { border-top: 2px solid var(--ink); padding-top: 16px; }
.card { padding-bottom: 8px; margin-bottom: 8px; }
.sec-head, .card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; margin-bottom: 16px; }
.card-head h2 { font-size: 18px; }
.sub { font-weight: 700; color: var(--ink-2); margin: 16px 0 8px; font-size: 13px; }

/* —— 按钮 —— */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); font-weight: 700; cursor: pointer; text-decoration: none; border-radius: 0; }
.btn:hover { background: var(--soft); color: var(--ink); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #2a2d31; color: #fff; }
.btn.danger { border-color: var(--risk); color: var(--risk); }
.btn.link, .btn.danger-link { min-height: 0; padding: 0; border: 0; background: none; text-decoration: underline; text-underline-offset: 4px; }
.btn.link:hover { color: var(--red); background: none; }
.btn.danger-link { color: var(--risk); font-weight: 400; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.big { min-height: 52px; font-size: 16px; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* —— 表单 —— */
.field { display: grid; grid-template-columns: 160px 1fr; gap: 6px 24px; align-items: start; margin-bottom: 16px; }
.field > label { padding-top: 10px; font-size: 13px; color: var(--ink-2); }
.input, select.input { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid #9aa0a6; border-radius: 0; background: #fff; }
textarea.input { resize: vertical; line-height: 1.7; }
.input:focus { outline: 0; border-color: var(--ink); box-shadow: inset 0 -2px 0 var(--red); }
.input:disabled { background: var(--soft); color: var(--muted); }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.radio-row label { display: inline-flex; gap: 10px; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--ink); cursor: pointer; }
.radio-row label:has(input:checked) { background: var(--ink); color: #fff; font-weight: 700; }
input[type='checkbox'], input[type='radio'] { accent-color: var(--red); width: 16px; height: 16px; }
.import-card { border: 1px solid var(--ink); border-top: 2px solid var(--ink); padding: 16px 20px; }
.dir-group { margin-bottom: 12px; }
.other-input { max-width: 360px; margin-top: 6px; }
.claim-row { border: 1px solid var(--line); padding: 14px 16px; margin-bottom: 12px; }
.claim-row-head { display: grid; grid-template-columns: 28px 1fr 120px auto auto auto; gap: 8px; align-items: center; }
.claim-no { font-family: var(--num); font-weight: 700; }
.scope-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.data-row { display: grid; grid-template-columns: 2fr 2fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.upload-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.file-list, .plain-list { margin: 6px 0 0; padding-left: 18px; }
.file-list { list-style: none; padding: 0; }
.file-list li, .plain-list li { padding: 4px 0; }

/* —— 标签、提示 —— */
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 0 8px; border: 1px solid var(--ink); color: var(--ink); font-weight: 700; white-space: nowrap; }
.tag.muted { border-color: var(--line); color: var(--muted); font-weight: 400; }
.tag.warn { border-color: var(--adj); color: var(--adj); }
.tag.danger { border-color: var(--risk); color: var(--risk); }
.tag.info { border-color: var(--ink-2); color: var(--ink-2); font-weight: 400; }
.msg { padding: 10px 14px; font-size: 13px; border: 1px solid; }
.msg.ok { border-color: var(--ok); color: var(--ok); }
.msg.err { border-color: var(--risk); color: var(--risk); }
.msg.warn { border-color: var(--adj); color: var(--adj); }
.code { font-family: var(--num); background: var(--soft); padding: 2px 6px; word-break: break-all; }

/* 双线印章 */
.stamp { display: inline-flex; align-items: center; padding: 1px 8px; border: 1.5px solid currentColor; outline: 1px solid currentColor; outline-offset: 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; white-space: nowrap; margin: 3px; }
.stamp.big { font-size: 15px; padding: 3px 12px; border-width: 2px; outline-offset: 3px; letter-spacing: 0.12em; }
.stamp.ok { color: var(--ok); }
.stamp.adjust { color: var(--adj); }
.stamp.risk { color: var(--risk); }
.stamps { display: flex; flex-wrap: wrap; gap: 6px; }

/* 状态文字 */
.state { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.state.run { color: var(--red); }
.state.wait { color: var(--ink-2); }
.state.fail { color: var(--risk); }
.state.done { color: var(--ok); }
.state i { width: 8px; height: 8px; background: currentColor; }
.state.wait i { background: none; border: 2px solid currentColor; }
.state.run i { animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

/* —— 表格 —— */
.table-wrap { overflow-x: auto; }
table.grid, table.list { width: 100%; border-collapse: collapse; }
table.grid th, table.list th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--ink); white-space: nowrap; }
table.grid td, table.list td { padding: 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid th:first-child, table.grid td:first-child, table.list th:first-child, table.list td:first-child { padding-left: 0; }
table.grid th:last-child, table.grid td:last-child { padding-right: 0; }
table.grid .r { text-align: right; }
table.grid tr.clickable { cursor: pointer; }
table.grid tr.clickable:hover td { background: #fafafb; }
.co { font-weight: 700; }
.no { font-family: var(--num); font-weight: 600; font-size: 15px; white-space: nowrap; }

/* —— 进行中：大数字 + 五段进度 —— */
.live { display: grid; grid-template-columns: 220px repeat(auto-fit, minmax(300px, 1fr)); }
.live > h2 { padding: 4px 24px 20px 0; }
.live-item { padding: 4px 24px 20px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.big-num { display: flex; align-items: baseline; gap: 10px; }
.big-num b { font-family: var(--num); font-size: 56px; font-weight: 600; line-height: 1; }
.big-num.run b, .big-num.run .unit { color: var(--red); }
.big-num .unit { font-family: var(--num); font-size: 20px; font-weight: 600; margin-left: -6px; }
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.steps span { height: 6px; background: var(--line-2); }
.steps span.done { background: var(--ink); }
.steps span.now { background: var(--red); }
.steps span.wait { background: repeating-linear-gradient(90deg, var(--ink) 0 4px, #fff 4px 7px); }
.step-names { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; font-size: 12px; color: var(--muted); }
.step-names .now { color: var(--ink); font-weight: 700; }

/* —— 搜索 —— */
.search { display: flex; align-items: center; gap: 8px; min-height: 40px; border-bottom: 1px solid var(--ink); flex: 0 1 280px; }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; background: transparent; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.filters label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.filters select { min-height: 40px; padding: 0 10px; border: 1px solid var(--ink); background: #fff; border-radius: 0; }

/* —— 报告 —— */
.cover { display: flex; flex-wrap: wrap; gap: 24px 32px; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid var(--ink); padding-bottom: 28px; }
.cover .kicker { font-size: 14px; color: var(--muted); }
.cover h1 { font-size: 44px; margin: 4px 0 20px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px 24px; margin: 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-family: var(--num); font-size: 18px; font-weight: 600; }
.facts dd.txt { font-family: var(--sans); font-size: 16px; font-weight: 700; }
.tally { display: flex; gap: 20px; font-size: 13px; }
.tally b { font-family: var(--num); font-size: 18px; }
.tally .ok { color: var(--ok); } .tally .adjust { color: var(--adj); } .tally .risk { color: var(--risk); }
.claim-art { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 2fr); gap: 16px 32px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.claim-art .label { font-size: 12px; color: var(--muted); }
.claim-art .claim-text { font-size: 20px; font-weight: 700; line-height: 1.35; margin: 2px 0 10px; }
.claim-art .body { display: flex; flex-direction: column; gap: 12px; }
.claim-art p { margin: 0; }
.alt-table { display: grid; grid-template-columns: 1fr auto; border-top: 1px solid var(--ink); }
.alt-table > * { padding: 10px 0; border-bottom: 1px solid var(--line); }
.alt-table .t { font-weight: 700; }
.alt-table .v { font-size: 13px; font-weight: 700; text-align: right; padding-left: 16px; }
.alt-table .v.ok { color: var(--ok); } .alt-table .v.adjust { color: var(--adj); } .alt-table .v.risk { color: var(--risk); }
.alt-table .orig { color: var(--muted); text-decoration: line-through; font-weight: 400; }
.cite { font-family: var(--num); font-weight: 600; font-size: 13px; padding: 0 3px; border: 0; background: none; cursor: pointer; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.cite:hover, .cite.on { color: var(--red); text-decoration-color: var(--red); }
.cite.bad { color: var(--risk); text-decoration: line-through; }
.headline { font-size: 32px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.prose { max-width: 72ch; margin: 0; }
.trends { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 32px; }
.trends li { border-top: 1px solid var(--ink); padding: 14px 0; }
.trends p { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.ev-list { margin: 0; padding: 0; list-style: none; }
.ev-list li { display: grid; grid-template-columns: 40px 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.ev-list li .id { font-family: var(--num); font-weight: 600; }
.ev-list li.on { outline: 2px solid var(--red); outline-offset: -2px; padding-left: 10px; padding-right: 10px; margin: 0 -10px; }
.ev-list li.on .id { color: var(--red); }
.kv { margin: 0; }
.kv > div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; white-space: pre-wrap; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.history .note { color: var(--ink-2); }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
details.fold > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 56px; border-bottom: 1px solid var(--line); font-weight: 700; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: '+'; font-family: var(--num); font-size: 20px; color: var(--muted); }
details.fold[open] > summary::after { content: '−'; }
details.fold > .fold-body { padding: 16px 0 8px; display: flex; flex-direction: column; gap: 12px; }
.para-title { font-weight: 700; }
.mobile-bar { display: none; }

/* —— 主管端：团队统计条 —— */
.ratio { display: flex; height: 8px; width: 240px; max-width: 100%; background: var(--line-2); }
.ratio .ok { background: var(--ok); } .ratio .adjust { background: #c27a1a; } .ratio .risk { background: var(--risk); }
.legend { display: flex; gap: 20px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }

/* —— 管理后台 —— */
.status-line { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ok); }
.status-line i { width: 8px; height: 8px; background: currentColor; }
.status-line.bad { color: var(--risk); }

/* —— 登录 —— */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 380px; border-top: 2px solid var(--ink); padding: 28px 0; display: flex; flex-direction: column; gap: 12px; }
.login .brand { margin-bottom: 12px; }
.login h1 { font-size: 28px; }
.login .lead { margin: 0 0 8px; }
.login .btn { width: 100%; min-height: 48px; }

/* —— 手机 —— */
@media (max-width: 760px) {
  .topbar { padding: 8px 16px; min-height: 56px; }
  .brand-mark { font-size: 22px; }
  .topnav { order: 3; width: 100%; margin: 0 -16px; padding: 0 8px; overflow-x: auto; flex-wrap: nowrap; }
  .who { font-size: 13px; gap: 12px; }
  .page { padding: 24px 16px 96px; gap: 28px; }
  h1 { font-size: 28px; }
  .cover h1 { font-size: 26px; margin-bottom: 12px; }
  .back { margin-bottom: -12px; }
  .field { grid-template-columns: 1fr; gap: 4px; }
  .field > label { padding-top: 0; }
  .live { grid-template-columns: 1fr; }
  .live > h2 { padding: 0 0 8px; }
  .live-item { border-left: 0; border-top: 1px solid var(--line); padding: 14px 0; }
  .big-num b { font-size: 44px; }
  .claim-art { grid-template-columns: 1fr; padding: 16px 0; }
  .claim-art .claim-text { font-size: 17px; }
  .headline { font-size: 24px; }
  .scope-grid, .data-row { grid-template-columns: 1fr; }
  .claim-row-head { grid-template-columns: 28px 1fr 110px; }
  .kv > div, .history li { grid-template-columns: 1fr; gap: 2px; }
  .hide-sm { display: none; }
  .cover .dl { display: none; }
  .mobile-bar { display: block; position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px 16px; background: #fff; border-top: 2px solid var(--ink); z-index: 10; }
  .mobile-bar .btn { width: 100%; min-height: 50px; }
  /* 手机上表格变成一行一张 */
  table.grid.stack thead { display: none; }
  table.grid.stack, table.grid.stack tbody, table.grid.stack tr, table.grid.stack td { display: block; }
  table.grid.stack tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  table.grid.stack td { padding: 2px 0; border: 0; }
  table.grid.stack td.r { text-align: left; }
}

/* 标题紧跟说明文字时不要拉开太远 */
.page > h1 + .lead { margin-top: -32px; }
.dark .brand, .dark .brand:hover { color: #fff; }
@media (max-width: 760px) {
  .page > h1 + .lead { margin-top: -20px; }
}

/* 证据清单：固定在右侧、框内滚动，不把页面拉长；默认只显示标题和出处，点开看摘录 */
.ev-panel { position: sticky; top: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 10px; }
.ev-panel .ev-list { position: relative; overflow-y: auto; flex: 1 1 auto; min-height: 0; padding-right: 6px; border-bottom: 1px solid var(--ink); scrollbar-width: thin; scrollbar-color: #9aa0a6 transparent; }
.ev-panel .ev-list li { cursor: pointer; padding: 10px 0; font-size: 13px; line-height: 1.55; }
.ev-panel .ev-list li:hover .ev-title { color: var(--red); }
.ev-panel .ev-list li.on { padding-left: 10px; padding-right: 10px; margin: 0; }
.ev-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ev-list li.on .ev-title { display: block; }
.ev-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.ev-tabs button { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); background: #fff; font-size: 12px; cursor: pointer; }
.ev-tabs button.on { border-color: var(--ink); background: var(--ink); color: #fff; font-weight: 700; }
@media (max-width: 760px) {
  .ev-panel { position: static; max-height: none; }
  .ev-panel .ev-list { max-height: 60vh; }
}

/* 表格：右对齐的数字、日期不换行；过长的论点只显示两行 */
table.grid td.r, table.grid th.r { white-space: nowrap; }
table.grid .date { white-space: nowrap; font-family: var(--num); color: var(--muted); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 46ch; }

/* 操作结果提示：固定在底部 */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 12px; background: #fff; padding: 4px 12px 4px 4px; box-shadow: 0 6px 24px -6px rgba(11, 11, 12, 0.35); max-width: calc(100vw - 32px); }
.toast .msg { border: 0; }
.toast .btn.link { text-decoration: none; font-size: 18px; color: var(--muted); }

/* 设置页左侧分类 */
.side-menu { flex: 0 1 240px; min-width: 200px; display: flex; flex-direction: column; border-top: 2px solid var(--ink); }
.side-menu a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-bottom: 1px solid var(--line); text-decoration: none; }
.side-menu a:hover { background: var(--soft); color: var(--ink); }
.side-menu a.on { box-shadow: inset 3px 0 0 var(--red); background: var(--soft); }
.settings-body > .card:first-child { margin-top: 0; }
/* 团队总览：团队切换条 */
.team-bar { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
@media (max-width: 760px) {
  .side-menu { flex-basis: 100%; }
}
