/* 全局变量定义 */
:root {
    --primary-color: #5D9CEC;
    --secondary-color: #4B89DC;
    --accent-color: #FF7043;
    --text-color: #333;
    --light-text: #fff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --transition-default: all 0.3s ease;
    --font-family-base: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --box-shadow-sm: 0 2px 10px var(--shadow-color);
    --box-shadow-md: 0 4px 15px rgba(93, 156, 236, 0.3);
    --box-shadow-lg: 0 6px 20px rgba(93, 156, 236, 0.4);
    --background-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* 基础样式优化 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-base);
    line-height: 1.8;
    color: var(--text-color);
    background: var(--background-gradient);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* 夜间模式优化 */
body.night-mode {
    --text-color: #E0E0E0;
    --background-color: #212121;
    --primary-color: #388E3C;
    --secondary-color: #43A047;
    --accent-color: #FFA726;
}

/* 导航栏优化 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--box-shadow-sm);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition-default);
    will-change: transform;
}

.navbar-brand {
    font-weight: 600;
    color: #4CAF50 !important;
    transition: var(--transition-default);
}

.nav-link {
    position: relative;
    color: var(--text-color) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    margin: 0 0.2rem;
    transition: var(--transition-default);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition-default);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* 主标题样式优化 */
.hero-section {
    position: relative;
    padding: 10vh 0 15vh;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
    margin-bottom: 5vw;
}

.hero-title {
    font-size: clamp(1.5rem, 6vw, 3rem);
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: clamp(0.8rem, 3vw, 1.5rem);
    animation: fadeInUp 0.8s ease;
    line-height: 1.3;
    max-width: min(95%, 70ch);
    margin-left: auto;
    margin-right: auto;
}

/* 超小屏幕优化 */
@media (max-width: 576px) {
    .hero-title {
        font-size: clamp(1.3rem, 5vw, 2rem);
    }
    .hero-subtitle {
        font-size: clamp(0.9rem, 3.5vw, 1.2rem);
    }
    .qr-code-container img {
        max-width: 180px;
    }
    .booking-step {
        min-width: 100%;
    }
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    margin-bottom: clamp(2rem, 5vw, 4rem);
    animation: fadeInUp 1s ease 0.2s;
    max-width: min(90%, 65ch);
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* 按钮样式优化 */
.btn-primary {
    background: var(--primary-color);
    border: none;
    padding: 0.8em 2em;
    border-radius: 100vw;
    font-weight: 600;
    transition: var(--transition-default);
    box-shadow: var(--box-shadow-md);
    will-change: transform;
    font-size: clamp(1rem, 2vw, 1.25rem);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255,255,255,0.2), transparent);
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.86, 0, 0.07, 1);
}

.btn-primary:hover::after {
    transform: translateY(0);
}

.btn-primary:hover, .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.cta-buttons .btn {
    padding: 12px 30px;
    font-weight: 500;
    border-radius: 30px;
    box-shadow: var(--box-shadow-md);
    transition: all 0.2s ease;
    will-change: transform;
}

.cta-buttons .btn:hover {
    transform: translateY(-2px);
}

.cta-buttons .btn-light {
    background: white;
    color: #4CAF50;
}

.cta-buttons .btn-outline-light {
    border: 2px solid #fff;
    background: transparent;
    color: white;
    transition: all 0.2s ease;
}

