* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #ff4d4f;
    --primary-hover: #ff7875;
    --secondary: #1890ff;
    --success: #52c41a;
    --warning: #faad14;
    --text-primary: #262626;
    --text-secondary: #595959;
    --text-tertiary: #8c8c8c;
    --text-quaternary: #bfbfbf;
    --border: #d9d9d9;
    --border-light: #f0f0f0;
    --bg-page: #f5f5f5;
    --bg-component: #ffffff;
    --bg-container: #fafafa;
    --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-3: 0 8px 24px rgba(0, 0, 0, 0.16);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    background: var(--bg-component);
    box-shadow: var(--shadow-1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    padding: 8px 0;
    color: white;
    font-size: 13px;
}

.header-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-top a {
    color: white;
    opacity: 0.9;
}

.header-top a:hover {
    opacity: 1;
}

.header-main {
    padding: 16px 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 26px;
    font-weight: bold;
    color: var(--primary);
    flex-shrink: 0;
}

.logo img {
    height: 40px;
    width: auto;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    display: flex;
    background: var(--bg-page);
    border: 2px solid var(--border-light);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.3s;
}

.search-bar:focus-within {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.1);
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 20px;
    font-size: 14px;
    outline: none;
}

.search-bar button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: var(--primary-hover);
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-item {
    padding: 8px 16px;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.3s;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 77, 79, 0.1);
    color: var(--primary);
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.user-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn {
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
}

.hero-section {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 50%, #ff9f43 100%);
    padding: 50px 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 0c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-18-7c-3.866 0-7 3.134-7 7s3.134 7 7 7 7-3.134 7-7-3.134-7-7-7zm30 0c-3.866 0-7 3.134-7 7s3.134 7 7 7 7-3.134 7-7-3.134-7-7-7z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 42px;
    font-weight: bold;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 18px;
    opacity: 0.95;
    margin-bottom: 30px;
}

.hero-search {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    background: white;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: var(--shadow-3);
}

.hero-search input {
    flex: 1;
    border: none;
    padding: 16px 24px;
    font-size: 16px;
    outline: none;
}

.hero-search button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.category-nav {
    background: var(--bg-component);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 0;
}

.category-list {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.category-item {
    padding: 8px 20px;
    background: var(--bg-container);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.category-item:hover,
.category-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.main-content {
    padding: 30px 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.section {
    background: var(--bg-component);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-1);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-light);
}

.section-title {
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

.section-more {
    color: var(--text-tertiary);
    font-size: 14px;
}

.section-more:hover {
    color: var(--primary);
}

.novel-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.novel-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-container);
    border-radius: 8px;
    transition: all 0.3s;
    cursor: pointer;
}

.novel-item:hover {
    background: white;
    box-shadow: var(--shadow-2);
    transform: translateY(-4px);
}

.novel-cover {
    width: 90px;
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-1);
}

.novel-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.novel-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    opacity: 0.3;
}

.novel-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 2px 8px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: bold;
    border-radius: 2px;
}

.novel-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.novel-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.novel-author {
    font-size: 13px;
    color: var(--text-tertiary);
}

.novel-desc {
    font-size: 12px;
    color: var(--text-quaternary);
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex: 1;
}

.novel-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-quaternary);
}

.novel-tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 77, 79, 0.1);
    color: var(--primary);
    font-size: 11px;
    border-radius: 2px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rank-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-container);
    border-radius: 6px;
    transition: all 0.3s;
    cursor: pointer;
}

.rank-item:hover {
    background: white;
    box-shadow: var(--shadow-1);
}

.rank-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.rank-number.top1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: white;
    border-radius: 50%;
}

.rank-number.top2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: white;
    border-radius: 50%;
}

.rank-number.top3 {
    background: linear-gradient(135deg, #cd7f32 0%, #dda15e 100%);
    color: white;
    border-radius: 50%;
}

.rank-info {
    flex: 1;
    min-width: 0;
}

.rank-title {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-meta {
    font-size: 12px;
    color: var(--text-quaternary);
    margin-top: 4px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination-item {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-component);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination-item:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.site-footer {
    background: #2c3e50;
    color: white;
    padding: 50px 0 30px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .novel-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .search-bar {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: 12px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .novel-list {
        grid-template-columns: 1fr;
    }
    
    .novel-item {
        padding: 12px;
    }
    
    .novel-cover {
        width: 70px;
        height: 95px;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 20px;
    }
    
    .logo img {
        height: 32px;
    }
    
    .user-actions {
        gap: 8px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .category-item {
        padding: 6px 14px;
        font-size: 13px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}
