/* ==========================================
   V2 新闻网站公共样式
   使用 CSS 自定义属性实现多站点主题化
   ========================================== */

/* --- CSS Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans KR", "Noto Sans SC", Arial, sans-serif;
    line-height: 1.6; color: #333; background: #f8f9fa;
}
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--secondary); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { line-height: 1.3; color: #1a1a2e; }

/* --- Layout --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.row { display: flex; flex-wrap: wrap; gap: 24px; }

/* --- Top Bar --- */
.top-bar {
    background: #1a1a2e; color: rgba(255,255,255,0.8); font-size: 13px;
    padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-bar .social-icons { display: flex; gap: 12px; }
.top-bar .social-icons a { color: rgba(255,255,255,0.7); font-size: 14px; transition: color 0.2s; }
.top-bar .social-icons a:hover { color: #fff; }
.top-bar .date-text { font-size: 12px; }

/* --- Header --- */
.site-header {
    background: #fff; padding: 16px 0;
    border-bottom: 3px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.site-header .container { display: flex; justify-content: space-between; align-items: center; }
.site-logo { display: flex; align-items: center; gap: 12px; }
.site-logo img { height: 48px; width: auto; }
.site-logo .logo-text { font-size: 24px; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
.site-logo .logo-tagline { font-size: 12px; color: #888; margin-top: 2px; }
.header-search { position: relative; }
.header-search input {
    border: 1px solid #ddd; border-radius: 20px; padding: 8px 36px 8px 16px;
    font-size: 14px; width: 220px; transition: border-color 0.2s;
}
.header-search input:focus { outline: none; border-color: var(--primary); }
.header-search button {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: #999; cursor: pointer;
}

/* --- Navigation --- */
.main-nav {
    background: var(--nav-bg); position: sticky; top: 0; z-index: 50;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.main-nav .container { display: flex; justify-content: space-between; align-items: center; }
.nav-menu { display: flex; gap: 0; }
.nav-menu a {
    color: rgba(255,255,255,0.9); padding: 14px 18px; font-size: 14px;
    font-weight: 500; transition: all 0.2s; display: block; letter-spacing: 0.3px;
}
.nav-menu a:hover, .nav-menu a.active {
    background: rgba(255,255,255,0.15); color: #fff;
}
.hamburger {
    display: none; background: none; border: none; color: #fff;
    font-size: 22px; cursor: pointer; padding: 10px;
}

/* --- Mobile Nav --- */
.mobile-nav {
    display: none; background: var(--nav-bg); flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 49;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
    color: rgba(255,255,255,0.9); padding: 14px 24px; font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1); transition: background 0.2s;
}
.mobile-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* --- Hero Section (Homepage) --- */
.hero-section { margin: 28px 0; }
.hero-card {
    position: relative; border-radius: 12px; overflow: hidden;
    background: #1a1a2e; min-height: 360px; display: flex; align-items: flex-end;
}
.hero-card img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 0.6; transition: opacity 0.3s;
}
.hero-card:hover img { opacity: 0.5; }
.hero-card .hero-content {
    position: relative; z-index: 1; padding: 40px; color: #fff; width: 100%;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
}
.hero-card .hero-category {
    display: inline-block; background: var(--secondary); color: #fff;
    padding: 4px 12px; border-radius: 4px; font-size: 12px; font-weight: 600;
    text-transform: uppercase; margin-bottom: 12px; letter-spacing: 0.5px;
}
.hero-card h2 { font-size: 28px; font-weight: 700; margin-bottom: 8px; color: #fff; }
.hero-card .hero-summary { font-size: 15px; opacity: 0.9; line-height: 1.5; }
.hero-card .hero-date { font-size: 13px; opacity: 0.7; margin-top: 12px; }

/* --- Category Section (Homepage) --- */
.category-section { margin-bottom: 40px; }
.section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 12px;
    border-bottom: 3px solid var(--primary);
}
.section-header h2 { font-size: 20px; font-weight: 700; color: var(--primary); }
.section-header a { font-size: 13px; color: var(--primary); font-weight: 500; }
.section-header a:hover { color: var(--secondary); }

.articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* --- Article Card --- */
.article-card {
    background: #fff; border-radius: 10px; overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06); transition: all 0.25s;
    display: flex; flex-direction: column;
}
.article-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); transform: translateY(-2px); }
.article-card .card-image {
    height: 180px; overflow: hidden; position: relative;
}
.article-card .card-image img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.3s;
}
.article-card:hover .card-image img { transform: scale(1.05); }
.article-card .card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.article-card .card-category {
    font-size: 11px; font-weight: 600; color: var(--secondary);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.article-card h3 {
    font-size: 16px; font-weight: 600; line-height: 1.4; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card h3 a { color: #1a1a2e; }
.article-card h3 a:hover { color: var(--primary); }
.article-card .card-summary {
    font-size: 13px; color: #666; line-height: 1.5; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card .card-meta {
    font-size: 12px; color: #999; margin-top: 12px;
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 10px; border-top: 1px solid #f0f0f0;
}

/* --- List Card (Category Page) --- */
.article-list-card {
    background: #fff; border-radius: 10px; overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06); transition: all 0.25s;
    display: flex; margin-bottom: 16px;
}
.article-list-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.article-list-card .list-image {
    width: 280px; min-width: 280px; height: 190px; overflow: hidden;
}
.article-list-card .list-image img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.3s;
}
.article-list-card:hover .list-image img { transform: scale(1.05); }
.article-list-card .list-body {
    padding: 20px; flex: 1; display: flex; flex-direction: column; justify-content: center;
}
.article-list-card .list-category {
    font-size: 11px; font-weight: 600; color: var(--secondary);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.article-list-card h3 {
    font-size: 18px; font-weight: 600; line-height: 1.4; margin-bottom: 8px;
}
.article-list-card h3 a { color: #1a1a2e; }
.article-list-card h3 a:hover { color: var(--primary); }
.article-list-card .list-summary {
    font-size: 14px; color: #666; line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-list-card .list-meta {
    font-size: 12px; color: #999; margin-top: 12px;
    display: flex; gap: 16px; align-items: center;
}

/* --- Load More Button --- */
.load-more-wrap { text-align: center; margin: 32px 0; }
.btn-load-more {
    background: var(--primary); color: #fff; border: none; border-radius: 8px;
    padding: 12px 40px; font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all 0.2s;
}
.btn-load-more:hover { background: var(--nav-bg); transform: translateY(-1px); }
.btn-load-more:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Article Detail --- */
.article-detail { max-width: 800px; margin: 32px auto; }
.article-detail .breadcrumb {
    font-size: 13px; color: #888; margin-bottom: 20px;
    display: flex; gap: 8px; align-items: center;
}
.article-detail .breadcrumb a { color: var(--primary); }
.article-detail .article-category-tag {
    display: inline-block; background: var(--secondary); color: #fff;
    padding: 4px 14px; border-radius: 4px; font-size: 12px; font-weight: 600;
    text-transform: uppercase; margin-bottom: 16px;
}
.article-detail h1 { font-size: 32px; font-weight: 800; line-height: 1.3; margin-bottom: 16px; }
.article-detail .article-meta {
    display: flex; gap: 20px; align-items: center; color: #888; font-size: 14px;
    margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #eee;
}
.article-detail .article-meta .author { font-weight: 600; color: #555; }
.article-detail .featured-image {
    margin-bottom: 24px; border-radius: 10px; overflow: hidden;
}
.article-detail .featured-image img { width: 100%; }
.article-detail .article-content {
    font-size: 17px; line-height: 1.8; color: #333;
}
.article-detail .article-content p { margin-bottom: 20px; }
.article-detail .article-content h2 { font-size: 24px; margin: 32px 0 16px; }
.article-detail .article-content h3 { font-size: 20px; margin: 24px 0 12px; }
.article-detail .article-content img {
    margin: 24px 0; border-radius: 8px;
}
.article-detail .article-content blockquote {
    border-left: 4px solid var(--primary); padding: 16px 20px;
    background: #f8f9fa; margin: 24px 0; font-style: italic; color: #555;
}
.article-detail .article-tags {
    margin-top: 32px; padding-top: 20px; border-top: 1px solid #eee;
    display: flex; gap: 8px; flex-wrap: wrap;
}
.article-detail .article-tags span {
    background: #f0f0f0; color: #666; padding: 4px 12px;
    border-radius: 20px; font-size: 13px;
}

/* --- Related Articles --- */
.related-section { margin: 40px 0; padding: 32px 0; border-top: 2px solid #eee; }
.related-section h3 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }

/* --- Footer --- */
.site-footer {
    background: #1a1a2e; color: rgba(255,255,255,0.8);
    padding: 48px 0 0; margin-top: 60px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-title {
    color: #fff; font-size: 16px; font-weight: 700; margin-bottom: 20px;
    padding-bottom: 10px; border-bottom: 2px solid var(--secondary);
}
.footer-about p { font-size: 14px; line-height: 1.7; }
.footer-links a {
    display: block; color: rgba(255,255,255,0.7); font-size: 14px;
    padding: 4px 0; transition: color 0.2s;
}
.footer-links a:hover { color: #fff; }
.footer-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-tags a {
    background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8);
    padding: 4px 12px; border-radius: 4px; font-size: 13px;
    transition: background 0.2s;
}
.footer-tags a:hover { background: var(--secondary); color: #fff; }
.footer-bottom {
    margin-top: 40px; padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center; font-size: 13px; color: rgba(255,255,255,0.5);
}

/* --- Page Header (Category) --- */
.page-header {
    background: var(--primary); color: #fff; padding: 32px 0; margin-bottom: 32px;
}
.page-header h1 { font-size: 28px; font-weight: 700; color: #fff; }
.page-header .breadcrumb { margin-top: 8px; font-size: 14px; opacity: 0.8; }
.page-header .breadcrumb a { color: rgba(255,255,255,0.8); }

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 1024px) {
    .articles-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-menu { display: none; }
    .hamburger { display: block; }
    .articles-grid { grid-template-columns: 1fr; }
    .article-list-card { flex-direction: column; }
    .article-list-card .list-image { width: 100%; height: 200px; min-width: auto; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero-card { min-height: 280px; }
    .hero-card h2 { font-size: 22px; }
    .hero-card .hero-content { padding: 24px; }
    .article-detail h1 { font-size: 24px; }
    .article-detail .article-content { font-size: 16px; }
    .site-logo .logo-text { font-size: 20px; }
    .header-search input { width: 160px; }
    .site-header .container { flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero-card { min-height: 220px; }
    .hero-card h2 { font-size: 18px; }
    .article-detail { margin: 16px auto; }
    .article-detail h1 { font-size: 22px; }
    .header-search { display: none; }
}
