:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-muted: #eef0f4;
  --border: #dfe3ea;
  --text: #1c2333;
  --text-muted: #6b7488;
  --brand: #2f6df6;
  --brand-on: #ffffff;
  --brand-soft: #e8efff;
  --ok: #167a4a;
  --ok-soft: #e3f5ea;
  --warn: #8a5a00;
  --warn-soft: #fdf3dd;
  --danger: #b4232b;
  --radius: 12px;
  --radius-sm: 8px;
  --gap: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 18px 0 8px; }
code { background: var(--surface-muted); border-radius: 4px; padding: 1px 5px; font-size: 13px; }

/* 顶栏 */
.bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.bar .brand { font-weight: 600; }
.bar .who { color: var(--text-muted); font-size: 13px; margin-left: auto; }
.bar nav { display: flex; gap: 12px; flex-wrap: wrap; }
.bar nav .link.active { font-weight: 600; }
.inline { display: inline; }

/* 表单 */
label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--text-muted); }
input, textarea, select {
  width: 100%; margin-top: 5px; padding: 10px 12px; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
textarea { resize: vertical; min-height: 64px; }
input[readonly] { background: var(--surface-muted); }
.button {
  display: inline-block; padding: 10px 18px; font-size: 15px; font-family: inherit;
  color: var(--brand-on); background: var(--brand); border: 1px solid var(--brand);
  border-radius: var(--radius-sm); cursor: pointer; text-align: center;
}
.button:hover { filter: brightness(1.06); }
.button.ghost { color: var(--text); background: var(--surface); border-color: var(--border); }
.button.small { padding: 6px 12px; font-size: 13px; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font-size: 14px; font-family: inherit; cursor: pointer; }
.switch { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; color: var(--text); }
.switch input { width: auto; margin: 0; }

/* 提示 */
.notice {
  margin: 12px 16px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--brand-soft); color: var(--text); font-size: 14px;
}
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.dev-code { background: var(--warn-soft); color: var(--warn); padding: 8px 12px; border-radius: var(--radius-sm); font-size: 14px; }
.empty { color: var(--text-muted); padding: 20px 0; }
.foot-note { color: var(--text-muted); font-size: 13px; margin-top: 14px; }
.lede { color: var(--text-muted); font-size: 14px; margin: 0 0 16px; }

/* 登录 */
body.auth { display: flex; flex-direction: column; align-items: center; min-height: 100vh; padding: 0; }
/* 卡片居中占满剩余高度，页脚固定在视口底部 */
.auth-shell { flex: 1 0 auto; width: 100%; display: flex; align-items: center; justify-content: center; padding: 28px 20px; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 22px;
}
.auth-card .button { width: 100%; }

/* 登录页品牌区 */
.auth-brand { text-align: center; margin: 2px 0 22px; }
.auth-logo { display: inline-flex; margin-bottom: 12px; filter: drop-shadow(0 8px 18px rgba(255,84,104,.28)); }
.auth-title { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: .3px; }
.auth-sub { margin: 6px 0 0; font-size: 13px; color: var(--text-muted); }
.auth-tip { margin: 14px 0 0; font-size: 12px; line-height: 1.6; color: var(--text-muted); text-align: center; }
.auth-agree { margin-top: 16px; text-align: center; font-size: 12px; }
/* 已发送验证码的提示条 */
.auth-sent {
  margin: 0 0 16px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--brand-soft); font-size: 13px; color: var(--text); text-align: center;
}
.auth-sent strong { font-weight: 600; }
.auth-sent em { display: block; margin-top: 3px; font-style: normal; font-size: 12px; color: var(--text-muted); }

/* 登录页页脚：品牌名 + ICP 备案号 */
.site-foot { flex: 0 0 auto; width: 100%; padding: 10px 20px calc(16px + env(safe-area-inset-bottom)); text-align: center; }
.site-foot-name { margin: 0 0 4px; font-size: 12px; color: var(--text-muted); }
.site-icp { font-size: 12px; color: var(--text-muted); }
.site-icp:hover { color: var(--brand); }

