/* 我的空间（/my）· 样式
   与官网同一套品牌色（暖白底 / 墨黑 / 橙），但文件独立，不引用、不影响 /site、/team、/admin 的任何样式。
   CSP 是 style-src 'self'：页面里没有内联样式，动态尺寸由脚本通过 CSSOM 设置。 */

:root {
  --primary: #d64800;
  --primary-dark: #a93600;
  --primary-soft: rgba(214, 72, 0, 0.08);
  --ink: #09090b;
  --ink-2: #3f3f46;
  --ink-3: #71717a;
  --ink-4: #a1a1aa;
  --bg: #fafaf7;
  --bg-alt: #f4f1eb;
  --card: #ffffff;
  --line: rgba(9, 9, 11, 0.08);
  --line-strong: rgba(9, 9, 11, 0.16);
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --ok: #0f7b3f;
  --ok-soft: #e9f7ee;
  --warn: #8a5a00;
  --warn-soft: #fff5d9;
  --radius: 14px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(9, 9, 11, 0.04), 0 8px 24px -12px rgba(9, 9, 11, 0.12);
  --shadow-pop: 0 16px 48px -12px rgba(9, 9, 11, 0.28), 0 2px 8px rgba(9, 9, 11, 0.06);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --serif: Georgia, "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --topbar-h: 60px;
  --tabbar-h: 56px;
  --max-w: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-wrap: anywhere;
}
body.no-scroll { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input { font: inherit; color: inherit; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.noscript { padding: 48px 24px; text-align: center; color: var(--ink-3); }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

/* ── 图标 ─────────────────────────────────────────────── */
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic.s { width: 15px; height: 15px; }
.ic.l { width: 22px; height: 22px; }
.ic.xl { width: 30px; height: 30px; stroke-width: 1.4; }
.ic.fill { fill: currentColor; stroke: none; }

/* ── 按钮 ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 18px; border-radius: 999px;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--primary); }
.btn.ghost { background: var(--card); border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.soft { background: var(--bg-alt); color: var(--ink); }
.btn.soft:hover { background: #ebe6dc; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #8f1c13; }
.btn.danger-ghost { background: var(--card); border-color: rgba(180, 35, 24, 0.35); color: var(--danger); }
.btn.danger-ghost:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.text { min-height: 32px; padding: 0 6px; color: var(--primary); border-radius: 8px; }
.btn.text:hover { background: var(--primary-soft); }
.btn.sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.lg { min-height: 48px; font-size: 16px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5); border-top-color: #fff; animation: spin 0.7s linear infinite;
}
.btn.ghost.loading::after, .btn.soft.loading::after, .btn.danger-ghost.loading::after { border-color: rgba(9, 9, 11, 0.2); border-top-color: var(--ink); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2); transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: rgba(9, 9, 11, 0.06); color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 表单 ─────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.input-wrap { position: relative; }
.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--radius-s);
  border: 1px solid var(--line-strong); background: var(--card); font-size: 16px; /* 16px：iOS 聚焦时不放大页面 */
  transition: border-color 0.15s, box-shadow 0.15s; -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--ink-4); }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(9, 9, 11, 0.06); }
