:root {
  --bg: #f5f7f4;
  --panel: #ffffff;
  --ink: #17201b;
  --muted: #68736d;
  --line: #dfe5dd;
  --accent: #2f6f5e;
  --accent-dark: #214f43;
  --warm: #c9854b;
  --blue: #587a9f;
  --shadow: 0 18px 45px rgba(31, 48, 39, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  padding: 24px;
}

.workspace {
  max-width: 1360px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 18px;
}

.primary,
.secondary {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  cursor: pointer;
}

.primary {
  border: 0;
  color: #fff;
  background: var(--accent);
}

.primary:hover {
  background: var(--accent-dark);
}

.primary:disabled {
  background: #8aa79d;
  cursor: wait;
}

.secondary {
  border: 1px solid var(--line);
  color: var(--accent-dark);
  background: var(--panel);
}

.secondary:disabled {
  color: #9aa59f;
  background: #eef2ee;
  cursor: not-allowed;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.input-grid,
.detail-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fbfcfb;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.upload-card {
  min-height: 96px;
  align-content: center;
  border: 1px dashed #aeb9b1;
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfb;
  cursor: pointer;
}

.upload-card span {
  color: var(--ink);
  font-weight: 700;
}

.upload-card input {
  display: none;
}

.upload-card small {
  color: var(--muted);
}

.checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: 0;
  color: var(--ink);
}

.is-hidden {
  display: none !important;
}

.status-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 16px 0;
  padding: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.notice-panel {
  border: 1px solid #e0d6c8;
  border-radius: 8px;
  margin-top: 16px;
  padding: 18px;
  background: #fffaf2;
  color: #4f3d2a;
}

.notice-panel h2 {
  margin-bottom: 8px;
  font-size: 17px;
}

.notice-panel p {
  margin-bottom: 8px;
  line-height: 1.7;
}

.notice-panel p:last-child {
  margin-bottom: 0;
}

.status-panel h2 {
  margin-bottom: 8px;
}

.status-panel p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.loading-panel {
  display: flex;
  align-items: center;
  gap: 18px;
}

.loader {
  width: 42px;
  height: 42px;
  border: 4px solid #dce5df;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  flex: 0 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.summary-band {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

.summary-band > div {
  min-height: 108px;
  border-radius: 8px;
  padding: 18px;
}

.total-card {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--blue));
}

.total-card p,
.basis-card p,
.accuracy-card p {
  margin-bottom: 12px;
}

.total-card p {
  color: rgba(255, 255, 255, 0.82);
}

.total-card strong {
  display: block;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.1;
}

.metric-card,
.basis-card,
.accuracy-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card p,
.basis-card p,
.accuracy-card p {
  color: var(--muted);
  font-size: 14px;
}

.metric-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
}

.metric-card div {
  min-width: 0;
}

.metric-card dt {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.metric-card dd {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
}

.basis-card strong,
.accuracy-card strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.detail-layout {
  grid-template-columns: 1fr;
}

.two-column {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  margin-bottom: 16px;
}

.table-panel {
  overflow-x: auto;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin-bottom: 6px;
}

.section-head p {
  max-width: 900px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.compact-table {
  min-width: 520px;
}

.brand-table {
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

td:last-child,
th:last-child,
td:nth-child(4),
th:nth-child(4),
td:nth-child(5),
th:nth-child(5),
td:nth-child(6),
th:nth-child(6),
td:nth-child(7),
th:nth-child(7) {
  text-align: right;
}

.brand-table td,
.brand-table th {
  text-align: left;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tier-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfb;
}

.tier-card.is-active {
  border-color: var(--accent);
  background: #eef7f3;
}

.tier-card h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.tier-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 28px;
  line-height: 1.1;
}

.tier-card dl {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
}

.tier-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.tier-card dt,
.tier-card dd {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.tier-card dd {
  color: var(--ink);
  font-weight: 700;
}

@media (max-width: 980px) {
  .input-grid,
  .detail-layout,
  .summary-band,
  .tier-grid,
  .two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .shell {
    padding: 14px;
  }

  .topbar,
  .field-row,
  .checks {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .primary {
    width: 100%;
  }

  .secondary {
    width: 100%;
  }

  .top-actions {
    justify-content: stretch;
  }

  .loading-panel {
    align-items: flex-start;
  }
}
