:root {
  --bg: #f2efe6;
  --panel: #fffdfa;
  --ink: #1e2a2f;
  --muted: #5f6f72;
  --line: #d9d1bf;
  --accent: #184e77;
  --accent-2: #f0b429;
  --danger: #9f2a2a;
  --danger-bg: #fff1f1;
  --warning-bg: #fff6dc;
  --success-bg: #ecf7ef;
  --info-bg: #eef6fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(24, 78, 119, 0.1), transparent 28%),
    linear-gradient(180deg, #f8f4eb 0%, var(--bg) 100%);
}

.page {
  width: min(920px, calc(100% - 32px));
  margin: 32px auto 48px;
}

.hero {
  padding: 28px 32px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 241, 229, 0.96));
  box-shadow: 0 18px 40px rgba(65, 52, 27, 0.08);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: 0.02em;
}

.intro {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.panel {
  margin-top: 22px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(62, 53, 38, 0.06);
}

.upload-form {
  display: grid;
  gap: 18px;
}

.auth-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-heading h2 {
  margin-bottom: 6px;
}

.auth-status {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-status[data-state="ok"] {
  color: #176b3a;
}

.auth-status[data-state="error"] {
  color: var(--danger);
}

.secondary {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.secondary:hover {
  background: #edf5fa;
}

.template-bar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-weight: 700;
}

.field small {
  color: var(--muted);
  line-height: 1.5;
}

input[type="file"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px dashed #a6b7be;
  background: #f9fbfc;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shipping-guide {
  padding: 14px 16px;
  border-left: 4px solid var(--accent-2);
  background: #fff8e8;
  color: #3d4b4c;
}

.shipping-guide-title {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.shipping-guide ol {
  margin: 0;
  padding-left: 21px;
  font-size: 13px;
  line-height: 1.65;
}

.shipping-guide-note {
  margin: 10px 0 0;
  color: #76551a;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
}

.file-queue {
  padding: 16px;
  border: 1px dashed #92aab8;
  background: #f7fafb;
}

.file-picker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition: background 140ms ease, transform 140ms ease;
}

.file-picker:hover {
  background: #103c5e;
  transform: translateY(-1px);
}

.file-picker:focus-within {
  outline: 3px solid rgba(240, 180, 41, 0.55);
  outline-offset: 3px;
}

.file-picker-icon {
  display: inline-grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.75);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.file-queue-status {
  margin: 12px 0 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.file-queue-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid #d5e1e6;
  background: #fff;
}

.file-queue-details {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.file-queue-details strong {
  overflow: hidden;
  color: #254655;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-queue-details small {
  color: var(--muted);
  font-size: 12px;
}

.file-remove {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid #d3a7a7;
  background: #fff;
  color: var(--danger);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.file-remove:hover {
  background: #fff0f0;
}

.primary,
.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.primary {
  width: fit-content;
  background: var(--accent);
  color: white;
}

.primary:disabled,
.secondary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.download {
  background: #0f766e;
  color: white;
}

.danger {
  background: var(--danger-bg);
  border-color: #e3bbbb;
}

.warning {
  background: var(--warning-bg);
  border-color: #f0d07c;
}

.success {
  background: var(--success-bg);
  border-color: #a9d2b1;
}

.info {
  background: var(--info-bg);
  border-color: #b8d3e4;
}

h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.75;
}

@media (max-width: 640px) {
  .page {
    width: calc(100% - 20px);
    margin: 18px auto 32px;
  }

  .hero,
  .panel {
    padding: 18px;
  }

  .downloads {
    flex-direction: column;
  }

  .auth-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .file-queue-item {
    align-items: flex-start;
  }
}

/* Batch (ZIP) results table */
.results {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.results th,
.results td {
  padding: 8px 10px;
  border-bottom: 1px solid #e3e8ef;
  vertical-align: top;
}

.results th {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5b6b7f;
}

.results .problem {
  color: #b42318;
}

.results .note {
  color: #8a6100;
}
