/* IPTV 直播源 - 暗色科技风格 */
:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0f1a;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --green-primary: #10B981;
    --green-light: #34d399;
    --green-dark: #059669;
    --text-primary: #d1d5db;
    --text-secondary: #9ca3af;
    --text-heading: #f3f4f6;
    --border-color: #1f2937;
    --border-green: #10B981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--green-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* 头部 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-green);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--green-primary);
    transition: color 0.3s;
}

.logo:hover {
    color: #fff;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: var(--green-primary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    color: #fff;
}

/* 头部右侧区域 */
.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* 语言切换器 */
.lang-switcher {
    display: flex;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.lang-btn {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--bg-card);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.lang-btn:hover {
    color: var(--green-primary);
    background: var(--bg-card-hover);
}

.lang-btn.active {
    color: #000;
    background: var(--green-primary);
    font-weight: 600;
}

/* 主内容 */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* 标题区域 */
.hero {
    text-align: center;
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2rem;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.hero .update-time {
    color: var(--green-primary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* 区块标题 */
.section-title {
    font-size: 1.5rem;
    color: var(--text-heading);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-green);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--green-primary);
    border-radius: 2px;
}

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

.card h3 {
    font-size: 1rem;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.card .meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.card .actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card .badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--green-dark);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: var(--green-primary);
    color: #000;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--green-light);
}

.btn-outline {
    border-color: var(--green-primary);
    color: var(--green-primary);
    background: transparent;
}

.btn-outline:hover {
    background: var(--green-primary);
    color: #000;
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* 频道列表 */
.channel-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.channel-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.channel-list-header h3 {
    color: var(--text-heading);
    font-size: 1rem;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.channel-item:last-child {
    border-bottom: none;
}

.channel-item:hover {
    background: var(--bg-card-hover);
}

.channel-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.channel-info {
    flex: 1;
    min-width: 0;
}

.channel-name {
    color: var(--text-heading);
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-group {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.channel-url {
    color: var(--green-primary);
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.search-bar input {
    flex: 1;
    padding: 0.6rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    border-color: var(--border-green);
}

.search-bar input::placeholder {
    color: var(--text-secondary);
}

/* 标签/快捷搜索 */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tag {
    padding: 0.3rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--green-primary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s;
}

.tag:hover {
    background: var(--green-primary);
    color: #000;
    border-color: var(--green-primary);
}

/* 自定义链接播放 */
.custom-play-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.custom-play-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-heading);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.custom-play-title svg {
    color: var(--green-primary);
    flex-shrink: 0;
}

.custom-play-bar {
    display: flex;
    gap: 0.75rem;
    max-width: 800px;
}

.custom-play-input {
    flex: 1;
    padding: 0.65rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'Courier New', Consolas, monospace;
    outline: none;
    transition: border-color 0.3s;
}

.custom-play-input:focus {
    border-color: var(--green-primary);
}

.custom-play-input::placeholder {
    color: var(--text-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.custom-play-btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    gap: 0.4rem;
    white-space: nowrap;
}

.custom-play-hint {
    color: var(--text-secondary);
    font-size: 0.78rem;
    margin-top: 0.6rem;
}

@media (max-width: 768px) {
    .custom-play-section {
        padding: 1rem;
    }

    .custom-play-bar {
        flex-direction: column;
    }
}

/* FAQ */
.faq-section {
    margin-bottom: 3rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.faq-question {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-heading);
    font-weight: 500;
    transition: background 0.3s;
}

.faq-question:hover {
    background: var(--bg-card-hover);
}

.faq-question::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--green-primary);
    transition: transform 0.3s;
}

.faq-item.open .faq-question::after {
    content: '−';
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    line-height: 1.8;
}

.faq-item.open .faq-answer {
    padding: 0 1.5rem 1rem;
    max-height: 500px;
}

/* 缓存状态 */
.cache-status {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.cache-status .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green-primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
}

.pagination a {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--green-primary);
}

.pagination a:hover {
    border-color: var(--border-green);
}

.pagination .active {
    background: var(--green-primary);
    color: #000;
    font-weight: 600;
}

/* 页脚 */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
    background: var(--bg-secondary);
}

.site-footer .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: var(--text-heading);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.footer-section p,
.footer-section li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section li::before {
    content: '•';
    color: var(--green-primary);
    margin-right: 0.5rem;
}

.footer-bottom {
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* 返回按钮 */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--green-primary);
    text-decoration: none;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.back-link:hover {
    color: #fff;
}

/* 播放器推荐 */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.player-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.player-card:hover {
    border-color: var(--border-green);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.1);
    transform: translateY(-2px);
}

.player-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.player-body {
    flex: 1;
    min-width: 0;
}

.player-body h4 {
    color: var(--text-heading);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.player-platform {
    display: inline-block;
    font-size: 0.7rem;
    padding: 1px 8px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--green-primary);
    margin-bottom: 0.5rem;
}

.player-body p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* 客户端工具区域 */
.tools-section {
    margin-bottom: 3rem;
}

.tool-group {
    margin-bottom: 1.5rem;
}

.tool-group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-heading);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.tool-group-title svg {
    color: var(--green-primary);
    flex-shrink: 0;
}

.tool-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tool-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-bottom: none;
    transition: background 0.2s;
}

.tool-item:first-child {
    border-radius: 10px 10px 0 0;
}

