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

/* ===== 移动端菜单 ===== */

.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;
    }
}

/* ===== 绕开父级结构限制 ===== */
.cphos-main-outer {
    width: 100vw;
    max-width: 1920px;
    margin: 0 auto;
    position: relative;
}

/* 移动端汉堡菜单动画 */
.cphos-mobile-toggle span.active:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.cphos-mobile-toggle span.active:nth-child(2) {
    opacity: 0;
}
.cphos-mobile-toggle span.active:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* 图片轮播样式 - 完全脱离WordPress容器 */
.cphos-slideshow-container {
    position: relative;
    width: calc(100vw - 240px);
    height: 560px;
    overflow: visible;
    background: #f8fafc;
    margin-left: 120px;
    margin-right: 120px;
    padding: 0;
}
.cphos-slideshow {
    position: relative;
    width: 100%;
    height: 100%;
}
.cphos-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
.cphos-slide.active {
    opacity: 1;
}
.cphos-slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
/* 导航点样式 */
.cphos-slideshow-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 100;
}

.cphos-nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.cphos-nav-dot:hover,
.cphos-nav-dot.active {
    background: rgba(255, 255, 255, 0.9);
    border-color: #1e3a8a;
    transform: scale(1.2);
}

/* 轮播图片本身左右虚化遮罩（图片内30px） */
.cphos-slide-inner {
    position: relative;
    width: 100%;
    height: 100%;
}
.cphos-slide-inner::before,
.cphos-slide-inner::after {
    content: "";
    position: absolute;
    top: 0;
    width: 60px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}
.cphos-slide-inner::before {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,10,0.9) 0%, rgba(250,250,250,0) 100%);
}
.cphos-slide-inner::after {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,10,0.9) 0%, rgba(250,250,250,0) 100%);
}
/* 轮播图片左右虚化遮罩（仅在margin区域） */
.cphos-slideshow-container::before,
.cphos-slideshow-container::after {
    content: "";
    position: absolute;
    top: 0;
    width: 120px; /* 仅margin区域 */
    height: 100%;
    z-index: 10;
    pointer-events: none;
}
.cphos-slideshow-container::before {
    left: -120px;
    background: linear-gradient(to right,
        rgba(0,0,0,1) 0%,
        rgba(0,0,10,1) 100%
    );
    opacity: 1;
}
.cphos-slideshow-container::after {
    right: -120px;
    background: linear-gradient(to left,
        rgba(0,0,0,1) 0%,
        rgba(0,0,10,1) 100%
    );
    opacity: 1;
}
/* 响应式设计 */
@media (max-width: 768px) {
    .cphos-slideshow-container {
        height: 250px;
        width: 100vw;
        margin: 0;
        padding: 0;
    }
    .cphos-nav-dot {
        width: 10px;
        height: 10px;
    }
    .cphos-slideshow-nav {
        bottom: 15px;
        gap: 8px;
    }
}
@media (max-width: 480px) {
    .cphos-slideshow-container {
        height: 200px;
        width: 100vw;
        margin: 0;
        padding: 0;
    }
    .cphos-slideshow-nav {
        bottom: 10px;
    }
}

/* 轮播图片左下角橙色标签 */
.cphos-slide-tag {
    position: absolute;
    left: 0;
    bottom: 0;
    margin: 0 0 120px 60px;
    padding: 6px 18px;
    background: #f59e0b;
    color: #fff;
    font-size: 1.08rem;
    font-weight: 600;
    border-radius: 12px 12px 12px 12px;
    opacity: 1;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    pointer-events: none;
    user-select: none;
}

/* 轮播图片左下角描述文本 */
.cphos-slide-desc {
    position: absolute;
    left: 0;
    bottom: 0;
    margin: 0 0 60px 50px;
    padding: 0 18px 10px 18px;
    font-size: 1.3rem;
    color: #fff;
    font-weight: 400;
    z-index: 10;
    text-shadow: 0 2px 8px rgba(0,0,0,0.45), 0 1px 2px rgba(0,0,0,0.7);
    pointer-events: none;
    user-select: none;
}

/* 轮播左右切换箭头按钮 */
.cphos-slideshow-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 60px;
    border: none;
    background: rgba(60,60,60,0.38);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    outline: none;
}
.cphos-slideshow-arrow-left {
    left: 18px;
}
.cphos-slideshow-arrow-right {
    right: 18px;
}
/* 默认状态 */
.cphos-slideshow-arrow {
  background: rgba(60,60,60,0.38); /* 初始透明度 */
  transition: background 0.2s, box-shadow 0.2s;
}
/* 悬停状态 */
.cphos-slideshow-arrow:hover {
  background: rgba(60,60,60,0.55) !important; /* 加深透明度 */
}
.cphos-slideshow-arrow:active,
.cphos-slideshow-arrow:focus {
  outline: none;
  box-shadow: none;
  background: rgba(60,60,60,0.38);
}
.cphos-arrow-icon svg {
    display: block;
    width: 24px;
    height: 24px;
    color: #fff;
}
.cphos-arrow-icon path {
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}
@media (max-width: 768px) {
    .cphos-slideshow-arrow {
        width: 36px;
        height: 36px;
    }
    .cphos-slideshow-arrow-left {
        left: 6px;
    }
    .cphos-slideshow-arrow-right {
        right: 6px;
    }
}

