:root {
  color-scheme: light;
  --ink: #142326;
  --muted: #627174;
  --line: #d8e0df;
  --bg: #f6f8f7;
  --panel: #ffffff;
  --accent: #176b61;
  --accent-2: #c7532c;
  --soft: #e6f0ee;
  --shadow: 0 18px 42px rgba(20, 35, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Noto Sans TC", Arial, sans-serif;
}

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

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

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

h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.status-pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 0.9fr);
  gap: 18px;
  margin: 24px 0 18px;
}

.upload-panel,
.summary-panel,
.table-panel,
.flow-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.upload-panel {
  padding: 18px;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 230px;
  padding: 24px;
  border: 1px dashed #93a8a5;
  border-radius: 8px;
  background: #fbfcfc;
  cursor: pointer;
  text-align: center;
}

.dropzone.dragging {
  border-color: var(--accent);
  background: var(--soft);
}

.dropzone input {
  display: none;
}

.upload-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.dropzone strong {
  display: block;
  margin-top: 14px;
  font-size: 20px;
}

.dropzone small,
.file-name,
.metric label,
.panel-head span {
  color: var(--muted);
}

button {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  background: #9aa8a6;
}

.file-name {
  min-height: 20px;
  margin: 12px 2px 0;
  overflow-wrap: anywhere;
}

.summary-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.metric {
  min-height: 136px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 22px;
  background: var(--panel);
}

.metric span {
  font-size: 38px;
  font-weight: 800;
}

.metric label {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.downloads a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
}

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

.preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
}

.table-panel,
.flow-panel {
  min-height: 330px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  overflow: auto;
  max-height: 430px;
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf3f2;
  font-size: 13px;
}

td {
  font-size: 14px;
}

.empty {
  height: 160px;
  text-align: center;
  color: var(--muted);
  vertical-align: middle;
}

.flow-panel {
  padding: 18px;
}

.flow-panel ol {
  margin: 18px 0 0;
  padding-left: 22px;
}

.flow-panel li {
  margin: 0 0 14px;
  color: #344649;
}

@media (max-width: 860px) {
  .topbar,
  .workspace,
  .preview-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar {
    display: block;
  }

  .status-pill {
    display: inline-flex;
    margin-top: 14px;
  }
}
