/* ============================================================
   守护地球 — 保护濒危动物 主题样式
   ============================================================ */

/* --- CSS 变量 --- */
:root {
    --primary: #2d8a4e;
    --primary-dark: #1b5e2a;
    --primary-light: #4caf50;
    --accent: #ff6f00;
    --accent-light: #ffa040;
    --danger: #d32f2f;
    --warning: #f9a825;
    --bg-light: #f1f8e9;
    --bg-cream: #fefaf3;
    --text-dark: #1a1a2e;
    --text-medium: #444;
    --text-light: #666;
    --text-muted: #999;
    --white: #ffffff;
    --border: #e0e0e0;
    --shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    background: var(--white);
    line-height: 1.7;
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

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

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

/* --- 导航栏 --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.logo-icon {
    font-size: 1.6rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-medium);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background: rgba(45, 138, 78, 0.08);
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 2.5px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero 区块 --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #1a3a1a 0%, #2d5a27 25%, #1a4d2e 50%, #0d3320 75%, #1a3a1a 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    overflow: hidden;
}

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

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(76, 175, 80, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 111, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, var(--white), transparent);
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.12;
    background-image:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 24px;
    animation: fadeInUp 1s ease-out;
}

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

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.title-line {
    color: var(--white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.title-line.accent {
    background: linear-gradient(135deg, var(--accent-light), #ffcc80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 40px;
    line-height: 1.8;
}

.hero-subtitle strong {
    color: var(--accent-light);
    font-weight: 700;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(45, 138, 78, 0.4);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(45, 138, 78, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--white);
    transform: translateY(-2px);
}

.hero-scroll {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

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

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

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

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.section-title.dark {
    color: var(--white);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.section-subtitle.dark {
    color: rgba(255, 255, 255, 0.75);
}

/* --- 关于我们 --- */
.about-section {
    background: var(--white);
}

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

.about-card {
    padding: 36px 28px;
    border-radius: var(--radius);
    background: var(--bg-light);
    border: 1px solid rgba(45, 138, 78, 0.1);
    transition: var(--transition);
}

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

.about-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.about-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.about-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* --- 濒危动物区块 --- */
.endangered-section {
    background: var(--bg-cream);
    position: relative;
    overflow: hidden;
}

.endangered-section::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(211, 47, 47, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

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

.endangered-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

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

.card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--white);
    background: var(--danger);
    letter-spacing: 0.5px;
}

.card-badge.warning {
    background: var(--warning);
    color: #333;
}

.card-image {
    height: 240px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.endangered-card:hover .card-image img {
    transform: scale(1.08);
}

.card-content {
    padding: 24px;
}

.card-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.scientific {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 2px;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #fafafa;
    border-radius: var(--radius-sm);
    margin: 14px 0;
}

.status-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.status-value {
    font-weight: 700;
    font-size: 0.95rem;
}

.critical-text { color: var(--danger); }
.warning-text { color: var(--warning); }

.card-content > p {
    font-size: 0.92rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 14px;
}

.threats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.threat-tag {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.78rem;
    font-weight: 500;
    background: #ffebee;
    color: #c62828;
}

/* --- 动物名录 --- */
.animals-section {
    background: var(--white);
}

.filter-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 10px 22px;
    border-radius: 25px;
    border: 1.5px solid var(--border);
    background: var(--white);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    color: var(--text-medium);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.animals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.animal-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

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

.animal-card.hidden {
    display: none;
}

.animal-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #e8f5e9;
}

.animal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.animal-card:hover .animal-image img {
    transform: scale(1.08);
}

.conservation-status {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--white);
}

