* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

.container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 加载指示器 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.mb-2 {
    margin-bottom: 2rem;
}

.p-2 {
    padding: 2rem 0;
}

.pb-2 {
    padding-bottom: 2rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 头部 */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
    position: relative;
}

/* 左侧区域样式 */
.header-left {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.logo,
.mobile-logo {
    display: flex;
    align-items: center;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
    letter-spacing: 1px;
}

.desktop-nav {
    display: flex;
    gap: 2.5rem;
}

.desktop-nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
}

.desktop-nav a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    color: var(--primary-color);
}

/* 右侧区域样式 */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 我的报名文字按钮 */
.my-registration-btn {
    background: none;
    border: none;
    color: #333;
    padding: 0;
    font-size: 0.875rem;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.3s ease;
    margin-right: 0.75rem;
}

.my-registration-btn:hover {
    color: var(--primary-color);
}

.header-right .language-switch {
    margin-right: 0.75rem;
}

/* 语言切换按钮 */
.lang-btn {
    background: none;
    border: none;
    color: #666;
    padding: 0;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    outline: none;
    box-shadow: none;
}

.lang-btn:hover {
    color: #666;
}

/* 立即报名按钮 */
.register-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 0.8rem;
    border-radius: 0.4rem;
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
}

.register-btn:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