/* 图形验证码 */
.captcha-box { margin: 0 0 14px; }
.captcha-line { display: flex; gap: 8px; align-items: flex-start; }
.captcha-line input { flex: 1; min-width: 0; }
.captcha-img {
  width: 150px; height: 48px; margin-top: 5px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-muted); cursor: pointer;
}
.resend-block { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.resend-sep { color: var(--text-muted); }
/* 点「重新发送验证码」后才展开的图形验证码面板 */
.resend-form { flex: 1 0 100%; margin: 0; padding: 12px 14px; text-align: left; background: var(--surface-muted); border-radius: var(--radius-sm); }
.resend-form .captcha-box { margin: 0 0 12px; }
.resend-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.resend-actions .button { flex: 0 0 auto; }

/* 直播间列表 */
.list { max-width: 720px; margin: 0 auto; padding: 16px; display: grid; gap: var(--gap); }
.room-card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; color: inherit;
}
.room-card:hover { border-color: var(--brand); }
.room-card.locked { opacity: .6; }
.room-card h2 { margin: 8px 0 6px; }
.room-card p { margin: 0; color: var(--text-muted); font-size: 14px; }
.room-top { display: flex; align-items: center; gap: 10px; }
.room-card .meta { margin-top: 8px; font-size: 13px; }
.online { color: var(--ok); font-size: 13px; font-weight: 600; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: var(--surface-muted); color: var(--text-muted); }
.badge-live { background: var(--ok-soft); color: var(--ok); }
.badge-draft { background: var(--brand-soft); color: var(--brand); }
.badge-ended { background: var(--surface-muted); color: var(--text-muted); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--warn-soft); color: var(--warn); }

