/* ===== 乡韵集市 全局样式（移动端优先，响应式） ===== */
:root {
  --primary: #2e7d4f;
  --primary-dark: #256240;
  --primary-light: #e6f3ea;
  --accent: #d4a017;
  --danger: #d9483b;
  --text: #22312a;
  --text-sub: #6b7a72;
  --bg: #f5f7f4;
  --card: #ffffff;
  --border: #e3e8e2;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(34, 49, 42, 0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* hidden 属性统一兜底：部分元素（如导航项）有作者样式，UA 的 [hidden]{display:none}
   可能被覆盖，导致「逻辑上隐藏」但视觉上仍出现。!important 保证显隐语义可靠。 */
[hidden] { display: none !important; }
/* 微信（尤其 iOS）会按系统「字体大小」放大网页文字，破坏固定布局；
   -webkit-text-size-adjust:100% 锁定缩放比例，保证微信内排版与设计一致。 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text);
  /* 100vh 在微信/移动浏览器里包含地址栏高度，底部会被顶出屏幕；
     优先用 dvh，回退到由 JS 写入的 --vh 变量，最后才用 100vh。 */
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
  display: flex; flex-direction: column;
  /* 微信内点击元素的高亮蓝框影响观感，统一去掉（可点区域本身已足够大） */
  -webkit-tap-highlight-color: transparent;
  /* 微信 iOS 回弹滚动时避免出现横向抖动 */
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ===== 顶部导航 ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 56px;
  display: flex; align-items: center; gap: 16px;
}
.brand { font-size: 19px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a {
  padding: 6px 12px; border-radius: 8px; font-size: 14.5px; color: var(--text-sub);
  position: relative; white-space: nowrap;
}
.main-nav a:hover { background: var(--primary-light); color: var(--primary); }
.main-nav a.active { color: var(--primary); font-weight: 600; background: var(--primary-light); }
.badge {
  display: inline-block; min-width: 17px; height: 17px; line-height: 17px;
  background: var(--danger); color: #fff; border-radius: 9px;
  font-size: 11px; text-align: center; margin-left: 3px; padding: 0 4px;
  vertical-align: 1px;
}
/* 顶栏右侧不参与收缩：一旦被压缩，按钮会被挤到比两个汉字还窄，
   「退出」竖排成两行、按钮高度顶出 52px 的 header，用户名也被挤成「用户 2…」。 */
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.user-box { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
.user-box .uname { max-width: 110px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-sub); }
/* 按钮宁可让用户名先截断，也不能自己换行 */
.user-box .btn-mini { flex-shrink: 0; white-space: nowrap; }
.btn-mini {
  border: 1px solid var(--border); background: #fff; border-radius: 8px;
  padding: 5px 10px; font-size: 13px; color: var(--text-sub);
}
.btn-mini:hover { border-color: var(--primary); color: var(--primary); }
.nav-toggle { display: none; background: none; border: none; font-size: 22px; color: var(--primary); }

/* ===== 主体 ===== */
.app-main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 16px; }
.page-loading { text-align: center; color: var(--text-sub); padding: 60px 0; }
.site-footer {
  text-align: center; color: var(--text-sub); font-size: 13px;
  padding: 24px 16px; border-top: 1px solid var(--border); margin-top: 32px;
}
.site-footer .beian { margin: 6px 0 0; }
.site-footer .beian a { color: var(--text-sub); text-decoration: none; }
.site-footer .beian a:hover { color: var(--text); text-decoration: underline; }

