/* ===== style.css===== */

/* 重置默认边距 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.light {
            --bg: #e3e4e7;
            --background: rgba(255, 255, 255, 0.2); 
            --card-background: rgba(255, 255, 255, 0.5); 
            --surface: #ffffff;
            --border: #cbd3da;
            --text: #1a1a1a;
            --text-tag:#4e66ee;
            --text-meta:#ffffff;
            --text-light: #8c8c8c;
            --button-bg: #1d8ae4;
            --button-hover: #63b6f1;
            --button-text: white;
            --color-red: #8b1717;
            --color-pink: #e66f6f;
            --color-yellow: #caa70b;
            --color-green: #459476;
            --title-image: url('https://www.yanzhubg.com/setting/title_l.png');
        }
        
/* 深色模式变量 */
body.dark {
    --bg: #1a1a1a;
    --background: rgba(0, 0, 0, 0.2); 
    --card-background: rgba(0, 0, 0, 0.5); 
    --surface: #1e2224;
    --border: #383838;
    --text: #e0e0e0;
    --text-tag:#8999f1;
    --text-meta:#cedaf0;
    --text-light: #a0a0a0;
    --button-bg: #1d8ae4;
    --button-hover: #63b6f1;
    --button-text: white;
    --color-red: #e06e6e;
    --color-pink: #f1c1c1;
    --color-yellow: #e9d788;
    --color-green: #9fe2c9;
    --title-image: url('https://www.yanzhubg.com/setting/title_d.png');
}

/* 页面主体：背景图片 */
body {
    background-color: var(--bg);
    background-image: url('https://yanzhubg-img.oss-cn-wuhan-lr.aliyuncs.com/background/bg00.png'); /* 示例图，请替换 */
    background-size: 100% auto;  /* 宽度100%，高度自动 */
    background-repeat: no-repeat; /* 不重复 */
    background-position: top center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    font-family: system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', '宋体', serif;
    /* 让 body 作为网格容器，水平垂直居中 */
    display: grid;
    place-items: center;
}

.title-background {
    /* 背景图片 - 替换成你的图片链接 */
    background-image: url('https://yanzhubg-img.oss-cn-wuhan-lr.aliyuncs.com/background/bg3.png'); /* 示例图，请替换 */
    background-size: 100% auto;  /* 宽度100%，高度自动 */
    background-repeat: no-repeat; /* 不重复 */
    background-position: top center; /* 顶端居中 */
}

.title-image {
    content: var(--title-image); 
    display: block;
    width: 30%;
    max-width: 400px;
    min-width: 150px;
    height: auto;
    margin: 250px 0 0 0;
    }
   
/* ===== 左上角悬浮工具栏 ===== */
.top-bar {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 4px;
    z-index: 1000;
    background: var(--surface);
    padding: 8px 12px;
    border-radius: 28px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(4px);
}

.top-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.top-btn:hover {
    background: var(--border);
}

/* 主题切换容器 */
.theme-container {
    position: relative;
}

/* 主题主按钮（小月亮） */
.theme-main-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text);
}

.theme-main-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.theme-main-btn.active {
    background: var(--button-bg);
    color: white;
    border-color: var(--button-bg);
}

/* 主题展开条 - 默认隐藏 */
.theme-expand-bar {
    position: absolute;
    top: 0;
    left: 60px;  /* 紧贴主按钮右侧 */
    display: flex;
    gap: 8px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 40px;
    padding: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    white-space: nowrap;
    z-index: 1001;
}

/* 展开状态 */
.theme-expand-bar.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* 主题选项按钮 */
.theme-option {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-light);
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.theme-option:hover {
    background: var(--border);
    color: var(--text);
}