/* ===== 轮播下方欢迎文案 ===== */
.cphos-welcome-section {
    width: calc(100vw - 240px);
    margin: 0 auto 32px auto;
    margin-left: 120px;
    margin-right: 120px;
    margin-top: 60px;
    margin-bottom: 60px;
    text-align: center;
    padding-top: 16px;
}
.cphos-welcome-title {
    font-size: 3.2rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 30px;
    letter-spacing: 1px;
}
.cphos-welcome-subtitle {
    font-size: 1.6rem;
    color: #666;
    font-weight: 400;
    letter-spacing: 0.5px;
}
@media (max-width: 768px) {
    .cphos-welcome-section {
        width: 100vw;
        margin: 0 0 24px 0;
        padding-top: 10px;
    }
    .cphos-welcome-title {
        font-size: 1.3rem;
    }
    .cphos-welcome-subtitle {
        font-size: 0.95rem;
    }
}

/* ===== 组织介绍 ===== */
.cphos-org-intro {
    max-width: 1200px;
    margin: 24px auto 0 auto;
    font-size: 1.08rem;
    color: #222;
    line-height: 1.9;
    background: #f8fafc;
    border-radius: 10px;
    padding: 0 32px 0 32px;
    box-shadow: 0 2px 12px rgba(30,58,138,0.06);
    box-sizing: border-box;
    overflow: hidden;
    transition: box-shadow 0.3s;
}
@media (max-width: 1000px) {
    .cphos-org-intro {
        padding-left: 18px;
        padding-right: 18px;
    }
}

@media (max-width: 600px) {
    .cphos-org-intro {
        padding-left: 8px;
        padding-right: 8px;
    }
}

.cphos-org-intro p {
    margin-bottom: 1.2em;
}

/* 组织简介可折叠样式 */
.cphos-org-intro-collapsible {
    padding-top: 0;
    padding-bottom: 0;
}
.cphos-org-intro-header {
    position: relative;
    cursor: pointer;
    user-select: none;
    background: none;
    border: none;
    outline: none;
    padding: 28px 0 0 0;
    margin-bottom: 0;
    z-index: 2;
}
.cphos-org-intro-header.cphos-intro-open {
    background: none;
}

/* 组织简介标题文本单独样式，防止按钮影响居中 */
.cphos-org-intro-title-text {
    flex: 0 0 auto;
    display: inline-block;
}

.cphos-intro-toggle-btn {
    position: absolute;
    right: 0;
    top: 50%;
    margin: 0;
    z-index: 2;
    background: transparent !important;
    border: none;
    padding: 0 10px;
    font-size: 1.3rem;
    color: #1e3a8a;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    display: flex;
    align-items: center;
}
.cphos-intro-toggle-btn:hover .cphos-intro-arrow {
    color: #1741a0;
}
.cphos-intro-arrow {
    font-size: 1.3rem;
    display: inline-block;
    transition: color 0.2s;
}
.cphos-intro-toggle-btn:active .cphos-intro-arrow,
.cphos-intro-toggle-btn:focus .cphos-intro-arrow,
.cphos-intro-toggle-btn.cphos-intro-open .cphos-intro-arrow {
    color: #1e3a8a !important;
}
.cphos-org-intro-content {
    padding: 0 0 28px 0;
    animation: cphos-intro-fadein 0.4s;
}
@keyframes cphos-intro-fadein {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 卡片标题 ===== */
.cphos-card-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--cphos-dark-blue, #1e3a8a);
    margin-bottom: 18px;
    letter-spacing: 0.5px;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cphos-card-title::before,
.cphos-card-title::after {
    content: '';
    display: inline-block;
    width: 36px;
    height: 3px;
    background: var(--cphos-dark-blue, #1e3a8a);
    border-radius: 2px;
}

/* ===== 往届文章及活动背景框 ===== */
.cphos-previous-articles,
.cphos-previous-events {
    max-width: 1200px;
    margin: 24px auto 0 auto;
    color: #222;
    line-height: 1.9;
    background: #f8fafc;
    border-radius: 10px;
    padding: 28px 32px;
    box-shadow: 0 2px 12px rgba(30,58,138,0.06);
    /* 新增响应式左右边距 */
    box-sizing: border-box;
}

/* ===== 卡片列表与卡片样式 ===== */
.cphos-card-list {
    display: flex;
    flex-direction: row;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 36px;
    flex-wrap: wrap;
}
.cphos-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(30,58,138,0.08);
    overflow: hidden;
    width: 23%;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1.5px solid #e5eaf3;
}
.cphos-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 8px 32px rgba(30,58,138,0.13);
    border-color: #1e3a8a22;
}
.cphos-card-img {
    width: 100%;
    height: 140px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.cphos-card-content {
    padding: 18px 18px 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.cphos-card-label {
    font-size: 0.98rem;
    color: #1e3a8a;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}
.cphos-card-main-title {
    font-size: 1.13rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 7px;
    line-height: 1.3;
}
.cphos-card-desc {
    font-size: 0.98rem;
    color: #555;
    line-height: 1.7;
    flex: 1;
}
@media (max-width: 1100px) {
    .cphos-card-list {
        gap: 18px;
    }
    .cphos-card {
        width: 48%;
        min-width: 180px;
    }
}
@media (max-width: 700px) {
    .cphos-card-list {
        flex-direction: column;
        gap: 18px;
    }
    .cphos-card {
        width: 100%;
        min-width: 120px;
    }
    .cphos-card-img {
        height: 110px;
    }
}