.cta-buttons .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式优化 */
@media (max-width: 768px) {
    .hero-banner {
        padding: 8vh 0 12vh;
    }
    
    /* 导航栏优化 */
    .navbar-collapse {
        padding: 1rem;
        background: rgba(255,255,255,0.98);
        margin-top: 0.5rem;
        border-radius: 0.5rem;
    }
    .nav-item {
        margin: 0.5rem 0;
    }
    .navbar-toggler {
        padding: 0.75rem;
        font-size: 1.25rem;
    }
    
    /* 内容区优化 */
    .cta-buttons {
        flex-direction: column;
        gap: 1.5rem;
        width: 90%;
        margin-left: auto;
        margin-right: auto;
    }
    .btn {
        width: 100%;
        padding: 1em 1.5em;
        min-height: 48px; /* 触控友好 */
    }
    
    /* 头像优化 */
    .profile-image {
        max-width: 150px;
        margin-bottom: 1.5rem;
    }
    
    /* 专业背景列表 */
    .qualification-list li {
        margin-bottom: 0.8rem;
        padding-left: 1.5rem;
    }
}

@media (min-width: 1600px) {
    .hero-title {
        --fluid-hero-title: calc(2rem + 3vw);
    }
    
    .hero-subtitle {
        --fluid-hero-subtitle: calc(1rem + 0.5vw);
    }
}

/* 背景渐变效果 */
.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(76, 175, 80, 0.8) 0%,
        rgba(69, 160, 73, 0.9) 100%
    );
    z-index: -1;
}

/* 添加微妙的波浪效果 */
.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-repeat: no-repeat;
}

/* 主页横幅优化 */
.hero-banner {
    /* 使用绿色渐变背景 */
    background: linear-gradient(135deg, #4CAF50 0%, #81C784 100%);
    /* 或者使用更柔和的竹子绿色系 */
    /* background: linear-gradient(135deg, #7CB342 0%, #AED581 100%); */
    padding: 120px 0;
    position: relative;
    overflow: hidden;
}

/* 调整遮罩透明度，让绿色更突出 */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2); /* 降低遮罩深度 */
    z-index: 1;
}

/* 文字阴影效果 */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* 按钮样式优化 */
.cta-buttons .btn {
    padding: 12px 30px;
    font-weight: 500;
    border-radius: 30px;
    box-shadow: var(--box-shadow-md);
}

.cta-buttons .btn-primary {
    background: #2E7D32; /* 深绿色按钮 */
    border: none;
}

.cta-buttons .btn-primary:hover {
    background: #1B5E20;
}

.cta-buttons .btn-outline-light {
    border: 2px solid #fff;
    background: transparent;
}

.cta-buttons .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 确保文字在遮罩层上方 */
.hero-banner .container {
    position: relative;
    z-index: 2;
}

/* 竹叶装饰元素 */
.hero-banner .bamboo-leaves {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    pointer-events: none;
}

.hero-banner .bamboo-leaf {
    position: absolute;
    width: 50px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    clip-path: polygon(50% 0%, 100% 30%, 80% 100%, 20% 100%, 0% 30%);
}

.bm-1 {
    top: 10%;
    left: 20%;
    animation: float 8s ease-in-out infinite;
}

.bm-2 {
    top: 25%;
    left: 50%;
    animation: float 10s ease-in-out infinite;
    transform: scale(0.8);
}

.bm-3 {
    top: 40%;
    left: 70%;
    animation: float 12s ease-in-out infinite;
    transform: scale(1.2);
}

/* 自然漂浮动画 */
@keyframes float {
    0% {
        transform: translateY(0) translateX(0) rotate(-10deg);
    }
    50% {
        transform: translateY(-20px) translateX(10px) rotate(10deg);
    }
    100% {
        transform: translateY(0) translateX(0) rotate(-10deg);
    }
}

.hero-banner h1 {
    font-size: 3rem;
    font-weight: 600;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.3);
    color: #ffffff;
    position: relative;
    z-index: 2;
}

.hero-banner .lead {
    font-size: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    color: var(--text-color);
}

