/* AiStoryer 网站源码系统 V6.0 */
/* 🟡 联动级 - AiStoryer V6.0：修改后全站刷新即生效。含夜间模式配色、响应式布局。 */

/* ==== 全局重置 ==== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==== 页头 ==== */
/* D3：全站页头广告 — 无边距、无圆角、通栏贴边 */
.site-header-ad-bar {
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
}
.site-header-ad-bar .ais-ad-slot {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    max-width: none;
    text-align: center;
    overflow: hidden;
    border-radius: 0 !important;
    box-sizing: border-box;
}
.site-header-ad-bar .ais-ad-slot > *,
.site-header-ad-bar .ais-demo-ad {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-sizing: border-box;
    display: block;
    line-height: 0;
}
/* 演示/图片广告：默认贴边铺满，避免 img 基线空隙 */
.ais-ad-slot img,
.ais-ad-inner img,
.banner-ad-inner img,
img.ais-demo-ad {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    vertical-align: top;
}

.site-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    height: 58px;
    gap: 10px;
}

.logo {
    flex-shrink: 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: 0.01em;
}

.main-nav {
    position: relative;
    flex: 0 0 auto;
    margin-left: 28px;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 4px;
    align-items: center;
}

.main-nav ul li a {
    padding: 8px 15px;
    border-radius: 14px;
    transition: background 0.2s, color 0.2s;
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #555;
    line-height: 1.35;
}

.main-nav ul li a:hover {
    background: #f5f5f5;
    color: #2196F3;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    min-width: 120px;
    z-index: 1001;
    padding: 5px 0;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    padding: 10px 20px;
    white-space: nowrap;
    display: block;
}

.dropdown-menu li a:hover {
    background: #f0f0f0;
}

.user-nav {
    display: flex;
    gap: 6px;
    font-size: 16px;
    align-items: center;
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
}

.user-nav a {
    padding: 8px 13px;
    border-radius: 14px;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
    color: #555;
    line-height: 1.3;
}

.user-nav a:hover {
    background: #f5f5f5;
    color: #2196F3;
}

.header-home-stats {
    flex-shrink: 0;
    font-size: 13px;
    color: #1a1a1a;
    white-space: nowrap;
    line-height: 1.4;
    margin-left: auto;
    margin-right: 8px;
}
.header-home-stats .header-stat-num {
    color: #1a1a1a;
    font-weight: 600;
    margin: 0 8px 0 2px;
}
.header-container.has-home-stats .user-nav {
    margin-left: 0;
}

.mobile-menu-btn {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only.bottom-nav,
    nav.bottom-nav.mobile-only {
        display: flex !important;
    }
}

.top-search {
    display: none;
}

