* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f6fa;
    color: #2c3e50;
    transition: background 0.3s, color 0.3s;
}

body.dark-mode {
    background: #1a1a2e;
    color: #e0e0e0;
}

a {
    text-decoration: none;
    color: inherit;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo a {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
}

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

.nav-links li a {
    color: white;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-links li a:hover {
    opacity: 0.8;
}

.theme-toggle, .hamburger {
    cursor: pointer;
    font-size: 1.5rem;
}

.hamburger {
    display: none;
}

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

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

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary {
    background: #ff6b6b;
    color: white;
    box-shadow: 0 4px 15px rgba(255,107,107,0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

section {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.novel-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

body.dark-mode .novel-card {
    background: #2c2c3e;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

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

.novel-cover {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    margin-bottom: 1rem;
}

.novel-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

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

.rating {
    color: #f1c40f;
    margin-bottom: 1rem;
}

.btn-detail {
    background: #667eea;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    display: inline-block;
    transition: background 0.3s;
}

.btn-detail:hover {
    background: #764ba2;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.category-item {
    background: white;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, background 0.3s;
}

body.dark-mode .category-item {
    background: #2c2c3e;
}

.category-item:hover {
    transform: scale(1.05);
    background: #667eea;
    color: white;
}

footer {
    text-align: center;
    padding: 2rem;
    background: #2c3e50;
    color: white;
    margin-top: 2rem;
}

body.dark-mode footer {
    background: #0f0f1a;
}

footer a {
    color: #667eea;
}

.admin-login {
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
}

body.dark-mode .admin-login {
    background: #2c2c3e;
}

.admin-login input {
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.admin-login button {
    width: 100%;
    padding: 0.8rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.admin-panel {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

body.dark-mode .admin-panel {
    background: #2c2c3e;
}

.admin-panel textarea {
    width: 100%;
    margin: 0.5rem 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.5rem;
    font-family: monospace;
}

.admin-panel button {
    padding: 0.8rem 2rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.success {
    color: #27ae60;
    background: #e8f8f5;
    padding: 0.5rem;
    border-radius: 8px;
}

.error {
    color: #e74c3c;
    background: #fdf2f2;
    padding: 0.5rem;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: #667eea;
        padding: 1rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    .nav-links.active {
        display: flex;
    }
    .hamburger {
        display: block;
    }
    .hero h1 {
        font-size: 1.8rem;
    }
    .novel-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .novel-grid {
        grid-template-columns: 1fr;
    }
}