/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --accent-color: #10b981;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background: var(--bg-primary);
}

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

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all 0.3s ease;
}

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

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

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

.logo-text {
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

.nav-actions {
    display: flex;
    gap: 10px;
}

.btn-login,
.btn-register {
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid #e5e7eb;
}

.btn-login:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-register {
    background: var(--primary-color);
    color: white;
}

.btn-register:hover {
    background: var(--primary-dark);
}

/* 英雄区域 */
.hero {
    padding: 120px 20px 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 30px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 50px;
}

.btn-primary,
.btn-secondary {
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hero-stats {
    display: flex;
    gap: 40px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 浮动卡片 */
.hero-image {
    position: relative;
    height: 400px;
}

.floating-card {
    position: absolute;
    background: white;
    color: var(--text-primary);
    padding: 15px 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    font-weight: 600;
    animation: float 3s ease-in-out infinite;
}

.floating-card span {
    margin-right: 8px;
}

.card-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.card-2 {
    top: 50%;
    right: 10%;
    animation-delay: 1s;
}

.card-3 {
    bottom: 20%;
    left: 30%;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* 通用区块样式 */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* AI咨询区域 */
.ai-chat-section {
    padding: 80px 20px;
    background: var(--bg-secondary);
}

.chat-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    height: 600px;
}

.chat-sidebar {
    background: #f8f9fa;
    padding: 30px 20px;
    overflow-y: auto;
}

.chat-mode-select h3,
.quick-topics h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.mode-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.mode-option:hover {
    background: white;
}

.mode-option.active {
    background: white;
    border-color: var(--primary-color);
}

.mode-option input {
    display: none;
}

.mode-icon {
    font-size: 1.5rem;
}

.mode-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.mode-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

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

.topic-tag {
    padding: 6px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.topic-tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 聊天主区域 */
.chat-main {
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chat-avatar {
    font-size: 2rem;
}

.chat-header-info h4 {
    font-size: 1rem;
    color: var(--text-primary);
}

.status {
    font-size: 0.85rem;
    color: var(--accent-color);
}

.btn-clear {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fafafa;
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

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

.message-avatar {
    font-size: 1.5rem;
    min-width: 40px;
}

.message-content {
    background: white;
    padding: 15px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    max-width: 70%;
}

.ai-message .message-content {
    background: white;
}

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

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

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

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

/* 聊天输入区域 */
.chat-input-area {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#userInput {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    transition: border-color 0.3s ease;
    max-height: 120px;
}

#userInput:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-send {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.input-tips {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 心理知识库 */
.knowledge-section {
    padding: 80px 20px;
    background: white;
}

.search-box {
    max-width: 800px;
    margin: 0 auto 50px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-lg);
    padding: 5px 5px 5px 20px;
    transition: border-color 0.3s ease;
    margin-bottom: 20px;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary-color);
}

.search-icon {
    color: var(--text-secondary);
    min-width: 20px;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
}

.btn-search {
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-search:hover {
    background: var(--primary-dark);
}

.search-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

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

/* 知识卡片网格 */
.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.knowledge-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

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

.card-image {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon {
    font-size: 4rem;
}

.card-content {
    padding: 20px;
}

.card-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.tag {
    padding: 4px 10px;
    background: #f3f4f6;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.card-content h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.card-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-read {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.btn-read:hover {
    color: var(--primary-dark);
}

.load-more {
    text-align: center;
    margin-top: 50px;
}

.btn-load-more {
    padding: 14px 40px;
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-load-more:hover {
    background: var(--primary-color);
    color: white;
}

/* 心理资源 */
.resources-section {
    padding: 80px 20px;
    background: var(--bg-secondary);
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.resource-card {
    background: white;
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

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

.resource-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.resource-card h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.resource-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.btn-resource {
    display: inline-block;
    padding: 10px 25px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-resource:hover {
    background: var(--primary-dark);
}

/* 关于我们 */
.about-section {
    padding: 80px 20px;
    background: white;
}

.about-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.about-text > p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 30px;
}

.about-features {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.feature-item {
    display: flex;
    gap: 15px;
}

.feature-icon {
    font-size: 2rem;
    min-width: 50px;
}

.feature-item h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.feature-item p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.testimonial-card {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.testimonial-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.testimonial-avatar {
    font-size: 2.5rem;
}

.testimonial-header div {
    display: flex;
    flex-direction: column;
}

.testimonial-header strong {
    color: var(--text-primary);
}

.testimonial-header span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.testimonial-card > p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    font-style: italic;
}

/* 页脚 */
.footer {
    background: #1f2937;
    color: white;
    padding: 60px 20px 30px;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.footer-brand p {
    color: #9ca3af;
    line-height: 1.6;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.footer-links ul {
    list-style: none;
}

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

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.footer-contact p {
    color: #9ca3af;
    margin-bottom: 10px;
}

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

.social-link {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: white;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 30px;
    border-top: 1px solid #374151;
    text-align: center;
}

.footer-bottom p {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.footer-bottom a {
    color: #9ca3af;
    text-decoration: none;
}

.footer-bottom a:hover {
    color: white;
}

.disclaimer {
    color: #fbbf24 !important;
    font-size: 0.85rem !important;
}

/* 紧急求助按钮 */
.emergency-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #ef4444;
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 999;
}

.emergency-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 30px rgba(239, 68, 68, 0.4);
}

/* 紧急求助弹窗 */
.emergency-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.emergency-modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    padding: 30px;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.emergency-warning {
    color: #ef4444;
    font-weight: 600;
    margin-bottom: 20px;
}

.hotline-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.hotline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #fef2f2;
    border-radius: var(--radius-sm);
    border: 1px solid #fecaca;
}

.hotline-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ef4444;
}

.emergency-note {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 968px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-image {
        display: none;
    }

    .chat-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .chat-sidebar {
        display: none;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

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

    .nav-menu {
        display: none;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

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

    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }

    .emergency-fab {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
    }

    .fab-text {
        display: none;
    }
}
