/* style.css - 2026 旗舰版 (6列宽屏模式) */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Microsoft YaHei", -apple-system, sans-serif;
    background-color: #e9e9e9;
    font-size: 13px;
    color: #333;
    padding-bottom: 50px;
    /* 极光背景 */
    background-color: #dbeafe; 
    background-image: 
        radial-gradient(at 0% 0%, hsla(210, 90%, 75%, 1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(190, 90%, 70%, 1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(220, 80%, 75%, 1) 0px, transparent 50%);
    background-attachment: fixed;
    background-repeat: no-repeat;
}

a { text-decoration: none; color: #333; transition: color 0.2s; }

.container {
    width: 1200px; margin: 0 auto; 
    /* 毛玻璃容器 */
    background-color: rgba(255, 255, 255, 0.7); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6); 
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
}

/* 顶部工具栏 */
.top-toolbar { background: transparent; border-bottom: 1px solid rgba(255,255,255,0.3); padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; }

/* 跑马灯 */
.marquee-box { background: rgba(255, 251, 230, 0.9); color: #d48806; border-bottom: 1px solid #ffe58f; padding: 8px 15px; display: flex; }
.marquee-label { font-weight: bold; margin-right: 10px; color: #d32f2f; white-space: nowrap; }

/* 广告位 */
.top-banner, .inter-ad { display: block; width: 100%; background: transparent; text-align: center; overflow: hidden; }
.top-banner img, .inter-ad img { width: 100%; display: block; }
.inter-ad { margin: 10px 0; border-top: 1px solid rgba(0,0,0,0.05); border-bottom: 1px solid rgba(0,0,0,0.05); }

/* 分类标题 */
.section-box { border-bottom: 2px solid rgba(255,255,255,0.5); }
.section-head {
    height: 38px; line-height: 38px; padding-left: 20px; color: #fff; font-weight: bold;
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.2), rgba(0,0,0,0.1));
}
.cat-icon { width: 20px; height: 20px; vertical-align: middle; margin-right: 8px; margin-top: -3px; }

/* --- 链接网格布局 (6列) --- */
.link-box { display: flex; flex-wrap: wrap; background-color: rgba(255,255,255,0.6); padding: 5px; }

.link-item-wrapper {
    /* 🔴 核心修改：改为 6 列 (100% / 6 = 16.6666%) */
    width: 16.6666%; 
    
    height: 36px; line-height: 36px; text-align: center;
    border: 1px solid rgba(0,0,0,0.05); margin-left: -1px; margin-top: -1px;
    position: relative; z-index: 1;
}

.link-item-wrapper:hover { z-index: 10; background-color: rgba(255,255,255,0.9); }
.link-item-wrapper:hover > a { color: #d32f2f; }

.link-item {
    display: flex !important; align-items: center; justify-content: center;
    width: 100%; height: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    padding: 0 5px; cursor: pointer;
}
.link-icon { width: 16px; height: 16px; vertical-align: middle; margin-right: 5px; border-radius: 2px; }

.highlight { font-weight: bold; color: #d32f2f; }
.highlight::after { content: '🔥'; font-size: 10px; margin-left: 2px; }

/* --- API 开奖区域 --- */
.api-box { background: rgba(255,255,255,0.8); border: 1px solid rgba(0,0,0,0.1); margin-bottom: 10px; font-size: 12px; }
.api-row { padding: 10px 15px; border-bottom: 1px dashed #ccc; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: #555; }
.api-row:last-child { border-bottom: none; }
.api-title { font-size: 14px; font-weight: bold; color: #333; width: 100px; }
.api-info { color: #1890ff; margin-right: 10px; }
.lotto-balls { display: flex; gap: 5px; align-items: center; }
.ball { width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; color: #fff; font-weight: bold; display: inline-block; }
.bg-red { background-color: #ff3b30; }
.bg-blue { background-color: #007aff; }
.bg-green { background-color: #34c759; }
.zodiac { font-size: 12px; color: #666; margin-left: 2px; margin-right: 5px; }
.api-actions { margin-left: auto; }
.api-actions a { color: #1890ff; margin-left: 8px; }

/* --- 轮播图 --- */
.carousel-container { position: relative; width: 100%; height: 320px; overflow: hidden; margin-bottom: 10px; background: #000; }
.carousel-track { display: flex; transition: transform 0.5s ease-in-out; height: 100%; width: 100%; }
.carousel-slide { min-width: 100%; height: 100%; position: relative; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --- 弹窗样式 --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 9999;
    display: none; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}
.modal-box {
    background: #fff; 
    width: 700px; max-width: 95%;
    border-radius: 8px; box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    overflow: hidden; animation: fadeIn 0.2s;
    display: flex; flex-direction: column;
}
/* 亚星3列布局时，模态框需要更宽 */
.modal-body.yaxin-3col ~ *,
body:has(.modal-body.yaxin-3col) .modal-box {
    width: 1200px;
    max-width: 95%;
}
.modal-header {
    padding: 15px 20px; background: #fff; border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-title { font-size: 18px; font-weight: bold; color: #333; border-left: 5px solid #d32f2f; padding-left: 12px; }
.modal-close { cursor: pointer; font-size: 26px; color: #999; line-height: 1; }
.modal-body { 
    padding: 20px; max-height: 70vh; overflow-y: auto;
    display: grid; grid-template-columns: 1fr 1fr; gap: 15px;
    background: #fafafa;
}
.speed-card {
    background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; padding: 12px;
    cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column;
    position: relative; overflow: hidden;
}
.speed-card:hover { border-color: #d32f2f; box-shadow: 0 4px 12px rgba(211, 47, 47, 0.1); transform: translateY(-2px); }
.line-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.line-name { font-weight: bold; font-size: 14px; color: #333; }
.line-tag { font-size: 10px; padding: 2px 6px; border-radius: 3px; font-weight: normal; }
.tag-vip { background: #fff2e8; color: #fa541c; border: 1px solid #ffbb96; }
.tag-agent { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.tag-normal { background: #f5f5f5; color: #666; border: 1px solid #ddd; }
.line-url { font-size: 12px; color: #999; word-break: break-all; margin-bottom: 8px; line-height: 1.4; font-family: Arial, sans-serif; }
.speed-val { font-size: 14px; font-weight: bold; align-self: flex-start; }
.s-checking { color: #999; }
.s-fast { color: #009944; }
.s-slow { color: #ff3b30; }
@media (max-width: 600px) { .modal-body { grid-template-columns: 1fr; } }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

/* 亚星3列布局样式 */
.modal-body.yaxin-3col {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 15px;
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
}

.yaxin-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0; /* 防止内容溢出 */
    width: 100%;
    box-sizing: border-box;
}

.yaxin-col-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    margin-bottom: 5px;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}

.yaxin-col .speed-card {
    margin: 0;
    min-width: 0; /* 防止内容溢出 */
    width: 100%;
    box-sizing: border-box;
}

/* 响应式设计 */
@media (max-width: 1300px) {
    .modal-body.yaxin-3col {
        gap: 10px;
        padding: 15px;
    }
}

@media (max-width: 900px) {
    .modal-body.yaxin-3col {
        grid-template-columns: 1fr !important;
    }
}