:root {
  color-scheme: light;
  font-family: "Segoe UI", "Noto Sans TC", Arial, sans-serif;
  background: #eef2f6;
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, #e8eef7 0, #f6f8fb 240px, #f6f8fb 100%),
    #f6f8fb;
}

.shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.toolbar,
.panelHeader,
.resultHeader,
.reviewToolbar,
.formFooter {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.toolbar {
  align-items: center;
  min-height: 104px;
  margin-bottom: 16px;
  padding: 22px 24px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.brandBlock {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brandMark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: #174ea6;
  color: #ffffff;
  font-weight: 800;
  font-size: 22px;
  box-shadow: inset 0 -10px 20px rgba(15, 23, 42, 0.18);
}

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

h1 {
  margin-bottom: 6px;
  font-size: 29px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 8px;
  font-size: 19px;
  line-height: 1.3;
}

h3 {
  margin: 0;
  font-size: 15px;
}

p {
  margin-bottom: 0;
  color: #556276;
  line-height: 1.55;
}

.eyebrow,
.sectionKicker {
  margin-bottom: 5px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status,
.badge,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  white-space: nowrap;
}

.status {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.badge.ok,
.chip.ok {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.chip.warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.tabs,
.steps,
.filterGroup {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tabs {
  width: fit-content;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.tab {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  font-weight: 700;
}

.tab.active {
  background: #174ea6;
  color: #ffffff;
}

.tabPage {
  display: none;
}

.tabPage.active {
  display: block;
}

.steps {
  margin: 16px 0 12px;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 10px;
  border: 1px solid #d8dee9;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  font-size: 14px;
  font-weight: 700;
}

.step b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
}

.step.active {
  border-color: #174ea6;
  background: #eff6ff;
  color: #174ea6;
}

.step.active b {
  background: #174ea6;
  color: #ffffff;
}

.panel {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.grid {
  display: grid;
  gap: 14px;
  margin: 18px 0 16px;
}

.routeUploadGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.singleUploadGrid {
  grid-template-columns: minmax(280px, 540px);
}

.fieldCard {
  display: grid;
  gap: 9px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.fieldCard.primaryField {
  border-color: #bfdbfe;
  background: #f3f8ff;
}

.hint {
  font-size: 13px;
}

label span {
  display: block;
}

select,
input[type="file"] {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-weight: 500;
}

select:focus,
input[type="file"]:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

button,
.actions a,
.supportDetails a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #174ea6;
  border-radius: 6px;
  background: #174ea6;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.actions a:hover {
  background: #123f86;
}

.filter {
  min-height: 34px;
  border-color: #d8dee9;
  background: #ffffff;
  color: #334155;
}

.filter.active {
  border-color: #174ea6;
  background: #e8f1ff;
  color: #174ea6;
}

.invariantBanner {
  display: inline-flex;
  width: fit-content;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  background: #f0f9ff;
  color: #075985;
  font-size: 13px;
  font-weight: 700;
}

.summaryBar {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 18px 0;
  padding: 10px 0;
  background: #ffffff;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.metric {
  padding: 13px;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  background: #f8fafc;
}

.metric span {
  display: block;
  margin-bottom: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  color: #111827;
  font-size: 20px;
}

.checkList {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.checkItem {
  padding: 12px;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  background: #f8fafc;
}

.checkItem span {
  display: block;
  margin-bottom: 5px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.supportDetails {
  position: relative;
  color: #475569;
}

.supportDetails summary {
  cursor: pointer;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #d8dee9;
  border-radius: 6px;
  background: #ffffff;
  font-weight: 700;
  list-style: none;
}

.supportDetails a {
  margin-top: 8px;
  border-color: #d8dee9;
  background: #ffffff;
  color: #334155;
}

.tableWrap {
  overflow: auto;
  border: 1px solid #d8dee9;
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.45;
}

th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  color: #334155;
  font-weight: 800;
}

tbody tr:hover td {
  background: #f8fafc;
}

.needsReviewRow td {
  background: #fffaf0;
}

.emptyCell {
  color: #64748b;
  text-align: center;
}

@media (max-width: 760px) {
  .toolbar,
  .brandBlock,
  .panelHeader,
  .resultHeader,
  .reviewToolbar,
  .formFooter {
    display: grid;
  }

  .routeUploadGrid,
  .singleUploadGrid,
  .metrics,
  .checkList {
    grid-template-columns: 1fr;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
  }
}
