/* ==========================================================================
   蓝龙互动网站样式表
   基于在地文化的互联网品牌创作与传播
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 变量系统 (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
    /* 颜色系统 - 品牌与功能 */
    --primary-blue: #2563eb;
    --primary-blue-dark: #1d4ed8;
    --link-blue: #3a5fb0;
    --accent-warm: #ea580c;
    --accent-green: #059669;

    /* 颜色系统 - 中性色/底色 */
    --neutral-white: #fafaf8;
    --neutral-light: #f6f7f4;
    --neutral-warm: #f1f2ee;
    --neutral-gray: #6b7280;
    --neutral-dark: #374151;

    /* 文字颜色 */
    --text-primary: #374151;
    --text-secondary: #6a6a6a;
    --text-light: #f3f4f6;

    /* 间距系统 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 6rem;

    /* 字体与排版 */
    --font-primary: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Chiron Hei HK', 'Noto Sans SC', sans-serif;
    --font-serif: 'Noto Serif SC', serif;

    /* 布局与层级 */
    --container-max: 1200px;
    --header-height: 70px;
    --z-index-header: 1000;
    --z-index-nav: 999;
    --z-index-overlay: 998;
    --z-index-modal: 2000;

    /* 视觉效果 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. 基础重置 (CSS Reset)
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--neutral-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
    overflow: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

a {
    color: var(--link-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-blue-dark);
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* --------------------------------------------------------------------------
   3. 通用布局组件 (Layout Utilities)
   -------------------------------------------------------------------------- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-2xl);
    text-align: center;
}

/* --------------------------------------------------------------------------
   4. 导航栏 (Header & Navigation)
   -------------------------------------------------------------------------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: rgba(254, 254, 254, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: var(--z-index-header);
    transition: all 0.4s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    padding: 10px 0;
    height: calc(var(--header-height) - 10px);
}

.logo img {
    height: 48px;
    width: auto;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition);
}

/* --------------------------------------------------------------------------
   5. 移动端抽屉与遮罩 (Mobile Drawer)
   -------------------------------------------------------------------------- */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    z-index: var(--z-index-overlay);
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 240px;
    height: 100vh;
    background-color: white;
    transform: translateX(100%);
    z-index: var(--z-index-nav);
    transition: transform 0.3s ease;
    padding-top: var(--header-height);
}

.mobile-nav.active { transform: translateX(0); }

.mobile-nav-list { padding: var(--spacing-xl); }
.mobile-nav-list li { margin-bottom: var(--spacing-lg); }

/* --------------------------------------------------------------------------
   6. 英雄区 (Hero Section)
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    height: 80vh;
    min-height: 600px;
    margin-top: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-background::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 0 var(--spacing-lg);
    text-align: center;
    color: var(--text-light);
}

/* 主标题：针对手机屏幕宽度自适应并强制单行 */
.hero-title-main {
    display: block;
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 5vw, 3.5rem); 
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    white-space: nowrap; 
}

.hero-title-sub {
    display: block;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 专项修复：描述文字在努比亚等机型上强制单行并微缩 */
.hero-title-desc {
    display: inline-block;
    font-size: clamp(0.85rem, 2vw, 1.4rem);
    margin-top: 0.5rem;
    line-height: 1.4;
    font-weight: 400;
    white-space: nowrap; /* 绝对不换行 */
}

/* Hero 进场动画 */
.hero-animate .hero-title > span {
    opacity: 0;
    transform: translateY(16px);
    animation: heroFadeUp 0.8s ease-out forwards;
}
.hero-animate .hero-title > span:nth-child(1) { animation-delay: 0.2s; }
.hero-animate .hero-title > span:nth-child(2) { animation-delay: 0.4s; }
.hero-animate .hero-title > span:nth-child(3) { animation-delay: 0.6s; }

@keyframes heroFadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   7. 内容区域通用动画 (Reveal)
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: transform, opacity;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.services-grid .reveal:nth-child(2) { transition-delay: 0.15s; }
.services-grid .reveal:nth-child(3) { transition-delay: 0.3s; }

/* --------------------------------------------------------------------------
   8. 各大业务模块
   -------------------------------------------------------------------------- */

/* 关于 */
.about { padding: var(--spacing-3xl) 0; }
.about-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: var(--spacing-3xl);
    align-items: center;
}
.about-image img { border-radius: 8px; box-shadow: var(--shadow-lg); }

