/* 首页样式 */

html.home-root,
body.home-page {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    background-color: #7ec0f5;
}

body.home-page {
    background: linear-gradient(180deg, #5aabf0 0%, #c8e8fc 45%, #9fd0f8 100%);
}

/* 全屏背景：与 ghdt-page-bg 一致，fixed 铺满视口避免移动端左右留白 */
.home-page-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: #7ec0f5;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    background-image: url('../assets/images/home/home_bg_mobile.jpg');
    pointer-events: none;
}

/* 主要内容区域 */
.main-content {
    min-height: 100vh;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* 英雄区域 */
.hero-section {
    position: relative;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
}

/* 旧版内嵌背景容器（保留类名兼容，实际背景已移至 .home-page-bg） */
.hero-bg {
    display: none;
}

/* 中间按钮组 */
.hero-middle-actions {
    position: absolute;
    right: 0;
    top: 25%;
    opacity: 0;
    transform: translate(0, -50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0;
    animation: fadeInRightMid 0.8s ease-out 0.5s forwards;
}

/* 无样式按钮class - 移除Bootstrap按钮默认样式 */
.btn-no-style {
    all: unset;
    cursor: pointer;
    line-height: 0;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
    touch-action: manipulation;
    outline: none;
    display: block;
}

.btn-no-style:active,
.btn-no-style:focus {
    opacity: 1;
    outline: none;
}

.hero-middle-actions .btn-icon {
    width: 62px;
    height: auto;
    object-fit: contain;
    transition: all 0.3s ease;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.hero-middle-actions .btn-no-style:hover .btn-icon {
    transform: scale(1.1);
    filter: brightness(1.2);
}

/* 右侧淡入动画（与其他元素一致的节奏） */
@keyframes fadeInRightMid {
    from {
        opacity: 0;
        transform: translate(20px, -50%); /* 从右侧20px进入，同时保持垂直居中 */
    }
    to {
        opacity: 1;
        transform: translate(0, -50%);
    }
}

/* 内容层 */
.hero-content {
    position: relative;
    z-index: 5;
    width: 100%;
    min-height: 100vh;
    padding: 0;
}

.home-layout {
    position: relative;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.home-header-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo和标题区域 */
.hero-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-section {
    margin-bottom: 1rem;
}

.logo-brand {
    max-width: 200px;
    height: auto;
}

.title-section {
    margin-bottom: 1rem;
}

.main-title-text {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
    letter-spacing: 2px;
}

/* Logo区域 */
.home-logo-section {
    text-align: center;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.home-logo {
    max-width: 50px;
    height: auto;
}

/* 标题区域 */
.home-title-section {
    text-align: center;
    margin-bottom: 2rem;
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.home-title-mobile {
    max-width: 300px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.home-title-pc {
    max-width: 800px;
    height: auto;
    display: none;
    margin: 1rem auto 4rem auto;
}

/* 主办单位区域 */
.home-organizer-section {
    text-align: center;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
    width: 100%;
    display: flex;
    justify-content: center;
}

.home-organizer {
    max-width: 400px;
    height: auto;
    display: block;
}

/* 项目选择区域 */
.project-selection {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out 0.8s forwards;
}

.project-card {
    position: relative;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.project-card-img {
    width: 100%;
    height: auto;
    display: block;
}

.project-card-img-pc {
    display: none;
}

/* 活动状态图片（右下角） */
.activity-state-image {
    position: absolute;
    bottom: 0rem;
    right: 0rem;
    z-index: 3;
}

.state-img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.project-image {
    margin-bottom: 1rem;
}

.project-title-img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
}

.project-meta {
    margin-bottom: 1.5rem;
}

.event-time {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.project-workers {
    margin-top: 1rem;
}

.workers-image {
    max-width: 150px;
    height: auto;
    border-radius: 8px;
}

/* 响应式设计 */
@media (max-width: 767px) {
    .hero-section {
        min-height: 100vh;
        height: auto;
        align-items: flex-start;
        overflow-x: hidden;
        overflow-y: visible;
    }

    .hero-content {
        height: auto;
        min-height: auto;
    }

    .home-layout {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        height: auto;
        min-height: auto;
        max-width: 100%;
        padding: 0.5rem 0.75rem 1.5rem;
    }

    /* 头部固定在顶部 */
    .home-header-group {
        flex: 0 0 auto;
        width: 100%;
        padding-top: 0.25rem;
        gap: 0;
    }

    .home-logo {
        width: 15%;
        max-width: 15%;
        height: auto;
        display: block;
        margin: 0 auto;
    }

    .home-logo-section {
        margin: 0;
        padding: 0;
        width: 100%;
        line-height: 0;
        font-size: 0;
    }

    .home-title-section {
        margin: -14px 0 0;
        padding: 0;
        width: 100%;
        line-height: 0;
        font-size: 0;
    }

    .home-title-mobile {
        max-width: min(480px, 98vw);
        width: 100%;
        display: block;
        margin: 0 auto;
        vertical-align: top;
    }

    /* 卡片顶部对齐屏幕中线：50vh 减去头部区域预估高度 */
    .project-selection {
        flex: 0 0 auto;
        width: 100%;
        max-width: none;
        margin: max(0.5rem, calc(50vh - 14rem)) auto 0;
        padding: 0;
        gap: 0.5rem;
    }

    .home-organizer-section {
        margin-bottom: 0;
        width: 100%;
    }

    .home-organizer {
        max-width: 200px;
        width: auto;
        margin: 0 auto;
    }

    .hero-middle-actions {
        top: 25%;
        transform: none;
        animation: fadeInRightMobile 0.8s ease-out 0.5s forwards;
    }

    @keyframes fadeInRightMobile {
        from {
            opacity: 0;
            transform: translate(20px, 0);
        }
        to {
            opacity: 1;
            transform: translate(0, 0);
        }
    }

    .state-img {
        height: 20px;
    }

    .activity-state-image {
        bottom: 0;
        right: 0;
    }
}

@media (min-width: 768px) {
    .home-page-bg {
        background-image: url('../assets/images/home/home_bg_pc.jpg');
        background-position: center center;
    }

    .hero-section {
        align-items: center;
        height: auto;
    }

    .hero-content {
        padding: 2rem 0 5rem;
        height: auto;
        min-height: auto;
    }

    .home-layout {
        display: block;
        height: auto;
        min-height: auto;
        padding-left: 15px;
        padding-right: 15px;
    }

    .home-header-group {
        position: static;
        padding: 0;
    }

    .project-selection {
        position: static;
        margin-top: 0;
    }
    
    .hero-middle-actions {
        flex-direction: column;
        gap: 0rem;
        right: 0px; /* PC端也紧贴屏幕右侧 */
        top: 50%;
    }
    
    .hero-middle-actions .btn-icon {
        width: 100px;
        height: auto;
    }
    
    /* PC端标题显示 */
    .home-title-mobile {
        display: none;
    }
    
    .home-title-pc {
        display: block;
    }
    
    /* PC端调整间距 */
    .home-logo-section {
        margin-bottom: 1.5rem;
    }
    
    .home-title-section {
        margin-bottom: 1.5rem;
    }
    
    .home-organizer-section {
        margin-bottom: 1.5rem;
    }
    
    /* PC端主办单位图片更大 */
    .home-organizer {
        max-width: 500px;
        margin-bottom: 2rem;
    }
    
    .main-title-text {
        font-size: 2.5rem;
    }
    
    .project-selection {
        flex-direction: row;
        align-items: stretch;
        gap: 1.5rem;
        max-width: min(1400px, 92vw);
        padding: 0 2rem;
    }
    
    .project-card {
        flex: 1;
        min-width: 0;
        max-width: none;
    }

    .project-card-img-mobile {
        display: none;
    }

    .project-card-img-pc {
        display: block;
    }
    
    .state-img {
        height: 24px;
    }
    
    .activity-state-image {
        bottom: 0rem;
        right: 0rem;
    }
    
    .project-title-img {
        max-width: 250px;
    }
    
    .workers-image {
        max-width: 180px;
    }
}

@media (min-width: 1200px) {
    .main-title-text {
        font-size: 3rem;
    }
    
    .project-selection {
        max-width: min(1500px, 94vw);
        gap: 2rem;
    }
    
    .state-img {
        height: 30px;
    }
    
    .activity-state-image {
        bottom: 0rem;
        right: 0rem;
    }
}

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

/* 加载状态 */
.loading-text {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* 活动规则弹窗样式优化 */
#eventRulesModal .modal-dialog.modal-lg {
    max-width: 600px !important;
    margin: 1.75rem auto !important;
    display: flex !important;
    align-items: center !important;
    min-height: calc(100vh - 3.5rem) !important;
}

#eventRulesModal .modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

#eventRulesModal .modal-header {
    background: linear-gradient(135deg, rgba(16, 154, 241, 0.05), rgba(34, 212, 206, 0.05)) !important;
    border-bottom: 1px solid rgba(16, 154, 241, 0.1) !important;
    padding: 1rem 1rem 1rem !important;
    border-radius: 20px 20px 0 0 !important;
}

#eventRulesModal .modal-title {
    color: var(--primary-color) !important;
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    text-shadow: 0 1px 2px rgba(16, 154, 241, 0.2) !important;
}

#eventRulesModal .btn-close {
    /* background: none; */
    border: none !important;
    font-size: 1.0rem !important;
    color: var(--text-secondary) !important;
    opacity: 0.7 !important;
    transition: all 0.3s ease !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
}

#eventRulesModal .modal-body {
    padding: 2rem;
}

/* 活动规则内容样式 */
#event-rules-content {
    line-height: 1.8;
    color: var(--text-primary);
}

#event-rules-content h4 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(16, 154, 241, 0.2);
}

#event-rules-content h5 {
    color: var(--primary-color);
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
    font-size: 1.1rem;
}

#event-rules-content p {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

#event-rules-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

#event-rules-content li {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

#event-rules-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

#event-rules-content .highlight {
    background: rgba(16, 154, 241, 0.08);
    border: 1px solid rgba(16, 154, 241, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

#event-rules-content .highlight p {
    margin-bottom: 0.5rem;
}

#event-rules-content .highlight p:last-child {
    margin-bottom: 0;
}

