/* 全局变量 - 用于统一管理网站配色和关键尺寸 */
:root {
    --header-bg: #ffffff;        /* 页眉背景色 */
    --header-text: #333333;      /* 页眉文字颜色 */
    --primary-color: #1c244b;    /* 主要品牌色 */
    --secondary-color: #f8f8f8;  /* 次要背景色 */
    --text-color: #333333;       /* 正文文字颜色 */
    --light-text: #666666;       /* 浅色文字颜色 */
    --border-color: #eeeeee;     /* 边框颜色 */
    --background-color: #ffffff; /* 全局背景色 */
    --hover-color: #444;         /* 悬停状态颜色 */
    --tesla-text: #f5f5f5;       /* 特殊文字颜色 */
    --project-gap: 20px;         /* 项目间距 */
}

/* 重置所有元素的默认样式 */
* {
    margin: 0;                   /* 清除外边距 */
    padding: 0;                  /* 清除内边距 */
    box-sizing: border-box;      /* 使用更合理的盒模型 */
}

/* 全局字体和基础样式设置 */
html, body {
    font-family: 'Times New Roman', Times, serif !important;  /* 使用 !important 确保不被覆盖 */
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    overflow-x: hidden;
}

/* 链接样式重置 */
a {
    text-decoration: none;       /* 移除下划线 */
    color: inherit;             /* 继承父元素颜色 */
}

/* 图片基础样式 */
img {
    max-width: 100%;            /* 确保图片不会溢出容器 */
    height: auto;               /* 保持图片比例 */
}

/* 内容容器通用样式 */
.container {
    width: 100%;               /* 占满可用宽度 */
    max-width: 1200px;         /* 最大宽度限制 */
    margin: 0 auto;            /* 水平居中 */
    padding: 0 20px;           /* 两侧留白 */
}

/* 全宽容器样式 */
.container-fluid {
    width: 100%;              /* 占满全部宽度 */
    padding: 0 20px;          /* 两侧留白 */
}

/* 主内容区域样式 */
.main-content {
    padding-top: 82px;        /* 为固定定位的页眉留出空间 */
}

/* 如果需要使用自定义字体，可以按如下方式添加 */
/*
@font-face {
    font-family: 'CustomFont';                    // 自定义字体名称
    src: url('../fonts/CustomFont.woff2') format('woff2'),  // 主要字体文件
         url('../fonts/CustomFont.woff') format('woff');    // 备用字体文件
    font-weight: normal;                          // 字重
    font-style: normal;                           // 字体样式
    font-display: swap;                           // 字体加载策略
}
*/

/* 如果使用在线字体，在HTML中添加如下代码 */
/*
<link href="https://fonts.googleapis.com/css2?family=Selected+Font&display=swap" rel="stylesheet">
然后修改 body 的 font-family
*/

/* 要修改全站字体，只需要修改 body 的 font-family 属性 */
/* 示例：
body {
    font-family: 'CustomFont', 'Helvetica Neue', Arial, sans-serif;
    // 其他样式保持不变
}
*/

/* 页眉样式 */
.site-header {
    height: 82px;
    min-height: 82px;
    max-height: 82px;
    padding: 15px 32px;
    background-color: var(--header-bg);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.tesla-nav {
    height: 52px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

/* 导航链接样式 */
.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--header-text);
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 4px;
}

.nav-links a:hover {
    color: var(--primary-color);
    background-color: rgba(28, 36, 75, 0.1);
}

.nav-links a.active {
    color: var(--primary-color);
    font-weight: bold;
}

.right-nav .icon-link {
    font-size: 1.2rem;
    color: var(--header-text);
    transition: color 0.3s;
}

.right-nav .icon-link:hover {
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--header-text);
    transition: all 0.3s ease;
}

/* 页脚样式 */
.site-footer {
    background-color: #1C244B;
    padding: 0;
    text-align: center;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    margin-top: 10px;
}

.site-footer p {
    color: #ffffff;
    margin: 0;
}

/* 首页英雄部分 */
.hero-section {
    height: calc(100vh - 82px);
    position: relative;
    overflow: hidden;
    background-color: #000;
}

.video-container {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #333; /* 默认背景色 */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 备用图片样式 */
.video-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0; /* 低于视频的层级 */
    display: block;
}

/* 视频样式 */
.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1; /* 高于背景图的层级 */
    transition: opacity 0.5s ease; /* 平滑过渡 */
}

/* 项目网格布局 */
.projects-section {
    padding: 50px 0;
    background: var(--secondary-color);
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--primary-color);
}

.section-title p {
    color: var(--light-text);
    max-width: 700px;
    margin: 0 auto;
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 30px;
}

.project-row {
    display: flex;
    gap: 30px;
    width: 100%;
}

