/* Modern Composition Website CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #1abc9c; /* Bookish Green */
    --primary-hover: #16a085;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --text-light: #bdc3c7;
    --border-color: #ecf0f1;
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.05);
    --shadow-hover: 0 15px 40px rgba(26,188,156,0.15);
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

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

/* Header */
.zw-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.04);
}

.zw-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.zw-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.zw-logo i {
    font-size: 28px;
}

.zw-nav {
    display: flex;
    gap: 30px;
}

.zw-nav a {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
    padding: 8px 0;
    position: relative;
}

.zw-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary-color);
    transition: var(--transition);
    border-radius: 3px;
}

.zw-nav a:hover {
    color: var(--primary-color);
}

.zw-nav a:hover::after, .zw-nav a.active::after {
    width: 100%;
}

.zw-nav a.active {
    color: var(--primary-color);
}

.zw-search {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border-radius: 30px;
    padding: 5px 15px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.zw-search:focus-within {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(26,188,156,0.1);
}

.zw-search input {
    border: none;
    background: transparent;
    padding: 8px 10px;
    outline: none;
    font-size: 14px;
    width: 200px;
}

.zw-search button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
}

.zw-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 28px;
    color: var(--text-main);
    cursor: pointer;
}

/* Hero Section */
.zw-hero {
    padding: 80px 40px;
    background: url('../images/hero_bg.png') center/cover no-repeat;
    border-radius: var(--radius-lg);
    margin-top: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    color: #fff;
    box-shadow: 0 15px 35px rgba(26,188,156,0.2);
}

.zw-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(26,188,156,0.8) 0%, rgba(44,62,80,0.6) 100%);
    z-index: 1;
}

.zw-hero > * {
    position: relative;
    z-index: 2;
}

.zw-hero h1 {
    font-size: 46px;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.zw-hero p {
    font-size: 18px;
    max-width: 650px;
    margin: 0 auto 40px;
    opacity: 0.9;
    text-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

.zw-hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 15px 35px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-num {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.stat-label {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

/* Category Grid */
.zw-section {
    padding: 60px 0;
}

.zw-section-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.zw-section-title span {
    position: relative;
    padding-left: 15px;
}

.zw-section-title span::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 5px;
}

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

.zw-cat-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.zw-cat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: var(--transition);
    transform-origin: left;
}

.zw-cat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.zw-cat-card:hover::before {
    transform: scaleX(1);
}

.zw-cat-icon {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 15px;
    opacity: 0.8;
}

.zw-cat-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

/* Article List Layout & Sidebar */
.zw-content-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}
.zw-main-content {
    flex: 1;
    min-width: 0;
}
.zw-sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 30px;
}
@media (max-width: 992px) {
    .zw-content-layout { flex-direction: column; }
    .zw-sidebar { width: 100%; }
}

/* Sidebar Widgets */
.zw-widget {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}
.zw-widget-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}
.zw-widget-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 4px;
}

/* Ranking List */
.zw-ranking-list {
    counter-reset: rank;
}
.zw-ranking-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
}
.zw-ranking-item:last-child {
    margin-bottom: 0;
}
.zw-ranking-item::before {
    counter-increment: rank;
    content: counter(rank);
    width: 24px;
    height: 24px;
    background: var(--border-color);
    color: var(--text-muted);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}
.zw-ranking-item:nth-child(1)::before { background: #e74c3c; color: #fff; }
.zw-ranking-item:nth-child(2)::before { background: #e67e22; color: #fff; }
.zw-ranking-item:nth-child(3)::before { background: #f1c40f; color: #fff; }
.zw-ranking-item a {
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.zw-ranking-item a:hover {
    color: var(--primary-color);
}

/* Tag Cloud */
.zw-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.zw-tags a {
    padding: 6px 12px;
    background: rgba(26,188,156,0.08);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 13px;
    transition: var(--transition);
}
.zw-tags a:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

/* Article List */
.zw-article-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.zw-article-card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    text-decoration: none;
    overflow: hidden;
    position: relative;
    color: var(--text-main);
}
.zw-article-card.has-thumb {
    flex-direction: column;
    padding: 0;
    gap: 0;
}
.zw-article-thumb {
    width: 100%;
    height: 180px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}
.zw-article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}
.zw-article-card:hover .zw-article-thumb img {
    transform: scale(1.05);
}
.zw-article-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 25px;
}
.zw-article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(26,188,156,0.3);
}

.zw-article-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 13px;
    color: var(--text-muted);
}

.zw-tag {
    background: rgba(26,188,156,0.1);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.zw-article-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.4;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.zw-article-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.zw-article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-light);
}

.read-more {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 14px;
}

.read-more:hover {
    text-decoration: underline;
}

/* Article View */
.zw-article-view {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 50px 60px;
    box-shadow: var(--shadow-soft);
    margin-top: 20px;
    margin-bottom: 60px;
    position: relative;
    transition: background 0.3s, color 0.3s;
}