/* 服务项 */
.services { padding: var(--spacing-3xl) 0; background-color: var(--neutral-light); }
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
}
.service-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
}
.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.service-image { overflow: hidden; }
.service-image img { transition: transform 0.5s ease; }
.service-card:hover .service-image img { transform: scale(1.1); }
.service-content { padding: var(--spacing-lg); }

/* 案例展示 (优化后的文字居中与间距) */
.cases { padding: var(--spacing-3xl) 0; }

.cases-intro {
    text-align: center;         /* 文字水平居中 */
    margin-bottom: var(--spacing-xl); /* 与封面图隔开约两行距离 (3rem) */
    max-width: 850px;           /* 限制最大阅读宽度 */
    margin-left: auto;
    margin-right: auto;
    color: var(--text-secondary);
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.case-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}
.case-image img { transition: transform 0.6s ease; }
.case-card:hover .case-image img { transform: scale(1.08); }
.case-overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 58, 138, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    opacity: 0;
    transition: 0.3s;
}
.case-card:hover .case-overlay { opacity: 1; }

/* 团队 */
.team { padding: var(--spacing-3xl) 0; }
.team-content { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-xl); align-items: center; }
.team-image img { border-radius: 12px; }

/* 联系 */
.contact { padding: var(--spacing-3xl) 0; background: var(--neutral-light); text-align: center; }
.contact-email {
    display: inline-block;
    margin-top: var(--spacing-lg);
    padding: var(--spacing-sm) var(--spacing-lg);
    border: 1px solid var(--primary-blue);
    border-radius: 6px;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   9. 通用 UI 组件 (页脚/返回顶部/弹窗)
   -------------------------------------------------------------------------- */
.footer { background: var(--neutral-dark); color: white; padding: var(--spacing-lg) 0; text-align: center; }

.scroll-to-top {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 45px;
    height: 45px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 100;
}
.scroll-to-top.visible { opacity: 1; visibility: visible; }

.modal { position: fixed; inset: 0; z-index: 3000; display: none; }
.modal.active { display: flex; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.8); }
.modal-content { position: relative; width: 90%; height: 90%; margin: auto; background: white; border-radius: 12px; overflow: hidden; }
.modal-body { height: 100%; padding-top: 50px; }
.modal-body iframe { width: 100%; height: 100%; border: none; }
.modal-close { position: absolute; top: 15px; right: 15px; width: 30px; height: 30px; z-index: 10; cursor: pointer; }
.modal-close span { position: absolute; width: 100%; height: 2px; background: #333; top: 50%; }
.modal-close span:nth-child(1) { transform: rotate(45deg); }
.modal-close span:nth-child(2) { transform: rotate(-45deg); }

/* --------------------------------------------------------------------------
   10. 极致响应式与特定机型修复
   -------------------------------------------------------------------------- */

@media (max-width: 992px) {
    .services-grid, .team-content, .about-content { grid-template-columns: 1fr; }
    .cases-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root { --header-height: 60px; }
    .nav-list { display: none; }
    .mobile-menu-toggle { display: flex; }
    
    /* 案例文字间距在手机端微调 */
    .cases-intro { margin-bottom: var(--spacing-lg); padding: 0 var(--spacing-sm); }

    /* 英雄区标题在手机端缩减空间 */
    .hero-title-main {
        font-size: 1.35rem; 
        letter-spacing: -1px; 
    }

    .hero-title-desc {
        font-size: 0.8rem; 
        letter-spacing: -0.5px;
        transform: scale(0.95); /* 利用缩放强行挤进单行 */
        transform-origin: center;
    }
    
    .hero { height: 60vh; min-height: 400px; }
}

@media (max-width: 480px) {
    .cases-grid { grid-template-columns: 1fr; }
    
    .hero-title-main {
        font-size: 1.2rem;
    }
    
    .hero-title-desc {
        font-size: 0.72rem; 
        letter-spacing: -0.3px;
    }
}

/* 针对宽度 360px 以下极端窄屏机型补丁 */
@media (max-width: 360px) {
    .hero-title-desc {
        letter-spacing: -0.8px;
    }
}