/* ==== D1 轮播（首页 / 男频 / 女频列表共用） ==== */
.banner-area.home-ad-banner {
    position: relative;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
    height: 150px;
    margin: 0 0 14px;
    box-sizing: border-box;
    padding: 0;
}
.banner-area.home-ad-banner .banner-slides {
    position: relative;
    height: 100%;
}
.banner-area.home-ad-banner .banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0;
    transition: opacity 0.5s;
    line-height: 0;
}
.banner-area.home-ad-banner .banner-slide.active { opacity: 1; }
.banner-area.home-ad-banner .banner-ad-inner {
    width: 100%;
    height: 150px;
    display: block;
    overflow: hidden;
    margin: 0;
    padding: 0;
    line-height: 0;
}
.banner-area.home-ad-banner .banner-ad-inner img {
    width: 100% !important;
    height: 150px !important;
    max-width: 100%;
    max-height: 150px;
    object-fit: cover;
    display: block;
    margin: 0;
    border: 0;
}
.banner-area.home-ad-banner .banner-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}
.banner-area.home-ad-banner .banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}
.banner-area.home-ad-banner .banner-dot.active { background: #fff; }
.channel-page-banner {
    margin: 0 0 12px;
}

/* ==== 页尾 ==== */
/* D4：深蓝 footer 上方、同宽 100%，底边紧贴深蓝顶边 */
.site-footer-ad-bar {
    width: 100%;
    margin: 40px 0 0;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
}
.site-footer-ad-bar .ais-ad-slot {
    margin: 0 !important;
    width: 100%;
    max-width: none;
    text-align: center;
    overflow: hidden;
    box-sizing: border-box;
    /* 仅上两角圆角，下两角直角贴深蓝 footer */
    border-radius: 8px 8px 0 0 !important;
}
.site-footer-ad-bar .ais-ad-slot > *,
.site-footer-ad-bar .ais-demo-ad {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    border-radius: 8px 8px 0 0 !important;
    display: block;
}
.site-footer {
    background: #2c3e50;
    color: #bdc3c7;
    padding: 30px 20px;
    margin-top: 40px;
}
.site-footer.has-top-ad {
    margin-top: 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-info p {
    margin-bottom: 5px;
    font-size: 14px;
}

.footer-info a {
    color: #3498db;
}

.footer-nav-block {
    text-align: right;
}

.footer-seo {
    text-align: right;
    font-size: 13px;
}

.footer-seo a {
    color: #95a5a6;
    margin-left: 16px;
}

.footer-seo a:first-child {
    margin-left: 0;
}

.footer-seo a:hover {
    color: #3498db;
}

/* ==== 文章页面 ==== */
.article-content {
    max-width: 800px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.article-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.article-title {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.article-meta {
    color: #999;
    font-size: 14px;
    display: flex;
    gap: 20px;
}

.article-body {
    font-size: 17px;
    line-height: 1.85;
    color: #1a1a1a;
    letter-spacing: 0.3px;
}

.article-body p {
    margin-bottom: 1.1em;
    text-indent: 0;
    line-height: 1.75;
}

.article-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.article-disclaimer {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
}

/* ==== 复制追踪记号：页面上完全隐藏（复制时由 JS 注入剪贴板） ==== */
.ais-mark,
.ais-mark[hidden],
.wm[data-ais-m],
.wm[data-wm] {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    font-size: 0 !important;
    line-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    position: absolute !important;
    left: -9999px !important;
}

@media (min-width: 769px) {
    .bottom-nav,
    nav.bottom-nav,
    .bottom-nav.mobile-only,
    nav.bottom-nav.mobile-only {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}

/* ==== 首页 ==== */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.content-layout {
    display: flex;
    gap: 30px;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* 文章卡片 */
.article-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.article-card h3 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.article-card .tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.article-card .tag {
    background: #e8f4fd;
    color: #2196F3;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.article-card .summary {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.article-card .meta {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 13px;
}

/* 男频/女频分类列表卡片 */
.channel-list-card {
    display: flex;
    gap: 15px;
    padding: 15px;
    margin-bottom: 12px;
}

.channel-list-card .cover-link {
    flex-shrink: 0;
    width: 70px;
    height: 95px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    background: #3498db;
}

.channel-list-card.channel-nv .cover-link {
    background: #E91E63;
}

.channel-list-card .cover-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.channel-list-card .cover-fallback {
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
}

.channel-list-card .channel-list-body {
    flex: 1;
    min-width: 0;
}

.channel-list-card .channel-list-title {
    font-size: 16px;
    margin: 0 0 8px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.channel-list-card .channel-list-title a {
    color: #333;
    text-decoration: none;
}

.channel-list-card .channel-list-title a:hover {
    color: #2196F3;
}

.channel-list-card.channel-nv .channel-list-title a:hover {
    color: #E91E63;
}

.channel-list-card .channel-list-tags-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.channel-list-card .channel-list-tags-row .channel-list-tags {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    margin-bottom: 0 !important;
}

.channel-list-card .channel-list-tags-row .channel-list-meta {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    white-space: nowrap;
    font-size: 12px;
    color: #999;
    justify-content: flex-end;
}

.channel-list-card .channel-list-tags .tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.channel-list-card.channel-nan .channel-list-tags .tag {
    background: #e8f4fd;
    color: #2196F3;
}

.channel-list-card.channel-nv .channel-list-tags .tag {
    background: #fce4ec;
    color: #E91E63;
}

.channel-list-card .channel-list-summary {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.6;
    white-space: normal;
    word-break: break-word;
}

.channel-list-card .channel-list-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}

.channel-list-card .channel-list-tags .tag {
body.night-mode {
    background-color: #1a1a2e;
    color: #ccc;
}

body.night-mode .site-header {
    background: #16213e;
}

body.night-mode .article-content,
body.night-mode .article-card {
    background: #16213e;
    color: #ccc;
}

body.night-mode .article-title {
    color: #e0e0e0;
}

body.night-mode .article-body {
    color: #aaa;
}

body.night-mode .site-footer {
    background: #0f3460;
}

/* ==== 沉浸阅读模式 ==== */
body.immersive-mode { background: #1a1a1a; color: #e0e0e0; }
body.immersive-mode .site-header,
body.immersive-mode .site-footer,
body.immersive-mode .article-toolbar,
body.immersive-mode .article-info,
body.immersive-mode .derived-section,
body.immersive-mode .article-disclaimer,
body.immersive-mode .article-footer-nav,
body.immersive-mode .bottom-nav { display: none !important; }
.immersive-article { position: fixed; inset: 0; background: #1a1a1a; overflow-y: scroll; scroll-snap-type: y mandatory; max-width: 100% !important; margin: 0 !important; padding: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.immersive-page { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 60px 20px; scroll-snap-align: start; }
.immersive-page .page-content { max-width: 720px; font-size: 22px; line-height: 2; color: #e0e0e0; }
.immersive-page .page-content p { margin-bottom: 1.5em; text-indent: 2em; }
.immersive-page .page-num { margin-top: 30px; color: #666; font-size: 13px; }
.immersive-page.immersive-ad { background: #2a2a2a; }
.immersive-page.immersive-ad .ad-content { color: #999; text-align: center; padding: 80px 20px; }
.immersive-exit-bar { position: fixed; top: 20px; right: 20px; z-index: 9999; background: rgba(0,0,0,0.6); color: #fff; padding: 8px 16px; border-radius: 20px; cursor: pointer; font-size: 13px; }
body.immersive-mode::before { content: '✕ 退出沉浸'; position: fixed; top: 20px; right: 20px; background: rgba(0,0,0,0.6); color: #fff; padding: 8px 16px; border-radius: 20px; z-index: 9999; cursor: pointer; font-size: 13px; }
body.immersive-mode::before:hover { background: rgba(0,0,0,0.85); }

/* ==== 响应式布局 ==== */
@media screen and (max-width: 768px) {
    .header-container {
        height: 45px;
    }
    
    .main-nav, .user-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .mobile-only {
        display: flex;
    }
    
    .top-search {
        display: block;
        padding: 8px 15px;
        background: #fff;
        border-bottom: 1px solid #eee;
    }
    
    .search-box {
        display: block;
        width: 100%;
        height: 35px;
        border-radius: 17px;
        background: #f5f5f5;
        line-height: 35px;
        padding: 0 15px;
        color: #d4d4d4;
        font-size: 14px;
    }
    
    .content-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .article-content {
        margin: 0;
        border-radius: 0;
        padding: 15px;
    }
    
    .article-title {
        font-size: 22px;
    }
    
    .article-body {
        font-size: 16px;
    }
    
    body {
        padding-top: 45px;
        padding-bottom: 50px;
    }
}