/* 前端主样式 */
:root {
    /* 基础静态变量 - 动态主题变量在index.php中定义 */
    --white: #ffffff;
    --accent: #ff9a76;
    --success: #4cc9f0;
    --transition: all 0.3s ease;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 12px 30px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-lg: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--light);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

/* 粒子背景 */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* 弹窗公告 */
.announcement-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.announcement-box {
    background: linear-gradient(145deg, #ffffff, #f8f9ff);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: modalFadeIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding-bottom: 60px;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-50px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.announcement-content {
    padding: 30px;
    text-align: center;
    font-size: 16px;
    line-height: 1.6;
    background: linear-gradient(145deg, #f0f0f0, #ffffff);
    border-radius: var(--radius);
    margin: 15px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.announcement-confirm {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-image: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(106, 17, 203, 0.3);
}

.announcement-confirm:hover {
    background-image: linear-gradient(45deg, var(--secondary), var(--primary));
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 117, 252, 0.4);
}

header {
    color: var(--white);
    padding: 180px 20px 100px;
    text-align: center;
    position: relative;
    background: transparent;
    clip-path: ellipse(120% 100% at 50% 0%);
}

header h1 {
    font-size: 3.8rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    animation: fadeInUp 0.8s ease-out;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

header p {
    font-size: 1.5rem;
    max-width: 800px;
    margin: 0 auto 40px;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease-out 0.2s;
    animation-fill-mode: both;
    font-weight: 300;
}

.btn-group {
    margin-top: 30px;
    animation: fadeInUp 0.8s ease-out 0.4s;
    animation-fill-mode: both;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
}

/* 按钮变体 */
.btn-primary, .btn-action {
    background-size: 300% 300%;
    color: var(--white);
    box-shadow: var(--shadow-md);
    animation: gradientBG var(--animation-speed) ease infinite;
}

.btn-primary {
    background-image: linear-gradient(45deg, var(--primary), var(--secondary));
}

.btn-secondary {
    background: rgba(255,255,255,0.15);
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(5px);
}

.btn-action {
    background-image: linear-gradient(45deg, var(--accent), #ff8e8e);
    animation-duration: calc(var(--animation-speed) * 0.75);
    margin-top: 30px;
    max-width: 200px;
    text-align: center;
}

@keyframes gradientBG {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.btn:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    background-image: linear-gradient(45deg, var(--secondary), var(--primary));
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.2);
    z-index: -1;
    transition: var(--transition);
    opacity: 0;
}

.btn:hover::after {
    opacity: 1;
}

section {
    padding: 120px 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: 70px;
    color: var(--dark);
    font-size: 2.8rem;
    position: relative;
    padding-bottom: 20px;
}

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

.section-subtitle {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
    font-size: 1.2rem;
    color: #666;
    font-weight: 400;
    line-height: 1.8;
}

/* 服务部分 */
.services-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.service-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 50px 30px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: translateY(-100%);
    transition: var(--transition);
    z-index: -1;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.service-card:hover::before {
    transform: translateY(0);
}

.service-icon {
    font-size: 3.8rem;
    margin-bottom: 25px;
    color: var(--primary);
    transition: var(--transition);
}

.service-card:hover .service-icon {
    color: var(--secondary);
    transform: scale(1.1);
}

.service-card h3 {
    color: var(--dark);
    margin-bottom: 20px;
    font-size: 1.8rem;
    transition: var(--transition);
}

.service-card:hover h3 {
    color: var(--primary);
}

.service-card p {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.8;
}

footer {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    color: var(--white);
    text-align: center;
    padding: 80px 20px 50px;
    margin-top: 100px;
    position: relative;
    clip-path: ellipse(120% 100% at 50% 100%);
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary));
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.social-links {
    margin: 40px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: var(--white);
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-5px);
}

.copyright {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    opacity: 0.7;
}

/* 图片展示区 */
.showcase-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.showcase-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    height: 300px;
    transform: perspective(1000px) rotateX(0) rotateY(0);
    transform-style: preserve-3d;
}

.showcase-item:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
    box-shadow: var(--shadow-lg);
}

.showcase-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.showcase-item:hover img {
    transform: scale(1.1);
}

.showcase-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: var(--white);
    padding: 25px;
    transform: translateY(100%);
    transition: var(--transition);
}

.showcase-item:hover .showcase-overlay {
    transform: translateY(0);
}

.showcase-overlay h3 {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
}

.showcase-overlay p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
}

/* 客户评价 */
.testimonials-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.testimonial-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px 30px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 6rem;
    color: rgba(106, 17, 203, 0.05);
    font-family: Georgia, serif;
    line-height: 1;
    pointer-events: none;
}

.testimonial-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.rating {
    color: #ffc107;
    font-size: 1.4rem;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.testimonial-card p {
    font-style: italic;
    margin-bottom: 25px;
    color: #555;
    font-size: 1.1rem;
    line-height: 1.7;
}

.client-info {
    display: flex;
    align-items: center;
}

.client-info img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 3px solid var(--primary);
}

.client-info div {
    display: flex;
    flex-direction: column;
}

.client-info strong {
    color: var(--dark);
    font-weight: 600;
    font-size: 1.2rem;
}

.client-info span {
    color: #666;
    font-size: 1rem;
}

