/**
 * 视频解析工具样式文件
 * 功能：定义网站的主题颜色、阴影、圆角等基础样式参数
 * 版本：1.44
 */
:root {
    /* 主色调定义 */
    --primary-color: #2d8cf0;           /* 主色 */
    --primary-hover: #2078d6;           /* 主色 hover 状态 */
    --secondary-color: #e63946;         /* 次要色 */
    --secondary-hover: #d12f3c;         /* 次要色 hover 状态 */
    
    /* 文本颜色定义 */
    --text-main: #212529;               /* 主要文本颜色 */
    --text-secondary: #6c757d;          /* 次要文本颜色 */
    
    /* 背景颜色定义 */
    --bg-gradient-start: #f5f6f7;       /* 背景渐变起始色 */
    --bg-gradient-end: #f5f6f7;         /* 背景渐变结束色 */
    
    /* 阴影定义 */
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);              /* 卡片阴影 */
    --card-inner-shadow: inset 0 1px 0 rgba(255,255,255,0.9);   /* 卡片内阴影 */
    --btn-shadow: 0 4px 12px rgba(45, 140, 240, 0.25);          /* 主按钮阴影 */
    --btn-shadow-hover: 0 6px 16px rgba(45, 140, 240, 0.35);    /* 主按钮 hover 阴影 */
    
    /* 圆角定义 */
    --radius-card: 20px;                /* 卡片圆角 */
    --radius-btn: 12px;                 /* 按钮圆角 */
    
    /* 其他样式参数 */
    --text-shadow: 0 1px 3px rgba(0,0,0,0.03);                 /* 文本阴影 */
    --card-border-gradient: linear-gradient(135deg, #e0e7ff, #fef7fb); /* 卡片边框渐变 */
}

/**
 * 全局样式重置
 * 重置默认样式，确保跨浏览器一致性
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
    -webkit-tap-highlight-color: transparent; /* 移除触摸高亮 */
    -webkit-font-smoothing: antialiased;     /* 平滑字体 */
    -moz-osx-font-smoothing: grayscale;       /* 平滑字体 */
}

/* 全局链接样式 */
a {
    text-decoration: none;
    color: inherit;
}

/**
 * 页面主体布局
 * 定义页面的整体结构和背景样式
 */
body {
    min-height: 100vh;                                 /* 最小高度为视口高度 */
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%); /* 背景渐变 */
    display: flex;
    flex-direction: column;
    align-items: center;                               /* 水平居中 */
    padding: 24px;                                     /* 页面内边距，设置为24px */
    margin: 0;                                         /* 重置默认边距 */
    text-shadow: var(--text-shadow);                   /* 文本阴影 */
    opacity: 0;                                        /* 初始透明度为 0，用于动画 */
    animation: pageFadeIn 0.8s ease-out 0.2s forwards; /* 页面淡入动画 */
    overflow-x: hidden;                                /* 防止水平滚动条 */
    position: relative;                               /* 确保子元素的绝对定位是相对于body的 */
}

/**
 * 页面淡入动画
 */
@keyframes pageFadeIn {
    to { opacity: 1; } /* 结束状态为完全不透明 */
}

/**
 * 淡入动画
 */
@keyframes fadeIn {
    to { opacity: 1; } /* 结束状态为完全不透明 */
}

/**
 * 主容器样式
 */
.video-parser-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}



/**
 * 视频解析工具样式
 * 定义视频解析页面的布局和组件样式
 */

/* 无障碍跳过链接 */
.skip-link {
    position: absolute;
    top: -9999px;
    left: 0;
    padding: 12px 16px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    z-index: 9999;
    font-weight: 500;
    border-radius: 0 0 8px 8px;
    transition: all 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid white;
    outline-offset: 2px;
}

/* 视频解析工具容器 */
.video-parser {
    background-color: #fff;
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    padding: 24px 40px 24px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    overflow: visible;
    background-image: var(--card-inner-shadow), linear-gradient(#fff, #fff);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border: 1px solid transparent;
}

.video-parser::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-card);
    padding: 1px;
    background: var(--card-border-gradient);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 0;
}

/* 标题栏容器样式 */
.video-parser__header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
    width: 100%;
    flex-wrap: nowrap;
}

/* 标题样式 */
.video-parser__title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 auto;
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 8px;
    height: 44px;
    line-height: 44px;
}

/* 输入组样式 */
.video-parser__input-group {
    margin-bottom: 16px;
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

.video-parser__label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 12px;
}

.video-parser__input {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid #e9ecef;
    border-radius: var(--radius-btn);
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: var(--text-main);
}

.video-parser__input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 140, 240, 0.1);
    background-color: #fff;
}

.video-parser__input[readonly] {
    background-color: #e9ecef;
    cursor: pointer;
}

/* 提示信息样式 */
.video-parser__hint {
    display: none;
    margin-top: 8px;
    font-size: 14px;
    color: var(--secondary-color);
    font-weight: 500;
}

.video-parser__hint--visible {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* 通道按钮样式 */
.video-parser__channels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    margin-top: 24px;
    position: relative;
    z-index: 1;
}

