/* ===== 重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #e94560;
    --bg: #0a0a0f;
    --bg-card: #14141f;
    --text: #fff;
    --text2: #999;
    --border: #222;
}

html { background: var(--bg); }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: transparent;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ===== 星空背景 ===== */
.page-stars, .stars {
    position: fixed;
    top: 0; left: 0;
    width: 1px; height: 1px;
    background: transparent;
    z-index: 0;
    pointer-events: none;
}

.page-stars { opacity: 0.5; }

#stars { animation: starMove 50s linear infinite; }
#stars2 { width: 2px; height: 2px; animation: starMove 100s linear infinite; }
#stars3 { width: 3px; height: 3px; animation: starMove 150s linear infinite; }
#page-stars { animation: starMove 50s linear infinite; }
#page-stars2 { width: 2px; height: 2px; animation: starMove 100s linear infinite; }
#page-stars3 { width: 3px; height: 3px; animation: starMove 150s linear infinite; }

#stars::after, #stars2::after, #stars3::after,
#page-stars::after, #page-stars2::after, #page-stars3::after {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: transparent;
    box-shadow: inherit;
}

@keyframes starMove {
    from { transform: translateY(0); }
    to { transform: translateY(-2000px); }
}

/* ===== 加载中 ===== */
.loading-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-screen-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.loading-screen-tip {
    margin: 16px 0 0;
    font-size: 14px;
    letter-spacing: 0.08em;
    animation: loading-tip-glow 1.7s linear infinite;
}

@keyframes loading-tip-glow {
    0%, 100% {
        color: rgb(186, 66, 255);
        text-shadow:
            0 -3px 18px rgba(186, 66, 255, 0.85),
            0 3px 18px rgba(0, 225, 255, 0.45);
        filter: blur(0.3px);
    }
    50% {
        color: rgb(0, 225, 255);
        text-shadow:
            0 -3px 18px rgba(0, 225, 255, 0.85),
            0 3px 18px rgba(186, 66, 255, 0.45);
        filter: blur(0.5px);
    }
}

/* From Uiverse.io by xXJollyHAKERXx — 站点初始加载 */
.loading-screen .spinner {
    background-image: linear-gradient(rgb(186, 66, 255) 35%, rgb(0, 225, 255));
    width: 100px;
    height: 100px;
    animation: spinning82341 1.7s linear infinite;
    text-align: center;
    border-radius: 50px;
    filter: blur(1px);
    box-shadow: 0 -5px 20px 0 rgb(186, 66, 255), 0 5px 20px 0 rgb(0, 225, 255);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-screen .spinner1 {
    background-color: rgb(36, 36, 36);
    width: 100px;
    height: 100px;
    border-radius: 50px;
    filter: blur(10px);
}

@keyframes spinning82341 {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid #222;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 登录页 ===== */
.login-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-box {
    background: rgba(20, 20, 30, 0.9);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 16px;
    width: 360px;
    text-align: center;
    border: 1px solid var(--border);
    position: relative;
    z-index: 10;
}

.login-logo { font-size: 48px; margin-bottom: 16px; }

.login-box h1 {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 24px;
}

.login-box input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.login-box input:focus { border-color: var(--primary); }
.login-box input::placeholder { color: #555; }

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover { opacity: 0.9; }

.error {
    color: #ff6b6b;
    margin-top: 12px;
    font-size: 13px;
}

/* ===== 导航栏 ===== */
.header {
    position: sticky;
    top: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
}

.logo {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary);
    white-space: nowrap;
}

.search-box {
    flex: 1;
    max-width: 400px;
    display: flex;
    gap: 8px;
}

.search-box input {
    flex: 1;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 13px;
    outline: none;
}

.search-box input:focus { border-color: var(--primary); }
.search-box input::placeholder { color: #555; }

.search-box button {
    padding: 8px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
}

.search-box button:hover { opacity: 0.9; }

.nav-links {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text2);
    font-size: 14px;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active { color: var(--primary); }

/* ===== 用户菜单 ===== */
.user-menu {
    position: relative;
    margin-left: auto;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #ff6b6b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.4);
}

.user-avatar span {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    background: rgba(20, 20, 30, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: hidden;
    animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.dropdown-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), #ff6b6b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.dropdown-info {
    display: flex;
    flex-direction: column;
}

.dropdown-name {
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
}

.dropdown-role {
    color: var(--text2);
    font-size: 12px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text2);
    font-size: 13px;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.dropdown-item.logout {
    color: #ff6b6b;
}

.dropdown-item.logout:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* ===== 主内容 ===== */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 120px);
    position: relative;
    z-index: 1;
}

/* ===== Hero 横幅 ===== */
.hero {
    position: relative;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 24px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-card);
    transition: transform 0.5s;
}