.tool-item:last-child {
    border-bottom: 1px solid var(--border-color);
    border-radius: 0 0 10px 10px;
}

.tool-item:only-child {
    border-radius: 10px;
    border-bottom: 1px solid var(--border-color);
}

.tool-item:hover {
    background: var(--bg-card-hover);
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-info strong {
    color: var(--text-heading);
    font-size: 0.95rem;
}

.tool-info p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.2rem;
    line-height: 1.5;
}

/* 响应式 */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: 0.75rem;
    }

    .main-nav {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-right {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .channel-url {
        max-width: 120px;
    }

    .channel-item {
        padding: 0.5rem 1rem;
    }

    .site-footer .container {
        grid-template-columns: 1fr;
    }

    .player-grid {
        grid-template-columns: 1fr;
    }

    .tool-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .tool-item .btn {
        align-self: flex-start;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--green-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 统计信息 */
.stats-bar {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--green-primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 弹窗遮罩 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    /* backdrop-filter: blur(4px); */
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 弹窗容器 */
.modal-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-green);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.25s;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(16, 185, 129, 0.1);
}

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
}

/* 弹窗头部 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-title {
    color: var(--text-heading);
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

/* 弹窗主体 */
.modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 0;
}

.modal-body .channel-list {
    border-radius: 0;
    border: none;
}

.modal-body .channel-item:last-child {
    border-bottom: none;
}

/* 弹窗底部 */
.modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.modal-footer .btn {
    min-width: 40px;
    text-align: center;
}

/* 弹窗内加载状态 */
.modal-body .loading {
    padding: 3rem;
}

/* 滚动条美化 */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--green-primary);
}

/* 响应式 */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }

    .modal-header {
        padding: 0.75rem 1rem;
    }

    .modal-title {
        font-size: 0.95rem;
    }

    .channel-url {
        max-width: 100px;
    }
}

/* ===================== */
/* 在线播放器 */
/* ===================== */
.player-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.player-overlay.active {
    opacity: 1;
    visibility: visible;
}

.player-wrapper {
    width: 94%;
    max-width: 1200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-green);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8), 0 0 60px rgba(16, 185, 129, 0.1);
}

/* 主体布局：左侧视频 + 右侧列表 */
.player-main {
    display: flex;
    height: 75vh;
    max-height: 680px;
}

.player-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.player-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    flex-shrink: 0;
}

.player-channel-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex: 1;
}

.player-channel-title img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.player-channel-title span {
    color: var(--text-heading);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.player-ctrl-btn {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.player-ctrl-btn:hover {
    border-color: var(--green-primary);
    color: var(--green-primary);
}

.player-ctrl-btn.active {
    background: var(--green-primary);
    color: #000;
    border-color: var(--green-primary);
    font-weight: 600;
}

.player-ctrl-btn.close-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

/* 视频容器 */
.player-video-container {
    position: relative;
    width: 100%;
    flex: 1;
    background: #000;
    min-height: 0;
}

.player-video-container video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    object-fit: contain;
}

/* 播放器状态覆盖层 */
.player-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.6);
    transition: opacity 0.3s;
}

.player-state.hidden {
    opacity: 0;
    pointer-events: none;
}

.player-state .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--green-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.player-state p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.player-state.error p {
    color: #ef4444;
}

.player-state.error .error-hint {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* 右侧播放列表 */
.player-playlist {
    width: 280px;
    flex-shrink: 0;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-card);
}

.player-playlist-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--bg-card);
}

.player-playlist-header svg {
    color: var(--green-primary);
}

.player-playlist-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.player-ch-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.8rem;
}

.player-ch-item:hover {
    background: var(--bg-card-hover);
}

.player-ch-item.active {
    background: rgba(16, 185, 129, 0.12);
    border-left: 3px solid var(--green-primary);
}

.player-ch-item .ch-logo {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: contain;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.player-ch-item .ch-name {
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    font-size: 0.82rem;
}

.player-ch-item.active .ch-name {
    color: var(--green-primary);
    font-weight: 600;
}

.player-ch-item .play-icon {
    color: var(--green-primary);
    font-size: 0.7rem;
    flex-shrink: 0;
    opacity: 0.6;
}

.player-ch-item.active .play-icon,
.player-ch-item:hover .play-icon {
    opacity: 1;
}

/* 频道卡片播放按钮 */
.channel-play-btn {
    flex-shrink: 0;
}

.channel-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.channel-copy-btn.copied {
    background: var(--green-primary);
    color: #000;
    border-color: var(--green-primary);
}

/* 播放列表滚动条 */
.player-playlist-list::-webkit-scrollbar {
    width: 5px;
}

.player-playlist-list::-webkit-scrollbar-track {
    background: var(--bg-card);
}

.player-playlist-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.player-playlist-list::-webkit-scrollbar-thumb:hover {
    background: var(--green-primary);
}

/* 播放器响应式 */
@media (max-width: 768px) {
    .player-wrapper {
        width: 98%;
        border-radius: 10px;
    }

    .player-main {
        flex-direction: column;
        height: auto;
        max-height: 90vh;
    }

    .player-left {
        flex: none;
    }

    .player-top-bar {
        flex-direction: column;
        gap: 0.4rem;
        padding: 0.5rem 0.75rem;
    }

    .player-controls {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .player-video-container {
        aspect-ratio: 16 / 9;
        max-height: 40vh;
    }

    .player-playlist {
        width: 100%;
        max-height: 35vh;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}