/* 浮动按钮优化 */
.floating-cta, .emergency-button {
    position: fixed;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-width: 56px;
    min-height: 56px;
    padding: 1rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* 预约按钮 */
.floating-cta {
    background: linear-gradient(135deg, #4CAF50 0%, #81C784 100%);
    color: white;
    bottom: 100px;
    right: 20px;
}

/* 紧急求助按钮 */
.emergency-button {
    background: linear-gradient(135deg, #FF5252 0%, #FF1744 100%);
    color: white;
    bottom: 20px;
    right: 20px;
    animation: pulse 2s infinite;
}

/* 触控反馈 */
.floating-cta:active,
.emergency-button:active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* 咨询卡片响应式布局 */
@media (max-width: 768px) {
    .consultation-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .consultation-card {
        padding: 1.5rem;
    }
    
    /* 按钮位置调整 */
    .floating-cta {
        bottom: 80px;
        right: 15px;
        font-size: 0.9rem;
        padding: 0.8rem 1.5rem;
    }
    
    .emergency-button {
        bottom: 15px;
        right: 15px;
        font-size: 0.9rem;
        padding: 0.8rem 1.5rem;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 82, 82, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 82, 82, 0);
    }
}

/* 二维码预约区域样式 */
.qr-booking-section {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    margin: 4rem auto;
    max-width: 800px;
    box-shadow: var(--card-shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.qr-booking-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.qr-container {
    margin: 2rem auto;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    display: inline-block;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.qr-instruction {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-top: 1.5rem;
    line-height: 1.8;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.booking-steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.booking-step {
    flex: 1;
    min-width: 200px;
    background: rgba(93, 156, 236, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--transition-default);
}

.booking-step:hover {
    transform: translateY(-5px);
    background: rgba(93, 156, 236, 0.2);
}

.step-number {
    display: inline-block;
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 36px;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* 文章展示样式 */
.article-container {
    margin-top: 4rem;
}
.article-card {
    background-color: var(--background-darker);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--box-shadow-md);
    transition: var(--transition-default);
}

/* 用户登录注册模态框样式 */
#authModal .modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: var(--box-shadow-md);
}
#authModal .nav-tabs {
    border-bottom: 2px solid var(--primary-color);
}
#authModal .nav-link {
    color: var(--text-color);
    border: none;
    font-weight: 600;
    padding: 1rem 0;
    transition: var(--transition-default);
}
#authModal .nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}
#authModal form .form-control {
    border-radius: 8px;
    padding: 0.8rem 1rem;
    border: 1px solid var(--soft-shadow);
    transition: var(--transition-default);
}
#authModal form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(102,187,106,0.3);
}
#authModal button[type="submit"] {
    border-radius: 30px;
    padding: 0.8rem;
    font-size: 1rem;
}
.article-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}
.article-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}
.article-content p {
    line-height: 1.8;
    margin-bottom: 1rem;
}
.read-more {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    position: relative;
}
.read-more::after {
    content: '→';
    margin-left: 0.5rem;
    transition: margin 0.3s ease;
}
.read-more:hover::after {
    margin-left: 1rem;
}

.emergency-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 10px rgba(0,0,0,0.25);
}

/* 心理测评卡片 */
.psych-test-card {
    background: var(--secondary-color);
    border-radius: 16px;
    box-shadow: var(--box-shadow-md);
    transition: var(--transition-default);
    padding: 2rem;
    margin: 1rem;
    cursor: pointer;
}

.psych-test-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}
/* 响应式调整 */
@media (max-width: 768px) {
    .hero-banner {
        padding: 6rem 0 2rem;
    }
    
    .hero-banner h1 {
        font-size: 2rem;
    }
}

.bamboo-background {
    background-color: #f0f4f0; /* 背景颜色 */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* 确保背景在最底层 */
}

/* 竹子组 */
.bamboo-group {
    position: absolute;
    height: 100%;
    bottom: 0;
    transform-origin: bottom center;
    animation: bambooSway 6s ease-in-out infinite; /* 动画应用 */
}

/* 竹子位置分布 */
.bamboo-group-1 { left: 15%; }
.bamboo-group-2 { left: 35%; }
.bamboo-group-3 { left: 55%; }
.bamboo-group-4 { left: 75%; }

