/* ============================================================
   VIEW-DETAIL.CSS - CMS通用详情页模板
   通栏正文 + 底部关联区块
   ============================================================ */

:root {
    --primary: #e63946;
    --primary-dark: #c1121f;
    --secondary: #1d3557;
    --accent: #f4a261;
    --white: #ffffff;
    --light: #f8f9fa;
    --light-blue: #e0f2fe;
    --dark: #0f172a;
    --border: #e5e7eb;
    --text: #1a1a2e;
    --text-muted: #6c757d;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
    --transition: 0.3s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', sans-serif; line-height: 1.6; color: var(--text); background: var(--white); }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
.container { width: 100%; max-width: 800px; margin: 0 auto; padding: 0 16px; }
.container-wide { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ==================== HEADER ==================== */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: var(--white); box-shadow: var(--shadow); }
.header-container { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; max-width: 1200px; margin: 0 auto; }
.logo img { height: 36px; }
.nav-toggle { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 44px; height: 44px; background: var(--primary); border: none; border-radius: var(--radius); cursor: pointer; z-index: 101; }
.hamburger { width: 20px; height: 2px; background: var(--white); position: relative; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; width: 20px; height: 2px; background: var(--white); }
.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }
.nav-toggle.active .hamburger { background: transparent; }
.nav-toggle.active .hamburger::before { transform: rotate(45deg); top: 0; }
.nav-toggle.active .hamburger::after { transform: rotate(-45deg); top: 0; }
.nav-menu { position: fixed; top: 0; right: -280px; width: 280px; height: 100vh; background: var(--white); box-shadow: var(--shadow-hover); padding: 70px 16px 24px; transition: right var(--transition); }
.nav-menu.active { right: 0; }
.nav-list { display: flex; flex-direction: column; gap: 4px; }
.nav-link { display: block; padding: 12px 16px; font-size: 15px; font-weight: 500; border-radius: var(--radius); }
.nav-link:hover, .nav-link.active { background: var(--light-blue); color: var(--primary); }
.nav-link.nav-cta { background: var(--primary); color: var(--white); text-align: center; margin-top: 8px; }

/* ==================== BREADCRUMB ==================== */
.breadcrumb-section { padding: 70px 0 16px; background: var(--light); }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--border); }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ==================== ARTICLE HEADER ==================== */
.article-header { padding: 32px 0; background: var(--light); }
.article-title { font-size: 26px; font-weight: 700; color: var(--secondary); line-height: 1.3; margin-bottom: 16px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 16px; }
.article-meta .meta-item { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.article-meta i { color: var(--accent); font-size: 12px; }

/* ==================== ARTICLE COVER ==================== */
.article-cover { background: var(--light); padding-bottom: 32px; }
.article-cover img { width: 100%; max-height: 400px; object-fit: cover; border-radius: var(--radius-lg); }

/* ==================== ARTICLE BODY (通栏正文) ==================== */
.article-body { padding: 40px 0; background: var(--white); }
.content-area { font-size: 16px; line-height: 1.9; color: var(--text); }
.content-area h2 { font-size: 22px; font-weight: 700; color: var(--secondary); margin: 40px 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--light-blue); }
.content-area h3 { font-size: 18px; font-weight: 600; color: var(--secondary); margin: 32px 0 12px; }
.content-area h4 { font-size: 16px; font-weight: 600; color: var(--secondary); margin: 24px 0 10px; }
.content-area p { margin-bottom: 16px; }
.content-area a { color: var(--primary); border-bottom: 1px solid transparent; }
.content-area a:hover { border-bottom-color: var(--primary); }

/* 引用块 */
.content-area blockquote { margin: 24px 0; padding: 20px 24px; background: var(--light-blue); border-left: 4px solid var(--primary); border-radius: 0 var(--radius) var(--radius) 0; }
.content-area blockquote p { margin: 0; font-style: italic; color: var(--secondary); }