.hero:hover .hero-bg { transform: scale(1.05); }

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10,10,15,0.9) 0%, transparent 60%);
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 500px;
}

.hero-tag {
    display: inline-block;
    background: var(--primary);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    width: fit-content;
    margin-bottom: 16px;
}

.hero-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 12px;
    line-height: 1.2;
}

.hero-desc {
    color: var(--text2);
    font-size: 14px;
    margin-bottom: 20px;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    width: fit-content;
    transition: transform 0.2s;
}

.hero-btn:hover { transform: translateY(-2px); }

/* ===== 分类标签 ===== */
.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text2);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover { border-color: var(--primary); color: var(--primary); }

.tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===== 区块标题 ===== */
.section-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    padding-left: 12px;
    border-left: 3px solid var(--primary);
    margin: 0;
}

.section-action {
    padding: 6px 14px;
    font-size: 12px;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.section-action:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* ===== 视频网格 ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.video-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.video-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 30px rgba(233, 69, 96, 0.15);
}

.video-card:active {
    transform: translateY(-2px) scale(0.99);
}

.poster {
    position: relative;
    aspect-ratio: 2/3;
    background: var(--bg-card);
}

.poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.poster img.poster-loaded,
.detail-poster img.poster-loaded {
    opacity: 1;
}

.detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.35s ease;
}

/* 封面加载 — From Uiverse.io by Shoh2008，适配暗色主题 */
.poster-loader {
    width: 36px;
    height: 36px;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: 0;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
    animation: poster-loader-rotation 1s linear infinite;
    z-index: 1;
    pointer-events: none;
}

.poster-loader-lg {
    width: 48px;
    height: 48px;
}

.poster-loader::after,
.poster-loader::before {
    content: '';
    box-sizing: border-box;
    position: absolute;
    width: 50%;
    height: 50%;
    top: 0;
    left: 25%;
    background-color: rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    animation: poster-loader-scale 1s infinite ease-in-out;
}

.poster-loader::before {
    top: auto;
    bottom: 0;
    background-color: var(--primary);
    animation-delay: 0.5s;
}

@keyframes poster-loader-rotation {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes poster-loader-scale {
    0%, 100% { transform: scale(0); }
    50% { transform: scale(1); }
}

.poster-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: var(--text2);
    font-size: 13px;
    text-align: center;
}

.poster-hover {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.video-card:hover .poster-hover { opacity: 1; }

.play-icon {
    font-size: 48px;
    color: var(--primary);
}

.badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.info {
    padding: 12px;
}

.info h4 {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.info p {
    font-size: 12px;
    color: var(--text2);
}

/* ===== 空状态 ===== */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text2);
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 30px 0;
}

.pagination button {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text2);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination span {
    color: var(--text2);
    font-size: 13px;
    padding: 0 12px;
}

/* ===== 视频详情 ===== */
.detail { }

