/* ==========================================================
   Live 素材站 v2 - 极致美化版
   特性：渐变背景 / 光晕 / 毛玻璃 / 骨架屏 / 虚拟列表 / 美化Toast & Modal
   ========================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-deep: #07070f;
    --bg: #0b0820;
    --bg-soft: #15123a;
    --card: #1e1a42;
    --card-soft: rgba(30,26,66,0.55);
    --primary: #a06bff;      /* 紫罗兰 */
    --primary-2: #ff4fa3;    /* 玫粉 */
    --primary-3: #43d9ff;    /* 青蓝 */
    --accent: #ffd166;
    --text: #f7f4ff;
    --text-soft: #cdc2ff;
    --text-mute: #7d76b0;
    --border: rgba(255,255,255,0.08);
    --border-soft: rgba(160,107,255,0.25);
    --success: #32e39d;
    --danger: #ff5c7c;
    --warning: #ffcf5c;
    --radius-xl: 22px;
    --radius-lg: 16px;
    --radius: 12px;
    --shadow-lg: 0 20px 50px rgba(100,60,200,0.35);
    --shadow: 0 10px 30px rgba(60,30,150,0.35);
}

html, body {
    background: var(--bg-deep);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans",
                 "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 全局背景光晕 */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
    animation: floatGlow 14s ease-in-out infinite alternate;
}
body::before {
    top: -20%; left: -10%;
    width: 50vw; height: 50vw;
    background: radial-gradient(circle, var(--primary), transparent 70%);
}
body::after {
    bottom: -25%; right: -15%;
    width: 55vw; height: 55vw;
    background: radial-gradient(circle, var(--primary-2), transparent 70%);
    animation-delay: -7s;
}
@keyframes floatGlow {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(4vw, -3vh) scale(1.12); }
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ================== 顶部 ================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 8, 30, 0.6);
    backdrop-filter: saturate(200%) blur(18px);
    -webkit-backdrop-filter: saturate(200%) blur(18px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    max-width: 1500px;
    margin: 0 auto;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-2), var(--primary-3));
    background-size: 200% 200%;
    border-radius: 12px;
    font-size: 20px;
    box-shadow: 0 6px 18px rgba(160,107,255,0.5);
    animation: gradShift 6s ease infinite;
}
@keyframes gradShift {
    0%,100% { background-position: 0% 50%; }
    50%     { background-position: 100% 50%; }
}
.logo-text {
    font-size: 19px;
    font-weight: 700;
    background: linear-gradient(90deg, #fff 0%, var(--primary-3) 50%, var(--primary-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 0.6px;
}
.logo-sub {
    display: none;
    font-size: 11px;
    color: var(--text-mute);
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}
.admin-link {
    height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px 0 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(123,67,255,0.22) 0%, rgba(255,107,180,0.22) 100%);
    border: 1px solid rgba(160,107,255,0.45);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(123,67,255,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
    position: relative;
    overflow: hidden;
}
.admin-link::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform .6s;
}
.admin-link:hover {
    transform: translateY(-1px);
    border-color: rgba(255,180,230,0.8);
    box-shadow: 0 4px 20px rgba(160,107,255,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}
.admin-link:hover::before { transform: translateX(120%); }
.admin-link-ico { font-size: 15px; line-height: 1; }
.admin-link-txt { white-space: nowrap; }

/* ================== Hero 横幅 ================== */
.hero {
    max-width: 1500px;
    margin: 0 auto;
    padding: 30px 22px 0;
    position: relative;
    z-index: 1;
}
.hero-inner {
    padding: 26px 28px;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(ellipse at top right, rgba(255,79,163,0.18), transparent 60%),
        radial-gradient(ellipse at bottom left, rgba(67,217,255,0.15), transparent 60%),
        linear-gradient(135deg, rgba(160,107,255,0.14), rgba(30,26,66,0.55));
    border: 1px solid var(--border-soft);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}
.hero-inner::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,79,163,0.4), rgba(67,217,255,0.4) 50%, rgba(160,107,255,0.0));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    opacity: .7;
}
.hero-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #fff, var(--primary-3));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-desc {
    font-size: 14px;
    color: var(--text-soft);
    max-width: 640px;
    line-height: 1.7;
}
.hero-stats {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.hero-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.hero-stat-num {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(90deg, var(--accent), var(--primary-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-stat-lbl {
    font-size: 12px;
    color: var(--text-mute);
}

/* ================== 分类滚动条 ================== */
.category-nav {
    position: sticky;
    top: 66px;
    z-index: 49;
    margin-top: 20px;
    background: rgba(10, 8, 30, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    border-top: 1px solid var(--border);
}
.category-list {
    max-width: 1500px;
    margin: 0 auto;
    padding: 12px 18px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
}
.category-list::-webkit-scrollbar { display: none; }
.cat-btn {
    flex: 0 0 auto;
    padding: 9px 18px;
    border-radius: 999px;
    background: var(--card-soft);
    border: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 14px;
    transition: all .25s ease;
    user-select: none;
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cat-btn .cat-icon { font-size: 15px; filter: grayscale(0.5); transition: filter .2s; }
.cat-btn:hover {
    color: var(--text);
    border-color: var(--border-soft);
    transform: translateY(-1px);
}
.cat-btn:hover .cat-icon { filter: none; }
.cat-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(160,107,255,0.45), inset 0 1px 0 rgba(255,255,255,0.2);
}
.cat-btn.active .cat-icon { filter: none; }

/* ================== 主容器 & 虚拟列表 ================== */
.main-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 28px 20px 120px;
    position: relative;
    z-index: 1;
}

/* 虚拟列表外层：占位撑开滚动高度 */
.virtual-wrap {
    position: relative;
    width: 100%;
}
/* 内容层：只渲染可见卡片，用 absolute 放到每列正确位置 */
.virtual-content {
    position: relative;
    width: 100%;
}

/* 图片卡片（通用容器：绝对定位） */
.img-card {
    position: absolute;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    background: #120e30;
    border: 1px solid var(--border);
    transition: transform .3s cubic-bezier(.2,.7,.2,1),
                box-shadow .3s ease,
                border-color .3s ease;
    will-change: transform;
    animation: cardIn .45s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(18px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.img-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 18px 48px rgba(80,30,180,0.45);
    border-color: rgba(160,107,255,0.6);
    z-index: 5;
}

/* ------- 仅图片卡片（photo-only） 无信息区 无标题 ------- */
.img-card.photo-only {
    padding: 0;
    /* 兜底可见背景：即使骨架屏样式失效，卡片也不会完全透明，避免"全部挤在一列"的视觉错觉 */
    background:
        linear-gradient(135deg, #1e1750 0%, #2d2170 50%, #1a1140 100%);
    border: 1px solid rgba(255,255,255,0.05);
}
/* 图片未加载时，整张卡显示为渐变骨架（保证右侧列占位肉眼可见，不会"消失"）*/
.img-card.photo-only::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background:
        linear-gradient(100deg,
            rgba(60,50,120,0) 18%,
            rgba(140,110,255,0.35) 50%,
            rgba(60,50,120,0) 82%),
        linear-gradient(180deg, #251a68, #170f44);
    background-size: 200% 100%, 100% 100%;
    animation: skelShimmer 1.35s ease-in-out infinite;
    transition: opacity .5s ease;
    opacity: 1;
}
.img-card.loaded.photo-only::before { opacity: 0; }
/* virtual-content 必须占满主容器宽，否则卡片会被挤到窄宽内 */
.virtual-content { width: 100%; display: block; }
.img-card.photo-only .card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .55s ease;
    background: #110d28;
}
.img-card.photo-only .card-img.show { opacity: 1; }

.img-card.photo-only .card-skel {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(100deg,
            rgba(60,50,120,0) 18%,
            rgba(140,110,255,0.35) 50%,
            rgba(60,50,120,0) 82%),
        linear-gradient(180deg, #221a55, #160f3c);
    background-size: 200% 100%, 100% 100%;
    animation: skelShimmer 1.35s ease-in-out infinite;
    transition: opacity .45s ease;
}
.img-card.photo-only .card-skel.hide { opacity: 0; }

/* --- 与 createCard 使用的实际类名对齐：skeleton-img / real-img --- */
.img-card.photo-only .skeleton-img {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(100deg,
            rgba(60,50,120,0) 18%,
            rgba(140,110,255,0.35) 50%,
            rgba(60,50,120,0) 82%),
        linear-gradient(180deg, #221a55, #160f3c);
    background-size: 200% 100%, 100% 100%;
    animation: skelShimmer 1.35s ease-in-out infinite;
    transition: opacity .45s ease;
    z-index: 1;
    border-radius: inherit;
}
.img-card.loaded .skeleton-img { opacity: 0; }

.img-card.photo-only .real-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
    opacity: 0;
    transition: opacity .5s ease;
    background: #110d28;
    z-index: 2;
}
.img-card.loaded .real-img { opacity: 1; }

@keyframes skelShimmer {
    0%   { background-position: 200% 0, 0 0; }
    100% { background-position: -200% 0, 0 0; }
}

/* 极简 LIVE 角标（一个小圆点 + 呼吸），不出现"解析"文字 */
.img-card.photo-only .live-dot {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff, var(--primary-2));
    box-shadow: 0 0 0 3px rgba(255,79,163,0.25),
                0 0 10px rgba(255,79,163,0.9);
    z-index: 3;
    animation: livePulse 1.4s ease-in-out infinite;
}
@keyframes livePulse {
    0%,100% { transform: scale(1);   box-shadow: 0 0 0 3px rgba(255,79,163,0.25), 0 0 10px rgba(255,79,163,.9); }
    50%     { transform: scale(1.2); box-shadow: 0 0 0 5px rgba(255,79,163,0.10), 0 0 16px rgba(255,79,163,1); }
}

/* ---------- 旧素材卡片样式（保留作兼容，但不再使用）---------- */
.card-cover-box {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
    aspect-ratio: 3 / 4;
}
.card-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity .5s ease, transform .6s ease;
    background: #111;
}
.card-cover.loaded {
    opacity: 1;
    transform: scale(1);
}
.img-card:hover .card-cover.loaded {
    transform: scale(1.06);
}

/* 骨架屏（占位时效果） */
.skel-cover {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(100deg,
            rgba(60,50,120,0) 20%,
            rgba(120,90,220,0.4) 50%,
            rgba(60,50,120,0) 80%),
        linear-gradient(180deg, #241f55, #181438);
    background-size: 200% 100%, 100% 100%;
    animation: skelShimmer 1.4s ease-in-out infinite;
}
@keyframes skelShimmer {
    0%   { background-position: 200% 0, 0 0; }
    100% { background-position: -200% 0, 0 0; }
}
.skel-title {
    height: 10px;
    border-radius: 4px;
    background: linear-gradient(90deg, #2b2462, #3b3384, #2b2462);
    background-size: 200% 100%;
    animation: skelShimmer 1.4s infinite;
    margin-bottom: 6px;
}
.skel-title.s2 { width: 60%; height: 8px; margin-bottom: 0; }

.card-info {
    padding: 11px 12px 13px;
    position: relative;
}
.card-title {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-mute);
}
.card-meta .count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(160,107,255,0.12);
    color: var(--text-soft);
}

/* Live 角标 + 其他标签 */
.card-badges {
    position: absolute;
    top: 8px; left: 8px;
    display: flex;
    gap: 6px;
    z-index: 2;
    pointer-events: none;
}
.live-badge {
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-2), #ff8a3c);
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 14px rgba(255,79,163,0.45);
    position: relative;
    overflow: hidden;
}
.live-badge::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #fff;
    animation: pulse 1.2s infinite;
    box-shadow: 0 0 8px #fff;
}
.live-badge::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    animation: shine 2.4s infinite;
}
@keyframes pulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50%     { opacity: .4; transform: scale(.7); }
}
@keyframes shine {
    0%   { left: -100%; }
    60%  { left: 100%; }
    100% { left: 100%; }
}
.parse-badge {
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: rgba(0,0,0,0.55);
    border: 1px solid var(--border);
    backdrop-filter: blur(6px);
}
.parse-badge.ok { background: linear-gradient(135deg, #16a34a, #32e39d); color: #052e16; }
.parse-badge.fail { background: linear-gradient(135deg, #dc2626, #ff5c7c); }
.parse-badge.loading { background: linear-gradient(135deg, #2563eb, var(--primary-3)); }

/* 解析失败蒙层 */
.card-retry {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,92,124,0.2), rgba(0,0,0,0.85));
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    text-align: center;
    z-index: 3;
}
.card-retry .retry-ico { font-size: 32px; }
.card-retry .retry-txt { font-size: 13px; color: #fff; }
.card-retry .retry-btn-sm {
    margin-top: 4px;
    padding: 6px 16px;
    border-radius: 999px;
    background: #fff;
    color: #222;
    font-weight: 600;
    font-size: 12px;
    transition: all .2s;
}
.card-retry .retry-btn-sm:hover {
    transform: translateY(-1px);
    background: var(--primary);
    color: #fff;
}
.img-card.parse-failed .card-retry { display: flex; }

/* ================== 空状态 ================== */
.empty-state {
    padding: 80px 20px;
    text-align: center;
    color: var(--text-mute);
    display: none;
    position: relative;
    z-index: 1;
}
.empty-state.show { display: block; animation: fadeUp .4s ease both; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.empty-icon {
    font-size: 72px;
    margin-bottom: 18px;
    display: inline-block;
    animation: bobble 2.6s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(160,107,255,0.5));
}
@keyframes bobble {
    0%,100% { transform: translateY(0) rotate(-3deg); }
    50%     { transform: translateY(-8px) rotate(3deg); }
}
.empty-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.empty-text { font-size: 14px; }

/* ================== 加载更多 ================== */
.load-more-wrap {
    padding: 30px 0 10px;
    text-align: center;
    position: relative;
    z-index: 1;
}
.btn-load-more {
    padding: 12px 36px;
    border-radius: 999px;
    background: var(--card-soft);
    border: 1px solid var(--border-soft);
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    transition: all .25s;
    position: relative;
    overflow: hidden;
}
.btn-load-more:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(160,107,255,0.45);
}
.btn-load-more:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.no-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-mute);
    font-size: 13px;
}
.no-more::before, .no-more::after {
    content: '';
    width: 40px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-soft));
}
.no-more::after {
    background: linear-gradient(90deg, var(--border-soft), transparent);
}

