:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: rgba(255, 255, 255, 0.94);
  --text: #172033;
  --muted: #667085;
  --primary: #ff6b35;
  --primary-dark: #d94a1a;
  --line: #e4e7ec;
  --success: #0f9f6e;
  --warning: #d97706;
  --error: #dc2626;
  --shadow: 0 20px 60px rgba(16, 24, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 107, 53, 0.22), transparent 32rem),
    linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
.file-picker {
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(255, 107, 53, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover,
.file-picker:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(255, 107, 53, 0.3);
}

button:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

button.ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

button.ghost:hover {
  background: #f8fafc;
}

.file-picker input {
  display: none;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero,
.status-panel,
.result-card,
.debug-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 14px;
}

.crumbs a {
  color: var(--primary-dark);
  text-decoration: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: stretch;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 720px;
  margin-bottom: 16px;
  font-size: clamp(32px, 6vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.privacy-card {
  padding: 24px;
  border-radius: 24px;
  background: #101828;
  color: #fff;
}

.privacy-card p,
.privacy-card li {
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.7;
}

.privacy-card ul {
  padding-left: 20px;
  margin-bottom: 0;
}

.status-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: center;
  margin-top: 22px;
  padding: 22px 24px;
}

#hintText {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.progress-wrap {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

#progressBar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #fbbf24);
  transition: width 0.25s ease;
}

.result-card,
.debug-card {
  margin-top: 22px;
  padding: 24px;
}

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

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
}

table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475467;
  font-size: 13px;
  white-space: nowrap;
}

td input,
td select {
  width: 100%;
  min-width: 92px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
}

.empty-row td {
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.status-ok select {
  color: var(--success);
}

.status-warn select {
  color: var(--warning);
}

.status-error select {
  color: var(--error);
}

.debug-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 24px;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

pre {
  max-height: 360px;
  overflow: auto;
  margin-bottom: 0;
  padding: 16px;
  border-radius: 16px;
  background: #0f172a;
  color: #dbeafe;
  white-space: pre-wrap;
  line-height: 1.6;
}

.field-help {
  color: var(--muted);
  line-height: 1.8;
}

@media (max-width: 900px) {
  .hero-grid,
  .status-panel,
  .debug-card {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .hero,
  .status-panel,
  .result-card,
  .debug-card {
    border-radius: 20px;
    padding: 18px;
  }
}
