/* 继承全局变量 */
:root {
    --primary-color: #0B1C3D;
    --header-color: #050A17;
    --accent-color: #1E90FF;
    --text-color: #333;
    --white: #ffffff;
    --max-width: 1200px;
    --red: #FF0000;
}

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

body {
    margin: 0;
    padding-top: 80px; /* 只保留顶部padding，用于fixed header */
    min-width: 100%;
    overflow-x: hidden; /* 防止水平滚动 */
}

/* Header */
.header {
    background: var(--header-color);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

.header__container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header__left {
    display: flex;
    align-items: center;
    white-space: nowrap; /* 防止域名换行 */
    
}

.header__right {
    display: flex;
    align-items: center;
    transform: scale(0.5); /* 将按钮缩小到原来的一半 */
    transform-origin: right center; /* 从右侧开始缩放 */
}

.header__logo {
    width: 40px;  /* 调整logo大小 */
    height: 40px;
    border-radius: 5px;
    object-fit: cover;
}

.header__title {
    color: var(--white);
    margin-left: 1rem;
    font-size: 1.2rem; /* 调小字体大小 */
    font-weight: bold;
    letter-spacing: 1px;
    white-space: nowrap; /* 防止文字换行 */
}

.header__domain {
    color: var(--accent-color); /* 使用亮蓝色突出显示 */
    font-weight: bold;
}

/* 面包屑导航 */
.breadcrumb {
    background: var(--header-color);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.breadcrumb__container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.breadcrumb__link {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.breadcrumb__separator {
    color: var(--white);
    margin: 0 0.5rem;
    opacity: 0.5;
}

.breadcrumb__current {
    color: var(--white);
    font-size: 0.9rem;
}

/* Chapter Hero */
.chapter-hero {
    position: relative;
    background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('../chapter-hero.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 6rem 0;
    text-align: center;
    color: var(--white);
    width: 100vw; /* 确保全宽 */
    margin: 0; /* 移除可能的margin */
}

.chapter-hero__container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.chapter-hero__title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.chapter-hero__subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 漫画阅读器 */
.manga {
    padding: 2rem 0;
    background: #000; /* 深色背景更适合看漫画 */
    width: 100vw; /* 确保全宽 */
    margin: 0; /* 移除可能的margin */
}

.manga__container {
    max-width: 800px; /* 控制漫画页面的最大宽度 */
    margin: 0 auto;
    padding: 0; /* 移除水平padding */
}

.manga__reader {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.manga__page {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* 章节导航 */
.chapter-nav {
    background: var(--header-color);
    padding: 1.5rem 0;
}

.chapter-nav__container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.chapter-nav__link {
    display: flex;
    align-items: center;
    color: var(--white);
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.chapter-nav__link:hover {
    background: var(--accent-color);
}

.chapter-nav__arrow {
    font-size: 1.2rem;
    margin: 0 0.5rem;
}

.chapter-nav__link--prev .chapter-nav__arrow {
    margin-right: 0.5rem;
}

.chapter-nav__link--next .chapter-nav__arrow {
    margin-left: 0.5rem;
}
/* 响应式调整 */
@media (max-width: 768px) {
    .header__container {
        padding: 0.2rem 1rem;
    }
    
    .header__logo {
        width: 32px; /* 移动端更小的logo */
        height: 32px;
    }
    
    .header__title {
        font-size: 1rem; /* 移动端更小的字体 */
    }
    
    /* 修复 Buy me a coffee 按钮样式 */
    .header__right {
        transform: scale(0.4); /* 移动端更小 */
        transform-origin: right center;
        margin-left: 0.5rem;
    }
    
    /* 确保按钮容器不会重叠 */
    .header__right iframe {
        max-width: 100%;
        margin: 0 !important;
    }
}

/* 超小屏幕的额外调整 */
@media (max-width: 360px) {
    .header__title {
        font-size: 0.9rem;
    }
    
    .header__right {
        transform: scale(0.35); /* 超小屏幕进一步缩小 */
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chapter-hero__title {
        font-size: 2rem;
    }

    .chapter-hero__subtitle {
        font-size: 1rem;
    }

    .chapter-nav__container {
        flex-direction: column;
    }

    .chapter-nav__link {
        width: 100%;
        justify-content: center;
    }
}

/* SEO Section Styles */
.seo {
    padding: 4rem 0;
    background-color: #f8f9fa;
}

.seo__container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    color: #2c3e50;
    line-height: 1.8;
}

/* Headings */
.seo h2 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin: 3rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
}

.seo h3 {
    font-size: 1.8rem;
    color: #34495e;
    margin: 2rem 0 1rem;
}

.seo h4 {
    font-size: 1.4rem;
    color: #455a64;
    margin: 1.5rem 0 1rem;
}

/* First h2 shouldn't have top margin */
.seo h2:first-child {
    margin-top: 0;
}

/* Paragraphs */
.seo p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: #444;
    line-height: 1.8;
}

/* Links */
.seo a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.seo a:hover {
    border-bottom-color: var(--accent-color);
}

/* Lists if needed */
.seo ul, .seo ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.seo li {
    margin-bottom: 0.5rem;
}

/* Emphasis */
.seo strong {
    color: #2c3e50;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .seo {
        padding: 2rem 0;
    }

    .seo__container {
        padding: 0 1rem;
    }

    .seo h2 {
        font-size: 1.8rem;
        margin: 2rem 0 1rem;
    }

    .seo h3 {
        font-size: 1.5rem;
    }

    .seo h4 {
        font-size: 1.2rem;
    }

    .seo p {
        font-size: 1rem;
        line-height: 1.6;
    }
}

/* Print Styles */
@media print {
    .seo {
        background-color: white;
        padding: 0;
    }

    .seo__container {
        max-width: 100%;
    }

    .seo h2 {
        break-after: avoid;
    }

    .seo p {
        orphans: 3;
        widows: 3;
    }
}

/* Additional Enhancements */
.seo h2::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, var(--accent-color), transparent);
    margin-top: 0.5rem;
}

.seo h3::before {
    content: '•';
    color: var(--accent-color);
    margin-right: 0.5rem;
}

/* Hover Effects */
.seo h2:hover,
.seo h3:hover {
    color: var(--accent-color);
    transition: color 0.3s ease;
}

/* Content Animation */
.seo__container {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.support-section {
    text-align: center;
    padding: 2rem 1rem;
    margin: 2rem auto;
    max-width: 800px;
}

.support-section__message {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    color: #f8f9fa;
}

.support-section__description {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #666;
    line-height: 1.6;
}

.support-section__subtext {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.support-section__button {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Chapters Section */
.chapters {
    padding: 4rem 0;
    background-color: #f8f9fa;
}

.chapters__container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.chapters__title {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 800;
}

.chapters__nav {
    max-width: 800px;
    margin: 0 auto;
}

.chapters__list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.chapters__item {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chapters__item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.chapters__link {
    display: block;
    padding: 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    position: relative;
}

.chapters__link::after {
    content: '→';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chapters__item:hover .chapters__link::after {
    opacity: 1;
    transform: translate(5px, -50%);
}

.chapters__link:hover {
    color: var(--accent-color);
}

/* Latest Chapter Badge */
.chapters__item--latest {
    position: relative;
}

.chapters__item--latest::before {
    content: 'NEW';
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--red);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 1;
}

/* Chapter Number */
.chapters__number {
    color: var(--accent-color);
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chapters {
        padding: 2rem 0;
    }

    .chapters__title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .chapters__list {
        grid-template-columns: 1fr;
    }

    .chapters__link {
        padding: 1.2rem;
        font-size: 1rem;
    }
}

.chapters__subtitle {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.chapters__support-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background-color: rgba(30, 144, 255, 0.1);
    transition: all 0.3s ease;
}

.chapters__support-link:hover {
    background-color: var(--accent-color);
    color: var(--white);
}

/* 添加咖啡���标 */
.chapters__support-link::after {
    content: '☕';
    margin-left: 4px;
    font-size: 1rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .chapters__subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }
}