/* 列表 */
.content-area ul, .content-area ol { margin: 16px 0 16px 24px; }
.content-area ul { list-style: disc; }
.content-area ol { list-style: decimal; }
.content-area li { margin-bottom: 8px; padding-left: 4px; }

/* 图片 */
.content-figure { margin: 32px 0; }
.content-figure img { width: 100%; border-radius: var(--radius-lg); }
.content-figure figcaption { margin-top: 10px; font-size: 13px; color: var(--text-muted); text-align: center; font-style: italic; }

/* 表格 */
.content-area table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14px; }
.content-area th, .content-area td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.content-area th { background: var(--light); font-weight: 600; color: var(--secondary); }

/* ==================== ARTICLE FOOTER ==================== */
.article-footer { padding: 32px 0; background: var(--white); border-top: 1px solid var(--border); }

/* 标签 */
.article-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 24px; }
.tags-label { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.tag { padding: 4px 12px; font-size: 12px; color: var(--primary); background: rgba(230,57,70,0.1); border-radius: 16px; transition: var(--transition); }
.tag:hover { background: var(--primary); color: var(--white); }

/* 分享 */
.share-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.share-bar > span { font-size: 13px; color: var(--text-muted); }
.share-btns { display: flex; gap: 8px; }
.share-btn { width: 36px; height: 36px; background: var(--light); border-radius: 50%; display: flex; justify-content: center; align-items: center; color: var(--text-muted); transition: var(--transition); }
.share-btn:hover { background: var(--primary); color: var(--white); }

/* 上下篇导航 */
.article-nav { display: grid; grid-template-columns: 1fr; gap: 12px; }
.nav-prev, .nav-next { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--light); border-radius: var(--radius); transition: var(--transition); }
.nav-prev:hover, .nav-next:hover { background: var(--light-blue); }
.nav-label { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.nav-title { font-size: 14px; font-weight: 600; color: var(--secondary); line-height: 1.4; }
.nav-next { text-align: right; }
.nav-next .nav-label { justify-content: flex-end; }

/* ==================== RELATED SECTION ==================== */
.related-section { padding: 48px 0; background: var(--light); }
.related-block { margin-bottom: 40px; }
.related-block:last-child { margin-bottom: 0; }
.block-title { font-size: 20px; font-weight: 700; color: var(--secondary); margin-bottom: 20px; padding-left: 12px; border-left: 4px solid var(--primary); }

/* 网格布局 */
.related-grid { display: grid; gap: 16px; }
.related-grid.cols-2 { grid-template-columns: 1fr; }
.related-grid.cols-3 { grid-template-columns: 1fr; }
.related-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }

