:root {
  color-scheme: light;
  --bg: #f7f1e8;
  --panel: rgba(255, 252, 247, 0.92);
  --panel-strong: #fffaf2;
  --line: rgba(81, 56, 35, 0.14);
  --text: #2d2018;
  --muted: #725844;
  --brand: #a44a1d;
  --brand-dark: #7d3512;
  --accent: #0f766e;
  --accent-dark: #0a5a54;
  --danger: #b42318;
  --shadow: 0 20px 60px rgba(96, 52, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 210, 168, 0.45), transparent 28%),
    radial-gradient(circle at top right, rgba(131, 196, 190, 0.25), transparent 24%),
    linear-gradient(180deg, #fcf8f2 0%, var(--bg) 100%);
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 32px auto 56px;
  display: grid;
  gap: 20px;
}

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

.hero-card {
  padding: 28px;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.04;
}

.hero-copy {
  margin-top: 14px;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.6;
}

.hero-metrics {
  display: grid;
  gap: 14px;
}

.metric-card {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 241, 232, 0.96));
  border: 1px solid var(--line);
}

.metric-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.metric-card strong {
  font-size: 1.5rem;
}

.panel {
  padding: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.status-text {
  color: var(--muted);
  font-size: 0.95rem;
}

.payment-link-container {
  margin: 0 0 16px;
  color: var(--muted);
  word-break: break-all;
}

.payment-link {
  color: var(--accent-dark);
  text-decoration: none;
}

.payment-link:hover {
  text-decoration: underline;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: var(--muted);
  font-size: 0.92rem;
}

input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
}

input:focus {
  outline: 2px solid rgba(164, 74, 29, 0.18);
  border-color: rgba(164, 74, 29, 0.45);
}

.button-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  transition: transform 120ms ease, opacity 120ms ease;
}

button.secondary {
  background: linear-gradient(135deg, #534338, #34281f);
}

button.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.table-wrap {
  overflow-x: auto;
}

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

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

thead th {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

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

.price-cell {
  font-weight: 700;
  color: var(--brand-dark);
  width: 110px;
}

.source-title-cell {
  line-height: 1.55;
  word-break: break-word;
}

.source-link {
  color: inherit;
  text-decoration: none;
}

.source-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.probe-result-cell[data-state="success"] {
  color: var(--accent-dark);
  font-weight: 700;
}

.probe-result-cell[data-state="error"] {
  color: var(--danger);
  font-weight: 700;
}

.quantity-input {
  width: 92px;
  min-width: 92px;
}

.row-buy-button {
  min-width: 84px;
}

th:nth-child(7),
td:nth-child(7) {
  width: 112px;
}

th:nth-child(8),
td:nth-child(8) {
  width: 96px;
}

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

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

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

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

  .control-grid {
    grid-template-columns: 1fr;
  }

  .button-row {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
