/* v2 styles — extends app.css. Loaded after it. */

/* page header (used by parse/format/checklist/history) */
.page-head { margin: 0 0 var(--s-6); }
.page-head__title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 6px 0 6px;
}
.page-head__sub { color: var(--ink-3); font-size: 14px; margin: 0; max-width: 560px; }
.page-intro {
  color: var(--ink-2);
  font-size: 14px;
  margin: 0 0 var(--s-5);
  max-width: 760px;
}

/* ============================================================
   Job shell — head + sub-nav tabs (shared by 4 sub-views)
   ============================================================ */
.jobshell { display: block; }
.js-head {
  display: flex; flex-direction: column; gap: 6px;
  padding: 0 0 var(--s-4);
}
.js-head__row {
  display: flex; align-items: center; gap: var(--s-3);
  flex-wrap: wrap;
}
.js-back { margin-left: -10px; }
.js-head__actions { margin-left: auto; display: flex; gap: 8px; }
.js-head__title {
  font-size: 24px;
  font-weight: 600;
  margin: 6px 0 0;
  letter-spacing: -.005em;
  text-wrap: pretty;
}
.js-head__meta {
  display: flex; gap: var(--s-3); flex-wrap: wrap;
  color: var(--ink-3); font-size: 13px;
}
.js-head__meta .sep { color: var(--ink-4); }

.js-tabs {
  position: sticky;
  top: var(--topbar-h);
  z-index: 18;
  background: var(--bg);
  margin: 0 calc(var(--s-5) * -1) var(--s-5);
  padding: 0 var(--s-5);
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
}
.js-tab {
  display: inline-block;
  padding: 14px 18px 13px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.js-tab:hover { color: var(--ink); }
.js-tab.is-active {
  color: var(--accent-ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.jobshell__body { padding: 0; }

.btn--danger {
  background: var(--err);
  border-color: var(--err);
  color: #fff;
}
.btn--danger:hover { background: #6a1212; border-color: #6a1212; }
.btn--danger-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--err);
}
.btn--danger-ghost:hover { background: var(--err-soft); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 18, 12, .42);
  z-index: 90;
  display: flex; align-items: center; justify-content: center;
  animation: fadein .15s var(--ease);
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  width: min(440px, calc(100vw - 32px));
  padding: var(--s-5) var(--s-5) var(--s-4);
  box-shadow: 0 24px 64px rgba(0,0,0,.18);
}
.modal__title { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.modal__body { margin: 0 0 var(--s-4); color: var(--ink-2); font-size: 13px; line-height: 1.7; }
.modal__actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Chapter flash (deep-link target) */
.chapter-flash { animation: chapterFlash .9s var(--ease); }
@keyframes chapterFlash {
  0%   { background: var(--accent-soft); box-shadow: 0 0 0 6px var(--accent-soft); }
  100% { background: transparent; box-shadow: 0 0 0 0 transparent; }
}

/* ============================================================
   PAGE: 招标文件解析 / Parse
   ============================================================ */
.cardgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
.cardgrid > .pcard--wide { grid-column: span 2; }
@media (max-width: 900px) {
  .cardgrid { grid-template-columns: 1fr; }
  .cardgrid > .pcard--wide { grid-column: span 1; }
}

.pcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
}
.pcard__head {
  display: flex; align-items: baseline; gap: 12px;
  padding: 14px var(--s-5) 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.pcard__num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-4);
  font-weight: 600;
}
.pcard__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
}
.pcard__body { padding: var(--s-4) var(--s-5); }
.pcard__empty {
  padding: var(--s-6) var(--s-4);
  text-align: center;
  color: var(--ink-3);
}
.pcard__empty-icon { color: var(--ink-4); display: inline-flex; margin-bottom: 8px; }
.pcard__empty-title { font-weight: 500; color: var(--ink-2); margin-bottom: 4px; }
.pcard__empty-sub { font-size: 12px; color: var(--ink-3); max-width: 360px; margin: 0 auto; }

.basic-infer-note {
  margin: 0 0 var(--s-3);
  padding: 7px 10px;
  font-size: 12px; line-height: 1.5;
  color: #6b5616;
  background: #fbf6e7;
  border: 1px solid #ecdfb6;
  border-radius: var(--r-1);
}
.infer-chip {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px; letter-spacing: .04em;
  padding: 1px 6px;
  vertical-align: middle;
  color: #6b5616; background: #f4e7d6;
  border-radius: 999px;
}

