* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333333;
    background-color: #FAFAF8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.container {
    max-width: 1256px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: #88D8C0;
    padding: 12px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo {
    height: 36px;
    width: 36px;
    vertical-align: middle;
    margin-right: 8px;
    border-radius: 0;
}

.header-title-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-filter {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.header-filter .button-group {
    justify-content: center;
}

.header-filter .filter-btn {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    color: #333;
    border-radius: 0;
}

.header-filter .filter-btn:hover {
    background-color: #F7A072;
    border-color: #F7A072;
    color: white;
}

.header-filter .filter-btn.active {
    background-color: #F7A072;
    border-color: #F7A072;
    color: white;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.login-btn {
    padding: 10px 20px;
    background: #88D8C0;
    color: white;
    border: none;
    border-radius: 0;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: #6EC4A8;
}

.header-admin-link {
    text-decoration: none;
    color: #666;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.header-admin-link:hover {
    color: #F7A072;
}

.admin-link {
    text-decoration: none;
    color: #F7A072;
    font-weight: 600;
    font-size: 1rem;
    padding: 10px 20px;
    border: 2px solid #F7A072;
    border-radius: 0;
    transition: all 0.3s ease;
}

.admin-link:hover {
    background-color: #F7A072;
    color: white;
    border-color: transparent;
}

.back-link {
    text-decoration: none;
    color: #F7A072;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 8px 16px;
    border: 2px solid #F7A072;
    border-radius: 0;
    transition: all 0.3s ease;
}

.back-link:hover {
    background-color: #F7A072;
    color: white;
}

header h1 {
    font-size: 1.6rem;
    color: #ffffff;
    margin: 0;
    text-align: left;
}

.header-subtitle {
    color: #666;
    font-size: 0.9rem;
}

header p {
    color: #666;
    font-size: 1rem;
    text-align: left;
}

.articles-section {
    padding: 25px 0;
}

.pagination-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px 0;
}

.pagination-btn {
    padding: 10px 25px;
    background: #88D8C0;
    border: 2px solid #88D8C0;
    border-radius: 0;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination-btn:hover {
    background: #F7A072;
    border-color: #F7A072;
    color: white;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
    width: 100px;
    flex-shrink: 0;
}

.button-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
}

.button-group .filter-btn {
    flex: 1;
    min-width: 120px;
    max-width: 160px;
    text-align: center;
}

.filter-btn {
    padding: 9px 15px;
    border: 2px solid #88D8C0;
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background-color: white;
    color: #88D8C0;
}

.filter-btn:hover {
    background-color: #F7A072;
    border-color: #F7A072;
    color: white;
    transform: translateY(-2px);
}

.filter-btn.active {
    background-color: #F7A072;
    border-color: #F7A072;
    color: white;
    box-shadow: 0 4px 12px rgba(247, 160, 114, 0.3);
}

.filter-btn.active:hover {
    background-color: #E89062;
    transform: translateY(-2px);
}

.articles-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sort-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    padding: 7px 20px;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 5px;
}

.sort-buttons {
    display: flex;
    gap: 12px;
}

.search-box {
    display: flex;
    gap: 8px;
}

.search-box input {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 0;
    font-size: 0.9rem;
    width: 375px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #F7A072;
    box-shadow: 0 0 0 3px rgba(247, 160, 114, 0.1);
}

.search-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 0;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #F7A072;
    color: white;
}

.search-btn:hover {
    background-color: #E89062;
    transform: translateY(-2px);
}

.sort-btn {
    padding: 10px 24px;
    border: 2px solid #88D8C0;
    border-radius: 0;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: white;
    color: #88D8C0;
}

.sort-btn:hover {
    background-color: #88D8C0;
    color: white;
}

.sort-btn.active {
    background-color: #F7A072;
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(247, 160, 114, 0.3);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 0;
    margin: 0;
    max-height: 920px;
    overflow-y: auto;
}

