/* ========================================
   公共样式 - 所有页面共用
   ======================================== */

/* CSS变量系统 */
:root {
    --color-primary: #497271;
    --color-text-light: #fff;
    --color-text-dark: #000;
    --font-special: '宋体', '新宋体', sans-serif;
    --transition-default: 0.5s ease;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 链接样式 */
a:link, a:visited {
    color: var(--color-text-light);
    text-decoration: none;
}

/* 特殊字体 */
.font-special {
    font-family: var(--font-special);
}

/* 段落缩进 */
p {
    text-indent: 2em;
}

/* ========================================
   导航栏样式
   ======================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 10;
    padding: 20px 100px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text-light);
    overflow: hidden;
    border-bottom: double white 1px;
    background-color: rgba(0, 0, 0, 0.5);
}

.nav-header {
    display: flex;
    flex-direction: row;
}

.navbar-brand {
    font-family: '宋体';
    font-size: 30px;
    font-weight: bold;
    height: 30px;
    color: var(--color-text-light);
}

header ul {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

header ul li {
    font-weight: 400px;
    margin-left: 15px;
    transition: all var(--transition-default) linear;
    padding: 5px 10px;
    border-radius: 20px;
}

header ul li:hover,
.active {
    background: var(--color-primary);
    color: #2b1055;
}

/* ========================================
   公共动画
   ======================================== */
@keyframes slidein {
    from {
        margin-left: 100%;
        width: 300%;
    }
    to {
        margin-left: 0%;
        width: 50%;
    }
    75% {
        font-size: x-large;
        margin-left: 25%;
        width: 150%;
    }
}

@keyframes moving {
    from {
        margin-left: 100%;
        width: 300%;
    }
    to {
        margin-left: 0%;
        width: 50%;
    }
    75% {
        width: 150%;
        margin-left: 25%;
    }
}

/* ========================================
   布局容器
   ======================================== */
.section {
    margin-top: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    transform-style: preserve-3d;
}

.box1 {
    margin: 20px 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 100px;
}

/* ========================================
   3D卡片翻转样式
   ======================================== */
.card, .card1 {
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card {
    width: 320px;
    height: 320px;
    margin-top: 100px;
    margin-left: 20px;
    margin-bottom: 100px;
}

.card1 {
    width: 500px;
    height: 400px;
    margin-top: 100px;
    margin-left: 20px;
    margin-bottom: 100px;
}

.card .box, .card1 .box {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: 1s ease;
}

.card .box .img-box, .card1 .box .img-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    pointer-events: auto;
}

/* 翻转后正面不可点击，避免拦截反面事件 */
.card.flipped .box .img-box, .card1.flipped .box .img-box {
    pointer-events: none;
}

.card .box .img-box img, .card1 .box .img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card .box .con-box, .card1 .box .con-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transform: rotateY(180deg);
    pointer-events: none;
}

/* 翻转后反面可点击 */
.card.flipped .box .con-box, .card1.flipped .box .con-box {
    pointer-events: auto;
}