.deflist { margin: 0; }
.deflist dt {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  margin-top: var(--s-3);
}
.deflist dt:first-child { margin-top: 0; }
.deflist dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.qual-list { list-style: none; margin: 0; padding: 0; }
.qual-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: var(--s-3);
  padding: 10px 0;
  align-items: start;
  border-bottom: 1px dashed var(--line);
}
.qual-item:last-child { border-bottom: 0; }
.qual-cat {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; padding: 3px 8px;
  border-radius: var(--r-1);
  background: var(--bg-soft);
  color: var(--ink-2);
  font-weight: 500;
  height: fit-content;
  letter-spacing: .04em;
}
.qual-cat--legal { background: #ebe9e3; color: #463f30; }
.qual-cat--fin   { background: #e8f0e6; color: #2f4d2a; }
.qual-cat--tech  { background: var(--accent-soft); color: var(--accent-ink); }
.qual-cat--perf  { background: #f4e7d6; color: #5b3f12; }
.qual-cat--rep   { background: #e6eef4; color: #234255; }
.qual-cat--gen   { background: var(--bg-soft); color: var(--ink-2); }
.qual-text { color: var(--ink); font-size: 13.5px; line-height: 1.6; }

.eval-method {
  display: flex; align-items: baseline; gap: 12px;
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
}
.eval-method-name { font-weight: 600; color: var(--ink); }

.eval-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.eval-table th, .eval-table td {
  text-align: left;
  padding: 10px 8px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.eval-table th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-3); font-weight: 600;
  background: var(--surface-2);
}
.eval-table .num { text-align: right; width: 110px; font-variant-numeric: tabular-nums; }
.eval-name { font-weight: 500; color: var(--ink); width: 130px; }
.eval-scoring { color: var(--ink-2); }
.weight-bar {
  display: flex; align-items: center; justify-content: flex-end;
  position: relative;
}
.weight-num {
  position: relative; z-index: 1;
  font-weight: 600;
  color: var(--ink);
}
.weight-num::after { content: ' %'; color: var(--ink-4); font-weight: 400; }
.weight-fill {
  position: absolute; right: 0; top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin-right: 36px;
  max-width: 100px;
  opacity: .55;
}
.eval-subhead {
  margin: var(--s-4) 0 var(--s-2);
  font-size: 12px; font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .02em;
}
.eval-total-row td {
  font-weight: 600; color: var(--ink);
  border-top: 2px solid var(--line);
}
.eval-total-note {
  font-weight: 400; font-size: 12px;
  color: var(--warn, #b7791f);
}
.eval-table--passfail .eval-name { width: auto; }

.supp-list { list-style: none; margin: 0; padding: 0; }
.supp-item {
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line);
}
.supp-item:last-child { border-bottom: 0; }
.supp-head { display: flex; gap: var(--s-3); align-items: baseline; margin-bottom: 6px; }
.supp-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: var(--r-1);
}
.supp-title { font-weight: 600; color: var(--ink); }
.supp-body { color: var(--ink-2); font-size: 13.5px; line-height: 1.7; }

/* ============================================================
   PAGE: 投标文件格式 / Format — outline tree
   ============================================================ */
.src-note {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 14px;
  background: var(--accent-soft);
  border-radius: var(--r-2);
  font-size: 13px;
  color: var(--accent-ink);
  margin-bottom: var(--s-4);
}
.src-note__icon { color: var(--accent); display: inline-flex; }

.fmt-legend {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  margin-bottom: var(--s-4);
  font-size: 12px;
}
.fmt-legend .eyebrow { margin-right: 8px; }
.fmt-legend__sep { width: 1px; height: 14px; background: var(--line); }

.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; padding: 2px 8px;
  border-radius: var(--r-1);
  font-weight: 500;
  letter-spacing: .04em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--bind   { background: #e6e3da; color: #4a3f24; }
.badge--anon   { background: #2a2d33; color: #fff; }
.badge--page   { background: var(--accent-soft); color: var(--accent-ink); }
.badge--attach { background: #f7e3d0; color: #5b3a12; }
.badge--gen    { background: var(--bg-soft); color: var(--ink-2); }

.fmt {
  display: flex; flex-direction: column; gap: var(--s-4);
}
.fmt > * { width: 100%; }
.fmt-tree {
  background: var(--surface);
  border: 1px solid var(--line);
  width: 100%;
  border-radius: var(--r-3);
  padding: 8px 0;
}
.fnode { position: relative; }
.fnode--root + .fnode--root { border-top: 1px solid var(--line); }
.fnode__row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px var(--s-5);
  width: 100%; box-sizing: border-box;
  position: relative;
}
.fnode--root > .fnode__row { padding-top: 14px; padding-bottom: 12px; }
.fnode__indent {
  display: flex; flex: 0 0 auto;
}
.fnode__rail {
  width: 22px;
  border-left: 1px dashed var(--line);
  margin-right: 0;
  align-self: stretch;
}
.fnode[data-depth="0"] .fnode__indent { display: none; }

.fnode__chev {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  border-radius: var(--r-1);
  transition: transform .15s var(--ease), background .15s var(--ease);
  margin-top: 2px;
  flex: 0 0 auto;
}
.fnode__chev:hover { background: var(--bg-soft); color: var(--ink); }
.fnode__chev.is-open { transform: rotate(90deg); }
.fnode__leaf-dot {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  margin-top: 2px;
}
.fnode__leaf-dot::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ink-4);
}

.fnode__main {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.fnode__row.is-leaf .fnode__main {
  flex-direction: row; align-items: center; gap: var(--s-4); flex-wrap: wrap;
}
.fnode__row.is-leaf .fnode__title-row { flex: 1 1 320px; min-width: 0; }
.fnode__row.is-leaf .fnode__leaf-meta { margin-left: auto; flex: 0 0 auto; }
.fnode__title-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.fnode__title {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}
.fnode--root > .fnode__row .fnode__title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.005em;
}
.fnode__desc {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 4px;
  line-height: 1.65;
  max-width: 800px;
}
.fnode__leaf-meta {
  display: flex; align-items: center; gap: var(--s-3);
  margin-top: 0;
  white-space: nowrap;
}
.fnode__jump {
  font-size: 12px;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 4px;
  transition: color .12s var(--ease);
}
.fnode__jump:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }

.fnode[data-expanded="false"] > .fnode__kids { display: none; }
.fnode__kids { padding-left: 0; }

.cov {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--r-1);
}
.cov__mark { font-weight: 700; }
.cov--ok      { background: var(--ok-soft);   color: var(--ok); }
.cov--miss    { background: var(--err-soft);  color: var(--err); }
.cov--partial { background: var(--warn-soft); color: var(--warn); }

