/* style.css - 开云 Kaiyun 官方网站 */

/* ===== CSS Variables & Reset ===== */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #4a90e2;
    --bg: #ffffff;
    --bg-alt: #f5f7fa;
    --text: #1f2937;
    --text-light: #6b7280;
    --radius: 16px;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --glass: rgba(255,255,255,0.7);
    --gradient: linear-gradient(135deg, #1a73e8 0%, #6c63ff 100%);
    --transition: 0.3s ease;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --glass: rgba(15,23,42,0.8);
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
    scroll-behavior: smooth;
}

a {
    color: var(--primary);
    text-decoration: none;
}

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

/* ===== Layout Utilities ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-desc {
    text-align: center;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 3rem;
}

/* ===== Grid Systems ===== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* ===== Card Component ===== */
.card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
    border: 1px solid rgba(255,255,255,0.2);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

[data-theme="dark"] .card {
    border-color: rgba(255,255,255,0.1);
}

/* ===== Button ===== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--gradient);
    color: #fff;
    border-radius: 30px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.2s, box-shadow 0.3s;
}

.btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(26,115,232,0.3);
}

/* ===== Badge ===== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-light);
    color: #fff;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===== Header & Navigation ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.15);
    transition: background 0.3s;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    color: var(--text);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text);
    padding: 4px;
}

.dark-toggle {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text);
    padding: 4px;
    transition: transform 0.3s;
}

.dark-toggle:hover {
    transform: rotate(20deg);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--gradient);
    color: #fff;
    padding: 120px 20px 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.15) 0%, transparent 60%);
    animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% { transform: translate(0,0); }
    100% { transform: translate(20px,20px); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero .btn-outline {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
}

.hero .btn-outline:hover {
    background: #fff;
    color: var(--primary);
    transform: scale(1.02);
}

/* ===== Banner Carousel ===== */
.banner-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 800px;
    margin: 40px auto 0;
    border-radius: var(--radius);
}

.banner-slides {
    display: flex;
    transition: transform 0.6s ease;
}

.banner-slide {
    min-width: 100%;
    padding: 40px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius);
    text-align: center;
}

.banner-slide h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.banner-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.banner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.banner-dot.active {
    background: #fff;
    transform: scale(1.2);
}

/* ===== Scroll Animation (fade-up) ===== */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Number Counter ===== */
.counter-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== FAQ ===== */
.faq-item {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding: 16px 0;
    cursor: pointer;
    transition: background 0.3s;
}

[data-theme="dark"] .faq-item {
    border-color: rgba(255,255,255,0.1);
}

.faq-item:hover {
    background: rgba(26,115,232,0.03);
}

.faq-question {
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
}

.faq-question span {
    font-size: 1.5rem;
    transition: transform 0.3s;
}

.faq-item.open .faq-question span {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s;
    color: var(--text-light);
    line-height: 1.7;
}

.faq-item.open .faq-answer {
    max-height: 300px;
    padding-top: 12px;
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 999;
}

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

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(26,115,232,0.3);
}

/* ===== Footer ===== */
footer {
    background: var(--bg-alt);
    padding: 40px 0;
    margin-top: 40px;
    transition: background 0.3s;
}

[data-theme="dark"] footer {
    background: #0f172a;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
}

.footer-grid h4 {
    margin-bottom: 12px;
    color: var(--text);
}

.footer-grid a {
    display: block;
    color: var(--text-light);
    margin-bottom: 6px;
    transition: color 0.3s, padding-left 0.3s;
}

.footer-grid a:hover {
    color: var(--primary);
    padding-left: 4px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(0,0,0,0.1);
    margin-top: 30px;
    color: var(--text-light);
    font-size: 0.9rem;
}

[data-theme="dark"] .footer-bottom {
    border-color: rgba(255,255,255,0.1);
}

/* ===== Search Box ===== */
.search-box {
    display: flex;
    gap: 8px;
    max-width: 400px;
    margin: 20px auto;
}

.search-box input {
    flex: 1;
    padding: 10px 16px;
    border-radius: 30px;
    border: 1px solid #ddd;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.3s, box-shadow 0.3s;
}

[data-theme="dark"] .search-box input {
    border-color: #334155;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

.search-box button {
    padding: 10px 20px;
    border-radius: 30px;
    background: var(--gradient);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.2s;
}

.search-box button:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        background: var(--bg);
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        padding: 20px;
        box-shadow: var(--shadow);
        border-radius: 0 0 var(--radius) var(--radius);
    }

    .nav-links.open {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section {
        padding: 50px 0;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        gap: 16px;
    }

    .card {
        padding: 20px;
    }

    .banner-slide {
        padding: 20px;
    }

    .banner-slide h3 {
        font-size: 1.3rem;
    }

    .counter-number {
        font-size: 2rem;
    }

    .footer-grid {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.6rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 250px;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box input,
    .search-box button {
        width: 100%;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* ===== Additional Hover Effects ===== */
.card h3 {
    transition: color 0.3s;
}

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

/* ===== Smooth Section Background Transitions ===== */
.section:nth-child(even) {
    background: var(--bg-alt);
}

[data-theme="dark"] .section:nth-child(even) {
    background: var(--bg-alt);
}