.conservation-status.critically-endangered { background: var(--danger); }
.conservation-status.endangered { background: #e65100; }
.conservation-status.vulnerable { background: #f9a825; color: #333; }
.conservation-status.near-threatened { background: #5d9cec; }

.animal-info {
    padding: 20px;
}

.animal-info h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.scientific-name {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.animal-desc {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* --- 数据统计 --- */
.stats-section {
    background: linear-gradient(135deg, #1a3a2a, #1b5e20, #1a3a2a);
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Ccircle cx='20' cy='20' r='1'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

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

.stat-card {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--white);
    line-height: 1;
    margin-bottom: 4px;
    display: inline-block;
}

.stat-unit {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-light);
}

.stat-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 8px;
}

/* --- 如何帮助 --- */
.help-section {
    background: var(--bg-light);
}

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

.help-card {
    background: var(--white);
    padding: 32px 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.help-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
    transition: var(--transition);
}

.help-card:hover {
    transform: translateX(6px);
    box-shadow: var(--shadow-lg);
}

.help-card:hover::before {
    width: 6px;
}

.help-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: rgba(45, 138, 78, 0.12);
    line-height: 1;
    margin-bottom: 12px;
}

.help-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.help-card p {
    font-size: 0.92rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* --- 联系我们 --- */
.contact-section {
    background: var(--white);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 50px;
    align-items: start;
}

.contact-info h3,
.contact-form h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-dark);
}

.contact-item {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.contact-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 12px;
}

.contact-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.contact-item p {
    font-size: 0.9rem;
    color: var(--text-light);
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.social-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 12px;
    font-size: 1.3rem;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    background: #fafafa;
    color: var(--text-dark);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.btn-submit {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 1.05rem;
}

/* --- 页脚 --- */
.footer {
    background: #102016;
    color: rgba(255, 255, 255, 0.7);
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 16px;
}

.footer h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 12px;
}

.footer-about p {
    font-size: 0.9rem;
    line-height: 1.7;
}

.footer-links ul li {
    margin-bottom: 8px;
}

.footer-links ul li a {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition);
}

.footer-links ul li a:hover {
    color: var(--primary-light);
    padding-left: 4px;
}

.footer-newsletter p {
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.newsletter-form {
    display: flex;
    gap: 8px;
}

.newsletter-form input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    font-family: inherit;
    font-size: 0.9rem;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary-light);
}

.newsletter-form button {
    padding: 10px 20px;
    border-radius: 25px;
    border: none;
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background: var(--primary-dark);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

/* --- 聊天机器人 --- */
.chatbot-widget {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 999;
}

.chatbot-toggle {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: var(--white);
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(45, 138, 78, 0.4);
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 30px rgba(45, 138, 78, 0.5);
}

.chatbot-icon {
    font-size: 1.8rem;
}

.chatbot-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--danger);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
}

.chatbot-badge.visible {
    display: flex;
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 560px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.chatbot-window.open {
    transform: scale(1);
    pointer-events: all;
}

.chatbot-header {
    background: var(--primary);
    color: var(--white);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.2);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-header-info h4 {
    font-size: 1rem;
    font-weight: 600;
}

.chatbot-status {
    font-size: 0.78rem;
    opacity: 0.8;
}

.chatbot-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #69f0ae;
    margin-right: 6px;
}

.chatbot-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
    padding: 4px;
}

.chatbot-close:hover {
    opacity: 1;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8faf8;
}

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #c8e6c9;
    border-radius: 3px;
}

.message {
    display: flex;
    gap: 10px;
    animation: messageIn 0.3s ease-out;
}

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

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    background: #e8f5e9;
}

.message.user .message-avatar {
    background: var(--primary-light);
    color: var(--white);
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.6;
}

.message.bot .message-content {
    background: var(--white);
    border-top-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.message.user .message-content {
    background: var(--primary);
    color: var(--white);
    border-top-right-radius: 4px;
}

.message-content p {
    margin-bottom: 6px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin: 6px 0;
    padding-left: 16px;
    list-style: none;
}

.message-content ul li {
    margin-bottom: 3px;
    font-size: 0.85rem;
}

.chatbot-input-area {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    background: var(--white);
}

.chatbot-input {
    flex: 1;
    padding: 10px 16px;
    border: 1.5px solid var(--border);
    border-radius: 25px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    background: #fafafa;
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--white);
}

.chatbot-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-send:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* --- 返回顶部 --- */
.back-to-top {
    position: fixed;
    bottom: 110px;
    right: 38px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--white);
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.back-to-top:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-3px);
}

/* --- 响应式 --- */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        padding: 100px 24px 40px;
        gap: 0;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-link {
        display: block;
        padding: 14px 0;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        font-size: 1.05rem;
    }

    .hamburger {
        display: flex;
    }

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

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

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

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

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

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

    .filter-bar {
        gap: 6px;
    }

    .filter-btn {
        padding: 8px 14px;
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    section {
        padding: 60px 0;
    }

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

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

    .back-to-top {
        bottom: 100px;
        right: 16px;
    }

    .chatbot-toggle {
        right: 12px;
        bottom: 20px;
        width: 54px;
        height: 54px;
    }
}
