/* Common Frontend Styles */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; transition: color 0.2s, opacity 0.2s; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 1000; }
.header-inner { display: flex; align-items: center; gap: 24px; padding: 12px 0; }
.logo img { height: 40px; }
.logo-text { font-size: 22px; font-weight: 700; }
.main-nav { display: flex; gap: 20px; flex: 1; }
.main-nav a { font-size: 14px; font-weight: 500; white-space: nowrap; }
.search-box { display: flex; align-items: center; }
.search-box input { padding: 8px 14px; border-radius: 20px; border: 1px solid; font-size: 13px; width: 180px; outline: none; }
.search-box button { background: none; border: none; cursor: pointer; font-size: 16px; margin-left: -36px; padding: 4px 8px; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 24px; cursor: pointer; }

/* Main */
.site-main { flex: 1; }

/* Hero */
.hero-section { position: relative; padding: 80px 0 60px; overflow: hidden; text-align: center; }
.hero-title { font-size: 42px; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.gradient-text { background: linear-gradient(90deg, #00d2ff, #7b2ff7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-desc { font-size: 18px; opacity: 0.8; max-width: 600px; margin: 0 auto 32px; }
.hero-stats { display: flex; justify-content: center; gap: 48px; }
.stat-num { display: block; font-size: 32px; font-weight: 700; }
.stat-label { font-size: 13px; opacity: 0.6; }
.hero-particles { position: absolute; inset: 0; pointer-events: none; }

/* Sections */
.section { padding: 48px 0; }
.section-title { font-size: 24px; font-weight: 700; margin-bottom: 24px; display: flex; align-items: center; gap: 8px; }
.page-header { padding: 40px 0 20px; }
.page-title { font-size: 32px; font-weight: 700; margin-bottom: 8px; }
.page-desc { opacity: 0.7; }

/* Layout */
.content-layout { display: grid; grid-template-columns: 1fr 300px; gap: 32px; }
.main-column { min-width: 0; }

/* Article Grid */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.article-card { border-radius: 12px; overflow: hidden; transition: transform 0.3s, box-shadow 0.3s; }
.article-card:hover { transform: translateY(-4px); }
.card-cover { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.article-card:hover .card-cover img { transform: scale(1.05); }
.badge-top { position: absolute; top: 10px; left: 10px; background: #ff6b35; color: #fff; padding: 2px 10px; border-radius: 4px; font-size: 12px; }
.card-body { padding: 16px; }
.card-category { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.card-title { font-size: 17px; font-weight: 600; margin: 8px 0; line-height: 1.4; }
.card-excerpt { font-size: 13px; opacity: 0.7; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; gap: 12px; font-size: 12px; opacity: 0.5; flex-wrap: wrap; }

/* Top articles */
.top-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.top-card { border-radius: 12px; overflow: hidden; position: relative; }
.top-card a { display: block; height: 100%; }
.top-card img { width: 100%; height: 100%; object-fit: cover; min-height: 200px; }
.top-card.featured { grid-row: span 2; }
.top-card.featured img { min-height: 420px; }
.top-card-body { position: absolute; bottom: 0; left: 0; right: 0; padding: 20px; background: linear-gradient(transparent, rgba(0,0,0,0.8)); color: #fff; }
.top-card-body h3 { font-size: 18px; margin-bottom: 4px; }
.top-card.featured .top-card-body h3 { font-size: 24px; }
.top-card-body p { font-size: 13px; opacity: 0.8; }

/* Article Detail */
.article-detail { padding: 32px 0; }
.breadcrumb { margin-bottom: 20px; font-size: 13px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.breadcrumb .sep { opacity: 0.4; }
.article-header { margin-bottom: 24px; }
.article-category { font-size: 13px; font-weight: 600; text-transform: uppercase; }
.article-title { font-size: 36px; font-weight: 800; line-height: 1.3; margin: 12px 0; }
.article-meta { display: flex; gap: 16px; font-size: 14px; opacity: 0.6; flex-wrap: wrap; }
.article-cover { margin-bottom: 32px; border-radius: 12px; overflow: hidden; }
.article-cover img { width: 100%; max-height: 480px; object-fit: cover; }
.article-content { font-size: 16px; line-height: 1.8; }
.article-content h2 { font-size: 24px; margin: 32px 0 16px; }
.article-content h3 { font-size: 20px; margin: 24px 0 12px; }
.article-content p { margin-bottom: 16px; }
.article-content img { border-radius: 8px; margin: 16px 0; }
.article-content blockquote { border-left: 4px solid; padding: 12px 20px; margin: 16px 0; opacity: 0.8; }
.article-content pre { padding: 16px; border-radius: 8px; overflow-x: auto; font-size: 14px; margin: 16px 0; }
.article-content code { font-size: 14px; }
.article-tags { margin-top: 32px; padding-top: 20px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.tag-item { padding: 4px 12px; border-radius: 16px; font-size: 13px; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.widget { border-radius: 12px; padding: 20px; }
.widget-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid; }
.category-list li a { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; border-bottom: 1px solid; }
.category-list .count { opacity: 0.5; font-size: 12px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.related-list li a { display: block; padding: 8px 0; font-size: 14px; border-bottom: 1px solid; }

/* Ads */
.ad-block { margin: 12px 0; text-align: center; }
.ad-block img { max-width: 100%; border-radius: 8px; }

/* Footer */
.site-footer { padding: 48px 0 24px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-col h4 { font-size: 16px; margin-bottom: 16px; }
.footer-col p, .footer-col li a { font-size: 14px; opacity: 0.7; line-height: 2; }
.footer-bottom { text-align: center; padding-top: 24px; border-top: 1px solid; font-size: 13px; opacity: 0.5; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; }
.pagination a { padding: 8px 14px; border-radius: 6px; font-size: 14px; border: 1px solid; }

/* Contact */
.contact-info { display: flex; flex-direction: column; gap: 24px; margin-top: 32px; }
.contact-item { display: flex; gap: 16px; align-items: flex-start; }
.contact-icon { font-size: 28px; }
.contact-item h3 { font-size: 14px; opacity: 0.6; margin-bottom: 4px; }

/* 404 */
.error-code { font-size: 120px; font-weight: 900; line-height: 1; opacity: 0.2; }
.error-page h1 { font-size: 28px; margin: 16px 0; }
.btn-home { display: inline-block; margin-top: 24px; padding: 12px 32px; border-radius: 8px; font-weight: 600; }

.empty-msg { text-align: center; padding: 48px; opacity: 0.6; grid-column: 1 / -1; }

/* Responsive */
@media (max-width: 768px) {
    .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; padding: 16px; }
    .main-nav.open { display: flex; }
    .mobile-menu-btn { display: block; }
    .search-box { display: none; }
    .hero-title { font-size: 28px; }
    .hero-stats { gap: 24px; }
    .content-layout { grid-template-columns: 1fr; }
    .top-grid { grid-template-columns: 1fr; }
    .top-card.featured { grid-row: auto; }
    .article-title { font-size: 26px; }
    .footer-grid { grid-template-columns: 1fr; }
    .article-grid { grid-template-columns: 1fr; }
}