/* ============================================================
   PAGE: 投标文件审查 / Checklist
   ============================================================ */
.chk-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  margin-bottom: var(--s-4);
  font-size: 14px;
}
.chk-summary__total { font-weight: 600; color: var(--ink); }
.chk-summary__sep   { color: var(--ink-4); }
.chk-summary__pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: var(--r-1);
  font-weight: 500;
}
.chk-summary__mark { font-weight: 700; }
.chk-summary__pill--ok      { background: var(--ok-soft); color: var(--ok); }
.chk-summary__pill--partial { background: var(--warn-soft); color: var(--warn); }
.chk-summary__pill--miss    { background: var(--err-soft); color: var(--err); }

.chk-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3) var(--s-5);
  padding: var(--s-4) var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  margin-bottom: var(--s-4);
}
@media (max-width: 760px) {
  .chk-filters { grid-template-columns: 1fr; }
}
.chk-filter {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}
.chk-filter__label {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
  flex: 0 0 60px;
}
.chk-seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: 2px;
  background: var(--bg-soft);
  flex-wrap: wrap;
  flex: 1 1 auto;
}
.chk-seg__btn {
  flex: 0 1 auto;
  border: 0;
  background: transparent;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 3px;
  cursor: pointer;
  color: var(--ink-3);
  white-space: nowrap;
}
.chk-seg__btn.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.chk-search-wrap { flex: 1 1 auto; }
.chk-search {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  background: var(--surface);
  color: var(--ink);
}
.chk-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.chk-list { display: flex; flex-direction: column; gap: 8px; }
.chk-item {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  transition: border-color .15s var(--ease);
}
.chk-item:hover { border-color: var(--line-strong); }
.chk-item__bar { background: var(--ink-4); }
.chk-item--covered   .chk-item__bar { background: var(--ok); }
.chk-item--partial   .chk-item__bar { background: var(--warn); }
.chk-item--uncovered .chk-item__bar { background: var(--err); }