.video-parser__channel-btn {
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-btn);
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--btn-shadow);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.video-parser__channel-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--btn-shadow-hover);
}

.video-parser__channel-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.video-parser__channel-btn--active {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-hover) 100%);
    box-shadow: 0 4px 16px rgba(230, 57, 70, 0.4);
    transform: scale(1.05);
}

.video-parser__channel-btn--active:hover {
    background: linear-gradient(135deg, var(--secondary-hover) 0%, var(--secondary-color) 100%);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.5);
}

/* 友情链接样式 */
.video-parser__links-section {
    margin-bottom: 24px;
    margin-top: 24px;
    position: relative;
    z-index: 1;
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: var(--radius-btn);
    padding: 16px;
}

.video-parser__links-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
}

.video-parser__links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.video-parser__link-item {
    padding: 12px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
}

.video-parser__link-item:hover {
    background-color: #e3f2fd;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 140, 240, 0.15);
}

/* 合规声明样式 */
.video-parser__legal {
    margin-top: 24px;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
    padding: 12px 0 0 0;
}

.video-parser__legal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e9ecef;
}

.video-parser__legal-toggle {
    display: block;
    width: 100%;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: #ffffff;
    border: none;
    border-radius: 0;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.video-parser__legal-toggle:hover {
    color: var(--text-main);
}

.video-parser__legal-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0;
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    background-color: #ffffff;
    border: none;
    border-radius: 0;
}

.video-parser__legal-content--expanded {
    max-height: 200px;
    padding: 0;
    animation: fadeIn 0.3s ease-in-out;
}



/* 视频播放器样式 */
.video-player {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    overflow: hidden;
}

.video-player__header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: transparent;
    color: white;
    z-index: 10;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.video-player__header--hidden {
    opacity: 0;
    pointer-events: none;
}

.video-player__header:hover {
    opacity: 1 !important;
}

.video-player__channel-toggle {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    background-color: rgba(45, 140, 240, 0.8);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.video-player__channel-toggle:hover {
    background-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.video-player__close {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    background-color: rgba(230, 57, 70, 0.8);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-left: 12px;
}

.video-player__close:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.video-player__channel-panel {
    position: absolute;
    top: 64px;
    left: 16px;
    background: transparent;
    padding: 20px;
    border-radius: var(--radius-card);
    z-index: 11;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
}

.video-player__channel-panel--visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.video-player__channel-panel--hidden {
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
}

.video-player__channel-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-player__channel-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.video-player__channel-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.video-player__channel-btn--active {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-hover) 100%) !important;
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(230, 57, 70, 0.4);
}

.video-player__channel-btn--active:hover {
    background: linear-gradient(135deg, var(--secondary-hover) 0%, var(--secondary-color) 100%) !important;
    transform: scale(1.05) translateY(-2px);
}

.video-player__channel-panel--visible .video-player__channel-btn {
    animation: slideIn 0.3s ease-out forwards;
}

/* 依次滑入动画 */
.video-player__channel-panel--visible .video-player__channel-btn:nth-child(1) { animation-delay: 0.05s; }
.video-player__channel-panel--visible .video-player__channel-btn:nth-child(2) { animation-delay: 0.1s; }
.video-player__channel-panel--visible .video-player__channel-btn:nth-child(3) { animation-delay: 0.15s; }
.video-player__channel-panel--visible .video-player__channel-btn:nth-child(4) { animation-delay: 0.2s; }
.video-player__channel-panel--visible .video-player__channel-btn:nth-child(5) { animation-delay: 0.25s; }
.video-player__channel-panel--visible .video-player__channel-btn:nth-child(6) { animation-delay: 0.3s; }
.video-player__channel-panel--visible .video-player__channel-btn:nth-child(7) { animation-delay: 0.35s; }
.video-player__channel-panel--visible .video-player__channel-btn:nth-child(8) { animation-delay: 0.4s; }
.video-player__channel-panel--visible .video-player__channel-btn:nth-child(9) { animation-delay: 0.45s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-player__iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 1;
    overflow: hidden;
}

/* 确保视频播放器容器没有滚动条 */
.video-player {
    overflow: hidden !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* 确保整个页面在播放时也没有滚动条 */
body.video-playing {
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
}

/* 确保iframe完全没有滚动条 */
.video-player__iframe {
    overflow: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

.video-player__iframe::-webkit-scrollbar {
    display: none !important;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .video-parser {
        padding: 32px 24px;
    }
    
    .video-parser__title {
        font-size: 24px;
        margin-bottom: 24px;
    }
    
    .video-parser__channels {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .video-parser__channel-btn {
        padding: 16px;
        font-size: 16px;
    }
    
    .video-parser__links-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .video-player__header {
        padding: 12px 16px;
    }
    
    .video-player__channel-panel {
        top: 50px;
        left: 16px;
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 375px) {
    .video-parser {
        padding: 24px 16px;
    }
    
    .video-parser__title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .video-parser__input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .video-parser__channels {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .video-parser__channel-btn {
        padding: 12px;
        font-size: 14px;
    }
    
    .video-parser__links-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 6px;
    }
    
    .video-parser__link-item {
        padding: 8px;
        font-size: 12px;
    }
}