/* 响应式优化 */
@media (max-width: 768px) {
    #eventRulesModal .modal-dialog.modal-lg {
        margin: 1rem !important;
        max-width: calc(100% - 2rem) !important;
    }
    
    #eventRulesModal .modal-header,
    #eventRulesModal .modal-body {
        padding: 1.25rem 1.5rem;
    }
    
    #eventRulesModal .modal-title {
        font-size: 1.2rem;
    }
    
    #event-rules-content h4 {
        font-size: 1.1rem;
    }
    
    #event-rules-content h5 {
        font-size: 1rem;
    }
    
    #event-rules-content p,
    #event-rules-content li {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    #eventRulesModal .modal-dialog.modal-lg {
        margin: 1rem !important;
        max-width: calc(100% - 2rem) !important;
    }
    
    #eventRulesModal .modal-header,
    #eventRulesModal .modal-body {
        padding: 1rem 1.25rem;
    }
    
    #eventRulesModal .modal-title {
        font-size: 1.1rem;
    }
    
    #event-rules-content h4 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    #event-rules-content h5 {
        font-size: 0.95rem;
        margin: 1.25rem 0 0.5rem 0;
    }
    
    #event-rules-content p,
    #event-rules-content li {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    #event-rules-content .highlight {
        padding: 0.75rem;
        margin: 0.75rem 0;
    }
}
