/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif; color: #1a1a2e; background: #f8f9fa; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ===== Header ===== */
.site-header { background: hsl(197, 65%, 42%); color: #fff; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: #fff; }
.logo svg { width: 28px; height: 28px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.9); transition: all 0.2s; }
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,0.2); color: #fff; }
.header-right { display: flex; align-items: center; gap: 12px; }
.search-box { position: relative; }
.search-box input { width: 200px; padding: 8px 36px 8px 14px; border: 1px solid rgba(255,255,255,0.3); border-radius: 20px; background: rgba(255,255,255,0.15); color: #fff; font-size: 14px; outline: none; transition: all 0.3s; }
.search-box input::placeholder { color: rgba(255,255,255,0.6); }
.search-box input:focus { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.5); width: 240px; }
.search-box button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; color: rgba(255,255,255,0.8); cursor: pointer; }
.btn-login { padding: 8px 20px; border-radius: 20px; background: rgba(255,255,255,0.2); color: #fff; font-size: 14px; font-weight: 500; border: 1px solid rgba(255,255,255,0.3); cursor: pointer; transition: all 0.2s; }
.btn-login:hover { background: rgba(255,255,255,0.3); }
.user-menu { position: relative; }
.user-menu-btn { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 20px; background: rgba(255,255,255,0.2); border: none; color: #fff; cursor: pointer; font-size: 14px; }
.user-dropdown { position: absolute; right: 0; top: 100%; padding-top: 6px; min-width: 160px; display: none; background: transparent; }
.user-menu:hover .user-dropdown { display: block; }
.user-dropdown a { display: block; padding: 10px 16px; color: #333; font-size: 14px; background: #fff; border-bottom: 1px solid #f0f0f0; }
.user-dropdown { box-shadow: none; }
.user-dropdown a:hover { background: #f0f7fa; }
.hamburger { display: none; background: none; border: none; color: #fff; cursor: pointer; padding: 8px; }

/* ===== Carousel ===== */
.carousel { position: relative; max-width: 1200px; margin: 24px auto; border-radius: 16px; overflow: hidden; height: 400px; }
.carousel-track { display: flex; height: 100%; transition: transform 0.5s ease; }
.carousel-slide { min-width: 100%; height: 100%; position: relative; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 40px 32px; background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0.4), transparent); }
.carousel-overlay h2 { font-size: 28px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.carousel-overlay p { font-size: 16px; color: rgba(255,255,255,0.9); margin-bottom: 16px; }
.btn-read-more { display: inline-block; padding: 10px 24px; background: hsl(180, 65%, 85%); color: #000; border-radius: 8px; font-weight: 600; font-size: 14px; transition: all 0.2s; }
.btn-read-more:hover { background: hsl(180, 65%, 75%); transform: translateY(-1px); }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; background: hsl(180, 65%, 85%); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #000; transition: all 0.2s; backdrop-filter: blur(4px); z-index: 2; }
.carousel-btn:hover { background: hsl(180, 65%, 75%); }
.carousel-prev { left: 16px; }
.carousel-next { right: 16px; }
.carousel-dots { position: absolute; bottom: 16px; right: 32px; display: flex; gap: 6px; }
.carousel-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.5); border: none; cursor: pointer; transition: all 0.2s; }
.carousel-dot.active { background: #fff; width: 24px; border-radius: 4px; }

/* ===== Main Layout ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.content-layout { display: grid; grid-template-columns: 200px 1fr 260px; gap: 24px; margin: 24px auto; max-width: 1200px; padding: 0 20px; }
.left-sidebar { order: 1; }
.main-content { min-width: 0; order: 2; }
.right-sidebar { order: 3; }

/* ===== Section Titles ===== */
.section-title { font-size: 24px; font-weight: 700; margin-bottom: 20px; background: linear-gradient(135deg, hsl(197, 71%, 53%), hsl(180, 65%, 55%)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.section-title-sm { font-size: 18px; font-weight: 600; margin-bottom: 16px; background: linear-gradient(135deg, hsl(197, 71%, 53%), hsl(180, 65%, 55%)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; display: flex; align-items: center; gap: 8px; }

/* ===== Sidebar ===== */
.sidebar-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 20px; border: 1px solid #e8ecf0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-badge { display: inline-block; padding: 6px 14px; background: #f0f7fa; border: 1px solid #d5e8f0; border-radius: 20px; font-size: 13px; color: #4a7c8f; transition: all 0.2s; }
.tag-badge:hover { background: hsl(197, 71%, 73%); color: #fff; border-color: hsl(197, 71%, 73%); }
.popular-list { list-style: none; }
.popular-list li { padding: 10px 0; border-bottom: 1px solid #f0f0f0; display: flex; align-items: flex-start; gap: 10px; }
.popular-list li:last-child { border-bottom: none; }
.popular-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: hsl(197, 71%, 73%); color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.popular-list li:nth-child(1) .popular-num { background: #ff6b6b; }
.popular-list li:nth-child(2) .popular-num { background: #ffa726; }
.popular-list li:nth-child(3) .popular-num { background: #66bb6a; }
.popular-link { font-size: 14px; color: #333; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.popular-link:hover { color: hsl(197, 71%, 53%); }

/* ===== Article Cards ===== */
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.article-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid #e8ecf0; transition: all 0.3s; }
.article-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,0.12); }
.card-image { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.article-card:hover .card-image img { transform: scale(1.05); }
.card-category { position: absolute; top: 12px; left: 12px; padding: 4px 12px; background: rgba(0,0,0,0.5); color: #fff; border-radius: 20px; font-size: 12px; backdrop-filter: blur(4px); }
.card-body { padding: 16px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }
.card-title a:hover { color: hsl(197, 71%, 53%); }
.card-excerpt { font-size: 14px; color: #666; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.6; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.card-tag { padding: 2px 8px; background: #f0f7fa; border-radius: 4px; font-size: 12px; color: #4a7c8f; }
.card-meta { display: flex; align-items: center; gap: 16px; font-size: 12px; color: #999; }
.card-meta span { display: flex; align-items: center; gap: 4px; }

/* ===== Article Detail ===== */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #666; margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb a { color: hsl(197, 71%, 53%); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: #999; }
.article-detail { background: #fff; border-radius: 12px; padding: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid #e8ecf0; }
.article-detail h1 { font-size: 28px; font-weight: 700; line-height: 1.4; margin-bottom: 12px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.article-tag { padding: 4px 12px; background: #f0f7fa; border: 1px solid #d5e8f0; border-radius: 20px; font-size: 13px; color: #4a7c8f; }
.article-tag:hover { background: hsl(197, 71%, 73%); color: #fff; }
.article-meta { display: flex; align-items: center; gap: 16px; font-size: 14px; color: #666; margin-bottom: 20px; flex-wrap: wrap; }
.article-meta .meta-category { padding: 4px 12px; background: #f0f7fa; border-radius: 20px; font-size: 13px; color: #4a7c8f; }
.article-cover { width: 100%; border-radius: 12px; margin-bottom: 24px; }
.article-content { font-size: 16px; line-height: 1.8; color: #333; }
.article-content h2 { font-size: 22px; font-weight: 700; margin: 32px 0 16px; padding-bottom: 8px; border-bottom: 2px solid #e8ecf0; }
.article-content h3 { font-size: 18px; font-weight: 600; margin: 24px 0 12px; }
.article-content p { margin-bottom: 16px; }
.article-content img { border-radius: 8px; margin: 16px 0; }
.article-content ul, .article-content ol { margin: 16px 0; padding-left: 24px; }
.article-content li { margin-bottom: 8px; }
.article-content blockquote { border-left: 4px solid hsl(197, 71%, 73%); padding: 12px 20px; background: #f0f7fa; margin: 16px 0; border-radius: 0 8px 8px 0; }

/* Article Actions */
.article-actions { display: flex; gap: 12px; margin: 32px 0; padding-top: 24px; border-top: 1px solid #e8ecf0; }
.action-btn { display: flex; align-items: center; gap: 8px; padding: 10px 24px; border-radius: 8px; border: 1px solid #e0e0e0; background: #fff; cursor: pointer; font-size: 14px; color: #666; transition: all 0.2s; }
.action-btn:hover { border-color: hsl(197, 71%, 73%); color: hsl(197, 71%, 53%); }
.action-btn.active { background: hsl(197, 71%, 73%); color: #fff; border-color: hsl(197, 71%, 73%); }

/* Prev/Next Nav */
.prev-next { display: flex; justify-content: space-between; gap: 20px; margin: 24px 0; }
.prev-next a { flex: 1; padding: 16px; background: #fff; border-radius: 12px; border: 1px solid #e8ecf0; transition: all 0.2s; }
.prev-next a:hover { border-color: hsl(197, 71%, 73%); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.prev-next .label { font-size: 12px; color: #999; margin-bottom: 4px; }
.prev-next .title { font-size: 14px; color: #333; font-weight: 500; }
.prev-next .next-link { text-align: right; }

/* Related Articles */
.related-section { margin-top: 32px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ===== Pagination ===== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 32px 0; flex-wrap: wrap; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid #e0e0e0; background: #fff; font-size: 14px; color: #333; transition: all 0.2s; }
.page-link:hover { border-color: hsl(197, 71%, 73%); color: hsl(197, 71%, 53%); }
.page-link.active { background: hsl(197, 71%, 73%); color: #fff; border-color: hsl(197, 71%, 73%); }
.page-info { font-size: 14px; color: #999; margin-left: 12px; }

/* ===== Footer ===== */
.site-footer { background: hsl(197, 65%, 42%); color: #fff; padding: 40px 0 20px; margin-top: 60px; }
.footer-grid { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; }
.footer-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.footer-logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.footer-desc { font-size: 14px; color: rgba(255,255,255,0.85); line-height: 1.6; }
.footer-links a { display: block; padding: 4px 0; font-size: 14px; color: rgba(255,255,255,0.85); transition: color 0.2s; }
.footer-links a:hover { color: #fff; }
.footer-bottom { max-width: 1200px; margin: 20px auto 0; padding: 16px 20px 0; border-top: 1px solid rgba(255,255,255,0.25); text-align: center; font-size: 13px; color: rgba(255,255,255,0.7); }

/* ===== Login/Register ===== */
.auth-container { max-width: 400px; margin: 60px auto; padding: 0 20px; }
.auth-card { background: #fff; border-radius: 16px; padding: 40px 32px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); border: 1px solid #e8ecf0; }
.auth-card h1 { text-align: center; font-size: 24px; margin-bottom: 24px; }
.auth-tabs { display: flex; margin-bottom: 24px; border-bottom: 2px solid #e8ecf0; }
.auth-tab { flex: 1; padding: 12px; text-align: center; font-size: 16px; font-weight: 500; color: #999; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.auth-tab.active { color: hsl(197, 71%, 53%); border-bottom-color: hsl(197, 71%, 53%); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #333; }
.form-group input { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; outline: none; transition: border-color 0.2s; }
.form-group input:focus { border-color: hsl(197, 71%, 73%); }
.btn-primary { width: 100%; padding: 12px; background: hsl(197, 71%, 73%); color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-primary:hover { background: hsl(197, 71%, 63%); }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; }

/* ===== Search Page ===== */
.search-header { margin-bottom: 24px; }
.search-form-inline { display: flex; gap: 12px; margin-top: 16px; }
.search-form-inline input { flex: 1; padding: 12px 16px; border: 1px solid #ddd; border-radius: 8px; font-size: 15px; outline: none; }
.search-form-inline input:focus { border-color: hsl(197, 71%, 73%); }
.search-form-inline button { padding: 12px 24px; background: hsl(197, 71%, 73%); color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; }

/* ===== Category Header ===== */
.category-header { margin-bottom: 24px; }
.category-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.category-header p { font-size: 14px; color: #666; }
.empty-state { text-align: center; padding: 60px 20px; color: #999; font-size: 16px; }

/* ===== 404 ===== */
.page-404 { text-align: center; padding: 100px 20px; }
.page-404 h1 { font-size: 80px; font-weight: 700; color: hsl(197, 71%, 73%); }
.page-404 p { font-size: 18px; color: #666; margin: 16px 0 32px; }
.btn-home { display: inline-block; padding: 12px 32px; background: hsl(197, 71%, 73%); color: #fff; border-radius: 8px; font-weight: 600; }

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .content-layout { grid-template-columns: 1fr 260px; }
    .left-sidebar { display: none; }
    .article-grid { grid-template-columns: repeat(2, 1fr); }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hamburger { display: block; }
    .search-box input { width: 140px; }
    .search-box input:focus { width: 160px; }
    .content-layout { grid-template-columns: 1fr; }
    .right-sidebar { order: 10; }
    .article-grid { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr; }
    .carousel { height: 280px; margin: 12px; border-radius: 12px; }
    .carousel-overlay h2 { font-size: 20px; }
    .header-inner { padding: 0 12px; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .prev-next { flex-direction: column; }
    .article-detail { padding: 20px; }
    .article-detail h1 { font-size: 22px; }
    .auth-container { margin: 30px auto; }
}

/* ===== Mobile Nav Overlay ===== */
.mobile-nav { display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0; background: #fff; z-index: 99; padding: 20px; overflow-y: auto; }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 14px 16px; font-size: 16px; color: #333; border-bottom: 1px solid #f0f0f0; }
.mobile-nav a:hover { background: #f0f7fa; color: hsl(197, 71%, 53%); }

/* Dropdown menu fix */
.user-dropdown a:first-child { border-radius: 12px 12px 0 0; box-shadow: 0 -2px 10px rgba(0,0,0,0.08); }
.user-dropdown a:last-child { border-radius: 0 0 12px 12px; border-bottom: none; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }