/* ============================================================
   Unified storefront and operations console
   ============================================================ */
:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-soft: #f6f8fa;
  --line: #e1e7e9;
  --text: #202b2d;
  --muted: #748184;
  --primary: #177e78;
  --primary-dark: #12645f;
  --primary-soft: #e5f3f1;
  --accent: #c58432;
  --danger: #d94d4d;
  --success: #17845b;
  --radius: 8px;
  --shadow: 0 2px 10px rgba(30, 55, 58, .06);
  --shadow-lg: 0 12px 32px rgba(30, 55, 58, .12);
}

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); }
body:not([data-mode="admin"]) { background: #f5f7f7; }
body[data-mode="admin"] { background: #f1f4f4; }
.container { width: min(1240px, calc(100% - 48px)); }

.site-header {
  height: 64px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.header-inner { height: 63px; gap: 36px; }
.brand { gap: 10px; }
.brand-logo { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.brand-text strong { color: #263638; font-size: 15px; font-weight: 700; }
.brand-text small { color: var(--muted); }
.main-nav { gap: 8px; }
.main-nav a { padding: 22px 0 20px; color: #667578; font-weight: 600; }
.main-nav a:hover, .main-nav a.active { color: var(--primary); }
.main-nav a.active::after { bottom: 0; height: 2px; border-radius: 2px; }
.main-nav a.nav-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
  border: 1px solid var(--line); border-radius: 999px; background: #f7faf9;
  font-size: 13px; font-weight: 600; color: #526164; transition: all .15s ease;
}
.main-nav a.nav-pill:hover { color: var(--primary); border-color: #9dc4bf; background: #eef7f5; }
.main-nav a.nav-pill.active { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: 0 2px 6px rgba(23,126,120,.18); }
.main-nav a.nav-pill .nav-dot { width: 6px; height: 6px; border-radius: 50%; background: #b6c2c3; flex: none; }
.main-nav a.nav-pill.active .nav-dot { background: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.28); }
.main-nav a.nav-pill.active::after { content: none; }
.header-right { display: flex; align-items: center; gap: 12px; }
.balance-pill { border-radius: 6px; background: #f7faf9; }
.balance-pill .dot { background: var(--success); }

.app-main { min-height: calc(100vh - 130px); padding: 24px 0 48px; }
.notice-strip {
  display: flex; align-items: flex-start; gap: 12px; margin: 4px 0 22px; padding: 12px 15px;
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px;
  box-shadow: 0 1px 4px rgba(30,55,58,.03); font-size: 13px; line-height: 1.7;
}
.notice-strip-tag { flex-shrink: 0; color: #8a5a22; background: #fbf1e3; border-radius: 4px; padding: 1px 8px; font-size: 11px; font-weight: 700; }
.notice-strip-text { color: #566467; white-space: pre-line; }
.shop-bar { display: flex; align-items: flex-end; gap: 20px; margin: 20px 0 12px; }
.shop-bar > .shop-search { flex: 0 1 390px; }
.shop-search { width: min(390px, 100%); height: 40px; background: #fff; border: 1px solid #d9e1e2; border-radius: 6px; }
.shop-search:focus-within { border-color: #78aaa5; box-shadow: 0 0 0 3px rgba(23,126,120,.08); }
.shop-search button { height: 32px; border-radius: 4px; background: var(--primary); }
.category-tabs { gap: 24px; margin-bottom: 16px; border-color: var(--line); }
.category-tabs button { color: #647275; padding: 10px 0 11px; }
.category-tabs button:hover, .category-tabs button.active { color: var(--primary); }
.category-tabs button.active::after { background: var(--primary); height: 2px; }

.product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.product-card { border: 1px solid #e2e8e8; border-radius: 7px; background: #fff; box-shadow: 0 1px 3px rgba(30,55,58,.025); }
.product-card:hover { transform: translateY(-2px); border-color: #bfd8d5; box-shadow: 0 7px 18px rgba(30,55,58,.09); }
.product-card .card-img { height: 156px; background: #f3f6f6; }
.card-hover-tip { background: rgba(23,126,120,.86); }
.product-card h3 { height: 42px; padding: 10px 12px 0; font-size: 13px; line-height: 1.55; color: #293638; }
.product-card .card-bottom { padding: 9px 12px 12px; }
.product-card .price { color: var(--danger); font-size: 16px; }
.product-type-tag { color: #177e78; background: #e8f4f2; border: 1px solid #d5eae7; border-radius: 4px; }
.empty-box { border-color: var(--line); border-radius: 7px; box-shadow: var(--shadow); }
.pagination button { border-radius: 5px; }
.pagination button:hover:not(:disabled), .pagination button.active { background: var(--primary); border-color: var(--primary); }

.btn { border-radius: 6px; font-weight: 650; }
.btn-primary { background: var(--primary); box-shadow: none; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { color: #506063; }
.btn-ghost:hover { border-color: #aabdbc; background: #f8fbfa; }
.btn-danger { color: #b83e42; }
.panel { border-color: var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.detail-card { border-color: var(--line); border-radius: 8px; }
.detail-actions .btn { border-radius: 6px; }
.read-dialog, .buy-dialog, .pay-dialog { border-radius: 8px; }
.order-card { border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); }
.site-footer { background: #fff; border-top: 1px solid var(--line); }
.service-fab { background: var(--primary); border-radius: 7px; box-shadow: 0 5px 14px rgba(23,126,120,.24); }

/* Admin shell */
body[data-mode="admin"] { min-height: 100vh; background: #f1f4f4; }
body[data-mode="admin"] .admin-header {
  position: sticky; top: 0; z-index: 60; height: 62px; background: #fff; border-bottom: 1px solid var(--line);
}
.admin-header-inner { width: min(1320px, calc(100% - 48px)); height: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-identity { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.admin-logo { display: grid; place-items: center; width: 34px; height: 34px; background: var(--primary); color: #fff; border-radius: 7px; font-size: 17px; font-weight: 800; }
.admin-identity strong, .admin-identity small { display: block; line-height: 1.25; }
.admin-identity strong { color: #253436; font-size: 14px; }
.admin-identity small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.admin-header-actions { display: flex; align-items: center; gap: 20px; color: #5d6d70; font-size: 12px; }
.admin-header-actions a { color: #53676a; font-weight: 600; }
.admin-header-actions a:hover { color: var(--primary); }
.admin-header-actions .admin-home-link { padding: 7px 11px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.admin-live { display: inline-flex; align-items: center; gap: 7px; color: #54716b; }
.admin-live i { width: 7px; height: 7px; border-radius: 50%; background: #20a16b; box-shadow: 0 0 0 3px #e2f3eb; }
body[data-mode="admin"] .app-main { width: min(1320px, calc(100% - 48px)); margin: 0 auto; padding: 24px 0 50px; }
body[data-mode="admin"] .section-title { margin: 0 0 18px; }
body[data-mode="admin"] .section-title h2 { font-size: 21px; font-weight: 750; color: #243335; }
body[data-mode="admin"] .section-title::before { content: "运营总览"; display: none; }
body[data-mode="admin"] .stat-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
body[data-mode="admin"] .stat-box { position: relative; min-height: 88px; padding: 15px 18px; background: #fff; border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 1px 4px rgba(30,55,58,.03); }
body[data-mode="admin"] .stat-box strong { color: var(--primary); font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
body[data-mode="admin"] .stat-box span { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.admin-tabs { gap: 2px; padding: 4px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 1px 4px rgba(30,55,58,.03); }
.admin-tab { padding: 9px 13px; color: #627174; font-size: 12px; border: 0; border-radius: 5px; }
.admin-tab:hover, .admin-tab.active { color: var(--primary); background: var(--primary-soft); border: 0; }
.admin-card { padding: 20px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 1px 5px rgba(30,55,58,.04); }
.admin-card h2 { color: #263638; font-size: 16px; }
.admin-card h3 { color: #344548; }
.admin-card .panel-sub { margin-bottom: 16px; }
.login-box { width: min(420px, calc(100% - 32px)); margin: 72px auto; padding: 30px; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); }
.login-box h1 { color: #27383a; font-size: 21px; }
.login-box p { line-height: 1.7; }
body[data-mode="admin"] input:not([type="checkbox"]),
body[data-mode="admin"] select,
body[data-mode="admin"] textarea { min-height: 38px; border: 1px solid #d8e0e1 !important; border-radius: 5px !important; background-color: #fff; color: var(--text); }
body[data-mode="admin"] input:focus,
body[data-mode="admin"] select:focus,
body[data-mode="admin"] textarea:focus { border-color: #78aaa5 !important; outline: 0; box-shadow: 0 0 0 3px rgba(23,126,120,.08); }
body[data-mode="admin"] .form-field label { color: #526366; font-size: 12px; }
body[data-mode="admin"] table { border-collapse: separate !important; border-spacing: 0; }
body[data-mode="admin"] th { color: #647477 !important; background: #f7f9f9; font-weight: 650; white-space: nowrap; }
body[data-mode="admin"] td, body[data-mode="admin"] th { padding: 10px 9px !important; border-bottom: 1px solid #e8eded !important; }
body[data-mode="admin"] tbody tr:hover { background: #f8fbfa; }
body[data-mode="admin"] .switch-row { padding: 10px 0; border-bottom: 1px solid #edf0f0; }
body[data-mode="admin"] .log-item { padding: 12px 0; color: #647477; }
body[data-mode="admin"] .access-gate { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }

/* Shared controls and card internals */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; padding: 9px 15px; color: inherit; font-size: 13px; font-weight: 650; line-height: 1.35; transition: background .16s, border-color .16s, color .16s, transform .16s; }
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-primary { border-color: var(--primary); color: #fff; }
.btn-ghost { border-color: var(--line); background: #fff; }
.btn-danger { border-color: #f1d0d0; background: #fff5f5; }
.form-field { margin-bottom: 12px; }
.form-field label { font-size: 12px; font-weight: 700; color: #526366; }
.form-field input, .form-field select, .form-field textarea { min-height: 38px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); }
.form-field textarea { min-height: 76px; resize: vertical; }
.field-hint { color: var(--muted); font-size: 11px; }
.product-card .card-img { position: relative; }
.product-card .card-img .img-placeholder { color: #8b999b; font-size: 12px; }
.card-hover-tip { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(23,126,120,.88); color: #fff; font-size: 13px; font-weight: 650; opacity: 0; pointer-events: none; transition: opacity .18s; }
.product-card:hover .card-hover-tip { opacity: 1; }
.product-grid.layout-single, .product-grid.layout-list { grid-template-columns: 1fr; }
.product-grid.layout-list .product-card { min-height: 0; }
.product-grid.layout-single .product-card .desc, .product-grid.layout-list .product-card .desc { -webkit-line-clamp: 3; }
.status-badge { display: inline-block; white-space: nowrap; padding: 3px 8px; border-radius: 4px; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 700; }
.status-done { background: #e5f4ec; color: var(--success); }
.status-warn { background: #fbf0df; color: #946222; }

/* Structural layout reset */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.site-header { position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; }
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.main-nav { display: flex; align-items: center; flex: 1; }
.header-right { margin-left: auto; }
.app-main { min-height: calc(100vh - 130px); }
.section-title { display: flex; align-items: center; justify-content: space-between; }
.panel { background: var(--surface); }
.shop-search { display: flex; align-items: center; overflow: hidden; }
.shop-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 0 10px; }
.shop-search svg { flex-shrink: 0; width: 16px; height: 16px; margin-left: 14px; color: #a0abad; }
.shop-search button { width: 40px; flex: 0 0 40px; display: grid; place-items: center; border: 0; color: #fff; }
.product-grid { display: grid; }
.product-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.product-card .card-img { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-card .card-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.product-card h3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-card .price { white-space: nowrap; }
.product-type-tag { display: inline-block; white-space: nowrap; }
.category-tabs { display: flex; overflow-x: auto; }
.category-tabs button { position: relative; border: 0; background: transparent; white-space: nowrap; }
.category-tabs button.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; }
.empty-box { text-align: center; padding: 58px 20px; }
.empty-box svg { display: block; width: 78px; height: 78px; margin: 0 auto 14px; opacity: .5; }
.detail-card { display: grid; align-items: start; }
.detail-image { display: grid; place-items: center; overflow: hidden; }
.detail-image img { width: 100%; height: 100%; object-fit: contain; }
.detail-info { min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field input, .form-field select, .form-field textarea { width: 100%; outline: none; }
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.week-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.week-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 12px; }
.week-chip input { width: auto; accent-color: var(--primary); }
.time-pair { display: flex; align-items: center; gap: 6px; }
.time-pair input { width: 60px; text-align: center; }
.order-preview { margin: 14px 0; padding: 10px 12px; background: var(--bg-soft, #f5f8f8); border-radius: 6px; font-size: 13px; }
.order-preview strong { color: var(--danger); font-size: 16px; }
.check-item input { width: auto; accent-color: var(--primary); }
/* 运动代跑下单弹窗：贴近 ydsj 货源平台的紧凑布局 */
.sports-dialog { width: min(100%, 560px); }
.sports-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sports-dialog-head h3 { margin: 0; min-width: 0; }
.sports-close { flex: none; width: 28px; height: 28px; border: 0; background: transparent; color: #89979b; font-size: 24px; line-height: 1; cursor: pointer; }
.sports-close:hover { color: var(--danger); }
.sports-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.sports-week .week-chip { display: inline-flex; align-items: center; justify-content: center; padding: 7px 2px; border: 1px solid var(--line); border-radius: 999px; color: #526366; font-size: 12px; font-weight: 500; white-space: nowrap; cursor: pointer; user-select: none; transition: background .15s, color .15s, border-color .15s; }
.sports-week .week-chip input { display: none; }
.sports-week .week-chip.checked { background: var(--primary); border-color: var(--primary); color: #fff; }
/* 跑步类型胶囊选择：与跑步周期同风格 */
.run-type-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.run-type-chip { display: inline-flex; align-items: center; justify-content: center; padding: 8px 18px; border: 1px solid var(--line); border-radius: 999px; color: #526366; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; user-select: none; transition: background .15s, color .15s, border-color .15s; }
.run-type-chip input { display: none; }
.run-type-chip.checked { background: var(--primary); border-color: var(--primary); color: #fff; }
.sports-form input[type="time"] { min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); }
.sports-form input[type="time"].time-locked { background: #f2f5f6; color: #526366; cursor: not-allowed; }
.time-rule-hint { margin: -2px 0 10px; font-size: 12px; color: #7a8b8f; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.pagination button { min-width: 34px; height: 34px; }
.admin-grid, .admin-two-col { display: grid; align-items: start; }
.admin-two-col { grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.stat-grid { display: grid; }
.admin-tabs { display: flex; overflow-x: auto; }
.admin-tab { white-space: nowrap; cursor: pointer; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; border-radius: 999px; background: #cbd3d4; }
.switch .slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.pay-mask, .read-mask, .buy-mask { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 80; background: rgba(28, 42, 44, .45); }
.pay-mask.hidden { display: none; }
.pay-dialog, .read-dialog, .buy-dialog { background: #fff; width: min(100%, 520px); max-height: 88vh; overflow: auto; }
.toast { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3000; }

/* Shared page layout */
body { font: 14px/1.6 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif; }
.container { margin-inline: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.main-nav a { position: relative; white-space: nowrap; }
.main-nav a.active::after { content: ''; position: absolute; inset-inline: 0; background: var(--primary); }
.shop-search button svg { margin: 0; color: inherit; }
.product-card { cursor: pointer; }
.product-card h3 { margin: 0; -webkit-line-clamp: 2; }
.product-card .price { font-weight: 750; }
.product-card .price small { color: var(--muted); font-weight: 400; }
.detail-card { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 24px; padding: 20px; background: var(--surface); border: 1px solid var(--line); }
.detail-image { background: var(--surface-soft); min-width: 0; aspect-ratio: 1; border-radius: var(--radius); }
.detail-info h1 { margin: 0 0 12px; font-size: 22px; }
.detail-price { color: var(--danger); font-size: 23px; font-weight: 750; }
.detail-price small, .breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb { margin-bottom: 15px; }
.detail-desc, .order-detail { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; overflow-wrap: anywhere; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.promo-bar, .notice-bar { padding: 10px 14px; margin-bottom: 14px; border-radius: 6px; background: #fbf1e3; color: #80521f; }
.info-page, .notice-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.info-page h2 { padding: 14px 20px; margin: 0; border-bottom: 1px solid var(--line); font-size: 17px; }
.info-body { padding: 20px; }
.notice-item { padding: 14px; margin-bottom: 12px; }
.notice-item h3, .notice-item p { margin: 0; }
.notice-item p { white-space: pre-line; }
.order-card { display: flex; gap: 16px; padding: 16px; margin-bottom: 12px; }
.order-card .info { flex: 1; min-width: 0; }
.order-card h3 { margin: 0 0 6px; }
.order-card .muted, .empty-state { color: var(--muted); }
.access-gate, .empty-state, .loading { text-align: center; padding: 28px; }
.access-gate { max-width: 420px; margin: 40px auto; }
.spinner { display: inline-block; width: 18px; height: 18px; margin-right: 8px; vertical-align: -4px; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spinner-rot .8s linear infinite; }
.loading .spinner { display: block; margin: 0 auto 10px; }
@keyframes spinner-rot { to { transform: rotate(360deg); } }
.tab-loading { display: flex; align-items: center; gap: 8px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); font-size: 12px; }
.tab-loading .spinner { margin: 0; }
.site-footer { padding: 18px 0; color: var(--muted); font-size: 12px; }
.footer-inner { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.service-fab { position: fixed; right: 22px; bottom: 22px; width: 42px; height: 42px; border: 0; color: #fff; font-weight: 700; z-index: 70; }
.pay-dialog, .read-dialog, .buy-dialog { padding: 22px; box-shadow: var(--shadow-lg); }
.pay-qr, .pay-amount, .pay-tip { text-align: center; }
.pay-link { display: block; color: var(--primary); overflow-wrap: anywhere; }
.course-results { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.course-result-item, .check-item, .switch-row, .radio-row { display: flex; align-items: center; gap: 8px; }
.course-result-item { padding: 8px; border-bottom: 1px solid var(--line); }
.course-result-item.selected { background: var(--primary-soft); }
.course-thumb { width: 44px; height: 44px; flex-shrink: 0; }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.switch-row { justify-content: space-between; }
.switch:focus-within { outline: 2px solid var(--primary); outline-offset: 3px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.toast { max-width: calc(100% - 48px); opacity: 0; pointer-events: none; background: #263638; color: #fff; border-radius: 8px; padding: 10px 14px; }
.toast.show { opacity: 1; }
.toast.error { background: #9f3438; }
@media (max-width: 820px) { .admin-grid, .admin-two-col { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .header-inner { flex-wrap: wrap; } .main-nav { flex-basis: 100%; } .form-grid { grid-template-columns: 1fr; } }

@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .detail-card { grid-template-columns: 220px minmax(0, 1fr); }
  .detail-image { width: 220px; height: 220px; }
  .admin-tabs { flex-wrap: nowrap; }
}
@media (max-width: 820px) {
  .container { width: min(100% - 32px, 1240px); }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-header-inner, body[data-mode="admin"] .app-main { width: calc(100% - 32px); }
  .admin-tabs { overflow-x: auto; }
  .admin-tab { flex: 0 0 auto; }
}
@media (max-width: 640px) {
  .site-header { height: auto; }
  .header-inner { height: auto; min-height: 58px; padding: 9px 0 0; gap: 6px 12px; }
  .brand-logo { width: 30px; height: 30px; }
  .brand-text strong { font-size: 13px; }
  .main-nav { order: 3; width: 100%; gap: 8px; overflow-x: auto; }
  .main-nav a { padding: 9px 0 10px; font-size: 13px; }
  .main-nav a.nav-pill { padding: 6px 12px; font-size: 12px; }
  .header-right { margin-left: auto; }
  .balance-pill { padding: 6px 9px; font-size: 11px; }
  .app-main { padding: 14px 0 34px; }
  .container { width: calc(100% - 24px); }
  .notice-strip { margin: 0 0 16px; padding: 10px 11px; font-size: 12px; }
  .shop-bar { gap: 10px; margin: 15px 0 9px; }
  .shop-search { height: 38px; }
  .category-tabs { gap: 19px; margin-bottom: 12px; }
  .category-tabs button { font-size: 13px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .product-card .card-img { height: auto; aspect-ratio: 1.16; }
  .product-card h3 { height: 40px; padding: 8px 9px 0; font-size: 12px; }
  .product-card .card-bottom { padding: 7px 9px 10px; }
  .product-card .price { font-size: 14px; }
  .product-type-tag { font-size: 10px; }
  .detail-card { grid-template-columns: 1fr; gap: 18px; padding: 14px; }
  .detail-image { width: min(200px, 100%); height: auto; aspect-ratio: 1; justify-self: center; }
  .detail-actions { justify-content: stretch; }
  .detail-actions .btn { flex: 1; padding: 10px 8px; }
  .order-card { flex-wrap: wrap; }
  .site-footer { padding: 15px 0; }
  .footer-inner { gap: 5px 14px; font-size: 11px; }
  .service-fab { right: 14px; bottom: 14px; }

  .admin-header { height: 56px !important; }
  .admin-header-inner, body[data-mode="admin"] .app-main { width: calc(100% - 24px); }
  .admin-logo { width: 30px; height: 30px; font-size: 15px; }
  .admin-header-actions { gap: 10px; font-size: 11px; }
  .admin-live { display: none; }
  .admin-header-actions .admin-home-link { padding: 6px 8px; }
  body[data-mode="admin"] .app-main { padding-top: 17px; }
  body[data-mode="admin"] .section-title h2 { font-size: 18px; }
  body[data-mode="admin"] .stat-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; }
  body[data-mode="admin"] .stat-box { min-height: 76px; padding: 11px 9px; }
  body[data-mode="admin"] .stat-box strong { font-size: 16px; }
  body[data-mode="admin"] .stat-box span { font-size: 10px; }
  .admin-tabs { margin-right: -12px; padding: 3px; }
  .admin-tab { padding: 8px 10px; font-size: 11px; }
  .admin-card { padding: 15px 12px; }
  body[data-mode="admin"] td, body[data-mode="admin"] th { padding: 8px 7px !important; }
  .login-box { margin-top: 44px; padding: 24px 18px; }
}

/* ---------- 前台用户入口与登录/注册弹窗 ---------- */
.header-right { display: flex; align-items: center; gap: 12px; }
.user-entry { display: flex; align-items: center; gap: 8px; }
.user-badge { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--primary); font-size: 12px; font-weight: 700; padding: 5px 10px; background: rgba(23,126,120,.08); border-radius: 999px; }
.user-balance { white-space: nowrap; color: #a15a12; font-size: 12px; font-weight: 700; padding: 5px 9px; background: #fbf1e3; border-radius: 999px; }

.auth-mask { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(18,32,34,.5); backdrop-filter: blur(2px); }
.auth-dialog { position: relative; width: min(400px, 100%); background: var(--surface, #fff); border-radius: 14px; padding: 28px 26px 24px; box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.auth-dialog h3 { margin: 0 0 6px; font-size: 20px; color: var(--text, #222); }
.auth-sub { margin: 0 0 20px; font-size: 12px; color: var(--muted); }
.auth-close { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; }
.auth-dialog .form-field { margin-bottom: 14px; }
.auth-dialog input { width: 100%; box-sizing: border-box; }
.auth-switch { margin-top: 16px; text-align: center; font-size: 12px; color: var(--muted); }
.auth-switch a { color: var(--primary); font-weight: 700; text-decoration: none; margin-left: 4px; }

/* ---------- 登录提示弹窗（未登录禁止查看商品） ---------- */
.login-hint-mask { position: fixed; inset: 0; z-index: 2050; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(18,32,34,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.login-hint-dialog { width: min(340px, 100%); padding: 26px 24px 22px; background: var(--surface, #fff); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.22); text-align: center; }
.login-hint-dialog h3 { margin: 0 0 14px; font-size: 18px; color: var(--text, #222); }
.login-hint-dialog p { margin: 0 0 22px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.login-hint-dialog .btn { background: #e11d48; border-color: #e11d48; }
.login-hint-dialog .btn:hover { background: #be123c; border-color: #be123c; }

/* ---------- 客服二维码弹窗 ---------- */
.service-fab { width: 48px; height: 48px; border-radius: 10px; font-size: 13px; letter-spacing: 1px; }
.service-mask { position: fixed; inset: 0; z-index: 2100; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(18,32,34,.5); backdrop-filter: blur(2px); }
.service-dialog { position: relative; width: min(340px, 100%); padding: 24px 22px 20px; background: var(--surface, #fff); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.18); text-align: center; }
.service-dialog h3 { margin: 0 0 16px; font-size: 18px; color: var(--text, #222); }
.service-close { position: absolute; top: 10px; right: 13px; border: 0; background: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; }
.service-qr-img { display: block; width: min(240px, 100%); margin: 0 auto; border: 1px solid var(--line); border-radius: 8px; }
.service-qr-tip { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.service-qr-empty { margin: 0; padding: 24px 0; font-size: 13px; color: var(--muted); }

/* ---------- 后台本地图片上传 ---------- */
.upload-field .upload-preview { width: 120px; height: 90px; display: grid; place-items: center; margin-bottom: 9px; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface-soft, #f6f8fa); overflow: hidden; }
.upload-field .upload-preview img { width: 100%; height: 100%; object-fit: contain; }
.upload-empty { font-size: 12px; color: var(--muted); }
.upload-trigger { display: inline-flex; align-items: center; cursor: pointer; margin-right: 6px; }
.upload-clear { vertical-align: top; }
.upload-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- 图片库 ---------- */
.btn-xs { padding: 4px 8px; font-size: 11px; }
.gallery-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.gallery-upload-trigger { display: inline-flex; align-items: center; cursor: pointer; }
.gallery-status { min-height: 18px; margin-bottom: 8px; font-size: 12px; color: var(--accent); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.gallery-item { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface, #fff); }
.gallery-thumb { height: 120px; display: grid; place-items: center; background: var(--surface-soft, #f6f8fa); overflow: hidden; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery-meta { padding: 6px 8px 2px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-actions { display: flex; gap: 4px; padding: 4px 8px 8px; }
.gallery-picker-dialog { position: relative; background: var(--surface, #fff); border-radius: 10px; padding: 22px; width: min(760px, 100%); max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg); }
.gallery-picker-head { position: relative; margin-bottom: 14px; padding-right: 30px; }
.gallery-picker-head h3 { margin: 0; font-size: 17px; color: var(--text, #222); }
.gallery-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.gallery-picker-item { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft, #f6f8fa); cursor: pointer; text-align: left; transition: border-color .15s, transform .15s; }
.gallery-picker-item:hover { border-color: var(--primary); transform: translateY(-2px); }
.gallery-picker-item img { width: 100%; height: 92px; object-fit: contain; background: #fff; border-radius: 4px; }
.gallery-picker-item span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 640px) {
  .user-entry { gap: 5px; }
  .user-badge { max-width: 84px; font-size: 11px; }
  .user-balance { font-size: 10px; padding: 4px 7px; }
  .header-right { gap: 8px; }
  .auth-dialog { padding: 24px 18px 20px; }
  .service-fab { right: 14px; bottom: 14px; width: 44px; height: 44px; }
}

/* ---------- 前台布局：分类位置 + 商品布局 ---------- */
.shop-content { display: block; }
.shop-content.cat-sidebar { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; align-items: start; }
.shop-content.cat-sidebar .category-tabs { flex-direction: column; gap: 4px; margin-bottom: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--surface, #fff); overflow-x: visible; }
.shop-content.cat-sidebar .category-tabs button { text-align: left; padding: 9px 12px; border-radius: 6px; font-size: 13px; }
.shop-content.cat-sidebar .category-tabs button.active::after { display: none; }
.shop-content.cat-sidebar .category-tabs button.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.shop-goods { min-width: 0; }
/* 商品布局：列表 / 单栏时卡片横向排列（紧凑间距） */
.product-grid.layout-list, .product-grid.layout-single { gap: 8px; }
.product-grid.layout-list .product-card,
.product-grid.layout-single .product-card { flex-direction: row; align-items: stretch; }
.product-grid.layout-list .product-card .card-img,
.product-grid.layout-single .product-card .card-img { width: 116px; height: 76px; flex: 0 0 116px; }
.product-grid.layout-list .product-card h3,
.product-grid.layout-single .product-card h3 { flex: 1; height: auto; padding: 8px 12px 0; align-self: center; -webkit-line-clamp: 2; line-height: 1.5; }
.product-grid.layout-list .product-card .card-bottom,
.product-grid.layout-single .product-card .card-bottom { flex: 0 0 auto; flex-direction: column; align-items: flex-end; justify-content: center; gap: 5px; padding: 8px 12px; }
@media (max-width: 820px) {
  .shop-content.cat-sidebar { grid-template-columns: 1fr; gap: 12px; }
  .shop-content.cat-sidebar .category-tabs { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 0 0 8px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
  .shop-content.cat-sidebar .category-tabs button { flex: 0 0 auto; }
  .product-grid.layout-list .product-card .card-img,
  .product-grid.layout-single .product-card .card-img { width: 96px; flex-basis: 96px; height: 68px; }
  .product-grid.layout-list .product-card h3,
  .product-grid.layout-single .product-card h3 { padding: 7px 9px 0; font-size: 12px; }
  .product-grid.layout-list .product-card .card-bottom,
  .product-grid.layout-single .product-card .card-bottom { padding: 7px 9px; gap: 4px; }
}

/* ---------- 数据统计 ---------- */
.stats-panel .stats-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 16px; }
.stats-panel .stats-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.stats-seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-soft, #f2f5f5); border: 1px solid var(--line); border-radius: 7px; }
.stats-seg-btn { border: 0; background: transparent; padding: 6px 14px; border-radius: 5px; font-size: 12px; color: var(--muted); cursor: pointer; }
.stats-seg-btn:hover { color: var(--primary); }
.stats-seg-btn.active { background: #1a7f79; color: #fff; font-weight: 700; box-shadow: 0 1px 3px rgba(23,126,120,.25); }
.stats-summary { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; padding: 16px 2px 6px; font-size: 13px; color: #526366; }
.stats-summary strong { color: #1a7f79; font-size: 15px; }
.stats-summary-muted { color: var(--muted); font-size: 12px; margin-left: auto; }
.stats-chart { padding: 4px 0 8px; }
.stats-rank-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 18px 0 12px; }
.stats-rank-head h3 { margin: 0; font-size: 15px; color: var(--text, #222); }
.stats-rank-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat-rank-card { border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); padding: 14px 16px; min-height: 190px; }
.stat-rank-card h4 { margin: 0 0 12px; font-size: 13px; color: #526366; }
.stat-rank-card ol { list-style: none; margin: 0; padding: 0; }
.stat-rank-card li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.stat-rank-card li:last-child { border-bottom: 0; }
.stat-rank-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text, #222); }
.stat-rank-val { flex: 0 0 auto; color: #1a7f79; font-weight: 700; }
.stat-rank-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 140px; color: #b9c3c4; font-size: 12px; }
.stat-rank-empty svg { width: 54px; height: 54px; opacity: .7; }
@media (max-width: 820px) { .stats-rank-grid { grid-template-columns: 1fr; } .stats-summary-muted { margin-left: 0; } }

/* ---------- 用户下单记录弹窗 ---------- */
.user-orders-mask { position: fixed; inset: 0; z-index: 2200; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(18,32,34,.5); backdrop-filter: blur(2px); }
.user-orders-dialog { position: relative; width: min(900px, 100%); max-height: 86vh; display: flex; flex-direction: column; background: var(--surface, #fff); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.2); overflow: hidden; }
.uo-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.uo-head h3 { margin: 0; font-size: 17px; color: var(--text, #222); }
.uo-close { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.uo-body { padding: 16px 22px 22px; overflow: auto; }
.uo-loading { padding: 40px 0; text-align: center; color: var(--muted); font-size: 13px; }
.uo-summary { margin-bottom: 12px; font-size: 13px; color: #526366; }
.uo-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.uo-table th, .uo-table td { padding: 9px 8px !important; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.uo-table th { color: var(--muted); background: var(--surface-soft, #f7f9f9); font-weight: 650; }

/* ---------- 分类与商品工作台 ---------- */
.catalog-workbench { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 20px; align-items: start; }
.catalog-cats { border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft, #fafcfc); padding: 14px; position: sticky; top: 12px; }
.catalog-cats-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.catalog-cats-head h2 { margin: 0; font-size: 15px; color: var(--text, #222); }
.cat-create-form { padding: 12px; margin-bottom: 12px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.catalog-cat-list { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 250px); min-height: 120px; overflow-y: auto; padding-right: 2px; }
.catalog-cat-item { display: flex; align-items: center; gap: 4px; width: 100%; min-height: 46px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; transition: border-color .16s, background .16s; }
.catalog-cat-item:hover { border-color: #a9c9c6; background: #f7fbfa; }
.catalog-cat-item.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.cc-select { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 0; cursor: pointer; }
.cc-name { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 650; color: var(--text, #222); }
.cc-count { color: var(--muted); font-size: 11px; }
.cc-ops { display: inline-flex; flex-direction: column; gap: 2px; flex: 0 0 auto; }
.cc-icon { border: 0; background: none; padding: 1px 5px; font-size: 11px; line-height: 1.4; color: var(--primary); cursor: pointer; border-radius: 4px; }
.cc-icon:hover { background: var(--primary-soft); }
.cc-icon.cc-danger { color: #b83e42; }
.cc-icon.cc-danger:hover { background: #fff1f1; }
.cat-thumb { display: block; width: 44px; height: 44px; object-fit: contain; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft, #f6f8fa); }
.cat-thumb-empty { display: grid; place-items: center; color: var(--muted); font-size: 10px; }
.catalog-products { min-width: 0; }
.catalog-prod-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.catalog-prod-head h2 { margin: 0; font-size: 16px; color: var(--text, #222); }
.catalog-prod-head .panel-sub { margin: 6px 0 0; }
.catalog-batch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 9px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
@media (max-width: 980px) {
  .catalog-workbench { grid-template-columns: 1fr; }
  .catalog-cats { position: static; }
  .catalog-cat-list { flex-direction: row; flex-wrap: wrap; max-height: none; }
  .catalog-cat-item { width: auto; min-width: 150px; }
}

/* ===== 数据大屏 ===== */
.dash-screen { display: grid; gap: 18px; min-width: 0; }
.dash-kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.dash-kpi { display: flex; align-items: center; gap: 10px; padding: 14px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow, 0 1px 4px rgba(0,0,0,.04)); min-width: 0; }
.dash-kpi-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; }
.dash-kpi-icon svg { width: 22px; height: 22px; }
.dash-kpi-body { min-width: 0; }
.dash-kpi-label { font-size: 12px; color: var(--muted, #748184); white-space: nowrap; }
.dash-kpi-value { font-size: 20px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-kpi-sub { font-size: 11px; color: #9aa6a9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 3px 12px #14234208; padding: clamp(14px, 2vw, 22px); min-width: 0; }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dash-card-head h3 { margin: 0; font-size: 15px; color: var(--text, #202b2d); }
.dash-card-body { min-width: 0; }
.dash-trends { display: grid; gap: 12px; min-width: 0; }
.dash-trends-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin-top: 6px; }
.dash-trends-heading h3, .dash-trends-heading p { margin: 0; }
.dash-trends-heading h3 { font-size: 17px; }
.dash-trends-heading p { font-size: 12px; color: #56657b; }
.dash-trend { --trend: #255ac7; --trend-soft: #edf3ff; }
.dash-trend-profit { --trend: #087468; --trend-soft: #e9f7f3; }
.dash-trend-overview { --trend: #255ac7; }
.dash-trend-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.dash-trend-index { color: var(--trend); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.dash-trend-head h4 { margin: 4px 0; color: #142342; font-size: 19px; }
.dash-trend-head p { margin: 0; color: #56657b; font-size: 11px; }
.dash-total-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-total { display: grid; gap: 2px; padding: 8px 12px; border-radius: 10px; color: var(--trend); background: var(--trend-soft); }
.dash-total span { font-size: 11px; }
.dash-total strong { font-size: clamp(15px, 2vw, 21px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dash-donut-wrap { display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 200px; flex-wrap: wrap; }
.dash-legend { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: #526366; min-width: 96px; }
.dash-legend-item { display: flex; align-items: center; gap: 8px; }
.dash-legend-item strong { margin-left: auto; color: var(--text, #202b2d); }
.dash-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dash-chart { display: grid; grid-template-columns: clamp(44px, 6vw, 76px) minmax(0, 1fr); gap: 6px 8px; }
.dash-axis-y, .dash-axis-x { position: relative; font-size: 11px; color: #56657b; font-variant-numeric: tabular-nums; }
.dash-axis-y span { position: absolute; right: 0; transform: translateY(-50%); }
.dash-axis-x { grid-column: 2; height: 17px; }
.dash-axis-x span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.dash-axis-x span:first-child { transform: translateX(-22%); }
.dash-axis-x span:last-child { transform: translateX(-78%); }
.dash-line { position: relative; height: clamp(138px, 18vw, 212px); color: var(--trend); background: linear-gradient(#fff, #fafcff); border-radius: 8px; }
.dash-line svg { display: block; width: 100%; height: 100%; }
.dash-gridline { stroke: #e2e9f3; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.dash-gridline.is-zero { stroke: #aabbd2; stroke-dasharray: none; }
.dash-cross { position: absolute; inset-block: 0; pointer-events: none; }
.dash-dot { position: absolute; width: 11px; height: 11px; transform: translate(-50%, -50%); border: 2px solid #fff; border-radius: 50%; background: var(--trend); box-shadow: 0 0 0 2px var(--trend); }
.dash-cross::before { position: absolute; inset-block: 6%; border-left: 1px dashed #94a3b8; content: ''; }
.dash-hit { position: absolute; inset: 0; cursor: crosshair; touch-action: pan-y; border-radius: 8px; }
.dash-hit:focus-visible { outline: 2px solid var(--trend); outline-offset: 2px; }
.dash-chart-overview .dash-line { height: clamp(190px, 24vw, 280px); }
.dash-tooltip { position: absolute; top: 8px; z-index: 3; width: max-content; min-width: 156px; max-width: 100%; padding: 8px 10px; background: #142342; color: #fff; border-radius: 8px; font-size: 12px; pointer-events: none; box-shadow: 0 4px 12px #14234240; overflow-wrap: anywhere; }
.dash-tip-date { font-size: 11px; color: #cfdbef; margin-bottom: 5px; }
.dash-tip-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; line-height: 1.9; }
.dash-tip-label { display: inline-flex; align-items: center; gap: 6px; color: #dbe6f5; }
.dash-tip-label i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dash-tip-row strong { font-variant-numeric: tabular-nums; }
.dash-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 1180px) {
  .dash-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .dash-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-axis-x { font-size: 10px; }
}
@media (max-width: 380px) {
  .dash-chart { gap: 6px 4px; }
  .dash-axis-y, .dash-axis-x { font-size: 9px; }
  .dash-kpi { padding: 10px; gap: 6px; }
  .dash-kpi-icon { width: 28px; height: 28px; }
}

/* 个人中心：充值 / 修改密码弹窗与操作日志 */
.profile-mask, .recharge-mask, .password-mask { position: fixed; inset: 0; z-index: 2100; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(18,32,34,.5); backdrop-filter: blur(2px); }
.profile-dialog { position: relative; width: min(460px, 100%); max-height: 86vh; overflow: auto; background: var(--surface, #fff); border-radius: 14px; padding: 26px 24px 22px; box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.profile-dialog h3 { margin: 0 0 14px; font-size: 19px; color: var(--text, #222); }
.profile-dialog .form-field { margin-bottom: 12px; }
.profile-dialog input, .profile-dialog select { width: 100%; box-sizing: border-box; }
.activity-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: #eef2f7; color: #475569; }
.activity-tag[data-type="recharge"] { background: #fef3c7; color: #92400e; }
.activity-tag[data-type="balance"] { background: #dcfce7; color: #166534; }
.activity-tag[data-type="password"] { background: #fee2e2; color: #991b1b; }
@media (max-width: 640px) {
  .profile-dialog { padding: 22px 16px 18px; }
  .activity-table th:nth-child(5), .activity-table td:nth-child(5) { display: none; }
}

/* ---------- 手机端显示优化 ---------- */
@media (max-width: 640px) {
  .site-header .header-inner { padding-top: 8px; row-gap: 4px; }
  .brand { min-width: 0; }
  .brand-text { min-width: 0; }
  .brand-text strong { max-width: 168px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .header-right { gap: 6px; min-width: 0; }
  .user-entry { gap: 5px; min-width: 0; }
  .user-badge { max-width: 74px; }
  .main-nav { margin-top: 2px; }

  .section-title { flex-wrap: wrap; align-items: flex-start; gap: 3px 10px; }
  .section-title h2 { font-size: 19px; }
  .section-title .sub { flex-basis: 100%; font-size: 12px; line-height: 1.5; white-space: normal; }

  body:not([data-mode="admin"]) .panel:not(.empty-state):not(.order-card) { padding: 14px 13px; }
  .order-card { padding: 13px; gap: 10px; }
  .order-card h3 { font-size: 15px; line-height: 1.45; }
  .order-card .muted { font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
  .order-card > strong { font-size: 16px; }
  .order-card .order-actions { margin-top: 8px; }

  .activity-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .activity-table { font-size: 12px !important; }
  .activity-table th, .activity-table td { padding: 7px 5px !important; }
  .activity-table td:first-child { white-space: normal; font-size: 11px; line-height: 1.4; }
  .activity-table th:first-child { white-space: nowrap; }
  .activity-table td:nth-child(3) { min-width: 0; word-break: break-word; }

  .product-card h3 { font-size: 12px; line-height: 1.45; }
  .product-card .card-bottom { gap: 4px; }
  .pagination { display: none !important; }
}

@media (max-width: 380px) {
  .brand-text strong { max-width: 110px; }
  .user-badge { max-width: 60px; }
  .section-title h2 { font-size: 18px; }
}