/* ===== 页面过渡动画 ===== */
.page-slide-enter-active,
.page-slide-leave-active {
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.page-slide-enter-from {
    opacity: 0;
    transform: translateX(24px);
}

.page-slide-leave-to {
    opacity: 0;
    transform: translateX(-16px);
}

.card-stagger-enter-active {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.card-stagger-enter-from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
}

.card-stagger-move {
    transition: transform 0.3s ease;
}

/* Toast */
.toast {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 10px 20px;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(233, 69, 96, 0.4);
    border-radius: 24px;
    font-size: 13px;
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.toast-fade-enter-active,
.toast-fade-leave-active {
    transition: opacity 0.25s, transform 0.25s;
}

.toast-fade-enter-from,
.toast-fade-leave-to {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
}

/* 详情加载 */
.detail-loading {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-loading-inner {
    text-align: center;
    color: var(--text2);
}

.detail-loading-inner p {
    margin-top: 16px;
    font-size: 14px;
}

/* 骨架屏 */
.grid-skeleton .skeleton-card {
    pointer-events: none;
}

.skeleton-shimmer {
    background: linear-gradient(90deg, #1a1a24 25%, #252530 50%, #1a1a24 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
}

.skeleton-line {
    height: 12px;
    margin: 8px 10px;
    border-radius: 4px;
    background: linear-gradient(90deg, #1a1a24 25%, #252530 50%, #1a1a24 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
}

.skeleton-line.short {
    width: 60%;
}

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

/* 搜索加载 — From Uiverse.io by andrew-manzyk */
.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    padding: 48px 24px 64px;
}

.search-loading .loader {
    margin-bottom: 28px;
}

.loader {
  --color-one: #ffbf48;
  --color-two: #be4a1d;
  --color-three: #ffbf4780;
  --color-four: #bf4a1d80;
  --color-five: #ffbf4740;
  --time-animation: 2s;
  --size: 1; /* You can change the size */
  position: relative;
  border-radius: 50%;
  transform: scale(var(--size));
  box-shadow:
    0 0 25px 0 var(--color-three),
    0 20px 50px 0 var(--color-four);
  animation: colorize calc(var(--time-animation) * 3) ease-in-out infinite;
}

.loader::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border-top: solid 1px var(--color-one);
  border-bottom: solid 1px var(--color-two);
  background: linear-gradient(180deg, var(--color-five), var(--color-four));
  box-shadow:
    inset 0 10px 10px 0 var(--color-three),
    inset 0 -10px 10px 0 var(--color-four);
}

.loader .box {
  width: 100px;
  height: 100px;
  background: linear-gradient(
    180deg,
    var(--color-one) 30%,
    var(--color-two) 70%
  );
  mask: url(#clipping);
  -webkit-mask: url(#clipping);
}

.loader svg {
  position: absolute;
}

.loader svg #clipping {
  filter: contrast(15);
  animation: roundness calc(var(--time-animation) / 2) linear infinite;
}

.loader svg #clipping polygon {
  filter: blur(7px);
}

.loader svg #clipping polygon:nth-child(1) {
  transform-origin: 75% 25%;
  transform: rotate(90deg);
}

.loader svg #clipping polygon:nth-child(2) {
  transform-origin: 50% 50%;
  animation: rotation var(--time-animation) linear infinite reverse;
}

.loader svg #clipping polygon:nth-child(3) {
  transform-origin: 50% 60%;
  animation: rotation var(--time-animation) linear infinite;
  animation-delay: calc(var(--time-animation) / -3);
}

.loader svg #clipping polygon:nth-child(4) {
  transform-origin: 40% 40%;
  animation: rotation var(--time-animation) linear infinite reverse;
}

.loader svg #clipping polygon:nth-child(5) {
  transform-origin: 40% 40%;
  animation: rotation var(--time-animation) linear infinite reverse;
  animation-delay: calc(var(--time-animation) / -2);
}

.loader svg #clipping polygon:nth-child(6) {
  transform-origin: 60% 40%;
  animation: rotation var(--time-animation) linear infinite;
}

.loader svg #clipping polygon:nth-child(7) {
  transform-origin: 60% 40%;
  animation: rotation var(--time-animation) linear infinite;
  animation-delay: calc(var(--time-animation) / -1.5);
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes roundness {
  0% {
    filter: contrast(15);
  }
  20% {
    filter: contrast(3);
  }
  40% {
    filter: contrast(3);
  }
  60% {
    filter: contrast(15);
  }
  100% {
    filter: contrast(15);
  }
}

@keyframes colorize {
  0% {
    filter: hue-rotate(0deg);
  }
  20% {
    filter: hue-rotate(-30deg);
  }
  40% {
    filter: hue-rotate(-60deg);
  }
  60% {
    filter: hue-rotate(-90deg);
  }
  80% {
    filter: hue-rotate(-45deg);
  }
  100% {
    filter: hue-rotate(0deg);
  }
}

.search-loading-kw {
    font-size: 18px;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0 0 10px;
    letter-spacing: 0.02em;
}

.search-loading-tip {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
    min-height: 22px;
}

.search-tip-fade-enter-active,
.search-tip-fade-leave-active {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.search-tip-fade-enter-from {
    opacity: 0;
    transform: translateY(6px);
}

.search-tip-fade-leave-to {
    opacity: 0;
    transform: translateY(-6px);
}

/* 历史进度条 */
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3;
}

.progress-bar span {
    display: block;
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

.fav-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    z-index: 2;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
}

.card-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 4;
}

.video-card:hover .card-remove,
.video-card:focus-within .card-remove {
    opacity: 1;
}

@media (hover: none) {
    .video-card .card-remove {
        opacity: 1;
    }
}

.card-remove:hover {
    background: var(--primary);
    color: #fff;
}