/* 观看页 */
.watch { max-width: 860px; margin: 0 auto; padding: 12px 16px 40px; }
.stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; background: #10141c;
  border-radius: var(--radius); overflow: hidden;
}
.stage-player, .stage-player video { width: 100%; height: 100%; object-fit: contain; background: #10141c; }
.stage-note {
  position: absolute; inset: auto 0 0 0; padding: 10px 14px; font-size: 13px; color: #e8ecf5;
  background: rgba(10, 14, 22, .78);
}
.stage-note.hidden { display: none; }
.stage-note.error { background: rgba(140, 24, 32, .88); }
.live-info { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-top: var(--gap); }
.live-info p { margin: 6px 0 0; font-size: 14px; color: var(--text-muted); }
.live-info .meta { font-size: 13px; }

/* 后台 */
.admin-grid { max-width: 1180px; margin: 0 auto; padding: 16px; display: grid; gap: var(--gap); grid-template-columns: minmax(280px, 360px) 1fr; }
.admin-single { max-width: 1180px; margin: 0 auto; padding: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow-x: auto; }
.panel .button { margin-top: 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.table tr:last-child td { border-bottom: 0; }
.nowrap { white-space: nowrap; }
/* 表格行内的操作按钮（开播 / 删除等） */
.row-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted-note { color: var(--text-muted); font-size: 12px; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { margin: 0; }
.copy-row .button { margin: 0; white-space: nowrap; }
.search-row { display: flex; gap: 8px; margin-bottom: 14px; max-width: 360px; }
.search-row input { margin: 0; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form input { margin: 0; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--gap); }
.metric { background: var(--surface-muted); border-radius: var(--radius-sm); padding: 12px; }
.metric-value { display: block; font-size: 20px; font-weight: 600; }
.metric-label { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* 开播页 */
.admin-live { max-width: 1180px; margin: 0 auto; padding: 16px; display: grid; gap: var(--gap); grid-template-columns: 1fr minmax(240px, 320px); align-items: start; }
.admin-live .stage { grid-column: 1; }
.live-controls { grid-column: 1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.live-controls .button { margin: 0; }
/* 开播设备选择（摄像头 / 麦克风 / 刷新） */
.device-row {
  grid-column: 1; display: flex; gap: 10px 14px; flex-wrap: wrap; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px;
}
.device-row label { flex: 1 1 220px; margin: 0; }
.device-row .button { flex: 0 0 auto; }
.live-side { grid-column: 2; grid-row: 1 / span 2; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.online-list { list-style: none; margin: 0; padding: 0; font-size: 14px; max-height: 320px; overflow-y: auto; }
.online-list li { padding: 7px 0; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.online-list li:last-child { border-bottom: 0; }

/* ==================== 后台移动端适配 ==================== */
@media (max-width: 760px) {
  /* 顶栏：品牌与账号一行，导航独占一行并可横向滑动，不再挤成好几行 */
  body.admin .bar { padding: 8px 12px; gap: 6px; }
  body.admin .bar .brand { order: 1; flex: 1 1 auto; font-size: 14px; }
  body.admin .bar .who { order: 2; margin: 0; font-size: 12px; }
  body.admin .bar form { order: 2; }
  body.admin .bar nav {
    order: 3; flex: 1 0 100%; display: flex; gap: 6px; flex-wrap: nowrap;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  body.admin .bar nav::-webkit-scrollbar { display: none; }
  body.admin .bar nav .link {
    flex: 0 0 auto; padding: 6px 12px; font-size: 13px; white-space: nowrap;
    background: var(--surface-muted); border-radius: 999px;
  }
  body.admin .bar nav .link.active { background: var(--brand); color: var(--brand-on); }

  /* 容器 / 面板 / 指标 */
  body.admin .admin-grid, body.admin .admin-live { grid-template-columns: 1fr; gap: 10px; }
  body.admin .live-side { grid-column: 1; grid-row: auto; }
  body.admin .admin-grid, body.admin .admin-live, body.admin .admin-single { padding: 10px; }
  body.admin .panel { padding: 12px; border-radius: var(--radius-sm); }
  body.admin .panel h2 { font-size: 15px; }
  body.admin .metrics { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  body.admin .metric { padding: 10px; }
  body.admin .metric-value { font-size: 18px; }

  /* 按钮更大、整行铺满，方便手指点 */
  body.admin .button { padding: 9px 14px; }
  body.admin .button.small { padding: 8px 14px; }
  body.admin .actions-row { gap: 8px; }
  body.admin .actions-row > .button, body.admin .actions-row > .inline-form { flex: 1 1 100%; }
  body.admin .actions-row .button { width: 100%; }
  body.admin .row-actions { display: flex; width: 100%; gap: 8px; flex-wrap: wrap; }
  body.admin .row-actions > .button, body.admin .row-actions > .inline-form { flex: 1 1 auto; }
  body.admin .row-actions .button { width: 100%; }
  body.admin .row-actions .muted-note { flex: 1 1 100%; }

  /* 表格 → 卡片：每个字段前面带上字段名，窄屏不再需要左右滑动 */
  body.admin table.table thead { display: none; }
  body.admin table.table,
  body.admin table.table tbody,
  body.admin table.table tr,
  body.admin table.table td { display: block; width: 100%; }
  body.admin table.table tbody tr {
    margin: 0 0 10px; padding: 10px 12px;
    background: var(--surface-muted); border-radius: var(--radius-sm);
  }
  body.admin table.table tbody tr:last-child { margin-bottom: 0; }
  body.admin table.table td {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 4px 0; border: 0; font-size: 14px;
  }
  body.admin table.table td[data-label]::before {
    content: attr(data-label); flex: 0 0 74px;
    color: var(--text-muted); font-size: 13px;
  }
  body.admin table.table td:empty { display: none; }
  body.admin table.table td > .copy-row { flex: 1; min-width: 0; }
  /* 键值表（订单详情）：字段名在上、值在下 */
  body.admin table.table.kv tr { padding: 8px 12px; }
  body.admin table.table.kv th { display: block; width: auto; padding: 0; border: 0; white-space: normal; }
  body.admin table.table.kv td { display: block; padding: 2px 0 0; }
}

/* ==================== 商城 ==================== */
.bar .who-link { font-size: 13px; color: var(--text-muted); }
.button[disabled], .button.disabled { opacity: .55; cursor: not-allowed; filter: none; }

/* 后台商品表沿用（原样保留） */
.origin-price { color: var(--text-muted); font-size: 12px; }

/* ==================== 观看端主题（仅 body.viewer，后台保持蓝色） ==================== */
body.viewer {
  --brand: #ff4a3d;
  --brand-on: #ffffff;
  --brand-soft: #fff1ee;
  --danger: #ff3b30;
  --ok: #12a150;
  --ok-soft: #e6f7ee;
  --radius: 14px;
  --radius-sm: 10px;
  --live-dark: #17181c;
  --grad: linear-gradient(90deg, #ff5468 0%, #ff8f3f 100%);
  background: #f5f6f8;
}

/* 深色顶栏（观看页 / 订单类页面共用） */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 0 10px; background: var(--live-dark); color: #fff;
}
.topbar-back, .topbar-side {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%;
  color: #fff; background: rgba(255,255,255,.08); border: 0;
  font: inherit; font-size: 13px; cursor: pointer;
}
.topbar-side { width: auto; min-width: 34px; padding: 0 10px; border-radius: 999px; }
.topbar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: center; line-height: 1.25; }
.topbar-title strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-title small { font-size: 11px; color: rgba(255,255,255,.55); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-menu { position: relative; flex: 0 0 auto; }
.topbar-menu summary {
  list-style: none; display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.08); cursor: pointer;
}
.topbar-menu summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: 42px; min-width: 148px; padding: 6px; z-index: 40;
  background: #23252b; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.menu-panel a, .menu-panel button {
  display: block; width: 100%; padding: 10px 12px; text-align: left;
  font: inherit; font-size: 14px; color: #eef0f4; background: none; border: 0; border-radius: 8px; cursor: pointer;
}
.menu-panel a:hover, .menu-panel button:hover { background: rgba(255,255,255,.08); }
.menu-panel form { margin: 0; }

/* 直播间列表 / 登录页 */
.home-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.home-head h1 { margin: 0; }
body.viewer .room-card { border: 0; box-shadow: 0 2px 10px rgba(23,24,28,.06); }
body.viewer .room-card:hover { box-shadow: 0 8px 22px rgba(255,84,104,.18); }
body.viewer .badge-live { background: #ffe9e6; color: #ff3b30; }
body.viewer.auth { background: linear-gradient(180deg, #fff2ef 0%, #f5f6f8 46%); }
body.viewer .auth-card {
  border: 0; border-radius: 20px; padding: 30px 24px 26px; box-shadow: 0 18px 48px rgba(23,24,28,.13);
}
body.viewer .auth-card input { border-radius: 12px; border-color: #e9ebf0; background: #f7f8fa; padding: 13px 14px; }
body.viewer .auth-card input:focus {
  outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(255,74,61,.12);
}
body.viewer .auth-card .button {
  width: 100%; border: 0; background: var(--grad); border-radius: 999px; font-weight: 600;
  padding: 13px 18px; font-size: 16px; box-shadow: 0 8px 20px rgba(255,84,104,.3);
}

/* ==================== 直播间观看页 ==================== */
body.live { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: #fff; }
body.live .topbar { position: static; }
.live-stage { position: relative; flex: 0 0 auto; background: #10141c; }
body.live .stage { border-radius: 0; aspect-ratio: 16 / 9; }
/* 竖版直播：按 9:16 居中展示，两侧留深色底（不再铺满整宽） */
body.live .stage.stage-portrait,
.admin-live .stage.stage-portrait {
  aspect-ratio: 9 / 16; width: auto; max-width: 100%; height: 58dvh; margin: 0 auto; background: #10141c;
}
.live-stage .stage-note { font-size: 12px; }
body.live .live-stage > .foot-note { position: absolute; left: 10px; bottom: 10px; margin: 0; }
body.live .live-stage > .foot-note .button { padding: 6px 12px; font-size: 12px; }
.live-mark {
  position: absolute; top: 10px; right: 10px; padding: 3px 8px; letter-spacing: .5px;
  font-size: 11px; font-weight: 600; color: #fff; background: rgba(255,59,48,.9); border-radius: 6px;
}
.live-state {
  position: absolute; top: 10px; left: 10px; padding: 3px 9px;
  font-size: 11px; color: #fff; background: rgba(0,0,0,.5); border-radius: 999px;
}
.live-state-live { background: rgba(255,59,48,.9); }
.live-tabs { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: #fff; border-bottom: 1px solid #eef0f4; }
.live-tab { position: relative; padding: 11px 2px; font-size: 15px; font-weight: 600; color: #1c2333; }
.live-tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: var(--grad); }
.live-pill { margin-left: auto; font-size: 12px; color: #a8adb8; }
.live-tab-shop {
  margin-left: auto; padding: 5px 12px; font: inherit; font-size: 12px; cursor: pointer;
  color: #ff3b30; background: #fff1ee; border: 0; border-radius: 999px;
}
.live-pill + .live-tab-shop { margin-left: 0; }
.live-tab-shop b { font-weight: 700; }

/* 聊天流 */
.chat-feed { flex: 1 1 auto; overflow-y: auto; padding: 12px 14px; background: #f5f6f8; display: flex; flex-direction: column; gap: 12px; }
.chat-list { display: flex; flex-direction: column; gap: 12px; }
.chat-empty { margin: auto 0; text-align: center; color: #a8adb8; font-size: 13px; }
.chat-item { display: flex; align-items: flex-start; gap: 8px; }
.chat-avatar {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: #fff; background: #ff8f3f;
}
.chat-body { min-width: 0; max-width: 78%; }
.chat-name { display: block; margin: 0 0 3px; font-size: 12px; color: #97a0ad; }
.chat-bubble {
  display: inline-block; padding: 8px 12px; font-size: 14px; color: #1c2333; white-space: pre-wrap;
  word-break: break-word; background: #fff; border-radius: 4px 14px 14px 14px; box-shadow: 0 1px 4px rgba(23,24,28,.06);
}
.chat-item.mine { flex-direction: row-reverse; }
.chat-item.mine .chat-body, .chat-item.mine .chat-name { text-align: right; }
.chat-item.mine .chat-bubble { background: #ffe9e6; border-radius: 14px 4px 14px 14px; }
.chat-sys { text-align: center; }
.chat-sys span { display: inline-block; padding: 4px 12px; font-size: 12px; color: #a8adb8; background: rgba(28,35,51,.05); border-radius: 999px; }

/* 底部输入条 */
.live-input {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid #eef0f4;
}
.chat-form { flex: 1; display: flex; align-items: center; gap: 8px; }
.chat-input { flex: 1; margin: 0; padding: 9px 16px; font-size: 14px; color: #1c2333; background: #f2f3f6; border: 0; border-radius: 999px; }
.chat-input:focus { outline: none; background: #ebeef3; }
.chat-send {
  flex: 0 0 auto; padding: 9px 16px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  color: #fff; background: var(--grad); border: 0; border-radius: 999px;
}
.chat-send[disabled] { opacity: .5; }
.cart-fab {
  position: relative; flex: 0 0 auto; width: 46px; height: 46px; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: var(--grad); border-radius: 50%; box-shadow: 0 6px 16px rgba(255,84,104,.35);
}
.cart-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #ff3b30; background: #fff;
  border: 1.5px solid #ff3b30; border-radius: 999px;
}
.live-blocked { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px 24px; text-align: center; }
.live-blocked .muted { color: var(--text-muted); font-size: 13px; }

/* ==================== 商品半屏弹层 ==================== */
.sheet-mask { position: fixed; inset: 0; z-index: 45; background: rgba(16,18,24,.5); }
.sheet-mask[hidden] { display: none; }
.shop-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 46;
  display: flex; flex-direction: column; max-height: 78vh; overflow: hidden;
  background: #fff; border-radius: 16px 16px 0 0; animation: sheet-up .22s ease-out;
}
.shop-sheet[hidden] { display: none; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-head { display: flex; align-items: center; gap: 18px; padding: 6px 14px 0; border-bottom: 1px solid #eef0f4; }
.sheet-tab { position: relative; padding: 12px 2px; font: inherit; font-size: 15px; color: #6b7488; background: none; border: 0; cursor: pointer; }
.sheet-tab.active { color: #ff3b30; font-weight: 600; }
.sheet-tab.active::after { content: ''; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 22px; height: 3px; border-radius: 3px; background: var(--grad); }
.sheet-close { margin-left: auto; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: #97a0ad; background: none; border: 0; cursor: pointer; }
.sheet-body { flex: 1; overflow-y: auto; padding: 4px 14px calc(14px + env(safe-area-inset-bottom)); }
.sheet-pane[hidden] { display: none; }
.sheet-empty { padding: 30px 0; text-align: center; color: #a8adb8; font-size: 13px; }
.sheet-more { display: block; margin: 14px 0 6px; text-align: center; font-size: 13px; color: #ff4a3d; }

/* 商品行 */
.prod-list { list-style: none; margin: 0; padding: 0; }
.prod-card { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f0f1f4; }
.prod-card:last-child { border-bottom: 0; }
.prod-card.static { border-bottom: 0; padding: 0; }
.prod-cover { flex: 0 0 84px; width: 84px; height: 84px; object-fit: cover; border-radius: 10px; background: #f2f3f6; }
.prod-cover-fallback { display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 600; color: #ff4a3d; background: #fff1ee; }
.prod-info { flex: 1; min-width: 0; }
.prod-title {
  margin: 0; font-size: 14px; font-weight: 600; color: #1c2333; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.prod-prices { margin: 6px 0 0; display: flex; align-items: baseline; gap: 8px; }
.prod-price { color: #ff3b30; font-size: 18px; font-weight: 700; }
.prod-price i { margin-right: 1px; font-size: 12px; font-style: normal; font-weight: 600; }
.prod-origin { color: #a8adb8; font-size: 12px; text-decoration: line-through; }
.prod-meta { margin: 4px 0 0; font-size: 12px; color: #a8adb8; }
.prod-summary { margin: 12px 0 0; font-size: 14px; color: var(--text-muted); }
.prod-desc { margin: 10px 0 0; font-size: 14px; line-height: 1.7; color: var(--text); }
.prod-buy {
  flex: 0 0 auto; padding: 8px 16px; font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap;
  background: var(--grad); border-radius: 999px; box-shadow: 0 6px 14px rgba(255,84,104,.28);
}
.prod-buy.disabled { background: #d9dbe1; box-shadow: none; }

/* 弹层内「我的订单」 */
.order-mini { list-style: none; margin: 0; padding: 0; }
.order-mini li { display: flex; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid #f0f1f4; }
.order-mini li:last-child { border-bottom: 0; }
.order-mini-main { flex: 1; min-width: 0; }
.order-mini-title { margin: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-mini-meta { margin: 3px 0 0; font-size: 12px; color: #a8adb8; }
.order-mini-link { flex: 0 0 auto; padding: 6px 12px; font-size: 13px; color: #ff4a3d; border: 1px solid #ffd5cf; border-radius: 999px; }

/* 右下角悬浮商品卡 */
.float-card {
  position: fixed; right: 10px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 35;
  width: min(84vw, 320px); padding: 10px; background: #fff; border-radius: 14px;
  box-shadow: 0 12px 30px rgba(23,24,28,.18);
}
.float-close { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; color: #a8adb8; background: none; border: 0; cursor: pointer; }
.float-main { display: flex; gap: 10px; }
.float-card .prod-cover { flex: 0 0 64px; width: 64px; height: 64px; }
.float-info { flex: 1; min-width: 0; }
.float-title {
  margin: 0; font-size: 13px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.float-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.float-spacer { flex: 1; }
.float-all { padding: 0; font: inherit; font-size: 12px; color: #97a0ad; background: none; border: 0; cursor: pointer; }

/* 确认订单 / 支付 */
.checkout { max-width: 560px; margin: 0 auto; padding: 12px 12px 140px; display: grid; gap: 12px; }
.card { background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 2px 10px rgba(23,24,28,.05); }
.card-title { margin: 0 0 12px; font-size: 15px; }
.pay-option { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #e6e8ee; border-radius: 12px; }
.pay-option.selected { border-color: #12a150; background: #f6fdf9; }
.pay-option-name { flex: 1; font-size: 15px; }
.pay-option-check { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; color: #fff; background: #12a150; border-radius: 50%; }
.checkout-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: #fff; box-shadow: 0 -4px 18px rgba(23,24,28,.08);
}
.checkout-total { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--text-muted); }
.checkout-total b { font-size: 22px; color: #ff3b30; }
.checkout-bar form { flex: 1; margin: 0; }
.pay-cta {
  width: 100%; padding: 12px 18px; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
  color: #fff; background: var(--grad); border: 0; border-radius: 999px; box-shadow: 0 8px 20px rgba(255,84,104,.3);
}
.pay-cta[disabled] { opacity: .55; box-shadow: none; cursor: not-allowed; }
.pay-qr { display: flex; align-items: center; justify-content: center; min-height: 220px; padding: 14px; background: #f5f6f8; border-radius: 12px; }
.pay-qr svg { width: 216px; height: 216px; background: #fff; border-radius: 10px; }
.pay-tip { margin: 12px 0 0; font-size: 13px; color: var(--text-muted); text-align: center; }
.pay-status { margin: 14px 0 10px; font-size: 14px; color: var(--warn); }
.deliver-box {
  margin: 10px 0 0; padding: 12px; white-space: pre-wrap; word-break: break-all;
  font-size: 13px; font-family: inherit; background: #f5f6f8;
  border-radius: 10px; border: 1px solid #eef0f4;
}

/* 我的订单 */
body.viewer .list { padding-top: 14px; }
.order-card { background: #fff; border: 0; border-radius: 14px; padding: 14px 16px; box-shadow: 0 2px 10px rgba(23,24,28,.05); }
.order-head { display: flex; align-items: center; gap: 10px; }
.order-no { font-size: 12px; color: var(--text-muted); }
.order-title { margin: 8px 0 4px; font-size: 15px; font-weight: 600; }
.order-meta { margin: 0 0 8px; font-size: 13px; color: var(--text-muted); }
.order-card .actions-row { margin-top: 10px; }
.order-card .copy-row input { font-size: 13px; }

/* 购买须知 */
.legal { max-width: 720px; margin: 0 auto; }
.legal p { font-size: 14px; line-height: 1.8; }
.legal h3 { margin: 18px 0 6px; }
.license-image { max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); }

.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-paid { background: var(--ok-soft); color: var(--ok); }
.badge-closed { background: var(--surface-muted); color: var(--text-muted); }
.badge-refunded { background: #fde8e9; color: var(--danger); }
.badge-on { background: var(--ok-soft); color: var(--ok); }
.badge-off { background: var(--surface-muted); color: var(--text-muted); }

/* 订单多字段筛选行（比 .search-row 宽，允许换行） */
.filter-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-bottom: 14px; }
.filter-row input, .filter-row select { margin: 0; }
.field-inline { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 120px; font-size: 12px; color: var(--text-muted); }
.field-inline select, .field-inline input { font-size: 14px; }

/* 订单详情字段表 + 支付流水时间线 */
.table.kv th { width: 150px; white-space: nowrap; color: var(--text-muted); font-weight: 500; }
.table tr.muted-row td { opacity: .5; }
.wrap { word-break: break-all; white-space: normal; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--border); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ''; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--brand); border: 2px solid var(--surface);
}
.timeline-time { display: block; font-size: 12px; color: var(--text-muted); }
.timeline-body { margin-top: 2px; font-size: 14px; }
.timeline-body p { margin: 4px 0 0; }