:root {
  --bg-base: #f7efe5;
  --bg-soft: #fff7ef;
  --surface: #fffdf9;
  --surface-2: #fff5e8;
  --line: #f3d8bf;
  --line-strong: #e8b98b;
  --text: #1f1f1f;
  --text-soft: #6e5d4f;
  --text-faint: #9c8a79;
  --brand-start: #ff7a18;
  --brand-end: #ff4f2f;
  --brand-ink: #812d1f;
  --score: #ff9900;
  --price: #db2a2a;
  --danger: #b42318;
  --ok: #0d8f62;
  --shadow-soft: 0 10px 30px rgb(51 31 11 / 8%);
  --shadow-card: 0 8px 18px rgb(75 36 10 / 10%);
  --page-gradient-start: #fef3e7;
  --page-gradient-mid: #fde2c7;
  --page-gradient-end: #ffd6bd;
  --blur-a: #ff9e67;
  --blur-b: #ffd3b1;
  --hero-border: var(--line-strong);
  --hero-gradient-start: #ff8a33;
  --hero-gradient-mid: #ff5f3b;
  --hero-gradient-end: #ff4551;
  --hero-tag-border: rgb(255 255 255 / 42%);
  --hero-tag-bg: rgb(255 255 255 / 16%);
  --panel-bg: rgb(255 252 247 / 92%);
  --product-card-bg: #fff;
  --product-card-line: #f5e5d5;
  --product-card-active: #fff8ef;
  --tag-rank-bg: #fff1de;
  --tag-rank-text: #955112;
  --tag-feature-bg: #ffece8;
  --tag-feature-text: #b8392b;
  --promo-bg: #fff1ef;
  --promo-text: #c3372d;
  --focus-ring: #ff9b5e;
  --modal-overlay: rgb(25 11 6 / 55%);
  --modal-border: #f0c9a5;
  --modal-bg: #fffaf4;
  --modal-shadow: 0 16px 36px rgb(45 21 7 / 22%);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: linear-gradient(140deg, var(--page-gradient-start) 0%, var(--page-gradient-mid) 52%, var(--page-gradient-end) 100%);
}

.bg-blur {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.bg-blur-a {
  top: -120px;
  right: -110px;
  background: var(--blur-a);
}

.bg-blur-b {
  left: -130px;
  bottom: -140px;
  background: var(--blur-b);
}

.mobile-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 14px 12px 22px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 16px 14px;
  border: 1px solid var(--hero-border);
  background:
    radial-gradient(circle at 95% -10%, rgb(255 255 255 / 65%) 0, rgb(255 255 255 / 0%) 42%),
    linear-gradient(130deg, var(--hero-gradient-start) 0%, var(--hero-gradient-mid) 52%, var(--hero-gradient-end) 100%);
  box-shadow: var(--shadow-card);
  color: #fff;
}

.hero-eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 1.3px;
  opacity: 0.85;
}

.hero-card h1 {
  margin: 6px 0 0;
  font-size: 24px;
  line-height: 1.2;
}

.hero-subtitle {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.95;
}

.hero-tags {
  margin-top: 10px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.hero-tags span {
  border: 1px solid var(--hero-tag-border);
  background: var(--hero-tag-bg);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
}

.panel-shell {
  margin-top: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-bg);
  box-shadow: var(--shadow-soft);
  padding: 10px;
}