/* Eye Protection Mode */
body.eye-protect {
    --bg-color: #e8f5e9;
    --card-bg: #cce8cf;
    --text-main: #1f3b22;
    background-color: var(--bg-color);
}
body.eye-protect .zw-article-view {
    background: var(--card-bg);
    color: var(--text-main);
    box-shadow: none;
    border: 1px solid #9fcfa4;
}

/* Reading Tools Toolbar */
.zw-reading-tools {
    position: absolute;
    top: 50px;
    right: -60px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.zw-tool-btn {
    width: 45px;
    height: 45px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: var(--transition);
    font-size: 18px;
}
.zw-tool-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}
@media (max-width: 1300px) {
    .zw-reading-tools {
        position: static;
        flex-direction: row;
        justify-content: flex-end;
        margin-bottom: 20px;
    }
}

.zw-view-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px dashed var(--border-color);
}

.zw-view-title {
    font-size: 34px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
    line-height: 1.4;
}

.zw-view-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.zw-view-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.zw-view-content {
    font-size: 18px;
    line-height: 2.2;
    color: #34495e;
    transition: font-size 0.3s;
}

body.eye-protect .zw-view-content {
    font-size: 18px;
    line-height: 2;
    color: var(--text-main);
    margin-bottom: 40px;
    overflow-x: hidden;
}
.zw-view-content p {
    margin-bottom: 20px;
    text-indent: 2em; /* Indent for compositions */
}
/* 解决手机端后台插入大图超宽、错位、以及被首行缩进挤出去的问题 */
.zw-view-content p:has(img) {
    text-indent: 0;
    text-align: center;
}
.zw-view-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 15px auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}.zw-teacher-comment {
    margin-top: 40px;
    padding: 30px;
    border-radius: var(--radius-md);
    background: linear-gradient(to right, rgba(26,188,156,0.05), rgba(26,188,156,0.02));
    border-left: 4px solid var(--primary-color);
    position: relative;
    font-size: 16px;
    line-height: 1.8;
}

.zw-teacher-comment::before {
    content: '\eb8b'; /* iconfont quote icon approximation or use a badge */
    font-family: "iconfont" !important;
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 60px;
    color: var(--primary-color);
    opacity: 0.1;
}

.tc-title {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Footer */
.zw-footer {
    background: #fff;
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

.zw-friend-links {
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.zw-friend-links span {
    font-weight: 700;
}

.zw-friend-links a {
    color: var(--text-muted);
    transition: var(--transition);
}

.zw-friend-links a:hover {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .zw-article-card.has-thumb {
        flex-direction: column;
    }
    .zw-article-thumb {
        width: 100%;
        height: 180px;
    }
    .zw-article-card.has-thumb .zw-article-body {
        padding: 20px;
    }
    .zw-header-inner {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
        gap: 0;
    }
    .zw-header-brand {
        width: 100%;
    }
    .zw-menu-toggle {
        display: block;
    }
    .zw-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
        background: var(--bg-color);
        padding: 10px;
        border-radius: var(--radius-md);
        gap: 5px;
    }
    .zw-nav.show {
        display: flex;
    }
    .zw-nav a {
        padding: 12px 15px;
    }
    .zw-nav a::after {
        display: none;
    }
    .zw-nav a.active {
        background: var(--primary-color);
        color: #fff;
        border-radius: var(--radius-sm);
    }
    .zw-search {
        display: none;
        width: 100%;
        margin-top: 15px;
    }
    .zw-search.show {
        display: flex;
    }
    .zw-search input {
        width: 100%;
    }
    .zw-hero {
        padding: 40px 20px;
    }
    .zw-hero h1 {
        font-size: 28px;
    }
    .zw-hero-stats {
        flex-direction: column;
        gap: 15px;
    }
    .zw-article-view {
        padding: 30px 20px;
    }
    .zw-view-title {
        font-size: 24px;
    }
    .zw-view-content {
        font-size: 16px;
    }
}

/* Print Friendly Mode (For Parents/Teachers printing essays) */
@media print {
    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
    }
    .zw-header, .zw-footer, .zw-reading-tools, .zw-article-nav, .zw-recommended, .zw-breadcrumb, .tc-title {
        display: none !important;
    }
    .zw-article-view {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .zw-view-title {
        font-size: 24pt;
        text-align: center;
        color: #000;
        page-break-after: avoid;
    }
    .zw-view-meta {
        color: #555;
        border-bottom: 2px solid #000;
        padding-bottom: 15px;
        margin-bottom: 20px;
    }
    .zw-view-content p {
        font-size: 14pt;
        line-height: 2;
        color: #000;
        page-break-inside: avoid;
    }
    .zw-teacher-comment {
        border: 2px dashed #000;
        background: none;
        padding: 20px;
        page-break-inside: avoid;
    }
    .zw-teacher-comment::before {
        content: "【名师点评】";
        font-size: 16pt;
        font-weight: bold;
        position: static;
        opacity: 1;
        display: block;
        margin-bottom: 10px;
        color: #000;
    }
    @page {
        margin: 2cm;
    }
}