/* 2列布局 */
.project-row:nth-child(1) .project-item,
.project-row:nth-child(3) .project-item {
    flex: 0 0 calc(50% - 15px);
    width: calc(50% - 15px);
}

/* 3列布局 */
.project-row:nth-child(2) .project-item,
.project-row:nth-child(4) .project-item {
    flex: 0 0 calc(33.333% - 20px);
    width: calc(33.333% - 20px);
}

/* 1列布局 */
.project-row:nth-child(5) .project-item {
    flex: 0 0 100%;
    width: 100%;
}

.project-item {
    position: relative;
    height: 400px;
    background: var(--background-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.project-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.project-image {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.project-title {
    text-align: center !important;
    position: absolute !important;
    display: block !important;
    margin: 0 !important;
    font-size: 1rem !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    padding: 15px 10px 20px !important;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 70%, transparent 100%) !important;
    z-index: 10 !important;
}

.project-architect {
    font-size: 0.9rem;
    color: var(--light-text);
    margin: 0;
}

/* 悬停效果 */
.project-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.project-item:hover .project-image img {
    transform: scale(1.05);
}

/* 响应式布局 */
@media (max-width: 1200px) {
    .projects-grid {
        padding: 0 20px;
    }
    
    .project-row {
        flex-wrap: wrap;
    }
    
    .project-row .project-item {
        flex: 0 0 calc(50% - 15px) !important;
        width: calc(50% - 15px) !important;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5px;
    }
    
    .projects-grid {
        padding: 0 1.5px;
    }
    
    .project-row .project-item {
        flex: 0 0 100% !important;
        width: 100% !important;
        margin-bottom: 1.5px;
    }
    
    .project-item {
        height: 350px;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .section-title h2 {
        font-size: 1.8rem;
    }
    
    .project-item {
        height: 300px;
    }
}

/* 淡入动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 1s ease-in;
}

/* 对于非3列项目保留原来的宽高比 */
.col-1-item .project-image,
.col-2-item .project-image {
    height: 100% !important;
}

/* 3列项目不使用宽高比，而是使用flex布局 */
.col-3-item .project-image {
    height: 100% !important;
}

/* 鼠标悬停效果优化 */
.project-link {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.col-3-item .project-link::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    content: '';
    background-color: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.col-3-item .project-link:hover::after {
    opacity: 1;
}

/* 卡片悬停效果 */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* 按钮样式 */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

/* 页脚社交图标 */
.social-links a {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.social-links a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 联系表单样式 */
#contact-form {
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

#contact-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 图片容器样式 */
.card-img-top {
    height: 200px;
    object-fit: cover;
}

/* 通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: #2a6496;
    transition: color 0.3s ease;
}

a:hover {
    color: #1e4a73;
}

ul {
    list-style: none;
}

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

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #2a6496;
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #1e4a73;
    color: white;
}

/* 导航栏样式 */
.site-header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.logo a {
    font-size: 24px;
    font-weight: 700;
    color: #2a6496;
}

.main-nav ul {
    display: flex;
}

.main-nav li {
    margin-left: 30px;
}

.main-nav a {
    color: #333;
    font-weight: 500;
}

.main-nav a:hover {
    color: #2a6496;
}

.mobile-menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* 页面标题区域样式 */
.page-title {
    background-color: #2a6496;
    color: white;
    padding: 60px 0;
    text-align: center;
}

.page-title h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.page-title .subtitle {
    font-size: 18px;
    opacity: 0.9;
}

/* 项目区域样式 */
.projects-section {
    padding: 60px 0;
}

/* 三列项目布局样式 */
.three-column-projects {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.project-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.project-image {
    height: 220px;
    position: relative;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-item:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 20px;
}

.project-content h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #2a6496;
}

.project-content p {
    color: #666;
    margin-bottom: 15px;
}

.project-content .btn {
    padding: 8px 16px;
    font-size: 14px;
}

/* 联系我们区域样式 */
.cta-section {
    background-color: #f1f7fc;
    padding: 60px 0;
    text-align: center;
}

.cta-section h2 {
    font-size: 32px;
    margin-bottom: 15px;
    color: #2a6496;
}

.cta-section p {
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 30px;
    color: #666;
}

/* 页脚样式 */
.site-footer {
    background-color: #1C244B;
    color: white;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-top: 10px;
    text-align: center;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.footer-logo h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.7);
}

.footer-links h4,
.footer-contact h4,
.footer-social h4 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-links h4:after,
.footer-contact h4:after,
.footer-social h4:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: #4a89dc;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-links a:hover {
    color: white;
}

.footer-contact p {
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
}

.footer-contact i {
    margin-right: 10px;
    color: #4a89dc;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background-color: #4a89dc;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .three-column-projects {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .three-column-projects {
        grid-template-columns: 1fr;
    }
    
    .page-title h1 {
        font-size: 28px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* 重置1列和2列项目的链接样式 */
.col-1-item .project-link {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}
.col-2-item .project-link {
    display: block !important;
    height: auto !important;
    flex-direction: initial !important;
}

/* 确保1列项目的图片容器正确显示 */
.col-1-item .project-image {
    height: 70% !important; /* 保持70% */
    min-height: 70% !important;
    max-height: 70% !important;
    aspect-ratio: unset !important; /* 取消宽高比限制 */
    flex: 1 !important; /* 弹性布局 */
    overflow: hidden !important; /* 隐藏溢出部分 */
}

/* 确保1列项目的图片正确显示 */
.col-1-item .project-image img {
    object-position: center bottom !important; /* 改回底部居中显示 */
    object-fit: cover !important;
    transform: scale(1.05) !important; /* 恢复放大效果 */
}

/* 确保2列项目的图片容器正确显示 */
.col-2-item .project-image {
    height: auto !important;
    aspect-ratio: 4/3 !important;
    flex: none !important;
}

.col-3-item .project-link::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    content: '';
    background-color: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* 确保所有项目的信息框样式一致 */
.col-1-item .project-info,
.col-2-item .project-info,
.col-3-item .project-info {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    transform: none !important;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 60%, rgba(0, 0, 0, 0.2) 85%, transparent 100%) !important; /* 加强底部渐变深度 */
    padding: 60px 15px 20px !important; /* 将顶部内边距增加到60px，底部内边距增加到20px */
    border-radius: 0 !important;
    min-width: auto !important;
    text-align: center !important;
    box-shadow: none !important;
    z-index: 10 !important;
    border-bottom: none !important;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important; /* 使用贝塞尔曲线提供更自然的动画 */
    will-change: transform, opacity !important; /* 提示浏览器这些属性将会变化，启用GPU加速 */
}

/* 悬停效果优化 */
.project-item:hover .project-info {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 60%, rgba(0, 0, 0, 0.3) 85%, transparent 100%) !important; /* 悬停时加深背景 */
    transform: translateY(-5px) !important; /* 轻微上移 */
}

/* 确保所有项目标题居中 */
.project-title {
    text-align: center !important;
    position: absolute !important;
    display: block !important;
    margin: 0 !important;
    font-size: 1rem !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    padding: 15px 10px 20px !important;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 70%, transparent 100%) !important;
    z-index: 10 !important;
}

/* 修改标题下划线 */
.project-title::after {
    content: '' !important;
    position: absolute !important;
    bottom: -3px !important;
    left: 50% !important;
    width: 30px !important;
    height: 1px !important; /* 减小高度，更加精致 */
    background-color: rgba(255,255,255,0.7) !important; /* 使用半透明白色 */
    transform: translateX(-50%) !important;
    transition: width 0.15s ease !important; /* 添加过渡效果 */
}

/* 悬停时扩大下划线 */
.project-item:hover .project-title::after {
    width: 60px !important;
    background-color: rgba(255,255,255,0.9) !important;
}

/* 确保所有项目建筑师信息居中 */
.project-architect {
    text-align: center !important;
    font-size: 0.85rem !important;
    color: rgba(255,255,255,0.85) !important; /* 使用半透明白色 */
    margin-bottom: 0 !important;
    opacity: 0.9 !important;
    transition: opacity 0.15s ease !important;
}

/* 悬停时增强显示效果 */
.project-item:hover .project-architect {
    opacity: 1 !important;
}

/* 服务卡片图片样式 */
.service-img {
    height: 200px;
    overflow: hidden;
    position: relative;
    background-color: #f0f0f0; /* 添加背景色作为图片加载的占位符 */
}

.service-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.05) 100%);
}

.service-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
    display: block; /* 确保图片不留间隙 */
}

/* 页眉导航样式 - 强制优先级高于header-styles.css */
.site-header .nav-links a.active {
    color: var(--primary-color) !important;
    font-weight: bold !important;
}

.site-header .nav-links a.active:after {
    transform: scaleX(1) !important;
}

/* 确保悬停样式不会覆盖active样式 */
.site-header .nav-links a.active:hover {
    color: var(--primary-color) !important;
    font-weight: bold !important;
}

/* 初始化后的网格样式，确保布局稳定 */
.grid-initialized {
    opacity: 1;
    visibility: visible;
}

.grid-initialized .project-item {
    /* 确保项目卡片正确显示 */
    display: block;
}

/* 处理懒加载项目 */
.project-image img.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-image img.lazy-loaded {
    opacity: 1;
}

/* 页面滚动显示项目 */
.project-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.project-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 首页标题和描述样式 */
.section-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.section-description {
    color: var(--light-text);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* 文本居中对齐类 */
.text-center {
    text-align: center !important;
} 