/* ===== 基础重置 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #faf9f6;
    --bg-secondary: #ffffff;
    --pink: #e8b4b8;
    --purple: #d4c5f9;
    --text-primary: #2d2a26;
    --text-secondary: #6b6560;
    --text-light: #9e9790;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Noto Serif SC', 'Georgia', serif;
    font-weight: 600;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== 导航栏 ===== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    background: transparent;
}

nav.scrolled {
    background: rgba(250, 249, 246, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    padding: 12px 40px;
}

.nav-logo {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    opacity: 0.9;
    transition: var(--transition);
}

nav.scrolled .nav-logo {
    opacity: 1;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
    position: relative;
    padding: 4px 0;
    transition: var(--transition);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--pink), var(--purple));
    border-radius: 1px;
    transition: width 0.3s ease;
}

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

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: var(--transition);
}

/* ===== 首屏 Hero ===== */
#hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#hero video,
#hero img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(250, 249, 246, 0.55);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 600px;
    padding: 0 24px;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: 0.05em;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: var(--text-secondary);
    margin-bottom: 36px;
    font-weight: 300;
    letter-spacing: 0.08em;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    transition: var(--transition);
}

.hero-cta:hover {
    background: var(--pink);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.mouse {
    width: 24px;
    height: 38px;
    border: 2px solid var(--text-light);
    border-radius: 12px;
    position: relative;
}

.mouse::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 8px;
    background: var(--text-light);
    border-radius: 2px;
    animation: mouseScroll 1.5s ease-in-out infinite;
}

@keyframes mouseScroll {
    0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.3; transform: translateX(-50%) translateY(8px); }
}

/* ===== 区块通用 ===== */
section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-tag {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 500;
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== 关于我 ===== */
#about {
    background: var(--bg-secondary);
}

.about-grid {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-avatar {
    flex-shrink: 0;
    text-align: center;
}

.avatar-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: var(--shadow-md);
}

.avatar-emoji {
    font-size: 4rem;
    line-height: 1;
}

.avatar-name {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.about-content {
    flex: 1;
}

.about-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 2;
    margin-bottom: 24px;
}

.about-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    padding: 6px 16px;
    background: var(--bg-primary);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border: 1px solid rgba(0,0,0,0.06);
    transition: var(--transition);
}

.tag:hover {
    border-color: var(--pink);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* ===== 服务板块 ===== */
#services {
    background: var(--bg-primary);
}

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

.service-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 36px 28px;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.04);
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.service-icon {
    font-size: 2.2rem;
    margin-bottom: 16px;
}

.service-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.service-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== 联系板块 ===== */
#contact {
    background: var(--bg-secondary);
}

.contact-content {
    text-align: center;
}

.contact-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.contact-methods {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    background: var(--bg-primary);
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.04);
}

.contact-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    border-color: var(--pink);
}

.contact-icon {
    font-size: 1.3rem;
}

/* ===== 页脚 ===== */
footer {
    padding: 32px 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    background: var(--bg-primary);
    border-top: 1px solid rgba(0,0,0,0.04);
}

/* ===== 滚动动画 ===== */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
}

[data-animate="fade-right"] {
    transform: translateX(-30px);
}

[data-animate="fade-left"] {
    transform: translateX(30px);
}

[data-animate].visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* ===== AI 客服浮窗 ===== */
.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.chat-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    white-space: nowrap;
}

.chat-toggle:hover {
    background: var(--pink);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.chat-icon {
    font-size: 1.2rem;
}

.chat-window {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 380px;
    max-height: 520px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
}

.chat-window.open {
    display: flex;
    animation: chatSlideIn 0.3s ease;
}

@keyframes chatSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.chat-avatar-small {
    font-size: 1.5rem;
}

.chat-header-info strong {
    display: block;
    font-size: 0.95rem;
}

.chat-status {
    font-size: 0.7rem;
    opacity: 0.85;
}

.chat-close {
    background: rgba(255,255,255,0.3);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.chat-close:hover {
    background: rgba(255,255,255,0.5);
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    max-height: 360px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--pink);
    border-radius: 2px;
}

.message {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.bot-message {
    flex-direction: row;
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.message-bubble {
    max-width: 260px;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.6;
}

.bot-message .message-bubble {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.user-message .message-bubble {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-bottom-right-radius: 4px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-light);
    border-radius: 50%;
    animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid rgba(0,0,0,0.06);
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input-area input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 24px;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    background: var(--bg-primary);
}

.chat-input-area input:focus {
    border-color: var(--pink);
}

.chat-input-area button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--text-primary);
    color: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.chat-input-area button:hover {
    background: var(--pink);
    color: var(--text-primary);
}

.chat-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    nav {
        padding: 14px 20px;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(250, 249, 246, 0.97);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 28px;
    }

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

    .nav-links a {
        font-size: 1.2rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .about-grid {
        flex-direction: column;
        text-align: center;
        gap: 32px;
    }

    .about-tags {
        justify-content: center;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .chat-window {
        width: calc(100vw - 32px);
        right: -8px;
    }

    section {
        padding: 60px 0;
    }
}