/* 竹子主干 */
.bamboo {
    position: relative;
    width: 24px;
    height: 100%;
    background: linear-gradient(90deg, rgba(168, 214, 0, 0.95), rgba(150, 193, 0, 1));
    border-radius: 12px;
}

/* 竹节 */
.node {
    position: absolute;
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

.node:nth-child(1) { top: 25%; }
.node:nth-child(2) { top: 45%; }
.node:nth-child(3) { top: 65%; }
.node:nth-child(4) { top: 85%; }

/* 竹叶样式 */
.leaf-section {
    position: absolute;
    width: 100%;
    left: 50%;
    transform: translateX(-50%);
}

/* 单片竹叶 */
.leaf {
    position: absolute;
    width: 70px;
    height: 16px;
    background: linear-gradient(90deg, rgba(184, 230, 0, 0.9), rgba(168, 214, 0, 1));
    border-radius: 100% 0 100% 0;
    transform-origin: 0 50%;
    opacity: 0.95;
}

/* 竹叶角度和位置 */
.leaf-1 { transform: rotate(-22deg); top: 0; }
.leaf-2 { transform: rotate(-8deg); top: 6px; }
.leaf-3 { transform: rotate(6deg); top: 12px; }

/* 竹子摆动动画 */
@keyframes bambooSway {
    0%, 100% { transform: rotate(0deg) scaleY(1); }
    50% { transform: rotate(1deg) scaleY(0.9995); }
}

.consultation-section {
    padding: 40px 20px;
    text-align: center;
    background-color: #f9f9f9; /* 背景色 */
}

.consultation-title {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #4CAF50;
}

.consultation-cards {
    display: flex;
    justify-content: space-around; /* 均匀分布 */
    flex-wrap: wrap; /* 允许换行 */
}

.consultation-card {
    background: #ffffff;
    border-radius: 15px; /* 圆角 */
    padding: 20px;
    margin: 10px;
    box-shadow: var(--box-shadow-md); /* 阴影效果 */
    flex: 1; /* 使每个卡片占据相同的空间 */
    max-width: 300px; /* 设置最大宽度 */
    transition: transform 0.3s; /* 动画效果 */
}

.consultation-card:hover {
    transform: translateY(-5px); /* 悬停时上升效果 */
}

.consultation-card h3 {
    font-size: 1.5rem; /* 标题字体大小 */
    color: #333; /* 标题颜色 */
}

.consultation-card p {
    font-size: 1rem; /* 内容字体大小 */
    color: #666; /* 内容颜色 */
}

/* 浮动预约按钮 */
.floating-cta {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 1000;
    transition: var(--transition-default);
    animation: float 3s ease-in-out infinite;
}

.floating-cta:hover {
    transform: translateY(-5px);
}

.cta-button {
    display: inline-flex;
    align-items: center;
    background-color: var(--primary-color);
    color: white !important;
    padding: 18px 36px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 500;
    box-shadow: var(--box-shadow-md);
    transition: var(--transition-default);
    white-space: nowrap;
}

.cta-button:hover {
    background-color: var(--secondary-color);
    box-shadow: var(--box-shadow-lg);
    color: white !important;
    text-decoration: none;
}

.cta-button i {
    font-size: 1.4rem;
    margin-right: 10px;
}

@media (max-width: 768px) {
    .floating-cta {
        right: 20px;
        bottom: 20px;
    }
    
    .cta-button {
        padding: 14px 28px;
        font-size: 1.1rem;
    }

    .cta-button i {
        font-size: 1.2rem;
        margin-right: 8px;
    }
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

/* 底部版权栏样式 */
.footer {
    background-color: #2c3e50;
    padding: 1rem 0;
    position: relative;
    width: 100%;
    color: #fff;
    font-size: 0.9rem;
}

.footer p {
    margin: 0;
    opacity: 0.9;
}