/* 通用卡片 */
.related-card, .product-card-mini, .project-card-mini { background: var(--white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); transition: var(--transition); }
.related-card:hover, .product-card-mini:hover, .project-card-mini:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-thumb { position: relative; aspect-ratio: 16/10; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.related-card:hover .card-thumb img, .product-card-mini:hover .card-thumb img, .project-card-mini:hover .card-thumb img { transform: scale(1.05); }
.card-info { padding: 14px; }
.card-info h4 { font-size: 14px; font-weight: 600; color: var(--secondary); line-height: 1.4; margin-bottom: 4px; }
.card-info span, .card-date { font-size: 12px; color: var(--text-muted); }

/* 产品卡片 */
.product-card-mini .card-thumb { aspect-ratio: 4/3; }

/* 项目卡片 */
.card-overlay { position: absolute; bottom: 8px; left: 8px; padding: 4px 10px; font-size: 11px; font-weight: 600; color: var(--white); background: rgba(0,0,0,0.6); border-radius: 12px; }

/* ==================== CTA ==================== */
.cta-section { padding: 48px 0; background: var(--white); }
.cta-box { text-align: center; padding: 40px 24px; background: linear-gradient(135deg, var(--light-blue) 0%, #bae6fd 100%); border-radius: var(--radius-lg); }
.cta-box h2 { font-size: 22px; color: var(--secondary); margin-bottom: 8px; }
.cta-box p { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.cta-btn { display: inline-block; padding: 14px 32px; font-size: 15px; font-weight: 600; color: var(--white); background: var(--primary); border-radius: 24px; transition: var(--transition); }
.cta-btn:hover { background: var(--primary-dark); }

/* ==================== FOOTER ==================== */
.footer { background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 50%, #90caf9 100%); color: var(--text-dark); padding: 48px 0 24px; }
.footer-grid { display: grid; gap: 32px; margin-bottom: 32px; }
.footer-col h4 { font-size: 15px; margin-bottom: 16px; color: var(--primary); font-weight: 700; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--text-dark); font-weight: 700; font-size: 14px; }
.footer-col a:hover { color: var(--primary); }
.contact-list li { display: flex; align-items: center; gap: 8px; color: var(--text-dark); font-weight: 700; font-size: 13px; }
.contact-list i { color: var(--primary); width: 16px; }
.footer-bottom { text-align: center; padding-top: 24px; border-top: 1px solid rgba(0,0,0,0.08); }
.footer-bottom p { font-size: 13px; color: var(--text-dark); font-weight: 700; }

.back-to-top { position: fixed; bottom: 20px; right: 20px; width: 44px; height: 44px; background: var(--primary); color: var(--white); border: none; border-radius: 50%; cursor: pointer; opacity: 0; visibility: hidden; transition: var(--transition); z-index: 99; }
.back-to-top.visible { opacity: 1; visibility: visible; }

/* ==================== TABLET (768px) ==================== */
@media (min-width: 768px) {
    .header-container { padding: 8px 24px; }
    .logo img { height: 32px; }
    .nav-toggle { display: none; }
    .nav-menu { position: static; width: auto; height: auto; background: none; box-shadow: none; padding: 0; }
    .nav-list { flex-direction: row; gap: 0; }
    .nav-link { padding: 6px 8px; font-size: 13px; }
    .nav-link:hover, .nav-link.active { background: none; }
    .nav-link.nav-cta { padding: 6px 12px; margin-top: 0; margin-left: 4px; background: var(--primary); color: var(--white); }
    .nav-link.nav-cta:hover, .nav-link.nav-cta.active { background: var(--primary-dark); color: var(--white); }
    
    .breadcrumb-section { padding: 80px 0 20px; }
    
    .article-title { font-size: 32px; }
    .article-cover img { max-height: 480px; }
    
    .content-area { font-size: 17px; }
    .content-area h2 { font-size: 26px; }
    .content-area h3 { font-size: 20px; }
    
    .article-nav { grid-template-columns: 1fr 1fr; }
    
    .related-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
    .related-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
    .related-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
    
    .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ==================== DESKTOP (1024px) ==================== */
@media (min-width: 1024px) {
    .header-container { padding: 10px 32px; gap: 32px; justify-content: flex-start; }
    .logo img { height: 42px; }
    .nav-link { padding: 8px 14px; font-size: 15px; }
    .nav-link.nav-cta { padding: 8px 20px; font-size: 15px; }
    
    .breadcrumb-section { padding: 90px 0 24px; }
    
    .article-header { padding: 48px 0; }
    .article-title { font-size: 38px; }
    .article-cover img { max-height: 560px; }
    
    .article-body { padding: 56px 0; }
    .content-area { font-size: 18px; line-height: 2; }
    .content-area h2 { font-size: 28px; margin: 48px 0 20px; }
    .content-area h3 { font-size: 22px; margin: 40px 0 16px; }
    .content-area blockquote { padding: 24px 32px; }
    
    .article-footer { padding: 40px 0; }
    .nav-title { font-size: 15px; }
    
    .related-section { padding: 64px 0; }
    .block-title { font-size: 24px; margin-bottom: 24px; }
    .card-info h4 { font-size: 15px; }
    
    .cta-section { padding: 64px 0; }
}
