:root {
  --ink: #0d1b2a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f4f6f8;
  --card: #ffffff;
  --navy: #0e2a47;
  --teal: #0f766e;
  --teal-soft: #e6f4f1;
  --amber: #b45309;
  --red: #b91c1c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(13, 27, 42, .04), 0 8px 24px rgba(13, 27, 42, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

.topbar {
  background: var(--navy);
  color: #fff;
  height: 58px;
  display: flex;
  align-items: center;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .3px; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px; background: #fff; color: var(--navy);
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.brand .sub { font-weight: 400; opacity: .62; font-size: 12.5px; letter-spacing: .5px; }
.topbar .who { font-size: 12.5px; opacity: .7; display: flex; align-items: center; gap: 14px; }
.topbar .who b { font-weight: 600; opacity: .95; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.main { padding: 26px 0 64px; }

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.2px; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 14.5px; }

.sub { color: var(--muted); font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card-head .sub { font-size: 12.5px; }

.grid-2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 13.5px; font-weight: 550; cursor: pointer;
  transition: .15s ease; font-family: inherit;
}
.btn:hover { border-color: #cbd5e1; background: #fafbfc; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: #0b5f59; }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.dark:hover { background: #123a5f; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
input, textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; font-family: inherit; font-size: 14px; color: var(--ink); outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 118, 110, .10); }
textarea { resize: vertical; min-height: 92px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 550;
  background: #eef2f6; color: var(--muted);
}
.pill.live { background: var(--teal-soft); color: var(--teal); }
.pill.warn { background: #fef3e2; color: var(--amber); }
.pill.off { background: #f1f5f9; color: #94a3b8; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dot.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase;
  color: #8b9aab; font-weight: 600; padding: 0 10px 9px; border-bottom: 1px solid var(--line);
}
td { padding: 11px 10px; border-bottom: 1px solid #eef2f6; font-size: 13.5px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.hl td { background: #f7fbfa; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.rank-badge {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: #eef2f6; color: #475569; font-size: 12.5px; font-weight: 700;
}
.rank-badge.top { background: var(--navy); color: #fff; }
.rank-badge.second { background: #e2e8f0; color: #334155; }

.kpi { display: flex; flex-direction: column; gap: 3px; }
.kpi .label { font-size: 11.5px; color: var(--muted); letter-spacing: .3px; }
.kpi .value { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.kpi .value.sm { font-size: 16px; }

.timer {
  font-variant-numeric: tabular-nums; font-weight: 650; letter-spacing: .5px;
  font-size: 30px; line-height: 1.1;
}
.timer.urgent { color: var(--red); }

.rank-hero {
  background: linear-gradient(160deg, #0e2a47 0%, #123f63 100%);
  color: #fff; border-radius: var(--radius); padding: 22px 24px;
  position: relative; overflow: hidden;
}
.rank-hero::after {
  content: ""; position: absolute; right: -40px; top: -60px; width: 180px; height: 180px;
  border-radius: 50%; background: rgba(255, 255, 255, .05);
}
.rank-hero .label { font-size: 12px; opacity: .68; letter-spacing: .8px; }
.rank-hero .big { font-size: 56px; font-weight: 700; line-height: 1; margin: 4px 0 2px; }
.rank-hero .big small { font-size: 17px; font-weight: 500; opacity: .65; margin-left: 6px; }
.rank-hero .my-price { font-size: 27px; font-weight: 650; font-variant-numeric: tabular-nums; }
.rank-hero .foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.14); font-size: 12.5px; opacity: .75; }

.hero-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:16px; }
.hero-grid .label { margin-bottom:4px; }
.hero-grid .hv { font-size:23px; font-weight:650; letter-spacing:-.2px; color:#fff; }

.gap-chip {
  display: inline-block; margin-top: 12px; padding: 6px 12px; border-radius: 8px;
  background: rgba(251, 191, 36, .14); border: 1px solid rgba(251, 191, 36, .35);
  color: #fcd34d; font-size: 12.5px; font-weight: 550;
}
.gap-chip b { color: #fff; font-weight: 700; }

.gap-note { font-size: 12.5px; color: var(--amber); background: #fff8ec; border: 1px solid #f7e3c3;
  padding: 8px 12px; border-radius: 8px; margin-top: 12px; }

.bid-input { font-size: 24px; font-weight: 650; padding: 12px 14px; font-variant-numeric: tabular-nums; }
.form-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

.bid-list { list-style: none; margin: 0; padding: 0; }
.bid-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #eef2f6; font-size: 13px; }
.bid-list li:last-child { border-bottom: none; }
.bid-list .t { color: var(--muted); font-size: 12px; }

.rule { font-size: 12.5px; color: var(--muted); line-height: 1.75; }
.rule b { color: var(--ink); font-weight: 600; }

.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 10px 30px rgba(13,27,42,.25);
  opacity: 0; transform: translateY(8px); transition: .2s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast.err { background: #7f1d1d; }

.entry-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 22px; }
.entry {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); color: inherit; transition: .15s ease;
}
.entry:hover { transform: translateY(-2px); border-color: #cbd5e1; text-decoration: none; }
.entry .tag { font-size: 11.5px; letter-spacing: .8px; color: var(--teal); font-weight: 600; }
.entry h3 { margin: 6px 0 6px; font-size: 16.5px; }

.note { background: #f8fafc; border: 1px dashed #dbe3ec; border-radius: 10px; padding: 12px 14px;
  font-size: 12.5px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 36px 0; font-size: 13px; }

@media (max-width: 900px) {
  .grid-2, .grid-3, .entry-grid { grid-template-columns: 1fr; }
  .rank-hero .big { font-size: 46px; }
  .wrap { padding: 0 16px; }
}

/* ---------------------------------------------- 采购方看板：出价走势图 */
.trend-wrap { position: relative; padding: 2px 14px 14px; }
.trend-wrap svg { display: block; width: 100%; height: auto; }
.trend-axis {
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px; fill: #7b8a9c; letter-spacing: .2px;
}
.trend-dot { cursor: pointer; transition: r .12s ease; }
.trend-dot:hover { r: 6; }
.trend-legend {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  padding: 0 18px 12px;
}
.trend-lg {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink);
}
.trend-lg i { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.trend-lg b { font-family: var(--mono, ui-monospace, monospace); font-weight: 650; color: #0f2a47; }
.trend-empty { padding: 54px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.trend-tip {
  position: absolute; opacity: 0; pointer-events: none; z-index: 5;
  background: #0f2a47; color: #fff; padding: 6px 10px; border-radius: 7px;
  font-size: 12px; white-space: nowrap; border-left: 3px solid #0f766e;
  box-shadow: 0 6px 18px rgba(15, 42, 71, .22); transform: translateY(0);
  transition: opacity .12s ease;
}
.trend-endlabel {
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11.5px; font-weight: 650; letter-spacing: .2px;
}

/* ---------------------------------------------- 供应商页 · 多模块竞价 */
.bid-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.head-right { display: flex; align-items: center; gap: 14px; }
.clock-box {
  background: var(--navy); color: #fff; border-radius: 10px;
  padding: 8px 16px; display: flex; flex-direction: column; align-items: flex-end; min-width: 132px;
}
.clock-box .label { font-size: 11px; letter-spacing: .6px; text-transform: uppercase; opacity: .6; }
.clock-box b { font-size: 22px; font-weight: 650; line-height: 1.2; }
.clock-box .sub { color: rgba(255, 255, 255, .55); font-size: 11.5px; }

.bar-note {
  margin: 16px 0 18px; padding: 10px 16px; border-radius: 10px;
  background: var(--teal-soft); color: #0b5a53; font-size: 12.8px;
  display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center;
}
.bar-note b { color: #084b45; }
.bar-note .dotsep { opacity: .45; }

.items-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px; align-items: start;
}
.item-card { padding: 18px 20px 16px; }
.item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.item-head h3 { font-size: 16px; }
.item-spec { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.pill.dec {
  background: #f1f5f9; color: #475569; font-size: 11.5px; white-space: nowrap;
  border: 1px solid var(--line);
}
.item-stats {
  display: grid; grid-template-columns: 1.1fr 1.1fr .8fr; gap: 10px;
  margin: 14px 0 12px; padding: 12px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.item-stats .label { font-size: 11.5px; color: var(--muted); letter-spacing: .2px; }
.item-stats .v { font-size: 19px; font-weight: 650; letter-spacing: -.3px; margin-top: 2px; }
.item-stats .v.rank { color: var(--teal); font-size: 17px; }
.item-stats .v.lowest { color: var(--navy); }
.item-bid { display: flex; gap: 10px; }
.item-bid input {
  flex: 1; height: 44px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 16px; background: #fff; outline: none;
}
.item-bid input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }
.item-bid .btn { height: 44px; padding: 0 20px; }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.item-hist { margin-top: 10px; }
.item-hist summary {
  cursor: pointer; font-size: 12.5px; color: var(--teal); list-style: none;
}
.item-hist summary::-webkit-details-marker { display: none; }
.item-hist summary .n { color: var(--muted); margin-left: 6px; }
.item-hist .bid-list { margin-top: 8px; }
.rules-card { margin-top: 18px; }
.gap-note.err { margin-top: 8px; }

/* ---------------------------------------------- 采购方看板 · 分模块面板 */
.board-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }

.item-panel { margin-top: 16px; padding: 16px 18px 6px; }
.panel-title { display: flex; align-items: flex-start; gap: 10px; }
.panel-title .idx {
  width: 24px; height: 24px; border-radius: 7px; background: var(--teal-soft); color: var(--teal);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700; flex: none; margin-top: 1px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  font-size: 12px; color: var(--muted); background: #f6f8fa;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; white-space: nowrap;
}
.chip.strong { background: #fff; color: var(--ink); }
.chip.strong b { color: var(--teal); font-variant-numeric: tabular-nums; }
.panel-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 18px; align-items: start; margin-top: 6px; }
@media (max-width: 980px) { .panel-grid { grid-template-columns: 1fr; } }
.panel-rank { overflow-x: auto; }
.panel-rank table { width: 100%; }
.panel-rank tbody { display: table-row-group; }
.rank-badge {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px;
  background: #f1f5f9; color: var(--muted); font-size: 12px; font-weight: 650;
}
.rank-badge.first { background: var(--teal); color: #fff; }
.trend-host { position: relative; min-height: 200px; padding-top: 2px; }

/* ---------------------------------------------- 创建页 · 模块编辑器 */
.items-editor { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.ie-head, .ie-row {
  display: grid; grid-template-columns: 26px 1.3fr 1.7fr 100px 26px;
  gap: 8px; align-items: center; padding: 7px 10px;
}
.ie-head { background: #f6f8fa; border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.ie-row + .ie-row { border-top: 1px solid #f1f5f9; }
.ie-row input {
  width: 100%; height: 32px; border: 1px solid transparent; background: #fbfcfd;
  border-radius: 6px; padding: 0 8px; font-size: 12.5px; outline: none;
}
.ie-row input:focus { border-color: var(--teal); background: #fff; }
.ie-idx { font-size: 12px; color: var(--muted); text-align: center; }
.ie-del {
  border: none; background: none; color: #94a3b8; font-size: 17px; cursor: pointer;
  line-height: 1; padding: 0;
}
.ie-del:hover { color: var(--red); }
.ie-add { margin: 2px 10px 10px; font-size: 12.5px; padding: 5px 12px; }
@media (max-width: 720px) {
  .ie-head { display: none; }
  .ie-row { grid-template-columns: 1fr 1fr; }
  .ie-row .ie-idx { display: none; }
}

/* 表格表头不拆字 */
.panel-rank th, .panel-rank td { white-space: nowrap; }
.panel-rank th, .panel-rank td { padding-left: 6px; padding-right: 6px; }
.panel-rank th.rk { width: 40px; padding-left: 4px; padding-right: 4px; text-align: center; }
#auditBody td:nth-child(2), #auditBody th:nth-child(2) { white-space: nowrap; }
.trend-cap { font-size: 11.5px; color: var(--muted); letter-spacing: .3px; margin: 2px 0 0 2px; }
.panel-rank td:first-child { white-space: nowrap; }

/* 受邀与验证 · 全宽网格 */
.sup-grid {
  list-style: none; margin: 6px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px 18px;
}
.sup-item {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfd;
}
.sup-item .sup-main { min-width: 0; }
.sup-item b { display: block; font-size: 13px; line-height: 1.45; word-break: break-word; }
.sup-item .t { display: block; font-size: 11.5px; color: var(--muted); word-break: break-all; }
.sup-item .pill { flex: none; font-size: 11px; white-space: nowrap; }