.nav-shell {
  backdrop-filter: blur(8px);
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-toolbar {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.theme-toolbar .muted {
  margin: 0;
}

.theme-toggle-btn {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--brand-ink);
  font-size: 12px;
  font-weight: 700;
}

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

button,
select,
input {
  font: inherit;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  transition: all 0.2s ease;
}

button {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

button:hover {
  border-color: var(--line-strong);
}

button.primary {
  border: none;
  color: #fff;
  background: linear-gradient(130deg, var(--brand-start) 0%, var(--brand-end) 100%);
  box-shadow: 0 6px 14px rgb(219 74 39 / 26%);
}

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

button:disabled,
button.primary:disabled {
  cursor: not-allowed;
  border: 1px solid #e1d7ce;
  background: #e9e3db;
  color: #8d8378;
  box-shadow: none;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-soft);
}

.filters label {
  flex: 1;
  min-width: 120px;
}

.filters select,
.filters input {
  width: 100%;
}

.helper-text {
  margin: 7px 0 0;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
}

.section-head p {
  margin: 4px 0 8px;
  font-size: 12px;
  color: var(--text-soft);
}

.product-list {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
}

.product-card {
  display: flex;
  gap: 10px;
  align-items: stretch;
  padding: 11px;
  border-bottom: 1px solid var(--product-card-line);
  background: var(--product-card-bg);
  transition: transform 0.16s ease, background 0.16s ease;
}

.product-card:last-child {
  border-bottom: 0;
}

.product-card:active {
  transform: scale(0.987);
  background: var(--product-card-active);
}

.product-thumb-wrap {
  width: 25%;
  min-width: 88px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 14px rgb(74 33 11 / 16%);
}

.product-thumb {
  width: 100%;
  height: 114px;
  object-fit: cover;
  display: block;
}

.product-info {
  width: 75%;
  min-height: 114px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-top {
  display: flex;
  gap: 8px;
}

.product-name {
  margin: 0;
  font-size: 17px;
  line-height: 1.24;
  font-weight: 800;
  color: #2c1a10;
  flex: 1;
}

.product-rating {
  text-align: right;
  min-width: 68px;
}

.rating-score {
  color: var(--score);
  font-size: 14px;
  font-weight: 700;
}

.rating-reviews {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 11px;
}

.product-mid {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.product-meta {
  color: var(--text-soft);
  font-size: 12px;
}

.product-distance {
  color: #322014;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.product-tags {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
}

.tag-rank {
  background: var(--tag-rank-bg);
  color: var(--tag-rank-text);
}

.tag-feature {
  background: var(--tag-feature-bg);
  color: var(--tag-feature-text);
}

.product-bottom {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
}

.price-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price {
  color: var(--price);
  font-size: 23px;
  line-height: 1;
  font-weight: 900;
}

.origin-price {
  color: var(--text-faint);
  font-size: 12px;
  text-decoration: line-through;
}

.promo {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 3px 7px;
  background: var(--promo-bg);
  color: var(--promo-text);
  font-size: 11px;
  font-weight: 700;
}

.product-actions .view-detail {
  height: 32px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(130deg, var(--brand-start) 0%, var(--brand-end) 100%);
  color: #fff;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.admin-panel {
  margin-top: 10px;
}

.admin-block {
  margin-top: 8px;
  border-radius: 14px;
  border: 1px solid #f2d8c0;
  background: var(--surface);
  padding: 10px;
}

.admin-block h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.admin-form-grid label,
.admin-product-form label {
  display: grid;
  gap: 4px;
  align-items: initial;
}

.admin-form-grid input,
.admin-form-grid select,
.admin-product-form input {
  width: 100%;
}

.admin-marketing-grid {
  border-radius: 12px;
  padding: 8px;
  border: 1px dashed #edc7a9;
  background: var(--surface-2);
}

.admin-products-list {
  display: grid;
  gap: 10px;
}

.admin-product-item {
  border-radius: 12px;
  border: 1px solid #f1d7bf;
  padding: 10px;
  background: #fff;
}

.admin-product-title {
  margin: 0;
  font-size: 15px;
}

.admin-product-meta {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 12px;
}

.admin-product-form {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-product-actions {
  margin-top: 9px;
  display: flex;
  justify-content: flex-end;
}

.detail-panel {
  margin-top: 10px;
}

.detail-cover {
  width: 100%;
  max-height: 220px;
  border-radius: 12px;
  border: 1px solid #f2d8c0;
  object-fit: cover;
  margin-bottom: 10px;
}

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

.order-item {
  border-radius: 12px;
  border: 1px solid #f2d8c0;
  background: #fff;
  padding: 10px;
}

.empty-state {
  border-radius: 12px;
  background: #fff;
  color: var(--text-soft);
  text-align: center;
  padding: 24px 14px;
}

.muted {
  color: var(--text-soft);
  font-size: 12px;
}

.error {
  color: var(--danger);
  font-size: 13px;
}

.modal-mask {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--modal-overlay);
  backdrop-filter: blur(2px);
  z-index: 20;
  padding: 14px;
}

.modal {
  width: min(100%, 420px);
  border-radius: 16px;
  border: 1px solid var(--modal-border);
  background: var(--modal-bg);
  box-shadow: var(--modal-shadow);
  padding: 14px;
}

body.theme-business {
  --bg-base: #eff3f7;
  --bg-soft: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --line: #d8dee8;
  --line-strong: #8a96aa;
  --text: #1f2b3a;
  --text-soft: #4c5d73;
  --text-faint: #7f8ea3;
  --brand-start: #2f455c;
  --brand-end: #3f5f7d;
  --brand-ink: #233648;
  --score: #f1902f;
  --price: #c53636;
  --danger: #a62d2d;
  --shadow-soft: 0 10px 26px rgb(18 34 56 / 10%);
  --shadow-card: 0 16px 32px rgb(15 27 45 / 18%);
  --page-gradient-start: #f1f4f8;
  --page-gradient-mid: #e4ebf3;
  --page-gradient-end: #d8e2ed;
  --blur-a: #b7c7da;
  --blur-b: #c9d4e5;
  --hero-border: #aebdd1;
  --hero-gradient-start: #314a62;
  --hero-gradient-mid: #3f5f7d;
  --hero-gradient-end: #4f6f8e;
  --hero-tag-border: rgb(255 255 255 / 38%);
  --hero-tag-bg: rgb(255 255 255 / 12%);
  --panel-bg: rgb(255 255 255 / 92%);
  --product-card-bg: #fff;
  --product-card-line: #e5ebf3;
  --product-card-active: #f4f8fc;
  --tag-rank-bg: #edf2f9;
  --tag-rank-text: #36516d;
  --tag-feature-bg: #f4f7fb;
  --tag-feature-text: #4f6783;
  --promo-bg: #eef3f8;
  --promo-text: #37506a;
  --focus-ring: #5f7f9f;
  --modal-overlay: rgb(15 26 40 / 52%);
  --modal-border: #bcc7d5;
  --modal-bg: #f7fafe;
  --modal-shadow: 0 18px 42px rgb(12 24 40 / 24%);
}

.modal h3 {
  margin: 0 0 8px;
}

.modal-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 390px) {
  .hero-card h1 {
    font-size: 21px;
  }

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

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

  .product-thumb-wrap {
    min-width: 80px;
  }

  .product-name {
    font-size: 16px;
  }

  .price {
    font-size: 21px;
  }
}