/* 可访问性样式 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 键盘焦点样式 */
:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* 主题切换器 */
.theme-switcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    padding: 12px 15px;
    border-radius: 50px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition);
}

.theme-switcher:hover {
    box-shadow: var(--shadow-lg);
}

.theme-switcher i {
    margin-right: 10px;
    color: var(--primary);
    font-size: 1.2rem;
}

.theme-switcher select {
    border: none;
    background: transparent;
    padding: 5px;
    outline: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--dark);
    font-family: inherit;
    width: 120px;
}

/* 动画效果 */

/* 基础淡入动画（使用硬件加速） */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 向上淡入动画（使用硬件加速） */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 向左淡入动画 */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 向右淡入动画 */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 缩放淡入动画 */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 动画类 */
.animated {
    animation-duration: 0.8s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); /* 自定义缓动函数，提高动画流畅度 */
}

/* 元素特定动画 */
.animate-fade {
    animation-name: fadeIn;
}

.animate-fade-up {
    animation-name: fadeInUp;
}

.animate-fade-left {
    animation-name: fadeInLeft;
}

.animate-fade-right {
    animation-name: fadeInRight;
}

.animate-scale {
    animation-name: scaleIn;
}

/* 动画延迟类 */
.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }

/* 动画性能优化 */
.animated {
    will-change: opacity, transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 动画触发条件（滚动时） */
@media (prefers-reduced-motion: no-preference) {
    .animated {
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

/* 响应式设计 */

/* 平板设备 (768px 及以下) */
@media (max-width: 768px) {
    /* 通用响应式调整 */
    section {
        padding: 80px 20px;
    }
    
    /* 头部响应式 */
    header {
        padding: 120px 20px 80px;
        clip-path: ellipse(150% 100% at 50% 0%);
    }
    
    header h1 {
        font-size: 2.8rem;
    }
    
    header p {
        font-size: 1.3rem;
    }
    
    /* 按钮组响应式 */
    .btn-group {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* 确保次要按钮在移动端可见 */
    .btn-secondary {
        background: var(--primary);
        color: var(--white);
        border: 2px solid var(--primary-dark);
        backdrop-filter: none;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    
    .btn-secondary:hover {
        background: var(--primary-dark);
        border-color: var(--primary-darker);
    }
    
    /* 标题响应式 */
    .section-title {
        font-size: 2.3rem;
    }
    
    /* 网格布局响应式 */
    .services-container,
    .testimonials-container,
    .showcase-container {
        grid-template-columns: 1fr;
    }
    
    /* 主题切换器响应式 */
    .theme-switcher {
        bottom: 20px;
        right: 20px;
    }
    
    /* 服务卡片响应式 */
    .service-card {
        padding: 40px 25px;
    }
    
    /* 弹窗公告响应式 */
    .announcement-modal {
        padding: 30px 25px;
        margin: 20px;
    }
    
    /* 评价卡片响应式 */
    .testimonial-card {
        padding: 30px 25px;
    }
    
    /* 客户信息响应式 */
    .client-info {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .client-info img {
        margin-right: 0;
    }
}

/* 小屏平板 (640px 及以下) */
@media (max-width: 640px) {
    /* 头部进一步优化 */
    header h1 {
        font-size: 2.5rem;
    }
    
    header p {
        font-size: 1.2rem;
    }
    
    /* 粒子背景优化 */
    #particles-js {
        display: none;
    }
    
    /* 按钮样式优化 */
    .btn {
        max-width: 280px;
        font-size: 1rem;
        padding: 12px 30px;
    }
    
    /* 确保次要按钮在移动端可见 */
    .btn-secondary {
        background: var(--primary);
        color: var(--white);
        border: 2px solid var(--primary-dark);
        backdrop-filter: none;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    
    .btn-secondary:hover {
        background: var(--primary-dark);
        border-color: var(--primary-darker);
    }
    
    /* 卡片间距优化 */
    .service-card,
    .testimonial-card {
        margin-bottom: 30px;
    }
    
    /* 滚动条优化 */
    ::-webkit-scrollbar {
        width: 6px;
    }
}

/* 手机设备 (480px 及以下) */
@media (max-width: 480px) {
    /* 通用优化 */
    section {
        padding: 60px 15px;
    }
    
    /* 头部优化 */
    header {
        padding: 100px 15px 60px;
    }
    
    header h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }
    
    header p {
        font-size: 1.1rem;
        margin-top: 20px;
    }
    
    /* 标题优化 */
    .section-title {
        font-size: 2rem;
    }
    
    /* 按钮样式优化 */
    .btn {
        max-width: 250px;
        font-size: 0.95rem;
        padding: 11px 28px;
    }
    
    /* 弹窗优化 */
    .announcement-modal {
        padding: 25px 20px;
        margin: 15px;
    }
    
    /* 主题切换器优化 */
    .theme-switcher {
        bottom: 15px;
        right: 15px;
        padding: 10px 12px;
    }
    
    .theme-switcher select {
        width: 100px;
        font-size: 0.9rem;
    }
}

/* 小屏手机 (360px 及以下) */
@media (max-width: 360px) {
    /* 进一步压缩头部 */
    header h1 {
        font-size: 2rem;
    }
    
    /* 按钮组优化 */
    .btn-group {
        gap: 12px;
    }
    
    /* 卡片内边距优化 */
    .service-card,
    .testimonial-card {
        padding: 30px 20px;
    }
}