/* ==================== Reset & Base ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f5f5; color: #333; line-height: 1.6; min-height: 100vh; }
a { text-decoration: none; color: inherit; transition: color 0.2s; }
a:hover { color: #5bbad5; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ==================== Navbar ==================== */
.navbar {
    background: linear-gradient(135deg, #87CEEB, #b3e5fc);
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.nav-container {
    max-width: 1400px; margin: 0 auto;
    display: flex; align-items: center;
    padding: 0 20px; height: 60px;
}
.nav-brand {
    display: flex; align-items: center; gap: 8px;
    font-size: 1.3rem; font-weight: 700; color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    white-space: nowrap;
}
.nav-icon { font-size: 1.5rem; }
.nav-links {
    display: flex; align-items: center; gap: 6px;
    margin-left: 30px; flex: 1;
}
.nav-link {
    color: rgba(255,255,255,0.9); font-weight: 600; font-size: 0.95rem;
    padding: 8px 14px; border-radius: 6px;
    transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.25); color: #fff;
}
.nav-right {
    display: flex; align-items: center; gap: 12px;
    margin-left: auto;
}
.nav-search {
    position: relative; display: flex; align-items: center;
}
.nav-search .search-icon {
    position: absolute; left: 12px; font-size: 0.85rem;
    opacity: 0.6; pointer-events: none;
}
.nav-search input {
    padding: 8px 14px 8px 34px;
    border: none; border-radius: 20px;
    background: rgba(255,255,255,0.85);
    font-size: 0.9rem; width: 200px;
    outline: none; transition: all 0.3s;
}
.nav-search input:focus { width: 260px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.nav-btn {
    background: rgba(255,255,255,0.9); color: #5bbad5;
    padding: 8px 20px; border-radius: 20px;
    font-weight: 600; font-size: 0.9rem;
    transition: all 0.2s;
}
.nav-btn:hover { background: #fff; color: #3aa0c0; transform: translateY(-1px); }
.nav-hamburger {
    display: none; background: none; border: none;
    font-size: 1.5rem; color: #fff; cursor: pointer;
}

/* ==================== Main Content ==================== */
.main-content { max-width: 1400px; margin: 0 auto; padding: 20px; min-height: 60vh; }

/* ==================== Carousel ==================== */
.carousel-section {
    position: relative; width: 100%;
    border-radius: 12px; overflow: hidden;
    margin-bottom: 30px; height: 420px;
}
.carousel-track {
    display: flex; height: 100%;
    transition: transform 0.5s ease;
}
.carousel-slide {
    min-width: 100%; height: 100%;
    position: relative; display: flex;
}
.carousel-slide .slide-main {
    width: 65%; height: 100%; position: relative; overflow: hidden;
}
.carousel-slide .slide-main img {
    width: 100%; height: 100%; object-fit: cover;
}
.carousel-slide .slide-main .slide-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 30px; background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
}
.slide-overlay h3 { font-size: 1.5rem; margin-bottom: 8px; }
.slide-overlay p { font-size: 0.95rem; opacity: 0.9; }
.carousel-slide .slide-sidebar {
    width: 35%; height: 100%; position: relative;
    background-size: cover; background-position: center;
    display: flex; flex-direction: column; justify-content: center;
    padding: 30px;
}
.slide-sidebar::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(91,186,213,0.85), rgba(91,186,213,0.6));
}
.slide-sidebar > * { position: relative; z-index: 1; color: #fff; }
.slide-sidebar h3 { font-size: 1.4rem; margin-bottom: 10px; font-weight: 700; }
.slide-sidebar p { font-size: 0.9rem; opacity: 0.9; margin-bottom: 16px; }
.slide-sidebar .slide-btn {
    display: inline-block; background: #fff; color: #5bbad5;
    padding: 10px 24px; border-radius: 25px;
    font-weight: 600; transition: all 0.2s;
    width: fit-content;
}
.slide-sidebar .slide-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(91,186,213,0.7); color: #fff;
    border: none; font-size: 1.2rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; z-index: 10;
}
.carousel-btn:hover { background: rgba(91,186,213,0.95); }
.carousel-btn.prev { left: 15px; }
.carousel-btn.next { right: 15px; }

