/* 全局设定与背景 */
html, body {
    height: 100%; /* 基础垫底 */
    touch-action: manipulation;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-image: url('images/desktop-bg.jpg'); 
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    color: #fff; 
    
    /* 核心魔法：使用 dvh 彻底解决 iOS Chrome 底部被遮挡问题 */
    height: 100vh; /* 老版本浏览器回退方案 */
    height: 100dvh; /* 动态视口高度，适配移动端工具栏 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 768px) {
    body {
        background-image: url('images/mobile-bg.jpg'); 
    }
}

/* 屏幕两侧各留出 10% 空白 (宽度80%自动居中) */
.content-wrapper {
    width: 80%;
    margin: 0 auto;
}

/* --- 顶部固定区域 --- */
.fixed-header {
    flex-shrink: 0;
    padding: 20px 0 15px 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3); /* 顶部横线分割 */
    background: rgba(0, 0, 0, 0.1); /* 微微压暗背景确保标题清晰 */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

h1 {
    text-align: center;
    font-size: 1.8rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* --- 中间滑动区域 --- */
.scrollable-content {
    flex-grow: 1; /* 撑满中间剩余空间 */
    overflow-y: auto; /* 允许内部上下滑动 */
    -webkit-overflow-scrolling: touch; /* 增强苹果设备滑动流畅度 */
    padding: 20px 0 40px 0;
}

/* 隐藏中间区域滚动条，视觉更高级 */
.scrollable-content::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.notice-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 30px;
    font-size: 0.9rem;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

h2 {
    font-size: 1.4rem; /* 增大字号 */
    font-weight: 800; /* 加粗 */
    margin-top: 15px;
    margin-bottom: 25px;
    padding: 8px 15px; /* 增加内边距 */
    border-left: 5px solid #E60000; /* 加粗左侧红线 */
    /* 增加红色半透明渐变背景，像横幅一样醒目 */
    background: linear-gradient(90deg, rgba(230, 0, 0, 0.78) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 4px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9); /* 加深文字阴影 */
    letter-spacing: 1px;
}

/* --- 极其高级的玻璃卡片设计 --- */
.grid {
    display: grid;
    /* 桌面端自适应排布 */
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 30px 20px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .grid {
        /* 移动端强制每行两个卡片，拉大上下行间距 */
        grid-template-columns: repeat(2, 1fr);
        gap: 35px 15px; 
    }
}

.card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 20px 10px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s, background 0.3s;
}

.card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.25);
}

/* 卡片顶部：名称 */
.card .name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* 卡片中部：扩大 Logo 占比 */
.card img {
    width: 65%; /* 图片占宽度的绝大部分 */
    aspect-ratio: 1 / 1;
    object-fit: contain;
    margin-bottom: 20px;
    /* 给球队标志加上阴影，让它像悬浮在玻璃上 */
    filter: drop-shadow(0px 5px 8px rgba(0, 0, 0, 0.3)); 
}

/* 卡片底部：按钮 */
.card .btn {
    width: 80%;
    background: linear-gradient(135deg, #E60000, #ff4d4d);
    color: #fff;
    padding: 8px 0;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(230, 0, 0, 0.4);
}

/* --- 标签切换区域 --- */
.tabs {
    display: flex !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important; 
    overflow-x: auto !important; 
    /* 强行拉开三个标签按钮之间的【左右间距】 */
    gap: 16px !important; 
    /* 强行拉开标签组与上方“球队订阅”标题的【上间距】 */
    margin-top: 15px !important; 
    /* 强行拉开标签组与下方卡片的【下间距】 */
    margin-bottom: 30px !important; 
    /* 增大内部安全内边距，确保左右滑动丝滑且不切边 */
    padding: 12px 16px !important; 
    -webkit-overflow-scrolling: touch;
}

/* 隐藏横向滚动条 */
.tabs::-webkit-scrollbar {
    display: none !important;
}

/* 隐藏横向滚动条，保持美观 */
.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: rgba(0, 0, 0, 0.45); /* 加深底色，与卡片的玻璃反光拉开对比 */
    border: 2px solid rgba(255, 255, 255, 0.6); /* 加粗边框 */
    color: #fff;
    padding: 10px 22px; /* 增大点击面积（iOS 触控友好） */
    border-radius: 25px;
    font-size: 1.05rem;
    font-weight: bold; /* 加粗字体 */
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    white-space: nowrap; /* 保证文字不换行 */
}

.tab-btn.active {
    background: #E60000;
    border-color: #ff4d4d;
    box-shadow: 0 4px 15px rgba(230, 0, 0, 0.5);
    transform: scale(1.05); /* 选中时微微放大，极其抢眼 */
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- 折叠面板（Accordion）基础与响应式样式 --- */
h2.accordion-header {
    user-select: none; /* 防止移动端连续点击时误选中文字 */
    transition: background 0.3s ease;
}

/* 📱 移动端：启用折叠行为，并显示小箭头 */
@media (max-width: 768px) {
    .accordion-header {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* 注入右侧的小箭头指示器 */
    .accordion-header::after {
        content: '▼';
        font-size: 0.8rem;
        color: rgba(255, 255, 255, 0.6);
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    }
    
    /* 当变为展开激活状态时，小箭头翻转 180 度 */
    .accordion-header.active::after {
        transform: rotate(180deg);
    }
    
    /* 移动端默认全部折叠收起 */
    .accordion-content {
        display: none;
    }
    
    /* 点击展开后显示内容 */
    .accordion-content.open {
        display: block;
    }
}

/* 💻 桌面端：强制保持完全展开，隐藏多余的箭头 */
@media (min-width: 769px) {
    .accordion-content {
        display: block !important; /* 覆盖隐藏属性，确保桌面端永远可见 */
    }
    .accordion-header::after {
        display: none !important; /* 桌面端不需要折叠箭头 */
    }
}

/* --- 底部固定区域 --- */
.fixed-footer {
    flex-shrink: 0;
    padding: 15px 0 20px 0;
    border-top: 2px solid rgba(255, 255, 255, 0.3); /* 底部横线分割 */
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    font-size: 0.85rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.footer-info {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.footer-info a {
    color: #FFD700;
    text-decoration: none;
    font-weight: bold;
}

.stats {
    opacity: 0.8;
}

.tab-content {
    margin-top: 20px !important;
}