/* ================== 返回顶部 ================== */
.btn-back-top {
    position: fixed;
    right: 24px;
    bottom: 36px;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(160,107,255,0.5);
    opacity: 0;
    transform: translateY(20px) scale(.9);
    pointer-events: none;
    transition: all .3s cubic-bezier(.2,.7,.2,1);
    z-index: 60;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    animation: breathe 3s ease-in-out infinite;
}
@keyframes breathe {
    0%,100% { box-shadow: 0 8px 24px rgba(160,107,255,0.5); }
    50%     { box-shadow: 0 8px 34px rgba(255,79,163,0.7); }
}
.btn-back-top.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.btn-back-top:hover { transform: translateY(-4px) scale(1.06); }

/* ================== Modal 弹框 v2 ================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 14px;
}
.modal.open { display: flex; }
.modal-mask {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(10,8,30,0.5), rgba(0,0,0,0.92));
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    animation: maskFade .3s ease;
}
@keyframes maskFade { from { opacity: 0; } to { opacity: 1; } }
.modal-inner {
    position: relative;
    width: min(96%, 580px);
    max-height: 96vh;           /* 放宽：让 9:16 视频有更多空间 */
    background:
        radial-gradient(ellipse at top, rgba(160,107,255,0.25), transparent 60%),
        linear-gradient(180deg, #1a1540, #0c0a1f);
    border-radius: 26px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.7), 0 0 0 1px var(--border-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    animation: modalIn .35s cubic-bezier(.2,.7,.2,1);
    z-index: 1;
    padding: 0;
}
.modal-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,79,163,0.6), rgba(67,217,255,0.5) 40%, rgba(160,107,255,0));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    opacity: .55;
    z-index: 3;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(.9) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    z-index: 10;
    display: grid; place-items: center;
    transition: all .25s;
    backdrop-filter: blur(10px);
}
.modal-close:hover {
    transform: rotate(90deg) scale(1.1);
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border-color: transparent;
}