/* ===== 首页 ===== */
.hero {
  border-radius: 16px; padding: 44px 28px; margin-bottom: 24px;
  background: linear-gradient(120deg, #2e7d4f 0%, #3f9463 55%, #57ab74 100%);
  color: #fff; box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(24px, 4.5vw, 36px); margin-bottom: 10px; }
.hero p { opacity: 0.92; font-size: 15px; max-width: 560px; line-height: 1.7; }
.hero-actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; }
.section-head h2 { font-size: 19px; }
.section-head a { font-size: 13.5px; color: var(--primary); }

/* ===== 筛选条 ===== */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.chip {
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 6px 14px; font-size: 13.5px; color: var(--text-sub);
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.search-form { display: flex; gap: 8px; }
.search-form input {
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 16px;
  font-size: 14px; width: 200px; background: #fff; outline: none;
}
.search-form input:focus { border-color: var(--primary); }

/* ===== 卡片网格 ===== */
.grid { display: grid; gap: 16px; }
.grid.gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grid.product-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(34,49,42,0.13); }
.card .cover { aspect-ratio: 4/3; width: 100%; object-fit: cover; background: var(--primary-light); }
.card .body { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.card .title { font-size: 15px; font-weight: 600; }
.card .sub { font-size: 12.5px; color: var(--text-sub); }
.card .row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.price { color: var(--danger); font-weight: 700; font-size: 16px; }
.price::before { content: "¥"; font-size: 12px; margin-right: 1px; }
.price.free { color: var(--primary); }
.tag-free {
  background: var(--primary-light); color: var(--primary); border-radius: 6px;
  font-size: 12px; padding: 2px 8px; font-weight: 600;
}
.card .buy-btn {
  border: none; border-radius: 8px; background: var(--primary); color: #fff;
  padding: 7px 14px; font-size: 13px;
}
.card .buy-btn:hover { background: var(--primary-dark); }
.empty-tip { text-align: center; color: var(--text-sub); padding: 48px 0; }

/* ===== 通用图片滚动栏 =====
   一个组件服务全站四个栏目（首页 / 画廊 / 商城 / 摄影师），
   卡片骨架、控件、圆点、间距全部共用，保证视觉一致。
   轨道用原生横向滚动 + scroll-snap：移动端由浏览器接管惯性滑动，
   桌面端可用按钮、圆点、触控板或 Shift+滚轮切换。 */
.car { margin: 22px 0 26px; }
.car-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.car-head h2 { font-size: 19px; }
.car-ctrl { display: flex; align-items: center; gap: 8px; }
.car-more { font-size: 13.5px; color: var(--primary); white-space: nowrap; }
.car-more:hover { text-decoration: underline; }
.car-btn {
  width: 32px; height: 32px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--card); color: var(--text);
  font-size: 18px; line-height: 1; padding: 0 0 2px;
  transition: background .18s, border-color .18s, opacity .18s;
}
.car-btn:hover:not(:disabled) { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.car-btn:disabled { opacity: .32; cursor: not-allowed; }

.car-viewport { position: relative; }
.car-track {
  display: flex; gap: 14px;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.car-track::-webkit-scrollbar { display: none; }
.car-slide {
  flex: 0 0 calc((100% - 28px) / 3);   /* 桌面：一屏 3 张 */
  scroll-snap-align: start;
  display: flex;
}
.car-card {
  display: flex; flex-direction: column; width: 100%;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
}
.car-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(34,49,42,0.13); }
.car-media {
  position: relative; aspect-ratio: 4/3; overflow: hidden;
  background: var(--primary-light);
}
.car-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.car-card:hover .car-media img { transform: scale(1.04); }
.car-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.car-title {
  font-size: 14.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.car-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.car-price { color: var(--danger); font-weight: 700; font-size: 14px; }
.car-sub { font-size: 12.5px; color: var(--text-sub); }

/* 摄影师介绍卡：横向布局，头像 + 姓名 / 擅长 / 简介 */
.car-card.car-ph { flex-direction: row; gap: 12px; padding: 14px; align-items: flex-start; }
.car-ph-avatar {
  width: 54px; height: 54px; flex: 0 0 auto; border-radius: 50%;
  overflow: hidden; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-weight: 700; font-size: 20px;
}
.car-ph-avatar img { width: 100%; height: 100%; object-fit: cover; }
.car-ph-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.car-ph-badge {
  display: inline-block; margin-left: 6px; vertical-align: 1px;
  background: var(--primary-light); color: var(--primary);
  font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 5px;
}
.car-bio {
  font-size: 12.5px; color: var(--text-sub); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 圆点：当前屏用短棒强调，弱化可点击面积但保留触控友好高度 */
.car-dots { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; }
.car-dot {
  width: 7px; height: 7px; padding: 0; border: none; border-radius: 4px;
  background: var(--border); transition: width .2s, background .2s;
}
.car-dot.active { width: 18px; background: var(--primary); }
/* 单张内容不需要切换，隐藏圆点但保留留白高度，避免相邻栏目跳动 */
.car-single .car-dots { visibility: hidden; }

/* 摄影师栏目：两个滚动区成组出现，与上方表单/管理区做视觉分隔 */
.ph-showcase { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border); }
/* 无签约摄影师时的引导条：不渲染空壳轮播，只给一句说明 + 入口 */
.car-empty {
  text-align: center; padding: 26px 18px; margin: 18px 0;
  background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius);
}
.car-empty p { color: var(--text-sub); font-size: 14px; margin-bottom: 14px; }

/* 响应式：桌面 3 张 → 平板 2 张 → 手机 1 张半（露出下一张边缘，暗示可滑动） */
@media (max-width: 900px) {
  .car-slide { flex-basis: calc((100% - 14px) / 2); }
}
@media (max-width: 560px) {
  .car { margin: 18px 0 22px; }
  .car-head h2 { font-size: 17px; }
  .car-track { gap: 12px; }
  .car-slide { flex-basis: 82%; }
  .car-btn { width: 30px; height: 30px; font-size: 16px; }
  .car-body { padding: 9px 11px 11px; }
  .car-title { font-size: 13.5px; }
  .car-card.car-ph { padding: 12px; gap: 10px; }
  .car-ph-avatar { width: 46px; height: 46px; font-size: 17px; }
}

/* ===== 详情页 ===== */
.detail-wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; margin-top: 8px; }
.detail-media {
  border-radius: var(--radius); overflow: hidden; background: var(--primary-light);
  box-shadow: var(--shadow);
}
.detail-media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.detail-info h1 { font-size: 24px; margin-bottom: 10px; }
.detail-info .desc { color: var(--text-sub); line-height: 1.8; margin: 12px 0 18px; }
.meta-list { font-size: 13.5px; color: var(--text-sub); display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.detail-price { font-size: 28px; color: var(--danger); font-weight: 700; margin-bottom: 18px; }
.detail-price::before { content: "¥"; font-size: 16px; }
/* 详情页辅助提示：未登录引导 / 缺货说明，不抢主信息视觉权重 */
.detail-hint { font-size: 13px; color: var(--text-sub); margin-top: 12px; line-height: 1.7; }
.detail-hint a { color: var(--primary); }
/* 按钮禁用态（缺货）：保持可辨识但明确不可点 */
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn {
  border: none; border-radius: 10px; padding: 12px 26px; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.gold { background: var(--accent); color: #fff; }
.btn.ghost { background: #fff; border: 1px solid var(--border); color: var(--text-sub); }
.btn.danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== 购物车 / 订单 ===== */
.cart-list, .order-list { display: flex; flex-direction: column; gap: 12px; }
.cart-item, .order-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px; padding: 12px;
}
.cart-item img, .order-card .thumb { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; background: var(--primary-light); flex-shrink: 0; }
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .info .t { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.qty-box { display: inline-flex; align-items: center; gap: 8px; }
.qty-box button {
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border);
  background: #fff; font-size: 15px; color: var(--primary); line-height: 1;
}
.qty-box span { min-width: 20px; text-align: center; font-size: 14px; }
.link-danger { color: var(--danger); font-size: 13px; background: none; border: none; }
.cart-footer {
  position: sticky; bottom: 12px; margin-top: 16px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.cart-footer .total { font-size: 15px; }
.cart-footer .total b { color: var(--danger); font-size: 21px; }
.order-card .info { flex: 1; min-width: 0; }
.order-card .t { font-weight: 600; margin-bottom: 4px; font-size: 15px; }
.order-card .sub { font-size: 12.5px; color: var(--text-sub); margin-bottom: 6px; }
.status-pill {
  display: inline-block; border-radius: 999px; font-size: 12px; padding: 2px 10px; font-weight: 600;
}
.st-pending { background: #fdf2dc; color: #b07818; }
.st-paid { background: var(--primary-light); color: var(--primary); }
.st-shipped { background: #e0edf7; color: #2d6f9e; }
.st-completed { background: #eae7f7; color: #5b4b9e; }
.st-confirm { background: #e6f3fd; color: #1c6fb8; }
.st-cancelled { background: #f2f2f2; color: #999; }
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.order-actions .btn { padding: 7px 16px; font-size: 13px; border-radius: 8px; }

/* ===== 支付页 ===== */
.pay-panel {
  max-width: 460px; margin: 32px auto; background: var(--card); border-radius: 16px;
  box-shadow: var(--shadow); padding: 30px 26px; text-align: center;
}
.pay-amount { font-size: 40px; color: var(--danger); font-weight: 700; margin: 14px 0 4px; }
.pay-amount::before { content: "¥"; font-size: 22px; }
.pay-channels { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }
.pay-channel {
  border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 20px;
  font-size: 14px; background: #fff;
}
.pay-channel.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pay-note { font-size: 12.5px; color: var(--text-sub); margin-top: 14px; line-height: 1.7; }
.pay-success-icon { font-size: 52px; }

/* ===== 微信收款码 ===== */
.wechat-qr-box { background: #f7fdf9; border: 1.5px solid #d9f0e3; border-radius: 12px; padding: 16px 14px; margin: 6px 0 4px; }
.wechat-qr-box .wq-tip { font-size: 13.5px; color: #1f7a4d; margin-bottom: 12px; line-height: 1.6; }
.wechat-qr-box .wq-img { width: 210px; height: 210px; border-radius: 10px; border: 1px solid #e3efe8; background: #fff; }
.wechat-qr-box .wq-note { font-size: 12.5px; color: var(--text-sub); margin-top: 12px; line-height: 1.7; }
.wechat-qr-box .field input { text-align: center; }

/* ===== 省/市/区 三级下拉 ===== */
.region-row { display: flex; gap: 8px; }
.region-row select {
  flex: 1; min-width: 0; padding: 9px 6px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 13.5px; background: #fff; color: var(--text);
}
.region-row select:disabled { background: #f7f7f7; color: #aaa; }

/* ===== 广告位 ===== */
.ad-strip { display: flex; flex-direction: column; gap: 12px; margin: 0 0 18px; }
.ad-banner {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); background: var(--card);
}
.ad-banner .ad-img { display: block; width: 100%; max-height: 220px; object-fit: cover; }
.ad-banner .ad-tag {
  position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.45); color: #fff;
  font-size: 11px; padding: 2px 8px; border-radius: 999px; letter-spacing: 1px;
}
.ad-banner .ad-title {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.55)); color: #fff;
  font-size: 14.5px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.4);
}

/* ===== 后台 ===== */
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-panel {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 18px; overflow-x: auto;
}
.admin-panel h3 { font-size: 16px; margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; color: var(--text-sub); }
.field input, .field select, .field textarea {
  border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px;
  font-size: 14px; font-family: inherit; background: #fff; outline: none; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.data-table th, .data-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table th { color: var(--text-sub); font-weight: 600; font-size: 12.5px; }
.data-table img { width: 52px; height: 40px; object-fit: cover; border-radius: 6px; background: var(--primary-light); }
.data-table select, .data-table input {
  border: 1px solid var(--border); border-radius: 7px; padding: 5px 8px; font-size: 13px;
}
.data-table input { width: 76px; }

/* ===== 封面补齐栏（后台图片列表顶部）=====
   历史作品缺公开封面时，未登录访客只会看到空白；这条横幅把「还差几张」
   和「一键补齐」放在最显眼的位置，避免这个问题又悄悄复发。 */
.tb-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; background: var(--primary-light); border-radius: 10px;
  padding: 11px 14px; margin-bottom: 12px; font-size: 13.5px;
}
.tb-bar .tb-text { color: var(--text-sub); line-height: 1.6; }
.tb-bar b { color: var(--primary); font-size: 15px; }
.tb-state { color: var(--primary); font-weight: 600; }
.tb-done {
  background: var(--primary-light); color: var(--primary); border-radius: 10px;
  padding: 9px 14px; margin-bottom: 12px; font-size: 13.5px; font-weight: 600;
}
@media (max-width: 560px) {
  .tb-bar { flex-direction: column; align-items: stretch; }
  .tb-bar .btn { width: 100%; }
}

/* ===== 详情页购买提示 =====
   按钮下方的一句说明，把「为什么还不能下载」讲清楚，
   避免用户把「未付费」误当成「功能坏了」。 */
.buy-hint {
  margin-top: 8px; font-size: 12.5px; color: var(--text-sub); line-height: 1.6;
}

/* ===== 登录页 ===== */
.login-wrap { max-width: 400px; margin: 36px auto; }
.login-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 28px 24px; }
.login-card h1 { font-size: 21px; text-align: center; margin-bottom: 18px; }
.login-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.login-tabs button {
  flex: 1; background: none; border: none; padding: 10px 0; font-size: 14.5px;
  color: var(--text-sub); border-bottom: 2px solid transparent;
}
.login-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.login-card .field { margin-bottom: 13px; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.code-row .send-btn {
  border: 1px solid var(--primary); color: var(--primary); background: #fff;
  border-radius: 9px; padding: 0 14px; font-size: 13px; white-space: nowrap;
}
.code-row .send-btn:disabled { opacity: 0.5; }
.login-extra { text-align: center; margin-top: 14px; font-size: 13px; color: var(--text-sub); }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }

/* ===== 独立注册通道（#/register） ===== */
.register-wrap { max-width: 420px; }
.register-sub { text-align: center; font-size: 13px; color: var(--text-sub); margin: -8px 0 16px; line-height: 1.6; }
.register-invite {
  text-align: center; font-size: 12.5px; color: var(--primary);
  background: var(--primary-light); border-radius: 8px; padding: 7px 10px; margin: 0 0 14px;
}
.register-invite b { letter-spacing: 0.5px; }
.opt { color: var(--text-sub); font-size: 12px; font-weight: 400; }

/* 密码强度计：4 段色条，仅作提示，不参与是否放行 */
.pwd-meter { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.pwd-meter .pwd-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--border); transition: background .18s; }
.pwd-meter[data-score="1"] .pwd-bar.on { background: #e2574c; }
.pwd-meter[data-score="2"] .pwd-bar.on { background: #e6a23c; }
.pwd-meter[data-score="3"] .pwd-bar.on { background: #4a9e6b; }
.pwd-meter[data-score="4"] .pwd-bar.on { background: var(--primary); }
.pwd-text { font-size: 12px; color: var(--text-sub); white-space: nowrap; margin-left: 2px; }

/* 协议勾选行 */
.agree-row { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 12px; font-size: 13px; color: var(--text-sub); line-height: 1.6; }
.agree-row input[type="checkbox"] { width: 16px; height: 16px; margin: 2px 0 0; flex: none; accent-color: var(--primary); }
.link-strong { color: var(--primary); text-decoration: none; }
.link-strong:hover { text-decoration: underline; }

/* 微信一键注册分隔 */
.register-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; color: var(--text-sub); font-size: 12.5px; }
.register-divider::before, .register-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* 登录页底部的注册引导 */
.login-register-row {
  text-align: center; margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border); font-size: 13.5px; color: var(--text-sub);
}
.login-register-row span { margin-right: 4px; }

/* ===== 弹层 & Toast ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,30,24,0.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 420px;
  max-height: 86vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 14px; }
.toast-wrap { position: fixed; top: 68px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(30,42,35,0.92); color: #fff; border-radius: 999px;
  padding: 9px 20px; font-size: 14px; animation: fadein 0.2s;
  max-width: 84vw;
}
.toast.err { background: rgba(180,50,40,0.94); }
@keyframes fadein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ===== 钱包 / 充值 ===== */
.wallet-hero {
  background: linear-gradient(120deg, #2e7d4f 0%, #3f9463 100%);
  border-radius: 16px; padding: 26px 24px; color: #fff;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.wallet-hero .wh-label { font-size: 13px; opacity: 0.85; }
.wallet-hero .wh-balance { font-size: 42px; font-weight: 700; margin: 6px 0 14px; }
.wallet-hero .wh-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wallet-hero .wh-tip { font-size: 12.5px; opacity: 0.8; }
.rc-icon { font-size: 30px; width: 48px; text-align: center; flex-shrink: 0; }
.rc-amount { font-weight: 700; color: var(--primary); font-size: 17px; white-space: nowrap; }
.recharge-panel {
  max-width: 480px; background: var(--card); border-radius: 16px;
  box-shadow: var(--shadow); padding: 24px 22px; margin: 0 auto;
}
.recharge-panel .rp-label { font-size: 14px; color: var(--text-sub); margin-bottom: 12px; }
.recharge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.recharge-opt {
  border: 1.5px solid var(--border); border-radius: 12px; background: #fff;
  padding: 16px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.recharge-opt .ro-val { font-size: 21px; font-weight: 700; color: var(--text); }
.recharge-opt .ro-unit { font-size: 12px; color: var(--text-sub); }
.recharge-opt.active { border-color: var(--accent); background: #fdf6e3; }
.recharge-opt.active .ro-val { color: var(--accent); }
@media (max-width: 480px) { .recharge-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===== 余额明细 ===== */
.tx-list { display: flex; flex-direction: column; gap: 10px; }
.tx-item {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
}
.tx-item .info { flex: 1; min-width: 0; }
.tx-item .t { font-weight: 600; font-size: 14.5px; margin-bottom: 3px; }
.tx-item .sub { font-size: 12.5px; color: var(--text-sub); }
.tx-in { color: var(--primary); font-weight: 700; white-space: nowrap; }
.tx-out { color: var(--danger); font-weight: 700; white-space: nowrap; }

/* ===== 个人中心 ===== */
/* 账号档案卡：头像 + 昵称 + 掩码账号 + 修改昵称 */
.me-profile {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px;
  max-width: 560px; margin-bottom: 14px;
}
.me-profile .mp-avatar {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
}
.me-profile .mp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.me-profile .mp-name {
  font-weight: 600; font-size: 16px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.me-profile .mp-acct { font-size: 12.5px; color: var(--text-sub); }
.me-nick-tip { font-size: 12px; color: var(--text-sub); margin-bottom: 4px; }

.me-grid { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.me-item {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px;
}
.me-item:active { background: var(--primary-light); }
.me-item .mi-icon { font-size: 26px; width: 40px; text-align: center; }
.me-item .mi-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.me-item .mi-title { font-weight: 600; font-size: 15.5px; }
.me-item .mi-sub { font-size: 12.5px; color: var(--text-sub); }
.me-item .mi-arrow { color: var(--text-sub); font-size: 20px; }

/* ===== 地址选择 / 地址簿 ===== */
.addr-pick-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.addr-pick {
  border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.addr-pick.active { border-color: var(--primary); background: var(--primary-light); }
.addr-pick .ap-info { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.addr-pick .ap-info small { color: var(--text-sub); }
.addr-manage { display: inline-block; font-size: 13px; color: var(--primary); margin-top: 4px; }
.addr-card .sub { font-size: 13px; }

/* ===== 物流轨迹 ===== */
.tracking-line { margin-top: 2px; color: var(--primary); font-weight: 600; }
.track-list { padding: 6px 0 2px; }
.track-item { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.track-item:last-child { padding-bottom: 4px; }
.track-item::before {
  content: ""; position: absolute; left: 5px; top: 14px; bottom: 0;
  width: 2px; background: var(--border);
}
.track-item:last-child::before { display: none; }
.track-dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--border);
  flex-shrink: 0; margin-top: 4px; position: relative; z-index: 1;
}
.track-item.latest .track-dot { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.track-item.latest .track-content { color: var(--primary); font-weight: 600; }
.track-body { flex: 1; min-width: 0; }
.track-content { font-size: 13.5px; line-height: 1.55; }
.track-time { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

/* ===== 手机端底部标签栏（仅小屏显示） ===== */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(255,255,255,0.97); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 0 3px; color: var(--text-sub); font-size: 11px;
  position: relative; -webkit-tap-highlight-color: transparent;
}
.tabbar a .tb-icon { font-size: 21px; line-height: 1.1; }
.tabbar a.active { color: var(--primary); font-weight: 600; }
.tabbar a .badge { position: absolute; top: 0; right: calc(50% - 22px); margin: 0; }
.tabbar + .site-footer { padding-bottom: 84px; }

/* ===== 微信登录按钮 ===== */
.btn.wechat-btn { background: #07c160; color: #fff; }
.btn.wechat-btn:hover { background: #06ad56; }
.wechat-hint {
  text-align: center; font-size: 13px; color: #07c160;
  background: rgba(7, 193, 96, 0.08); border-radius: 8px;
  padding: 8px 10px; margin-bottom: 14px;
}

/* ===== 微信全面屏 / 刘海屏安全区 ===== */
@supports (padding: env(safe-area-inset-bottom)) {
  .cart-footer { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .site-footer { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

/* ===== 摄影师模块 ===== */
.ph-join { max-width: 860px; margin: 0 auto; }
.ph-join-hero { text-align: center; padding: 28px 16px 22px; }
.ph-join-icon { font-size: 44px; line-height: 1; margin-bottom: 10px; }
.ph-join-hero h1 { font-size: 24px; margin: 0 0 10px; }
.ph-join-hero p { color: var(--text-sub); max-width: 520px; margin: 0 auto 16px; }
.ph-benefits { list-style: none; padding: 0; margin: 0 0 8px; color: var(--text-sub); font-size: 14px; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.ph-join-form { margin-top: 6px; }

.ph-head { display: flex; align-items: center; gap: 16px; padding: 18px 0 6px; flex-wrap: wrap; }
.ph-avatar { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; background: var(--primary-light); flex: none; display: flex; align-items: center; justify-content: center; }
.ph-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ph-avatar-empty::before { content: '📷'; font-size: 30px; opacity: .55; }
.ph-head-info { flex: 1; min-width: 200px; }
.ph-head-info h2 { margin: 0 0 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ph-head-sub { color: var(--text-sub); margin: 0; font-size: 14px; }
.ph-head-btn { flex: none; }
.ph-badge { display: inline-block; font-size: 12px; font-weight: 600; color: var(--primary); background: var(--primary-light); border-radius: 999px; padding: 2px 10px; vertical-align: middle; }
.ph-count { font-size: 14px; font-weight: 400; color: var(--text-sub); margin-left: 6px; }

.ph-byline { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 2px; color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.ph-byline:hover { color: var(--primary); }

.quote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.quote-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; transition: box-shadow .2s; }
.quote-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.07); }
.quote-kind { display: inline-block; font-size: 12px; color: var(--primary); background: var(--primary-light); border-radius: 999px; padding: 2px 10px; margin-bottom: 8px; }
.quote-title { font-weight: 600; margin-bottom: 8px; }
.quote-price { font-size: 22px; font-weight: 700; color: var(--danger); }
.quote-unit { font-size: 13px; font-weight: 400; color: var(--text-sub); margin-left: 2px; }
.quote-min { font-size: 12.5px; color: var(--text-sub); margin-top: 4px; }
.quote-desc { font-size: 13px; color: var(--text-sub); margin-top: 8px; line-height: 1.5; }

/* ===== 商家中心 ===== */
.merchant-hero {
  display: flex; align-items: center; gap: 14px;
  background: var(--primary-light); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 16px;
}
.merchant-hero img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: #fff; }
.merchant-hero .mh-body { flex: 1; min-width: 0; }
.merchant-hero .mh-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.merchant-hero .mh-sub { font-size: 12.5px; color: var(--text-sub); margin-top: 4px; }
.btn-mini-lg { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.data-table-wrap { overflow-x: auto; }

/* ===== 分销中心 ===== */
.dist-hero { position: relative; }
.dist-share-row {
  display: flex; gap: 8px; align-items: center; margin: -6px 0 16px;
}
.dist-share-row input {
  flex: 1; min-width: 0; font-size: 12px; color: var(--text-sub);
  border: 1px dashed var(--border); border-radius: 8px; padding: 8px 10px; background: #fff;
}

/* ===== 响应式 ===== */
@media (max-width: 860px) {
  .detail-wrap { grid-template-columns: 1fr; }
  .main-nav {
    display: none; position: absolute; top: 56px; left: 0; right: 0;
    background: #fff; flex-direction: column; padding: 8px 12px 14px;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 13px 12px; font-size: 15.5px; }
  .nav-toggle { display: block; padding: 8px 10px; }
  .grid.gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .grid.product-grid { grid-template-columns: repeat(2, 1fr); }
  .search-form input { width: 130px; }
  .cart-item img, .order-card .thumb { width: 68px; height: 68px; }
  .hero { padding: 32px 20px; }
  /* 主区内边距适配底部标签栏，避免内容被遮挡 */
  .app-main { padding: 14px 14px calc(78px + env(safe-area-inset-bottom)); }
  /* 后台页签横向滑动，不换行挤压 */
  .admin-tabs {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: none;
  }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tabs .chip { flex: 0 0 auto; padding: 8px 16px; }
  /* 弹层：小屏贴合屏幕底部（抽屉感），更大可视空间 */
  .modal-mask { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100%; border-radius: 18px 18px 0 0;
    max-height: 90vh; padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
  }
  /* 触控目标放大 */
  .btn { padding: 13px 22px; }
  .chip { padding: 8px 15px; font-size: 14px; }
  .qty-box button { width: 34px; height: 34px; font-size: 18px; }
  .link-danger { padding: 6px 4px; font-size: 14px; }
  .btn-mini { padding: 8px 12px; font-size: 13.5px; }
  /* 通用输入 16px 防 iOS 聚焦自动放大 */
  .field input, .field select, .field textarea { font-size: 16px; }
  .search-form input { font-size: 16px; }
  .region-row select { font-size: 16px; }
  .data-table select, .data-table input { font-size: 16px; }
  /* 卡片与筛选间距 */
  .filter-bar { gap: 8px; }
  .section-head { margin: 20px 0 12px; }
  .section-head h2 { font-size: 17.5px; }
  .hero { border-radius: 14px; padding: 26px 18px; margin-bottom: 18px; }
  .hero h1 { font-size: 23px; }
  .hero p { font-size: 14px; }
  .pay-panel { margin: 16px auto; padding: 22px 18px; }
  .pay-amount { font-size: 34px; }
  .pay-channels { flex-wrap: wrap; }
  .pay-channel { padding: 11px 16px; font-size: 14.5px; }
  .wallet-hero { padding: 20px 18px; }
  .wallet-hero .wh-balance { font-size: 34px; }
  .wechat-qr-box .wq-img { width: 180px; height: 180px; }
  .login-wrap { margin: 20px auto 24px; }
  .me-item { padding: 14px 15px; }
  .ad-banner .ad-img { max-height: 150px; }
}

/* ===== 手机端（≤560px）：底部标签栏启用 + 后台表格卡片化 ===== */
@media (max-width: 560px) {
  /* 显示底部标签栏 */
  .tabbar { display: flex; }
  /* 顶栏精简：隐藏部分次要链接（标签栏已覆盖），汉堡菜单仍保留全部入口 */
  .header-inner { height: 52px; gap: 10px; padding: 0 12px; }
  .brand { font-size: 17px; }
  .user-box { gap: 6px; }
  /* 小屏把用户名上限再收紧，把宽度让给「退出」按钮（系统字体放大时尤其明显） */
  .user-box .uname { max-width: 60px; font-size: 13px; }
  .user-box .btn-mini { padding: 6px 10px; }
  .nav-toggle { padding: 6px 8px; }
  .toast-wrap { top: 60px; width: 100vw; padding: 0 16px; }

  /* 后台数据表 → 卡片式列表（每行变一张卡，表头隐藏） */
  .admin-panel { padding: 14px 12px; }
  .admin-panel h3 { font-size: 15px; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td {
    display: block; width: 100%; min-width: 0 !important;
  }
  .data-table tr {
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 10px 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px;
  }
  .data-table td { padding: 0; border-bottom: none; display: flex; align-items: center; gap: 8px; }
  .data-table td::before {
    content: attr(data-label); color: var(--text-sub); font-size: 12px;
    flex-shrink: 0; min-width: 3.5em;
  }
  .data-table td img { width: 64px; height: 48px; }
  .data-table input { flex: 1; min-width: 0; }
  .data-table td:last-child { justify-content: flex-start; flex-wrap: wrap; }

  /* 订单/购物车再紧凑一点 */
  .cart-item, .order-card { padding: 10px; gap: 10px; }
  .cart-footer { padding: 12px 14px; }
  .cart-footer .btn { flex: 1; }
  .tx-item { padding: 11px 12px; }
  /* 首页 hero 大标题 */
  .hero h1 { font-size: 21px; }
  .hero-actions .btn { flex: 1; min-width: 130px; }
  /* 详情页按钮全宽 */
  .detail-info .btn-actions .btn { flex: 1; min-width: 140px; }
  .detail-info h1 { font-size: 20px; }
  .detail-price { font-size: 24px; }
  /* 充值选项 2 列字号微调 */
  .recharge-opt { padding: 12px 4px; }
  .recharge-opt .ro-val { font-size: 18px; }
}

@media (max-width: 420px) {
  .grid.product-grid, .grid.gallery-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card .body { padding: 9px 10px 11px; }
  .card .title { font-size: 13.5px; }
  .price { font-size: 14px; }
  .card .buy-btn { padding: 8px 10px; font-size: 12.5px; }
  .merchant-hero { flex-wrap: wrap; }
  .dist-share-row { flex-direction: column; align-items: stretch; }
  .dist-share-row input { width: 100%; }
  .tabbar a { font-size: 10.5px; }
  .tabbar a .tb-icon { font-size: 19px; }
  .hero { padding: 22px 16px; }
}

/* ===== 统一扫码支付弹窗（qrp = QR pay） ===== */
/* 关键：作者样式里的 display 会盖掉 UA 的 [hidden]{display:none}，必须显式兜底 */
.qrp [hidden] { display: none !important; }
.qrp { text-align: center; }
.qrp-title { font-size: 17px; margin-bottom: 6px; }
.qrp-amount { font-size: 36px; font-weight: 700; color: var(--danger); line-height: 1.15; }
.qrp-amount .qrp-cur { font-size: 20px; margin-right: 2px; }
.qrp-meta { font-size: 12.5px; color: var(--text-sub); margin-top: 4px; }
.qrp-meta b { color: var(--text); }
.qrp-desc { margin-top: 6px; }

.qrp-main { display: flex; gap: 14px; align-items: center; margin: 16px 0 4px; text-align: left; }
.qrp-qrwrap {
  position: relative; flex: 0 0 auto; padding: 8px; background: #fff;
  border: 1.5px solid #d9f0e3; border-radius: 12px;
}
.qrp-img { width: 168px; height: 168px; object-fit: contain; border-radius: 8px; }
.qrp-mask-tip {
  margin-top: 6px; font-size: 11.5px; color: #1f7a4d; background: #eefaf2;
  border-radius: 999px; padding: 3px 8px; text-align: center;
}
.qrp-help { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.qrp-step { font-size: 13px; color: var(--text-sub); display: flex; gap: 7px; align-items: flex-start; line-height: 1.5; }
.qrp-step i {
  flex: 0 0 auto; width: 17px; height: 17px; border-radius: 50%; background: var(--primary-light);
  color: var(--primary); font-size: 11px; font-style: normal; text-align: center; line-height: 17px;
  font-weight: 700; margin-top: 1px;
}
.qrp-copy {
  border: 1px dashed var(--primary); background: #fff; color: var(--primary);
  border-radius: 8px; padding: 7px 10px; font-size: 12.5px; margin-top: 2px;
}
.qrp-copy:hover { background: var(--primary-light); }

.qrp-pending .field input { text-align: center; font-size: 14px; }
.qrp-pending .btn { margin-top: 8px; }
.qrp-pending .btn:disabled { opacity: .55; }

.qrp-claimed, .qrp-paid { padding: 6px 0 2px; }
.qrp-big { font-size: 46px; line-height: 1.1; }
.qrp-ct { font-size: 16px; font-weight: 700; margin: 8px 0 6px; }
.qrp-cs { font-size: 13px; color: var(--text-sub); line-height: 1.65; }
.qrp-poll {
  margin-top: 12px; font-size: 12.5px; color: var(--primary);
  background: var(--primary-light); border-radius: 8px; padding: 8px 10px;
}
.qrp-paid .qrp-ct { color: var(--primary); }
.qrp-foot { font-size: 12px; color: var(--text-sub); line-height: 1.7; margin-top: 10px; text-align: left; }

body.modal-open { overflow: hidden; }

@media (max-width: 560px) {
  .qrp { text-align: left; }
  .qrp-title, .qrp-meta { text-align: center; }
  .qrp-amount { text-align: center; font-size: 32px; }
  .qrp-main { flex-direction: column; align-items: center; }
  .qrp-qrwrap { width: 100%; max-width: 250px; display: flex; flex-direction: column; align-items: center; }
  .qrp-img { width: 190px; height: 190px; }
  .qrp-help { width: 100%; }
  .qrp-claimed, .qrp-paid { text-align: center; }
  .qrp-foot { text-align: center; }
}

/* ==========================================================================
   微信内置浏览器专章（in-wechat 由 js/wechat.js 在启动时写到 html 上）
   只在微信里生效，不影响普通浏览器与桌面端。
   ========================================================================== */

/* 微信字体缩放已由 JS 设 100%，这里再用 CSS 锁一层，防止微信「大字号模式」撑破布局 */
html.in-wechat { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* 微信内底部有一条半透明小黑条（全面屏手势条），标签栏需额外留白 */
html.in-wechat .tabbar {
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
}
html.in-wechat .app-main {
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

/* 微信内点按区域统一放大到 ≥44px（微信官方交互建议），降低误触 */
html.in-wechat .btn { min-height: 44px; }
html.in-wechat .tabbar a { padding: 6px 0 4px; }
html.in-wechat .main-nav a { padding: 13px 12px; }
html.in-wechat .qty-box button { width: 36px; height: 36px; }
/* iOS 微信输入框聚焦放大阈值是 16px，单独兜一层（部分输入框在媒体查询外） */
html.in-wechat input, html.in-wechat select, html.in-wechat textarea { font-size: 16px; }

/* 微信内长按图片会弹「保存图片」：收款码需要保住这个能力，内容图则禁止误存 */
html.in-wechat .qrp-img { -webkit-touch-callout: default; }
html.in-wechat .grid img, html.in-wechat .hero img { -webkit-touch-callout: none; }

/* X5 内核（安卓微信）不支持 backdrop-filter 时会给顶栏/标签栏加半透明背景，
   导致内容透出叠字，这里用不透明背景兜底。 */
html.in-wechat-x5 .site-header,
html.in-wechat-x5 .tabbar { backdrop-filter: none; }
html.in-wechat-x5 .site-header { background: #ffffff; }
html.in-wechat-x5 .tabbar { background: #ffffff; }

/* 微信内列表惯性滚动的流畅度优化（X5 内核对子元素 scroll 支持差） */
html.in-wechat { -webkit-overflow-scrolling: touch; }

/* ===== 路由懒加载：骨架屏（模块加载较慢时避免整屏空白） ===== */
.page-skeleton { padding: 4px 0; }
.sk-bar, .sk-card {
  background: linear-gradient(90deg, #eef1ee 25%, #e4e9e5 37%, #eef1ee 63%);
  background-size: 400% 100%;
  animation: sk-shimmer 1.3s ease-in-out infinite;
  border-radius: 10px;
}
.sk-title { height: 26px; width: 46%; margin-bottom: 18px; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.sk-card { height: 172px; }
@keyframes sk-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (max-width: 560px) {
  .sk-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sk-card { height: 150px; }
}
/* 尊重系统「减弱动态效果」，微信内部分机型会自动开启 */
@media (prefers-reduced-motion: reduce) {
  .sk-bar, .sk-card { animation: none; }
}
.load-err-detail {
  font-size: 11.5px; color: var(--text-sub); text-align: left;
  background: #f6f7f6; border-radius: 8px; padding: 8px 10px;
  margin-top: 10px; white-space: pre-wrap; word-break: break-all;
  max-height: 120px; overflow: auto;
}

/* ===== 微信右上角分享引导蒙层 ===== */
.wxsg-mask {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0, 0, 0, 0.72);
  display: flex; flex-direction: column; align-items: flex-end;
  padding: 8px 20px 0;
  animation: wxsg-in .18s ease-out;
}
@keyframes wxsg-in { from { opacity: 0; } to { opacity: 1; } }
.wxsg-arrow {
  font-size: 46px; line-height: 1; color: #ffd666; margin-right: 6px;
  animation: wxsg-bounce 1.1s ease-in-out infinite;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}
@keyframes wxsg-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.wxsg-tip { text-align: right; color: #fff; margin-top: 6px; }
.wxsg-t1 { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.wxsg-t2 { font-size: 14px; color: rgba(255,255,255,.86); line-height: 1.6; }
.wxsg-close {
  margin-top: auto; margin-bottom: calc(46px + env(safe-area-inset-bottom));
  align-self: center;
  background: #fff; color: #22312a; border: none; border-radius: 999px;
  padding: 12px 34px; font-size: 15px; font-weight: 600;
}
@media (prefers-reduced-motion: reduce) { .wxsg-arrow { animation: none; } }

/* ===== 批量上传面板（作品管理 / 图片管理） ===== */
/* 结构：.bu-head（总进度条 + 计数 + 清空） / .bu-list（每文件一行） / .bu-result（本批结果） */
.bu-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin-bottom: 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
/* flex 只给顶部总进度条：行内进度条处在纵向 flex 容器里，
   若继承 flex:1（即 flex-basis:0）会被压成 0 高度而看不见 */
.bu-bar { height: 6px; background: #e2e8e2; border-radius: 99px; overflow: hidden; }
.bu-head .bu-bar { flex: 1; }
.bu-bar > i {
  display: block; height: 100%; width: 0; border-radius: 99px;
  background: var(--primary); transition: width .3s ease;
}
.bu-count { font-size: 12.5px; color: var(--text-sub); white-space: nowrap; }
.bu-mini {
  font-size: 12.5px; padding: 4px 10px; border-radius: 7px; cursor: pointer;
  background: #fff; border: 1px solid var(--border); color: var(--text-sub);
  white-space: nowrap;
}
.bu-mini:hover { border-color: var(--primary); color: var(--primary); }
.bu-mini[hidden] { display: none !important; }

.bu-empty {
  font-size: 13px; color: var(--text-sub); line-height: 1.7;
  padding: 14px 12px; background: #fff; border: 1px dashed var(--border); border-radius: 10px;
}

.bu-list { display: flex; flex-direction: column; gap: 8px; }
.bu-row {
  display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap;
  padding: 9px 11px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px;
}
.bu-row.is-failed { border-color: #f0c8c3; background: #fdf7f6; }
.bu-row.is-done { border-color: #cfe6d8; }

.bu-thumb {
  width: 50px; height: 50px; flex: 0 0 auto; border-radius: 8px;
  object-fit: cover; background: var(--primary-light);
}
.bu-thumb-none { display: block; }
.bu-main { flex: 1 1 140px; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.bu-title {
  width: 100%; font-size: 13.5px; padding: 5px 9px; border-radius: 7px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
}
.bu-title:focus { outline: none; border-color: var(--primary); }
.bu-title:disabled { background: var(--bg); color: var(--text-sub); border-color: transparent; }
.bu-title-static { font-size: 13.5px; }
.bu-meta {
  font-size: 11.5px; color: var(--text-sub);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bu-bar-row { height: 4px; }

.bu-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.bu-state { font-size: 12.5px; color: var(--text-sub); white-space: nowrap; }
.bu-row.is-done .bu-state { color: var(--primary); font-weight: 600; }
.bu-row.is-failed .bu-state { color: var(--danger); font-weight: 600; }
.bu-row.is-compressing .bu-state,
.bu-row.is-uploading .bu-state,
.bu-row.is-saving .bu-state { color: var(--accent); }

/* 进行中的行：进度条走不定态（真实字节进度拿不到，只用它表示「在动」） */
.bu-row.is-compressing .bu-bar-row > i,
.bu-row.is-uploading .bu-bar-row > i,
.bu-row.is-saving .bu-bar-row > i {
  width: 34%; animation: bu-slide 1.15s ease-in-out infinite;
}
.bu-row.is-failed .bu-bar-row > i { background: var(--danger); }
@keyframes bu-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(320%); }
}
@media (prefers-reduced-motion: reduce) {
  .bu-row.is-compressing .bu-bar-row > i,
  .bu-row.is-uploading .bu-bar-row > i,
  .bu-row.is-saving .bu-bar-row > i { width: 100%; opacity: .45; animation: none; }
}

.bu-err {
  flex: 1 1 100%; display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px; color: var(--danger); line-height: 1.55;
  padding-top: 2px; padding-left: 60px;
}
.bu-err-txt { flex: 1; word-break: break-word; }
.bu-err .bu-mini { color: var(--danger); border-color: #f0c8c3; }
.bu-err .bu-mini:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.bu-result {
  margin-top: 10px; padding: 11px 13px; border-radius: 10px; font-size: 13px; line-height: 1.65;
}
.bu-result.is-ok { background: var(--primary-light); color: var(--primary-dark); }
.bu-result.is-bad { background: #fdf3f2; border: 1px solid #f0c8c3; color: var(--text); }
.bu-result.is-bad b { color: var(--danger); }
.bu-fail-list { list-style: none; margin: 8px 0 10px; display: flex; flex-direction: column; gap: 6px; }
.bu-fail-list li {
  display: flex; flex-direction: column; gap: 2px;
  padding: 7px 10px; background: #fff; border-radius: 8px; border: 1px solid #f0c8c3;
  font-size: 12.5px;
}
.bu-fail-list li > b { font-weight: 600; word-break: break-all; }
.bu-fail-list li > span { color: var(--danger); line-height: 1.5; }
.bu-retry-all { width: 100%; }

/* 手机端：缩略图收紧、状态文字不再与标题抢横向空间，失败说明改为整行 */
@media (max-width: 560px) {
  .bu-head { padding: 8px 10px; gap: 8px; }
  .bu-row { padding: 8px 9px; gap: 8px; }
  .bu-thumb { width: 42px; height: 42px; }
  /* 16px 防止 iOS 聚焦时自动放大页面 */
  .bu-title { font-size: 16px; padding: 6px 8px; }
  .bu-state { font-size: 12px; }
  .bu-err { padding-left: 0; }
  .bu-fail-list li { font-size: 12px; }
}

/* ===== 微信环境自检页（#/wx-check） ===== */
.wxc-wrap { max-width: 720px; margin: 0 auto; }
.wxc-top {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; margin-bottom: 14px;
}
.wxc-top h2 { font-size: 19px; margin-bottom: 6px; }
.wxc-sum { font-size: 13.5px; color: var(--text-sub); line-height: 1.6; margin-bottom: 14px; }
.wxc-item {
  background: var(--card); border: 1px solid var(--border); border-left-width: 4px;
  border-radius: 12px; padding: 13px 15px; margin-bottom: 10px;
}
.wxc-item.ok { border-left-color: #2e9e5b; }
.wxc-item.warn { border-left-color: #d4a017; }
.wxc-item.fail { border-left-color: var(--danger); }
.wxc-head { display: flex; align-items: center; gap: 8px; }
.wxc-icon { font-size: 15px; line-height: 1; }
.wxc-name { font-weight: 600; font-size: 14.5px; }
.wxc-detail {
  font-size: 12.5px; color: var(--text-sub); margin-top: 6px;
  line-height: 1.65; white-space: pre-wrap; word-break: break-all;
}
.wxc-advice {
  font-size: 12.5px; color: #8a6d1a; background: #fdf7e6;
  border-radius: 8px; padding: 7px 10px; margin-top: 8px; line-height: 1.6;
}
.wxc-item.fail .wxc-advice { color: #9c3a30; background: #fdeeec; }
.wxc-foot {
  text-align: center; color: var(--text-sub); font-size: 12.5px;
  line-height: 1.8; padding: 16px 0 8px;
}

/* ===== 个人中心：工具区（分享 / 微信自检） ===== */
.me-tools { display: flex; gap: 12px; margin-top: 16px; }
.me-tool {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--card); border: 1px dashed var(--primary); color: var(--primary);
  border-radius: 12px; padding: 13px 10px; font-size: 14px; font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
.me-tool:hover { background: var(--primary-light); }
.mt-icon { font-size: 17px; line-height: 1; }
.me-wx-tip {
  margin-top: 12px; font-size: 12.5px; color: #1f7a4d;
  background: #eefaf2; border-radius: 10px; padding: 10px 12px;
  line-height: 1.7; text-align: center;
}
@media (max-width: 420px) {
  .me-tools { flex-direction: column; }
}

/* ===== 法律文本：整页版 ===== */
/* 长文阅读：限制行宽（过宽会让人读串行），加大段间距，标题层级用左侧色条区分 */
.legal-page {
  max-width: 720px; margin: 0 auto;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px 30px 22px;
}
.legal-head { padding-bottom: 15px; border-bottom: 2px solid var(--primary-light); margin-bottom: 18px; }
.legal-head h1 { font-size: 22px; margin-bottom: 8px; }
.legal-meta { font-size: 12.5px; color: var(--text-sub); }
.legal-body { font-size: 14.5px; line-height: 1.85; color: var(--text); }
.legal-sec { margin-bottom: 22px; }
.legal-body h3 {
  font-size: 15.5px; margin-bottom: 9px; padding-left: 10px;
  border-left: 3px solid var(--primary); line-height: 1.5;
}
.legal-body p { margin-bottom: 7px; text-align: justify; word-break: break-word; }
.legal-foot {
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-sub); line-height: 1.8;
}
.legal-top { padding: 8px 18px; font-size: 13.5px; margin-top: 12px; }

/* ===== 法律文本：弹层版（注册页就地查阅） ===== */
/* 弹层高度受限，正文区独立滚动，保证「我已阅读」按钮始终可见 */
.modal .legal-body.legal-modal-body {
  max-height: 54vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 14px; background: var(--bg); border-radius: 10px;
  font-size: 13.5px; line-height: 1.8;
}
.legal-modal-body h3 { font-size: 14.5px; }
.legal-modal-body .legal-sec { margin-bottom: 18px; }
.legal-modal-title { margin-bottom: 4px; }
.modal .legal-modal-actions { margin-top: 14px; }
.modal .legal-modal-actions .btn { flex: 1; text-align: center; }

/* 页脚 / 个人中心的协议入口 */
.footer-links { margin: 8px 0 0; font-size: 12.5px; }
.footer-links a { color: var(--text-sub); }
.footer-links a:hover { color: var(--primary); text-decoration: underline; }
.fl-sep { margin: 0 6px; color: var(--border); }
.me-legal {
  margin-top: 14px; text-align: center; font-size: 12.5px; color: var(--text-sub);
}
.me-legal a { color: var(--text-sub); }
.me-legal a:hover { color: var(--primary); text-decoration: underline; }

@media (max-width: 560px) {
  .legal-page { padding: 20px 18px 16px; border-radius: 10px; }
  .legal-head h1 { font-size: 19px; }
  .legal-body { font-size: 14px; }
  .modal .legal-body.legal-modal-body { max-height: 48vh; padding: 10px 12px; }
}

/* 自检页：检测中的占位态（异步项回填前） */
.wxc-item.pending { border-left-color: #b9c4bc; }
.wxc-item.pending .wxc-name { color: var(--text-sub); }
.wxc-item.pending .wxc-icon { animation: wxc-spin 1.2s linear infinite; display: inline-block; }
@keyframes wxc-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wxc-item.pending .wxc-icon { animation: none; } }
