/* 全局样式 */
@font-face {
    font-family: 'VonwaonBitmap';
    src: url('../fonts/VonwaonBitmap-16px.woff2') format('woff2'),
         url('../fonts/ark-pixel-16px-monospaced-zh_hk.otf.woff2') format('woff2'),
         sans-serif;
}

body {
    margin: 0;
    font-family: 'Source Han Sans';
    background-color: var(--background);
    color: #333;
    line-height: 1.6;
    max-width: 1440px;
}

* {
    box-sizing: border-box;
}


:root {
    --surface: #333;
    --background: #333;
    --onPrimaryContainer: #fff;
    --secondaryContainer: #aaa; 
  }

.hero-content, .hero-image {
    box-sizing: border-box;
}

/* 英雄部分样式 */
.hero-section {
    display: flex;
    align-items: stretch; /* 子元素高度拉伸一致 */
    justify-content: space-between;
    padding: 20px;
    gap: 10px;
    min-width: 400px;
}

.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--secondaryContainer);
    border-radius: 30px;
    border-style:solid;
    border-width: 1px;
    border-color: var(--outline);
}

.hero-content-inner {
    padding: 26px 56px 42px;
}

#led-matrix-container {
    width: 100%;
    margin-bottom: 20px;
    background: #000;
    border: 1px solid var(--outline);
    border-radius: 20px;
    overflow: hidden;
    line-height: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

#led-matrix-container canvas {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
}

.hero-content h1 {
    font-size: 96px;
    font-weight: 300;
    line-height: 1.2;
    margin: 0 0 20px 0;
    color: var(--onSecondaryContainer);
}

.hero-content p {
    font-size: 1em;
    margin: -2.5px 0.6em 0 0;
    color: var(--tertiary);
}

.location-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    background-color: var(--tertiaryContainer);
    padding: 10px 15px;
    border-radius: 15px;
    border: 1.5px solid var(--tertiary);
    width: fit-content; /* 紧贴内容 */
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background-color: var(--onSecondaryContainer);
    color: var(--onSecondary);
    text-decoration: none;
    border-radius: 100px;
    font-weight: 500;
    transition: background-color 0.3s;
    height: 40px; /* 统一高度 */
    font-size: 16px; /* 匹配 GO BROMO */
    cursor: pointer;
    border: none;
    font-family: inherit;
    box-sizing: border-box;
}

.btn svg {
    width: 1.8em;
    height: 1.8em;
    fill: currentColor;
}

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

.hero-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-icon {
    width: 40px;
    padding: 0 !important;
}

#dark-mode-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 轮播容器样式 */
.carousel-wrapper {
    position: relative;
    width: fit-content;
    max-width: 100%; /* 确保在手机端不溢出 */
    margin: 0 auto 20px;
    overflow: hidden;
    padding-bottom: 10px;
}

.iwg-carousel {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    min-height: 40px; /* 防止内容清空时高度塌陷 */
    width: 100%;
}

@media (max-width: 450px) {
    .iwg-carousel, .hero-actions {
        gap: 6px;
    }
    .iwg-carousel .btn, .hero-actions .btn {
        padding: 6px 10px;
        font-size: 13px;
        height: 34px;
    }
    .btn-icon {
        width: 34px; /* 图标按钮同步缩小 */
    }
}

/* 进入动画：从右侧滑入并淡入 */
@keyframes slideInRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 退出动画：向左侧滑出并淡出 */
@keyframes slideOutLeft {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-50px); opacity: 0; }
}

.carousel-animate-in {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.carousel-animate-out {
    animation: slideOutLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.progress-bar-container {
    width: 100%;
    height: 3px; /* 调整为 3px */
    background-color: var(--secondaryContainer);
    border-radius: 1px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: color(display-p3 170% 170% 170%); /* 使用指定的 display-p3 颜色 */
    width: 0%;
    transition: none;
}

.progress-bar.active {
    width: 100%;
    transition: width 3s linear;
}

/* 暂停进度条动画 */
.carousel-wrapper:hover .progress-bar.active {
    animation-play-state: paused;
    transition: none; /* 为了让进度停止在当前位置，我们需要配合 JS */
}

/* 呼吸灯效果关键帧 */
@keyframes live-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.05; /* 初始：小且暗 */
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    }
    70% {
        transform: scale(1);
        opacity: 1; /* 到达最亮的同时，圆圈扩散至最远 */
        box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
    }
    100% {
        transform: scale(0.8);
        opacity: 0.2; /* 快速回到初始暗态 */
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

.live-pulse {
    width: 10.5px;
    height: 10px;
    background-color: color(display-p3 1 0.2 0.2); /* 使用广色域 HDR 红色 */
    border-radius: 50%;
    display: inline-block;
    animation: live-pulse 2.2s infinite;
    flex-shrink: 0;
}

.hero-image {
    flex: 1;
    display: flex;
    min-height: 0; /* 允许 flex 子项收缩 */
    background-color: var(--n94-color);
    border-radius: 30px;
    overflow: hidden;
    border-style: solid;
    border-width: 1px;
    border-color: var(--outline);
}

.hero-image a {
    display: flex;
    width: 100%;
    min-height: 0;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-height: 0;
}

/* 新闻部分样式 */
.news-section {
    padding: 10px 20px;
    margin: 10px;
    border-radius: 30px;
    letter-spacing: 1px;
}

.news-section h2 {
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center;
    color: var(--onPrimaryContainer);
}

@media (max-width: 1080px) {
    .hero-section {
        flex-direction: column; /* 改为上下排列 */
        align-items: center; /* 居中对齐 */
        gap: 10px; /* 子元素间距 */
    }

    .hero-content, .hero-image {
        width: 100%; /* 子元素宽度占满 */
        max-width: 1200px; /* 可选：设置最大宽度 */
    }

    .hero-image {
        height: auto; /* 默认高度自动调整 */
        max-height: 100%; /* 确保不会溢出 */
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .hero-image img {
        width: 100%; /* 保持宽度适配 */
        height: auto; /* 防止图片拉伸 */
        max-height: 100%; /* 限制图片高度 */
    }
}

@media (min-width: 1079px) {
    body {
        margin-left: auto;  /* 左边距自动 */
        margin-right: auto; /* 右边距自动 */
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-weight: 500;
        font-size: 3.5rem;
    }
}

@media (max-width: 460px) {
    .hero-content-inner {
        padding: 22px 35px 28px;
    }
}
