/* ====== 基础变量 ====== */
:root {
    --bg: #FAF7F2;
    --text: #3D3226;
    --text-muted: #6B5F52;
    --white: #ffffff;
    --navy: #3C2415;
    --navy-dark: #2D1A0E;
    --accent: #C8A45C;
    --accent-hover: #B89341;
    --border: #E8E0D4;
    --shadow-card: 0 8px 25px -8px rgba(60, 36, 21, 0.10);
    --shadow-subtle: 0 2px 8px -2px rgba(60, 36, 21, 0.05);
    --radius: 0.75rem;
    --font-heading: "Georgia", "Noto Serif SC", "STSong", "Songti SC", serif;
    --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

/* ====== 导航栏 ====== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.nav.scrolled {
    border-bottom-color: var(--border);
}

.nav-brand {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    color: var(--navy);
    letter-spacing: -0.3px;
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a.active {
    color: var(--accent);
    font-weight: 600;
}

/* ====== Hero 主视觉 ====== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, var(--navy), var(--navy-dark));
    color: #fff;
    padding: 120px 24px 80px;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, transparent, var(--navy-dark) 80%);
    pointer-events: none;
}

.hero-content {
    max-width: 640px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-avatar {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 15%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 36px;
    box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.4);
}

.hero-greeting {
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent);
    margin-bottom: 20px;
}

.hero-name {
    font-family: var(--font-heading);
    font-size: 64px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 400;
    color: #C8A45C;
    margin-bottom: 28px;
}

.hero-tagline {
    font-size: 16px;
    line-height: 1.7;
    color: #D4C5B0;
    margin-bottom: 12px;
}

.hero-location {
    font-size: 14px;
    font-weight: 500;
    color: #A89880;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 40px;
}

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

/* ====== 按钮 ====== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.25s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px -8px rgba(200, 164, 92, 0.25);
}

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

.btn-outline:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* On light backgrounds (cards, sections), invert to dark */
.card .btn-outline,
.section-alt .btn-outline {
    color: var(--accent);
    border-color: var(--accent);
}
.card .btn-outline:hover,
.section-alt .btn-outline:hover {
    background: rgba(200, 164, 92, 0.06);
    border-color: var(--accent-hover);
    color: var(--accent-hover);
}

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

.section-alt {
    background: var(--white);
}

.container {
    max-width: 880px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 600;
    color: var(--navy);
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.section-desc {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 48px;
    font-size: 16px;
}

/* ====== 卡片 ====== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 640px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .hero-avatar {
        width: 180px;
        height: 180px;
    }

    .hero-name {
        font-size: 40px;
    }

    .nav {
        padding: 14px 20px;
    }
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-subtle);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

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

.card h4 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 12px;
}

.card p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
}

/* ====== Project Brand Header ====== */
.project-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.project-logo {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-brand-text h4 {
    margin-bottom: 2px;
}

.project-tagline {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.3px;
}

.card strong {
    color: var(--navy);
}

.inline-link {
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
}
.inline-link:hover {
    color: var(--accent-hover);
}

/* ====== 研究方向 ====== */
.research-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .research-grid {
        grid-template-columns: 1fr;
    }
}

.research-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-subtle);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.research-card:hover {
    box-shadow: var(--shadow-card);
    transform: translateY(-3px);
}

.research-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 14px;
}

.research-card h4 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 10px;
}

.research-card p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
}

/* ====== 时间线 ====== */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 640px) {
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

.timeline-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-top: 4px;
}

.timeline-content {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: box-shadow 0.3s ease;
}

.timeline-content:hover {
    box-shadow: var(--shadow-card);
}

.timeline-content h4 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 4px;
}

.timeline-org {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 10px;
}

.timeline-content p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
}

/* ====== 语言 ====== */
.lang-grid {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 12px 24px;
    transition: border-color 0.25s ease;
}

.lang-item:hover {
    border-color: var(--accent);
}

.lang-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--navy);
}

.lang-level {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.lang-level.native,
.lang-level.fluent {
    color: #5B8C5A;
}

/* ====== 联系链接 ====== */
.contact-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 640px) {
    .contact-links {
        grid-template-columns: 1fr;
    }
}

.contact-link {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    transition: all 0.25s ease;
}

.contact-link:hover {
    border-color: var(--accent);
    background: rgba(200, 164, 92, 0.06);
    color: var(--accent);
}

.contact-link strong {
    display: block;
    color: var(--navy);
    margin-bottom: 2px;
    font-size: 14px;
}

.contact-detail {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    word-break: break-all;
}

.contact-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ====== 页脚 ====== */
.footer {
    padding: 32px 24px;
    text-align: center;
    background: var(--navy);
    color: #C8B898;
    font-size: 13px;
}

/* ====== AI Chat: Floating Button ====== */
.chat-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(200, 164, 92, 0.30);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    animation: fabPulse 3s ease-in-out infinite;
}

@keyframes fabPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(200, 164, 92, 0.30); }
    50% { box-shadow: 0 4px 32px rgba(200, 164, 92, 0.45); }
}

.chat-fab:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 36px rgba(200, 164, 92, 0.40);
    background: var(--accent-hover);
    animation: none;
}

