/* shop-dark.css - 前台暗色主题（胶囊卡片 UI），含亮色皮肤变量覆盖 */
:root {
  --bg: #0b0f18;
  --bg-glow: rgba(108, 140, 255, .12);
  --surface: #131a28;
  --surface-2: #182234;
  --surface-3: #1e293d;
  --border: #26314a;
  --border-hi: #3a4a6b;
  --text: #e8edf7;
  --text-2: #aeb9d0;
  --muted: #7c89a5;
  --accent: #6c8cff;
  --accent-2: #a06bff;
  --accent-soft: rgba(108, 140, 255, .14);
  --price: #ff6b7d;
  --success: #35d3a0;
  --warning: #ffb648;
  --input-bg: #101724;
  --shadow: 0 8px 28px rgba(0, 0, 0, .32);
  --card-grad: linear-gradient(135deg, #151e2f 0%, #111827 100%);
}
html.theme-light {
  --bg: #f3f5f9;
  --bg-glow: rgba(108, 140, 255, .10);
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #eef2fa;
  --border: #e3e8f2;
  --border-hi: #cbd6ea;
  --text: #2b3445;
  --text-2: #5b6577;
  --muted: #8a93a6;
  --accent: #3a6ff7;
  --accent-2: #6a4df4;
  --accent-soft: rgba(58, 111, 247, .10);
  --price: #f04438;
  --success: #17a05e;
  --warning: #e8890c;
  --input-bg: #ffffff;
  --shadow: 0 8px 28px rgba(20, 35, 80, .10);
  --card-grad: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  background-image: radial-gradient(60vw 40vw at 12% -8%, var(--bg-glow), transparent 70%),
                    radial-gradient(50vw 40vw at 95% 10%, rgba(160, 107, 255, .09), transparent 70%);
  background-attachment: fixed;
  transition: background-color .25s, color .25s;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; outline: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* 顶部通知条 */
.topbar { background: linear-gradient(90deg, #4c6ef5, #8a5cf6, #d256c9); color: #fff; text-align: center; font-size: 13px; padding: 7px 12px; letter-spacing: .3px; }

/* 头部（玻璃拟态） */
.header { position: sticky; top: 0; z-index: 50; background: rgba(15, 21, 34, .82); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
html.theme-light .header { background: rgba(255, 255, 255, .88); }
.header-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.logo { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 9px; letter-spacing: .5px; background: linear-gradient(90deg, #7fa2ff, #c08bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-icon { -webkit-text-fill-color: initial; font-size: 22px; filter: drop-shadow(0 0 8px rgba(108,140,255,.7)); }
.nav { display: flex; gap: 22px; }
.nav a { font-size: 15px; color: var(--text-2); padding: 6px 2px; border-bottom: 2px solid transparent; transition: color .15s; }
.nav a.active, .nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.search-box { margin-left: auto; display: flex; }
.search-box input { width: 220px; height: 38px; border: 1px solid var(--border); border-radius: 999px 0 0 999px; padding: 0 16px; font-size: 14px; background: var(--input-bg); color: var(--text); }
.search-box input::placeholder { color: var(--muted); }
.search-box input:focus { border-color: var(--accent); }
.search-box button { height: 38px; padding: 0 20px; border: none; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-radius: 0 999px 999px 0; font-size: 14px; font-weight: 600; }

/* 主布局 */
.main-layout { display: flex; gap: 18px; margin-top: 22px; align-items: flex-start; }
.sidebar { width: 250px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card-grad); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.card-title { font-size: 15px; font-weight: 700; padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.category-list { list-style: none; padding: 8px; }
.category-list li { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; font-size: 14px; color: var(--text-2); cursor: pointer; border-radius: 999px; margin-bottom: 2px; transition: all .15s; }
.category-list li:hover { background: var(--surface-3); color: var(--text); }
.category-list li.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 600; box-shadow: 0 6px 18px -8px var(--accent); }
.category-list li em { font-style: normal; font-size: 12px; color: var(--muted); background: var(--surface-3); border-radius: 999px; padding: 1px 9px; }
.category-list li.active em { background: rgba(255, 255, 255, .22); color: #fff; }
.announcement { padding: 14px 18px 18px; font-size: 13px; color: var(--text-2); line-height: 1.9; white-space: pre-wrap; }

/* 商品区标题 */
.content { flex: 1; min-width: 0; }
.content-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.content-header h2 { font-size: 20px; font-weight: 700; position: relative; padding-left: 14px; }
.content-header h2::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; border-radius: 4px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.product-count { font-size: 13px; color: var(--muted); }

/* ===== 胶囊商品卡片 ===== */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(390px, 1fr)); gap: 14px; }
.product-card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 14px 18px; min-height: 104px;
  border-radius: 999px;
  background: var(--card-grad);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .2s cubic-bezier(.2,.8,.2,1), border-color .2s, box-shadow .2s;
}
.product-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(220px 80px at 6% 50%, color-mix(in srgb, var(--c1, #6c8cff) 16%, transparent), transparent 70%);
  opacity: .9;
}
.product-card:hover { transform: translateY(-3px); border-color: var(--border-hi); box-shadow: 0 14px 34px -12px color-mix(in srgb, var(--c1, #6c8cff) 55%, transparent), var(--shadow); }
.p-icon { position: relative; z-index: 1; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 25px; background: linear-gradient(135deg, var(--c1, #6c8cff), var(--c2, #a06bff)); box-shadow: 0 8px 20px -8px var(--c1, #6c8cff); border: 2px solid rgba(255, 255, 255, .14); }
.p-main { position: relative; z-index: 1; min-width: 0; }
.p-name { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-desc { font-size: 12.5px; color: var(--muted); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-meta { display: flex; gap: 8px; align-items: center; margin-top: 7px; }
.p-tag { font-size: 11.5px; color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); border: 1px solid color-mix(in srgb, var(--success) 25%, transparent); padding: 2px 10px; border-radius: 999px; }
.p-tag.soldout { color: var(--muted); background: var(--surface-3); border-color: var(--border); }
.p-sales { font-size: 11.5px; color: var(--muted); }
.p-buy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.p-price { color: var(--price); font-size: 13px; font-weight: 600; white-space: nowrap; }
.p-price b { font-size: 22px; font-weight: 800; }
.btn-buy { border: none; border-radius: 999px; padding: 7px 20px; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--c1, #6c8cff), var(--c2, #a06bff)); box-shadow: 0 6px 16px -8px var(--c1, #6c8cff); transition: transform .15s, filter .15s; }
.btn-buy:hover:not(:disabled) { transform: scale(1.06); filter: brightness(1.12); }
.btn-buy:disabled { background: var(--surface-3); color: var(--muted); box-shadow: none; cursor: not-allowed; }

/* 按钮 */
.btn-primary { border: none; border-radius: 999px; padding: 10px 22px; font-size: 14px; font-weight: 600; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); transition: filter .15s, transform .15s; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.btn-primary:disabled { background: var(--surface-3); color: var(--muted); cursor: not-allowed; }
.btn-lg { padding: 13px 30px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-link { color: var(--accent); font-size: 14px; }
.btn-link:hover { text-decoration: underline; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(4, 8, 16, .72); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; width: 520px; max-width: 100%; max-height: 90vh; overflow: auto; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 24px; color: var(--muted); line-height: 1; }
.modal-body { padding: 20px 22px; }
.modal-footer { padding: 4px 22px 22px; text-align: center; }
.buy-product { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.buy-name { font-weight: 700; margin-bottom: 6px; }
.buy-price { color: var(--price); font-size: 18px; font-weight: 800; }
.buy-stock { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.buy-desc { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.form-item { margin-bottom: 16px; }
.form-item label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; }
.form-item input, .form-item select, .form-item textarea { width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; font-size: 14px; background: var(--input-bg); color: var(--text); }
.form-item input::placeholder { color: var(--muted); }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-item textarea { height: auto; padding: 10px 14px; }
.qty-ctrl { display: flex; align-items: center; }
.qty-ctrl button { width: 40px; height: 42px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 18px; }
.qty-ctrl button:first-child { border-radius: 12px 0 0 12px; }
.qty-ctrl button:last-child { border-radius: 0 12px 12px 0; }
.qty-ctrl input { width: 80px; height: 42px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); border-left: none; border-right: none; text-align: center; font-size: 15px; }
.pay-channels { display: flex; flex-direction: column; gap: 8px; }
.channel { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; cursor: pointer; background: var(--surface-2); transition: all .15s; }
.channel.checked { border-color: var(--accent); background: var(--accent-soft); }
.channel .ch-name { font-size: 14px; font-weight: 600; }
.channel .ch-tip { font-size: 12px; color: var(--muted); margin-left: auto; }
.no-channel { color: var(--price); font-size: 13px; padding: 8px 0; }
.buy-total { text-align: right; font-size: 14px; color: var(--text-2); }
.buy-total b { color: var(--price); font-size: 22px; }

/* 收银台 / 订单查询 */
.pay-page { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 44px 16px; }
.pay-box { background: var(--card-grad); border: 1px solid var(--border); border-radius: 22px; width: 480px; max-width: 100%; box-shadow: var(--shadow); overflow: hidden; }
.pay-header { background: linear-gradient(90deg, #4c6ef5, #8a5cf6); color: #fff; padding: 17px 24px; font-size: 17px; font-weight: 700; }
.pay-body-inner { padding: 24px; }
.pay-order { padding: 10px 24px 0; }
.po-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; font-size: 14px; border-bottom: 1px dashed var(--border); }
.po-row span { color: var(--muted); flex-shrink: 0; }
.po-row b { text-align: right; word-break: break-all; }
.pay-amount { color: var(--price); font-size: 20px; }
.pay-actions { padding: 18px 24px 26px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.pay-error { color: var(--price); text-align: center; padding: 24px; }
.qr-area { text-align: center; padding: 10px 0 4px; }
.qr-tip { font-size: 14px; color: var(--text-2); margin-bottom: 12px; }
.qr-wait { font-size: 13px; color: var(--muted); margin-top: 12px; }
#qrcode { display: inline-block; padding: 10px; background: #fff; border-radius: 12px; }
.order-result { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 8px; }
.st-wait { color: var(--warning); font-weight: 600; }
.st-paid { color: var(--success); font-weight: 600; }
.st-cancel { color: var(--muted); }
.cards-box { margin-top: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.cards-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.card-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.card-line code { font-size: 13px; color: var(--text); word-break: break-all; }
.card-line button { flex-shrink: 0; border: none; background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 4px 10px; font-size: 12px; }

/* 页脚 */
.footer { margin-top: 44px; padding: 28px 0; text-align: center; background: var(--surface); border-top: 1px solid var(--border); }
.footer-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.loading { color: var(--muted); text-align: center; }

/* 主题切换按钮 */
.theme-toggle { position: fixed; left: 18px; bottom: 18px; z-index: 990; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 9px 16px; font-size: 13px; box-shadow: var(--shadow); transition: all .15s; }
.theme-toggle:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }

@media (max-width: 900px) {
  .main-layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .search-box input { width: 140px; }
  .nav { gap: 14px; }
}
@media (max-width: 560px) {
  .product-grid { grid-template-columns: 1fr; }
  .product-card { grid-template-columns: 48px minmax(0,1fr) auto; gap: 10px; padding: 12px 14px; }
  .p-icon { width: 48px; height: 48px; font-size: 21px; }
  .p-price b { font-size: 18px; }
  .btn-buy { padding: 6px 14px; }
  .header-inner { gap: 12px; }
  .logo { font-size: 16px; }
}
