/* ==================== VIP视频解析 - 完整样式表 ==================== */
/* 包含：飘雪背景、毛玻璃效果、多图广告网格、搜索模块、解析区、播放器、公告弹窗、VIP弹窗、用户菜单、移动端适配 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #a855f7;
    --primary-light: #c084fc;
    --secondary: #06b6d4;
    --bg-dark: #0b0b1a;
    --card-bg: rgba(20, 20, 40, 0.65);
    --border: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --text-muted: #b0b0d0;
}

body {
    font-family: 'Inter', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ========== 飘雪背景 ========== */
#snowCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ========== 主容器 ========== */
.container {
    position: relative;
    z-index: 2;
    max-width: 1300px;
    margin: 0 auto;
    padding: 16px;
}

/* ========== 毛玻璃卡片效果 ========== */
.glass-card,
.search-section,
.input-section,
.player-section,
.info-card,
.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* ========== 头部 ========== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #c084fc, #06b6d4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-tagline {
    color: var(--text-muted);
    font-size: 14px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    backdrop-filter: blur(5px);
}

/* ========== 用户状态区域 ========== */
.user-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-btn {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 30px;
    padding: 8px 16px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-btn:hover {
    background: #a855f7;
}

.user-info-dropdown {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #a855f7, #06b6d4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 18px;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 50px;
    background: rgba(20, 20, 40, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 8px;
    min-width: 160px;
    display: none;
    z-index: 100;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 10px 16px;
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: rgba(168, 85, 247, 0.2);
}

/* ========== 多图片广告网格 ========== */
.image-ads-section {
    margin-bottom: 24px;
}

.image-ads-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.image-ad-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 24px;
    padding: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.image-ad-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.2);
}

.image-ad-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none;
}

.image-ad-item img {
    max-width: 100%;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
    display: block;
    margin: 0 auto;
}

.image-ad-title {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    font-weight: 500;
}

/* ========== 文字广告区域 ========== */
.text-ads-section {
    margin-bottom: 24px;
}

.text-ads-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
}

.text-ad-item {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 40px;
    padding: 8px 20px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    flex: 0 1 auto;
}

.text-ad-item a {
    color: #fbbf24;
    text-decoration: none;
}

.text-ad-item:hover {
    background: rgba(168, 85, 247, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

/* ========== 搜索模块 ========== */
.search-section {
    padding: 20px;
    margin-bottom: 20px;
}

.search-wrapper {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    flex: 2;
    min-width: 200px;
}

.search-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 14px 16px 14px 45px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: border 0.2s;
}

.search-input:focus {
    border-color: var(--primary);
}

.platform-select {
    padding: 0 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    min-width: 140px;
    outline: none;
}

.search-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50px;
    padding: 0 28px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.search-btn:hover {
    opacity: 0.9;
    transform: scale(0.98);
}

.search-hint {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

/* ========== 解析输入区 ========== */
.input-section {
    padding: 24px;
    margin-bottom: 24px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 60px;
    padding: 4px;
    margin-bottom: 24px;
    transition: border 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
}

.input-icon {
    color: var(--text-muted);
    padding: 0 8px 0 20px;
    font-size: 18px;
}

.video-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 16px 0;
    color: #fff;
    font-size: 16px;
    outline: none;
}

.video-input::placeholder {
    color: var(--text-muted);
}

.paste-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0 20px;
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s;
}

.paste-btn:hover {
    color: var(--primary);
}

.api-section {
    margin-bottom: 24px;
}

.api-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.api-label {
    color: var(--text-muted);
    font-size: 14px;
}

.api-status {
    color: #10b981;
    font-size: 13px;
}

.api-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
}

.api-list::-webkit-scrollbar {
    width: 6px;
}

.api-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.api-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-size: 14px;
}

.api-item:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: var(--primary);
}

.api-item.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: white;
}

.api-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: #fff;
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.auto-switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
}

.parse-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 60px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    margin: 20px 0 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.4);
}

.parse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(168, 85, 247, 0.5);
}

.quick-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-label {
    color: var(--text-muted);
    font-size: 14px;
}

.quick-link {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 30px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.quick-link:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--primary);
    color: white;
}

/* ========== 播放器区域 ========== */
.player-section {
    padding: 20px;
    margin-bottom: 24px;
}

.player-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.player-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.player-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.control-btn:hover {
    background: var(--primary);
    color: white;
    border-color: transparent;
}

.player-container {
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    min-height: 300px;
}

#dplayer {
    width: 100%;
    aspect-ratio: 16 / 9;
}

.iframe-container {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
}

.iframe-container iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
}

/* ========== 信息卡片 ========== */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    padding: 24px;
}

.info-card i {
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 16px;
}

.info-card h4 {
    margin-bottom: 12px;
    font-size: 18px;
}

.info-card ol,
.info-card ul {
    padding-left: 20px;
    color: var(--text-muted);
}

.info-card li {
    margin-bottom: 6px;
}

/* ========== 底部 ========== */
.footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    font-size: 14px;
}

/* ========== 普通公告弹窗（可关闭） ========== */
.modal-announcement {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-announcement .modal-content {
    max-width: 480px;
    width: 90%;
    padding: 28px;
    margin: 20px;
    border-radius: 32px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 20px;
    color: white;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-btn:hover {
    opacity: 1;
}

.modal-body {
    margin-bottom: 20px;
    color: var(--text-muted);
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

.modal-footer label {
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    padding: 10px 24px;
    border-radius: 40px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.4);
}

/* ========== VIP到期弹窗（不可关闭） ========== */
.modal-vip-expire {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-vip-expire .modal-content {
    max-width: 420px;
    width: 90%;
    padding: 28px;
    border-radius: 32px;
    background: #1e1e32;
    border: 1px solid #a855f7;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.modal-vip-expire .modal-header {
    margin-bottom: 16px;
}

.modal-vip-expire .modal-header h3 {
    color: #fbbf24;
    font-size: 22px;
}

.modal-vip-expire .modal-body {
    color: #e0e0e0;
}

.modal-vip-expire .modal-body p {
    margin-bottom: 12px;
}

/* ========== Toast 提示 ========== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e3f;
    padding: 14px 28px;
    border-radius: 60px;
    backdrop-filter: blur(20px);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 500;
}

.toast.show {
    opacity: 1;
}

/* ========== 加载动画 ========== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 11, 26, 0.9);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    color: var(--text-muted);
    font-size: 16px;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-right {
        justify-content: space-between;
        margin-top: 8px;
    }

    .user-status {
        order: -1;
    }

    /* 图片广告移动端单列 */
    .image-ads-grid {
        grid-template-columns: 1fr;
    }

    /* 搜索区域 */
    .search-wrapper {
        flex-direction: column;
    }

    .platform-select {
        width: 100%;
        padding: 14px;
    }

    .search-btn {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }

    /* 接口列表单列 */
    .api-list {
        grid-template-columns: 1fr;
    }

    .api-footer {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    /* 信息卡片 */
    .info-section {
        grid-template-columns: 1fr;
    }

    /* 文字广告居中 */
    .text-ads-container {
        justify-content: center;
    }

    /* 播放器按钮间距 */
    .player-header {
        flex-direction: column;
        gap: 12px;
    }

    .player-controls {
        align-self: flex-end;
    }

    /* 解析按钮 */
    .parse-btn {
        padding: 16px;
        font-size: 18px;
    }

    /* 快捷链接居中 */
    .quick-links {
        justify-content: center;
    }
}

/* ========== 辅助样式 ========== */
.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}