.chat-fab-icon--close { display: none; }
.chat-fab.is-open .chat-fab-icon--open { display: none; }
.chat-fab.is-open .chat-fab-icon--close { display: inline; }
.chat-fab.is-open {
    background: var(--accent);
    animation: none;
}

/* ====== AI Chat: Overlay ====== */
.chat-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.chat-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* ====== AI Chat: Modal ====== */
.chat-modal {
    width: 420px;
    max-height: 580px;
    height: calc(100vh - 80px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-overlay.is-open .chat-modal {
    transform: translateY(0) scale(1);
}

/* ====== AI Chat: Header ====== */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--navy);
    color: #fff;
    flex-shrink: 0;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.chat-subtitle {
    font-size: 11px;
    color: #C8B898;
    margin-top: 2px;
}

.chat-close {
    background: none;
    border: none;
    color: #C8B898;
    font-size: 28px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.chat-close:hover { color: #fff; }

/* ====== AI Chat: Body ====== */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #FAF7F2;
}

.chat-body::-webkit-scrollbar { width: 5px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }
.chat-body::-webkit-scrollbar-thumb { background: #D4C5B0; border-radius: 10px; }

/* ====== AI Chat: Messages ====== */
.chat-message {
    display: flex;
    max-width: 88%;
    animation: chatSlideIn 0.3s ease;
}

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

.chat-message--user {
    align-self: flex-end;
}

.chat-message--bot {
    align-self: flex-start;
}

.chat-bubble {
    padding: 10px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}

.chat-message--bot .chat-bubble {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 6px;
}

.chat-message--user .chat-bubble {
    background: var(--navy);
    color: #fff;
    border-bottom-right-radius: 6px;
}

/* ====== AI Chat: Typing dots ====== */
.chat-message--typing .chat-bubble {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 18px;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #B8AA98;
    animation: dotBounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.16s; }
.dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.6); }
    40% { transform: scale(1); }
}

/* ====== AI Chat: Preset questions ====== */
.chat-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.chat-preset {
    padding: 8px 16px;
    border: 1px solid #D4C5B0;
    border-radius: 20px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chat-preset:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(200, 164, 92, 0.08);
}

/* ====== AI Chat: Footer ====== */
.chat-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: #fff;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 10px 18px;
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s ease;
    color: var(--text);
    background: #FAF7F2;
}

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

.chat-input::placeholder {
    color: #C8B898;
}

.chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.15s ease;
}

.chat-send:hover {
    background: var(--accent-hover);
    transform: scale(1.06);
}

.chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ====== AI Chat: Mobile ====== */
@media (max-width: 480px) {
    .chat-fab {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .chat-modal {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
        transform: translateY(30px);
    }

    .chat-overlay.is-open .chat-modal {
        transform: translateY(0);
    }
}

/* ====== Scroll Reveal Animation ====== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for cards */
.reveal:nth-child(1) { transition-delay: 0s; }
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.15s; }
.reveal:nth-child(5) { transition-delay: 0.25s; }
.reveal:nth-child(6) { transition-delay: 0.3s; }

/* ====== Brand Strip ====== */
.brand-strip {
    padding: 28px 24px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.brand-list {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    max-width: 880px;
    margin: 0 auto;
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    transition: color 0.25s ease;
    cursor: default;
}

.brand-name:hover {
    color: var(--navy);
}

.brand-dot {
    color: #C8B898;
    font-size: 14px;
    user-select: none;
}

@media (max-width: 640px) {
    .brand-strip {
        padding: 22px 16px;
    }

    .brand-list {
        gap: 4px 12px;
    }

    .brand-name {
        font-size: 13px;
    }

    .brand-dot {
        font-size: 12px;
    }
}

/* ====== Stats Bar (Hero bottom) ====== */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    max-width: 720px;
    margin: 48px auto 0;
    background: rgba(200, 164, 92, 0.15);
    border-radius: var(--radius);
    overflow: hidden;
}

.stat-item {
    text-align: center;
    padding: 28px 20px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-number sup {
    font-size: 28px;
    font-weight: 400;
    vertical-align: top;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #C8B898;
}

@media (max-width: 640px) {
    .stats-bar {
        grid-template-columns: 1fr;
        gap: 1px;
    }

    .stat-item {
        padding: 20px 16px;
    }

    .stat-number {
        font-size: 36px;
    }
}

/* ====== Back to Top ====== */
.back-to-top {
    position: fixed;
    bottom: 96px;
    right: 34px;
    z-index: 998;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--white);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, box-shadow 0.25s ease;
    box-shadow: var(--shadow-subtle);
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    box-shadow: var(--shadow-card);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* ====== AI Chat FAB: Pill mode (desktop) ====== */
@media (min-width: 481px) {
    .chat-fab {
        width: auto;
        height: auto;
        border-radius: 28px;
        padding: 12px 22px;
        gap: 10px;
    }

    .chat-fab-icon--open,
    .chat-fab-icon--close {
        width: 20px;
        height: 20px;
    }

    .chat-fab-text {
        display: inline;
        font-family: var(--font-body);
        font-size: 14px;
        font-weight: 500;
        letter-spacing: 0.2px;
    }
}

.chat-fab-text { display: none; }

@media (max-width: 480px) {
    .back-to-top {
        bottom: 84px;
        right: 24px;
    }
}