/* 媒体区域 */
.modal-media-wrap {
    position: relative;
    background: #000;
    aspect-ratio: 9 / 16;       /* 竖屏实况图 9:16 完整显示 */
    max-height: 82vh;           /* 从 62vh 提升：不被底部按钮挤占，给笔记本屏留 18vh 给顶部/底部余量 */
    width: auto;                /* 不再被弹框 560px 强行撑宽导致比例锁死后高度超标被裁 */
    max-width: min(560px, 92vw);/* 限制最大宽度，防止横屏时太宽 */
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0;           /* 继承弹框圆角：内部不额外圆角，避免遮掉视频边缘 */
    flex-shrink: 0;             /* 防止被下方 flex 项目压缩高度 */
}
.modal-media {
    width: 100% !important;     /* 强制占满整个 9:16 容器 */
    height: 100% !important;
    max-width: none;
    max-height: none;
    object-fit: contain !important; /* 核心：完整显示，绝不裁剪上下/左右 */
    background: #000;
    display: block;
    margin: 0 auto;
}
/* 加载 spinner（双环） */
.spinner {
    position: absolute;
    width: 50px; height: 50px;
    z-index: 2;
    display: none;
}
.spinner.show { display: block; }
.spinner::before, .spinner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
}
.spinner::before {
    border-top-color: var(--primary);
    border-right-color: var(--primary-2);
    animation: spin 1.1s linear infinite;
}
.spinner::after {
    inset: 8px;
    border-bottom-color: var(--primary-3);
    border-left-color: var(--primary);
    animation: spin .8s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 弹框动作区 — 改为 absolute 浮在视频底部，不再挤占媒体高度，
   保证 9:16 竖屏视频在笔记本屏中也能完整显示不被压缩裁剪 */
.modal-actions {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 34px;            /* 预留 34px 给下方 .download-tip 小字 */
    padding: 60px 20px 10px; /* 顶部 padding 做大，做渐变遮罩，保证按钮可读 */
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    z-index: 5;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.92) 0%,
        rgba(0, 0, 0, 0.78) 28%,
        rgba(0, 0, 0, 0.45) 55%,
        rgba(0, 0, 0, 0.15) 78%,
        transparent 100%
    );
    pointer-events: none;      /* 容器穿透，仅按钮可点 */
}
.modal-actions > * { flex-shrink: 0; pointer-events: auto; }

