:root {
  --primary: #2f6bff; --primary-dark: #1f4fd1; --ink: #1a1f2b; --muted: #6b7280;
  --line: #e6e8ee; --bg: #f5f6fa; --card: #fff; --danger: #ef4444; --ok: #16a34a;
  --radius: 12px; --shadow: 0 4px 20px rgba(20,30,60,.08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.btn { border: none; border-radius: 10px; padding: 10px 16px; font-weight: 700; font-size: 14px; cursor: pointer; background: var(--primary); color: #fff; }
.btn:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field input, .field textarea, .field select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-family: inherit; }

/* 登录 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #0b1f4d, #2f6bff); }
.login-card { background: #fff; border-radius: 16px; padding: 32px; width: 340px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { font-weight: 800; font-size: 22px; color: var(--primary); text-align: center; }
.login-logo span { color: var(--ink); font-weight: 600; }

/* 布局 */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { background: #0b1326; color: #c9d2e3; padding: 18px 14px; display: flex; flex-direction: column; }
.side-logo { font-weight: 800; color: #fff; font-size: 18px; padding: 6px 8px 16px; }
.sidebar nav a { display: block; padding: 11px 12px; border-radius: 9px; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav a.active { background: var(--primary); color: #fff; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.side-foot a, .link-danger { color: #c9d2e3; font-size: 13px; background: none; border: none; text-align: left; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.side-foot a:hover, .link-danger:hover { background: rgba(255,255,255,.08); color: #fff; }
.link-danger { color: #ff8a80; }

.admin-main { display: flex; flex-direction: column; }
.admin-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.admin-top h2 { margin: 0; font-size: 20px; }
.admin-content { padding: 24px; }

/* 语言下拉框 */
.lang-select { font-size: 13px; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; height: 38px; padding: 0 10px; cursor: pointer; outline: none; }
.lang-select:hover { border-color: var(--primary); }
.lang-select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47,107,255,.15); }

/* 卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat .n { font-size: 28px; font-weight: 800; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 20px; }
.panel h3 { margin: 0 0 14px; font-size: 16px; }

/* 表格 */
table.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
.admin-table th { background: #f0f2f8; color: var(--muted); font-weight: 700; font-size: 12px; }
.admin-table tr:hover td { background: #fafbff; }
.order-legend { margin: 0 0 14px; font-size: 12px; line-height: 1.65; color: var(--muted); max-width: 1040px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #eef2ff; color: var(--primary); font-weight: 700; }
.status { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.status-pending { background: #fef3c7; color: #b45309; }
.status-paid { background: #dbeafe; color: #1d4ed8; }
.status-shipped { background: #d1fae5; color: #047857; }
.status-completed { background: #e0e7ff; color: #3730a3; }
.status-cancelled { background: #fee2e2; color: #b91c1c; }
.status-refunded { background: #ffedd5; color: #c2410c; }
.status-closed { background: #e5e7eb; color: #374151; }

/* 仪表盘：订单状态分布（统计卡风格：大数字 + 状态名，固定 7 张） */
.panel-dist .dist-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters select, .filters input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: #fff; }
.filters input { min-width: 160px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.table-wrap .admin-table { margin: 0; }
.btn-warn { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.btn-warn:hover { background: #d97706; }
.thumb-tiny { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #f0f2f8; }

/* 分页 */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pagination .page-info { color: var(--muted); font-size: 13px; margin-right: 8px; }
.pagination .page-btn { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.pagination .page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination .page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .page-btn:disabled { opacity: .5; cursor: not-allowed; }
.pagination .page-ellipsis { color: var(--muted); font-size: 13px; padding: 0 4px; }
.pagination .page-size { height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; cursor: pointer; }

/* 模态 */
.modal { position: fixed; inset: 0; background: rgba(10,15,30,.5); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal-box { background: #fff; border-radius: 14px; padding: 24px; width: 640px; max-width: 100%; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-box h3 { margin: 0 0 16px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* 弹窗里的分组小标题：用一条细线把「分销商信息 / 联系信息」与上面的通用字段隔开 */
.form-section { margin: 4px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 物流：物流公司选择器 + 单号下拉 */
.ship-field { position: relative; }
.ship-carrier-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 14px; font-family: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.ship-carrier-btn:hover { border-color: #b9c0d4; }
.ship-carrier-btn .ph { color: #9aa1b4; }
.ship-caret { color: #9aa1b4; font-size: 12px; }
.ship-pop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(16,24,40,.14); padding: 8px; }
.ship-search { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; margin-bottom: 4px; }
.ship-pop-list { max-height: 216px; overflow: auto; }
.ship-letter { font-size: 11px; font-weight: 700; color: #9aa1b4; padding: 7px 8px 2px; }
.ship-item { padding: 7px 8px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.ship-item:hover { background: #eef2ff; }
.ship-item.sel { background: #e6f1fb; color: #185fa5; font-weight: 700; }
.ship-pop-head { font-size: 13px; color: #8b90a0; padding: 8px; }
.ship-pop-row { font-size: 13px; padding: 5px 8px; color: #5f5e5a; }
.ship-pop-row b { color: var(--ink); }
.ship-pop-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #8b90a0; padding: 8px; margin-top: 4px; border-top: 1px solid var(--line); }
.ship-pop-foot a { color: var(--primary); font-weight: 700; cursor: pointer; }
.ship-then-hint { font-size: 12px; color: #854f0b; background: #faeeda; border: 1px solid #f5d99b; border-radius: 9px; padding: 8px 10px; margin: 0 0 14px; }

/* 订单表：商品缩略图 + 可点击商品名 */
.ord-item { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.ord-item:last-child { margin-bottom: 0; }
.ord-thumb { width: 38px; height: 38px; flex-shrink: 0; border-radius: 7px; object-fit: cover; background: #f1f2f6; display: block; }
.ord-thumb-empty { border: 1px dashed var(--line); }
.ord-item-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ord-name { color: var(--ink); font-weight: 600; font-size: 13px; text-decoration: none; line-height: 1.35; }
a.ord-name:hover { color: var(--primary); text-decoration: underline; }
.ord-qty { font-size: 11px; color: #8b90a0; }
.ord-flavor { font-size: 11px; color: #0f766e; background: #f0fdfa; border-radius: 4px; padding: 1px 5px; align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.ord-nic { color: #1d4ed8; background: #eff6ff; }
.ord-cancelled { color: #b91c1c; background: #fee2e2; }
.ord-item.cancelled .ord-name, .ord-item.cancelled .ord-qty { text-decoration: line-through; color: #9aa0ac; }
.ord-item.cancelled img { opacity: .45; }

/* 物流单号：点击查看轨迹（下拉为 fixed 定位，避开表格 overflow:hidden 的裁剪） */
.track-cell { position: relative; }
.track-link { display: inline-flex; align-items: flex-start; gap: 4px; margin-top: 5px; max-width: 178px; padding: 0; border: none; background: none; color: var(--primary); font-family: inherit; font-size: 11px; line-height: 1.45; text-align: left; cursor: pointer; word-break: break-all; }
.track-link:hover { text-decoration: underline; }
.track-pop { position: fixed; z-index: 80; width: 320px; max-height: 360px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(16,24,40,.18); padding: 12px; text-align: left; }
.track-head { font-size: 12px; color: #8b90a0; padding-bottom: 8px; border-bottom: 1px dashed var(--line); margin-bottom: 10px; word-break: break-all; }
.track-events { display: flex; flex-direction: column; }
.track-ev { display: flex; gap: 10px; padding-bottom: 13px; }
.track-ev:last-child { padding-bottom: 0; }
.track-ev-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #d3d6e0; flex-shrink: 0; }
.track-ev.is-latest .track-ev-dot { background: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.15); }
.track-ev-body { min-width: 0; }
.track-ev-desc { font-size: 13px; color: var(--ink); line-height: 1.45; }
.track-ev.is-latest .track-ev-desc { font-weight: 700; }
.track-ev-meta { font-size: 11px; color: #8b90a0; margin-top: 2px; }
.track-loading, .track-empty, .track-detail { font-size: 12px; color: #8b90a0; padding: 4px 0; word-break: break-all; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-dist .dist-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .side-foot { margin: 0; border: none; flex-direction: row; }
}

.tag-off { background: #fee2e2; color: #b91c1c; }

.faq-preview { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: #fafbff; }
.faq-p { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.faq-p:last-child { border-bottom: none; }
.faq-p b { display: block; color: #1e293b; margin-bottom: 2px; }
.faq-p span { color: #64748b; line-height: 1.5; }

/* 订单支付渠道徽章 */
.pay-chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pay-bank { background: #e0f2fe; color: #0369a1; }
.pay-paypal { background: #eef2ff; color: #4338ca; }
.pay-crypto { background: #fef3c7; color: #b45309; }
.pay-unknown { background: #f1f5f9; color: #64748b; }

/* 店铺设置 - 支付方式开关 */
.field-block { margin-bottom: 14px; }
.field-block > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.pay-toggle-list { display: flex; flex-direction: column; gap: 10px; }
.pay-toggle { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbff; cursor: pointer; }
.pay-toggle-ico { font-size: 18px; }
.pay-toggle-name { flex: 1; font-size: 14px; font-weight: 600; }
.pay-toggle input { display: none; }
.pay-toggle .switch { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #cbd5e1; transition: .2s; flex: none; }
.pay-toggle .switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; }
.pay-toggle input:checked + .switch { background: var(--ok); }
.pay-toggle input:checked + .switch::after { transform: translateX(18px); }

/* 后台设置：每种支付方式的收款信息配置卡片 */
.pay-detail-card { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; }
.pay-api-block { margin-top: 14px; border: 1px dashed #f0b429; border-radius: 12px; padding: 14px 16px; background: #fffdf5; }
.pay-api-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pay-api-head .pay-detail-ico { font-size: 18px; }
.pay-api-block .pay-toggle { margin-top: 10px; }
.pay-detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pay-detail-ico { font-size: 18px; }
.pay-detail-head b { font-size: 14px; }
.pay-detail-tag { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--ok); background: rgba(16,163,74,.1); padding: 2px 8px; border-radius: 999px; }
.pay-detail-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.pay-detail-fields .field { margin: 0; }
@media (max-width: 640px) { .pay-detail-fields { grid-template-columns: 1fr; } }

/* 安全提醒条（如 PayPal 密钥需轮换） */
.sec-warn { margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.55;
  color: #92400e; background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.4); }

/* PayPal 连通性自检结果 */
.pp-test-out { margin-top: 12px; }
.pp-test-out[hidden] { display: none; }
.pp-test-loading { font-size: 12.5px; color: #6b7280; }
.pp-test-ok { padding: 8px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: #166534; background: rgba(16,163,74,.1); border: 1px solid rgba(16,163,74,.35); }
.pp-test-fail { padding: 8px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: #991b1b; background: rgba(220,38,38,.08); border: 1px solid rgba(220,38,38,.35); }
.pp-test-hint { margin-top: 8px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.5; color: #92400e; background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.4); }
.pp-test-step { margin-top: 10px; padding: 10px; border-radius: 8px; border: 1px solid var(--line, #e5e7eb); background: #fafafa; }
.pp-test-step.ok { border-color: rgba(16,163,74,.35); }
.pp-test-step.bad { border-color: rgba(220,38,38,.35); }
.pp-test-step-head { font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.pp-test-code { margin-left: auto; font-size: 11px; color: #6b7280; }
.pp-test-line { display: flex; gap: 8px; font-size: 12px; margin-top: 5px; word-break: break-all; }
.pp-test-line span { color: #9ca3af; min-width: 62px; }
.pp-test-line b { font-weight: 600; }
.pp-test-raw { margin: 8px 0 0; padding: 8px; border-radius: 6px; background: #111827; color: #e5e7eb; font-size: 11px; line-height: 1.45; max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-all; }

/* 付款凭证 */
.proof-chip { display: inline-block; margin-top: 4px; padding: 2px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 600;
  color: #1d4ed8; background: rgba(37,99,235,.1); border: 1px solid rgba(37,99,235,.25); word-break: break-all; }
.cfp-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.cfp-summary > div { background: #f8f9fa; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.cfp-summary span { display: block; color: #9ca3af; font-size: 11px; margin-bottom: 2px; }
.cfp-submitted { padding: 8px 10px; border-radius: 8px; font-size: 12px; background: rgba(37,99,235,.07); border: 1px solid rgba(37,99,235,.25); word-break: break-all; }
@media (max-width: 640px) { .cfp-summary { grid-template-columns: 1fr; } }

/* ===== 数据总览（统计页） ===== */
.an-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.an-head-left { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.an-title { margin: 0; font-size: 18px; font-weight: 800; }
.an-statetime { color: var(--muted); font-size: 13px; }
.an-ranges { display: flex; gap: 8px; }
.an-range { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s; }
.an-range:hover { border-color: var(--primary); color: var(--primary); }
.an-range.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.an-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.an-cards-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.an-cards-row2 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.an-card { padding: 16px 14px; border-right: 1px solid var(--line); min-width: 0; }
.an-card:last-child { border-right: none; }
.an-card-label { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-card-val { font-size: 22px; font-weight: 800; line-height: 1.1; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-delta { font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.an-delta.up { color: var(--danger); }
.an-delta.down { color: var(--ok); }
.an-legend { display: flex; gap: 22px; margin-bottom: 14px; flex-wrap: wrap; }
.an-legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.an-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.an-chart { width: 100%; height: auto; display: block; max-height: 380px; }
@media (max-width: 1100px) { .an-cards-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } .an-card { border-bottom: 1px solid var(--line); } }
@media (max-width: 640px) { .an-cards-row, .an-cards-row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .an-head { align-items: flex-start; } }

/* 真实数据说明提示 */
.an-realtime-note { margin-bottom: 16px; padding: 9px 14px; border-radius: 8px; font-size: 12.5px; line-height: 1.5;
  color: #166534; background: rgba(22,163,74,.09); border: 1px solid rgba(22,163,74,.28); }

/* ===== 产品图片管理（编辑弹窗） ===== */
.prod-media-block { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.prod-media-block .media-title { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.prod-media-block .media-sub { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.media-field { margin-bottom: 14px; }
.media-field > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.media-main-row { display: flex; gap: 12px; align-items: flex-start; }
.media-preview { width: 110px; height: 110px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; flex: 0 0 auto; }
.media-main-controls { flex: 1; min-width: 0; }
.media-main-controls > input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; }
.media-btn-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.media-upload-btn { display: inline-flex; align-items: center; cursor: pointer; }
.media-status { color: var(--primary); font-size: 12px; }
.media-gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.media-thumb { position: relative; width: 74px; height: 74px; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.media-thumb-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: none; background: var(--danger); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.2); }

/* ===== 产品访问 TOP20 排行 ===== */
.an-top-title { margin: 0 0 14px; font-size: 16px; }
.an-top-table { width: 100%; border-collapse: collapse; }
.an-top-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.an-top-table th:first-child, .an-top-table td:first-child { width: 56px; text-align: center; }
.an-top-table th:last-child, .an-top-table td:last-child, .an-top-table th:nth-last-child(2), .an-top-table td:nth-last-child(2) { text-align: right; width: 110px; }
.an-top-table td { padding: 8px 10px; border-bottom: 1px solid #f0f2f5; font-size: 13px; vertical-align: middle; }
.an-top-table tr:last-child td { border-bottom: none; }
.an-top-table tbody tr:hover { background: #fafbff; }
.an-top-rank { white-space: nowrap; }
.an-top-medal { font-size: 18px; }
.an-top-num { color: var(--muted); font-weight: 700; }
.an-top-prod { display: flex; align-items: center; gap: 10px; min-width: 0; }
.an-top-thumb { width: 40px; height: 40px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; flex: 0 0 auto; }
.an-top-thumb-ph { display: inline-block; background: #f0f2f5; }
.an-top-name { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.an-top-name b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-top-visitors { color: var(--muted); }
.an-top-views b { color: var(--primary); }

/* ===== 阶梯报价编辑 ===== */
.prod-tiers-block { margin-top: 14px; }
.tiers-rows { margin-bottom: 8px; }
.tier-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.tier-row input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; }
.tier-row .tier-qty { flex: 1.4; min-width: 0; }
.tier-row .tier-price { flex: 1; min-width: 0; }
.tier-del { width: 30px; height: 30px; flex: 0 0 auto; border: none; border-radius: 50%; background: var(--danger); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; }

/* WhatsApp 统计 */
.an-cards-row-wa { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; }
.an-wa-panel .an-top-title { color: #128c7e; }
.an-wa-panel a { color: #128c7e; font-weight: 600; }
@media (max-width: 640px) { .an-cards-row-wa { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