.article-card {
    display: flex;
    background-color: #F0FFF5;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(136, 216, 192, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
    border: 1px solid rgba(136, 216, 192, 0.6);
    max-height: 150px;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(247, 160, 114, 0.25);
    border-color: #F7A072;
    background-color: rgba(247, 160, 114, 0.15);
}

.article-image {
    flex-shrink: 0;
    width: 160px;
    height: 100%;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-info {
    flex: 1;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.article-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.article-title-link {
    text-decoration: none;
    color: #222222;
    transition: all 0.3s ease;
}

.article-title-link:hover {
    color: #F7A072;
}

.article-title-link h3 {
    font-size: 1rem;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.article-meta {
    font-size: 0.85rem;
    color: #666;
    position: absolute;
    bottom: 15px;
    left: 16px;
    right: 16px;
}

.article-excerpt {
    font-size: 0.95rem;
    color: #888;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.article-stats {
    display: flex;
    gap: 20px;
    padding: 10px 20px;
    background: #f8f9fa;
    border-radius: 0;
    margin-right: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.stat-icon {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.stat-value.read {
    color: #10b981;
}

.stat-value.unread {
    color: #ef4444;
}

.level-badge {
    display: inline-block;
    font-weight: normal;
    color: #666;
}

.level-1 { color: #666; }
.level-2 { color: #666; }
.level-3 { color: #666; }
.level-4 { color: #666; }
.level-5 { color: #666; }

.reading-container {
    padding: 0 0 40px;
    max-width: 1250px;
}

#article-content.reading-main {
    background-color: #F2F8F0;
    border-radius: 0;
    box-shadow: 0 4px 15px rgba(136, 216, 192, 0.15);
    overflow: hidden;
    border: 1px solid rgba(136, 216, 192, 0.3);
    margin-top: 0;
}

.reading-header {
    padding: 10px 30px;
    background-color: #88D8C0;
    color: #222222;
    margin-top: 0;
}

.reading-header h1 {
    font-size: 1.5rem;
    margin: 5px 0;
}

.category-tag {
    display: inline-block;
    padding: 6px 14px;
    background-color: rgba(247, 160, 114, 0.3);
    color: #222222;
    border-radius: 0;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.reading-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    margin-top: 10px;
}

.reading-body {
    padding: 40px;
    font-size: 20px;
    line-height: 1.9;
    color: #333;
}

.reading-body p {
    margin-bottom: 25px;
    text-align: justify;
    text-justify: inter-word;
}

.reading-body .cover-image {
    display: block;
    width: 400px;
    height: 300px;
    object-fit: cover;
    margin: 30px auto;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.reading-body .article-image {
    display: block;
    width: 400px;
    height: 300px;
    object-fit: cover;
    margin: 20px auto;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.loading, .error {
    padding: 60px;
    text-align: center;
    color: #666;
    font-size: 1.2rem;
}

footer {
    background: #88D8C0;
    text-align: center;
    padding: 10px 0;
    color: #fff;
}

.reading-footer {
    background-color: #88D8C0;
    text-align: center;
    padding: 8px 0;
    margin-top: 20px;
    box-shadow: 0 -4px 15px rgba(136, 216, 192, 0.2);
    position: sticky;
    bottom: 0;
}

.reading-footer .back-link {
    display: inline-block;
    padding: 5px 20px;
    background-color: #F7A072;
    color: white;
    text-decoration: none;
    border-radius: 0;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(247, 160, 114, 0.3);
}

.reading-footer .back-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(247, 160, 114, 0.4);
}

@media (max-width: 1200px) {
    .article-list-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .article-info {
        padding-right: 0;
    }
    
    .article-stats {
        margin-right: 0;
        justify-content: space-around;
    }
}

@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: static;
    }
    
    .button-group {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .filter-btn {
        flex: 1;
        min-width: calc(50% - 5px);
        text-align: center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    
    header {
        padding: 8px 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .header-filter {
        width: 100%;
    }
    
    .header-filter .filter-btn {
        padding: 5px 10px;
        font-size: 0.7rem;
    }

    .articles-section {
        padding: 12px 0;
    }
    
    .filter-row {
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .button-group {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .filter-btn {
        flex: 1;
        min-width: calc(33.33% - 4px);
        max-width: none;
        padding: 7px 8px;
        font-size: 0.72rem;
    }
    
    .sort-bar {
        padding: 10px 12px;
        margin-bottom: 10px;
    }
    
    .search-box {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .search-box input {
        width: 100%;
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .search-btn {
        width: 100%;
        padding: 9px;
        font-size: 0.9rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        max-height: none;
    }
    
    .article-card {
        max-height: 150px;
        flex-direction: row;
        padding: 0;
    }
    
    .article-image {
        width: 96px;
        height: 100%;
        flex-shrink: 0;
    }
    
    .article-image img {
        border-radius: 0;
    }
    
    .article-info {
        padding: 10px 12px;
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .article-title-link h3 {
        font-size: 0.8rem;
        line-height: 1.3;
        -webkit-line-clamp: 2;
        margin-bottom: 6px;
    }
    
    .article-excerpt {
        font-size: 0.75rem;
        color: #666;
        -webkit-line-clamp: 1;
        margin-bottom: 6px;
        flex: 1;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .article-meta {
        font-size: 0.72rem;
        color: #888;
        position: static;
        margin-top: auto;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .level-badge {
        padding: 2px 6px;
        margin-right: 4px;
    }
    
    .pagination-bar {
        gap: 8px;
        padding: 12px 0;
    }
    
    .pagination-btn {
        padding: 7px 14px;
        font-size: 0.82rem;
    }
    
    .pagination-info {
        font-size: 0.82rem;
    }
    
    .reading-container {
        padding: 15px 0;
    }
    
    .reading-header {
        padding: 15px 12px;
        margin-bottom: 0;
    }
    
    .reading-header h1 {
        font-size: 1.3rem;
        margin: 10px 0;
        line-height: 1.4;
    }
    
    .category-tag {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
    
    .reading-meta {
        font-size: 0.75rem;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .reading-body {
        padding: 15px;
        font-size: 15px;
        line-height: 1.8;
        min-height: calc(100vh - 200px);
    }
    
    .reading-body p {
        margin-bottom: 18px;
        text-indent: 2em;
    }
    
    .reading-body .cover-image,
    .reading-body .article-image {
        width: 100%;
        height: auto;
        max-height: 240px;
        margin: 15px 0;
        border-radius: 0;
    }
    
    .reading-body img {
        max-width: 100%;
        height: auto;
    }
    
    .reading-footer {
        padding: 8px 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    }
    
    .reading-footer .back-link {
        padding: 10px 20px;
        font-size: 0.88rem;
        border-radius: 0;
        background-color: #88D8C0;
        color: white;
    }
    
    .reading-footer .back-link:hover {
        background-color: #6EC4A8;
    }
}

@media (max-width: 480px) {
    .header-logo {
        height: 22px;
        width: 22px;
    }
    
    header h1 {
        font-size: 0.95rem;
    }
    
    .filter-btn {
        min-width: calc(50% - 3px);
        font-size: 0.68rem;
        padding: 6px 6px;
    }
    
    .article-image {
        height: 140px;
    }
    
    .article-title-link h3 {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }
    
    .article-excerpt {
        font-size: 0.78rem;
        -webkit-line-clamp: 1;
    }
    
    .article-meta {
        font-size: 0.68rem;
        gap: 4px;
    }
    
    .reading-header h1 {
        font-size: 1.15rem;
    }
    
    .reading-body {
        font-size: 14px;
        line-height: 1.7;
        padding: 12px;
        padding-bottom: 80px;
    }
    
    .reading-body p {
        margin-bottom: 15px;
    }
    
    .reading-body .cover-image,
    .reading-body .article-image {
        max-height: 200px;
    }
    
    .reading-footer .back-link {
        padding: 9px 16px;
        font-size: 0.82rem;
    }
}