.dropdown-item.active {
    color: var(--primary);
    background: rgba(233, 69, 96, 0.08);
}

.back-btn {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text2);
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 24px;
    transition: all 0.2s;
}

.back-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }

.detail-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.detail-poster {
    width: 240px;
    min-width: 240px;
    aspect-ratio: 2/3;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.detail-info { flex: 1; }

.detail-info h1 {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 16px;
}

.meta {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.meta span {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 13px;
    color: var(--text2);
}

.fav-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text2);
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.fav-btn:hover { border-color: var(--primary); color: var(--primary); }
.fav-btn.active { background: rgba(233, 69, 96, 0.2); border-color: var(--primary); color: var(--primary); }

.desc {
    color: var(--text2);
    font-size: 14px;
    line-height: 1.8;
}

/* ===== 剧集列表 ===== */
.episodes {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

.episodes h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text2);
}

.ep-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ep-list button {
    width: 48px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text2);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.ep-list button:hover { border-color: var(--primary); color: var(--primary); }
.ep-list button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 播放器 ===== */
.player {
    margin-bottom: 24px;
}

.player-layout {
    position: relative;
    display: flex;
    gap: 16px;
}

.player-wrap {
    position: relative;
    border-radius: 8px;
    overflow: visible;
    background: #000;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.player-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 70vh;
    max-width: calc(70vh * 16 / 9);
    margin: 0 auto;
    line-height: 0;
    background: #000;
    flex: 0 0 auto;
    overflow: hidden;
    cursor: pointer;
}

.player-stage video {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* ========== 全屏：系统 API + CSS 网页全屏兜底（DPlayer 双模式） ========== */
.player-wrap:fullscreen,
.player-wrap:-webkit-full-screen,
.player-wrap.is-web-fullscreen {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    background: #000 !important;
    overflow: hidden !important;
    position: relative !important;
}

.player-wrap.is-web-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483646 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    margin: 0 !important;
}

body.player-web-fs-fix {
    overflow: hidden !important;
}

.player-wrap:fullscreen .player-stage,
.player-wrap:-webkit-full-screen .player-stage,
.player-wrap.is-web-fullscreen .player-stage {
    flex: 1 1 100%;
    min-height: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    aspect-ratio: unset;
    margin: 0;
    position: relative;
}

.player-wrap:fullscreen .player-stage video,
.player-wrap:-webkit-full-screen .player-stage video,
.player-wrap.is-web-fullscreen .player-stage video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    max-width: 100% !important;
    object-fit: contain;
}

.player-wrap:fullscreen .danmaku-canvas,
.player-wrap:-webkit-full-screen .danmaku-canvas,
.player-wrap.is-web-fullscreen .danmaku-canvas {
    z-index: 10;
}

/* 全屏隐藏弹幕栏：脱离文档流，不占任何高度 */
.player-wrap:fullscreen:not(.fs-ui-visible):not(.fs-settings-open) .danmaku-toolbar,
.player-wrap:-webkit-full-screen:not(.fs-ui-visible):not(.fs-settings-open) .danmaku-toolbar,
.player-wrap.is-web-fullscreen:not(.fs-ui-visible):not(.fs-settings-open) .danmaku-toolbar {
    position: absolute !important;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0;
    overflow: hidden !important;
    pointer-events: none;
    border: none !important;
}

/* 全屏显示弹幕栏：在视频下方独立一行，不遮挡进度条 */
.player-wrap:fullscreen.fs-ui-visible .danmaku-toolbar,
.player-wrap:-webkit-full-screen.fs-ui-visible .danmaku-toolbar,
.player-wrap.is-web-fullscreen.fs-ui-visible .danmaku-toolbar,
.player-wrap:fullscreen.fs-settings-open .danmaku-toolbar,
.player-wrap:-webkit-full-screen.fs-settings-open .danmaku-toolbar,
.player-wrap.is-web-fullscreen.fs-settings-open .danmaku-toolbar {
    position: relative;
    flex-shrink: 0;
    z-index: 20;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0 !important;
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transition: opacity 0.2s ease;
}

.player-wrap:fullscreen.fs-ui-visible .dm-main,
.player-wrap:-webkit-full-screen.fs-ui-visible .dm-main,
.player-wrap.is-web-fullscreen.fs-ui-visible .dm-main,
.player-wrap:fullscreen.fs-settings-open .dm-main,
.player-wrap:-webkit-full-screen.fs-settings-open .dm-main,
.player-wrap.is-web-fullscreen.fs-settings-open .dm-main {
    padding-top: 8px;
    padding-bottom: 4px;
}

