/* === 1. 基础全局设置 === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f4f4f4; /* 页面背景色 */
}

/* 禁止滚动类 */
.body-fixed {
    overflow: hidden;
    height: 100vh;
}

/* === 2. 广告位通用布局 === */
.nad-container {
    width: 100%;
    max-width: 100vw;
    margin: 10px auto;
    padding: 0 4px;
}

/* --- 小广告网格 (4列/2列) --- */
.nad-small-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    width: 100%;
    margin-bottom: 12px;
}
@media (min-width: 768px) {
    .nad-small-grid { grid-template-columns: repeat(4, 1fr); }
}

/* --- 大广告网格 (2列/1列) --- */
.nad-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    width: 100%;
}
@media (min-width: 768px) {
    .nad-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- 广告卡片通用样式 --- */
.nad-banner, .nad-small-banner {
    position: relative;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
    background-color: #fff;
}

.nad-banner:hover, .nad-small-banner:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

/* --- 右下角"推广"标签 (精致小尺寸) --- */
.nad-corner-icon {
    position: absolute;
    right: 5px;
    bottom: 5px;
    padding: 2px 5px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 10px;
    border-radius: 3px;
    z-index: 10;
    white-space: nowrap;
    pointer-events: none;
}
@media (max-width: 480px) {
    .nad-corner-icon {
        font-size: 9px;
        padding: 1px 4px;
    }
}

/* === 3. 弹窗基础结构 (通用壳子 & 默认样式) === */
/* 这里定义的是小广告弹窗的样式，以及大广告弹窗继承的基础样式 */

.jj-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(50, 50, 50, 0.7);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow-y: auto;
}

.jj-modal-container {
    width: 92%;
    max-width: 600px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: jjModalFadeIn 0.4s ease-out;
}

/* 滚动区域 */
.jj-modal-scroll {
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #999 #eee;
}
.jj-modal-scroll::-webkit-scrollbar { width: 6px; }
.jj-modal-scroll::-webkit-scrollbar-thumb { background: #999; border-radius: 3px; }
.jj-modal-scroll::-webkit-scrollbar-track { background: #eee; }

/* 内容排版 */
.jj-modal-header img {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: middle;
}
.jj-modal-content {
    padding: 24px;
    color: #444;
}
.jj-modal-content h3 {
    font-size: 20px;
    margin-bottom: 16px;
    color: #333;
    text-align: center;
    font-weight: 600;
}
.jj-modal-content p {
    line-height: 1.8;
    margin-bottom: 12px;
    font-size: 15px;
    text-indent: 2em;
}

/* --- 默认底部按钮栏 (小广告弹窗使用此样式) --- */
/* 这是横向布局，只放2个按钮 */
.jj-modal-footer {
    padding: 16px;
    background: #e9e9e9;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* --- 默认按钮样式 (小广告弹窗使用此样式) --- */
.jj-modal-close, .jj-modal-query {
    width: 120px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
}
.jj-modal-close { background: #999; color: #fff; }
.jj-modal-close:hover { background: #777; }
.jj-modal-query { background: #555; color: #fff; }
.jj-modal-query:hover { background: #333; }

/* === 4. 2026元旦大广告弹窗 (喜庆红金版) === */
/* 这里只写差异样式，完全覆盖基础样式，确保不影响小弹窗 */

#jjNewYearModal .jj-modal-container {
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
    border: 4px solid #FFD700;
    box-shadow: 0 0 30px rgba(255, 59, 48, 0.2);
    position: relative;
}

/* 顶部红条装饰 */
#jjNewYearModal .jj-modal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: #D62400;
    z-index: 1;
}

#jjNewYearModal .jj-modal-header img {
    border-bottom: 4px solid #FFD700;
    border-radius: 12px 12px 0 0;
}

#jjNewYearModal .jj-modal-content {
    padding: 20px 15px;
    position: relative;
}

#jjNewYearModal .jj-modal-content::after {
    content: '2026';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 60px;
    color: rgba(255, 215, 0, 0.08);
    font-weight: 900;
    z-index: 0;
}

#jjNewYearModal .jj-modal-content h3 {
    color: #D62400;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 4px;
    text-shadow: 1px 1px 0 #FFD700;
    font-family: "Ma Shan Zheng", "STKaiti", "SimHei", sans-serif;
    position: relative;
    z-index: 1;
}

#jjNewYearModal .jj-modal-content p {
    background: rgba(255, 255, 255, 0.8);
    padding: 8px;
    border-radius: 6px;
    position: relative;
    z-index: 1;
}

/* --- 核心：大广告专属 Footer (2x2 网格) --- */
/* 强制覆盖掉上面的 flex 布局 */
#jjNewYearModal .jj-modal-footer {
    background: linear-gradient(135deg, #D62400, #B91C1C);
    border-top: 3px solid #FFD700;
    padding: 15px;
    border-radius: 0 0 12px 12px;
    
    /* 改为 Grid 布局 */
    display: grid !important; 
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* --- 大广告专属按钮样式 (.jj-modal-btn) --- */
/* 这里不使用默认的 .jj-modal-close/query 类名，而是用 .jj-modal-btn 区分 */
#jjNewYearModal .jj-modal-btn {
    height: 45px;
    line-height: 45px;
    text-align: center;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
    position: relative;
    top: 0;
    transition: all 0.15s ease;
}

#jjNewYearModal .jj-modal-btn:active {
    top: 3px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

#jjNewYearModal .jj-modal-btn span {
    font-size: 18px;
}

/* 按钮配色 */
#jjNewYearModal .jj-modal-info {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    color: #1565C0;
    border: 1px solid #90CAF9;
}
#jjNewYearModal .jj-modal-party {
    background: linear-gradient(135deg, #F3E5F5, #E1BEE7);
    color: #7B1FA2;
    border: 1px solid #CE93D8;
}
#jjNewYearModal .jj-modal-query {
    /* 注意：这里重写了 .jj-modal-query，只在大弹窗内生效 */
    width: auto !important; /* 取消默认宽度限制 */
    background: linear-gradient(135deg, #FFF9C4, #FFECB3);
    color: #FF6F00;
    border: 1px solid #FFD54F;
}
#jjNewYearModal .jj-modal-close {
    /* 注意：这里重写了 .jj-modal-close，只在大弹窗内生效 */
    width: auto !important; /* 取消默认宽度限制 */
    background: linear-gradient(135deg, #F5F5F5, #EEEEEE);
    color: #555;
    border: 1px solid #DDD;
}

/* === 5. 动画 === */
@keyframes jjModalFadeIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
