:root {
  --bg-primary: #f7f3ec;
  --bg-secondary: #fffdf8;
  --primary: #b91c1c;
  --primary-light: #dc2626;
  --primary-dark: #7f1d1d;
  --gold: #c9962d;
  --gold-light: #f6d47a;
  --gold-soft: #fff2c7;
  --text-primary: #211814;
  --text-secondary: #6b5b4f;
  --text-muted: #9b8b80;
  --border: #eadfce;
  --success: #16a34a;
  --danger: #dc2626;
  --shadow-sm: 0 6px 18px rgba(90, 58, 20, 0.08);
  --shadow-md: 0 16px 40px rgba(90, 58, 20, 0.12);
  --shadow-lg: 0 24px 64px rgba(90, 58, 20, 0.18);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(246, 212, 122, 0.22), transparent 28%),
    radial-gradient(circle at 90% 8%, rgba(185, 28, 28, 0.08), transparent 26%),
    linear-gradient(180deg, #fffaf0 0%, #f7f3ec 48%, #f4efe6 100%);
}

.page-risk-tip {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 999px;
  color: #7f1d1d;
  background: rgba(255, 242, 199, 0.9);
  border: 1px solid rgba(255, 232, 166, 0.62);
  box-shadow: 0 10px 28px rgba(80, 28, 13, 0.18);
  backdrop-filter: blur(10px);
  font-size: 0.88rem;
  font-weight: 900;
  white-space: nowrap;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 340px;
  padding: 54px 20px 86px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 58%, #d97706 100%);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(246, 212, 122, 0.34), transparent 24%),
    radial-gradient(circle at 86% 22%, rgba(255, 255, 255, 0.14), transparent 20%),
    linear-gradient(135deg, rgba(77, 18, 18, 0.88) 0%, rgba(160, 18, 27, 0.86) 54%, rgba(146, 89, 15, 0.8) 100%);
  z-index: 1;
}

.hero::after {
  content: '';
  position: absolute;
  right: -90px;
  bottom: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  border: 1px solid rgba(255, 232, 166, 0.28);
  box-shadow: inset 0 0 0 28px rgba(255, 232, 166, 0.06);
  z-index: 1;
}

.hero__bar {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 8px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff7df;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 232, 166, 0.34);
  backdrop-filter: blur(10px);
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.brand-mark::before {
  content: '金';
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #7f1d1d;
  background: linear-gradient(135deg, #fff7d1, var(--gold-light));
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 900;
  margin: 22px 0 0;
  letter-spacing: -0.02em;
  line-height: 1.16;
  max-width: 720px;
}

.hero p {
  margin: 16px 0 0;
  color: rgba(255, 249, 232, 0.92);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  max-width: none;
  line-height: 1.85;
  white-space: nowrap;
}

.hero__anchor,
.map-link {
  display: inline-block;
  text-decoration: none;
  color: var(--primary-dark);
  background: linear-gradient(135deg, #fffaf0 0%, #ffe7a6 100%);
  padding: 13px 28px;
  border-radius: 50px;
  font-weight: 800;
  white-space: nowrap;
  transition: all 0.3s ease;
  box-shadow: 0 10px 26px rgba(80, 28, 13, 0.22);
}

.hero__anchor:hover,
.map-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Layout */
.layout {
  width: 100%;
  max-width: 1120px;
  margin: -76px auto 64px;
  padding: 0 20px;
  display: grid;
  gap: 22px;
  position: relative;
  z-index: 10;
}

/* Panel */
.panel {
  position: relative;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(234, 223, 206, 0.9);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.panel h2 {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  font-weight: 900;
  margin: 6px 0 0;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

.eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--gold));
}

/* Status */
.status-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  overflow: hidden;
  color: transparent;
  background: var(--text-muted);
}

.status-pill::before {
  content: none;
}

.status-pill--live {
  background: var(--success);
}

.status-pill--live::before {
  animation: pulse 2s ease-in-out infinite;
}

.status-pill--error {
  background: var(--danger);
}

.status-pill--pending {
  background: var(--text-muted);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

.refresh-button {
  border: 0;
  border-radius: 50px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.refresh-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.refresh-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.panel__hint {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  background: #fff7e5;
  border: 1px solid rgba(201, 150, 45, 0.18);
}

/* Market Grid */
.market-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 1024px) {
  .market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-grid--single {
    grid-template-columns: 1fr;
  }
}

.quote-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fffaf0 0%, #ffffff 100%);
  border: 1px solid rgba(234, 223, 206, 0.82);
}

