:root {
    --primary: #0062ff;
    --bg: #f4f7fa;
    --card: #ffffff;
    --text-m: #1e293b;
    --text-s: #64748b;
    --danger: #ef4444;
    --success: #10b981;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text-m);
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* 导航栏 */
.navbar {
    background: var(--card);
    padding: 15px 0;
    border-bottom: 1px solid #e2e8f0;
}
.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}
.logo { font-size: 20px; font-weight: 800; text-decoration: none; color: var(--primary); }
.nav-menu a { text-decoration: none; color: var(--text-m); margin-left: 20px; font-size: 14px; font-weight: 500; }

/* 英雄区 & 搜索框 */
.hero { padding: 40px 0 20px; text-align: center; }
.search-container {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background: var(--card);
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}
.search-container input {
    flex: 1;
    border: none;
    padding: 12px 20px;
    font-size: 18px;
    outline: none;
    color: var(--primary);
    font-weight: 600;
}
.search-container button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0 30px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}
.search-container button:hover { opacity: 0.9; }

/* 公告栏 */
.notice-bar {
    background: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e2e8f0;
}
.notice-left { display: flex; align-items: center; }
.notice-tag {
    background: #fff1f2;
    color: #e11d48;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 12px;
    font-weight: bold;
}
.notice-bar a { text-decoration: none; color: var(--text-m); font-size: 14px; }
.refresh-mini-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-s);
}
.refresh-mini-btn:hover { background: #f8fafc; color: var(--primary); }

/* 广告位样式 */
.ad-container {
    position: relative;
    background: #fff;
    padding: 15px 40px 15px 20px;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    margin-bottom: 20px;
}
.ad-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: #f1f5f9;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    color: #94a3b8;
    line-height: 1;
}
.ad-content { font-size: 14px; color: var(--text-s); }

/* 数据网格 */
.data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.card {
    background: var(--card);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
.card .label { display: block; font-size: 13px; color: var(--text-s); margin-bottom: 8px; }
.card .value { font-size: 18px; font-weight: 700; color: var(--text-m); }

.ai-card { background: linear-gradient(135deg, #fff 0%, #f0f7ff 100%); border: 1px solid #dbeafe; }
.ai-header { display: flex; justify-content: space-between; margin-bottom: 12px; border-bottom: 1px solid #e0e7ff; padding-bottom: 8px; }
.ai-body { font-size: 14px; line-height: 1.7; color: #475569; }

.badge { padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: bold; }
.badge.danger { background: #fee2e2; color: #ef4444; }
.badge.success { background: #dcfce7; color: #10b981; }

/* 页脚 */
.footer { background: #1e293b; color: #94a3b8; padding: 60px 0 30px; margin-top: 60px; }
.footer-wrap { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; padding: 0 20px; }
.footer-col h4 { color: #fff; margin-bottom: 20px; }
.footer-col a { display: block; color: #94a3b8; text-decoration: none; margin-bottom: 10px; font-size: 14px; }
.footer-bottom { text-align: center; margin-top: 40px; border-top: 1px solid #334155; padding-top: 20px; font-size: 13px; }

/* 响应式 */
@media (max-width: 768px) {
    .data-grid { grid-template-columns: 1fr; }
    .ai-card { grid-column: span 1; }
    .footer-wrap { grid-template-columns: 1fr; gap: 40px; }
}
/* 文字广告网格：一行5个 */
.ad-text-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    position: relative;
}
.ad-text-grid a {
    text-decoration: none;
    color: var(--primary);
    font-size: 13px;
    text-align: center;
    padding: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ad-text-grid a:hover { text-decoration: underline; }

/* 图片广告网格：一行3个 */
.ad-img-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
    position: relative;
}
.ad-img-grid img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 侧边对联广告 */
.side-ad {
    position: fixed;
    top: 150px;
    width: 120px;
    z-index: 100;
}
.side-left { left: 20px; }
.side-right { right: 20px; }
.side-ad img { width: 100%; border-radius: 4px; }
.side-ad button {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
}

/* 友情链接 */
.friend-links {
    margin-top: 30px;
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
}
.friend-links a {
    color: var(--text-s);
    text-decoration: none;
    margin-right: 15px;
}
.friend-links a:hover { color: var(--primary); }

/* 关闭按钮通用小号 */
.ad-close-mini {
    position: absolute;
    right: -5px;
    top: -5px;
    background: #94a3b8;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    cursor: pointer;
    font-size: 12px;
}

/* 移动端适配：隐藏对联，文字广告变2列 */
@media (max-width: 1100px) {
    .side-ad { display: none; }
}
@media (max-width: 768px) {
    .ad-text-grid { grid-template-columns: repeat(2, 1fr); }
    .ad-img-grid { grid-template-columns: 1fr; }
}
/* 紧凑型 3x3 文字广告 */
.ad-text-grid-3x3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px; /* 减小间距 */
    background: #fff;
    padding: 10px 15px; /* 减小内边距 */
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 15px;
    position: relative;
}
.ad-text-grid-3x3 a {
    text-decoration: none;
    color: var(--primary);
    font-size: 13px; /* 缩小字号 */
    text-align: center;
    padding: 6px;
    background: #f8fafc;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ad-text-grid-3x3 a:hover { background: #eff6ff; }

/* 三图广告 */
.ad-img-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    position: relative;
}
.ad-img-grid img { width: 100%; border-radius: 6px; display: block; }

/* 侧边对联 */
.side-ad { position: fixed; top: 180px; width: 100px; z-index: 1000; }
.side-left { left: 10px; }
.side-right { right: 10px; }
.side-ad img { width: 100%; border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.side-ad button {
    position: absolute; top: -10px; right: -5px; background: #334155;
    color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px;
    cursor: pointer; font-size: 10px;
}

/* 友链区域 */
.friend-links { margin-top: 30px; padding: 15px; border-top: 1px solid #e2e8f0; font-size: 12px; }
.friend-label { color: #94a3b8; font-weight: bold; margin-right: 10px; }
.friend-links a { color: #64748b; text-decoration: none; margin-right: 12px; }
.friend-links a:hover { color: var(--primary); }

/* 关闭按钮通用 */
.ad-close-mini {
    position: absolute; right: -8px; top: -8px; background: #94a3b8;
    color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px;
    cursor: pointer; font-size: 10px; z-index: 10;
}