.input.with-btn { padding-right: 48px; }
.input-btn { position: absolute; right: 5px; top: 5px; }
.input.code { letter-spacing: 0.5em; text-align: center; font-size: 22px; font-weight: 600; padding-left: 0.5em; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; -webkit-user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.code-row { display: flex; gap: 10px; align-items: center; }
.code-row .input { flex: 1; min-width: 0; }
.code-row .btn { min-height: 48px; flex: none; }
.form-error { min-height: 20px; margin: 4px 0 12px; font-size: 13px; color: var(--danger); }
.form-note { font-size: 13px; color: var(--ink-3); line-height: 1.6; }

/* ── 登录页 ───────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-aside {
  position: relative; overflow: hidden; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(ellipse at 78% 18%, rgba(214, 72, 0, 0.16), transparent 52%),
    radial-gradient(ellipse at 12% 92%, rgba(214, 72, 0, 0.07), transparent 58%),
    var(--bg-alt);
  border-right: 1px solid var(--line);
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 21px; letter-spacing: 0.02em; }
.wordmark .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 12px rgba(214, 72, 0, 0.45); flex: none; }
.auth-hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 3.6vw, 52px); line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 18px; }
.auth-hero h1 em { font-style: italic; color: var(--primary); }
.auth-hero p { color: var(--ink-2); font-size: 16px; max-width: 420px; line-height: 1.75; }
.auth-points { margin-top: 34px; display: grid; gap: 14px; max-width: 420px; }
.auth-point { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.auth-point .pt-ic { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, 0.75); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--primary); flex: none; }
.auth-point b { display: block; color: var(--ink); font-weight: 600; font-size: 14px; }
.auth-foot { font-size: 12px; color: var(--ink-3); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 26px; margin-bottom: 6px; }
.auth-card .sub { color: var(--ink-3); font-size: 14px; margin-bottom: 26px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 18px; }
.auth-alt { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); line-height: 1.7; }
.auth-links { margin-top: 14px; display: flex; gap: 18px; font-size: 13px; color: var(--ink-3); }
.auth-links a:hover, .link:hover { color: var(--primary); }
.link { color: var(--primary); font-size: 14px; }
.auth-mobile-brand { display: none; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-s); font-size: 13px; line-height: 1.6; margin-bottom: 16px; }
.notice.info { background: var(--bg-alt); color: var(--ink-2); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.notice .ic { margin-top: 2px; }

/* ── 外壳：顶栏 / 标签 / 头像 ─────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  background: rgba(250, 250, 247, 0.88); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: var(--max-w); height: 100%; margin: 0 auto; padding: 0 28px; display: flex; align-items: center; gap: 28px; }
.topbar .wordmark { font-size: 19px; }
.topbar .wordmark small { font-family: var(--sans); font-size: 13px; color: var(--ink-3); font-weight: 500; margin-left: 2px; padding-left: 12px; border-left: 1px solid var(--line-strong); letter-spacing: 0; }
.nav { display: flex; gap: 4px; height: 100%; }
.nav a {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; height: 100%;
  font-size: 14px; font-weight: 500; color: var(--ink-3); transition: color 0.15s;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); }
.nav a.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--primary); border-radius: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar-btn { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid transparent; transition: background 0.15s, border-color 0.15s; }
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { background: var(--card); border-color: var(--line-strong); }
.avatar-btn .name { font-size: 13px; font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; overflow: hidden;
  background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 48px; height: 48px; font-size: 19px; }
.avatar.xl { width: 64px; height: 64px; font-size: 24px; }

.tabbar { display: none; }

/* 头像菜单（桌面是右上角浮层，手机是底部抽屉） */
.menu { width: 300px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); overflow: hidden; }
.menu-head { display: flex; gap: 12px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.menu-head .who { min-width: 0; }
.menu-head .who b { display: block; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-head .who span { display: block; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-plan { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.menu-plan .row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--ink-3); }
.menu-list { padding: 6px; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 0 12px; min-height: 42px; border-radius: 9px; font-size: 14px; color: var(--ink); text-align: left; }
.menu-item:hover { background: var(--bg-alt); }
.menu-item .ic { color: var(--ink-3); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .ic { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 0; }

/* ── 页面骨架 ─────────────────────────────────────────── */
.page { max-width: var(--max-w); margin: 0 auto; padding: 28px 28px 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head .desc { font-size: 13px; color: var(--ink-3); margin-top: 4px; max-width: 640px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.back:hover { color: var(--ink); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad { padding: 20px; }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.section-title .count { font-weight: 400; color: var(--ink-3); font-size: 13px; }

/* 徽标 */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge.live { background: var(--ok-soft); color: var(--ok); }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s ease-in-out infinite; }
.badge.paused { background: var(--warn-soft); color: var(--warn); }
.badge.ended, .badge.idle { background: rgba(9, 9, 11, 0.06); color: var(--ink-3); }
.badge.plan { background: var(--primary-soft); color: var(--primary-dark); }
.badge.plan.off { background: rgba(9, 9, 11, 0.06); color: var(--ink-3); }
.badge.dark { background: rgba(9, 9, 11, 0.72); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.badge.dark.live::before { background: #4ade80; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }

/* 进度条 */
.bar { height: 6px; border-radius: 999px; background: rgba(9, 9, 11, 0.08); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--primary); transition: width 0.4s ease; }
.bar.warn > i { background: var(--danger); }

/* 概览四格 */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat { padding: 16px 18px; }
.stat .label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.stat .value { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.stat .value small { font-size: 13px; font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.stat .foot { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.stat .bar { margin-top: 12px; }

/* 筛选 */
.chips { display: flex; gap: 6px; }
.chip { height: 32px; padding: 0 14px; border-radius: 999px; font-size: 13px; color: var(--ink-2); background: transparent; border: 1px solid var(--line-strong); }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* 直播列表 */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.live-card { display: block; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.live-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.live-cover { position: relative; background: var(--bg-alt); }
.live-cover::before { content: ""; display: block; padding-top: 62.5%; }
.live-cover img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.live-cover .ph { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--ink-4); }
.live-cover .badge { position: absolute; top: 10px; left: 10px; }
.live-body { padding: 14px 16px 16px; }
.live-body h3 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-3); }
.live-meta span { display: inline-flex; align-items: center; gap: 4px; }
.live-date { margin-top: 4px; font-size: 12px; color: var(--ink-4); }

/* 直播详情 */
.detail-head { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; }
.detail-head .titles { min-width: 0; flex: 1 1 320px; }
.detail-head h1 { font-size: 24px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-head .meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-3); }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.linkbox { padding: 16px 18px; margin-bottom: 22px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.linkbox .info { min-width: 0; flex: 1 1 280px; }
.linkbox .cap { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.linkbox .url { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linkbox .facts { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-3); }
.linkbox .acts { display: flex; gap: 8px; flex-wrap: wrap; }

.subtabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.subtab { position: relative; padding: 10px 0; font-size: 14px; font-weight: 500; color: var(--ink-3); }
.subtab .count { font-weight: 400; margin-left: 4px; }
.subtab.on { color: var(--ink); }
.subtab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; min-height: 40px; }
.toolbar .hint { font-size: 13px; color: var(--ink-3); }
.toolbar .acts { display: flex; gap: 8px; align-items: center; }
.selectbar {
  position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 20; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 18px; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: var(--shadow-pop);
}
.selectbar .n { font-size: 14px; font-weight: 500; }
.selectbar .acts { display: flex; gap: 6px; }
.selectbar .btn.ghost { background: transparent; border-color: rgba(255, 255, 255, 0.28); color: #fff; }
.selectbar .btn.ghost:hover { border-color: #fff; }

/* 照片网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { position: relative; border-radius: 10px; overflow: hidden; background: var(--bg-alt); cursor: zoom-in; }
.tile::before { content: ""; display: block; padding-top: 100%; }
.tile img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.25s; }
.tile img.ready { opacity: 1; }
.tile .del {
  position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(9, 9, 11, 0.62); color: #fff; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s, background 0.15s;
}
.tile .del:hover { background: var(--danger); }
.tile .pick {
  position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(9, 9, 11, 0.25); display: none; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.tile .pick .ic { opacity: 0; width: 14px; height: 14px; stroke-width: 3; }
.tile .dur { position: absolute; left: 8px; bottom: 8px; }
.tile .playmark { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(9, 9, 11, 0.55); color: #fff; display: flex; align-items: center; justify-content: center; }
@media (hover: hover) { .tile:hover .del { opacity: 1; } }
.grid.selecting .tile { cursor: pointer; }
.grid.selecting .tile .pick { display: flex; }
.grid.selecting .tile .del { display: none; }
.tile.picked { outline: 3px solid var(--primary); outline-offset: -3px; }
.tile.picked img { transform: scale(0.94); border-radius: 6px; transition: transform 0.15s, opacity 0.25s; }
.tile.picked .pick { background: var(--primary); border-color: var(--primary); }
.tile.picked .pick .ic { opacity: 1; }
.tile.removing { opacity: 0.35; pointer-events: none; }
.more { display: flex; justify-content: center; padding: 24px 0 0; }

/* 空状态 / 加载 */
.empty { padding: 56px 24px; text-align: center; color: var(--ink-3); }
.empty .em-ic { width: 60px; height: 60px; border-radius: 18px; background: var(--bg-alt); margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; color: var(--ink-4); }
.empty h3 { color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.empty p { font-size: 13px; max-width: 380px; margin: 0 auto; line-height: 1.7; }
.empty .btn { margin-top: 18px; }
.loading-block { padding: 64px 0; display: flex; justify-content: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid rgba(9, 9, 11, 0.12); border-top-color: var(--ink); animation: spin 0.7s linear infinite; }
.skel { background: linear-gradient(90deg, rgba(9, 9, 11, 0.05) 25%, rgba(9, 9, 11, 0.09) 37%, rgba(9, 9, 11, 0.05) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── 宣传页 ───────────────────────────────────────────── */
.brand-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.brand-card { padding: 22px; }
.brand-id { display: flex; gap: 16px; align-items: center; }
.brand-logo { width: 68px; height: 68px; border-radius: 18px; overflow: hidden; background: var(--bg-alt); flex: none; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 600; color: var(--ink-3); border: 1px solid var(--line); }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-id h2 { font-size: 19px; }
.brand-id p { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.kv { margin-top: 18px; border-top: 1px solid var(--line); }
.kv .row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv .row:last-child { border-bottom: 0; }
.kv .row span:first-child { color: var(--ink-3); }
.share-card { padding: 22px; }
.share-url { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--bg); border: 1px solid var(--line); margin: 12px 0 14px; }
.share-url .url { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.share-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.share-stats .s b { display: block; font-size: 20px; font-weight: 600; }
.share-stats .s span { font-size: 12px; color: var(--ink-3); }

/* ── 模板 ─────────────────────────────────────────────── */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.tpl-card { overflow: hidden; display: flex; flex-direction: column; }
.tpl-thumb { position: relative; background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.tpl-thumb::before { content: ""; display: block; padding-top: 120%; }
.tpl-thumb img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.tpl-thumb .ph { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; padding: 16px; text-align: center; color: var(--ink-4); }
.tpl-thumb .ph .sheet-ic { width: 58px; height: 76px; border-radius: 6px; background: var(--card); border: 1px solid var(--line-strong); box-shadow: 0 6px 14px -8px rgba(9, 9, 11, 0.3); display: flex; align-items: center; justify-content: center; }
.tpl-thumb .ph span { font-size: 11px; }
.tpl-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tpl-body h3 { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-body .meta { font-size: 12px; color: var(--ink-3); }
.tpl-use { font-size: 12px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-use.none { color: var(--ink-4); }
.tpl-foot { margin-top: auto; padding-top: 8px; display: flex; justify-content: flex-end; }

/* ── 账号 ─────────────────────────────────────────────── */
.acct-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.acct-id { display: flex; gap: 16px; align-items: center; }
.acct-id h2 { font-size: 18px; }
.acct-id p { font-size: 13px; color: var(--ink-3); }
.acct-bar { margin: 2px 0 14px; }
.sess { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sess:last-of-type { border-bottom: 0; }
.sess .dev { width: 38px; height: 38px; border-radius: 10px; background: var(--bg-alt); display: flex; align-items: center; justify-content: center; color: var(--ink-3); flex: none; }
.sess .t { min-width: 0; flex: 1; }
.sess .t b { display: block; font-size: 14px; font-weight: 500; }
.sess .t > span { display: block; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess .t b .badge { margin-left: 8px; height: 20px; padding: 0 8px; font-size: 11px; vertical-align: 1px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ── 浮层：遮罩 / 弹窗 / 抽屉 / 大图 ──────────────────── */
.mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; background: rgba(9, 9, 11, 0.42); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade 0.15s ease; }
.mask.clear { background: transparent; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: 100%; max-width: 440px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow-pop); padding: 24px; animation: pop 0.18s ease; max-height: calc(100vh - 48px); overflow-y: auto; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 18px; margin-bottom: 8px; }
.modal .body { font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.modal .body p + p { margin-top: 8px; }
.modal .body ul { margin: 10px 0 0 18px; }
.modal .body li { margin-bottom: 4px; }
.modal .body strong { color: var(--ink); font-weight: 600; }
.modal .field { margin: 16px 0 0; }
.modal .form-error { margin: 8px 0 0; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal .danger-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--danger-soft); color: var(--danger); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.modal.qr { max-width: 360px; text-align: center; }
.qr-box { width: 232px; height: 232px; margin: 14px auto 12px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.qr-box img, .qr-box canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.qr-url { font-size: 12px; color: var(--ink-3); word-break: break-all; margin-bottom: 4px; }
.popover { position: fixed; z-index: 101; animation: pop 0.14s ease; }

/* 与 .mask 同一个 z-index：浮层按打开顺序叠放（DOM 顺序），大图里弹出的确认框才会盖在大图上面 */
.lightbox { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; background: rgba(9, 9, 11, 0.94); display: flex; flex-direction: column; animation: fade 0.15s ease; color: #fff; }
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); }
.lb-top .idx { font-size: 14px; color: rgba(255, 255, 255, 0.75); }
.lb-top .acts { display: flex; gap: 6px; align-items: center; }
.lb-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; font-size: 13px; color: #fff; background: rgba(255, 255, 255, 0.12); }
.lb-btn:hover { background: rgba(255, 255, 255, 0.22); }
.lb-btn.danger:hover { background: var(--danger); }
.lb-btn.round { width: 38px; padding: 0; justify-content: center; }
.lb-btn[disabled] { opacity: 0.55; pointer-events: none; }
.lb-stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; padding: 8px 64px 24px; touch-action: pan-y; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #111; }
.lb-nav { position: absolute; top: 50%; width: 46px; height: 46px; margin-top: -23px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; display: flex; align-items: center; justify-content: center; }
.lb-nav:hover { background: rgba(255, 255, 255, 0.24); }
.lb-nav.prev { left: 12px; }
.lb-nav.next { right: 12px; }
.lb-nav[disabled] { opacity: 0.25; pointer-events: none; }
.lb-note { text-align: center; font-size: 12px; color: rgba(255, 255, 255, 0.5); padding: 0 16px calc(14px + env(safe-area-inset-bottom)); }

/* 提示条 */
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 200; transform: translate(-50%, 16px);
  max-width: min(92vw, 420px); padding: 11px 18px; border-radius: 999px;
  background: rgba(9, 9, 11, 0.92); color: #fff; font-size: 14px; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }

/* ── 手机 ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; min-height: 100vh; }
  .auth-aside { display: none; }
  .auth-main { align-items: flex-start; padding: 28px 22px 40px; padding-top: calc(28px + env(safe-area-inset-top)); }
  .auth-card { max-width: 440px; margin: 0 auto; }
  .auth-mobile-brand { display: block; margin-bottom: 36px; }
  .auth-mobile-brand .wordmark { font-size: 20px; }
  .brand-layout, .acct-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  :root { --topbar-h: 52px; }
  body { font-size: 15px; }
  .topbar-inner { padding: 0 16px; gap: 12px; }
  .topbar .wordmark { font-size: 18px; }
  .nav { display: none; }
  .avatar-btn { padding: 2px; }
  .avatar-btn .name, .avatar-btn .caret { display: none; }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--ink-3); }
  .tabbar a .ic { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--primary); font-weight: 600; }

  .page { padding: 18px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px); }
  .page-head { margin-bottom: 14px; }
  .page-head h1, .detail-head h1 { font-size: 20px; }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 19px; }

  /* 列表在手机上是「左图右字」的行，一屏能看到更多场 */
  .live-grid { grid-template-columns: 1fr; gap: 10px; }
  .live-card { display: flex; align-items: stretch; }
  .live-card:hover { transform: none; box-shadow: none; }
  .live-cover { width: 108px; flex: none; }
  .live-cover::before { padding-top: 100%; }
  .live-cover .badge { display: none; }
  .live-body { flex: 1; min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
  .live-body .badge.inline { display: inline-flex; align-self: flex-start; }
  .live-meta { margin-top: 0; }

  .detail-head { gap: 12px; margin-bottom: 14px; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1; }
  .linkbox { padding: 14px; gap: 12px; }
  .linkbox .acts { width: 100%; }
  .linkbox .acts .btn { flex: 1; padding: 0 10px; }

  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .tile { border-radius: 4px; }
  .tile .del { display: none; }
  .selectbar { position: fixed; top: auto; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px); margin: 0; z-index: 45; }

  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .share-acts .btn { flex: 1 1 40%; }

  /* 弹窗在手机上从底部升起，按钮在拇指够得着的地方 */
  .mask { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); animation: rise 0.22s ease; max-height: 88vh; }
  .modal .foot { flex-direction: column-reverse; }
  .modal .foot .btn { width: 100%; min-height: 48px; font-size: 16px; }
  .modal.qr { text-align: center; }
  .menu { width: 100%; border-radius: 20px 20px 0 0; border: 0; padding-bottom: env(safe-area-inset-bottom); animation: rise 0.22s ease; }
  .menu-item { min-height: 50px; font-size: 16px; }
  .popover { position: static; animation: none; width: 100%; }
  .mask.clear { background: rgba(9, 9, 11, 0.42); }
  @keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

  .lb-stage { padding: 4px 0 12px; }
  .lb-nav { display: none; }
  .lb-btn span { display: none; }
  .lb-btn { width: 40px; padding: 0; justify-content: center; }
  .lb-btn.keep-text { width: auto; padding: 0 14px; }
  .lb-btn.keep-text span { display: inline; }
  .toast { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px); }
}

@media (min-width: 761px) {
  .live-body .badge.inline { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
