/* ==========================================
   YY漫画 - 歪歪漫画网 主样式表
   基于百度SEO优化，移动端优先设计
   ========================================== */

/* CSS变量定义 - 漫画风格配色 */
:root {
    --primary-color: #FF6B35;
    --primary-dark: #E85A2A;
    --secondary-color: #4ECDC4;
    --accent-color: #FFE66D;
    --dark-bg: #1a1a2e;
    --darker-bg: #16213e;
    --light-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --text-light: #b2bec3;
    --border-color: #e9ecef;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--light-bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

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

ul, ol {
    list-style: none;
}

/* 容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   顶部导航 - SEO友好结构
   ========================================== */
.header {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.logo-sub {
    font-size: 0.75rem;
    color: var(--text-light);
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 10px 20px;
    color: #fff;
    font-weight: 500;
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary-color);
    transition: var(--transition);
    border-radius: 2px;
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 60%;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    cursor: pointer;
    background: none;
    border: none;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: var(--transition);
}

/* ==========================================
   Hero Banner - 首页核心区域
   ========================================== */
.hero {
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 50%, #2d1b4e 100%);
    padding: 60px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 20px;
    line-height: 1.3;
}

.hero h1 .highlight {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 30px;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.hero-tag {
    padding: 8px 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    color: #fff;
    font-size: 0.9rem;
    transition: var(--transition);
}

.hero-tag:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* 搜索框 */
.search-box {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 16px 60px 16px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 50px;
    background: #fff;
    box-shadow: var(--shadow-lg);
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-box button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 15px rgba(255,107,53,0.4);
}

/* ==========================================
   内容区块通用样式
   ========================================== */
.section {
    padding: 60px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-title::before {
    content: '';
    width: 4px;
    height: 28px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.section-more {
    color: var(--primary-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-more:hover {
    gap: 10px;
}

/* ==========================================
   漫画卡片网格
   ========================================== */
.comic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.comic-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.comic-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.comic-cover {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.comic-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.comic-card:hover .comic-cover img {
    transform: scale(1.08);
}

.comic-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    color: #fff;
}

.comic-badge.hot {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.comic-badge.new {
    background: linear-gradient(135deg, var(--secondary-color), #00b894);
}

.comic-badge.free {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

.comic-info {
    padding: 15px;
}

.comic-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comic-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.comic-author {
    display: flex;
    align-items: center;
    gap: 4px;
}

.comic-update {
    color: var(--primary-color);
    font-weight: 500;
}

/* ==========================================
   分类标签区
   ========================================== */
.category-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-sm);
}

.category-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.category-row:last-child {
    margin-bottom: 0;
}

.category-label {
    flex-shrink: 0;
    width: 80px;
    font-weight: 600;
    color: var(--text-primary);
    padding-top: 8px;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}

.category-tag {
    padding: 8px 16px;
    background: var(--light-bg);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.category-tag:hover {
    background: var(--primary-color);
    color: #fff;
}

.category-tag.active {
    background: var(--primary-color);
    color: #fff;
}

/* ==========================================
   排行榜样式
   ========================================== */
.ranking-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.ranking-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.ranking-header {
    padding: 20px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ranking-header.hot {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.ranking-header.new {
    background: linear-gradient(135deg, var(--secondary-color), #00b894);
}

.ranking-header.complete {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
}

.ranking-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.ranking-list {
    padding: 15px 20px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.ranking-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 4px;
    color: var(--text-secondary);
    background: var(--light-bg);
}

.ranking-item:nth-child(1) .ranking-num {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #fff;
}

.ranking-item:nth-child(2) .ranking-num {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
    color: #fff;
}

.ranking-item:nth-child(3) .ranking-num {
    background: linear-gradient(135deg, #cd7f32, #b8690f);
    color: #fff;
}

.ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.ranking-author {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ==========================================
   页脚
   ========================================== */
.footer {
    background: linear-gradient(135deg, var(--dark-bg), var(--darker-bg));
    color: #fff;
    padding: 60px 0 30px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .logo {
    margin-bottom: 20px;
}

.footer-desc {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.8;
    max-width: 300px;
}

.footer-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-light);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer-bottom a {
    color: var(--primary-color);
}

/* ==========================================
   内页样式
   ========================================== */
.page-header {
    background: linear-gradient(135deg, var(--dark-bg), var(--darker-bg));
    padding: 40px 0;
    text-align: center;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.page-subtitle {
    color: var(--text-light);
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--text-light);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb span {
    color: var(--text-light);
}

/* 详情页 */
.comic-detail {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    padding: 40px 0;
}

.detail-cover {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.detail-cover img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
}

.detail-info h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.detail-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-desc {
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 30px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: var(--radius-md);
}

.detail-actions {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,53,0.4);
}

.btn-secondary {
    background: var(--light-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ==========================================
   移动端适配
   ========================================== */
@media (max-width: 1024px) {
    .ranking-section {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 78px;
        left: 0;
        right: 0;
        background: var(--darker-bg);
        flex-direction: column;
        padding: 20px;
        gap: 0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .hero {
        padding: 40px 0 60px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero-desc {
        font-size: 1rem;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .comic-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .comic-detail {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .detail-cover {
        max-width: 250px;
        margin: 0 auto;
    }
    
    .detail-actions {
        flex-direction: column;
    }
    
    .category-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .category-label {
        width: auto;
        padding-top: 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-brand .logo {
        justify-content: center;
    }
    
    .footer-desc {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero-tags {
        gap: 8px;
    }
    
    .hero-tag {
        padding: 6px 14px;
        font-size: 0.8rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .comic-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .comic-info {
        padding: 12px;
    }
    
    .comic-title {
        font-size: 0.9rem;
    }
}

/* ==========================================
   动画效果
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* 加载占位图 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

