/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

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

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #f6821f;
    text-decoration: none;
}

.search-box {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-box button {
    padding: 10px 20px;
    background: #f6821f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.search-box button:hover {
    background: #e5731e;
}

.btn {
    padding: 10px 20px;
    background: #f6821f;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.btn:hover {
    background: #e5731e;
}

/* 分类筛选 */
.categories {
    padding: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-btn:hover,
.category-btn.active {
    background: #f6821f;
    color: white;
    border-color: #f6821f;
}

/* 小说列表 */
.novel-list {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.novel-list h2 {
    margin-bottom: 20px;
    color: #333;
}

.novel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.novel-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

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

.novel-cover {
    width: 100%;
    height: 260px;
    object-fit: cover;
    background: #f0f0f0;
}

.novel-info {
    padding: 15px;
}

.novel-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.novel-author {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.novel-category {
    display: inline-block;
    padding: 4px 8px;
    background: #f6821f;
    color: white;
    font-size: 12px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.novel-status {
    font-size: 12px;
    color: #28a745;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px 0;
}

.pagination button {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.pagination button:hover,
.pagination button.active {
    background: #f6821f;
    color: white;
    border-color: #f6821f;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 小说详情页 */
.novel-detail {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.novel-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.novel-header .cover {
    width: 200px;
    height: 280px;
    object-fit: cover;
    border-radius: 8px;
}

.novel-header .info h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.novel-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: #666;
}

.novel-description {
    line-height: 1.8;
    color: #555;
}

/* 章节列表 */
.chapter-list {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
}

.chapter-list h3 {
    margin-bottom: 20px;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.chapter-item {
    padding: 10px 15px;
    background: #f9f9f9;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: background 0.3s;
}

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

/* 阅读页 */
.read-container {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    max-width: 900px;
    margin: 20px auto;
}

.read-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.read-header h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.read-content {
    font-size: 18px;
    line-height: 2;
    text-indent: 2em;
}

.read-content p {
    margin-bottom: 20px;
}

.read-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.read-nav a {
    padding: 10px 20px;
    background: #f6821f;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.read-nav a:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 管理后台 */
.admin-container {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-btn {
    padding: 12px 30px;
    background: #f6821f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.submit-btn:hover {
    background: #e5731e;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* 页脚 */
footer {
    background: #333;
    color: #fff;
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
}

/* 响应式 */
@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .search-box {
        order: 3;
        width: 100%;
        max-width: none;
    }
    
    .novel-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .novel-meta {
        justify-content: center;
    }
    
    .read-container {
        padding: 20px;
    }
    
    .read-content {
        font-size: 16px;
    }
}
