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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    margin-bottom: 30px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 2rem;
}

header h1 a {
    color: white;
    text-decoration: none;
}

header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

header nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.3s;
}

header nav a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.main-content {
    display: flex;
    gap: 30px;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.sidebar h3 {
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 10px;
}

.sidebar a {
    color: #555;
    text-decoration: none;
    padding: 8px 12px;
    display: block;
    border-radius: 4px;
    transition: background 0.3s, color 0.3s;
}

.sidebar a:hover,
.sidebar a.active {
    background: #667eea;
    color: white;
}

.content {
    flex: 1;
}

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

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.article-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.article-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.article-card h3 a {
    color: #333;
    text-decoration: none;
}

.article-card h3 a:hover {
    color: #667eea;
}

.meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.meta span {
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 12px;
}

.excerpt {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.8;
}

.read-more {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.3s;
}

.read-more:hover {
    background: #5568d3;
}

.article-full {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.article-full h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #333;
}

.content-body {
    margin-top: 30px;
    line-height: 2;
    color: #444;
}

.content-body h2 {
    margin: 30px 0 15px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.content-body p {
    margin-bottom: 15px;
}

.content-body pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.content-body code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
}

.content-body pre code {
    background: none;
    padding: 0;
}

.pagination {
    display: flex;
    gap: 8px;
    margin-top: 30px;
    justify-content: center;
}

.pagination a {
    padding: 10px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #666;
    transition: background 0.3s, color 0.3s;
}

.pagination a:hover,
.pagination a.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.login-container button {
    width: 100%;
    padding: 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.login-container button:hover {
    background: #5568d3;
}

.login-hint {
    text-align: center;
    margin-top: 20px;
    color: #888;
    font-size: 0.9rem;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

.admin-body {
    background: #f0f2f5;
}

.admin-header {
    background: #333;
    color: white;
    padding: 15px 0;
    margin-bottom: 0;
}

.admin-header a {
    color: white;
    text-decoration: none;
}

.admin-content {
    display: flex;
    gap: 0;
}

.admin-sidebar {
    width: 220px;
    background: white;
    min-height: calc(100vh - 70px);
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.admin-sidebar h3 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.admin-sidebar a {
    color: #555;
    text-decoration: none;
    padding: 10px 12px;
    display: block;
    border-radius: 4px;
    margin-bottom: 5px;
    transition: background 0.3s;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: #667eea;
    color: white;
}

.admin-main {
    flex: 1;
    padding: 30px;
}

.admin-main h2 {
    color: #333;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #f0f0f0;
    color: #555;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-edit {
    background: #4caf50;
    color: white;
}

.btn-edit:hover {
    background: #43a047;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:hover {
    background: #d32f2f;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.admin-table th,
.admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.admin-table tr:hover {
    background: #f8f9fa;
}

.admin-table a {
    color: #667eea;
    text-decoration: none;
}

.admin-table a:hover {
    text-decoration: underline;
}

.status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.status.published {
    background: #e8f5e9;
    color: #2e7d32;
}

.status.draft {
    background: #fff3e0;
    color: #ef6c00;
}

.form-actions {
    margin-top: 25px;
    display: flex;
    gap: 15px;
}

.error-404 {
    text-align: center;
    padding: 60px 20px;
}

.error-404 h1 {
    font-size: 6rem;
    color: #667eea;
    margin-bottom: 20px;
}

.error-404 h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #333;
}

.error-404 p {
    color: #666;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    header .container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    header nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .article-full {
        padding: 20px;
    }
    
    .article-full h1 {
        font-size: 1.5rem;
    }
    
    .admin-content {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        min-height: auto;
    }
}
