/* ===== Section Layout ===== */
.projects-section {
    width: 80%;
    margin: 10rem auto 1rem auto;
    padding: 10rem 2rem;
    font-family: "MiSans VF Regular", system-ui, sans-serif;
}

/* ----- Header 部分 ----- */
.projects-header {
    text-align: center;
    margin-bottom: 4rem;
}

.projects-tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: #f4f4e5;
    color: #7a7a5c;
    font-size: 0.9rem;
    border-radius: 6px;
    letter-spacing: 1px;
}

.projects-header h2 {
    margin: 1rem 0;
    font-size: 3rem;
    font-weight: 800;
    color: #333;
}

.projects-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

/* ===== Grid 部分 ===== */
.projects-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

/* ===== 1. 最外层：3D 舞台 (Scene) ===== */
.project-card {
    background-color: transparent; /* 背景透明，让 inner 决定颜色 */
    perspective: 1000px; /* 开启 3D 空间感 */
    cursor: pointer;
    height: auto; 
    /* 恢复或添加过渡效果，用于处理 translateY 的上浮动画 */
    transition: transform 0.25s ease; 
}

/* ===== 2. 中间层：负责旋转 (Wrapper) ===== */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: left;
    transition: transform 0.6s; /* 翻转动画时间 */
    transform-style: preserve-3d; /* 关键：保留子元素的 3D 空间 */
}

/* JS 会切换这个类来实现翻转 */
.project-card.is-flipped .card-inner {
    transform: rotateY(180deg);
}

/* ===== 3. 内层：正面和背面公共样式 (Faces) ===== */
.card-front, .card-back {
    width: 100%;
    /* 背面必须绝对定位，才能和正面重叠 */
    backface-visibility: hidden; /* 关键：背对屏幕时隐藏 */
    border-radius: 12px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.12);
    overflow: hidden; /* 圆角裁切 */
    background: #fff;
    
    /* 确保阴影和过渡效果在这里定义，以便它们能随着 hover 一起变化 */
    transition: box-shadow 0.25s ease;
}

/* --- 正面样式 (Front) --- */
.card-front {
    z-index: 2;
    transform: rotateY(0deg); /* 默认角度 */
}

/* --- 背面样式 (Back) --- */
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%; /* 填满容器 */
    transform: rotateY(180deg); /* 默认就已经转过去了 */
    
    /* 背面内容的排版 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #333; /* 背面颜色 */
    color: #fff;      /* 文字白色 */
    text-align: center;
}

/* 背面内容的一些简单样式 */
.card-back h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}
.card-back .back-btn {
    margin-top: 1.5rem;
    padding: 0.8rem 1.5rem;
    background: #ff6b6b;
    border: none;
    color: white;
    border-radius: 20px;
    cursor: pointer;
}

/* 🚀 交互优化：只有未翻转时，卡片才会上浮 */
.project-card:hover:not(.is-flipped) {
    transform: translateY(-5px);
}

/* 🚀 交互优化：只有未翻转时，卡面的阴影才会加深 */
.project-card:hover:not(.is-flipped) .card-front,
.project-card:hover:not(.is-flipped) .card-back {
    box-shadow: 0 10px 35px rgba(0,0,0,0.18);
}


/* ===== 图片部分 (保留原有的所有样式) ===== */
.project-img {
    width: 100%;
    aspect-ratio: 2 / 1;
    overflow: hidden;
}
.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== 文本部分 (保留原有的所有样式) ===== */
.project-content {
    padding: 1.8rem;
}
.project-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}
.project-content p {
    color: #666;
    font-size: 0.98rem;
    line-height: 1.6;
}
.project-icon {
    width: 48px;
    height: 48px;
    background: #f6f7e8;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 1rem;
}

/* 手机端 */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ===========================
   WHY CHOOSE US — Dark Section
   =========================== */

.why-section {
    background: #1e1c19; /* 深色背景 */
    padding: 8rem 0;
    color: #f6f6f4;
}

/* Header */
.why-header {
    text-align: center;
    margin-bottom: 5rem;
}

.why-tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: #d7d26130;
    color: #d7d261;
    font-size: 0.9rem;
    border-radius: 5px;
}

.why-header h2 {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 1rem 0;
}

.why-header p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
    color: #ccc;
}

/* Grid */
.why-grid {
    width: 80%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.why-card {
    background: #24221f;
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid #3a3733;
    transition: 0.25s ease;
}

.why-card:hover {
    transform: translateY(-5px);
    background: #2b2925;
}

/* ICON */
.why-icon {
    width: 54px;
    height: 54px;
    padding: 12px;
    background: #d7d26125;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.why-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.why-card p {
    color: #bbb;
    line-height: 1.6;
}

/* Banner */
.why-banner {
    margin-top: 5rem;
    padding: 3rem 2rem;
    background: #3b3a22;
    border-left: 6px solid #d7d261;
    text-align: center;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    border-radius: 8px;
}

.why-banner h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.why-banner p {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.7;
    color: #e6e6e6;
}

/* Mobile */
@media (max-width: 768px) {
    .why-grid {
        grid-template-columns: 1fr;
    }

    .why-section {
        padding: 5rem 0;
    }

    .why-banner {
        width: 90%;
    }
}

/* 整个区域 */
.feature-cards {
    width: 80%;
    margin: 4rem auto;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    padding: 0 2rem;
}

/* 通用卡片样式 */
.card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    padding-bottom: 1rem;
}

.card img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 15px;
}

.card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 1rem 1rem 0.3rem;
}

.card p {
    font-size: 0.95rem;
    color: #555;
    margin: 0 1rem 0.8rem;
    line-height: 1.5;
}

/* 尺寸控制（完全按你截图逻辑） */
.card-small {
    grid-column: span 4; /* 左边小卡 */
}

.card-medium {
    grid-column: span 8; /* 右边宽卡 */
}

.card-large {
    grid-column: span 12; /* 最底部整行卡 */
}



