/* ============================================================
   Ship 视频站 · 前台样式
   深色为默认主题，浅色通过 html[data-theme="light"] 覆盖变量
   ============================================================ */

:root {
    --bg:          #0d1117;
    --bg-soft:     #131922;
    --bg-card:     #161d27;
    --bg-hover:    #1c2432;
    --border:      #232c3a;
    --border-soft: #1c2430;
    --text:        #e3e8ef;
    --text-sub:    #8d97a8;
    --text-dim:    #6b7484;
    --primary:     #3b82f6;
    --primary-dim: #2563eb;
    --gold:        #f5a524;
    --gold-soft:   rgba(245, 165, 36, .14);
    --danger:      #ef4444;
    --success:     #22c55e;
    --shadow:      0 8px 28px rgba(0, 0, 0, .45);
    --radius:      12px;
    --radius-sm:   8px;
    --header-h:    62px;
    --tabbar-h:    54px;
    --maxw:        1440px;
}

html[data-theme="light"] {
    --bg:          #f6f8fb;
    --bg-soft:     #ffffff;
    --bg-card:     #ffffff;
    --bg-hover:    #eef2f7;
    --border:      #e2e8f0;
    --border-soft: #edf1f6;
    --text:        #1a2231;
    --text-sub:    #5b6675;
    --text-dim:    #8b95a5;
    --shadow:      0 6px 24px rgba(15, 30, 60, .1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background-color .25s, color .25s;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ---------------- 通用容器 ---------------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.stack { display: flex; flex-direction: column; gap: 26px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.muted { color: var(--text-sub); }
.dim { color: var(--text-dim); font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------------- 顶部导航 ---------------- */
.header {
    position: sticky; top: 0; z-index: 60;
    height: var(--header-h);
    background: color-mix(in srgb, var(--bg-soft) 92%, transparent);
    backdrop-filter: saturate(150%) blur(14px);
    border-bottom: 1px solid var(--border);
}
@supports not (backdrop-filter: blur(1px)) {
    .header { background: var(--bg-soft); }
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 20px; }

.logo { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 700; letter-spacing: .3px; flex-shrink: 0; }
.logo img { height: 30px; width: auto; border-radius: 6px; }
.logo-mark {
    width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    display: grid; place-items: center; color: #fff; font-size: 15px;
}

/* 导航 + 二级下拉 */
.nav { display: flex; align-items: center; gap: 2px; height: 100%; overflow: visible; }
.nav-item { position: relative; height: 100%; display: flex; align-items: center; }
.nav-link {
    padding: 7px 13px; border-radius: var(--radius-sm); font-size: 14.5px;
    color: var(--text-sub); transition: color .15s, background-color .15s; white-space: nowrap;
}
.nav-item:hover .nav-link, .nav-link.active { color: var(--text); background: var(--bg-hover); }
.nav-link.active { color: var(--primary); }

.dropdown {
    position: absolute; top: calc(100% - 8px); left: 0; min-width: 190px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 7px; opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .16s, transform .16s, visibility .16s;
}
.nav-item:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 8px 11px; border-radius: 7px; font-size: 14px; color: var(--text-sub);
}
.dropdown a:hover { background: var(--bg-hover); color: var(--text); }
.dropdown a .cnt { font-size: 12px; color: var(--text-dim); }

/* 搜索框 */
.search { position: relative; flex: 1; max-width: 340px; }
.search input {
    width: 100%; height: 38px; padding: 0 38px 0 14px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 19px;
    color: var(--text); outline: none; transition: border-color .15s, background-color .15s;
}
.search input:focus { border-color: var(--primary); background: var(--bg-soft); }
.search button {
    position: absolute; right: 4px; top: 4px; width: 30px; height: 30px;
    border: 0; border-radius: 50%; background: transparent; color: var(--text-sub); cursor: pointer;
}
.search button:hover { color: var(--primary); }

/* 头部右侧 */
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.icon-btn {
    width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 50%;
    background: transparent; color: var(--text-sub); cursor: pointer;
    display: grid; place-items: center; transition: all .15s; font-size: 16px;
}
.icon-btn:hover { color: var(--text); border-color: var(--text-dim); background: var(--bg-hover); }

.coin-chip {
    display: flex; align-items: center; gap: 5px; height: 34px; padding: 0 13px;
    background: var(--gold-soft); border: 1px solid rgba(245,165,36,.3);
    border-radius: 17px; color: var(--gold); font-size: 13.5px; font-weight: 600;
}

.avatar {
    width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
    border: 1px solid var(--border); background: var(--bg-hover);
    display: grid; place-items: center; font-size: 14px; color: var(--text-sub); font-weight: 600;
}
.user-menu { position: relative; }
.user-panel {
    position: absolute; right: 0; top: calc(100% + 10px); width: 210px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 7px; z-index: 70;
}
.user-panel a, .user-panel button {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 9px 11px; border: 0; border-radius: 7px; background: transparent;
    color: var(--text-sub); font-size: 14px; cursor: pointer; text-align: left;
}
.user-panel a:hover, .user-panel button:hover { background: var(--bg-hover); color: var(--text); }
.user-panel .sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* 移动端菜单按钮 */
.burger { display: none; }

/* ---------------- 底部标签栏（仅手机） ---------------- */
.tabbar { display: none; }
@media (max-width: 780px) {
    .tabbar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
        display: grid; grid-template-columns: repeat(5, 1fr);
        height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: color-mix(in srgb, var(--bg-soft) 94%, transparent);
        backdrop-filter: saturate(150%) blur(14px);
        border-top: 1px solid var(--border);
    }
    /* 后台关掉短视频后少一格，改成 4 列平分，别留空位 */
    .tabbar.no-shorts { grid-template-columns: repeat(4, 1fr); }
    @supports not (backdrop-filter: blur(1px)) {
        .tabbar { background: var(--bg-soft); }
    }
    .tabbar button, .tabbar a {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        height: var(--tabbar-h); border: 0; background: transparent; cursor: pointer;
        color: var(--text-dim); font-size: 10.5px; line-height: 1;
        -webkit-tap-highlight-color: transparent;
    }
    .tabbar .ico { font-size: 19px; line-height: 1; }
    .tabbar .on { color: var(--primary); }

    /* 中间的短视频入口：凸起圆钮，视觉上比其余四格高一级 */
    .tabbar .fab { justify-content: flex-start; padding-top: 4px; }
    .tabbar .fab .ico {
        display: grid; place-items: center;
        width: 46px; height: 46px; margin-top: -16px;
        border-radius: 50%; font-size: 21px; color: #fff;
        background: linear-gradient(135deg, var(--primary), #8b5cf6);
        box-shadow: 0 6px 16px rgba(59, 130, 246, .42);
        border: 3px solid var(--bg-soft);
    }
    .tabbar .fab.on .ico { filter: brightness(1.12); }
    .tabbar .fab span:last-child { margin-top: 2px; }
}

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 38px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius-sm);
    background: var(--primary); color: #fff; font-size: 14.5px; font-weight: 500;
    cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--primary-dim); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text-sub); }
