/* ============================================================
   PROJECTS3.CSS - CMS-Friendly Version
   简洁模块化 · 易于嵌套 · 语义化类名
   ============================================================ */

/* ==================== 变量定义 ==================== */
:root {
    --primary: #e63946;
    --primary-dark: #c1121f;
    --secondary: #1d3557;
    --accent: #f4a261;
    --white: #ffffff;
    --light: #f8f9fa;
    --light-blue: #e0f2fe;
    --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 { list-style: none; }
.container { 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);
    transition: var(--transition);
}
.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;
}

/* ==================== PAGE HEADER ==================== */
.page-header {
    padding: 80px 0 32px;
    background: linear-gradient(135deg, var(--light-blue) 0%, #bae6fd 100%);
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .separator { color: var(--border); }
.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 8px;
}
.page-desc {
    font-size: 15px;
    color: var(--text-muted);
}

/* ==================== FILTER BAR ==================== */
.filter-bar {
    position: sticky;
    top: 64px;
    z-index: 50;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}
.filter-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}
.filter-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--light);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}
.filter-btn:hover { color: var(--text); background: var(--border); }
.filter-btn.active {
    color: var(--white);
    background: var(--primary);
}

/* ==================== PROJECT GRID ==================== */
.project-list {
    padding: 32px 0 48px;
    background: var(--light);
}
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* ==================== PROJECT CARD ==================== */
.project-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.card-link {
    display: block;
}
.card-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.project-card:hover .card-image img {
    transform: scale(1.05);
}
.card-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--white);
    background: var(--primary);
    border-radius: 20px;
}
.card-body {
    padding: 16px;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}
.card-excerpt {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}
.meta-item i {
    margin-right: 4px;
    color: var(--accent);
}

/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}
.page-link {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--white);
    border-radius: var(--radius);
    transition: var(--transition);
}
.page-link:hover {
    color: var(--primary);
    background: var(--light-blue);
}
.page-link.active {
    color: var(--white);
    background: var(--primary);
}
.page-dots {
    color: var(--text-muted);
    padding: 0 4px;
}
.page-next {
    padding: 0 8px;
}

/* ==================== CTA SECTION ==================== */
.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: 12px 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);
    transform: translateY(-2px);
}

/* ==================== FOOTER ==================== */
.footer {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: var(--white);
    padding: 48px 0 24px;
}
.footer-grid {
    display: grid;
    gap: 32px;
    margin-bottom: 32px;
}
.footer-col h4 {
    font-size: 15px;
    margin-bottom: 16px;
    color: var(--accent);
}
.footer-col li {
    margin-bottom: 10px;
}
.footer-col a {
    color: rgba(255,255,255,0.75);
    font-size: 14px;
    transition: var(--transition);
}
.footer-col a:hover {
    color: var(--white);
}
.contact-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.75);
    font-size: 13px;
}
.contact-list i {
    color: var(--accent);
    width: 16px;
}
.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.footer-bottom p {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

/* ==================== BACK TO TOP ==================== */
.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;
}
.back-to-top:hover {
    background: var(--primary-dark);
}

/* ==================== TABLET (768px) ==================== */
@media (min-width: 768px) {
    .container { padding: 0 24px; }
    .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); }
    
    .page-header { padding: 100px 0 40px; }
    .page-title { font-size: 36px; }
    
    .filter-bar { top: 56px; }
    .filter-list { justify-content: center; }
    
    .project-grid { grid-template-columns: repeat(2, 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; }
    
    .page-header { padding: 120px 0 48px; }
    .page-title { font-size: 42px; }
    .page-desc { font-size: 16px; }
    
    .filter-bar { top: 66px; padding: 16px 0; }
    .filter-btn { padding: 10px 20px; font-size: 14px; }
    
    .project-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
    .card-body { padding: 20px; }
    .card-title { font-size: 18px; }
    .card-excerpt { font-size: 14px; }
    
    .cta-box { padding: 60px 40px; }
    .cta-box h2 { font-size: 28px; }
}