.chk-item__main { padding: 12px var(--s-4); min-width: 0; }
.chk-item__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.chk-item__req {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .04em;
}
.chk-item__q {
  font-size: 14.5px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.5;
  text-wrap: pretty;
}
.chk-item__ev {
  font-size: 12.5px;
  color: var(--ink-3);
  font-style: italic;
  margin-top: 6px;
}

.chk-item__right {
  display: flex; flex-direction: column; align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 12px var(--s-4) 12px 0;
  white-space: nowrap;
}
.chk-item__jump {
  font-size: 12px;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 4px;
}
.chk-item__jump:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }

.prio { font-weight: 500; padding: 2px 7px; border-radius: var(--r-1); border: 0; font-size: 11px; }
.prio--critical      { background: #fbe1de; color: #7a1313; }
.prio--standard      { background: var(--bg-soft); color: var(--ink-2); }
.prio--informational { background: #ecf0f5; color: #4a5b78; }

.cat { font-weight: 500; padding: 2px 7px; border-radius: var(--r-1); border: 0; font-size: 11px; background: var(--bg-soft); color: var(--ink-2); }
.cat--qual { background: #f4e7d6; color: #5b3f12; }
.cat--tech { background: var(--accent-soft); color: var(--accent-ink); }
.cat--biz  { background: #ecf0f5; color: #284067; }
.cat--svc  { background: #e8f0e6; color: #2f4d2a; }
.cat--team { background: #efe3f0; color: #4a2a55; }
.cat--perf { background: #f7e3d0; color: #5b3a12; }

@media (max-width: 700px) {
  .chk-item { grid-template-columns: 4px 1fr; }
  .chk-item__right {
    flex-direction: row; align-items: center; justify-content: flex-start;
    padding: 0 var(--s-4) 12px var(--s-4);
    grid-column: 2;
    flex-wrap: wrap;
  }
}

/* ============================================================
   PAGE: 历史 / History
   ============================================================ */
.h-filters {
  display: flex; gap: var(--s-3); align-items: center;
  margin-bottom: var(--s-4);
  flex-wrap: wrap;
}
.h-filters__search {
  position: relative;
  flex: 1 1 320px;
  min-width: 240px;
}
.h-search {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  padding: 9px 12px 9px 36px;
  font: inherit;
  font-size: 13px;
  background: var(--surface);
  color: var(--ink);
}
.h-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.h-search__icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-4);
  pointer-events: none;
  display: inline-flex;
}
.h-seg button { padding: 7px 14px; }

.h-table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
}
.h-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.h-table th {
  text-align: left;
  padding: 12px var(--s-4);
  background: var(--surface-2);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.h-table td {
  padding: 14px var(--s-4);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.h-table tr:last-child td { border-bottom: 0; }
.h-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.h-th-name { width: 44%; }
.h-th-act  { width: 1%; white-space: nowrap; text-align: right; }
.h-row { cursor: pointer; }
.h-row:hover td { background: var(--surface-2); }

.h-name__file {
  color: var(--ink-4);
  display: inline-flex;
  vertical-align: middle;
  margin-right: 10px;
}
.h-name__text {
  color: var(--ink);
  font-weight: 500;
  display: inline;
  vertical-align: middle;
}
.h-time__abs {
  display: block;
  font-size: 11px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.h-time { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.h-actions { text-align: right; white-space: nowrap; }
.h-actions .btn + .btn { margin-left: 4px; }
.h-del { color: var(--err); }
.h-del:hover { background: var(--err-soft); }

.h-pager {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: var(--s-4);
  padding: 0 4px;
}
.h-pager__count { font-size: 12px; color: var(--ink-3); }
.h-pager__btns { display: flex; gap: 8px; }

@media (max-width: 760px) {
  .h-table thead { display: none; }
  .h-table, .h-table tbody, .h-table tr, .h-table td { display: block; width: 100%; }
  .h-table tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .h-table tr:last-child { border-bottom: 0; }
  .h-table td { border-bottom: 0; padding: 4px var(--s-4); }
  .h-actions { padding-top: 8px; justify-content: flex-start; }
}