.download-tip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    padding: 0 18px;
    margin-top: 0;
    min-height: 20px;
    line-height: 20px;
    font-size: 12px;
    text-align: center;
    color: #c8c1e0;
    transition: all .2s;
    z-index: 5;
    text-shadow: 0 1px 3px rgba(0,0,0,.75);
}
.download-tip.success { color: #22d3ee; }
.download-tip.error   { color: var(--danger); }

/* 第二个 .download-tip 规则块在 947 行附近，删除/覆盖避免重复 margin-top */

.btn-play-toggle, .btn-copy-link {
    width: 46px; height: 46px;
    flex-shrink: 0;
    border-radius: 14px;
    background: var(--card-soft);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .25s;
    backdrop-filter: blur(10px);
}
.btn-play-toggle:hover, .btn-copy-link:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: rgba(160,107,255,0.18);
    box-shadow: 0 6px 16px rgba(160,107,255,0.25);
}
.btn-download {
    flex: 1;
    min-width: 0;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2) 60%, var(--primary-3));
    background-size: 200% 200%;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all .25s;
    box-shadow: 0 8px 24px rgba(160,107,255,0.45);
    position: relative;
    overflow: hidden;
}
.btn-download:not(:disabled):hover {
    background-position: 100% 100%;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255,79,163,0.55);
}
.btn-download:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}
.btn-download .btn-ico {
    display: inline-block;
    animation: bobDown 1.4s ease-in-out infinite;
}
@keyframes bobDown {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(3px); }
}
/* （第二个 .download-tip 重复规则已删除，absolute 版本见 869 行上方） */

