:root {
  --ink: #20201e;
  --muted: #77736d;
  --line: #e8e3dc;
  --paper: #faf9f6;
  --card: #ffffff;
  --accent: #d7654d;
  --accent-dark: #b94e38;
  --soft-accent: #f8e3dc;
  --shadow: 0 18px 45px rgba(56, 44, 31, 0.1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 8% -5%, #fff5e9 0, rgba(255, 245, 233, 0.35) 23%, transparent 42%), var(--paper);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 249, 246, 0.9);
  border-bottom: 1px solid rgba(232, 227, 220, 0.8);
  backdrop-filter: blur(14px);
}

.nav-bar { height: 72px; display: flex; align-items: center; gap: 18px; justify-content: space-between; }
.brand { font-size: 25px; font-weight: 800; letter-spacing: -1px; }
.brand span { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.search-form { flex: 1; display: flex; max-width: 560px; margin: 0 auto; }
.search-form input { min-width: 0; border-color: #ddd5ca; border-radius: 999px 0 0 999px; background: white; }
.search-form button { border: 0; padding: 0 20px; border-radius: 0 999px 999px 0; background: var(--accent); color: white; font-weight: 700; }
.account-button { border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; background: white; color: var(--ink); white-space: nowrap; }
.cart-button, .secondary-button, .primary-button {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.cart-button { background: var(--ink); color: white; }
.cart-button:hover, .primary-button:hover, .secondary-button:hover { transform: translateY(-1px); }
.cart-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 5px; padding: 0 5px; border-radius: 50%; background: var(--accent); font-size: 12px; }
.demo-banner { margin: 0 auto; padding: 10px 18px; background: #fff1dc; color: #854b13; font-size: 13px; font-weight: 750; text-align: center; }
.demo-banner.compact { margin: 10px 0 0; border-radius: 10px; font-size: 11px; }
.breadcrumbs { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.breadcrumbs a { color: var(--accent-dark); font-weight: 700; }
button:active { transform: scale(.97); }
.product-skeleton { display: grid; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.product-skeleton i { height: 180px; border-radius: 12px; background: linear-gradient(90deg,#eee 25%,#f7f7f7 50%,#eee 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.product-skeleton span { height: 14px; border-radius: 7px; background: #eee; }
.product-skeleton span:last-child { width: 65%; }

.hero { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 50px; align-items: center; padding-top: 92px; padding-bottom: 85px; }
.eyebrow { margin: 0 0 9px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 2px; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 620px; margin-bottom: 20px; font-size: clamp(38px, 6vw, 72px); line-height: 1.07; letter-spacing: -3px; }
h2 { margin-bottom: 8px; font-size: 30px; line-height: 1.2; letter-spacing: -1px; }
.hero-copy { max-width: 520px; color: var(--muted); font-size: 17px; }
.hero-button { display: inline-block; margin-top: 18px; }
.primary-button { background: var(--accent); color: white; box-shadow: 0 8px 20px rgba(215, 101, 77, 0.22); }
.primary-button:hover { background: var(--accent-dark); }
.primary-button:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }
.account-button:hover, .search-form button:hover { filter: brightness(0.96); }
.secondary-button { background: var(--soft-accent); color: var(--accent-dark); }
.hero-card { min-height: 260px; display: flex; flex-direction: column; justify-content: flex-end; padding: 28px; border-radius: 28px; background: linear-gradient(145deg, #e9c6ad, #f4e8d5); box-shadow: var(--shadow); }
.hero-card-icon { align-self: flex-end; margin-bottom: auto; color: white; font-size: 60px; line-height: 1; }
.hero-card strong { font-size: 27px; }
.hero-card span:last-child { color: #806c5e; }

.section { padding-bottom: 82px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 25px; }
.muted { color: var(--muted); }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.product-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--card); transition: transform 180ms ease, box-shadow 180ms ease; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-image { width: 100%; height: 210px; display: block; object-fit: cover; background: #eee8de; }
.product-body { padding: 17px; }
.product-name { margin-bottom: 7px; font-size: 17px; font-weight: 750; }
.product-description { min-height: 50px; margin-bottom: 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.product-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-size: 19px; font-weight: 800; }
.stock { margin-top: 6px; color: var(--muted); font-size: 12px; }
.small-button { border: 0; border-radius: 10px; padding: 9px 11px; background: var(--ink); color: white; font-size: 13px; }
.small-button:disabled { cursor: not-allowed; opacity: 0.45; }

.order-query-card { display: grid; grid-template-columns: 1fr auto; gap: 18px 35px; align-items: center; padding: 30px; border: 1px solid var(--line); border-radius: 24px; background: #f1ede6; }
.order-query-form { display: flex; gap: 9px; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; background: white; color: var(--ink); outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--soft-accent); }
.order-query-form input { width: 150px; }
.query-result { grid-column: 1 / -1; padding-top: 15px; border-top: 1px solid #ddd4c7; }

.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(31, 27, 22, 0.42); }
.cart-drawer { position: fixed; top: 0; right: 0; z-index: 21; width: min(430px, 100%); height: 100%; display: flex; flex-direction: column; padding: 28px; background: var(--paper); box-shadow: -15px 0 35px rgba(31, 27, 22, 0.13); transform: translateX(100%); transition: transform 220ms ease; }
.cart-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: start; justify-content: space-between; }
.drawer-header h2 { margin-bottom: 0; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--ink); font-size: 24px; line-height: 1; }
.cart-items { flex: 1; overflow: auto; padding: 25px 0; }
.empty-cart { padding: 70px 0; color: var(--muted); text-align: center; }
.empty-products { grid-column: 1 / -1; display: grid; justify-items: center; gap: 10px; padding: 45px 20px; border: 1px dashed var(--line); border-radius: 18px; background: white; text-align: center; }
.empty-products strong { color: var(--ink); font-size: 17px; }
.empty-illustration { display: grid; width: 55px; height: 55px; place-items: center; border-radius: 18px; background: #f8e3dc; color: var(--accent-dark); font-size: 32px; }
.search-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; color: var(--muted); font-size: 12px; }
.search-tools button { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--accent-dark); }
.search-tools label { display: flex; align-items: center; gap: 6px; margin-left: 5px; }
.search-tools input[type="number"] { width: 90px; padding: 5px 8px; }
.search-tools input[type="checkbox"] { width: auto; }
.back-to-top { position: fixed; right: max(22px, calc((100vw - 1120px)/2)); bottom: 28px; z-index: 15; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--ink); color: white; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s; }
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: none; }
.detail-gallery { display: grid; gap: 10px; }
.detail-thumbnails { display: flex; gap: 8px; }
.detail-thumbnails button { width: 58px; height: 58px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.detail-thumbnails img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
.detail-info-tabs { margin: 20px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.detail-info-tabs strong { display: block; margin: 8px 0; }
.detail-info-tabs p { margin: 4px 0; color: var(--muted); font-size: 12px; }
.detail-skeleton { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; min-height: 400px; }
.detail-skeleton > div:first-child { min-height: 350px; border-radius: 22px; background: linear-gradient(90deg,#eee 25%,#f7f7f7 50%,#eee 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.detail-skeleton i { display: block; height: 22px; margin: 20px 0; border-radius: 8px; background: #eee; }
.order-state-hint { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #fff7e9; color: #875718; font-size: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.cart-item-image { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: #eee8de; }
.cart-item-name { margin-bottom: 3px; font-size: 14px; font-weight: 700; }
.cart-item-price { color: var(--muted); font-size: 13px; }
.quantity-control { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.quantity-control button { width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; background: white; }
.quantity-control span { min-width: 16px; text-align: center; font-size: 13px; }
.cart-item-subtotal { align-self: start; font-size: 14px; font-weight: 750; }
.cart-footer { border-top: 1px solid var(--line); padding-top: 20px; }
.total-row { display: flex; justify-content: space-between; margin-bottom: 16px; font-size: 16px; }
.total-row strong { font-size: 22px; }
.full-width { width: 100%; }

.modal-backdrop { display: grid; place-items: center; padding: 20px; z-index: 30; }
.auth-modal { width: min(420px, 100%); padding: 28px; border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.auth-form { display: grid; gap: 15px; margin-top: 25px; }
.auth-form label { display: grid; gap: 6px; color: #555049; font-size: 13px; font-weight: 700; }
.account-panel { display: grid; gap: 12px; margin-top: 25px; padding: 18px; border-radius: 14px; background: #f0ece5; color: var(--muted); }
.account-panel p { margin: 0; font-size: 13px; }
.account-panel strong { color: var(--ink); font-size: 20px; }
.account-panel code { display: block; padding: 10px 12px; border-radius: 9px; background: var(--paper); color: var(--ink); font-size: 14px; letter-spacing: 1px; overflow-wrap: anywhere; }
.account-number-row { display: flex; align-items: center; gap: 8px; }
.account-number-row code { flex: 1; min-width: 0; }
.copy-button { flex: none; border: 1px solid #e2c6bb; border-radius: 9px; padding: 9px 11px; background: white; color: var(--accent-dark); font-size: 12px; font-weight: 700; cursor: pointer; }
.copy-button:hover { background: var(--soft-accent); }
.account-panel-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.account-panel-links a { padding: 9px 10px; text-align: center; font-size: 12px; }
.account-admin-link { display: block; text-align: center; }
.text-button { display: block; margin: 18px auto 0; border: 0; background: transparent; color: var(--accent-dark); cursor: pointer; font-size: 13px; }
.checkout-modal { width: min(470px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 28px; border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.checkout-form { display: grid; gap: 15px; margin-top: 25px; }
.checkout-form label { display: grid; gap: 6px; color: #555049; font-size: 13px; font-weight: 700; }
.field-hint { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.5; }
.checkout-summary { padding: 13px; border-radius: 12px; background: #f0ece5; color: #5b554f; font-size: 14px; }
.payment-modal { width: min(430px, 100%); padding: 28px; border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.payment-card { margin: 24px 0 18px; padding: 17px; border-radius: 15px; background: #f0ece5; color: var(--muted); }
.payment-card p { margin-bottom: 16px; font-size: 13px; }
.payment-order-line { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid #ddd4c7; }
.payment-order-line + .payment-order-line { margin-top: 10px; }
.payment-order-line strong { color: var(--ink); }
.payment-total { color: var(--accent-dark) !important; font-size: 22px; }
.query-pay-button { margin-left: 10px; }
.form-message { min-height: 22px; margin: 0; color: var(--accent-dark); font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 40; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: white; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.admin-nav { justify-content: flex-start; }
.admin-nav > strong { margin-right: auto; }
.admin-main { padding-top: 55px; padding-bottom: 80px; }
.admin-title { margin-bottom: 12px; font-size: clamp(32px, 5vw, 52px); }
.admin-panel { margin-bottom: 24px; padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: 0 10px 30px rgba(56, 44, 31, 0.05); }
.admin-login-form, .admin-product-form { display: grid; gap: 16px; max-width: 760px; margin-top: 25px; }
.admin-login-form label, .admin-product-form label { display: grid; gap: 6px; color: #555049; font-size: 13px; font-weight: 700; }
.admin-page-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.admin-count { color: var(--accent-dark); font-size: 18px; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-form-wide { grid-column: 1 / -1; }
.admin-form-actions { display: flex; align-items: center; gap: 15px; }
.admin-form-actions .form-message { flex: 1; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 14px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.admin-table th { color: var(--muted); font-size: 12px; font-weight: 700; }
.admin-table td:first-child { min-width: 220px; white-space: normal; }
.admin-table small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.status-pill { display: inline-block; padding: 4px 9px; border-radius: 999px; font-size: 12px; }
.status-pill.is-active { background: #e2f3e7; color: #24723d; }
.status-pill.is-offline { background: #eee9e3; color: var(--muted); }
.admin-order-toolbar { display: flex; align-items: center; gap: 9px; }
.admin-order-toolbar select { min-width: 125px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: white; color: var(--ink); }
.admin-order-table td:nth-child(2) { min-width: 180px; white-space: normal; }
.admin-order-table td:nth-child(3) { min-width: 220px; white-space: normal; }
.admin-order-table .order-status.paid { background: #e2f3e7; color: #24723d; }
.admin-order-table .order-status.pending { background: var(--soft-accent); color: var(--accent-dark); }
.admin-order-table .order-status.shipped { background: #e3edf8; color: #27618f; }
.admin-order-table .order-status.cancelled { background: #eee9e3; color: var(--muted); }

@media (max-width: 850px) {
  .search-form { max-width: none; }
  .hero { grid-template-columns: 1fr; padding-top: 60px; padding-bottom: 55px; }
  .hero-card { min-height: 190px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
  .container { width: min(100% - 28px, 1120px); }
  .nav-bar { height: auto; flex-wrap: wrap; padding: 12px 0; }
  .search-form { order: 3; flex-basis: 100%; }
  .header-actions { margin-left: auto; }
  .account-button { padding: 9px 10px; font-size: 12px; }
  .cart-button { padding: 9px 12px; font-size: 12px; }
  h1 { font-size: 43px; letter-spacing: -2px; }
  .section-heading, .order-query-card { display: block; }
  .section-heading .muted { margin-top: 8px; }
  .product-grid { gap: 10px; }
  .product-image { height: 145px; }
  .product-body { padding: 12px; }
  .product-description { min-height: 68px; }
  .product-bottom { align-items: end; flex-direction: column; }
  .small-button { width: 100%; }
  .order-query-form { margin-top: 18px; }
  .order-query-form input { flex: 1; width: auto; }
  .admin-page-heading, .admin-form-actions { display: block; }
  .admin-page-heading > button { margin-top: 18px; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-form-wide { grid-column: auto; }
  .admin-form-actions .form-message { margin-top: 10px; }
  .admin-order-toolbar { align-items: stretch; flex-direction: column; margin-top: 15px; }
}

/* Marketplace-style storefront */
.market-nav { display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.market-nav a { color: var(--muted); font-size: 14px; font-weight: 700; }
.market-nav a:hover, .market-nav a.active { color: var(--accent-dark); }
.market-hero { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 42px; align-items: stretch; padding-top: 48px; padding-bottom: 42px; }
.market-hero-main { padding: 35px 0 22px; }
.market-hero h1 { max-width: none; margin-bottom: 18px; font-size: clamp(42px, 6vw, 70px); letter-spacing: -4px; }
.market-hero h1 span { color: var(--accent); }
.market-hero .hero-copy { max-width: 570px; margin-bottom: 0; font-size: 16px; }
.market-promo-card { min-height: 265px; display: flex; flex-direction: column; justify-content: end; padding: 30px; border-radius: 28px; background: linear-gradient(135deg, #e8c0a5, #f7e8d0); box-shadow: var(--shadow); }
.market-promo-card p { margin: 0 0 3px; color: #806c5e; font-size: 13px; letter-spacing: 2px; }
.market-promo-card strong { font-size: 31px; letter-spacing: -1px; }
.market-promo-card span { margin-top: 8px; color: #806c5e; font-size: 13px; }
.promo-orbit { align-self: end; margin-bottom: auto; color: white; font-size: 72px; line-height: 1; }
.market-trust-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.trust-item { display: flex; align-items: center; gap: 12px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.78); }
.trust-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 11px; background: var(--soft-accent); color: var(--accent-dark); font-size: 11px; font-weight: 800; }
.trust-item strong, .trust-item small { display: block; }
.trust-item strong { font-size: 14px; }
.trust-item small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.category-nav { display: flex; align-items: center; gap: 24px; margin-bottom: 32px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 8px 24px rgba(56, 44, 31, 0.05); }
.category-nav-title { flex: 0 0 145px; display: grid; gap: 1px; }
.category-nav-title .eyebrow { margin-bottom: 0; font-size: 9px; letter-spacing: 1.3px; }
.category-nav-title strong { font-size: 16px; }
.category-nav-list { display: flex; flex: 1; align-items: center; gap: 8px; flex-wrap: wrap; }
.category-nav-list button { border: 1px solid transparent; border-radius: 999px; padding: 8px 15px; background: #f7f3ee; color: var(--muted); font-size: 13px; cursor: pointer; }
.category-nav-list button:hover, .category-nav-list button.active { border-color: #f0c5b8; background: var(--soft-accent); color: var(--accent-dark); }
.market-section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.market-section-heading h2 { margin-bottom: 0; }
.category-tabs, .sort-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.category-tabs { margin-bottom: 15px; padding: 6px; border-radius: 15px; background: #f0ece5; }
.category-tabs button, .sort-tabs button { border: 0; border-radius: 10px; padding: 9px 15px; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.category-tabs button.active, .category-tabs button:hover { background: white; color: var(--accent-dark); box-shadow: 0 3px 12px rgba(56, 44, 31, 0.08); }
.sort-tabs button.active, .sort-tabs button:hover { color: var(--accent-dark); background: var(--soft-accent); }
.product-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.market-note { color: var(--muted); font-size: 12px; }
.product-card { border-color: #ebe4da; border-radius: 16px; }
.product-image-frame { position: relative; overflow: hidden; background: #f0ece5; }
.product-image { height: 220px; transition: transform 240ms ease; }
.product-card:hover .product-image { transform: scale(1.035); }
.product-badge { position: absolute; top: 12px; left: 12px; z-index: 1; padding: 4px 8px; border-radius: 7px; background: rgba(255, 255, 255, 0.9); color: var(--accent-dark); font-size: 11px; font-weight: 800; }
.product-body { display: flex; flex-direction: column; min-height: 250px; padding: 15px 16px 17px; }
.product-category { margin-bottom: 4px; color: var(--accent); font-size: 11px; font-weight: 800; }
.product-name { min-height: 27px; margin-bottom: 5px; font-size: 16px; }
.product-description { min-height: 43px; margin-bottom: 10px; font-size: 12px; }
.product-market-line { display: flex; justify-content: space-between; margin-bottom: 12px; color: var(--muted); font-size: 11px; }
.product-buy-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-buy-row .price { color: var(--accent-dark); font-size: 21px; }
.buy-now-button { width: 100%; margin-top: 9px; border: 1px solid #f0c5b8; border-radius: 9px; padding: 7px; background: #fff7f3; color: var(--accent-dark); font-size: 12px; font-weight: 750; }
.buy-now-button:hover { background: var(--soft-accent); }
.buy-now-button:disabled { cursor: not-allowed; opacity: 0.45; }
.empty-products { grid-column: 1 / -1; padding: 50px 0; text-align: center; }
.site-footer { margin-top: 10px; padding: 30px 0 38px; border-top: 1px solid var(--line); background: rgba(245, 240, 233, 0.62); }
.site-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-footer .brand { font-size: 20px; }
.site-footer p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.site-footer nav { display: flex; gap: 18px; color: var(--muted); font-size: 12px; }
.site-footer nav a:hover { color: var(--accent-dark); }

@media (max-width: 900px) {
  .market-nav { display: none; }
  .market-hero { grid-template-columns: 1fr 0.8fr; gap: 22px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .market-trust-bar { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .market-hero { grid-template-columns: 1fr; padding-top: 28px; }
  .market-hero-main { padding-top: 10px; }
  .market-promo-card { min-height: 180px; }
  .category-nav { align-items: start; flex-direction: column; gap: 10px; }
  .category-nav-title { flex-basis: auto; }
  .market-section-heading { align-items: start; flex-direction: column; gap: 7px; }
  .product-toolbar { align-items: start; flex-direction: column; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .product-image { height: 155px; }
  .product-body { padding: 12px; }
  .product-description { min-height: 62px; }
  .product-buy-row { align-items: stretch; flex-direction: column; }
  .product-buy-row .small-button { width: 100%; }
  .trust-item { padding: 13px 14px; }
  .site-footer-inner { align-items: start; flex-direction: column; }
  .site-footer nav { flex-wrap: wrap; gap: 12px; }
}

@media (max-width: 420px) {
  .product-grid { grid-template-columns: 1fr; }
}

.auth-agreement { display: flex !important; grid-template-columns: none !important; align-items: start; gap: 8px; color: var(--muted) !important; font-size: 12px !important; font-weight: 400 !important; }
.auth-agreement input { width: auto; margin-top: 4px; }
.product-link { display: block; color: inherit; }
.product-link:hover { color: var(--accent-dark); }
.detail-nav { justify-content: space-between; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--muted); font-size: 14px; }
.back-link:hover { color: var(--accent-dark); }
.product-detail-main { padding-top: 42px; padding-bottom: 80px; }
.product-detail-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 48px; padding: 28px; border: 1px solid var(--line); border-radius: 26px; background: white; box-shadow: var(--shadow); }
.detail-image-wrap { overflow: hidden; border-radius: 18px; background: #f0ece5; }
.detail-image { width: 100%; height: min(540px, 60vw); display: block; object-fit: cover; }
.detail-content { display: flex; flex-direction: column; justify-content: center; }
.detail-content h1 { margin-bottom: 15px; font-size: clamp(32px, 5vw, 54px); letter-spacing: -2px; }
.detail-description { color: var(--muted); font-size: 16px; }
.detail-price { margin: 20px 0 6px; color: var(--accent-dark); font-size: 34px; font-weight: 800; }
.detail-meta { display: flex; gap: 18px; margin-bottom: 25px; color: var(--muted); font-size: 13px; }
.detail-buy-row { display: flex; align-items: end; gap: 10px; }
.quantity-picker { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.quantity-picker input { width: 80px; padding: 10px; }
.detail-notice { display: grid; gap: 4px; margin-top: 26px; padding: 15px; border-radius: 13px; background: #f8f1e9; color: var(--muted); font-size: 12px; }
.detail-notice strong { color: var(--ink); }
.orders-main { padding-top: 48px; padding-bottom: 80px; }
.orders-heading { margin-bottom: 25px; }
.orders-heading h1 { margin-bottom: 10px; font-size: clamp(36px, 6vw, 58px); }
.orders-panel { min-height: 260px; padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: white; }
.order-list { display: grid; gap: 13px; margin-top: 18px; }
.order-card { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fffdf9; }
.order-card-head, .order-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.order-card-head strong { display: block; }
.order-card-head span:not(.order-status) { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.order-card-bottom { margin-top: 17px; }
.order-card-bottom > strong { color: var(--accent-dark); font-size: 22px; }
.order-actions { display: flex; gap: 8px; }
.order-actions button { padding: 8px 12px; font-size: 12px; }
.order-status { padding: 5px 10px; border-radius: 999px; font-size: 12px; }
.order-status.paid { background: #e2f3e7; color: #24723d; }
.order-status.pending { background: var(--soft-accent); color: var(--accent-dark); }
.order-status.shipped { background: #e3edf8; color: #27618f; }
.order-status.cancelled { background: #eee9e3; color: var(--muted); }
.order-detail { margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.order-item-line { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.empty-orders { padding: 65px 0; color: var(--muted); text-align: center; }

@media (max-width: 720px) {
  .product-detail-card { grid-template-columns: 1fr; gap: 24px; padding: 16px; }
  .detail-image { height: 60vw; max-height: 360px; }
}
@media (max-width: 420px) {
  .container { width: calc(100% - 26px); }
  .demo-banner { padding: 9px 10px; font-size: 11px; }
  .search-tools { gap: 6px; }
  .search-tools label { margin-left: 0; }
  .product-detail-card { grid-template-columns: 1fr; gap: 18px; }
  .detail-skeleton { grid-template-columns: 1fr; min-height: 0; }
  .detail-skeleton > div:first-child { min-height: 250px; }
  .detail-buy-row { flex-wrap: wrap; }
  .detail-buy-row button { flex: 1 1 130px; min-height: 44px; }
  .order-actions { flex-wrap: wrap; gap: 6px; }
}

@media (max-width: 520px) {
  .detail-buy-row { align-items: stretch; flex-wrap: wrap; }
  .detail-buy-row .primary-button, .detail-buy-row .secondary-button { flex: 1; }
  .order-card-head, .order-card-bottom { align-items: start; flex-direction: column; }
  .order-actions { width: 100%; }
  .order-actions button { flex: 1; }
}

.pagination { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 28px; }
.pagination button { min-width: 36px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); cursor: pointer; }
.pagination button:hover, .pagination button.active { border-color: var(--ink); background: var(--ink); color: white; }
.pagination button:disabled { cursor: not-allowed; opacity: 0.4; }
.pagination span { padding: 0 3px; color: var(--muted); }
.admin-product-form, .admin-import-form { display: grid; gap: 15px; margin-top: 18px; }
.admin-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.admin-product-form label, .admin-import-form label { display: grid; gap: 6px; color: #555049; font-size: 13px; font-weight: 700; }
.admin-product-form textarea { width: 100%; resize: vertical; }
.admin-form-actions { display: flex; align-items: center; gap: 14px; }
.admin-form-actions .form-message { margin: 0; }
.admin-help { margin: 0; font-size: 12px; line-height: 1.6; }
.admin-help code { padding: 2px 5px; border-radius: 5px; background: #f5f0e9; color: var(--accent-dark); font-size: 11px; }
.admin-input-with-action { display: flex; gap: 8px; }
.admin-input-with-action input { min-width: 0; }
.admin-input-with-action button { flex: none; padding: 9px 12px; font-size: 12px; white-space: nowrap; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; }
.admin-stat-card { min-height: 132px; display: flex; flex-direction: column; justify-content: center; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: #fffaf3; }
.admin-stat-card span { color: var(--muted); font-size: 13px; }
.admin-stat-card strong { margin-top: 3px; color: var(--accent-dark); font-size: 28px; line-height: 1.2; }
.admin-stat-card small { margin-top: 7px; color: var(--muted); font-size: 11px; }
.admin-dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px; margin-top: 28px; }
.admin-subheading { margin-bottom: 10px; font-size: 17px; }
.admin-compact-table th, .admin-compact-table td { padding: 10px 8px; font-size: 12px; }
.admin-compact-table td:first-child { min-width: 0; }
.admin-compact-table small { display: block; color: var(--muted); font-size: 10px; }
.admin-import-options { display: grid; grid-template-columns: minmax(180px, 250px) 1fr; align-items: end; gap: 16px; }
.admin-import-options label { display: grid; gap: 6px; color: #555049; font-size: 13px; font-weight: 700; }
.admin-import-options .admin-help { margin-bottom: 0; }
.admin-import-preview { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fffdf9; }
.admin-import-preview > p { margin-bottom: 10px; font-size: 12px; }
.csv-preview-action { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11px; }
.csv-preview-action.is-ok { background: #e2f3e7; color: #24723d; }
.csv-preview-action.is-warning { background: #fff0c9; color: #8a6411; }
.csv-preview-action.is-error { background: #fde1df; color: #a43c35; }
.admin-import-preview code { padding: 2px 4px; border-radius: 4px; background: #f5f0e9; font-size: 11px; }

/* Seller center */
.seller-main { padding-top: 50px; padding-bottom: 85px; }
.seller-heading { margin-bottom: 26px; }
.seller-heading h1 { margin-bottom: 10px; font-size: clamp(38px, 6vw, 60px); }
.seller-card { padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: 0 10px 30px rgba(56, 44, 31, 0.05); }
.seller-register-card { max-width: 760px; }
.seller-login-card { padding: 60px 25px; text-align: center; }
.seller-login-card h2 { margin-bottom: 8px; }
.seller-login-card .primary-button { display: inline-block; margin-top: 14px; }
.seller-card-heading, .seller-shop-summary { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.seller-card-heading h2, .seller-shop-summary h2 { margin-bottom: 0; }
.seller-step { padding: 5px 10px; border-radius: 999px; background: var(--soft-accent); color: var(--accent-dark); font-size: 11px; font-weight: 800; white-space: nowrap; }
.seller-intro { margin: 10px 0 0; font-size: 13px; }
.seller-form { display: grid; gap: 15px; margin-top: 20px; }
.seller-form label { display: grid; gap: 6px; color: #555049; font-size: 13px; font-weight: 700; }
.seller-form textarea { width: 100%; resize: vertical; }
.seller-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.seller-form-actions { display: flex; align-items: center; gap: 14px; }
.seller-form-actions .form-message { margin: 0; }
.seller-shop-summary { align-items: start; }
.seller-shop-summary h2 { margin-bottom: 5px; }
.seller-shop-summary p { max-width: 700px; margin-bottom: 0; }
.seller-shop-meta { display: grid; justify-items: end; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.seller-status-badge { padding: 5px 10px; border-radius: 999px; background: #edf7ee; color: #3e7a4c; font-size: 11px; font-weight: 800; }
.seller-divider { height: 1px; margin: 28px 0; background: var(--line); }
.seller-table-wrap { overflow-x: auto; margin-top: 16px; }
.seller-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.seller-table th, .seller-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
.seller-table th { color: var(--muted); font-size: 11px; font-weight: 800; }
.seller-product-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.seller-product-cell > span { display: grid; gap: 2px; }
.seller-product-cell small { color: var(--muted); font-size: 11px; }
.seller-product-thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: #eee8de; }
.seller-message { margin-top: 16px; text-align: center; }

/* Personal account center */
.account-main { padding-top: 50px; padding-bottom: 85px; }
.account-heading { margin-bottom: 26px; }
.account-heading h1 { margin-bottom: 10px; font-size: clamp(38px, 6vw, 60px); }
.account-card { border: 1px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: 0 10px 30px rgba(56, 44, 31, 0.05); }
.account-profile { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(250px, 0.8fr) auto; align-items: center; gap: 20px; padding: 25px; }
.account-avatar-column { display: grid; justify-items: center; gap: 8px; }
.account-avatar { position: relative; width: 82px; height: 82px; display: grid; place-items: center; overflow: hidden; border-radius: 25px; background: linear-gradient(135deg, var(--accent), #efb193); color: white; font-size: 34px; font-weight: 800; box-shadow: 0 9px 22px rgba(215, 101, 77, 0.22); }
.account-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.account-avatar-button { padding: 6px 10px; font-size: 11px; cursor: pointer; }
.account-profile-copy h2 { margin-bottom: 4px; font-size: 27px; }
.account-profile-copy p { margin-bottom: 0; }
.account-status-badge { display: inline-flex; margin-top: 10px; padding: 5px 9px; border-radius: 999px; background: #edf7ee; color: #3e7a4c; font-size: 11px; font-weight: 700; }
.account-id-box { padding: 14px 16px; border-radius: 15px; background: #f5f0e9; }
.account-id-box > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.account-id-box code { flex: 1; min-width: 0; color: var(--ink); font-size: 18px; font-weight: 800; letter-spacing: 1.5px; overflow-wrap: anywhere; }
.account-id-box small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.account-profile-actions { display: grid; gap: 8px; min-width: 120px; }
.account-profile-actions a { padding: 9px 13px; text-align: center; font-size: 12px; }
.account-logout-button { margin: 0; padding: 2px; font-size: 12px; }
.account-settings-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr); gap: 18px; margin-top: 18px; }
.account-settings-card, .account-guide-card { padding: 25px; }
.account-profile-form { display: grid; gap: 13px; margin-top: 18px; }
.account-profile-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.account-profile-form input { width: 100%; }
.account-profile-form .primary-button { justify-self: start; padding: 10px 18px; }
.account-help { margin: 0; font-size: 12px; line-height: 1.6; }
.account-guide-card h2 { margin: 5px 0 18px; }
.account-guide-list { display: grid; gap: 12px; }
.account-guide-list div { display: grid; gap: 4px; padding: 13px 14px; border-radius: 14px; background: #fffaf3; }
.account-guide-list strong { font-size: 13px; }
.account-guide-list span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.account-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; margin: 18px 0; }
.account-stat { min-height: 123px; display: flex; flex-direction: column; justify-content: center; padding: 18px; }
.account-stat span { color: var(--muted); font-size: 13px; }
.account-stat strong { margin-top: 2px; color: var(--accent-dark); font-size: 30px; line-height: 1.2; }
.account-stat small { margin-top: 6px; color: var(--muted); font-size: 11px; }
.account-orders-card { padding: 25px; }
.account-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; }
.account-section-heading h2 { margin-bottom: 0; }
.account-section-heading a { padding: 9px 13px; font-size: 12px; }
.account-orders-card > .muted { margin: 18px 0 0; font-size: 13px; }
.account-order-list { display: grid; gap: 10px; margin-top: 14px; }
.account-order-item { display: grid; grid-template-columns: minmax(160px, 1.3fr) auto auto auto; align-items: center; gap: 15px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fffdf9; }
.account-order-main strong, .account-order-main span { display: block; }
.account-order-main span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.account-order-total { min-width: 85px; color: var(--accent-dark); text-align: right; }
.account-order-item .small-button { padding: 8px 12px; text-align: center; }
.account-login-card { padding: 60px 25px; text-align: center; }
.account-empty-icon { width: 55px; height: 55px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 50%; background: var(--soft-accent); color: var(--accent); font-size: 30px; }
.account-login-card h2 { margin-bottom: 8px; }
.account-login-card .primary-button { display: inline-block; margin-top: 14px; }
.account-message { margin-top: 16px; text-align: center; }

@media (max-width: 720px) {
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-form-actions { align-items: stretch; flex-direction: column; }
  .admin-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-dashboard-grid, .admin-import-options { grid-template-columns: 1fr; }
  .seller-form-grid { grid-template-columns: 1fr; }
  .seller-shop-summary { align-items: start; flex-direction: column; }
  .seller-shop-meta { justify-items: start; }
  .seller-form-actions { align-items: stretch; flex-direction: column; }
  .account-profile { grid-template-columns: auto 1fr; }
  .account-id-box, .account-profile-actions { grid-column: 1 / -1; }
  .account-settings-grid { grid-template-columns: 1fr; }
  .account-profile-actions { grid-template-columns: 1fr 1fr; align-items: center; }
  .account-profile-actions .account-logout-button { grid-column: 1 / -1; }
  .account-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-order-item { grid-template-columns: 1fr auto; }
  .account-order-total { text-align: left; }
}

@media (max-width: 480px) {
  .seller-card { padding: 18px; }
  .seller-card-heading { align-items: start; flex-direction: column; }
  .account-profile, .account-orders-card { padding: 18px; }
  .account-profile { gap: 14px; }
  .account-avatar { width: 62px; height: 62px; border-radius: 19px; font-size: 25px; }
  .account-profile-copy h2 { font-size: 22px; }
  .account-stats { gap: 9px; }
  .account-stat { min-height: 108px; padding: 14px; }
  .account-section-heading { align-items: start; flex-direction: column; }
  .account-section-heading a { width: 100%; text-align: center; }
  .account-order-item { gap: 8px; padding: 13px; }
  .account-order-item .order-status { justify-self: end; }
  .account-order-item .small-button { grid-column: 2; }
}

/* Unified storefront polish */
:root {
  --ink: #202724;
  --muted: #68736e;
  --line: #dfe7e2;
  --paper: #f6f8f6;
  --card: #ffffff;
  --accent: #d85d4c;
  --accent-dark: #b84538;
  --soft-accent: #fff0ec;
  --teal: #21756f;
  --teal-soft: #e7f4f1;
  --shadow: 0 14px 32px rgba(29, 46, 39, 0.08);
}

body {
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
}

h1, h2, h3, .brand { letter-spacing: 0; }
h1 { line-height: 1.12; }
h2 { line-height: 1.25; }

.site-header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: var(--line);
  box-shadow: 0 2px 14px rgba(29, 46, 39, 0.04);
}

.nav-bar { min-height: 70px; }
.brand { color: var(--ink); font-size: 24px; }
.brand span { color: var(--accent); }
.market-nav a { transition: color 160ms ease; }
.market-nav a.active { color: var(--accent-dark); }

.search-form input,
input, textarea, select {
  border-color: var(--line);
  background: #fff;
}

.search-form input:focus,
input:focus, textarea:focus, select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.search-form button,
.primary-button { background: var(--accent); }
.search-form button:hover,
.primary-button:hover { background: var(--accent-dark); filter: none; }

.primary-button, .secondary-button, .cart-button, .account-button,
.small-button, .buy-now-button, .copy-button {
  border-radius: 9px;
  font-weight: 700;
}

.secondary-button {
  border: 1px solid #f1c8be;
  background: var(--soft-accent);
  color: var(--accent-dark);
}
.secondary-button:hover { background: #ffe5df; }
.cart-button { background: var(--ink); }
.account-button { border-color: var(--line); }
.small-button { background: var(--ink); }
.small-button:hover { background: #39423e; }

button:focus-visible, a:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(33, 117, 111, 0.25);
  outline-offset: 2px;
}

.market-hero { padding-top: 58px; padding-bottom: 48px; }
.market-hero-main { padding-top: 20px; }
.market-hero h1 { font-size: clamp(42px, 6vw, 66px); }
.market-hero h1 span { color: var(--teal); }
.market-hero .hero-copy { color: #60706a; }
.market-promo-card {
  min-height: 245px;
  border: 1px solid #c9e1dc;
  border-radius: 16px;
  background: var(--teal-soft);
  box-shadow: none;
}
.market-promo-card p, .market-promo-card span { color: var(--teal); }
.market-promo-card strong { color: #174f4a; }
.promo-orbit { color: var(--teal); }

.market-trust-bar { margin-bottom: 28px; }
.trust-item {
  border-color: var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(29, 46, 39, 0.04);
}
.trust-icon { background: var(--teal-soft); color: var(--teal); }

.category-nav {
  border-color: var(--line);
  border-radius: 13px;
  box-shadow: none;
}
.category-nav-list button { border-radius: 8px; }
.category-nav-list button:hover,
.category-nav-list button.active { border-color: #b9dcd6; background: var(--teal-soft); color: var(--teal); }
.category-tabs { border: 1px solid var(--line); background: #edf2ef; }
.category-tabs button { border-radius: 8px; }
.category-tabs button.active, .category-tabs button:hover { color: var(--teal); }
.sort-tabs button.active, .sort-tabs button:hover { color: var(--teal); background: var(--teal-soft); }
.market-note { color: var(--teal); }

.product-grid { gap: 16px; }
.product-card {
  border-color: var(--line);
  border-radius: 13px;
  box-shadow: 0 4px 16px rgba(29, 46, 39, 0.04);
}
.product-card:hover { box-shadow: var(--shadow); }
.product-image-frame { background: #edf2ef; }
.product-image { aspect-ratio: 4 / 3; height: auto; }
.product-badge { border: 1px solid #f2d2ca; color: var(--accent-dark); }
.product-category { color: var(--teal); }
.product-name:hover { color: var(--teal); }
.product-buy-row .price { color: var(--accent-dark); }
.buy-now-button { border-color: #c9e1dc; background: #f4fbf9; color: var(--teal); }
.buy-now-button:hover { background: var(--teal-soft); }

.order-query-card {
  border-color: var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(29, 46, 39, 0.04);
}
.query-result { border-top-color: var(--line); }
.site-footer { background: #edf2ef; border-top-color: var(--line); }

.cart-drawer, .auth-modal, .checkout-modal, .payment-modal {
  background: #fff;
}
.cart-drawer { box-shadow: -16px 0 34px rgba(29, 46, 39, 0.14); }
.icon-button { border-color: var(--line); }
.icon-button:hover { border-color: #f1c8be; background: var(--soft-accent); color: var(--accent-dark); }
.account-panel, .checkout-summary, .payment-card { background: #f1f6f3; }
.detail-notice { background: var(--teal-soft); }
.detail-notice strong { color: var(--teal); }

.product-detail-card, .orders-panel, .order-card,
.admin-panel, .seller-card, .account-card {
  border-color: var(--line);
  border-radius: 14px;
  box-shadow: 0 6px 22px rgba(29, 46, 39, 0.05);
}
.product-detail-card { padding: 24px; }
.detail-image-wrap { border-radius: 12px; background: #edf2ef; }
.detail-price, .order-card-bottom > strong, .account-stat strong,
.admin-stat-card strong { color: var(--accent-dark); }
.detail-meta span:first-child { color: var(--teal); font-weight: 700; }
.back-link:hover { color: var(--teal); }

.order-card { background: #fff; }
.order-card:hover, .account-order-item:hover { border-color: #c9e1dc; }
.order-status.paid, .admin-order-table .order-status.paid { background: var(--teal-soft); color: var(--teal); }
.order-status.pending, .admin-order-table .order-status.pending { background: var(--soft-accent); color: var(--accent-dark); }
.order-status.shipped, .admin-order-table .order-status.shipped { background: #e8f0fb; color: #286292; }
.order-status.cancelled { background: #eef1ef; color: var(--muted); }
.order-detail { border-top-color: var(--line); }

.admin-main, .seller-main, .account-main, .orders-main { padding-top: 42px; }
.admin-title, .seller-heading h1, .account-heading h1, .orders-heading h1 { letter-spacing: 0; }
.admin-panel { background: #fff; }
.admin-page-heading { margin-bottom: 28px; }
.admin-stat-card {
  min-height: 124px;
  border-color: var(--line);
  border-radius: 12px;
  background: #f5faf7;
}
.admin-stat-card:nth-child(3) { background: #fff8ed; }
.admin-stat-card:nth-child(3) strong { color: #a66a13; }
.admin-stat-card:nth-child(5) { background: var(--soft-accent); }
.admin-subheading { color: var(--teal); }
.admin-table th { color: var(--teal); }
.admin-table th, .admin-table td { border-bottom-color: var(--line); }
.admin-import-preview { border-color: var(--line); background: #f8fbf9; }
.status-pill.is-active { background: var(--teal-soft); color: var(--teal); }
.status-pill.is-offline { background: #eef1ef; }
.admin-help code { background: var(--teal-soft); color: var(--teal); }

.seller-status-badge, .account-status-badge { background: var(--teal-soft); color: var(--teal); }
.seller-step { background: var(--soft-accent); color: var(--accent-dark); }
.seller-divider { background: var(--line); }
.seller-product-thumb { border: 1px solid var(--line); }
.account-avatar { background: var(--teal); box-shadow: 0 9px 22px rgba(33, 117, 111, 0.18); }
.account-id-box { background: #f1f6f3; }
.account-guide-list div { background: #f7faf8; }
.account-stat { border-radius: 12px; }
.account-order-item { border-color: var(--line); background: #fff; }
.account-empty-icon { background: var(--teal-soft); color: var(--teal); }

.toast { border-radius: 9px; background: var(--ink); box-shadow: var(--shadow); }
.pagination button:hover, .pagination button.active { border-color: var(--teal); background: var(--teal); }

@media (max-width: 640px) {
  .market-hero { padding-top: 30px; padding-bottom: 30px; }
  .market-hero h1 { font-size: 44px; }
  .market-promo-card { min-height: 170px; padding: 22px; }
  .product-image { aspect-ratio: 1 / 1; }
  .product-card { border-radius: 11px; }
  .product-badge { top: 8px; left: 8px; }
  .product-name { font-size: 15px; }
  .product-description { font-size: 11px; }
  .admin-panel, .seller-card, .account-card, .orders-panel { border-radius: 12px; }
}

/* Taobao/JD-style storefront navigation */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 15;
  width: min(560px, calc(100% - 32px));
  padding: 7px;
  border: 1px solid rgba(223, 231, 226, 0.96);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(29, 46, 39, 0.14);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}
.bottom-nav-inner { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.bottom-nav-item {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 48px;
  padding: 4px 3px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}
.bottom-nav-item:hover, .bottom-nav-item.active { background: var(--teal-soft); color: var(--teal); }
.bottom-nav-icon { display: block; height: 21px; font-size: 20px; font-weight: 500; line-height: 21px; }
.bottom-nav-icon-wrap { position: relative; height: 21px; }
.bottom-nav-badge {
  position: absolute;
  top: -6px;
  right: -13px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}
.message-modal {
  width: min(440px, 100%);
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow);
}
.message-list { display: grid; gap: 10px; margin: 22px 0 18px; }
.message-item { display: grid; grid-template-columns: 38px 1fr; gap: 11px; padding: 13px; border-radius: 12px; background: #f5faf7; }
.message-item-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--teal); color: white; font-size: 12px; font-weight: 800; }
.message-item-icon.is-warm { background: var(--accent); }
.message-item strong, .message-item p, .message-item small { display: block; }
.message-item strong { font-size: 13px; }
.message-item p { margin: 2px 0 1px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.message-item small { color: #91a099; font-size: 10px; }
.market-hero { padding-top: 30px; padding-bottom: 28px; }
.market-hero-main { padding-top: 18px; }
.market-hero h1 { font-size: clamp(36px, 5vw, 58px); letter-spacing: -1px; }
.market-hero .hero-copy { font-size: 15px; }
.market-promo-card { min-height: 190px; border-radius: 16px; }
.promo-orbit { font-size: 42px; font-weight: 800; }
.site-footer { padding-bottom: 110px; }

@media (min-width: 721px) {
  .bottom-nav { bottom: 22px; }
}

@media (max-width: 720px) {
  body { padding-bottom: 78px; }
  .site-header { position: sticky; top: 0; }
  .nav-bar { gap: 10px; }
  .brand { font-size: 21px; }
  .market-hero { grid-template-columns: 1fr; gap: 14px; padding-top: 22px; padding-bottom: 20px; }
  .market-hero-main { padding-top: 6px; }
  .market-hero h1 { margin-bottom: 10px; font-size: 38px; }
  .market-hero .hero-copy { margin-bottom: 0; font-size: 13px; }
  .hero-button { margin-top: 12px; padding: 10px 15px; }
  .market-promo-card { min-height: 120px; padding: 18px; }
  .market-promo-card strong { font-size: 22px; }
  .market-promo-card span { font-size: 11px; }
  .promo-orbit { font-size: 30px; }
  .market-trust-bar { grid-template-columns: 1fr; gap: 7px; margin-bottom: 13px; }
  .trust-item { padding: 10px 12px; }
  .trust-item small { font-size: 10px; }
  .category-nav { align-items: start; flex-direction: column; gap: 9px; margin-bottom: 20px; padding: 12px; }
  .category-nav-title { flex-basis: auto; }
  .category-nav-list { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .category-nav-list button { flex: none; padding: 7px 12px; }
  .category-tabs { overflow-x: auto; white-space: nowrap; }
  .category-tabs button { flex: none; }
  .message-modal { padding: 20px; }
}

/* Saved delivery addresses */
.account-addresses-card { margin-top: 18px; padding: 25px; }
.account-addresses-message { margin: 17px 0 12px; font-size: 13px; }
.account-address-list { display: grid; gap: 10px; margin-top: 14px; }
.account-address-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbf9;
}
.account-address-main { min-width: 0; }
.account-address-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.account-address-heading > strong { font-size: 15px; }
.account-address-default { padding: 2px 7px; border-radius: 6px; background: var(--teal-soft); color: var(--teal); font-size: 11px; font-weight: 700; }
.account-address-main p { margin: 5px 0 2px; font-size: 13px; font-weight: 700; }
.account-address-main p span { margin-left: 8px; color: var(--muted); font-weight: 500; }
.account-address-main small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.account-address-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; }
.account-address-actions .text-button { display: inline-flex; min-height: 36px; align-items: center; margin: 0; padding: 5px 2px; color: var(--teal); font-weight: 700; }
.account-address-actions .text-button.is-danger { color: #b94e38; }
.account-address-actions .text-button:disabled { cursor: wait; opacity: 0.55; }
.account-address-form { display: grid; gap: 15px; margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #f5faf7; }
.account-address-form h3 { margin: 0; font-size: 17px; }
.account-address-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.account-address-fields label { display: grid; min-width: 0; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.account-address-fields input, .account-address-fields textarea { width: 100%; }
.account-address-full { grid-column: 1 / -1; }
.account-address-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.account-address-form-actions .form-message { flex-basis: 100%; }
.checkout-address-picker { display: grid; min-width: 0; gap: 10px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.checkout-address-picker legend { padding: 0 5px; color: var(--ink); font-size: 13px; font-weight: 800; }
.checkout-address-options { display: grid; gap: 8px; }
.checkout-address-option { display: flex !important; align-items: flex-start; gap: 10px !important; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.checkout-address-option:has(input:checked) { border-color: #9bcfc4; background: #f2faf7; }
.checkout-address-option input { flex: none; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--teal); }
.checkout-address-option > span { display: grid; min-width: 0; gap: 2px; }
.checkout-address-option strong { font-size: 13px; }
.checkout-address-option em { display: inline-block; margin-left: 5px; color: var(--teal); font-size: 11px; font-style: normal; }
.checkout-address-option small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.checkout-address-manage { justify-self: end; color: var(--teal); font-size: 12px; font-weight: 700; }
.checkout-address-manage:hover { text-decoration: underline; }
.checkout-no-address { margin: 0; color: var(--muted); font-size: 12px; }

@media (max-width: 720px) {
  .account-addresses-card { padding: 20px; }
  .account-address-item { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .account-address-actions { justify-content: flex-start; border-top: 1px solid var(--line); padding-top: 7px; }
}

@media (max-width: 480px) {
  .account-addresses-card { padding: 18px; }
  .account-address-fields { grid-template-columns: minmax(0, 1fr); }
  .account-address-full { grid-column: auto; }
  .account-address-form { padding: 14px; }
  .account-address-form-actions > button { flex: 1; }
}

/* Operations workspace and cross-page navigation */
.admin-shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 720px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 12px 32px rgba(29, 46, 39, 0.07); }
.admin-sidebar { display: flex; flex-direction: column; padding: 22px 14px 16px; background: #132c23; color: #eff8f3; }
.admin-sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 2px 9px 25px; }
.admin-brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: #e8c879; color: #163126; font-weight: 900; }
.admin-sidebar-brand strong, .admin-sidebar-brand small { display: block; }
.admin-sidebar-brand strong { font-size: 15px; }
.admin-sidebar-brand small { margin-top: 3px; color: #a7c2b6; font-size: 11px; }
.admin-sidebar-nav { display: grid; gap: 5px; }
.admin-sidebar-link { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 43px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: #b5c9c0; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.admin-sidebar-link span { width: 18px; color: #86a99b; font-size: 15px; text-align: center; }
.admin-sidebar-link:hover, .admin-sidebar-link.is-active { background: #1e644b; color: #fff; }
.admin-sidebar-link.is-active span { color: #d6f0dd; }
.admin-sidebar-footer { display: grid; gap: 8px; margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(214, 240, 221, 0.14); }
.admin-sidebar-footer a, .admin-sidebar-footer button { padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: #b5c9c0; font: inherit; font-size: 12px; text-align: left; text-decoration: none; cursor: pointer; }
.admin-sidebar-footer a:hover, .admin-sidebar-footer button:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-workspace { min-width: 0; padding: 28px 30px 42px; background: #f6f8f6; }
.admin-workspace .admin-page-heading { margin-bottom: 22px; }
.admin-workspace .admin-panel { box-shadow: 0 5px 18px rgba(29, 46, 39, 0.04); }
.admin-page-actions { display: flex; align-items: center; }
.admin-live-dot { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--teal); font-size: 12px; font-weight: 700; }
.admin-live-dot::before { width: 7px; height: 7px; border-radius: 50%; background: #2ba36b; content: ''; }
.admin-workspace > [data-admin-view][hidden] { display: none; }
.order-filter-tabs { display: flex; gap: 3px; margin: 18px 0 15px; padding: 4px; overflow-x: auto; border-radius: 10px; background: #edf2ef; }
.order-filter-tabs button { flex: none; padding: 8px 14px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.order-filter-tabs button:hover, .order-filter-tabs button.active { background: #fff; color: var(--teal); box-shadow: 0 2px 7px rgba(29, 46, 39, 0.08); }
.page-bottom-nav { display: none; }

@media (min-width: 721px) {
  .admin-main { max-width: 1380px; padding-top: 30px; }
}

@media (max-width: 720px) {
  .admin-main { padding: 16px 12px 85px; }
  .admin-shell { display: block; min-height: 0; border-radius: 13px; }
  .admin-sidebar { padding: 13px 10px 10px; }
  .admin-sidebar-brand { padding: 0 5px 12px; }
  .admin-sidebar-brand small { display: none; }
  .admin-sidebar-nav { display: flex; gap: 5px; overflow-x: auto; }
  .admin-sidebar-link { flex: 1 0 auto; justify-content: center; min-height: 36px; padding: 0 11px; font-size: 12px; }
  .admin-sidebar-link span { display: none; }
  .admin-sidebar-footer { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 9px; }
  .admin-workspace { padding: 18px 12px 30px; }
  .admin-workspace .admin-page-heading { align-items: start; }
  .admin-page-actions { display: none; }
  .admin-workspace .admin-panel { padding: 18px 14px; }
  .page-bottom-nav { display: block; bottom: 10px; }
  .orders-main, .account-main, .product-detail-main, .seller-main { padding-bottom: 96px; }
}

/* Admin-only visual language: calm indigo workspace with warm action accents. */
.admin-shell { border-color: #dfe3ee; background: #fff; box-shadow: 0 14px 34px rgba(45, 55, 86, 0.09); }
.admin-sidebar { background: #252b45; color: #f4f5fb; }
.admin-brand-mark { background: #f0c878; color: #282d47; }
.admin-sidebar-brand small { color: #aeb6d0; }
.admin-sidebar-link { color: #b9c0d6; }
.admin-sidebar-link span { color: #8d98b8; }
.admin-sidebar-link:hover, .admin-sidebar-link.is-active { background: #4a537b; color: #fff; }
.admin-sidebar-link.is-active span { color: #f5d88f; }
.admin-sidebar-footer { border-top-color: rgba(235, 238, 250, 0.16); }
.admin-sidebar-footer a, .admin-sidebar-footer button { color: #b9c0d6; }
.admin-sidebar-footer a:hover, .admin-sidebar-footer button:hover { background: rgba(255,255,255,.09); color: #fff; }
.admin-workspace { background: #f5f6fa; }
.admin-workspace .primary-button { background: #c87545; }
.admin-workspace .primary-button:hover { background: #a85d35; }
.admin-workspace .secondary-button { border-color: #d8ddec; background: #f0f2f8; color: #4a537b; }
.admin-workspace .secondary-button:hover { border-color: #bbc4dd; background: #e6e9f3; color: #343c60; }
.admin-workspace .admin-panel { border-color: #e1e4ed; box-shadow: 0 6px 18px rgba(45, 55, 86, 0.045); }
.admin-live-dot { border-color: #dfe3ee; color: #4a537b; }
.admin-live-dot::before { background: #7b8bd6; }
.admin-subheading, .admin-table th { color: #4a537b; }
.admin-stat-card { border-color: #e1e4ed; background: #f7f8fc; }
.admin-stat-card:nth-child(3) { background: #fff8ed; }
.admin-stat-card:nth-child(3) strong { color: #bc7d21; }
.admin-stat-card:nth-child(5) { background: #fff4e7; }
.admin-stat-card strong, .admin-count { color: #b45d34; }
.admin-table th, .admin-table td { border-bottom-color: #e5e7ef; }
.admin-import-preview { border-color: #e1e4ed; background: #fafbfe; }
.admin-product-switcher { display: flex; gap: 4px; margin: 0 0 15px; padding: 4px; overflow-x: auto; border: 1px solid #e1e4ed; border-radius: 10px; background: #eaecf3; }
.admin-product-switcher button { flex: none; padding: 9px 17px; border: 0; border-radius: 7px; background: transparent; color: #737b95; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.admin-product-switcher button:hover, .admin-product-switcher button.is-active { background: #fff; color: #4a537b; box-shadow: 0 2px 7px rgba(45, 55, 86, 0.1); }
.admin-workspace > [data-admin-view][hidden], .admin-workspace > [data-admin-product-panel][hidden] { display: none; }

@media (max-width: 720px) {
  .admin-product-switcher { margin-bottom: 12px; }
  .admin-product-switcher button { padding: 8px 13px; }
}

/* Click-through customer workspace */
.admin-user-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 4px 0 16px; }
.admin-search-field { display: grid; width: min(360px, 100%); gap: 6px; color: #69718a; font-size: 12px; font-weight: 800; }
.admin-search-field input { min-height: 40px; border-color: #d9deeb; background: #fff; }
.admin-search-field input:focus { border-color: #7d89bd; box-shadow: 0 0 0 3px rgba(125, 137, 189, 0.14); }
.admin-user-workspace { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(330px, 0.88fr); align-items: start; gap: 16px; }
.admin-user-list { display: grid; min-width: 0; gap: 8px; }
.admin-user-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; min-width: 0; padding: 14px 15px; border: 1px solid #e1e4ed; border-radius: 12px; background: #fff; color: inherit; cursor: pointer; outline: 0; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease; }
.admin-user-row:hover { border-color: #c7cde0; background: #fcfcfe; box-shadow: 0 5px 15px rgba(45, 55, 86, .07); transform: translateY(-1px); }
.admin-user-row:focus-visible { border-color: #7d89bd; box-shadow: 0 0 0 3px rgba(125, 137, 189, .18); }
.admin-user-row.is-selected { border-color: #9b89b8; background: #faf7fc; box-shadow: inset 3px 0 0 #9b89b8, 0 6px 16px rgba(95, 75, 128, .08); }
.admin-user-cell { display: flex; min-width: 0; align-items: center; gap: 11px; }
.admin-user-main { display: grid; min-width: 0; gap: 4px; }
.admin-user-main strong { overflow: hidden; color: #2f3859; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-main small { overflow: hidden; color: #8189a0; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-avatar { display: grid; flex: none; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: #ece9f7; color: #635680; font-size: 15px; font-weight: 900; }
.admin-user-metrics { display: flex; align-items: center; gap: 18px; }
.admin-user-metrics span { display: grid; min-width: 62px; gap: 3px; }
.admin-user-metrics small { color: #8a91a5; font-size: 10px; }
.admin-user-metrics strong { color: #4a537b; font-size: 12px; white-space: nowrap; }
.admin-user-view-button { white-space: nowrap; }
.admin-empty-row { padding: 32px 15px; border: 1px dashed #d9deeb; border-radius: 12px; text-align: center; }
.admin-user-detail { position: sticky; top: 18px; min-width: 0; min-height: 360px; overflow: hidden; border: 1px solid #e1e4ed; border-radius: 14px; background: #fff; box-shadow: 0 7px 20px rgba(45, 55, 86, .055); }
.admin-user-detail-empty, .admin-user-detail-loading { display: grid; min-height: 360px; place-content: center; justify-items: center; gap: 8px; padding: 28px; color: #7e879f; text-align: center; }
.admin-user-detail-empty strong { color: #4a537b; font-size: 14px; }
.admin-user-detail-empty p { max-width: 210px; margin: 0; font-size: 12px; line-height: 1.6; }
.admin-detail-icon { display: grid; width: 46px; height: 46px; margin-bottom: 4px; place-items: center; border-radius: 14px; background: #f0edf8; color: #756791; font-size: 23px; }
.admin-user-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 20px 17px; border-bottom: 1px solid #eceef4; }
.admin-user-profile { display: flex; min-width: 0; align-items: center; gap: 11px; }
.admin-user-avatar-large { width: 44px; height: 44px; border-radius: 13px; font-size: 18px; }
.admin-user-profile > div { min-width: 0; }
.admin-detail-kicker { display: block; margin-bottom: 3px; color: #8b92a7; font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.admin-user-profile h3 { overflow: hidden; margin: 0 0 3px; color: #2f3859; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-profile p { margin: 0; color: #838ba0; font-size: 11px; }
.admin-user-detail-close { flex: none; width: 30px; height: 30px; border-color: #e2e5ee; color: #7f879b; }
.admin-user-detail-close:hover { border-color: #c5cbdf; background: #f5f6fa; color: #4a537b; }
.admin-user-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 16px 20px; background: #fafbfe; }
.admin-user-meta-grid > div { display: grid; min-width: 0; gap: 4px; padding: 9px 10px; border: 1px solid #eceef4; border-radius: 9px; background: #fff; }
.admin-user-meta-grid span { color: #8a91a5; font-size: 10px; }
.admin-user-meta-grid strong { overflow: hidden; color: #4a537b; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.admin-detail-section { padding: 16px 20px 0; }
.admin-detail-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.admin-detail-section-title h4 { margin: 0; color: #4a537b; font-size: 13px; }
.admin-detail-section-title span { color: #9198aa; font-size: 11px; }
.admin-user-order-list, .admin-user-address-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.admin-user-order-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid #eceef4; border-radius: 9px; background: #fff; }
.admin-user-order-item > div { display: grid; min-width: 0; gap: 3px; }
.admin-user-order-item strong { color: #39415f; font-size: 12px; }
.admin-user-order-item small { color: #8a91a5; font-size: 10px; }
.admin-user-order-item > strong { color: #b45d34; white-space: nowrap; }
.admin-user-address-item { display: grid; gap: 4px; padding: 10px; border: 1px solid #eceef4; border-radius: 9px; background: #fff; }
.admin-user-address-item > div { display: flex; align-items: center; gap: 6px; }
.admin-address-label { color: #4a537b; font-size: 11px; font-weight: 800; }
.admin-address-default { padding: 2px 5px; border-radius: 4px; background: #f7eadf; color: #b45d34; font-size: 9px; font-weight: 800; }
.admin-user-address-item strong { color: #39415f; font-size: 12px; }
.admin-user-address-item small { color: #81899e; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.admin-detail-empty-line { padding: 11px 0; color: #9299aa; font-size: 12px; }
.admin-detail-footnote { margin: 16px 20px 20px; padding-top: 12px; border-top: 1px solid #eceef4; color: #9a9fae; font-size: 10px; line-height: 1.5; }

/* Customer account and cart refinement */
.account-heading { margin-bottom: 18px; }
.account-heading h1 { font-size: clamp(30px, 4vw, 42px); }
.account-profile { position: relative; overflow: hidden; border-color: #dce9e2; background: linear-gradient(115deg, #f1f7f2 0%, #fff 66%); }
.account-profile::after { position: absolute; top: -72px; right: 25%; width: 190px; height: 190px; border: 1px solid rgba(74, 139, 111, .1); border-radius: 50%; content: ''; pointer-events: none; }
.account-profile-copy, .account-avatar-column, .account-id-box, .account-profile-actions { position: relative; z-index: 1; }
.account-orders-overview { margin-top: 18px; padding: 23px 25px 18px; }
.account-order-shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 17px; }
.account-order-shortcuts a { display: grid; justify-items: center; gap: 4px; padding: 9px 5px; border-right: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: background .16s ease; }
.account-order-shortcuts a:last-child { border-right: 0; }
.account-order-shortcuts a:hover { border-radius: 12px; background: #f2f7f3; }
.account-order-shortcuts strong { color: var(--ink); font-size: 20px; }
.account-order-shortcuts small { color: var(--muted); font-size: 11px; }
.account-service-card { margin-top: 18px; padding: 23px 25px; }
.account-service-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.account-service-links a, .account-service-links button { display: flex; min-width: 0; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.account-service-links a:hover, .account-service-links button:hover { border-color: #b8d5c7; background: #f7fbf8; }
.account-service-links > * > div { display: grid; min-width: 0; gap: 3px; }
.account-service-links strong { font-size: 12px; }
.account-service-links small { color: var(--muted); font-size: 10px; }
.account-service-links b { margin-left: auto; color: var(--teal); font-size: 11px; white-space: nowrap; }
.account-settings-details { margin-top: 14px; overflow: hidden; }
.account-settings-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; color: var(--ink); font-size: 13px; font-weight: 800; cursor: pointer; list-style: none; }
.account-settings-details > summary::-webkit-details-marker { display: none; }
.account-settings-details > summary::after { color: var(--muted); content: '+'; font-size: 18px; }
.account-settings-details[open] > summary::after { content: '−'; }
.account-settings-details > summary small { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 500; }
.account-settings-details .account-settings-card { padding: 0 20px 20px; }
.cart-shopping-hint { display: flex; flex: none; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 10px; background: #f2f7f3; color: #5f7468; font-size: 11px; }
.cart-shopping-hint span { color: var(--teal); font-weight: 900; }
.empty-cart { display: grid; min-height: 185px; align-content: center; justify-items: center; gap: 9px; padding: 24px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.empty-cart strong { color: var(--ink); font-size: 16px; }
.empty-cart span { color: var(--muted); font-size: 12px; text-align: center; }
.empty-cart button { margin-top: 4px; }
.checkout-review-card { display: grid; gap: 7px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.checkout-review-card h3, .checkout-review-card p { margin: 0; }
.checkout-review-card h3 { color: var(--ink); font-size: 14px; }
.checkout-review-card .checkout-summary { padding: 10px 0 0; border-top: 1px solid var(--line); background: transparent; font-weight: 800; }
.checkout-review-line, .checkout-review-total { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.checkout-review-line span { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.checkout-review-line strong, .checkout-review-total strong { flex: none; white-space: nowrap; }
.checkout-review-total { margin-top: 5px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink); }
button, .primary-button, .secondary-button { transition: transform .12s ease, filter .12s ease, opacity .12s ease; }
button:active:not(:disabled), .primary-button:active:not(:disabled), .secondary-button:active:not(:disabled) { transform: translateY(1px) scale(.98); filter: brightness(.96); }
button:disabled { cursor: wait; opacity: .65; }

@media (max-width: 980px) and (min-width: 721px) {
  .admin-user-workspace { grid-template-columns: minmax(0, 1fr); }
  .admin-user-detail { position: static; }
}

@media (max-width: 720px) {
  .admin-user-toolbar { align-items: stretch; flex-direction: column; gap: 9px; }
  .admin-search-field { width: 100%; }
  .admin-user-workspace { display: block; }
  .admin-user-detail { display: none; position: static; min-height: 0; }
  .admin-user-workspace.has-selected-user .admin-user-list { display: none; }
  .admin-user-workspace.has-selected-user .admin-user-detail { display: block; }
  .admin-user-detail-empty, .admin-user-detail-loading { min-height: 300px; }
  .admin-user-detail-close::after { content: ' 返回列表'; font-size: 11px; font-weight: 700; }
  .admin-user-detail-close { display: inline-flex; width: auto; min-width: 30px; align-items: center; justify-content: center; padding: 0 8px; }
  .admin-user-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px; }
  .admin-user-metrics { display: none; }
  .admin-user-view-button { width: auto; padding: 7px 9px; }
}

@media (max-width: 720px) {
  .account-main { padding: 22px 14px 100px; }
  .account-heading { margin-bottom: 14px; }
  .account-heading h1 { margin-bottom: 5px; font-size: 31px; }
  .account-heading > .muted { margin-bottom: 0; font-size: 12px; }
  .account-profile { grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 17px; border-radius: 18px; }
  .account-id-box { grid-column: 1 / -1; }
  .account-profile-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .account-profile-actions a:nth-child(3) { grid-column: 1 / -1; }
  .account-profile-actions .account-logout-button { grid-column: 1 / -1; }
  .account-orders-overview, .account-service-card { padding: 18px 16px; border-radius: 17px; }
  .account-orders-overview .account-section-heading { align-items: center; flex-direction: row; }
  .account-orders-overview .account-section-heading a { width: auto; }
  .account-order-shortcuts { margin: 14px -4px 0; }
  .account-order-shortcuts a { padding: 8px 2px; }
  .account-order-shortcuts small { font-size: 10px; }
  .account-service-links { grid-template-columns: 1fr; gap: 7px; }
  .account-service-links a, .account-service-links button { min-height: 60px; padding: 10px; }
  .account-service-links small { font-size: 11px; }
  .account-settings-details { margin-top: 12px; }
  .account-settings-details > summary { padding: 15px 16px; }
  .account-settings-details .account-settings-card { padding: 0 16px 16px; }
  .cart-drawer { inset: 0; width: 100%; height: 100dvh; padding: max(20px, env(safe-area-inset-top)) 18px max(16px, env(safe-area-inset-bottom)); border-radius: 0; transform: translateY(100%); box-shadow: none; }
  .cart-drawer.open { transform: translateY(0); }
  .cart-drawer .drawer-header { align-items: center; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
  .cart-drawer .drawer-header h2 { font-size: 23px; }
  .cart-shopping-hint { margin-top: 12px; }
  .cart-items { padding: 10px 0 18px; }
  .cart-item { grid-template-columns: 76px minmax(0, 1fr) auto; gap: 11px; padding: 15px 2px; }
  .cart-item-image { width: 76px; height: 76px; border-radius: 14px; }
  .cart-item-name { font-size: 13px; line-height: 1.5; }
  .cart-item-subtotal { font-size: 13px; }
  .cart-footer { flex: none; margin: 0 -18px 69px; padding: 14px 18px 12px; border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -8px 22px rgba(30, 48, 39, .05); }
  .cart-footer .total-row { align-items: center; margin-bottom: 11px; }
  .cart-footer .total-row strong { color: var(--accent-dark); font-size: 23px; }
  .cart-footer .primary-button { min-height: 48px; border-radius: 14px; }
  body.cart-open { overflow: hidden; }
  body.cart-open .bottom-nav { bottom: 0; z-index: 22; width: 100%; padding: 6px 12px max(6px, env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: 0 -4px 16px rgba(29, 46, 39, .08); }
  body.cart-open .bottom-nav-item { min-height: 48px; }
}

@media (min-width: 721px) {
  .cart-shopping-hint { margin-top: 16px; }
}