.btn.ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); border-color: var(--text-dim); }
.btn.gold { background: linear-gradient(135deg, #f5a524, #f59e0b); color: #241a06; font-weight: 600; }
.btn.gold:hover:not(:disabled) { filter: brightness(1.08); background: linear-gradient(135deg, #f5a524, #f59e0b); }
.btn.danger { background: var(--danger); }
.btn.sm { height: 32px; padding: 0 13px; font-size: 13.5px; }
.btn.lg { height: 46px; padding: 0 28px; font-size: 15.5px; }
.btn.block { width: 100%; }
.btn.active { background: var(--primary); color: #fff; border-color: transparent; }

/* ---------------- 区块标题 ---------------- */
.section-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 16px; }
.section-head h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: .2px; }
.section-head .sub { color: var(--text-dim); font-size: 13px; padding-bottom: 2px; }
.section-head .more { margin-left: auto; color: var(--text-sub); font-size: 13.5px; }
.section-head .more:hover { color: var(--primary); }

/* ---------------- 视频卡片网格 ---------------- */
.grid {
    display: grid; gap: 20px 18px;
    grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
}
.grid.dense { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 14px; }

.card { display: block; border-radius: var(--radius); overflow: hidden; }
.card-thumb {
    position: relative; aspect-ratio: 16/9; border-radius: var(--radius);
    overflow: hidden; background: var(--bg-card); border: 1px solid var(--border-soft);
}
.card-thumb img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .38s cubic-bezier(.22,.8,.3,1);
}
.card:hover .card-thumb img { transform: scale(1.06); }
.card-thumb .ph {
    width: 100%; height: 100%; display: grid; place-items: center;
    color: var(--text-dim); font-size: 26px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-hover));
}
.card-thumb::after {
    content: ''; position: absolute; inset: 0; opacity: 0;
    background: linear-gradient(to top, rgba(0,0,0,.55), transparent 55%);
    transition: opacity .25s;
}
.card:hover .card-thumb::after { opacity: 1; }