.danmaku-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    contain: strict;
}
.danmaku-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: linear-gradient(180deg, rgba(12, 12, 18, 0.96) 0%, rgba(8, 8, 12, 0.98) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

/* 主行：开关 + 发送 + 快捷按钮 */
.dm-main {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    min-height: 44px;
}

.dm-main-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    max-width: 28%;
}

.dm-badge {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    white-space: nowrap;
}

.dm-badge-muted {
    color: rgba(255, 255, 255, 0.45);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-send-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.dm-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.dm-btn {
    height: 30px;
    padding: 0 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.dm-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.dm-btn.active {
    background: rgba(255, 107, 107, 0.22);
    color: #ff8a8a;
}

.dm-btn-primary {
    background: var(--primary);
    color: #fff;
    font-weight: 500;
}

.dm-btn-primary:hover {
    opacity: 0.9;
    background: var(--primary);
}

.dm-btn-ghost {
    padding: 0 10px;
    font-size: 15px;
    line-height: 1;
}

/* 设置面板（折叠） */
.dm-settings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 8px 16px;
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.25);
}

.dm-setting {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.dm-setting-name {
    flex-shrink: 0;
    width: 56px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-align: right;
}

.dm-setting-val {
    flex-shrink: 0;
    width: 36px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
    text-align: right;
}

.dm-setting-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
}

.dm-setting .dm-range {
    flex: 1;
    min-width: 48px;
}

.dm-num {
    width: 52px;
    height: 28px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    text-align: center;
    outline: none;
}

.dm-num:focus {
    border-color: var(--primary);
}

.dm-switch {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.dm-switch input { display: none; }

.dm-switch-track {
    display: block;
    width: 34px;
    height: 18px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9px;
    transition: background 0.2s;
    position: relative;
}

.dm-switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dm-switch.on .dm-switch-track {
    background: var(--primary);
}

.dm-switch.on .dm-switch-track::after {
    transform: translateX(16px);
}

.dm-input {
    flex: 1;
    min-width: 0;
    height: 30px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s;
}

.dm-input:focus {
    border-color: rgba(255, 107, 107, 0.6);
}

.dm-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.dm-select {
    flex: 1;
    min-width: 0;
    height: 28px;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
    outline: none;
    cursor: pointer;
}

.dm-select option {
    background: #1a1a2e;
    color: #fff;
}

.dm-range {
    height: 4px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* 弹幕侧栏面板 */
.danmaku-list-panel,
.danmaku-match-panel {
    position: absolute;
    top: 0;
    z-index: 30;
    width: 280px;
    min-width: 280px;
    background: rgba(16, 16, 24, 0.98);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
}

/* 窗口模式：面板在播放器右侧 */
.player-wrap:not(:fullscreen):not(:-webkit-full-screen):not(.is-web-fullscreen) .danmaku-match-panel,
.player-wrap:not(:fullscreen):not(:-webkit-full-screen):not(.is-web-fullscreen) .danmaku-list-panel {
    left: calc(100% + 12px);
}

/* 全屏模式：面板叠在播放器内部右侧 */
.player-wrap:fullscreen .danmaku-match-panel,
.player-wrap:-webkit-full-screen .danmaku-match-panel,
.player-wrap.is-web-fullscreen .danmaku-match-panel,
.player-wrap:fullscreen .danmaku-list-panel,
.player-wrap:-webkit-full-screen .danmaku-list-panel,
.player-wrap.is-web-fullscreen .danmaku-list-panel {
    right: 0;
    left: auto;
    top: 0;
    bottom: 0;
    max-height: none;
    height: auto;
    border-radius: 0;
    border-right: none;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
}

.dml-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.dml-header h3 {
    font-size: 13px;
    color: var(--text);
    flex: 1;
}

.dml-total {
    font-size: 11px;
    color: var(--text2);
}

.dml-close {
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    color: var(--text2);
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dml-close:hover { background: rgba(255,255,255,0.1); color: var(--text); }

.dml-content {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.dml-empty {
    text-align: center;
    padding: 40px 0;
    color: var(--text2);
    font-size: 13px;
}

.dml-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.dml-item:hover { background: rgba(255,255,255,0.05); }

.dml-time {
    font-size: 11px;
    color: var(--primary);
    font-family: monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

.dml-text {
    font-size: 12px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 弹幕匹配面板 */
.dmm-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.dmm-keywords {
    font-size: 11px;
    color: var(--text2);
    opacity: 0.85;
    word-break: break-all;
    padding: 4px 8px;
    margin-bottom: 4px;
}

.dmm-hint {
    font-size: 12px;
    color: var(--text2);
    padding: 12px 4px;
    text-align: center;
}

.dmm-item {
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 6px;
    transition: background 0.15s, border-color 0.15s;
}

.dmm-item:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--border);
}

.dmm-title {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}

.dmm-ep {
    font-size: 12px;
    color: var(--primary);
    margin-top: 2px;
}

.dmm-meta {
    font-size: 10px;
    color: var(--text2);
    margin-top: 4px;
}

.dmm-refresh {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
}

.dmm-refresh:hover:not(:disabled) {
    background: rgba(255,255,255,0.1);
}

.dmm-refresh:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.player-title {
    margin-top: 12px;
    color: var(--text2);
    font-size: 14px;
}

.player-error {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
    color: #ff6b6b;
    font-size: 13px;
}

/* ===== 底部 ===== */
.footer {
    text-align: center;
    padding: 20px;
    color: #444;
    font-size: 12px;
    border-top: 1px solid var(--border);
}

/* ===== 源选择器 ===== */
.source-selector {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.source-selector-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.source-selector h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text);
}

.source-hint {
    font-size: 12px;
    color: var(--text2);
}

.source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.source-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    min-height: 72px;
}

.source-card:hover:not(:disabled) {
    border-color: rgba(233, 69, 96, 0.5);
    background: rgba(233, 69, 96, 0.08);
}

.source-card.active {
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.25), rgba(233, 69, 96, 0.1));
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(233, 69, 96, 0.2);
}

