:root {
  --bg: #f4efe6;
  --panel: rgba(255, 250, 242, 0.92);
  --panel-strong: #fff9ef;
  --line: rgba(104, 71, 49, 0.16);
  --text: #2d1f14;
  --muted: #7a6858;
  --accent: #b5532f;
  --accent-dark: #8c3f22;
  --success: #295c4f;
  --danger: #a0392f;
  --shadow: 0 18px 50px rgba(87, 55, 29, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 212, 173, 0.7), transparent 30%),
    radial-gradient(circle at top right, rgba(224, 193, 158, 0.8), transparent 28%),
    linear-gradient(180deg, #f8f2e8 0%, var(--bg) 100%);
  min-height: 100vh;
}

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

.hero-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-card {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  padding: 36px;
  margin-bottom: 20px;
}

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

.hero-copy h1 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.05;
}

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

.meta-grid {
  display: grid;
  gap: 14px;
}

.meta-grid div {
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 245, 230, 0.85);
  border: 1px solid rgba(150, 106, 65, 0.15);
}

.meta-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.meta-grid strong {
  font-size: 18px;
}

.panel {
  padding: 28px;
  margin-bottom: 20px;
}

.scan-form {
  display: grid;
  gap: 22px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

label span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

select,
input[type="text"] {
  width: 100%;
  border: 1px solid rgba(95, 63, 43, 0.18);
  border-radius: 14px;
  background: var(--panel-strong);
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text);
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 2px dashed rgba(181, 83, 47, 0.4);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 243, 227, 0.96), rgba(248, 233, 212, 0.88)),
    repeating-linear-gradient(
      45deg,
      rgba(181, 83, 47, 0.04),
      rgba(181, 83, 47, 0.04) 12px,
      transparent 12px,
      transparent 24px
    );
  text-align: center;
  padding: 24px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  transform: translateY(-2px);
  border-color: rgba(181, 83, 47, 0.7);
  box-shadow: 0 16px 36px rgba(181, 83, 47, 0.12);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-title {
  display: block;
  font-size: 22px;
  font-weight: 700;
}

.dropzone-hint {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.selection-bar,
.status-header,
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

button,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff8f0;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease;
}

button:hover,
.download-link:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.status-panel h2,
.result-panel h2 {
  margin: 0;
  font-size: 22px;
}

.status-panel p,
.result-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.error-text {
  color: var(--danger);
}

.download-wrap {
  margin-top: 18px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 252, 247, 0.86);
  border-radius: 16px;
  overflow: hidden;
}

th,
td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(99, 68, 47, 0.09);
  font-size: 14px;
  vertical-align: top;
}

th {
  background: rgba(224, 197, 163, 0.24);
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: rgba(255, 248, 239, 0.8);
}

.failure-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.failure-list li {
  padding: 14px 16px;
  border: 1px solid rgba(160, 57, 47, 0.18);
  border-radius: 16px;
  background: rgba(255, 241, 239, 0.9);
}

.failure-list strong {
  display: block;
  margin-bottom: 6px;
  color: var(--danger);
}

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

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

  .selection-bar,
  .status-header,
  .result-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding: 16px 0 28px;
  }

  .hero-card,
  .panel {
    border-radius: 22px;
    padding: 20px;
  }

  .dropzone {
    min-height: 180px;
  }

  .dropzone-title {
    font-size: 18px;
  }
}