.badge {
    position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
    backdrop-filter: blur(4px);
}
.badge.time { right: 7px; bottom: 7px; background: rgba(0,0,0,.72); color: #fff; font-variant-numeric: tabular-nums; }
.badge.coin { left: 7px; top: 7px; background: linear-gradient(135deg, #f5a524, #f59e0b); color: #241a06; }
.badge.free { left: 7px; top: 7px; background: rgba(34,197,94,.9); color: #fff; }
.badge.unlocked { left: 7px; top: 7px; background: rgba(59,130,246,.92); color: #fff; }

.card-play {
    position: absolute; inset: 0; z-index: 1; display: grid; place-items: center;
    opacity: 0; transition: opacity .22s;
}
.card:hover .card-play { opacity: 1; }
.card-play span {
    width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.92);
    color: #111; display: grid; place-items: center; font-size: 17px; padding-left: 3px;
    box-shadow: 0 4px 16px rgba(0,0,0,.35);
}

.card-body { padding: 10px 2px 0; }
.card-title {
    font-size: 14.5px; line-height: 1.45; font-weight: 500; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; min-height: 42px; transition: color .15s;
}
.card:hover .card-title { color: var(--primary); }
.card-meta { display: flex; align-items: center; gap: 10px; margin-top: 5px; font-size: 12.5px; color: var(--text-dim); }
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }

/* ---------------- 筛选栏 ---------------- */
.filters {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 14px 16px; background: var(--bg-card);
    border: 1px solid var(--border-soft); border-radius: var(--radius);
}
.filters .label { font-size: 13px; color: var(--text-dim); margin-right: 2px; }
.chip {
    padding: 6px 14px; border-radius: 16px; font-size: 13.5px; color: var(--text-sub);
    background: transparent; border: 1px solid transparent; cursor: pointer; transition: all .15s;
}
.chip:hover { color: var(--text); background: var(--bg-hover); }
.chip.on { background: var(--primary); color: #fff; }
.filters .divider { width: 1px; height: 18px; background: var(--border); margin: 0 6px; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 34px; flex-wrap: wrap; }
.pager button {
    min-width: 36px; height: 36px; padding: 0 11px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: transparent; color: var(--text-sub);
    cursor: pointer; transition: all .15s; font-variant-numeric: tabular-nums;
}
.pager button:hover:not(:disabled):not(.on) { background: var(--bg-hover); color: var(--text); }
.pager button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:disabled { opacity: .35; cursor: not-allowed; }
.pager .info { color: var(--text-dim); font-size: 13px; margin: 0 8px; }

/* ---------------- 广告位 ----------------
   注意：没有有效广告时，Vue 端用 v-if 完全不渲染，
   这些类不会产生任何占位高度。                          */
.ad-banner { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-soft); }
.ad-banner img { width: 100%; height: auto; object-fit: cover; }
.ad-tag {
    position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 4px;
    background: rgba(0,0,0,.55); color: rgba(255,255,255,.75); font-size: 11px; letter-spacing: .5px;
}
.ad-wrap { position: relative; }
.ad-side { display: flex; flex-direction: column; gap: 12px; }

/* 播放前贴片 */
.preroll { position: absolute; inset: 0; z-index: 30; background: #000; display: grid; place-items: center; }
.preroll img { width: 100%; height: 100%; object-fit: contain; }
.preroll-skip {
    position: absolute; right: 16px; bottom: 16px; padding: 8px 16px; border-radius: 20px;
    background: rgba(0,0,0,.65); border: 1px solid rgba(255,255,255,.3); color: #fff;
    font-size: 13.5px; cursor: pointer; backdrop-filter: blur(4px);
}
.preroll-skip:disabled { cursor: default; opacity: .8; }

/* ---------------- 播放器 ---------------- */
.player-shell {
    position: relative; width: 100%; aspect-ratio: 16/9; background: #000;
    border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
}
.player-shell video { width: 100%; height: 100%; display: block; background: #000; }

.player-extra {
    position: absolute; right: 12px; top: 12px; z-index: 20; display: flex; gap: 8px;
    opacity: 0; transition: opacity .2s;
}
.player-shell:hover .player-extra, .player-extra.pinned { opacity: 1; }
/* 触屏设备没有 hover，控制按钮必须常驻，否则等于没有入口 */
@media (hover: none), (pointer: coarse) {
    .player-extra { opacity: 1; }
}
.pbtn {
    height: 30px; padding: 0 11px; border-radius: 15px; border: 1px solid rgba(255,255,255,.22);
    background: rgba(0,0,0,.55); color: #fff; font-size: 12.5px; cursor: pointer;
    backdrop-filter: blur(6px); display: inline-flex; align-items: center; gap: 5px;
}
.pbtn:hover { background: rgba(0,0,0,.75); }
.pmenu {
    position: absolute; right: 0; top: 36px; min-width: 118px; padding: 6px;
    background: rgba(18,22,30,.96); border: 1px solid rgba(255,255,255,.14);
    border-radius: 10px; backdrop-filter: blur(10px);
}
.pmenu button {
    display: block; width: 100%; padding: 7px 11px; border: 0; border-radius: 6px;
    background: transparent; color: rgba(255,255,255,.8); font-size: 13px; text-align: left; cursor: pointer;
}
.pmenu button:hover { background: rgba(255,255,255,.1); color: #fff; }
.pmenu button.on { color: var(--primary); font-weight: 600; }

/* ---- 全屏 ---- */
.pbtn.fs { padding: 0 12px; }
.pbtn.fs span:first-child { font-size: 14px; line-height: 1; }

/* 原生全屏：外壳铺满，去掉圆角与边框 */
.player-shell:fullscreen,
.player-shell:-webkit-full-screen {
    width: 100vw; height: 100vh; aspect-ratio: auto;
    border: 0; border-radius: 0; background: #000;
}
.player-shell:fullscreen video,
.player-shell:-webkit-full-screen video { object-fit: contain; }

/* 兜底伪全屏：浏览器不支持全屏 API 时用定位铺满视口 */
.player-shell.pseudo-fs {
    position: fixed; inset: 0; z-index: 9999;
    width: 100vw; height: 100vh; aspect-ratio: auto;
    border: 0; border-radius: 0; background: #000;
}
.player-shell.pseudo-fs video { object-fit: contain; }
html.pseudo-fs-lock, html.pseudo-fs-lock body { overflow: hidden; }
/* 伪全屏时底部导航必须让位 */
html.pseudo-fs-lock .tabbar { display: none; }

/* 锁定遮罩 */
.lock-overlay {
    position: absolute; inset: 0; z-index: 25; display: grid; place-items: center;
    background-size: cover; background-position: center;
}
.lock-overlay::before { content: ''; position: absolute; inset: 0; background: rgba(6,10,16,.82); backdrop-filter: blur(10px); }
.lock-box { position: relative; z-index: 2; text-align: center; padding: 30px 24px; max-width: 460px; }
.lock-icon {
    width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 50%;
    background: var(--gold-soft); border: 1px solid rgba(245,165,36,.35);
    display: grid; place-items: center; font-size: 26px;
}
.lock-box h3 { margin: 0 0 8px; font-size: 19px; color: #fff; }
.lock-box p { margin: 0 0 18px; color: rgba(255,255,255,.62); font-size: 14px; }
.lock-price {
    display: inline-flex; align-items: center; gap: 7px; margin-bottom: 18px;
    padding: 8px 18px; border-radius: 22px; background: var(--gold-soft);
    border: 1px solid rgba(245,165,36,.35); color: var(--gold); font-size: 18px; font-weight: 700;
}
.lock-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lock-balance { margin-top: 14px; font-size: 13px; color: rgba(255,255,255,.5); }

/* ---------------- 详情页布局 ---------------- */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; align-items: start; }
.detail-main { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.detail-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: calc(var(--header-h) + 20px); }

.video-head h1 { margin: 0 0 12px; font-size: 22px; line-height: 1.4; font-weight: 650; }
.video-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; color: var(--text-dim); font-size: 13.5px; }
.video-actions { display: flex; gap: 10px; margin-left: auto; }
.act-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
    border: 1px solid var(--border); border-radius: 17px; background: transparent;
    color: var(--text-sub); font-size: 13.5px; cursor: pointer; transition: all .15s;
}
.act-btn:hover { background: var(--bg-hover); color: var(--text); }
.act-btn.on { color: var(--primary); border-color: var(--primary); background: rgba(59,130,246,.1); }

.panel { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px 20px; }
.panel-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.desc { color: var(--text-sub); font-size: 14.5px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    padding: 4px 12px; border-radius: 14px; background: var(--bg-hover);
    color: var(--text-sub); font-size: 12.5px; transition: all .15s;
}
a.tag:hover { background: var(--primary); color: #fff; }

.side-list { display: flex; flex-direction: column; gap: 12px; }
.side-item { display: flex; gap: 11px; }
.side-item .thumb {
    width: 132px; flex-shrink: 0; aspect-ratio: 16/9; border-radius: var(--radius-sm);
    overflow: hidden; background: var(--bg-hover); position: relative;
}
.side-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-item .meta { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.side-item .t {
    font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.side-item:hover .t { color: var(--primary); }

/* ---------------- 表单 / 认证页 ---------------- */
.auth-wrap { max-width: 430px; margin: 60px auto; }
.auth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 34px 32px; box-shadow: var(--shadow); }
.auth-card h1 { margin: 0 0 6px; font-size: 23px; }
.auth-card .lead { margin: 0 0 26px; color: var(--text-dim); font-size: 14px; }

.field { margin-bottom: 17px; }
.field > label { display: block; margin-bottom: 7px; font-size: 13.5px; color: var(--text-sub); }
.input, textarea.input, select.input {
    width: 100%; height: 42px; padding: 0 14px; background: var(--bg);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); outline: none; transition: border-color .15s;
}
textarea.input { height: auto; min-height: 96px; padding: 11px 14px; resize: vertical; line-height: 1.7; }
.input:focus { border-color: var(--primary); }
.input.error { border-color: var(--danger); }
.field-msg { margin-top: 6px; font-size: 12.5px; min-height: 17px; }
.field-msg.err { color: var(--danger); }
.field-msg.ok { color: var(--success); }

.strength { display: flex; gap: 4px; margin-top: 7px; }
.strength i { flex: 1; height: 3px; border-radius: 2px; background: var(--border); transition: background-color .2s; }
.strength.s1 i:nth-child(1) { background: var(--danger); }
.strength.s2 i:nth-child(-n+2) { background: var(--gold); }
.strength.s3 i { background: var(--success); }

.checkline { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-sub); cursor: pointer; }
.auth-foot { margin-top: 20px; text-align: center; font-size: 13.5px; color: var(--text-dim); }
.auth-foot a { color: var(--primary); }

/* ---------------- 用户中心 ---------------- */
.uc-layout { display: grid; grid-template-columns: 226px minmax(0, 1fr); gap: 24px; align-items: start; }
.uc-side { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 20px 16px; position: sticky; top: calc(var(--header-h) + 20px); }
.uc-profile { text-align: center; padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.uc-profile .avatar { width: 66px; height: 66px; margin: 0 auto 11px; font-size: 24px; }
.uc-profile .name { font-size: 16px; font-weight: 600; }
.uc-profile .coins { margin-top: 9px; display: inline-flex; }
.uc-nav { display: flex; flex-direction: column; gap: 2px; }
.uc-nav button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 13px;
    border: 0; border-radius: var(--radius-sm); background: transparent;
    color: var(--text-sub); font-size: 14.5px; cursor: pointer; text-align: left; transition: all .15s;
}
.uc-nav button:hover { background: var(--bg-hover); color: var(--text); }
.uc-nav button.on { background: var(--primary); color: #fff; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.stat {
    background: var(--bg-card); border: 1px solid var(--border-soft);
    border-radius: var(--radius); padding: 17px 18px;
}
.stat .k { font-size: 12.5px; color: var(--text-dim); }
.stat .v { font-size: 25px; font-weight: 700; margin-top: 5px; font-variant-numeric: tabular-nums; }
.stat .v.gold { color: var(--gold); }

.list-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.list-table th {
    text-align: left; padding: 11px 12px; font-weight: 500; font-size: 13px;
    color: var(--text-dim); border-bottom: 1px solid var(--border);
}
.list-table td { padding: 13px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.list-table tr:last-child td { border-bottom: 0; }
.amount-in { color: var(--success); font-weight: 600; }
.amount-out { color: var(--danger); font-weight: 600; }

/* 签到 */
.signin-card {
    background: linear-gradient(135deg, rgba(245,165,36,.13), rgba(139,92,246,.1));
    border: 1px solid rgba(245,165,36,.28); border-radius: var(--radius); padding: 26px;
    display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.signin-card .big { font-size: 40px; }
.signin-info { flex: 1; min-width: 200px; }
.signin-info h3 { margin: 0 0 5px; font-size: 18px; }
.signin-rules { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.rule-pill {
    padding: 8px 15px; border-radius: 10px; background: var(--bg-card);
    border: 1px solid var(--border); font-size: 13px; text-align: center;
}
.rule-pill.hit { border-color: var(--gold); color: var(--gold); }
.rule-pill b { display: block; font-size: 15px; margin-top: 2px; }

/* ---------------- 状态：加载 / 空 ---------------- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 37%, var(--bg-card) 63%);
    background-size: 400% 100%; animation: shine 1.3s ease-in-out infinite; border-radius: var(--radius);
}
@keyframes shine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk-thumb { aspect-ratio: 16/9; }
.sk-line { height: 13px; margin-top: 9px; border-radius: 4px; }
.sk-line.short { width: 55%; }

.empty { padding: 70px 20px; text-align: center; color: var(--text-dim); }
.empty .ico { font-size: 44px; margin-bottom: 12px; opacity: .5; }
.empty p { margin: 0 0 4px; font-size: 15px; }

.loading-bar {
    position: fixed; top: 0; left: 0; height: 2px; background: var(--primary);
    z-index: 999; transition: width .25s ease-out; box-shadow: 0 0 8px var(--primary);
}

/* ---------------- 提示 / 弹窗 ---------------- */
.toasts { position: fixed; top: 76px; right: 22px; z-index: 900; display: flex; flex-direction: column; gap: 10px; }
.toast {
    min-width: 230px; max-width: 380px; padding: 12px 16px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1px solid var(--border); box-shadow: var(--shadow);
    font-size: 14px; display: flex; align-items: flex-start; gap: 9px;
    animation: toastIn .25s cubic-bezier(.2,.9,.3,1);
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--primary); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

.modal-mask {
    position: fixed; inset: 0; z-index: 800; background: rgba(3,6,12,.7);
    display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px);
    animation: fadeIn .18s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
    width: 100%; max-width: 420px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
    animation: modalIn .22s cubic-bezier(.2,.9,.3,1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { padding: 20px 22px 0; font-size: 17px; font-weight: 600; }
.modal-body { padding: 14px 22px 20px; color: var(--text-sub); font-size: 14.5px; line-height: 1.7; }
.modal-foot { padding: 0 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }

/* ---------------- 页脚 ---------------- */
.footer {
    margin-top: 60px; padding: 30px 0; border-top: 1px solid var(--border);
    color: var(--text-dim); font-size: 13px; text-align: center;
}
.footer a:hover { color: var(--primary); }
.footer .line + .line { margin-top: 6px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1100px) {
    .detail-layout { grid-template-columns: 1fr; }
    .detail-side { position: static; }
}
@media (max-width: 900px) {
    .uc-layout { grid-template-columns: 1fr; }
    .uc-side { position: static; }
    .uc-nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
    .uc-nav button { white-space: nowrap; }
    .uc-profile { display: flex; align-items: center; gap: 14px; text-align: left; }
    .uc-profile .avatar { margin: 0; width: 52px; height: 52px; }
}
@media (max-width: 780px) {
    .container { padding: 0 14px; }
    .nav, .search { display: none; }
    /* 导航改到底部标签栏，头部不再需要汉堡按钮 */
    .burger { display: none; }
    /* 页脚让出底部标签栏的高度（body 是 height:100%，padding 加在它上面不生效） */
    .footer { padding-bottom: calc(30px + var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
    .grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 16px 12px; }
    .card-title { font-size: 13.5px; min-height: 39px; }
    .video-head h1 { font-size: 18px; }
    .video-actions { margin-left: 0; width: 100%; }
    .toasts {
        top: auto; right: 14px; left: 14px;
        bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px);
    }
    .toast { max-width: none; }
    .mobile-nav {
        position: fixed; z-index: 55; background: var(--bg);
        top: var(--header-h); left: 0; right: 0;
        bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
        overflow-y: auto; padding: 18px 16px 40px;
    }
    .mobile-nav .search { display: block; max-width: none; margin-bottom: 18px; }
    .mobile-nav .grp { margin-bottom: 20px; }
    .mobile-nav .grp > a { display: block; font-size: 16px; font-weight: 600; margin-bottom: 9px; }
    .mobile-nav .subs { display: flex; flex-wrap: wrap; gap: 8px; }
    .mobile-nav .subs a { padding: 6px 13px; border-radius: 15px; background: var(--bg-card); font-size: 13.5px; color: var(--text-sub); }
}
@media (min-width: 781px) { .mobile-nav { display: none; } }

/* ============================================================
   短视频（竖屏沉浸流）
   只在手机端出现，入口是底部标签栏中间的凸起按钮
   ============================================================ */
.shorts {
    position: fixed; inset: 0; z-index: 60;
    background: #000; color: #fff;
    overscroll-behavior: none;
}

.shorts-feed {
    height: 100%;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.shorts-feed::-webkit-scrollbar { display: none; }

.short-item {
    position: relative;
    /* dvh 会随地址栏收起而变化，正好避免 iOS 上「差一截」的经典问题 */
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
}

.short-item video,
.short-item .short-poster {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    background: #000;
}
/* 未进入视口的条目只放封面，绝不挂 video 元素（否则一屏并发下载必卡） */
.short-poster { filter: brightness(.9); }

/* 上下渐变，保证白字在任何画面上都读得清 */
.short-item::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
    background: linear-gradient(to top, rgba(0,0,0,.72), transparent);
    pointer-events: none;
}

/* 点击区域：整屏都能点，用于暂停/继续 */
.short-tap { position: absolute; inset: 0; z-index: 1; }

.short-play-hint {
    position: absolute; inset: 0; z-index: 2;
    display: grid; place-items: center;
    font-size: 58px; color: rgba(255,255,255,.86);
    text-shadow: 0 2px 14px rgba(0,0,0,.5);
    pointer-events: none;
}

/* 缓冲中：跟「黑屏卡死」区分开，用户才知道是在等数据还是真出错了 */
.short-buffering {
    position: absolute; top: 50%; left: 50%; z-index: 2;
    width: 38px; height: 38px; margin: -19px 0 0 -19px;
    border: 3px solid rgba(255, 255, 255, .22); border-top-color: #fff;
    border-radius: 50%; animation: shortspin .8s linear infinite;
    pointer-events: none;
}
@keyframes shortspin { to { transform: rotate(360deg); } }

/* 播放失败：给一层可重试的提示，别让用户只对着黑屏 */
.short-error {
    position: absolute; inset: 0; z-index: 4;
    display: grid; place-items: center; text-align: center; padding: 30px;
    background: rgba(0, 0, 0, .72);
}
.short-error .ico { font-size: 40px; margin-bottom: 12px; }
.short-error p {
    margin: 0 0 18px; font-size: 14px; line-height: 1.6;
    color: rgba(255, 255, 255, .82);
}

/* 右侧竖排操作条 */
.short-side {
    position: absolute; right: 10px; z-index: 3;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 22px);
    display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.short-side button {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    border: 0; background: transparent; cursor: pointer;
    color: #fff; font-size: 11.5px; line-height: 1;
    -webkit-tap-highlight-color: transparent;
    text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.short-side .ico { font-size: 28px; line-height: 1; }
.short-side .on { color: var(--primary); }
.short-side .liked { color: #f43f5e; }

/* 底部标题与标签 */
.short-meta {
    position: absolute; left: 14px; z-index: 3;
    right: 74px;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 18px);
    text-shadow: 0 1px 8px rgba(0,0,0,.7);
}
.short-meta h3 {
    margin: 0 0 6px; font-size: 15.5px; font-weight: 600; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.short-meta .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.short-meta .tags span { font-size: 12.5px; color: rgba(255,255,255,.78); }
.short-meta .stat { margin-top: 6px; font-size: 12px; color: rgba(255,255,255,.6); }

/* 付费未解锁：整屏遮罩 */
.short-lock {
    position: absolute; inset: 0; z-index: 4;
    display: grid; place-items: center; text-align: center; padding: 30px;
    background: rgba(0,0,0,.66); backdrop-filter: blur(6px);
}
.short-lock .ico { font-size: 44px; margin-bottom: 12px; }
.short-lock p { margin: 0 0 6px; font-size: 15px; }
.short-lock .sub { font-size: 13px; color: rgba(255,255,255,.66); margin-bottom: 18px; }

/* 顶部返回 */
.short-back {
    position: absolute; z-index: 5;
    top: calc(env(safe-area-inset-top, 0px) + 12px); left: 12px;
    width: 36px; height: 36px; border: 0; border-radius: 50%;
    background: rgba(0,0,0,.38); color: #fff; font-size: 18px; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* 静音提示：首次进入必须静音才能自动播放 */
.short-sound {
    position: absolute; z-index: 5;
    top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px;
    height: 36px; padding: 0 14px; border: 0; border-radius: 18px;
    background: rgba(0,0,0,.38); color: #fff; font-size: 13px; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.short-empty {
    height: 100vh; height: 100dvh;
    display: grid; place-items: center; text-align: center; padding: 30px;
    color: rgba(255,255,255,.7); font-size: 14.5px;
}
/* 短视频页永远是黑底，浅色主题下 ghost 按钮的深色字会糊成一团，这里单独兜住 */
.shorts .btn.ghost { border-color: rgba(255, 255, 255, .34); color: #fff; }
.shorts .btn.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .12); color: #fff; }
/* 触底提示：feed 是 mandatory 吸附，塞在最后一条之后的元素会被吸回去看不见，
   所以这里做成悬浮在标签栏之上的一条字 */
.short-end {
    position: absolute; left: 0; right: 0; z-index: 3;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 2px);
    text-align: center; color: rgba(255,255,255,.55); font-size: 12.5px;
    text-shadow: 0 1px 6px rgba(0,0,0,.7);
    pointer-events: none;
}

/* PC 端不提供短视频，手动敲 #/shorts 时给个说明页 */
.shorts-desktop {
    position: fixed; inset: 0; z-index: 60;
    display: grid; place-items: center; text-align: center;
    background: var(--bg); color: var(--text-sub); padding: 30px;
}
.shorts-desktop .ico { font-size: 46px; margin-bottom: 14px; }
.shorts-desktop h2 { margin: 0 0 8px; font-size: 19px; color: var(--text); }
.shorts-desktop p { margin: 0 0 20px; font-size: 14px; }
