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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

a {
    text-decoration: none;
    color: #007bff;
}

a:hover {
    color: #0056b3;
}

/* 响应式容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
}

.nav {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav a {
    color: #333;
    font-weight: 500;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.coins {
    background: #ffd700;
    color: #333;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: bold;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
    color: white;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #1e7e34;
    color: white;
}

.btn-full {
    width: 100%;
}

/* 认证页面样式 */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-header h1 {
    text-align: center;
    margin-bottom: 1rem;
    color: #333;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 2rem;
}

.auth-tabs a {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    color: #666;
    border-bottom: 2px solid transparent;
}

.auth-tabs a.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.auth-form {
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.auth-footer {
    text-align: center;
    margin-top: 1rem;
}

/* 警告和成功消息 */
.alert {
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 主要内容区域 */
.main {
    padding: 2rem 0;
}

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

/* 小说列表样式 */
.novels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.novel-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.novel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.novel-cover {
    width: 100%;
    height: 250px;
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.novel-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.novel-info {
    padding: 1rem;
}

.novel-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #333;
}

.novel-author {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.novel-description {
    color: #888;
    font-size: 0.875rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.novel-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #666;
}

.novel-status {
    display: flex;
    gap: 0.5rem;
}

.status-tag {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.status-completed {
    background: #28a745;
    color: white;
}

.status-contracted {
    background: #ffc107;
    color: #333;
}

.status-free {
    background: #17a2b8;
    color: white;
}

/* 章节列表 */
.chapter-list {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.chapter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
}

.chapter-item:hover {
    background-color: #f8f9fa;
}

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

.chapter-title {
    color: #333;
    font-weight: 500;
}

.chapter-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: #666;
}

.chapter-price {
    color: #ffd700;
    font-weight: bold;
}

.chapter-free {
    color: #28a745;
    font-weight: bold;
}

/* 阅读页面 */
.reading-header {
    background: white;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 2rem;
}

.reading-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reading-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    line-height: 2;
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
}

.reading-content h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.reading-content p {
    margin-bottom: 1rem;
    text-indent: 2em;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #007bff;
    text-decoration: none;
}

.pagination a:hover {
    background-color: #f8f9fa;
}

.pagination .current {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .novels-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .auth-box {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .reading-content {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .reading-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .chapter-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* 平板端特殊适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .novels-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .reading-content {
        font-size: 1.05rem;
        padding: 1.5rem;
        /* 平板端阅读页面使用更舒适的背景色 */
        background-color: #fef9e7;
    }
}

/* 阅读页面移动端和平板端优化 */
@media (max-width: 1024px) {
    .reading-content {
        /* 移动端和平板端使用护眼背景 */
        background-color: #f7f5f0;
    }
    
    body {
        /* 整体背景也调整为更适合阅读的颜色 */
        background-color: #f0ede5;
    }
}