.card .box .con-box div, .card1 .box .con-box div {
    color: var(--color-text-light);
    padding: 20px;
    background: linear-gradient(30deg, #96fbc4, #f9f586);
    transform: translateZ(100px);
}

.card .box .con-box div h2, .card1 .box .con-box div h2 {
    font-size: 20px;
    letter-spacing: 2px;
    font-family: '宋体';
    color: var(--color-text-dark);
}

.card .box .con-box div p, .card1 .box .con-box div p {
    font-size: 15px;
    text-align: justify;
    margin-top: 5px;
    font-family: '宋体';
    color: var(--color-text-dark);
}

/* 桌面端：hover 翻转（触摸设备由 JS 添加 touch-device 类来禁用） */
html:not(.touch-device) .card:hover .box,
html:not(.touch-device) .card1:hover .box {
    transform: rotateY(180deg);
}

/* 触摸设备：点击翻转 */
.card.flipped .box, .card1.flipped .box {
    transform: rotateY(180deg);
}

/* 触摸设备卡片按压反馈 */
html.touch-device .card:active,
html.touch-device .card1:active {
    transform: scale(0.97);
}

/* ========================================
   移动端翻转提示气泡
   ======================================== */
.card-flip-hint {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 50;
    animation: hint-pulse 1.5s ease-in-out infinite;
    pointer-events: none;
}

.card-flip-hint-fade {
    opacity: 0;
    transition: opacity 0.5s;
}

@keyframes hint-pulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

/* ========================================
   轮播图样式
   ======================================== */
.swipe {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: auto;
    margin-top: 100px;
}

.swipe .bg {
    position: absolute;
    width: 500%;
    height: 100%;
    z-index: 1;
    background-size: 6000px;
    background-position: center center;
    filter: blur(140px);
}

.swipe section {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1500px;
    height: 700px;
    margin: 0 auto;
}

.swipe .img-box {
    width: 100%;
    height: 100%;
}

.swipe .img-box .img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swipe .select {
    position: absolute;
    width: 100%;
    height: 30px;
    line-height: 30px;
    bottom: 20px;
    text-align: center;
}

.swipe .select .item {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: var(--color-text-light);
    border-radius: 50%;
    margin: 0 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.swipe .select .item:hover,
.swipe .select .item.checked {
    background-color: #ff4400;
}

.swipe .btn {
    width: 40px;
    height: 100px;
    color: var(--color-text-light);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    background-color: rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;
    cursor: pointer;
    transition: 0.3s;
}

.swipe .btn.left { left: -60px; }
.swipe .btn.right { right: -60px; }
.swipe .btn:hover { background-color: rgba(0, 0, 0, 0.2); }

@media screen and (max-width: 1620px) {
    .swipe .btn.left { left: 20px; }
    .swipe .btn.right { right: 20px; }
}

/* ========================================
   响应式样式 - 移动端适配
   ======================================== */

/* 汉堡菜单按钮样式 */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 20;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 汉堡菜单激活状态（X形状） */
.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* 平板端 - 导航栏调整 */
@media screen and (max-width: 992px) {
    header {
        padding: 15px 30px;
    }

    .navbar-brand {
        font-size: 24px;
    }

    header ul li {
        margin-left: 10px;
        padding: 4px 8px;
        font-size: 14px;
    }

    .card {
        width: 280px;
        height: 280px;
    }

    .card1 {
        width: 400px;
        height: 320px;
    }

    .swipe section {
        height: 500px;
    }
}

/* 手机端 - 核心响应式断点 */
@media screen and (max-width: 768px) {
    /* 汉堡菜单按钮显示 */
    .hamburger {
        display: flex;
    }

    /* 导航栏布局调整 */
    header {
        padding: 15px 20px;
        flex-wrap: wrap;
    }

    .nav-header {
        width: 100%;
        justify-content: space-between;
    }

    .navbar-brand {
        font-size: 20px;
    }

    /* 隐藏桌面导航 */
    header ul.desktop-nav {
        display: none;
    }

    /* 移动端导航展开状态 */
    header ul.mobile-nav-open {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        padding: 15px 0;
        background-color: rgba(0, 0, 0, 0.8);
        margin-top: 10px;
    }

    header ul.mobile-nav-open li {
        margin: 8px 0;
        text-align: center;
        font-size: 16px;
    }

    /* 卡片布局调整 */
    .card {
        width: 90%;
        max-width: 280px;
        height: auto;
        min-height: 250px;
        margin: 30px auto;
    }

    .card1 {
        width: 90%;
        max-width: 400px;
        height: auto;
        min-height: 300px;
        margin: 30px auto;
    }

    .card .box .con-box div h2,
    .card1 .box .con-box div h2 {
        font-size: 16px;
    }

    .card .box .con-box div p,
    .card1 .box .con-box div p {
        font-size: 13px;
    }

    /* 布局容器调整 */
    .section {
        margin-top: 30px;
    }

    .box1 {
        margin: 10px 15px;
        margin-top: 80px;
    }

    /* 轮播图调整 */
    .swipe {
        margin-top: 80px;
    }

    .swipe section {
        height: 350px;
    }

    .swipe .btn {
        width: 30px;
        height: 60px;
        font-size: 30px;
    }

    .swipe .btn.left { left: 10px; }
    .swipe .btn.right { right: 10px; }
}

/* 小屏手机 */
@media screen and (max-width: 576px) {
    header {
        padding: 12px 15px;
    }

    .navbar-brand {
        font-size: 18px;
    }

    .swipe section {
        height: 250px;
    }

    .swipe .btn {
        width: 25px;
        height: 50px;
        font-size: 24px;
    }

    .card .box .con-box div,
    .card1 .box .con-box div {
        padding: 15px;
    }
}

/* ========================================
   返回顶部按钮
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(73, 114, 113, 0.85);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: rgba(73, 114, 113, 1);
}