/* ==================== Content Grid (3-column with sidebars) ==================== */
.content-grid {
    display: grid;
    grid-template-columns: 200px 1fr 280px;
    gap: 24px; margin-top: 20px;
}
.tags-sidebar {
    background: #fff; border-radius: 12px;
    padding: 20px; height: fit-content;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.tags-sidebar h3 {
    color: #5bbad5; font-size: 1rem; margin-bottom: 15px;
    display: flex; align-items: center; gap: 6px;
}
.tags-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item {
    display: inline-block; padding: 5px 14px;
    background: #f0f7fa; border: 1px solid #d4eaf3;
    border-radius: 20px; font-size: 0.85rem; color: #555;
    transition: all 0.2s;
}
.tag-item:hover { background: #5bbad5; color: #fff; border-color: #5bbad5; }

/* ==================== Article Section ==================== */
.articles-section { min-width: 0; }
.section-title {
    color: #5bbad5; font-size: 1.3rem; font-weight: 700;
    margin-bottom: 20px;
}
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.article-card {
    background: #fff; border-radius: 12px;
    overflow: hidden; transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.article-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.article-card .card-image {
    width: 100%; height: 180px;
    object-fit: cover;
}
.article-card .card-body { padding: 16px; }
.article-card .card-category {
    display: inline-block; font-size: 0.75rem;
    color: #5bbad5; background: #f0f7fa;
    padding: 2px 10px; border-radius: 10px;
    margin-bottom: 8px;
}
.article-card .card-title {
    font-size: 1rem; font-weight: 600; color: #333;
    margin-bottom: 8px; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.article-card .card-excerpt {
    font-size: 0.85rem; color: #888; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: 10px;
}
.article-card .card-meta {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.8rem; color: #aaa;
}
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.card-tags a {
    font-size: 0.75rem; color: #5bbad5;
    background: #f0f7fa; padding: 1px 8px;
    border-radius: 10px;
}

/* ==================== Sidebar ==================== */
.sidebar {
    background: #fff; border-radius: 12px;
    padding: 20px; height: fit-content;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.sidebar-section { margin-bottom: 24px; }
.sidebar-section:last-child { margin-bottom: 0; }
.sidebar-title {
    color: #5bbad5; font-size: 1rem; font-weight: 700;
    margin-bottom: 15px; display: flex; align-items: center; gap: 6px;
    padding-bottom: 10px; border-bottom: 2px solid #f0f0f0;
}
.sidebar-icon { font-size: 1rem; }
.hot-list li { margin-bottom: 12px; }
.hot-list li:last-child { margin-bottom: 0; }
.hot-list a {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 6px 0;
}
.hot-list a:hover .hot-title { color: #5bbad5; }
.hot-rank {
    width: 22px; height: 22px; border-radius: 4px;
    background: #e0e0e0; color: #fff; font-size: 0.75rem;
    font-weight: 700; display: flex; align-items: center;
    justify-content: center; flex-shrink: 0;
}
.hot-list li:nth-child(1) .hot-rank { background: #ff6b6b; }
.hot-list li:nth-child(2) .hot-rank { background: #ffa94d; }
.hot-list li:nth-child(3) .hot-rank { background: #ffd43b; }
.hot-info { flex: 1; min-width: 0; }
.hot-title {
    font-size: 0.85rem; color: #444; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    transition: color 0.2s;
}
.hot-views { font-size: 0.75rem; color: #aaa; }

/* ==================== Pagination ==================== */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; margin-top: 30px; flex-wrap: wrap;
}
.page-btn, .page-num {
    padding: 8px 16px; border-radius: 6px;
    font-size: 0.9rem; transition: all 0.2s;
}
.page-btn { background: #5bbad5; color: #fff; }
.page-btn:hover { background: #4aa3be; color: #fff; }
.page-num { background: #fff; color: #666; border: 1px solid #e0e0e0; }
.page-num:hover { border-color: #5bbad5; color: #5bbad5; }
.page-num.active { background: #5bbad5; color: #fff; border-color: #5bbad5; }
.page-dots { color: #aaa; padding: 0 4px; }
.page-info { color: #999; font-size: 0.85rem; margin-left: 10px; }

/* ==================== Article Detail ==================== */
.article-detail-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
}
.breadcrumb {
    font-size: 0.9rem; color: #888; margin-bottom: 20px;
}
.breadcrumb a { color: #5bbad5; }
.breadcrumb span { margin: 0 6px; }
.article-detail {
    background: #fff; border-radius: 12px;
    padding: 30px; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.article-detail h1 {
    font-size: 1.8rem; color: #222; margin-bottom: 16px; line-height: 1.4;
}
.article-meta {
    display: flex; align-items: center; gap: 16px;
    color: #999; font-size: 0.85rem; margin-bottom: 20px;
    padding-bottom: 16px; border-bottom: 1px solid #f0f0f0;
}
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.article-tags a {
    padding: 4px 14px; background: #f0f7fa;
    border-radius: 20px; font-size: 0.85rem; color: #5bbad5;
    border: 1px solid #d4eaf3;
}
.article-tags a:hover { background: #5bbad5; color: #fff; }
.article-content {
    font-size: 1rem; line-height: 1.8; color: #444;
}
.article-content h2 {
    font-size: 1.4rem; color: #333; margin: 24px 0 12px;
    padding-left: 12px; border-left: 4px solid #5bbad5;
}
.article-content h3 { font-size: 1.2rem; color: #444; margin: 20px 0 10px; }
.article-content p { margin-bottom: 16px; }
.article-content strong { color: #333; }
.article-content img { border-radius: 8px; margin: 16px 0; }
.article-actions {
    display: flex; gap: 12px; margin-top: 24px;
    padding-top: 20px; border-top: 1px solid #f0f0f0;
}
.action-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: 25px;
    background: #f5f5f5; color: #666;
    font-size: 0.9rem; border: none; cursor: pointer;
    transition: all 0.2s;
}
.action-btn:hover { background: #5bbad5; color: #fff; }
.action-btn.liked { background: #ff6b6b; color: #fff; }
.prev-next {
    display: flex; justify-content: space-between;
    margin-top: 24px; gap: 16px;
}
.prev-next a {
    flex: 1; padding: 16px; background: #f8f9fa;
    border-radius: 8px; font-size: 0.9rem;
    transition: all 0.2s;
}
.prev-next a:hover { background: #e8f4f8; }
.prev-next .pn-label { font-size: 0.8rem; color: #999; margin-bottom: 4px; }
.prev-next .pn-title { color: #333; font-weight: 500; }

/* Related articles */
.related-section { margin-top: 30px; }
.related-section h3 {
    font-size: 1.1rem; color: #333; margin-bottom: 16px;
    padding-bottom: 10px; border-bottom: 2px solid #5bbad5;
    display: inline-block;
}
.related-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}

/* ==================== Category/Tag/Search Page ==================== */
.list-page-header {
    margin-bottom: 24px;
}
.list-page-header h1 {
    font-size: 1.5rem; color: #333;
}
.list-page-header p { color: #888; font-size: 0.9rem; margin-top: 4px; }
.list-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
}
.search-box {
    display: flex; gap: 10px; margin-bottom: 20px;
}
.search-box input {
    flex: 1; padding: 12px 20px;
    border: 2px solid #e0e0e0; border-radius: 8px;
    font-size: 1rem; outline: none;
    transition: border-color 0.2s;
}
.search-box input:focus { border-color: #5bbad5; }
.search-box button {
    padding: 12px 24px; background: #5bbad5;
    color: #fff; border: none; border-radius: 8px;
    font-size: 1rem; cursor: pointer;
    transition: background 0.2s;
}
.search-box button:hover { background: #4aa3be; }

/* ==================== Login/Register ==================== */
.auth-container {
    max-width: 420px; margin: 40px auto;
    background: #fff; border-radius: 12px;
    padding: 40px; box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.auth-container h1 {
    text-align: center; font-size: 1.5rem; color: #333;
    margin-bottom: 30px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; font-size: 0.9rem; color: #555;
    margin-bottom: 6px; font-weight: 500;
}
.form-group input {
    width: 100%; padding: 12px 16px;
    border: 2px solid #e8e8e8; border-radius: 8px;
    font-size: 1rem; outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus { border-color: #5bbad5; }
.form-submit {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, #87CEEB, #5bbad5);
    color: #fff; border: none; border-radius: 8px;
    font-size: 1.05rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.form-submit:hover { opacity: 0.9; transform: translateY(-1px); }
.auth-link {
    text-align: center; margin-top: 16px;
    font-size: 0.9rem; color: #888;
}
.auth-link a { color: #5bbad5; font-weight: 500; }
.alert {
    padding: 12px 16px; border-radius: 8px;
    margin-bottom: 16px; font-size: 0.9rem;
}
.alert-error { background: #fff0f0; color: #d32f2f; border: 1px solid #ffc7c7; }
.alert-success { background: #f0fff0; color: #2e7d32; border: 1px solid #c7ffc7; }

/* ==================== 404 Page ==================== */
.error-page {
    text-align: center; padding: 80px 20px;
}
.error-page h1 { font-size: 5rem; color: #5bbad5; margin-bottom: 10px; }
.error-page p { font-size: 1.2rem; color: #888; margin-bottom: 30px; }
.error-page a {
    display: inline-block; padding: 12px 30px;
    background: #5bbad5; color: #fff;
    border-radius: 25px; font-weight: 600;
}

/* ==================== Footer ==================== */
.footer {
    background: #2c3e50; color: rgba(255,255,255,0.7);
    padding: 30px 20px; margin-top: 40px; text-align: center;
}
.footer-container { max-width: 1400px; margin: 0 auto; }
.footer p { font-size: 0.85rem; margin-bottom: 4px; }

/* ==================== Responsive ==================== */
@media (max-width: 1200px) {
    .content-grid { grid-template-columns: 1fr 240px; }
    .tags-sidebar { display: none; }
    .articles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0; background: linear-gradient(135deg, #87CEEB, #b3e5fc); flex-direction: column; padding: 10px; z-index: 999; }
    .nav-links.show { display: flex; }
    .nav-hamburger { display: block; }
    .nav-search input { width: 130px; }
    .nav-search input:focus { width: 160px; }
    .content-grid { grid-template-columns: 1fr; }
    .tags-sidebar { display: none; }
    .articles-grid { grid-template-columns: repeat(2, 1fr); }
    .article-detail-grid { grid-template-columns: 1fr; }
    .list-grid { grid-template-columns: 1fr; }
    .carousel-section { height: 280px; }
    .carousel-slide .slide-main { width: 100%; }
    .carousel-slide .slide-sidebar { display: none; }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
    .prev-next { flex-direction: column; }
}
@media (max-width: 480px) {
    .articles-grid { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr; }
    .article-detail { padding: 20px; }
    .article-detail h1 { font-size: 1.4rem; }
}
