:root {
  --bg: #f4efe7;
  --panel: rgba(255, 251, 245, 0.94);
  --line: #dacfbf;
  --text: #1f1a17;
  --muted: #6a6258;
  --brand: #0f6d5b;
  --brand-deep: #0b4f43;
  --accent: #d98f2b;
  --danger: #a23b2a;
  --shadow: 0 18px 44px rgba(74, 51, 24, 0.12);
  --radius-lg: 26px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at left top, rgba(217, 143, 43, 0.18), transparent 24%),
    radial-gradient(circle at right top, rgba(15, 109, 91, 0.18), transparent 20%),
    linear-gradient(180deg, #faf5ee 0%, #eee4d7 100%);
}

.page-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px 18px 42px;
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

.hero-copy,
.status-card,
.panel,
.modal-card {
  background: var(--panel);
  border: 1px solid rgba(218, 207, 191, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 26px;
}

.eyebrow {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 109, 91, 0.08);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 10px 0 12px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero p,
.subtext,
.modal-copy {
  color: var(--muted);
  line-height: 1.65;
}

.hero-actions,
.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-status {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.status-card {
  padding: 18px 20px;
}

.status-label {
  color: var(--muted);
  font-size: 13px;
}

.status-value {
  margin-top: 10px;
  font-size: 24px;
  font-weight: 700;
}

.spotlight-panel {
  margin-bottom: 20px;
}

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

.inventory-panel {
  grid-column: 1 / -1;
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

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

.auth-grid-modal {
  margin-top: 16px;
}

.stack-form,
.inline-form,
.buy-cell {
  display: flex;
  gap: 10px;
}

.stack-form {
  flex-direction: column;
  padding: 16px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.stack-form h3 {
  margin: 0 0 6px;
}

.inline-form {
  margin-bottom: 12px;
}

input,
button {
  border: 1px solid var(--line);
  border-radius: 14px;
  font: inherit;
}

input {
  width: 100%;
  padding: 12px 14px;
  background: #fffdfa;
}

button {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #ba7314 100%);
}

.ghost-btn {
  color: var(--brand);
  background: rgba(15, 109, 91, 0.08);
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(218, 207, 191, 0.75);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.buy-cell {
  align-items: center;
}

.buy-cell input {
  width: 92px;
  min-width: 92px;
}

.buy-cell button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.mobile-cards {
  display: none;
}

.card-list {
  display: grid;
  gap: 12px;
}

.info-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(218, 207, 191, 0.9);
  background: rgba(255, 255, 255, 0.5);
}

.info-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.info-card p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.callout {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(217, 143, 43, 0.12);
  border: 1px solid rgba(217, 143, 43, 0.28);
  white-space: pre-wrap;
  word-break: break-all;
}

.link-btn {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(15, 109, 91, 0.08);
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(31, 26, 23, 0.92);
  color: #fff;
  box-shadow: var(--shadow);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 13, 10, 0.45);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100vw - 28px));
  margin: 6vh auto 0;
  padding: 22px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h2 {
  margin: 0;
}

.modal-close {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 999px;
  background: rgba(15, 109, 91, 0.08);
  color: var(--brand);
  font-size: 28px;
  line-height: 1;
}

.desktop-only {
  display: block;
}

.hidden {
  display: none !important;
}

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

  .hero-status {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 16px 12px 28px;
  }

  .hero-copy,
  .panel,
  .modal-card {
    border-radius: 22px;
  }

  .hero-status,
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .desktop-only {
    display: none;
  }

  .mobile-cards {
    display: block;
  }

  .inline-form,
  .buy-cell,
  .card-actions,
  .hero-actions,
  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .buy-cell input {
    width: 100%;
    min-width: 0;
  }

  .modal-card {
    width: calc(100vw - 20px);
    margin-top: 10px;
    padding: 18px;
  }
}