.source-card.disabled {
    opacity: 0.6;
    cursor: wait;
}

.source-card-name {
    font-size: 14px;
    font-weight: 600;
}

.source-card-meta {
    font-size: 11px;
    color: var(--text2);
    display: flex;
    gap: 8px;
}

.source-card-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.source-card-tags em {
    font-style: normal;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text2);
}

.source-good { border-left: 3px solid #4ade80; }
.source-ok { border-left: 3px solid #fbbf24; }
.source-warn { border-left: 3px solid #fb923c; }
.source-offline { border-left: 3px solid #666; opacity: 0.55; }

.source-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.source-list button {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.source-list button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.source-list button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.source-list button.line-m3u8:not(.active) {
    border-color: rgba(74, 222, 128, 0.35);
}

.line-ep-count {
    font-size: 11px;
    opacity: 0.65;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.line-selector {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

.source-speed {
    font-size: 12px;
    opacity: 0.7;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

/* 卡片源标签 */
.source-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.72);
    color: #ccc;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 2;
}

.meta-source {
    background: rgba(233, 69, 96, 0.15) !important;
    color: var(--primary) !important;
    border: 1px solid rgba(233, 69, 96, 0.3);
}

/* 设置分组 */
.dm-settings-group {
    display: contents;
}

.dm-settings-label {
    grid-column: 1 / -1;
    font-size: 11px;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dm-settings-group:first-child .dm-settings-label {
    margin-top: 0;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .header-content { flex-wrap: wrap; }
    .search-box { order: 3; max-width: 100%; width: 100%; }
    .nav-links { gap: 12px; font-size: 13px; }
    .hero { height: 280px; }
    .hero-content { padding: 24px; }
    .hero-title { font-size: 22px; }
    .detail-header { flex-direction: column; align-items: center; }
    .detail-poster { width: 180px; min-width: 180px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
    .main { padding: 16px; }
    .player-layout { flex-direction: column; }
    .danmaku-list-panel { width: 100%; min-width: unset; max-height: 300px; }
    .player-layout { overflow-x: auto; }
    .player-wrap:not(:fullscreen):not(:-webkit-full-screen):not(.is-web-fullscreen) .danmaku-match-panel,
    .player-wrap:not(:fullscreen):not(:-webkit-full-screen):not(.is-web-fullscreen) .danmaku-list-panel {
        position: fixed;
        left: auto;
        right: 8px;
        top: auto;
        bottom: 80px;
        width: calc(100vw - 16px);
        max-width: 320px;
        max-height: 50vh;
    }
    .dm-main {
        flex-wrap: wrap;
    }
    .dm-main-left {
        max-width: 100%;
    }
    .dm-send-wrap {
        width: 100%;
        order: 3;
    }
    .dm-actions {
        margin-left: auto;
    }
    .dm-settings {
        grid-template-columns: 1fr;
    }
}
