/* 公共样式文件 - 星怀蓝梦网站 */
:root {
    --primary-color: #2196f3;
    --primary-hover: #1784db;
    --secondary-color: #ff9800;
    --secondary-hover: #f57c00;
    --success-color: #4caf50;
    --background-color: #f8f9fa;
    --white: #ffffff;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e6ed;
    --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 12px rgba(0,0,0,0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* 基础样式 */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    color: var(--text-color);
}

/* 容器样式 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1976d2 100%);
    color: var(--white);
    padding: 25px 0;
    text-align: center;
    box-shadow: var(--shadow-light);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: 20px 20px;
}

header h1 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

header .subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 8px;
    font-weight: 300;
}

/* 导航栏样式 */
nav {
    background: var(--white);
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--primary-color);
}

.nav-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

/* 导航栏样式 */
nav a {
    color: var(--text-color);
    text-decoration: none;
    padding: 15px 20px;
    font-weight: 500;
    display: inline-block;
    transition: var(--transition);
    border-radius: var(--border-radius);
    margin: 5px;
    position: relative;
    overflow: hidden;
    min-width: 120px; /* 添加最小宽度确保一致性 */
    text-align: center;
    box-sizing: border-box;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(33, 150, 243, 0.1), transparent);
    transition: left 0.5s;
}

nav a:hover::before {
    left: 100%;
}

nav a:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* 下拉菜单样式 */
.dropdown {
    position: relative;
    display: inline-block;
}

/* 下拉菜单样式 */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: auto; /* 改为自动宽度 */
    width: 100%; /* 设置宽度为100%与父元素一致 */
    box-shadow: var(--shadow-medium);
    border-radius: var(--border-radius);
    z-index: 1001;
    border: 1px solid var(--border-color);
}

/* 下拉菜单样式 */
.dropdown-content a {
    display: block;
    padding: 15px 20px; /* 统一padding与一级菜单一致 */
    border-bottom: 1px solid var(--border-color);
    margin: 0;
    border-radius: 0;
    min-width: auto; /* 改为自动宽度 */
    text-align: center;
    box-sizing: border-box;
    width: 100%; /* 设置宽度为100% */
}

.dropdown-content a:last-child {
    border-bottom: none;
}

/* 下拉菜单样式 */
.dropdown-content a:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* 当前页面高亮 - 使用更具体的选择器 */
nav a[style*="background-color"] {
    background-color: var(--primary-color) !important;
    color: var(--white) !important;
    position: relative;
    z-index: 1;
}

/* 为下拉菜单中的当前页面设置特殊样式 */
.dropdown-content a[style*="background-color"] {
    background-color: var(--primary-color) !important;
    color: var(--white) !important;
    position: relative;
    z-index: 1;
}

/* 确保鼠标悬停时不会覆盖当前页面样式 */
.dropdown-content a[style*="background-color"]:hover {
    background-color: var(--primary-color) !important; /* 保持当前页面颜色不变 */
    color: var(--white) !important;
}

/* 为普通链接的悬停状态添加特殊样式 */
.dropdown-content a:not([style*="background-color"]):hover {
    background-color: var(--primary-hover) !important; /* 使用不同的颜色 */
    color: var(--white) !important;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* 内容区域样式 */
.content {
    background-color: var(--white);
    padding: 30px;
    margin: 30px 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    min-height: 600px; /* 添加最小高度确保一致性 */
}

.content h2 {
    color: var(--primary-color);
    margin-top: 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    font-weight: 400;
}

/* 页脚样式 */
footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: var(--white);
    text-align: center;
    padding: 25px 0;
    margin-top: auto;
    font-size: 14px;
}

footer p {
    margin: 5px 0;
    opacity: 0.9;
}

/* 视频相关样式 */
.video-container {
    max-width: 100%;
    margin: 0 auto;
}

#video-player {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    background-color: #000;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
}

/* 视频控制按钮样式 */
.video-controls {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
    align-items: center;
    background: var(--background-color);
    padding: 15px;
    border-radius: var(--border-radius);
}

.video-controls input {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

.video-controls input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.video-controls button {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-controls button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.video-controls button:active {
    transform: translateY(0);
}

/* 切换频道按钮特殊样式 */
#prev-channel, #next-channel {
    background: var(--secondary-color);
}

#prev-channel:hover, #next-channel:hover {
    background: var(--secondary-hover);
}

/* 视频列表样式 */
.video-list {
    margin-top: 25px;
}

.video-list h3 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-weight: 500;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.video-list ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin: 0;
}

.video-list li {
    margin: 0;
}

.video-list a {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    background-color: var(--white);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.video-list a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(33, 150, 243, 0.05), transparent);
    transition: left 0.5s;
}

.video-list a:hover::before {
    left: 100%;
}

.video-list a:hover, .video-list a.on {
    background: #e3f2fd;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* 数字方框样式 */
.number-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1976d2 100%);
    color: white;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.video-list a:hover .number-box {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #1565c0 100%);
    transform: scale(1.1);
}

.video-list a.on .number-box {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
}

/* 区域标题样式 */
.region-section {
    margin: 20px 0;
}

.region-section h4 {
    color: var(--primary-color);
    margin: 0 0 12px 0;
    padding: 8px 15px;
    background: var(--background-color);
    border-radius: var(--border-radius);
    font-weight: 500;
    border-left: 4px solid var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container, .nav-container {
        width: 95%;
    }
    
    .video-list ul {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
        margin: 0;
    }
    
    .container {
        padding: 15px;
    }
    
    header {
        padding: 20px 0;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .nav-container {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav a {
        padding: 12px 15px;
        margin: 3px;
        font-size: 14px;
    }
    
    .content {
        padding: 20px;
        margin: 20px 0;
    }
    
    /* 视频控制按钮组 */
    .video-controls {
        flex-direction: column;
        gap: 10px;
        margin: 15px 0;
    }
    
    .video-controls input {
        width: 100%;
        min-width: auto;
    }
    
    .video-controls button {
        width: 100%;
        justify-content: center;
    }
    
    /* 视频列表 */
    .video-list ul {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .video-list a {
        padding: 12px;
    }
    
    .number-box {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .content {
        padding: 15px;
    }
    
    .video-list a {
        padding: 10px;
        font-size: 14px;
    }
    
    .number-box {
        width: 24px;
        height: 24px;
    }
    
    .region-section h4 {
        font-size: 16px;
        padding: 6px 12px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}