.theme-option.active {
    background: var(--button-bg);
    color: white;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .top-left-tools {
        top: 20px;
        left: 20px;
        gap: 10px;
    }
    
    .back-to-top,
    .theme-main-btn {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
    
    .theme-expand-bar {
        left: 52px;
        padding: 4px;
    }
    
    .theme-option {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}

/* 外层容器：限制最大宽度，同时保持居中 */
.outer-container {
    padding: 0px 35px 0px 35px;
    max-width: 800px;  /* 电脑上阅读宽度，可调整 */
    width: 100%;   
    min-height: 100vh;
    line-height: 1.8;
    display: flex;
    flex-direction: column;
}

/* 文章标题 */
.article-title {
    font-size: 2.2em;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1a2a3a;
    line-height: 1.8;
}

/* 元信息 */
.article-meta {
    color: var(--text);
    margin-left: 1em;
    margin-bottom: 20px;
    font-size: 1em;
}

/* ===== 催更栏样式 ===== */
.cuigeng-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 16px;
}

/* 左侧计数容器 - 靠左不留空隙 */
.cuigeng-left {
    display: flex;
    align-items: center;
    margin-left: 0;  /* 抵消外层可能的边距，可根据需要调整 */
}

/* 计数数字容器 */
.cuigeng-numbers {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

/* 总数数字 */
.cuigeng-total {
    font-size: 2em;
    font-weight: 600;
    color: var(--button-bg);
}

/* 右侧按钮容器 */
.cuigeng-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 催更按钮 */
.cuigeng-btn {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 2px;
    border-radius: 4px;
    padding: 8px 32px;
    margin: 20px 0;
}

.read-btn {
    background: var(--bg);           /* 灰色背景 */
    color: var(--text-light);
    border: none;
    padding: 8px 32px;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 2px;
}

.randomMessage {
    font-size: 0.9em;
    color: var(--text);
    text-align: center;
    margin-bottom: 1em;
    min-height: 20px;
    white-space: nowrap;
}

/* ===== 选项卡样式 ===== */
.tab-header {
    display: flex;
    padding-bottom: 10px;
    width: 100%; 
}

.tab-btn {
    flex: 1;        
    background: transparent;
    border: none;
    color: var(--text);
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    opacity: 0.7;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.tab-btn.active {
    background: var(--button-bg);
    color: white;
    opacity: 1;
}

.tab-content {
    display: none;
    width: 100%;
}

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

/* 折叠目录样式 */
.work-catalog {
    margin-top: 15px;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
    padding-top: 10px;
}

.catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    cursor: pointer;
    color: var(--text-light);
    font-size: 0.95em;
    transition: 0.2s;
}

.catalog-header:hover {
    color: var(--button-bg);
}

.catalog-icon {
    font-size: 0.8em;
    transition: transform 0.3s;
}

.catalog-header.active .catalog-icon {
    transform: rotate(180deg);
}

.catalog-content {
    padding: 12px 0 5px 0;
}

.catalog-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.chapter-item {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.chapter-item:last-child {
    border-bottom: none;
}

.chapter-link-block {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 10px;
    border-radius: 8px;
    transition: 0.2s;
}

.chapter-link-block:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.chapter-title {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}

.chapter-desc {
    display: block;
    font-size: 0.9em;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 8px;
}

.chapter-tags {
    display: flex;
    flex-wrap: wrap;
}

.chapter-tags .tag {
    background: var(--button-bg);
    color: white;
    padding: 2px 10px;
    border-radius: 30px;
    font-size: 0.75em;
    opacity: 0.9;
}

.hashtag {
    color: var(--text-tag);
    font-size: 0.9em;
}

/* ===== 纯净阅读器样式（新增）===== */
.pure-reader {
    max-width: 750px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1em;
    background: var(--bg);
}

.pure-reader .article-title {
    font-size: 2.4em;
    font-weight: 700;
    color: var(--text);
    margin: 72px 0 15px 0;
    letter-spacing: 1px;
    line-height: 1.3;
}

.pure-reader .article-author {
    color: var(--text-light);
    font-size: 1em;
    margin-bottom: 8px;
}

.pure-reader .article-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.pure-reader .article-tags .tag1 {
    background: #d2e4cf;
    color: #4a6b60;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 0.85em;
}

.pure-reader .article-tags .tag2 {
    background: #e9ebd3;
    color: #867a34;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 0.85em;
}

.pure-reader .article-tags .tag3 {
    background: #fccfbd;
    color: #9b3030;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 0.85em;
}

.pure-reader .article-content p {
    margin-bottom: 1em;
    text-indent: 2em;
    font-size: 1.1em;
    line-height: 1.8em;
    color: var(--text);
}

.chapter-nav {
    margin: 50px 0 50px 0;
    padding-top: 25px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1em;
}

.chapter-nav a {
    color: var(--button-bg);
    text-decoration: none;
    transition: 0.2s;
    padding: 5px 0;
    border-bottom: 1px solid transparent;
}

.chapter-nav a:hover {
    color: var(--button-hover);
    border-bottom-color: var(--button-hover);
}

.chapter-nav .catalog-link {
    color: var(--button-bg);
    font-size: 0.95em;
}

/* ===== 毛玻璃图片效果 ===== */
.glass-image {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.glass-image img {
    display: block;
    width: 100%;
    height: auto;
    transition: all 0.5s ease;
    background: rgba(255, 255, 255, 0.2);  /* 保留透明背景 */
}

/* 鼠标悬停变清晰（PC端） */
.glass-image:hover img {
    filter: blur(0) brightness(1) grayscale(0);
    -webkit-filter: blur(0) brightness(1) grayscale(0);
}

/* 长按变清晰（移动端） */
.glass-image:active img {
    filter: blur(0) brightness(1) grayscale(0);
    -webkit-filter: blur(0) brightness(1) grayscale(0);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* 提示文字 */
.glass-image::after {
    content: "长按查看";
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--text);
    padding: 4px 10px;
    font-size: 16px;
    font-weight: 500;
    backdrop-filter: blur(4px);
    opacity: 0.8;
    transition: opacity 0.5s;
    pointer-events: none;
}

.glass-image:hover::after,
.glass-image:active::after {
    opacity: 0;
}

/* 正文段落 */
.article-content p {
    font-size: 1.2em;
    line-height: 1.8;
    margin-bottom: 1.5em;
    text-indent: 2em;
    color: var(--text);
}

/* 手机屏幕优化：完全撑满，不留空隙 */
@media (max-width: 768px) {
    body {
        place-items: stretch;  /* 取消居中，改为拉伸 */
    }
    .outer-container {
        max-width: 100%;
        padding: 0;            /* 去掉所有内边距，让卡片贴边 */
        min-height: 100vh;
    }
    .reader {
        border-radius: 0;       /* 去掉圆角 */
        padding: 25px 20px;     /* 减小内边距 */
        min-height: 100vh;       /* 撑满全屏高度 */
        border: none;            /* 去掉边框 */
        box-shadow: none;         /* 去掉阴影 */
        border-left: none;
        border-right: none;
    }
    .author-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }   
    .author-stats {
        justify-content: center;
        flex-wrap: wrap;
    }  
    .author-tags {
        justify-content: center;
    }
}

/* 超小屏优化 */
@media (max-width: 480px) {
    .article-title {
        font-size: 1.8em;
    }
    .article-content p {
        font-size: 1.1em;
        line-height: 1.7;
    }
}