/* ================== Toast ================== */
.toast-wrap {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    pointer-events: none;
    max-width: calc(100% - 40px);
}
.toast {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    background: rgba(20, 18, 50, 0.85);
    backdrop-filter: blur(18px) saturate(1.8);
    -webkit-backdrop-filter: blur(18px) saturate(1.8);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-18px) scale(.95);
    pointer-events: none;
    transition: all .3s cubic-bezier(.2,.7,.2,1);
    box-shadow: 0 12px 36px rgba(0,0,0,0.45);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.toast-ico {
    width: 22px; height: 22px;
    display: grid; place-items: center;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
}
.toast.success .toast-ico {
    background: linear-gradient(135deg, #22c55e, #32e39d);
    color: #052e16;
    box-shadow: 0 0 10px rgba(50,227,157,0.5);
    animation: tickPop .35s ease;
}
@keyframes tickPop {
    0% { transform: scale(0) rotate(-180deg); }
    70% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0); }
}
.toast.error .toast-ico {
    background: linear-gradient(135deg, var(--danger), #ff9a80);
    color: #450a0a;
    box-shadow: 0 0 10px rgba(255,92,124,0.5);
    animation: shakeX .4s ease;
}
@keyframes shakeX {
    0%,100% { transform: translateX(0); }
    20%,60% { transform: translateX(-4px); }
    40%,80% { transform: translateX(4px); }
}
.toast.info .toast-ico {
    background: linear-gradient(135deg, var(--primary-3), var(--primary));
    color: #0b1020;
    box-shadow: 0 0 10px rgba(67,217,255,0.5);
}
.toast.loading .toast-ico {
    background: var(--card);
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-right-color: var(--primary-2);
    animation: spin .9s linear infinite;
    color: transparent;
}

/* ================== 响应式 ================== */
@media (max-width: 1199.98px) {
    /* 平板：布局自然响应 */
    .hero-title { font-size: 22px; }
}

@media (max-width: 767.98px) {
    body::before { opacity: .25; }
    body::after  { opacity: .25; }
    .header-inner { padding: 12px 14px; }
    .logo-text { font-size: 17px; }
    .logo-icon { width: 34px; height: 34px; font-size: 17px; }
    .admin-link { height: 34px; padding: 0 10px 0 9px; border-radius: 10px; font-size: 12px; gap: 4px; }
    .admin-link-ico { font-size: 13px; }
    .admin-link-txt { display: none; }

    .category-nav { top: 62px; }
    .category-list { padding: 10px 12px; gap: 8px; }
    .cat-btn { padding: 7px 14px; font-size: 13px; }

    .hero { padding: 18px 14px 0; }
    .hero-inner { padding: 18px 18px; border-radius: 18px; }
    .hero-title { font-size: 18px; }
    .hero-desc { font-size: 13px; line-height: 1.6; }
    .hero-stats { gap: 14px; margin-top: 12px; }
    .hero-stat-num { font-size: 18px; }

    .main-container { padding: 18px 10px 120px; }

    .modal-inner {
        width: 100%;
        max-height: 98vh;
        border-radius: 20px;
    }
    /* 手机端：动作栏同样 absolute 浮在视频之上，不挤占高度 */
    .modal-actions {
        gap: 8px;
        padding: 42px 14px 6px;
        bottom: 28px;
    }
    .download-tip { padding: 0 14px; bottom: 6px; font-size: 11px; }
    .btn-play-toggle, .btn-copy-link {
        width: 42px; height: 42px;
        border-radius: 12px;
        font-size: 16px;
    }
    .btn-download { height: 42px; font-size: 14px; border-radius: 12px; }

    /* 手机端竖屏实况：媒体区高度撑满 */
    .modal-media-wrap {
        max-height: 90vh;
        max-width: 96vw;
    }

    .btn-back-top {
        width: 42px; height: 42px;
        right: 14px; bottom: 22px;
        font-size: 18px;
    }
    .toast-wrap { top: 16px; gap: 8px; }
    .toast { padding: 10px 14px; font-size: 13px; border-radius: 12px; }
}

@media (max-width: 380px) {
    .logo-text { letter-spacing: 0.2px; }
    .cat-btn { padding: 6px 11px; font-size: 12px; }
    .hero-title { font-size: 16px; }
}
