/* =========================================================
   基础变量与重置
   ========================================================= */
:root {
  --ink: #17212b;
  --ink-2: #263440;
  --paper: #f2f7fc;
  --white: #fff;
  --line: #d8e6f1;
  --muted: #5f7488;
  --coral: #2f9fe0;
  --coral-dark: #1b7fbd;
  --teal: #1f8fbe;
  --gold: #3f9ed6;
  --danger: #bf3d38;
  --radius: 8px;
  --shadow: 0 12px 36px rgba(23, 33, 43, .09);
  --font: Inter, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { transition: color .16s, background .16s, border-color .16s, transform .16s; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; stroke-width: 1.9; }
img { max-width: 100%; }

.hidden { display: none !important; }
.muted { color: var(--muted); }

.store-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.store-page > main { flex: 1; }

/* =========================================================
   顶部导航
   ========================================================= */
.store-header {
  height: 72px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  min-width: 0;
}
.brand > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-mark {
  width: 38px;
  height: 38px;
  padding: 3px;
  background: #fff;
  border: 1px solid #e1e5e1;
  border-radius: 7px;
  overflow: hidden;
  flex: none;
  display: grid;
  place-items: center;
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }

.store-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.store-nav > a:not(.icon-text) { font-weight: 600; }
.store-nav > a:hover { color: var(--coral); }

/* =========================================================
   按钮
   ========================================================= */
.icon-text, .primary, .secondary {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 7px;
  font-weight: 700;
  white-space: nowrap;
}
.ghost {
  background: transparent;
  color: var(--ink);
  padding: 0;
  border: 0;
  border-radius: 0;
}
.ghost:hover { color: var(--coral); }
.ghost svg { color: currentColor; }

.primary { background: var(--coral); color: #fff; }
.primary:hover { background: var(--coral-dark); }
.primary:disabled { background: #9cc7e4; opacity: .8; cursor: not-allowed; }

.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.secondary:hover { border-color: #9cc7e4; background: #f3faff; color: var(--coral-dark); }
.secondary:disabled { opacity: .5; cursor: not-allowed; }

.wide { width: 100%; }

.icon-button {
  border: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}
.icon-button:hover { background: #eaf3fb; color: var(--ink); }

.eyebrow {
  font-size: 11px;
  color: var(--coral);
  font-weight: 800;
  letter-spacing: 1.6px;
}

/* =========================================================
   首页 Hero
   ========================================================= */
.hero {
  background:
    radial-gradient(circle at 16% 18%, rgba(56, 189, 248, .22), transparent 46%),
    radial-gradient(circle at 84% 0%, rgba(59, 130, 246, .16), transparent 44%),
    #0a1524;
  color: #eaf6ff;
  padding: 26px 24px;
}
.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.hero-lead { display: grid; gap: 5px; }
.hero-lead .eyebrow { color: #7dd3fc; letter-spacing: 2.2px; font-size: 11px; }
.hero h1 {
  margin: 0;
  font-size: clamp(22px, 2.3vw, 32px);
  line-height: 1.2;
  letter-spacing: .5px;
  white-space: nowrap;
}
.hero h1 span { color: #6cc9f5; }
.hero-meta { display: grid; gap: 9px; }
.hero-meta p {
  margin: 0;
  color: #9fb0ab;
  font-size: 12.5px;
  line-height: 1.5;
}
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-actions .primary,
.hero-actions .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 15px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}
.hero-actions .secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .25);
  color: #e9efec;
}
.hero-actions .secondary:hover { border-color: rgba(255, 255, 255, .55); }
.hero-stats {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  border: 0;
}
.hero-stats span { display: block; font-size: 11px; color: #8fa7bb; }
.hero-stats strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  color: #fff;
  letter-spacing: .3px;
}
.hero-live { display: flex; justify-content: flex-end; }
.live-card {
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .45);
}
.live-head { display: flex; align-items: center; gap: 8px; padding: 16px 20px 0; }
.live-head strong { font-size: 14px; }
.live-tag {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e6f6f0;
  color: #0f7a5f;
  font-size: 11px;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #19b57a;
  box-shadow: 0 0 0 4px rgba(25, 181, 122, .15);
}
.live-body { min-height: 92px; padding: 18px 20px 20px; transition: opacity .18s ease; }
.live-body.fading { opacity: 0; }
.live-body strong { display: block; font-size: 17px; line-height: 1.5; }
.live-body p { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; }
.live-dots { display: flex; gap: 6px; padding: 0 20px 16px; }
.live-dots span { width: 6px; height: 6px; border-radius: 50%; background: #dde3df; }
.live-dots span.on { background: var(--coral); }
.live-foot {
  padding: 12px 20px;
  border-top: 1px dashed var(--line);
  color: #8b9791;
  font-size: 11.5px;
}
.hero-notice {
  padding: 12px 24px;
  background: #171d22;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: #a8b6b1;
  font-size: 12px;
}
.hero-notice span {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 1180px;
  margin: 0 auto;
}
.hero-notice svg { width: 14px; height: 14px; }
@media (max-width: 900px) {
  .hero { padding: 22px 18px; }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero h1 { white-space: normal; }
  .hero-stats { gap: 26px; flex-wrap: wrap; }
  .hero-live { justify-content: stretch; }
  .live-card { max-width: none; }
}

/* =========================================================
   商品区
   ========================================================= */
.catalog {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 24px 56px;
}
.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-title h2, .panel-title h2 {
  font-size: 26px;
  margin: 6px 0 0;
}
.section-title > #catalog-count {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}

.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.empty-state {
  border: 1px dashed #bec7c2;
  padding: 44px;
  text-align: center;
  color: var(--muted);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .55);
}

.download-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--coral);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.download-button:hover { background: var(--coral-dark); }
.download-button svg { width: 16px; height: 16px; }

/* 三步完成购买 */
.how {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 64px;
}
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.how-card {
  position: relative;
  overflow: hidden;
  padding: 22px 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.how-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #fdeee9;
}
.how-step {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 800;
  color: var(--coral);
  letter-spacing: 1px;
}
.how-card h3 {
  position: relative;
  z-index: 1;
  margin: 8px 0 6px;
  font-size: 16px;
}
.how-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
@media (max-width: 900px) {
  .how { padding: 0 16px 48px; }
  .how-grid { grid-template-columns: 1fr; }
}

/* 首页页脚 */
.site-footer {
  width: 100%;
  border-top: 1px solid var(--line);
  background: #f1f8fe;
}
.site-footer-bottom {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.footer-brand-block .brand { font-size: 14px; }
.footer-brand-block .brand-mark { width: 30px; height: 30px; border-radius: 6px; }
.site-footer .brand-mark { width: 28px; height: 28px; border-radius: 6px; }
.site-footer .brand { font-size: 14px; }
.footer-tagline {
  margin: 6px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.footer-wechat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 11.5px;
  cursor: pointer;
}
.footer-wechat svg { width: 13px; height: 13px; color: var(--teal); }
.footer-wechat b { font-weight: 700; }
.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.footer-links > div { display: grid; gap: 6px; align-content: start; }
.footer-links strong { font-size: 12px; color: var(--ink); }
.footer-links a,
.footer-links button,
.footer-links span {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
}
.footer-links a:hover,
.footer-links button:hover { color: var(--coral); }
@media (max-width: 760px) {
  .site-footer-bottom { padding: 12px 18px 16px; }
}

.store-footer {
  width: calc(100% - 48px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}
.store-footer .footer-link { color: var(--teal); font-weight: 700; }
.store-footer .footer-link:hover { color: var(--coral); text-decoration: underline; }

/* =========================================================
   商品卡片
   ========================================================= */
.app-card {
  position: relative;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 390px;
  min-height: 268px;
  overflow: hidden;
  background: #fff;
  border: 2px solid var(--card-accent, var(--coral));
  border-radius: 8px;
  box-shadow: 0 5px 18px rgba(23, 33, 43, .06);
}
.app-card:hover {
  box-shadow: 0 10px 26px rgba(23, 33, 43, .1);
}

.app-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 6px 9px;
  border-radius: 5px;
  background: var(--badge-color, var(--coral));
  color: var(--badge-text-color, #fff);
  font-size: 11px;
  font-weight: 800;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-preview-column {
  min-width: 0;
  display: flex;
  border-right: 1px solid var(--line);
  background: #e6f2fb;
}
.app-preview {
  position: relative;
  display: block;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 268px;
  overflow: hidden;
  color: #fff;
  background: #e6f2fb;
}
.app-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  padding: 0;
  background: #e6f2fb;
}
.app-preview-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 20px;
  color: #fff;
  background: linear-gradient(135deg, #17212b, #2b3b46);
  text-align: center;
}
.app-preview-fallback svg { width: 34px; height: 34px; color: #7ed2c8; }
.app-preview-fallback strong { font-size: 26px; }
.app-preview-fallback span { font-size: 11px; color: #c6d3ce; }

.app-info {
  min-width: 0;
  padding: 25px 24px;
  border-right: 1px solid var(--line);
}
.app-eyebrow {
  display: block;
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}
.app-info h3 {
  margin: 7px 0 4px;
  font-size: 22px;
  line-height: 1.3;
}
.app-info h4 {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}
.app-tools {
  display: flex;
  gap: 13px;
  flex-wrap: wrap;
  padding-bottom: 11px;
  border-bottom: 1px solid #e8ebe8;
}
.app-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.app-tool svg { width: 14px; height: 14px; }
.app-tool:hover { color: var(--coral); }
.app-tool.disabled { opacity: .42; cursor: not-allowed; }
button.app-tool {
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
}
.app-info p {
  margin: 13px 0 0;
  color: #59635f;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-purchase {
  min-width: 0;
  padding: 25px 24px;
  display: flex;
  flex-direction: column;
}
.app-product-choices {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 11px 0 10px;
}
.app-product-choice {
  border: 1px solid #d3dbd5;
  border-radius: 6px;
  background: #fff;
  color: #1f2937;
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}
.app-product-choice:hover { border-color: var(--coral); color: #0f172a; }
.app-product-choice.selected {
  border-color: var(--coral);
  background: #eef8ff;
  color: #0f172a;
  box-shadow: 0 0 0 1px rgba(47, 159, 224, .10);
}
.app-current-choice {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12.5px;
}
.app-current-choice strong { color: var(--ink); }

.app-sku-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.app-sku-option {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px 8px;
  padding: 11px;
  border: 1px solid #d5e5f2;
  border-radius: 6px;
  background: #fff;
  text-align: left;
}
.app-sku-option:hover { border-color: #8fc3e8; background: #f3faff; }
.app-sku-option.selected {
  border-color: var(--coral);
  background: #eef8ff;
  box-shadow: 0 0 0 1px rgba(47, 159, 224, .10);
}
.app-sku-option span {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 800;
  white-space: normal;
  word-break: break-word;
}
.app-sku-option strong { color: #1b7fbd; font-size: 14px; justify-self: end; }
.app-sku-option small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.app-purchase-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #e8ebe8;
}
.app-selected-stock {
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}
.app-selected-stock.out { color: var(--danger); }
.app-buy-button {
  min-height: 36px;
  padding: 0 13px;
  white-space: nowrap;
  background: #f26a3d;
  color: #fff;
}
.app-buy-button:hover { background: #d9542a; }
.app-buy-button:disabled {
  background: #f0b7a2;
  color: #fff;
  opacity: 1;
  cursor: not-allowed;
}

/* 内嵌下单面板（预览 + 规格 + 结算） */
.app-purchase-inline { padding: 16px 18px 14px; display: flex; flex-direction: column; }
.app-inline-step { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.app-inline-step .n {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.app-inline-step b { font-size: 12.5px; }
.app-inline-step em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 10px; }
.app-inline-specs { display: grid; gap: 5px; margin-bottom: 12px; }
.app-spec-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.app-spec-row:hover { border-color: #9cc7e4; }
.app-spec-row.selected { border-color: var(--coral); background: #eef8ff; box-shadow: inset 3px 0 0 var(--coral); }
.app-spec-row.soldout { opacity: .5; cursor: not-allowed; }
.spec-radio { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #b7cadb; }
.app-spec-row.selected .spec-radio { border-color: var(--coral); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 9px var(--coral); }
.spec-body strong { display: block; font-size: 13px; }
.spec-body small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.spec-price { font-size: 13.5px; font-weight: 800; color: var(--coral-dark); }
.app-inline-contact { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 8px; }
.app-inline-contact-input {
  width: 100%;
  height: 34px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  background: #fff;
}
.app-inline-contact-input:focus { border-color: var(--coral); outline: none; }
.app-inline-pay {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--coral);
  background: #eef8ff;
  border-radius: 7px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 12px;
}
.app-inline-pay .logo {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #1677ff;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.app-inline-pay em { margin-left: auto; font-style: normal; color: var(--coral-dark); font-size: 10.5px; }
.app-inline-totals { margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line); }
.app-inline-totals .line { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.app-inline-totals .total { display: flex; align-items: flex-end; justify-content: space-between; margin: 8px 0 10px; font-size: 12px; font-weight: 800; }
.app-inline-totals .total b { font-size: 23px; }
.app-pay-button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: #f26a3d;
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  padding: 12px;
  cursor: pointer;
}
.app-pay-button:hover { background: #d9542a; }
.app-pay-button:disabled { background: #f0b7a2; cursor: not-allowed; }
.app-inline-trust { display: flex; justify-content: center; gap: 12px; margin-top: 9px; color: var(--muted); font-size: 9.5px; }
.app-inline-trust span::before { content: "✓"; color: var(--coral); margin-right: 3px; font-weight: 800; }
.app-inline-note { margin: 8px 0 0; color: var(--danger); font-size: 10.5px; text-align: center; }

/* =========================================================
   弹窗与表单
   ========================================================= */
.dialog {
  border: 1px solid var(--line);
  padding: 0;
  border-radius: var(--radius);
  box-shadow: 0 18px 46px rgba(23, 33, 43, .18);
  width: min(92vw, 480px);
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow: auto;
  color: var(--ink);
}
.dialog::backdrop {
  background: rgba(23, 33, 43, .5);
  backdrop-filter: blur(2px);
}
.dialog-body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 30px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dialog-body > .close-dialog {
  position: absolute;
  right: 18px;
  top: 18px;
}
.dialog-body h2 { margin: -10px 0 4px; font-size: 25px; }
.dialog-body p { margin: 0; color: #59635f; line-height: 1.7; }

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}
input, select, textarea {
  width: 100%;
  border: 1px solid #cfd5d1;
  background: #fff;
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22, 135, 123, .11);
}
textarea { resize: vertical; line-height: 1.6; }

.pay-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  align-items: center;
  background: #f2f4f1;
  padding: 15px;
  border-radius: 6px;
}
.pay-summary span { color: var(--muted); font-size: 12px; }
.pay-summary strong { font-size: 23px; text-align: right; }
.pay-summary small { grid-column: 2; text-align: right; color: var(--muted); font-size: 11px; }

.checkout-payment-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
.checkout-payment-actions > button {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  min-height: 46px;
  padding: 8px 10px;
  gap: 8px;
  white-space: nowrap;
}
.checkout-payment-actions .payment-icon {
  display: block;
  flex: none;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.form-message { margin: 0; min-height: 18px; color: var(--danger); font-size: 13px; }

.order-result {
  margin-top: 15px;
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 6px;
  background: #f1f8fe;
  display: grid;
  gap: 6px;
}
.order-result p {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin: 0;
  font-size: 13px;
}
.order-result p span { color: var(--muted); }
.order-result code { word-break: break-all; color: var(--teal); font-weight: 700; }
.order-result .primary { margin-top: 6px; }
#query-result { display: grid; gap: 12px; }

.service-wechat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.service-wechat span { color: var(--muted); font-size: 12px; }
.service-wechat strong { font-size: 18px; text-align: right; word-break: break-all; }

.master-register-plan {
  padding: 16px;
  border: 1px solid #e8c9bf;
  border-radius: 8px;
  background: #fff7f4;
}
.master-register-plan span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.master-register-plan strong { display: block; margin: 4px 0; color: var(--coral); font-size: 28px; }
.master-register-plan p { margin: 0; color: #59635f; font-size: 12px; line-height: 1.6; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  transition: .2s;
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.app-buy-button span { font-size: 12px; }

.link-button {
  align-self: center;
  background: none;
  border: 0;
  padding: 0;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}
.link-button:hover { color: var(--coral); text-decoration: underline; }

/* =========================================================
   代理中心
   ========================================================= */
.agent-page { min-height: 100vh; }
.agent-main { max-width: 1120px; margin: 0 auto; padding: 48px 24px; }

.login-box {
  width: min(92vw, 390px);
  background: #fff;
  padding: 34px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.login-box h1 { font-size: 29px; margin: 7px 0 0; }
.agent-login { width: min(100%, 390px); margin: 55px auto; }
.agent-register { width: min(100%, 560px); }

.tier-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tier-option { position: relative; cursor: pointer; }
.tier-option input { position: absolute; opacity: 0; pointer-events: none; }
.tier-option span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  height: 100%;
}
.tier-option input:checked + span {
  border-color: var(--coral);
  box-shadow: 0 0 0 2px rgba(47, 159, 224, .14);
}
.tier-option strong { font-size: 13px; }
.tier-option em { color: var(--muted); font-size: 11px; font-style: normal; }

/* 代理注册页（卡片式档位） */
.agent-register-card {
  width: min(100%, 760px);
  margin: 36px auto;
  padding: 38px 40px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 22px;
}
.register-head h1 { font-size: 32px; margin: 8px 0; }
.register-head p { margin: 0; color: var(--muted); font-size: 14px; }
.register-form { display: grid; gap: 16px; }
.register-form .tier-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.register-form .tier-option span {
  position: relative;
  gap: 6px;
  padding: 16px 14px;
  border-radius: 12px;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.register-form .tier-option:hover span { transform: translateY(-1px); border-color: #c9d2cd; }
.register-form .tier-option input:checked + span {
  border-color: var(--coral);
  background: #fff7f4;
  box-shadow: 0 0 0 3px rgba(47, 159, 224, .14);
}
.register-form .tier-option input:checked + span::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 12px;
  color: var(--coral);
  font-size: 13px;
  font-weight: 800;
}
.tier-tag { color: var(--muted); font-size: 11px; letter-spacing: 1px; }
.register-form .tier-option strong { font-size: 16px; }
.tier-price { font-size: 20px; font-weight: 800; color: var(--ink); }
.register-form .tier-option small { color: var(--muted); font-size: 12px; }
.register-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.register-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.register-benefits span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.register-benefits svg { width: 14px; height: 14px; color: var(--teal); }
@media (max-width: 720px) {
  .agent-register-card { padding: 26px 20px; margin: 20px auto; }
  .register-form .tier-options { grid-template-columns: 1fr; }
  .register-fields { grid-template-columns: 1fr; }
  .register-head h1 { font-size: 26px; }
}

.agent-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.agent-heading h1 { font-size: 32px; margin: 5px 0 0; }
.agent-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.partner-links { display: grid; gap: 8px; margin-bottom: 18px; }
.partner-links > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
}
.partner-links span { font-size: 12px; color: var(--muted); font-weight: 700; }
.partner-links code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--teal);
  font-size: 12px;
}

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.agent-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}
.metric-icon {
  width: 43px;
  height: 43px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex: none;
}
.metric-icon.coral { background: #fff0ec; color: var(--coral); }
.metric-icon.teal { background: #e8f6f3; color: var(--teal); }
.metric-icon.gold { background: #fff6df; color: var(--gold); }
.metric-icon.ink { background: #e9edf0; color: var(--ink); }
.metric div { min-width: 0; }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong {
  display: block;
  font-size: 24px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plain-panel {
  margin-top: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.panel-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
table { border-collapse: collapse; width: 100%; min-width: 640px; }
th, td {
  text-align: left;
  border-bottom: 1px solid #e8ebe8;
  padding: 13px 15px;
  vertical-align: middle;
}
th {
  background: #f2f7fc;
  color: #59635f;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbf9; }
td strong { display: block; }
td small { color: var(--muted); }

.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.status.paid, .status.available { background: #e5f5f1; color: #087467; }
.status.pending { background: #fff2d4; color: #956200; }
.status.sold { background: #edf0f2; color: #56616a; }
.status.rejected { background: #fdeceb; color: var(--danger); }

.upload-file-status { color: var(--muted); font-size: 12px; font-weight: 400; }


/* =========================================================
   软件预览页
   ========================================================= */
.preview-page { min-height: 100vh; background: var(--paper); }
.preview-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 72px; }
.preview-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}
.preview-heading h1 { font-size: 34px; margin: 7px 0 0; }
.preview-version {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.preview-description {
  max-width: 820px;
  color: #59635f;
  line-height: 1.8;
  white-space: pre-line;
  margin: 0 0 28px;
}
.preview-gallery { display: grid; gap: 24px; }
.preview-gallery figure {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(23, 33, 43, .06);
}
.preview-gallery img { display: block; width: 100%; height: auto; background: #e9ece9; }
.preview-gallery figcaption { padding: 12px 16px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }

/* =========================================================
   模拟收银台
   ========================================================= */
.cashier-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #f2f7fc, #e6f2fb);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.cashier-card {
  width: min(100%, 430px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cashier-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.cashier-brand img { width: 32px; height: 32px; object-fit: contain; }
.cashier-amount { text-align: center; padding: 10px 0 2px; }
.cashier-amount span { color: var(--muted); font-size: 12px; }
.cashier-amount strong { display: block; font-size: 34px; margin-top: 4px; }
.cashier-rows { display: grid; gap: 8px; font-size: 13px; }
.cashier-rows p { display: flex; justify-content: space-between; gap: 12px; margin: 0; }
.cashier-rows span { color: var(--muted); }
.cashier-rows b { font-weight: 700; text-align: right; word-break: break-all; }
.cashier-actions { display: grid; gap: 10px; }
.cashier-note { color: var(--muted); font-size: 12px; text-align: center; line-height: 1.7; margin: 0; }
.cashier-message { margin: 0; min-height: 18px; font-size: 13px; color: var(--danger); text-align: center; }


/* =========================================================
   管理后台
   ========================================================= */
.admin-tag {
  margin-left: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #fff0ec;
  color: var(--coral);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .4px;
}

.admin-main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 56px;
}

.admin-login { margin: 32px auto 0; }
.admin-form { display: flex; flex-direction: column; gap: 16px; }
.admin-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.admin-hint code { color: var(--teal); font-weight: 700; }

.admin-metrics { margin-bottom: 4px; }
.admin-metrics .metric small { display: block; margin-top: 2px; font-size: 11px; }

/* 订单表 6 列，横向空间优先给订单面板：两块面板纵向排列，手机上不必左右滑动 */
.admin-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.admin-columns .plain-panel { min-width: 0; }
.admin-columns table { min-width: 560px; }
.admin-columns th, .admin-columns td { padding: 11px 12px; font-size: 13px; }

.admin-orders { min-width: 720px; }
.admin-orders th, .admin-orders td { padding: 11px 14px; vertical-align: middle; }
.admin-orders td > strong { white-space: nowrap; letter-spacing: .2px; }
.admin-orders td > small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-orders th:nth-child(1) { width: 190px; }
.admin-orders th:nth-child(3) { width: 92px; }
.admin-orders th:nth-child(4) { width: 96px; }
.admin-orders th:nth-child(5) { width: 190px; }
.admin-orders th:nth-child(6) { width: 132px; }
.admin-order-amount { white-space: nowrap; font-weight: 700; }
.admin-order-txn { color: #8b9490; font-size: 11px; }

.admin-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; white-space: nowrap; }
.admin-row-actions .secondary { min-height: 30px; padding: 0 10px; font-size: 12px; }
.admin-row-actions .link-button { font-size: 12px; }

.admin-sku-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.sku-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.sku-chip b { color: var(--ink); font-size: 12px; font-weight: 700; }
.sku-chip.sold { background: #faf4f2; border-color: #ecd8d3; color: #b5827b; }

.admin-product-list { display: grid; gap: 14px; }
.admin-group {
  padding: 4px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8faf8;
}
.admin-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px;
}
.admin-group-head strong { font-size: 14px; letter-spacing: .2px; }
.admin-group-head span { color: var(--muted); font-size: 12px; }
.admin-group-body { display: grid; gap: 10px; }
.admin-group .admin-product-card { background: #fff; }
.admin-product-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.admin-product-card:hover { border-color: #c9d4cd; box-shadow: 0 8px 22px rgba(23, 33, 43, .06); }
.admin-product-card.off { background: #fbfbfa; }
.admin-product-main { min-width: 0; }
.admin-product-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-product-name { font-size: 15px; letter-spacing: .2px; }
.admin-product-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 5px; color: var(--muted); font-size: 12px; }
.admin-product-side {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: end;
  padding-left: 16px;
  border-left: 1px dashed var(--line);
}
.admin-product-price { font-size: 18px; font-weight: 700; }
.admin-product-price small { margin-left: 3px; font-size: 11px; font-weight: 400; color: var(--muted); }
.admin-product-count { font-size: 12px; color: var(--muted); }
.admin-product-side .admin-row-actions { justify-content: flex-end; }
.admin-empty {
  padding: 34px 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
@media (max-width: 720px) {
  .admin-group { padding: 2px 10px 10px; }
  .admin-product-card { grid-template-columns: 1fr; gap: 12px; }
  .admin-product-side {
    justify-items: start;
    padding-left: 0;
    padding-top: 10px;
    border-left: 0;
    border-top: 1px dashed var(--line);
  }
  .admin-product-side .admin-row-actions { justify-content: flex-start; }
}
.link-button.danger { color: var(--danger); }
.link-button.danger:hover { color: #8f221e; }

.admin-dialog { width: min(96vw, 780px); }
.admin-dialog .dialog-body { gap: 16px; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.admin-cover,
.admin-gallery {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcff;
}
.admin-cover-head,
.admin-gallery-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-cover-head > strong,
.admin-gallery-head strong { font-size: 14px; }
.admin-cover-head .admin-hint { flex: 1 1 260px; text-align: right; }
.admin-gallery-head > div { display: grid; gap: 4px; }
.admin-cover-body { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: start; }
.admin-cover-thumb {
  display: grid;
  place-items: center;
  height: 92px;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}
.admin-cover-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-cover-thumb.empty { border-style: dashed; }
.admin-cover-fields { display: grid; gap: 8px; }
.admin-cover-fields > input { width: 100%; }
.admin-cover-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-cover-actions .secondary { min-height: 32px; padding: 0 12px; font-size: 12px; }

.admin-gallery-actions { display: flex; gap: 8px; flex: none; }
.admin-gallery-actions .secondary { min-height: 32px; padding: 0 12px; font-size: 12px; }
.admin-preview-rows { display: grid; gap: 8px; }
.admin-preview-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.admin-preview-thumb {
  width: 96px;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f4f5f2;
  object-fit: cover;
}
.admin-preview-row input { padding: 8px 9px; font-size: 13px; }
.admin-preview-row .icon-button { width: 34px; height: 34px; }

.admin-file-row { display: flex; align-items: center; gap: 10px; }
.admin-file-row .admin-file { flex: 1; min-width: 0; }
.admin-file-row .secondary { flex: none; min-height: 36px; padding: 0 12px; font-size: 12px; white-space: nowrap; }

.admin-qr-block { margin-top: 18px; }.admin-qr-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: start; }
.admin-qr-preview {
  display: grid;
  place-items: center;
  min-height: 180px;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}
.admin-qr-preview img { width: 100%; height: 180px; object-fit: contain; }
.admin-qr-fields { display: grid; gap: 10px; }
.admin-qr-actions { display: flex; gap: 8px; }
.admin-qr-actions .secondary { min-height: 34px; padding: 0 12px; font-size: 12px; }

.cashier-payee { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--ink); }

.admin-switch {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.admin-switch input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  flex: none;
  accent-color: var(--coral);
}

.admin-types {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcff;
}
.admin-types-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-types-heading > strong { font-size: 14px; }
.admin-types-heading .secondary { min-height: 32px; padding: 0 12px; font-size: 12px; }
.admin-type-rows { display: grid; gap: 10px; }
.admin-type-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 104px 92px 96px 34px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.admin-type-row label { gap: 4px; color: var(--muted); font-size: 11px; }
.admin-type-row input { padding: 8px 9px; font-size: 13px; }
.admin-type-row .icon-button { width: 34px; height: 34px; }

.admin-form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.admin-form-actions > button { min-width: 118px; justify-content: center; }


/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 900px) {
  .app-card {
    grid-template-columns: 210px minmax(0, 1fr);
    min-height: 0;
  }
  .app-purchase {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }
  .app-info { border-right: 0; }
  .app-preview { min-height: 230px; }
  .app-sku-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-grid, .agent-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-columns { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 620px) {
  .store-header { height: 64px; padding: 0 16px; }
  .store-header .brand { font-size: 15px; }
  .store-nav { gap: 14px; }
  .store-nav > a:not(.icon-text), .store-nav .icon-text span { display: none; }
  .catalog { padding: 30px 16px 48px; }
  .section-title { margin-bottom: 15px; }
  .section-title h2 { font-size: 22px; }
  .app-grid { gap: 12px; }
  .app-card { display: block; min-height: 0; }
  .app-preview-column { border-right: 0; border-bottom: 1px solid var(--line); }
  .app-preview, .app-preview-column { height: 190px; min-height: 190px; }
  .app-info {
    padding: 18px 18px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .app-info h3 { font-size: 19px; }
  .app-info p { -webkit-line-clamp: 6; }
  .app-purchase { padding: 18px; }
  .app-sku-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-purchase-footer { align-items: flex-start; flex-direction: column; }
  .app-buy-button { width: 100%; }
  .store-footer { width: calc(100% - 32px); padding: 20px 0; flex-direction: column; gap: 6px; }
  .dialog-body { padding: 25px 20px; }
  .metric-grid, .agent-metrics { grid-template-columns: 1fr; }
  .agent-main { padding: 28px 16px; }
  .agent-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
  .agent-actions { width: 100%; }
  .agent-actions > * { flex: 1; }
  .tier-options { grid-template-columns: 1fr; }
  .partner-links > div { grid-template-columns: 84px minmax(0, 1fr) 38px; }
  .preview-main { width: calc(100% - 28px); padding: 32px 0 52px; }
  .preview-heading { align-items: flex-start; flex-direction: column; }
  .preview-heading h1 { font-size: 26px; }
  .preview-description { font-size: 13px; }
  .admin-main { padding: 26px 16px 40px; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-type-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-type-row .type-remove { grid-column: 2; justify-self: end; }
  .admin-form-actions > button { flex: 1; min-width: 0; }
}

@media (max-width: 380px) {
  .checkout-payment-actions { gap: 6px; }
  .checkout-payment-actions > button { padding: 8px 5px; font-size: 12px; gap: 5px; }
  .checkout-payment-actions .payment-icon { width: 20px; height: 20px; }
}

@media (min-width: 901px) {
  .app-card {
    grid-template-columns: minmax(0, 1fr) 390px;
    grid-template-areas: "preview preview" "info purchase";
    height: auto;
    min-height: 270px;
  }
  .app-preview-column {
    grid-area: preview;
    height: 160px;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .app-preview { height: 160px; min-height: 0; }
  .app-preview img { padding: 0; }
  .app-info { grid-area: info; }
  .app-purchase { grid-area: purchase; }
  .app-info, .app-purchase { padding: 16px 18px; overflow: hidden; }
  .app-purchase { overflow: visible; padding: 16px 18px; }
  .app-info p { -webkit-line-clamp: 4; }
  .app-product-choices {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 5px;
    margin: 7px 0;
  }
  .app-product-choice {
    max-width: 185px;
    min-width: 0;
    padding: 6px 8px;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .app-current-choice {
    margin: 0 0 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .app-sku-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .app-sku-option { min-height: 48px; padding: 9px 8px; gap: 3px 5px; }
  .app-sku-option span { font-size: 14px; }
  .app-sku-option strong { font-size: 14px; }
  .app-sku-option small { font-size: 11px; }
  .app-purchase-footer { padding-top: 10px; }
}


/* =========================================================
   收银台二维码 / 后台支付配置
   ========================================================= */
.cashier-qr {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #f8fcff;
}
.cashier-qr img { width: 220px; height: 220px; border-radius: 6px; background: #fff; }
.cashier-qr span { color: var(--muted); font-size: 12px; text-align: center; }
#cashier-static-wrap .wide { width: 100%; }
#cashier-static-wrap #cashier-static-note { text-align: center; }

.admin-payment { display: grid; gap: 16px; }
.admin-payment .panel-title { margin-bottom: 0; }
.admin-payment > summary.panel-title { list-style: none; cursor: pointer; }
.admin-payment > summary.panel-title::-webkit-details-marker { display: none; }
.admin-payment[open] > summary.panel-title { margin-bottom: 4px; }
.admin-payment-columns { gap: 16px; margin-top: 4px; }
.admin-payment-block {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcff;
}
.admin-payment-block h3 { margin: 0; font-size: 15px; }
.admin-steps {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px dashed #d5e2db;
  border-radius: 10px;
  background: #f7faf8;
  color: #4f5a55;
  font-size: 12px;
  line-height: 1.75;
}
.admin-steps strong { color: var(--ink); font-size: 12px; }
.admin-steps ol { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.admin-steps code { color: var(--teal); font-weight: 600; }
.admin-payment-block label { gap: 5px; color: var(--muted); font-size: 12px; }
.admin-payment-block input, .admin-payment-block textarea { font-size: 13px; padding: 9px 10px; }
.admin-payment-block textarea {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}
.admin-payment .admin-hint { margin: 0; }
.admin-payment .admin-hint.ok { color: #087467; font-weight: 600; }
.admin-payment .admin-hint code { word-break: break-all; }
.admin-file input[type="file"] {
  padding: 8px 10px;
  background: #fff;
  border-style: dashed;
  font-size: 12px;
  color: var(--muted);
}
.admin-payment .admin-form-actions { flex-wrap: wrap; }

/* 长表单弹窗：保存按钮吸底，手机上也能直接点到 */
.admin-dialog .dialog-body { max-height: calc(100vh - 24px); overflow: auto; }
.admin-dialog .admin-form-actions {
  position: sticky;
  bottom: -30px;
  z-index: 2;
  margin: 0 -30px -30px;
  padding: 14px 30px;
  background: #fff;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
}

.admin-panel-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.admin-mobile-tip { display: none; color: var(--muted); font-size: 12px; font-weight: 600; }

@media (max-width: 900px) {
  .admin-payment-columns { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 720px) {
  .admin-mobile-tip { display: inline-flex; align-items: center; gap: 4px; }
  .admin-payment .admin-form-actions { justify-content: stretch; }
}

@media (max-width: 620px) {
  .cashier-card { padding: 22px; }
  .cashier-qr img { width: 190px; height: 190px; }
  .admin-dialog .dialog-body { padding: 22px 18px; }
  .admin-dialog .admin-form-actions {
    bottom: -22px;
    margin: 0 -18px -22px;
    padding: 12px 18px;
  }
}


/* =========================================================
   商品列表：两列卡片
   ========================================================= */
.app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.app-card { display: flex; flex-direction: column; min-height: 0; }
.app-preview-column {
  height: 170px;
  min-height: 0;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  display: block;
}
.app-preview { height: 170px; min-height: 0; flex: none; }
.app-info { border-right: 0; padding: 16px 18px 6px; }
.app-info h3 { font-size: 20px; }
.app-info p { -webkit-line-clamp: 2; }

.app-buy-zone { margin-top: auto; padding: 12px 18px 16px; }
.app-spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.app-spec-chip {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  margin: 0;
}
.app-spec-chip:hover { border-color: #9cc7e4; }
.app-spec-chip.selected { border-color: var(--coral); background: #eef8ff; box-shadow: inset 2px 0 0 var(--coral); }
.app-spec-chip.soldout { opacity: .45; cursor: not-allowed; }
.chip-dot { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #b7cadb; }
.app-spec-chip.selected .chip-dot { border-color: var(--coral); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 8px var(--coral); }
.chip-body b { display: block; font-size: 11.5px; color: var(--ink); }
.chip-body small { display: block; margin-top: 1px; color: var(--muted); font-size: 9.5px; }
.chip-price { font-size: 11.5px; font-weight: 800; color: var(--coral-dark); }

.app-buy-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  flex-wrap: wrap;
}
.app-buy-stock { font-size: 10.5px; color: var(--muted); }
.app-buy-stock.out { color: var(--danger); }
.app-buy-total { margin-left: auto; text-align: right; }
.app-buy-total small { display: block; color: var(--muted); font-size: 9.5px; }
.app-buy-total b { font-size: 20px; }
.app-buy-button { flex: 0 0 auto; }

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

@media (min-width: 901px) {
  .app-card {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    grid-template-columns: none;
    grid-template-areas: none;
  }
  .app-preview-column { height: 170px; min-height: 0; grid-area: auto; }
  .app-preview { height: 170px; min-height: 0; }
  .app-info { grid-area: auto; padding: 16px 18px 6px; }
  .app-buy-zone { grid-area: auto; }
}
