/**
 * Astra Child Theme - 物理竞赛专用样式
 * 
 * 物理竞赛网站专用设计 - 浅蓝深蓝主题
 * 专业、现代、科技感的视觉风格
 *
 * @package Astra Child - Physics Competition Styles
 * @since 1.0.0
 */

/* ===== 物理竞赛主色调 ===== */
:root {
    --cphos-dark-blue: #1e3a8a;     /* 深蓝色 */
    --cphos-light-blue: #3498db;    /* 浅蓝色 */
    --cphos-white: #ffffff;          /* 白色 */
    --cphos-gold: #f59e0b;          /* 金色强调 */
}

/* ===== 简洁Header样式 ===== */
.cphos-simple-header {
    background: #1e3a8a;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(30, 58, 138, 0.2);
}

.cphos-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== Logo区域 ===== */
.cphos-logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cphos-logo-icon {
    width: 45px;
    height: 45px;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cphos-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.cphos-custom-logo {
    height: 40px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    transition: transform 0.3s ease;
    display: block;
}

.cphos-custom-logo:hover {
    transform: scale(1.05);
}

.cphos-logo-fallback {
    display: none;
}

.cphos-logo-fallback .cphos-logo-icon {
    width: 45px;
    height: 45px;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #1e3a8a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cphos-site-info {
    display: flex;
    flex-direction: column;
}

.cphos-site-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.cphos-site-title a {
    color: #ffffff;
    text-decoration: none;
}

.cphos-tagline {
    color: #ffffff;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    margin-top: 2px;
}

/* ===== 导航按钮 ===== */
.cphos-navigation {
    display: flex;
    gap: 12px;
    align-items: center;
}

.cphos-nav-button {
    color: #ffffff;
    background: transparent;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cphos-nav-button:hover {
    background: transparent;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    color: #ffffff;
    text-decoration: none;
    border: none;
}

/* 所有导航按钮样式统一 */
.cphos-home-btn,
.cphos-about-btn,
.cphos-resource-btn,
.cphos-events-btn,
.cphos-forum-btn,
.cphos-register-btn,
.cphos-articles-btn {
    color: #ffffff;
    background: transparent;
    border: none;
}

.cphos-home-btn:hover,
.cphos-about-btn:hover,
.cphos-resource-btn:hover,
.cphos-events-btn:hover,
.cphos-forum-btn:hover,
.cphos-register-btn:hover,
.cphos-articles-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: none;
}

/* ===== 下拉菜单样式 ===== */
.cphos-dropdown {
    position: relative;
    display: inline-block;
}

.cphos-articles-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.cphos-dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.cphos-dropdown:hover .cphos-dropdown-arrow {
    transform: rotate(180deg);
}

.cphos-dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 160px;
    background: transparent;
    border: none;
    border-radius: 8px;
    box-shadow: none;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow: visible;
    /* 添加隐形的悬停区域 */
    padding-top: 10px;
    margin-top: -10px;
}

.cphos-dropdown-content::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1e3a8a;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.cphos-dropdown:hover .cphos-dropdown-content {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.cphos-dropdown-link {
    display: block;
    color: #ffffff !important;
    padding: 15px 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.cphos-dropdown-link:first-child {
    margin-top: 10px;
    border-radius: 7px 7px 0 0;
}

.cphos-dropdown-link:last-child {
    border-bottom: none;
}

.cphos-dropdown-link:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    text-decoration: none;
    padding-left: 25px;
}

.cphos-dropdown-link:last-child {
    border-bottom: none;
    border-radius: 0 0 7px 7px;
}

/* 添加小三角形指示器 */
.cphos-dropdown-content::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #1e3a8a;
    z-index: 1;
}

/* 确保下拉菜单在移动端隐藏 */
@media (max-width: 768px) {
    .cphos-dropdown-content {
        display: none !important;
    }
}

/* 桌面端确保下拉菜单可见性 */
@media (min-width: 769px) {
    .cphos-dropdown {
        position: relative;
    }
    
    .cphos-dropdown-content {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

/* ===== 移动端菜单 ===== */
.cphos-mobile-toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.cphos-mobile-toggle span {
    width: 20px;
    height: 2px;
    background: #ffffff;
    margin: 2px 0;
    transition: all 0.3s ease;
}

.cphos-mobile-menu {
    display: none;
    background: #1e3a8a;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 30px;
}

.cphos-mobile-link {
    display: block;
    color: #ffffff;
    text-decoration: none;
    padding: 12px 0;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: color 0.3s ease;
}

.cphos-mobile-link:hover {
    color: #f59e0b;
}

.cphos-mobile-link:last-child {
    border-bottom: none;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .cphos-header-container {
        padding: 0 20px;
    }
    
    .cphos-navigation {
        display: none;
    }
    
    .cphos-mobile-toggle {
        display: flex;
    }
    
    .cphos-site-title {
        font-size: 20px;
    }
    
    .cphos-custom-logo {
        height: 35px;
        max-width: 100px;
    }
    
    .cphos-logo-icon {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .cphos-header-container {
        padding: 0 15px;
    }
    
    .cphos-simple-header {
        padding: 12px 0;
    }
    
    .cphos-site-title {
        font-size: 18px;
    }
    
    .cphos-tagline {
        font-size: 11px;
    }
    
    .cphos-logo-section {
        gap: 10px;
    }
    
    .cphos-custom-logo {
        height: 30px;
        max-width: 80px;
    }
    
    .cphos-logo-icon {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
}
