/* Fish 本站商城样式 */
:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #06b97a;        /* 微信绿主调 */
  --primary-hover: #058f5f;
  --primary-soft: #ecfdf5;
  --warn-bg: #fef3c7;
  --warn-text: #92400e;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 2px 6px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .04);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

.shop-container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

.shop-main { padding: 28px 20px 8px; }

.page-back {
  margin-bottom: 14px;
  font-size: 13px;
}
.page-back a {
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.page-back a:hover { color: var(--primary); }

/* 页脚：与 hero 首尾呼应（绿色渐变 + 圆角，与 hero 同为 main 内子元素，宽度完全对齐） */
.shop-footer {
  display: block;
  background: linear-gradient(135deg, #06b97a 0%, #14b8a6 100%);
  color: rgba(255, 255, 255, .95);
  border-radius: 16px;
  margin-top: 8px;
  margin-bottom: 24px;
  padding: 22px 32px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(6, 185, 122, .18);
}
.shop-footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.shop-footer-inner a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, .35);
  text-underline-offset: 3px;
}
.shop-footer-inner a:hover {
  color: #fff;
  text-decoration-color: #fff;
}
.shop-footer-left { font-weight: 500; }
.shop-footer-right { opacity: .9; }
.shop-footer-icp {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, .3);
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, .85);
}
.shop-footer-icp a { color: rgba(255, 255, 255, .9); text-decoration: underline; }
.shop-footer-icp a:hover { color: #fff; }
.shop-announcement {
  /* 顶距留给 hero 的 margin-bottom 主导；底距与 product-list 衔接 */
  margin: 0 0 14px;
  background: linear-gradient(90deg, #fff7ed 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: 14px;
  color: #92400e;
  font-size: 13px;
  line-height: 1.6;
  padding: 12px 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.shop-announcement a { color: #b45309; text-decoration: underline; }
.shop-announcement a:hover { color: #78350f; }
@media (max-width: 720px) {
  .shop-announcement { padding: 10px 14px; border-radius: 12px; margin-bottom: 10px; }
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #06b97a 0%, #14b8a6 100%);
  color: #fff;
  padding: 32px 32px;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(6, 185, 122, .18);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.hero-text h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.hero-text p { margin: 0; opacity: .92; font-size: 13px; }
.hero-user {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  padding: 8px 16px; border-radius: 999px;
  font-size: 13px;
  display: inline-flex; align-items: center; gap: 8px;
  backdrop-filter: blur(4px);
}
.hero-user-email { font-weight: 500; }
.hero-user-tag {
  background: rgba(255,255,255,.25);
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px;
}
.hero-user-login {
  color: #fff; text-decoration: none;
}
.hero-user-login:hover { color: #fff; opacity: .85; }

.notice {
  padding: 14px 18px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
}
.notice-warn { background: var(--warn-bg); color: var(--warn-text); border-color: rgba(217, 119, 6, .25); }
.notice a { color: inherit; text-decoration: underline; }

/* Product grid (kept for compat) */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.product-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.product-cover-fallback { color: var(--primary); font-size: 36px; font-weight: 700; letter-spacing: 2px; opacity: .5; }

/* Single-column product list */
.product-list {
  display: flex; flex-direction: column;
  gap: 14px;
}
.product-row {
  display: grid;
  grid-template-columns: 1fr 108px;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.product-row:hover {
  border-color: rgba(6, 185, 122, .4);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.row-info { min-width: 0; }
.row-name {
  margin: 0 0 6px;
  font-size: 16px; font-weight: 600;
  color: var(--text);
  white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
}
.row-desc-wrap { margin: 4px 0 0; }
.row-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}
.row-desc.is-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row-desc.is-expanded {
  display: block;
  overflow: visible;
}
.row-desc :where(p, ul, ol) { margin: 4px 0; padding-left: 18px; }
.row-desc :where(a) { color: var(--primary); word-break: break-all; }
.row-desc-toggle {
  margin-top: 4px;
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.4;
}
.row-desc-toggle:hover { text-decoration: underline; }
.row-desc-toggle::after { content: " ▾"; font-size: 10px; }
.row-desc-toggle.is-expanded::after { content: " ▴"; }
.row-meta {
  margin-top: 8px;
  display: flex; align-items: baseline; gap: 12px;
}
.row-price { color: #ef4444; font-size: 20px; font-weight: 700; }
.row-tag {
  background: var(--primary-soft); color: var(--primary);
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  font-weight: 500;
}
.row-tag.stock-ok { background: var(--primary-soft); color: var(--primary); }
.row-tag.stock-empty { background: #fee2e2; color: #dc2626; }
.row-ctrl {
  display: flex; flex-direction: column; align-items: stretch;
  gap: 8px; min-width: 108px; width: 108px;
}
.qty-box {
  display: flex; align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
  background: #fff;
  height: 32px;
}
.qty-btn {
  width: 28px; height: 30px;
  background: var(--bg); color: var(--text);
  border: none; cursor: pointer;
  font-size: 15px; font-weight: 600;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
  flex-shrink: 0;
}
.qty-btn:hover { background: var(--primary-soft); color: var(--primary); }
.qty-input {
  flex: 1; min-width: 0; height: 30px;
  border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  text-align: center;
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  padding: 0 2px;
}
.qty-input:focus { outline: none; }
.row-buy {
  height: 34px;
  background: var(--primary); color: #fff; border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px; font-weight: 600;
  font-family: inherit;
  transition: background .12s, box-shadow .12s;
}
.row-buy:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(6, 185, 122, .25); }
.row-buy:active { transform: translateY(1px); }
.row-buy:disabled { opacity: .6; cursor: not-allowed; }

/* Detail */
.breadcrumb { margin-bottom: 18px; font-size: 13px; }
.item-wrap {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 28px; box-shadow: var(--shadow-sm);
}
.item-cover {
  border-radius: 12px; height: 320px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
}
.item-info h1 { margin: 0 0 10px; font-size: 22px; font-weight: 600; }
.item-price { color: #ef4444; font-size: 28px; font-weight: 700; margin-bottom: 12px; }
.item-price-unit { font-size: 13px; color: var(--muted); margin-left: 4px; font-weight: 400; }
.item-tag { display: inline-block; background: var(--primary-soft); color: var(--primary); padding: 4px 10px; border-radius: 999px; font-size: 12px; margin-bottom: 12px; }
.item-desc {
  background: var(--bg); border: 1px solid var(--border);
  padding: 14px 16px; border-radius: 10px; color: #334155;
  margin: 12px 0 18px; font-size: 13px; line-height: 1.7;
}

.buy-form label {
  display: block; font-size: 13px; color: var(--muted);
  margin: 12px 0 6px;
}
.buy-form input {
  width: 100%; padding: 10px 12px;
  border: 1px solid #cbd5e1; border-radius: 10px;
  font-size: 14px; background: #fff;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.buy-form input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 185, 122, .15);
}
.buy-summary {
  margin-top: 16px; padding: 12px 14px;
  background: var(--primary-soft); color: var(--primary);
  border-radius: 10px; font-weight: 600; font-size: 15px;
  display: flex; justify-content: space-between; align-items: center;
}
#buy-btn {
  width: 100%; margin-top: 14px;
  padding: 12px 16px; border-radius: 10px;
  background: var(--primary); color: #fff; border: none;
  font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: inherit;
  transition: background .15s, box-shadow .15s;
}
#buy-btn:hover { background: var(--primary-hover); box-shadow: 0 6px 18px rgba(6, 185, 122, .25); }
#buy-btn:disabled { opacity: .65; cursor: not-allowed; }
.buy-msg { color: var(--danger); margin-top: 10px; font-size: 13px; min-height: 18px; }

/* Checkout */
.checkout-wrap { max-width: 460px; margin: 24px auto; }
.checkout-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 16px; padding: 32px;
  text-align: center; box-shadow: var(--shadow);
}
.checkout-card h1 { margin: 0 0 18px; font-size: 20px; font-weight: 600; }
.checkout-meta { color: var(--muted); font-size: 13px; line-height: 1.8; margin-bottom: 10px; }
.checkout-amount { color: #ef4444; font-size: 28px; font-weight: 700; margin: 8px 0 22px; }
.qrcode {
  display: inline-block; padding: 14px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px;
}
.qrcode-tip { margin-top: 10px; font-size: 13px; color: var(--muted); }
.checkout-status {
  margin: 22px 0 8px; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  background: #f1f5f9; color: var(--muted); font-size: 13px;
}
.checkout-status.pending { background: #fef3c7; color: #92400e; }
.checkout-status.ok { background: var(--primary-soft); color: var(--primary); }
.checkout-status.fail { background: #fee2e2; color: var(--danger); }
.checkout-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 0% { opacity: 1 } 50% { opacity: .25 } 100% { opacity: 1 } }
.checkout-status.ok .dot,
.checkout-status.fail .dot { animation: none; }
.checkout-actions {
  margin-top: 14px; display: flex; justify-content: space-between;
  font-size: 13px;
}
.muted { color: var(--muted); }
.btn-link {
  display: inline-block; padding: 9px 16px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 13px;
}
.btn-link:hover { border-color: var(--primary); color: var(--primary); }

/* Order result */
.order-result { max-width: 720px; margin: 0 auto; }
.order-banner {
  border-radius: 14px; padding: 22px 24px; margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.order-banner.ok { background: linear-gradient(135deg, #06b97a, #10b981); color: #fff; }
.order-banner.pending { background: #fef3c7; color: #92400e; }
.order-banner.fail { background: #fee2e2; color: var(--danger); }
.banner-title { font-size: 18px; font-weight: 600; }
.banner-sub { font-size: 13px; opacity: .9; margin-top: 4px; }

.order-meta-card, .order-cards {
  background: #fff; border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 24px;
  margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.order-meta-card h2, .order-cards h2 {
  margin: 0 0 14px; font-size: 15px; font-weight: 600;
}
.order-meta-card dl {
  margin: 0; display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px;
  font-size: 13px;
}
.order-meta-card dt { color: var(--muted); }
.order-meta-card dd { margin: 0; color: var(--text); word-break: break-all; }

.card-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
}
.card-no, .card-pwd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.card-label { font-size: 12px; color: var(--muted); min-width: 92px; }
.card-no code, .card-pwd code {
  background: #fff; border: 1px solid var(--border);
  padding: 6px 10px; border-radius: 6px;
  font-size: 13px; word-break: break-all; flex: 1; max-width: 100%;
}
.pwd-text { max-height: 120px; overflow-y: auto; }
.copy-btn {
  background: var(--primary); color: #fff; border: none;
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
  font-size: 12px; font-family: inherit;
}
.copy-btn:hover { background: var(--primary-hover); }
.order-actions { text-align: center; margin-top: 18px; }
.order-refund-btn {
  padding: 8px 16px;
  border: 1px solid #dc2626;
  background: #fff;
  color: #dc2626;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.order-refund-btn:hover:not(:disabled) { background: #fef2f2; }
.order-refund-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 邮箱接码按钮与展示面板 */
.email-code-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: var(--primary);
  border: 1px solid var(--primary);
  padding: 5px 10px; border-radius: 6px; cursor: pointer;
  font-size: 12px; font-family: inherit;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.email-code-btn:hover { background: var(--primary); color: #fff; }
.email-code-btn:disabled, .email-code-btn.is-loading {
  opacity: .65; cursor: progress;
}
.email-code-panel {
  margin-top: 10px; padding: 12px 14px;
  background: #f8fafc; border: 1px dashed #cbd5e1;
  border-radius: 8px; font-size: 13px;
}
.email-code-panel .ec-status {
  color: var(--muted);
}
.email-code-panel .ec-status[data-kind="ok"] { color: #059669; font-weight: 500; }
.email-code-panel .ec-status[data-kind="fail"] { color: #dc2626; }
.email-code-panel .ec-status[data-kind="pending"]::before {
  content: ""; display: inline-block; width: 8px; height: 8px;
  background: #f59e0b; border-radius: 50%; margin-right: 6px;
  animation: ec-blink 1s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes ec-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.email-code-panel .ec-result {
  margin-top: 10px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
/* 全局兜底：避免 display:flex/grid/... 覆盖 HTML 原生 [hidden] 属性 */
[hidden] { display: none !important; }
.email-code-panel .ec-result-label {
  font-size: 12px; color: var(--muted); min-width: 50px;
}
.email-code-panel .ec-result-code {
  background: #fff; border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 6px;
  font-size: 18px; font-weight: 700; letter-spacing: 2px;
  color: #059669;
}
.email-code-panel .ec-meta {
  width: 100%; margin-top: 4px;
  font-size: 12px; color: var(--muted);
}
.order-cards-tip {
  margin: 12px 0 0; padding: 8px 12px;
  background: #fefce8; border: 1px solid #fde68a;
  border-radius: 8px; color: #854d0e;
  font-size: 12px; line-height: 1.6;
}

/* 首页入口卡片 → /shop/email-code（咸鱼用户引导，醒目橙色 CTA） */
.shop-ecode-entry {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 16px;
  padding: 18px 22px;
  background: linear-gradient(135deg, #fb923c 0%, #f97316 50%, #ea580c 100%);
  border: none;
  border-radius: 14px;
  color: #fff; text-decoration: none;
  box-shadow: 0 6px 18px rgba(234, 88, 12, .35), 0 2px 4px rgba(234, 88, 12, .25);
  transition: transform .15s ease, box-shadow .15s ease;
  overflow: hidden;
}
.shop-ecode-entry::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .6s ease;
  pointer-events: none;
}
.shop-ecode-entry:hover {
  text-decoration: none; color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(234, 88, 12, .45), 0 4px 8px rgba(234, 88, 12, .25);
}
.shop-ecode-entry:hover::before { transform: translateX(100%); }
.shop-ecode-entry-icon {
  font-size: 28px; flex-shrink: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .15));
  animation: ecode-bounce 2.4s ease-in-out infinite;
}
@keyframes ecode-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
.shop-ecode-entry-text {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
  line-height: 1.4;
}
.shop-ecode-entry-text strong {
  font-size: 17px; font-weight: 700; color: #fff;
  letter-spacing: .3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
.shop-ecode-entry-text span { color: rgba(255, 255, 255, .92); font-size: 13px; }
.shop-ecode-entry-arrow {
  font-size: 22px; color: #fff; flex-shrink: 0;
  font-weight: 700;
  transition: transform .15s ease;
}
.shop-ecode-entry:hover .shop-ecode-entry-arrow { transform: translateX(4px); }

/* ============== 公共接码页 /shop/email-code ============== */
.ecode-page { padding: 0 0 40px; }
.ecode-hero {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #a7f3d0; border-radius: 14px;
  padding: 22px 26px; margin: 14px 0 18px;
}
.ecode-hero h1 {
  margin: 0 0 8px; font-size: 22px; color: #065f46;
}
.ecode-sub {
  margin: 0; color: #047857; font-size: 14px; line-height: 1.7;
}
.ecode-sub strong { color: #065f46; }

.ecode-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 14px; padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.ecode-card label {
  display: block; margin: 14px 0 6px;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.ecode-card label:first-child { margin-top: 0; }
.ecode-hint {
  font-weight: 400; color: var(--muted); font-size: 12px;
}
.ecode-card input[type="email"],
.ecode-card textarea {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; font-family: inherit;
  background: #fff; color: var(--text);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.ecode-card textarea {
  resize: vertical; min-height: 80px; max-height: 200px;
  font-family: "SF Mono", Consolas, Menlo, monospace; font-size: 12px;
  line-height: 1.5; word-break: break-all;
}
.ecode-card input:focus,
.ecode-card textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .12);
}
.ecode-submit {
  margin-top: 16px;
  width: 100%; padding: 12px 16px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 8px; cursor: pointer;
  font-size: 15px; font-weight: 600; font-family: inherit;
  transition: background .12s ease;
}
.ecode-submit:hover { background: var(--primary-hover); }
.ecode-submit:disabled, .ecode-submit.is-loading {
  opacity: .65; cursor: progress;
}
.ecode-msg {
  margin-top: 10px; min-height: 20px; font-size: 13px;
  color: var(--muted); line-height: 1.6;
}
.ecode-msg[data-kind="ok"] { color: #059669; font-weight: 500; }
.ecode-msg[data-kind="fail"] { color: #dc2626; }
.ecode-msg[data-kind="pending"]::before {
  content: ""; display: inline-block; width: 8px; height: 8px;
  background: #f59e0b; border-radius: 50%; margin-right: 6px;
  animation: ec-blink 1s ease-in-out infinite; vertical-align: middle;
}

.ecode-result {
  margin-top: 18px; padding: 16px 18px;
  background: #f0fdf4; border: 1px dashed #86efac;
  border-radius: 10px;
}
.ec-result-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.ec-result-label {
  font-size: 13px; color: #047857; min-width: 50px;
}
.ecode-result .ec-result-code {
  background: #fff; border: 1px solid #86efac;
  padding: 10px 18px; border-radius: 6px;
  font-size: 22px; font-weight: 700; letter-spacing: 3px;
  color: #059669;
}
.ec-result-meta {
  margin-top: 10px; font-size: 12px; color: var(--muted);
}

.ecode-tips {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--border);
}
.ecode-tips h3 {
  margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600;
}
.ecode-tips ol {
  margin: 0; padding-left: 20px; font-size: 13px; color: var(--text-soft, #334155);
  line-height: 1.85;
}

code {
  font-family: "SF Mono", Consolas, Menlo, monospace;
  font-size: 13px;
}

/* ===================== Modal ===================== */
.modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade-in .18s ease;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.modal-mask[hidden] { display: none; }
.modal {
  background: #fff;
  width: 100%; max-width: 440px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-radius: 14px;
  padding: 28px 26px 22px;
  position: relative;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .22), 0 4px 18px rgba(15, 23, 42, .08);
  animation: slide-up .22s ease;
}
.modal-close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px;
  background: none; border: none; color: var(--muted);
  font-size: 24px; cursor: pointer; line-height: 1;
  border-radius: 6px;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-title {
  margin: 0 0 14px;
  font-size: 18px; font-weight: 600;
  padding-right: 36px;
}
.modal-tip {
  font-size: 13px; color: var(--muted); margin: 0 0 16px; line-height: 1.6;
}
.modal-form input[type=email],
.modal-form input[type=text],
.modal-form input[type=password],
.modal-form input[type=tel],
.modal-form input[type=number] {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1px solid #cbd5e1; border-radius: 8px;
  font-size: 14px; background: #fff;
  font-family: inherit;
  margin-bottom: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.modal-form input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 185, 122, .15);
}
.modal-primary {
  width: 100%; padding: 11px 16px;
  background: var(--primary); color: #fff; border: none;
  border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 600; font-family: inherit;
}
.modal-primary:hover { background: var(--primary-hover); }
.modal-primary:disabled { opacity: .65; cursor: not-allowed; }
.modal-secondary {
  padding: 9px 16px;
  background: #fff; color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  font-size: 13px; font-family: inherit;
}
.modal-secondary:hover { border-color: var(--primary); color: var(--primary); }
.modal-link { color: var(--primary); font-size: 13px; }
.modal-msg { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

body.modal-open { overflow: hidden; }

.pay-loading { text-align: center; padding: 24px 0; }
.spinner {
  width: 32px; height: 32px;
  margin: 0 auto 12px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
.pay-sub { font-size: 13px; color: var(--muted); }

.pay-summary {
  background: var(--bg);
  border-radius: 10px; padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}

/* 「确认订单」弹窗 */
.confirm-summary {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.confirm-row > span:first-child { color: var(--muted); flex: 0 0 auto; }
.confirm-row > strong, .confirm-row > span:last-child { text-align: right; word-break: break-all; }
.confirm-row.confirm-total {
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  margin-top: 4px;
  font-size: 15px;
}
.confirm-row.confirm-total > strong { color: var(--text); }
.confirm-row.confirm-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: -2px;
}
.confirm-pay {
  background: #fef3c7;
  color: #92400e;
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
  font-size: 14px;
  margin-bottom: 14px;
}
.confirm-pay strong { font-size: 18px; }
.confirm-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.confirm-actions .modal-secondary { flex: 0 0 auto; }
.confirm-actions .modal-primary { flex: 1 1 auto; }
.pay-goods { color: var(--text); }
.pay-amount { color: #ef4444; margin-top: 4px; font-size: 16px; font-weight: 600; }
.pay-amount strong { font-size: 20px; }
.pay-order-no { color: var(--muted); margin-top: 6px; font-size: 12px; }
.pay-order-no code { font-size: 12px; }

.qr-wrap { display: flex; justify-content: center; padding: 6px 0; }
.qr-target {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: inline-block;
}
.qr-tip { text-align: center; font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.pay-status {
  margin: 14px auto 0;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  font-size: 13px;
  background: #f1f5f9; color: var(--muted);
}
.pay-status.pending { background: #fef3c7; color: #92400e; }
.pay-status.ok { background: var(--primary-soft); color: var(--primary); }
.pay-status.fail { background: #fee2e2; color: var(--danger); }
.pay-status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  animation: pulse 1.4s infinite;
}
.pay-status.ok .dot, .pay-status.fail .dot { animation: none; }
.modal-body { display: flex; flex-direction: column; }
.modal-body > .qr-wrap + .qr-tip + .pay-status { align-self: center; }

.result-banner {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 14px;
}
.result-banner.ok { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.result-banner.fail { background: #fee2e2; color: var(--danger); }
.card-list { display: flex; flex-direction: column; gap: 10px; }
.card-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}
.card-line {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0;
  flex-wrap: wrap;
}
.card-line .card-label {
  font-size: 12px; color: var(--muted);
  min-width: 78px;
}
/* 账号/Email 行：单行省略，悬停可见完整内容 */
.card-line .card-no-code {
  background: #fff; border: 1px solid var(--border);
  padding: 6px 10px; border-radius: 6px;
  font-size: 12px;
  flex: 1; min-width: 0;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
/* 密码/Token 行：默认显示预览（一行），展开后可滚动多行 */
.card-line-pwd { align-items: flex-start; }
.card-line code.pwd {
  background: #fff; border: 1px solid var(--border);
  padding: 6px 10px; border-radius: 6px;
  font-size: 11px; line-height: 1.5;
  flex: 1; min-width: 0;
  word-break: break-all;
}
.card-line code.pwd.is-collapsed {
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.card-line code.pwd:not(.is-collapsed) {
  max-height: 140px; overflow-y: auto;
}
.card-copy {
  background: var(--primary); color: #fff; border: none;
  padding: 6px 12px; border-radius: 6px;
  cursor: pointer; font-size: 12px; font-family: inherit;
  flex-shrink: 0;
}
.card-copy:hover { background: var(--primary-hover); }
.card-toggle {
  background: #fff; color: var(--muted);
  border: 1px solid var(--border);
  padding: 5px 10px; border-radius: 6px;
  cursor: pointer; font-size: 12px; font-family: inherit;
  flex-shrink: 0;
}
.card-toggle:hover { color: var(--primary); border-color: var(--primary); }
.result-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px;
  gap: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(12px); opacity: 0; } }

/* ===================== 我的订单 ===================== */
.orders-page { max-width: 820px; margin: 0 auto; }
.orders-head { margin-bottom: 20px; }
.orders-head h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.orders-sub { margin: 0; font-size: 13px; color: var(--muted); }
/* 未登录时登录卡片采用固定中等宽度并居中，避免在大屏上过宽 */
.orders-login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 32px 28px;
  box-shadow: var(--shadow-sm);
  max-width: 480px;
  margin: 0 auto;
}
.orders-login-card .modal-form input { display: block; }
.orders-login-card .modal-tip {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px;
  background: #f3f4f6;
  border-radius: 10px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active {
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.modal-form label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.modal-form label + input { margin-bottom: 12px; }
.auth-captcha-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 12px;
}
.auth-captcha-row input {
  flex: 1;
  margin-bottom: 0 !important;
}
.auth-captcha-img {
  width: 130px;
  height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  background: #f6f8fb;
  flex-shrink: 0;
}
.orders-list { display: flex; flex-direction: column; gap: 12px; }
.orders-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.orders-item-main { flex: 1; min-width: 0; }
.orders-item-name { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.orders-item-meta {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  font-size: 13px; color: var(--muted);
}
.orders-item-meta code { font-size: 12px; word-break: break-all; }
.orders-item-price { color: #ef4444; font-weight: 600; }
.orders-item-time { margin-top: 6px; font-size: 12px; color: var(--muted); }
.orders-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
  min-width: 108px;
}
.orders-item-status {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end;
}
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.status-pill.status-ok { background: var(--primary-soft); color: var(--primary); }
.status-pill.status-pending { background: #fef3c7; color: #92400e; }
.status-pill.status-fail { background: #fee2e2; color: var(--danger); }
.status-pill.status-refund { background: #fee2e2; color: #dc2626; font-weight: 600; }
.orders-item--refunded {
  background: #fafafa;
  border-color: #e5e7eb;
}
.orders-item--refunded .orders-item-name { color: var(--muted); }
.orders-item-refund-note {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
}
.orders-item-refund-note.pending { color: #d97706; font-weight: 500; }
.orders-item-refund-note.fail { color: #dc2626; font-weight: 500; }
.orders-btn-muted {
  background: #f3f4f6;
  color: var(--muted);
  border-color: #e5e7eb;
}
.orders-btn-muted:hover { background: #e5e7eb; color: #374151; }
.orders-item-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}
.orders-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 36px;
  padding: 0 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s, box-shadow .12s;
}
.orders-btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(6, 185, 122, .25);
  color: #fff;
}
.orders-btn-secondary {
  text-align: center;
  padding: 8px 14px;
  height: auto;
  min-width: 96px;
}
.orders-pager {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 24px;
}
.orders-pager .btn-link.active {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

@media (max-width: 768px) {
  .item-wrap { grid-template-columns: 1fr; padding: 18px; }
  .item-cover { height: 220px; }
  .hero { padding: 24px 20px; flex-direction: column; align-items: flex-start; }
  .hero-text h1 { font-size: 20px; }
  .order-meta-card dl { grid-template-columns: 92px 1fr; }
  .shop-main { padding: 14px 8px 6px; }
  .product-list { gap: 10px; }
  .product-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
    padding: 14px 14px;
  }
  .shop-footer { padding: 18px 18px; }
  .row-ctrl {
    grid-column: 1 / -1;
    flex-direction: row; align-items: center;
    min-width: 0; width: auto;
  }
  .qty-box { flex: 1; max-width: 140px; }
  .row-ctrl .row-buy { flex: 1; }
  .row-name { font-size: 15px; }
  .row-price { font-size: 18px; }
  .modal { padding: 22px 20px 18px; }
  .orders-item {
    flex-direction: column;
    gap: 14px;
  }
  .orders-item-side {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
  }
  .orders-item-status { justify-content: flex-start; }
  .orders-item-actions {
    flex-direction: row;
    width: auto;
  }
}
