:root {
  --bg: #fbf8f4;
  --card: #ffffff;
  --ink: #1f1d1a;
  --muted: #857f76;
  --line: #ece7df;
  --accent: #c94a3d;
  --accent-soft: #fde7e3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 14, 5, 0.04), 0 8px 24px rgba(20, 14, 5, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(251, 248, 244, 0.9);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: 0.02em; }
.logo em { color: var(--accent); font-style: normal; }
.logo-dot { width: 10px; height: 10px; background: var(--accent); border-radius: 50%; }
.site-header nav a { margin-left: 20px; color: var(--ink); text-decoration: none; font-size: 14px; }
.site-header nav a.subtle { color: var(--muted); }
.site-header nav a:hover { color: var(--accent); }

main { padding: 40px 0 80px; min-height: 60vh; }

.site-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: 13px; }
.site-footer .wrap { display: flex; justify-content: space-between; }
.site-footer .icp { justify-content: center; margin-top: 8px; }
.site-footer .icp a { color: var(--muted); text-decoration: none; }
.muted { color: var(--muted); }

.hero {
  padding: 32px 0 40px;
}
.hero h1 { margin: 0 0 8px; font-size: 34px; letter-spacing: -0.02em; font-weight: 600; }
.hero p { margin: 0; color: var(--muted); max-width: 560px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
@media (max-width: 720px) {
  /* 手机上强制两列，卡片更紧凑 */
  .product-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .product-body { padding: 12px 12px 14px; }
  .product-name { font-size: 14px; }
  .product-desc { font-size: 12px; margin-bottom: 10px; }
  .product-meta { font-size: 11px; }
}

/* 首页分类筛选条 */
.category-bar {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cat-pill {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 6px 16px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.cat-pill:hover { border-color: var(--ink); }
.cat-pill.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #dcd4c7;
}
.product-img { aspect-ratio: 4 / 3; overflow: hidden; background: #efe9de; }
.product-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-body { padding: 16px 18px 18px; }
.product-name { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.product-desc { margin: 0 0 14px; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-meta { display: flex; justify-content: flex-start; gap: 14px; font-size: 12px; color: var(--muted); }
.meta-comments, .meta-likes { display: inline-flex; align-items: center; gap: 4px; }

.product-page { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; }
@media (max-width: 720px) { .product-page { grid-template-columns: 1fr; gap: 24px; } }

.product-hero-img { width: 100%; aspect-ratio: 4 / 3; background: #efe9de; border-radius: var(--radius); overflow: hidden; }
.product-hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.product-media { display: flex; flex-direction: column; gap: 12px; }
.product-extras {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.product-extras img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  background: #efe9de;
  cursor: zoom-in;
  display: block;
}
.product-video-box {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.product-video-box video {
  display: block;
  width: 100%;
  max-height: 60vh;
}
.detail-cat-tag {
  display: inline-block;
  font-size: 13px;
  color: var(--ink);
  background: #ece7df;
  padding: 2px 10px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 6px;
}
.back-link { display: inline-block; margin-bottom: 16px; color: var(--muted); text-decoration: none; font-size: 13px; }
.back-link:hover { color: var(--accent); }
.product-detail h1 { margin: 4px 0 8px; font-size: 26px; letter-spacing: -0.01em; }
.product-detail p { color: #4b4741; }

.comments-section { margin-top: 56px; }
.comments-section h2 { font-size: 18px; margin: 0; }
.comments-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.sort-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--card); }
.sort-tabs button {
  border: none; background: transparent; color: var(--muted);
  padding: 4px 14px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.sort-tabs button.active { background: var(--ink); color: #fff; }
.sort-tabs button:not(.active):hover { color: var(--accent); }

.comment-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comment-form input[type="text"],
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  outline: none;
  resize: vertical;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.comment-form input:focus, .comment-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.comment-form textarea { min-height: 84px; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.file-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px; cursor: pointer; user-select: none;
}
.file-btn:hover { color: var(--accent); }
.file-btn input { display: none; }
.file-preview { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.file-preview img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.file-preview button {
  border: none; background: transparent; color: var(--accent); cursor: pointer; font-size: 12px; padding: 2px 4px;
}
.submit-btn {
  background: var(--ink); color: #fff; border: none; border-radius: 10px;
  padding: 10px 18px; font: inherit; font-weight: 500; cursor: pointer;
  transition: background .15s ease;
}
.submit-btn:hover { background: #000; }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.form-error { color: var(--accent); font-size: 13px; margin: 0; }

.comments-list { margin-top: 24px; display: flex; flex-direction: column; gap: 20px; }

.comment { display: flex; gap: 12px; }
.comment-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #f0c9c3, #c94a3d);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
}
.comment-main { flex: 1; min-width: 0; }
.comment-main header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.comment-user { font-weight: 600; font-size: 14px; }
.comment-time { color: var(--muted); font-size: 12px; }
.comment-body { margin: 0 0 8px; white-space: pre-wrap; word-wrap: break-word; }
.comment-image-wrap { margin: 4px 0 8px; }
.comment-image { max-width: 240px; max-height: 240px; border-radius: 10px; border: 1px solid var(--line); display: block; cursor: zoom-in; }
.comment-main footer { display: flex; gap: 10px; align-items: center; }
.like-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--line);
  color: var(--muted); padding: 4px 10px; border-radius: 999px;
  font: inherit; font-size: 12px; cursor: pointer;
  transition: all .15s ease;
}
.like-btn:hover { color: var(--accent); border-color: var(--accent); }
.like-btn.liked { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.like-btn.liked svg { fill: var(--accent); }

.reply-btn, .delete-btn {
  border: none; background: transparent; color: var(--muted);
  font: inherit; font-size: 12px; cursor: pointer; padding: 4px 6px;
}
.reply-btn:hover { color: var(--accent); }
.delete-btn:hover { color: var(--accent); }
.delete-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.replies { margin-top: 14px; padding-left: 18px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.replies .comment { margin-top: 0; }
.comment.is-reply .comment-avatar { width: 28px; height: 28px; font-size: 12px; }

.reply-slot { margin-top: 10px; }
.reply-form {
  background: #fbf6ee; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
}
.reply-form textarea {
  width: 100%; min-height: 60px; border: 1px solid var(--line);
  background: #fff; border-radius: 8px; padding: 8px 10px;
  font: inherit; color: var(--ink); outline: none; resize: vertical;
}
.reply-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.reply-form-row { display: flex; justify-content: flex-end; gap: 8px; }
.reply-form-row button {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 6px 14px; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer;
}
.reply-form-row .reply-submit { background: var(--ink); color: #fff; border-color: var(--ink); }
.reply-form-row .reply-submit:hover { background: #000; }
.reply-form-row .reply-cancel:hover { color: var(--accent); }
.reply-error { color: var(--accent); font-size: 12px; margin: 0; }

.empty, .loading { color: var(--muted); font-size: 14px; padding: 20px 0; text-align: center; }
.hidden { display: none !important; }

.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  cursor: zoom-out;
}
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }

/* ---------- Admin ---------- */
.admin-tag {
  display: inline-block;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; padding: 2px 10px; border-radius: 999px;
  margin-right: 12px;
}
.link-btn {
  background: transparent; border: none; color: var(--muted);
  font: inherit; font-size: 14px; cursor: pointer; padding: 4px 8px;
}
.link-btn:hover { color: var(--accent); }
.link-btn.danger { color: var(--accent); }
.link-btn.danger:hover { color: #a33; }
.site-header nav .link-btn { margin-left: 20px; }

.login-card {
  max-width: 380px; margin: 60px auto;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.login-card p { margin: 0 0 18px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; }
.login-card input {
  border: 1px solid var(--line); background: #fff;
  border-radius: 10px; padding: 10px 12px; font: inherit; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card button {
  background: var(--ink); color: #fff; border: none; border-radius: 10px;
  padding: 10px 18px; font: inherit; font-weight: 500; cursor: pointer;
}
.login-card button:hover { background: #000; }

.admin-header { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 24px; gap: 12px; flex-wrap: wrap; }
.admin-header h1 { margin: 0; font-size: 24px; }

#product-form-wrap { margin-bottom: 28px; }
#product-form h2 { margin: 0 0 12px; font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field > span { font-weight: 500; }
.field input[type="text"], .field input[type="url"], .field textarea {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 10px 12px; font: inherit; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { min-height: 100px; resize: vertical; }
.field input[type="file"] { font-size: 13px; color: var(--ink); }

.current-image { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.current-image img {
  width: 80px; height: 80px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line);
}

.current-extras { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.current-extras .extras-row {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.current-extras .extra-item {
  position: relative; width: 88px;
  display: flex; flex-direction: column; gap: 4px;
}
.current-extras .extra-item img {
  width: 88px; height: 88px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line);
  display: block;
}
.current-extras .extra-item .badge-new {
  position: absolute; top: 4px; left: 4px;
  background: #10b981; color: #fff;
  font-size: 10px; line-height: 1; padding: 3px 5px;
  border-radius: 4px; pointer-events: none;
}
.current-extras .extra-item .del {
  position: absolute; top: 2px; right: 2px;
  width: 22px; height: 22px; padding: 0;
  border-radius: 50%; border: none;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: 16px; line-height: 22px; text-align: center;
  cursor: pointer;
}
.current-extras .extra-item .del:hover { background: #dc2626; }
.current-extras .extra-item .controls {
  display: flex; gap: 2px;
}
.current-extras .extra-item .controls button {
  flex: 1; padding: 3px 0; font-size: 12px; line-height: 1.2;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  border-radius: 4px;
}
.current-extras .extra-item .controls button:disabled {
  opacity: .3; cursor: not-allowed;
}
.current-extras .extra-item .controls button:not(:disabled):hover {
  background: #f3f4f6;
}

.current-video { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.current-video video {
  width: 100%; max-width: 320px;
  border-radius: 8px; border: 1px solid var(--line);
  background: #000;
}

.admin-list { display: flex; flex-direction: column; gap: 14px; }
.admin-row {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 16px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; align-items: center;
}
.admin-row-img {
  width: 96px; height: 96px; border-radius: 10px; overflow: hidden;
  background: #efe9de;
}
.admin-row-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-row-body { min-width: 0; }
.admin-row-title { font-weight: 600; margin-bottom: 4px; }
.admin-row-desc {
  color: var(--muted); font-size: 13px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 6px;
}
.admin-row-meta { font-size: 12px; }
.admin-row-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* 管理员 Tailscale 直连提示 */
.tailscale-hint {
  margin: 16px 0 0;
  padding: 10px 14px;
  background: #e8f2ff;
  border: 1px solid #b9d6ff;
  border-radius: 10px;
  font-size: 13px;
  color: #244b7a;
  line-height: 1.55;
}
.tailscale-hint a {
  color: #0b5ed7;
  text-decoration: underline;
  word-break: break-all;
}

/* 上传前压缩 / 视频大小提示 */
.compress-info {
  display: block;
  font-size: 12px;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}
.compress-info.info-ok { color: #1f7a3a; }
.compress-info.info-warn {
  color: #8a5a00;
  background: #fff6e0;
  border: 1px solid #f3d98a;
  padding: 6px 8px;
  border-radius: 6px;
}
.compress-info.info-error { color: var(--accent); }
.compress-info b { color: inherit; font-weight: 600; }

@media (max-width: 560px) {
  .admin-row { grid-template-columns: 64px 1fr; grid-template-rows: auto auto; }
  .admin-row-img { width: 64px; height: 64px; }
  .admin-row-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

.import-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
  margin-bottom: 28px;
}
.import-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.import-card h2 { margin: 0; font-size: 17px; }
.import-card p { margin: 8px 0 14px; font-size: 13px; }
.import-card code { background: #f3ede2; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.import-card form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.import-card input[type="file"] { font-size: 13px; }
#import-result {
  margin-top: 14px; padding: 10px 12px;
  background: var(--accent-soft); border-radius: 10px; font-size: 13px;
}
#import-result.import-error { background: #fde7e3; color: var(--accent); }
.import-summary b { color: var(--ink); }
.import-errors { margin: 10px 0 0; padding-left: 20px; color: var(--accent); }

/* ---------- 商品销售 / 支付 ---------- */

/* 管理端表单 */
.sell-block {
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.checkbox-field {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ink); cursor: pointer;
}
.checkbox-field input { width: 16px; height: 16px; accent-color: var(--accent); }
.price-field input {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 10px 12px; font: inherit; outline: none;
}
.price-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 管理端列表里的价格标签 */
.price-tag {
  display: inline-block; margin-left: 6px;
  font-size: 12px; color: var(--accent);
  background: var(--accent-soft); padding: 1px 8px; border-radius: 999px;
  font-weight: 500;
}
.off-tag {
  display: inline-block; margin-left: 6px;
  font-size: 12px; color: var(--muted);
  background: #f3ede2; padding: 1px 8px; border-radius: 999px;
}
.cat-tag {
  display: inline-block; margin-left: 6px;
  font-size: 12px; color: var(--ink);
  background: #ece7df; padding: 1px 8px; border-radius: 999px;
}

/* 首页卡片价格 */
.card-price {
  display: inline-block; margin-top: 8px;
  color: var(--accent); font-weight: 600; font-size: 15px;
}

/* 产品详情页价格块 */
.price-block {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  display: flex; flex-direction: column; gap: 14px;
}
.price-amount { font-size: 26px; color: var(--accent); font-weight: 600; letter-spacing: -0.01em; }
.price-amount span { font-size: 32px; }
.pay-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.pay-btn {
  flex: 1; min-width: 140px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 12px 16px; font: inherit; font-size: 15px;
  font-weight: 500; cursor: pointer;
  transition: border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.pay-btn:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.pay-btn.pay-wechat:hover { border-color: #07c160; color: #07c160; }
.pay-btn.pay-alipay:hover { border-color: #1677ff; color: #1677ff; }
.pay-icon { font-size: 18px; }

/* 支付弹窗 */
.pay-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20, 14, 5, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.pay-modal-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  width: 100%; max-width: 380px;
  position: relative;
  box-shadow: var(--shadow);
  text-align: center;
}
.pay-close {
  position: absolute; top: 10px; right: 12px;
  background: transparent; border: 0; font-size: 24px;
  color: var(--muted); cursor: pointer; line-height: 1; padding: 4px 8px;
}
.pay-close:hover { color: var(--accent); }

.pay-title { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.pay-amount { font-size: 28px; color: var(--accent); font-weight: 600; margin: 14px 0; }
.pay-qr-wrap {
  display: flex; justify-content: center; align-items: center;
  margin: 10px 0 12px;
  min-height: 240px;
}
.pay-qr {
  width: 240px; height: 240px; display: block;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff;
}
.pay-tip { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.pay-mock-hint {
  background: #fff8e1; border: 1px solid #f5d879; color: #8a6d00;
  font-size: 12px; padding: 8px 10px; border-radius: 8px; margin: 8px 0;
  line-height: 1.5;
}
.pay-mock-hint a { color: #8a6d00; font-weight: 600; }
.pay-status, .pay-poll-status { font-size: 12px; margin: 6px 0 0; }
.pay-error { color: var(--accent); font-weight: 500; }

.pay-success {
  padding: 20px 0 10px;
}
.pay-success-icon { font-size: 48px; }
.pay-success-title { font-size: 20px; font-weight: 600; margin: 8px 0; color: #2a8a3e; }
.pay-success-close { margin-top: 18px; }

/* 图片加载骨架 shimmer:图加载前父容器泛一层柔和高光,img onload 后自然覆盖。
   几天后切 .cn + 专用图床时整块可删 */
@keyframes xft-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.product-img,
.product-hero-img,
.product-extras img {
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.65) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  background-repeat: no-repeat;
  background-position: 200% 0;
  animation: xft-shimmer 1.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .product-img,
  .product-hero-img,
  .product-extras img {
    animation: none;
  }
}

/* ================= 直播 ================= */
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-left: 4px; vertical-align: super;
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.live-page .live-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.live-page .live-head h1 { margin: 0; font-size: 24px; }
.live-badge {
  display: inline-block; font-size: 13px; font-weight: 600; color: #fff;
  background: var(--accent); border-radius: 999px; padding: 2px 10px; vertical-align: middle; margin-right: 6px;
}
.live-badge.off { background: var(--muted); }
.live-me a { color: var(--muted); }

.live-player-box { background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.live-player-box video { display: block; width: 100%; max-height: 70vh; background: #000; }
.live-hint { font-size: 13px; margin: 8px 2px 0; }

.live-offline {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 48px 24px; text-align: center;
}
.live-offline p { margin: 4px 0; }

.live-products-title { font-size: 18px; margin: 32px 0 0; }

/* 直播登录卡片（观众端） */
.live-login { max-width: 420px; margin: 40px auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.live-login h1 { margin: 0 0 4px; font-size: 22px; }
.live-login form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.live-login input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; background: var(--bg);
}
.live-login .live-login-row { display: flex; gap: 8px; }
.live-login .live-login-row input { flex: 1; }
.live-login button {
  background: var(--ink); color: #fff; border: 0; border-radius: 10px;
  padding: 10px 16px; font-size: 15px; cursor: pointer; white-space: nowrap;
}
.live-login button:disabled { opacity: 0.5; cursor: default; }
.form-ok { color: #2a8a3e; font-size: 13px; }

/* 后台直播卡片 */
.live-push-info { font-size: 13px; margin-bottom: 12px; line-height: 1.9; }
.live-push-info code { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.live-push-info .live-key { cursor: pointer; }
#live-products-select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 6px; font-size: 14px; background: var(--bg); }

/* 直播间聊天 */
.live-main { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: stretch; }
@media (max-width: 860px) { .live-main { grid-template-columns: 1fr; } }
.live-chat {
  display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  min-height: 320px; max-height: 70vh;
}
.live-chat-head { padding: 10px 14px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--line); }
.live-chat-list { flex: 1; overflow-y: auto; padding: 10px 14px; font-size: 14px; }
.chat-msg { margin-bottom: 6px; word-break: break-word; line-height: 1.5; }
.chat-msg b { color: var(--accent); font-weight: 600; }
#live-chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
#live-chat-form input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; background: var(--bg);
}
#live-chat-form button {
  background: var(--ink); color: #fff; border: 0; border-radius: 10px;
  padding: 8px 16px; font-size: 14px; cursor: pointer;
}
#live-chat-form button:disabled { opacity: 0.5; }
@media (max-width: 860px) { .live-chat { min-height: 0; height: 300px; } }