/* 移动端菜单 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem;
    z-index: 1001;
    min-width: 44px;
    min-height: 44px;
    position: relative;
}

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background: #333;
    margin: 2px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* 移动端菜单覆盖层 */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 0;
    max-height: 100vh;
    background: white;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateY(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-logo h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.mobile-menu-close:hover {
    color: var(--primary-color);
}

.mobile-navigation {
    flex: 0 0 auto;
    padding: 1rem 1.5rem;
    min-height: fit-content;
}

.mobile-navigation a {
    display: block;
    color: #333;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-navigation a:last-child {
    border-bottom: none;
}

.mobile-navigation a:hover,
.mobile-navigation a.active {
    color: var(--primary-color);
    padding-left: 1rem;
    margin-left: -1rem;
    margin-right: -1rem;
}

.mobile-menu-footer {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    flex: 0 0 auto;
}

.mobile-actions {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.mobile-lang-btn {
    background: none;
    border: none;
    color: #666;
    padding: 0;
    font-size: 1rem;
    cursor: pointer;
    text-align: left;
    outline: none;
    box-shadow: none;
}

.mobile-lang-btn:hover {
    color: #666;
}

.mobile-register-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Mobile specific buttons (Home, Lang) in header */
.mobile-home-btn,
.header-mobile-lang-btn {
    display: none;
}

/* 主内容 */
.main {
    min-height: calc(100vh - 200px);
}

.content {
    /* 背景色由JavaScript动态设置，不在CSS中固定 */
}

/* 布局容器 */
.layout-container {
    display: grid;
    gap: 3rem;
}

/* 左右排列布局 */
.layout-horizontal {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
}

.layout-wrap {
    flex-wrap: wrap;
}

.layout-horizontal .layout-left {
    flex: 1;
}

.layout-horizontal .layout-right {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 横排依次排列 */
.layout-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.layout-row>.content-item {
    flex: 1;
    min-width: 200px;
}

/* 上下依次排列 */
.layout-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 移动端两列布局 */
.layout-mobile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.layout-mobile-grid .content-item {
    width: 100% !important;
    margin-bottom: 0 !important;
}

.layout-mobile-grid .content-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* type=0特殊布局：左右分栏 */
.layout-special-left-right {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.layout-left-column {
    flex: 1;
    min-width: 0;
}

.layout-right-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* 内容元素 */
.content-item {
    /* 移除固定背景色，让元素自动继承父级背景色 */
    border-radius: 8px;
}

.content-item img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.content-item video {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.content-item h2 {
    margin-bottom: 1rem;
    color: var(--primary-color, #007bff);
}

.content-item p {
    line-height: 1.8;
    color: #666;
}

/* 单图海报样式 - 宽度平铺屏幕 */
.single-image {
    width: 100%;
    text-align: center;
    position: relative;
}

.single-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* 确保单图海报在容器中正确显示 */
.content-item .single-image {
    margin-left: 0;
    margin-right: 0;
}

/* 确保单图海报突破所有容器限制 */
.content-item.full-width {
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
}

.content-item.full-width .single-image {
    margin-top: 0;
}

/* 单图海报专用样式 - category为1时的整屏显示 */
.content-item.single-poster {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 0;
    position: relative;
    box-sizing: border-box;
}

.content-item.single-poster .single-image {
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.content-item.single-poster .single-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: 0 !important;
}

/* 布局中的单图海报样式 */
.content-item.layout-single-poster {
    position: relative;
    box-sizing: border-box;
}

.content-item.layout-single-poster .single-image {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.content-item.layout-single-poster .single-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.content-item.layout-single-poster .single-image:hover img {
    transform: scale(1.05);
}

/* 响应式布局 */
@media (max-width: 768px) {

    /* Header响应式 */
    .header-content {
        padding: 0.75rem 0;
    }

    .header-left {
        gap: 0;
        flex: 1;
    }

    .desktop-nav {
        display: none;
    }

    /* Hide desktop specific elements */
    .header-right .language-switch,
    .header-right .register-btn-container,
    .my-registration-btn {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .header-right {
        gap: 0.5rem;
        justify-content: flex-end;
    }

    /* Mobile Header Buttons */
    .mobile-home-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        margin-right: 0.5rem;
    }
    
    .mobile-home-btn img {
        width: 18px;
        height: 18px;
        object-fit: contain;
    }

    .header-mobile-lang-btn {
        display: flex !important; /* Ensure visibility */
        align-items: center;
        justify-content: center;
        height: 32px;
        font-size: 1rem;
        font-weight: 500;
        color: #333;
    }

    /* 单图海报响应式 */
    .single-image {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .content-item.full-width {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .content-item.full-width .single-image {
        margin-left: 0;
        margin-right: 0;
    }

    /* 移动端菜单优化 */
    .mobile-menu-content {
        max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }

    .mobile-navigation {
        max-height: calc(60vh - 120px);
        overflow-y: auto;
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }

    .mobile-menu-overlay {
        display: none;
    }
}

/* 用户自定义轮播图样式 */
.carousel.carousel--user-defined .carousel-image {
    object-fit: contain; /* 确保图片完整显示，不裁剪 */
}

/* 轮播图 */
.carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    /* 使用16:10比例计算高度 */
    aspect-ratio: 16 / 10;
    min-height: 300px;
    /* 最小高度确保在小屏幕上的可视性 */
    max-height: 600px;
    /* 最大高度避免过度拉伸 */
}

.carousel-container {
    display: flex;
    transition: transform 0.3s ease;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
    width: 100%;
    height: 100%;
    /* 完全填充容器高度 */
    overflow: hidden;
    flex-shrink: 0;
    /* 防止幻灯片收缩 */
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 保持原始比例，完美填充容器 */
    object-position: center;
    /* 图片居中显示 */
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    border-radius: 0 !important;
}

/* 轮播图导航按钮 */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(156, 154, 154, 0.3);
    color: #222;
    border: none;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    line-height: 1;
    font-family: Arial, sans-serif;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-nav:hover {
    background: rgba(156, 154, 154, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
    left: 15px;
}

.carousel-nav.next {
    right: 15px;
}

/* 轮播图导航按钮图标容器 */
.carousel-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
    font-style: normal;
    text-align: center;
    padding-bottom: 5px;
    box-sizing: border-box;
}

/* 轮播图指示器 */
.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: #ffffff;
}

/* 底部 */
.footer {
    width: 100%;
    color: white;
}

.footer-content {
    text-align: center;
}

/* 首尾布局块的间距控制 */
.footer-content > .layout-container.layout-horizontal:first-child {
    padding: 2rem 0 0rem 0 !important;
}
.footer-content > .layout-container.layout-horizontal:nth-child(2) {
    padding: 1rem 0 2rem 0 !important;
}

.footer-content>*:last-child {
    padding: 1rem 0;
}

.footer-content > .layout-container.layout-vertical.has-multiple-vertical {
    padding: 1rem 0 0rem 0 !important;
}

/* 空数据占位 */
.empty-placeholder {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.empty-content {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
}

.empty-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.empty-text {
    font-size: 1.2rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.6;
    font-weight: 500;
}

/* 主内容区域空数据占位 */
.content-empty-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 3rem 1rem;
}

.content-empty-content {
    text-align: center;
    max-width: 400px;
}

.content-empty-image {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

.content-empty-text {
    font-size: 1.1rem;
    color: #8e8e93;
    margin: 0;
    line-height: 1.5;
    font-weight: 400;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .navigation.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .navigation ul {
        flex-direction: column;
        padding: 1rem;
        gap: 0;
    }

    .navigation a {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid #eee;
    }

    .layout-horizontal {
        flex-direction: column;
    }

    .layout-row {
        flex-direction: column;
    }

    /* 移动端特殊布局改为垂直排列 */
    .layout-special-left-right {
        flex-direction: column;
        gap: 1.5rem;
    }

    .layout-left-column,
    .layout-right-column {
        flex: none;
        width: 100%;
    }

    .container {
        padding: 0 1.5rem;
    }

    /* 移动端全屏轮播图调整 */
    .carousel {
        /* 保持16:10比例，但调整移动端的限制值 */
        aspect-ratio: 16 / 10;
        min-height: 200px;
        /* 移动端最小高度 */
        max-height: 400px;
        /* 移动端最大高度 */
        margin: 0.5rem 0;
        /* 减少移动端边距 */
    }

    /* 移动端轮播图导航按钮调整 */
    .carousel-nav {
        width: 35px;
        height: 35px;
        font-size: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        font-family: Arial, sans-serif;
    }

    .carousel-nav.prev {
        left: 10px;
    }

    .carousel-nav.next {
        right: 10px;
    }

    /* 移动端轮播图导航按钮图标容器 */
    .carousel-nav-icon {
        font-size: 28px;
    }

    /* 移动端轮播图指示器调整 */
    .carousel-dots {
        bottom: 10px;
        gap: 6px;
    }

    .carousel-dot {
        width: 8px;
        height: 8px;
    }

    /* 移动端空数据占位样式 */
    .empty-content {
        max-width: 300px;
        padding: 1.5rem;
    }

    .empty-image {
        width: 150px;
        height: 150px;
        margin-bottom: 1.5rem;
    }

    .empty-text {
        font-size: 1rem;
    }

    /* 移动端主内容区域空数据占位样式 */
    .content-empty-placeholder {
        min-height: 300px;
        padding: 2rem 1rem;
    }

    .content-empty-content {
        max-width: 280px;
    }

    .content-empty-image {
        width: 120px;
        height: 120px;
        margin-bottom: 1rem;
    }

    .content-empty-text {
        font-size: 1rem;
    }
}

/* 应用初始化失败占位图样式 */
.init-error-placeholder {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.init-error-content {
    text-align: center;
    max-width: 500px;
    padding: 2rem;
}

.init-error-image {
    width: 200px;
    height: auto;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.init-error-title {
    font-size: 1.5rem;
    color: #dc3545;
    margin-bottom: 1rem;
    font-weight: 600;
}

.init-error-text {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.init-error-retry {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.init-error-retry:hover {
    background: #0056b3;
}

/* Floating Registration Button */
.floating-register-btn {
    display: none;
}

@media (max-width: 768px) {
    .floating-register-btn {
        display: flex;
        position: fixed;
        right: 0;
        bottom: 40vh;
        z-index: 999;
        background-color: #3B82F6;
        border-top-left-radius: 24px;
        border-bottom-left-radius: 24px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        color: white;
        align-items: center;
        padding: 8px 12px;
        transition: all 0.3s ease;
    }

    .floating-content {
        display: flex;
        align-items: center;
        white-space: nowrap;
    }

    .floating-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 0;
        opacity: 0;
        margin-right: 0;
        overflow: hidden;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .floating-register-btn.collapsed .floating-toggle {
        width: 16px;
        opacity: 1;
        margin-right: 8px;
    }

    .floating-toggle img {
        width: 16px;
        height: 16px;
        transition: transform 0.3s;
        /* Expanded: Point right (>) to indicate collapse */
        transform: rotate(180deg);
        filter: brightness(0) invert(1);
    }
    
    .floating-register-btn.collapsed .floating-toggle img {
        /* Collapsed: Point left (<) to indicate expand */
        transform: rotate(0deg); 
    }

    .floating-main {
        display: flex;
        align-items: center;
        cursor: pointer;
    }

    .floating-icon {
        width: 20px;
        height: 20px;
        filter: brightness(0) invert(1);
    }

    .floating-text {
        margin-left: 6px;
        font-size: 14px;
        font-weight: 500;
        opacity: 1;
        max-width: 100px;
        overflow: hidden;
        transition: all 0.3s ease;
    }

    .floating-register-btn.collapsed .floating-text {
        opacity: 0;
        max-width: 0;
        margin-left: 0;
    }
}