.quote-group h3 {
  position: relative;
  margin: 0;
  padding-left: 12px;
  font-size: 1.08rem;
  font-weight: 900;
  color: var(--text-primary);
}

.quote-group h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), var(--gold));
  transform: translateY(-50%);
}

/* Quote Table */
.quote-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid rgba(234, 223, 206, 0.92);
  box-shadow: var(--shadow-sm);
}

.quote-table thead {
  background: linear-gradient(135deg, #8a1717 0%, var(--primary) 62%, #b7791f 100%);
  color: #fff7df;
}

.quote-table th {
  padding: 15px 16px;
  text-align: left;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

.quote-table td {
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(234, 223, 206, 0.72);
  font-size: 0.95rem;
  transition: background-color 0.2s ease;
}

.quote-table tbody tr:last-child td {
  border-bottom: 0;
}

.quote-table tbody tr {
  background: #ffffff;
  transition: background-color 0.2s ease;
}

.quote-table tbody tr:hover {
  background: #fff7e5;
}

.quote-table tbody tr:nth-child(even) {
  background: #fffaf0;
}

.quote-table tbody tr:nth-child(even):hover {
  background: #fff2d0;
}

.quote-table .buy-back-price,
.quote-table .sale-price,
.quote-table .recycle-price {
  font-weight: 900;
  font-size: 1.08rem;
  color: #b7791f;
  font-variant-numeric: tabular-nums;
}

.quote-table .row-time {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.flash-up {
  color: var(--success) !important;
  animation: flash 0.6s ease;
}

.flash-down {
  color: var(--danger) !important;
  animation: flash 0.6s ease;
}

@keyframes flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; transform: scale(1.05); }
}

/* Notice Panel */
.panel--notice {
  background: linear-gradient(135deg, #fff8e8 0%, #fffdf8 100%);
  border: 1px solid rgba(201, 150, 45, 0.24);
}

.notice-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.notice-title {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2rem) !important;
  font-weight: 900;
  color: var(--primary-dark);
}

.notice-warning {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: linear-gradient(135deg, #fff2c7, #ffe4a3);
  border: 1px solid rgba(201, 150, 45, 0.32);
  font-weight: 900;
  white-space: nowrap;
}

.risk-tip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: rgba(255, 242, 199, 0.72);
  border: 1px solid rgba(201, 150, 45, 0.24);
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.notice-text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.9;
  color: var(--text-secondary);
  white-space: pre-line;
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

.about-copy {
  display: grid;
  gap: 18px;
}

.about-intro {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fffaf0 0%, #ffffff 100%);
  border: 1px solid rgba(201, 150, 45, 0.16);
}

.about-copy p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.9;
}

.about-intro p:first-child {
  color: var(--text-primary);
  font-size: 1.02rem;
  font-weight: 700;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.service-tags span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #fff2c7;
  border: 1px solid rgba(201, 150, 45, 0.2);
  font-size: 0.88rem;
  font-weight: 800;
}

.contact-list {
  margin: 0;
  display: grid;
  gap: 14px;
  padding: 20px;
  background: #fff8e8;
  border: 1px solid rgba(201, 150, 45, 0.18);
  border-radius: var(--radius-md);
}

.contact-list > div {
  display: grid;
  gap: 6px;
}

.contact-list dt {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.contact-list dd {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.about-side {
  position: sticky;
  top: 20px;
  background: linear-gradient(180deg, #fff8e8 0%, #ffffff 100%);
  border: 1px solid rgba(201, 150, 45, 0.18);
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
}

.about-side img {
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.about-side p {
  margin: 14px 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 800;
}

.map-link {
  display: inline-block;
  margin-top: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #ffffff;
}

.site-footer {
  max-width: 1120px;
  margin: -34px auto 34px;
  padding: 0 20px;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.8;
}

.site-footer p {
  margin: 0;
}

.footer-meta {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Admin Styles */
.admin-shell {
  width: 100%;
  max-width: 1280px;
  margin: 24px auto 40px;
  padding: 0 20px;
}

.save-banner {
  margin-bottom: 16px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  color: var(--success);
  background: rgba(82, 196, 26, 0.1);
  border: 1px solid rgba(82, 196, 26, 0.2);
}

.admin-form {
  display: grid;
  gap: 20px;
}

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

.admin-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: grid;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.admin-card--full {
  grid-column: 1 / -1;
}

.admin-card h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-card label {
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
}

.admin-card input,
.admin-card textarea,
.admin-card select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-card input:focus,
.admin-card textarea:focus,
.admin-card select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.admin-card textarea {
  min-height: 96px;
  resize: vertical;
}

.image-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--bg-primary);
}

.image-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.image-preview--qr img {
  width: min(220px, 100%);
  max-height: none;
  object-fit: contain;
}

.product-admin-list {
  display: grid;
  gap: 16px;
}

.product-admin-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  background: var(--bg-secondary);
}

.product-admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.checkbox-row {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}

.checkbox-row input {
  width: auto;
}

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

.admin-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 20px;
}

.primary-button {
  border: 0;
  border-radius: 50px;
  padding: 12px 32px;
  font: inherit;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.primary-button:active {
  transform: translateY(0);
}

.secondary-button {
  display: inline-block;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.secondary-button:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(200, 16, 46, 0.12), transparent 30%),
    linear-gradient(180deg, #fafafa 0%, #f3f3f3 100%);
}

.login-card {
  width: min(100%, 420px);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
}

.login-card h1 {
  margin: 8px 0 8px;
  font-size: 1.75rem;
}

.login-card p {
  margin: 0 0 24px;
  color: var(--text-secondary);
}

.login-error {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--danger);
  background: rgba(255, 77, 79, 0.1);
  border: 1px solid rgba(255, 77, 79, 0.2);
}

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

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.login-form .primary-button {
  width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
  .page-risk-tip {
    top: 12px;
    right: 12px;
    max-width: calc(100% - 24px);
    font-size: 0.78rem;
    white-space: normal;
  }

  .hero {
    min-height: 280px;
    padding: 52px 16px 68px;
  }

  .hero__bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 0;
  }

  .brand-mark {
    font-size: 1.25rem;
    padding: 8px 12px;
  }

  .brand-mark::before {
    width: 30px;
    height: 30px;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .hero p {
    white-space: normal;
  }

  .hero__anchor {
    width: 100%;
    text-align: center;
  }

  .layout {
    margin: -52px auto 40px;
    padding: 0 14px;
  }

  .panel {
    padding: 18px;
    border-radius: 20px;
  }

  .panel__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .panel h2 {
    font-size: 1.25rem;
  }

  .notice-title-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .notice-warning,
  .risk-tip {
    white-space: normal;
  }

  .status-wrap {
    width: 100%;
    align-items: flex-start;
  }

  .market-grid {
    gap: 16px;
  }

  .quote-group {
    padding: 12px;
    border-radius: 18px;
  }

  .quote-table {
    display: table;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .quote-table th,
  .quote-table td {
    padding: 12px 10px;
    font-size: 0.86rem;
    white-space: nowrap;
  }

  .quote-table .buy-back-price,
  .quote-table .sale-price,
  .quote-table .recycle-price {
    font-size: 0.98rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .about-side {
    position: static;
    order: -1;
  }

  .contact-list {
    margin-top: 16px;
    padding: 16px;
  }

  .map-link {
    width: 100%;
    text-align: center;
  }

  .admin-shell {
    padding: 0 16px;
  }

  .admin-grid,
  .product-admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-card {
    padding: 20px;
  }

  .admin-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-header-actions .hero__anchor,
  .admin-header-actions .secondary-button {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .login-card {
    padding: 28px 20px;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: 260px;
    padding: 28px 12px 60px;
  }

  .hero h1 {
    font-size: 1.62rem;
  }

  .hero p {
    font-size: 0.9375rem;
  }

  .layout {
    padding: 0 10px;
  }

  .panel {
    padding: 14px;
  }

  .panel h2 {
    font-size: 1.125rem;
  }

  .quote-table th,
  .quote-table td {
    padding: 10px 7px;
    font-size: 0.8rem;
  }

  .quote-table .buy-back-price,
  .quote-table .sale-price,
  .quote-table .recycle-price {
    font-size: 0.92rem;
  }
}
