/* =========================================
   全局变量与基础设置
========================================= */
:root {
    --primary-color: #3b82f6; 
    --bg-mint: #f0fdf4;       
    --card-bg: #ffffff;
    --text-main: #334155;     
    --text-light: #64748b;
    --alert-red: #ef4444;     
    --warm-yellow: #fef3c7;
}

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

body {
    font-family: 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-mint);
    line-height: 1.6;
}
body.bg-gray { background-color: #f8fafc; }

a { text-decoration: none; color: inherit; }
li { list-style: none; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; }

/* 优化后的大标题：舒缓、高级、有呼吸感 */
.section-title { 
    text-align: center; 
    margin: 40px 0 25px; 
    font-size: 1.65rem; 
    font-weight: 600; 
    letter-spacing: 2px; 
    color: var(--primary-color); 
}

/* =========================================
   头部导航与 SOS 按钮
========================================= */
.main-header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}
.logo { font-size: 1.5rem; font-weight: bold; color: var(--primary-color); }

.main-nav ul { display: flex; gap: 20px; }
.main-nav a { padding: 10px; transition: color 0.3s; }
.main-nav a:hover, .main-nav a.active { color: var(--primary-color); font-weight: bold; border-bottom: 2px solid var(--primary-color); }

.header-actions { display: flex; align-items: center; gap: 15px; }
.mobile-menu-btn { display: none; font-size: 1.8rem; cursor: pointer; color: var(--primary-color); user-select: none; transition: transform 0.3s; }

.sos-btn {
    background-color: #ef4444; 
    color: white;
    padding: 6px 16px;
    border-radius: 20px; 
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25); 
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}
.sos-btn:hover { background-color: #dc2626; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4); }

/* =========================================
   主视觉纯色轮播区
========================================= */
.pure-carousel { position: relative; height: 350px; overflow: hidden; }
.pure-carousel .slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center; text-align: center;
    opacity: 0; transition: opacity 1.2s ease-in-out; z-index: 0;
}
.pure-carousel .slide.active { opacity: 1; z-index: 1; }

.bg-mint { background-color: #eef7f2; }  
.bg-blue { background-color: #f0f7ff; }  
.bg-beige { background-color: #fffaf0; } 

.pure-carousel .hero-content h1 { font-size: 2.8rem; color: #1e293b; margin-bottom: 15px; letter-spacing: 2px; transform: translateY(20px); transition: all 1s ease-out; }
.pure-carousel .hero-content p { font-size: 1.3rem; color: #475569; font-weight: 400; transform: translateY(20px); transition: all 1s ease-out 0.3s; }
.pure-carousel .slide.active .hero-content h1, .pure-carousel .slide.active .hero-content p { transform: translateY(0); }

/* =========================================
   首页四大快捷入口
========================================= */
.quick-links {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
    margin-top: -40px; position: relative; z-index: 10;
}
.card {
    display: block; background-color: var(--card-bg); padding: 30px 20px; border-radius: 12px;
    text-align: center; box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.card-icon { font-size: 3rem; margin-bottom: 15px; }
.card h3 { margin-bottom: 10px; font-size: 1.2rem; }
.card p { font-size: 0.9rem; color: var(--text-light); }

/* =========================================
   内容卡片区 (科普文章 & 动态)
========================================= */
.knowledge-section { background-color: white; padding: 40px 0; margin-top: 50px; }
.tabs { display: flex; justify-content: center; gap: 15px; margin-bottom: 20px; }
.tab-btn { padding: 10px 25px; border: none; border-radius: 20px; background-color: var(--bg-mint); cursor: pointer; font-size: 1rem; color: var(--text-main); transition: all 0.3s; }
.tab-btn.active, .tab-btn:hover { background-color: var(--primary-color); color: white; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.article-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; padding-top: 10px; }
.article-card {
    background: white; border-radius: 12px; padding: 20px; display: flex; align-items: flex-start; gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04); transition: all 0.3s ease; border: 1px solid transparent;
}
.article-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(59, 130, 246, 0.1); border-color: #bfdbfe; }
.article-icon { font-size: 2.2rem; background: var(--bg-mint); width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; border-radius: 12px; flex-shrink: 0; }
.article-info h4 { font-size: 1.05rem; color: var(--text-main); margin-bottom: 6px; }
.article-info p { font-size: 0.85rem; color: var(--text-light); margin-bottom: 10px; line-height: 1.5; }
.read-more { font-size: 0.85rem; color: var(--primary-color); font-weight: bold; }

/* 心理动态列表 */
.news-section { padding: 40px 0; }
.news-list { display: flex; flex-direction: column; gap: 15px; }
.news-item { background-color: white; padding: 15px; border-radius: 12px; display: flex; align-items: center; gap: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); transition: all 0.3s; }
.news-item:hover { transform: translateX(5px); box-shadow: 0 5px 15px rgba(0,0,0,0.08); background-color: #f8fafc; }
.news-date-box { background: linear-gradient(135deg, var(--primary-color), #60a5fa); color: white; min-width: 65px; height: 70px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2); flex-shrink: 0; }
.news-date-box .day { font-size: 1.4rem; font-weight: bold; line-height: 1.1; }
.news-date-box .month { font-size: 0.8rem; opacity: 0.9; margin-top: 2px; }
.news-title { font-size: 1.05rem; font-weight: 500; line-height: 1.45; color: #334155; margin-bottom: 6px; transition: color 0.3s; }
.news-item:hover .news-title { color: var(--primary-color); }
.news-desc { font-size: 0.85rem; color: #64748b; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-arrow { color: #cbd5e1; font-size: 1.2rem; font-weight: bold; transition: all 0.3s; }
.news-item:hover .news-arrow { color: var(--primary-color); transform: translateX(3px); }

/* =========================================
   在线预约表单
========================================= */
.appointment-section { padding: 40px 0; display: flex; justify-content: center; }
.appointment-card { background-color: var(--card-bg); width: 100%; max-width: 650px; padding: 40px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.appointment-subtitle { text-align: center; color: var(--text-light); margin-bottom: 30px; font-size: 0.95rem; }
.form-group { margin-bottom: 25px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 10px; }
.appointment-form input[type="text"], .appointment-form textarea, .appointment-form select { width: 100%; padding: 12px 15px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 1rem; background-color: #f8fafc; transition: border-color 0.3s; font-family: inherit;}
.appointment-form input[type="text"]:focus, .appointment-form textarea:focus, .appointment-form select:focus { outline: none; border-color: var(--primary-color); background-color: #fff; }
.appointment-form textarea { resize: vertical; }
.radio-group { display: flex; flex-wrap: wrap; gap: 15px; }
.radio-label { display: flex; align-items: center; gap: 6px; background-color: var(--bg-mint); padding: 8px 16px; border-radius: 20px; cursor: pointer; border: 1px solid transparent; transition: all 0.2s; font-weight: normal !important; }
.radio-label:hover { border-color: var(--primary-color); }
.time-inputs { display: flex; gap: 15px; }
.day-select, .hour-select { flex: 1; }
.alert-group { background-color: #fef2f2; padding: 15px; border-radius: 8px; border-left: 4px solid var(--alert-red); }
.urgent-text { color: #b91c1c; font-weight: bold; }
.submit-btn { width: 100%; background-color: var(--primary-color); color: white; border: none; padding: 15px; border-radius: 8px; font-size: 1.1rem; font-weight: bold; cursor: pointer; transition: background-color 0.3s, transform 0.1s; margin-top: 10px; }
.submit-btn:hover { background-color: #2563eb; }
.submit-btn:active { transform: scale(0.98); }

/* =========================================
   心灵树洞
========================================= */
.treehole-header { text-align: center; padding: 40px 0 20px; }
.treehole-submit-box { max-width: 600px; margin: 0 auto 40px; background: white; padding: 25px; border-radius: 16px; box-shadow: 0 8px 25px rgba(0,0,0,0.06); }
.treehole-form textarea { width: 100%; border: none; background: #f8fafc; padding: 15px; border-radius: 10px; resize: vertical; font-size: 1rem; margin-bottom: 15px; }
.treehole-form textarea:focus { outline: none; background: #f1f5f9; }
.submit-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.nickname-input { flex: 1; padding: 10px 15px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 0.9rem; }
.treehole-btn { width: auto; padding: 10px 25px; margin-top: 0; }
.emotion-toolbar { margin-bottom: 10px; display: flex; gap: 10px; flex-wrap: wrap; }
.emotion-btn { background: #f1f5f9; padding: 5px 12px; border-radius: 15px; font-size: 0.9rem; cursor: pointer; transition: background 0.2s; user-select: none; }
.emotion-btn:hover { background: #e2e8f0; }

.treehole-wall { column-count: 3; column-gap: 20px; padding-bottom: 60px; }
.note-card { break-inside: avoid; margin-bottom: 20px; padding: 25px; border-radius: 12px; box-shadow: 2px 4px 12px rgba(0,0,0,0.05); position: relative; transition: transform 0.3s; }
.note-card:hover { transform: translateY(-5px) rotate(1deg); }

.color-yellow { background-color: #fef08a; color: #713f12; }
.color-mint { background-color: #a7f3d0; color: #064e3b; }
.color-pink { background-color: #fbcfe8; color: #831843; }
.color-blue { background-color: #bae6fd; color: #0c4a6e; }
.color-lavender { background-color: #e9d5ff; color: #4c1d95; } 
.color-peach { background-color: #ffedd5; color: #9a3412; }   
.color-cyan { background-color: #cffafe; color: #164e63; }    
.color-matcha { background-color: #d9f99d; color: #3f6212; }  

.note-content { font-size: 1.05rem; line-height: 1.7; margin-bottom: 20px; word-wrap: break-word; }
.note-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; opacity: 0.8; }
.note-meta { display: flex; flex-direction: column; gap: 4px; }
.note-time { font-size: 0.8rem; opacity: 0.6; }
.teacher-reply { margin-top: 15px; padding-top: 15px; border-top: 1px dashed rgba(0,0,0,0.1); font-size: 0.9rem; line-height: 1.6; }
.hug-btn { background: rgba(255,255,255,0.5); border: none; padding: 6px 12px; border-radius: 20px; cursor: pointer; font-size: 0.9rem; transition: all 0.2s; color: inherit; }
.hug-btn:hover { background: rgba(255,255,255,0.8); transform: scale(1.05); }
.hug-btn.hugged { background: #ff4757; color: white; font-weight: bold; }

/* =========================================
   文章详情与列表页
========================================= */
.article-page-container { background-color: #f1f5f9; padding: 30px 20px 60px; min-height: calc(100vh - 150px); }
.breadcrumb { max-width: 800px; margin: 0 auto 15px; font-size: 0.9rem; color: var(--text-light); }
.breadcrumb a { color: var(--primary-color); }
.breadcrumb a:hover { text-decoration: underline; }
.article-card-main { max-width: 800px; margin: 0 auto; background: white; border-radius: 16px; padding: 40px 50px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.article-header { text-align: center; border-bottom: 1px solid #e2e8f0; padding-bottom: 25px; margin-bottom: 30px; }
.article-header h1 { font-size: 2.2rem; color: var(--text-main); margin-bottom: 15px; line-height: 1.4; }
.article-meta { display: flex; justify-content: center; gap: 20px; font-size: 0.9rem; color: var(--text-light); flex-wrap: wrap; }
.article-body { font-size: 1.15rem; line-height: 1.8; color: #334155; }
.article-body p { margin-bottom: 1.5em; }
.article-body h2 { font-size: 1.4rem; color: var(--primary-color); margin: 2em 0 1em; padding-left: 12px; border-left: 4px solid var(--primary-color); }
.article-body blockquote { background-color: #f8fafc; border-left: 4px solid #94a3b8; padding: 15px 25px; margin: 2em 0; font-size: 1.1rem; color: #475569; border-radius: 0 8px 8px 0; font-style: italic; }
.article-body ul { margin-bottom: 1.5em; padding-left: 20px; }
.article-body li { margin-bottom: 8px; }
.article-footer { margin-top: 50px; padding-top: 25px; border-top: 1px dashed #e2e8f0; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.tags { display: flex; gap: 10px; flex-wrap: wrap; }
.tags span { background: #f1f5f9; color: #64748b; padding: 5px 12px; border-radius: 20px; font-size: 0.85rem; }
.back-to-list-btn { display: inline-block; padding: 12px 30px; background-color: var(--primary-color); color: white; border-radius: 25px; transition: all 0.3s; font-weight: bold; }
.back-to-list-btn:hover { background-color: #2563eb; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }

/* 文章内部多媒体防撑破保护 */
.article-body img { max-width: 100% !important; height: auto !important; display: block; margin: 15px auto; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.03); }
.article-body iframe, .article-body video { max-width: 100% !important; height: auto !important; }
.article-body table { width: 100% !important; overflow-x: auto; display: block; }

/* 列表页布局 */
.list-page-header { text-align: center; padding: 40px 0 20px; }
.page-title { font-size: 2.2rem; color: var(--text-main); margin-bottom: 10px; }
.page-subtitle { color: var(--text-light); font-size: 1.1rem; }
.list-container { display: flex; gap: 30px; align-items: flex-start; padding-bottom: 60px; }
.category-sidebar { width: 280px; background: white; padding: 20px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); flex-shrink: 0; position: sticky; top: 90px; }
.category-list { padding: 0; }
.category-list li { margin-bottom: 10px; }
.category-list a { display: block; padding: 12px 15px; border-radius: 8px; transition: all 0.2s; font-size: 1rem; }
.category-list a:hover { background-color: #f1f5f9; color: var(--primary-color); }
.category-list li.active a { background-color: var(--primary-color); color: white; font-weight: bold; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3); }
.list-content { flex: 1; }
.list-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; border-top: 1px dashed #e2e8f0; padding-top: 15px; font-size: 0.85rem; color: var(--text-light); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 40px; }
.pagination a, .pagination span { display: inline-block; padding: 8px 15px; border-radius: 8px; background: white; box-shadow: 0 2px 6px rgba(0,0,0,0.04); transition: all 0.2s; }
.pagination a:hover { background: #f1f5f9; color: var(--primary-color); }
.pagination .active { background: var(--primary-color); color: white; font-weight: bold; }

/* =========================================
   放松专区
========================================= */
.relax-header { text-align: center; padding: 20px 0; }
.section-badge { display: inline-block; background-color: var(--primary-color); color: white; padding: 6px 16px; border-radius: 20px; font-size: 1rem; font-weight: bold; margin-bottom: 20px; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; }
.media-card { background: white; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,0.04); transition: transform 0.3s, box-shadow 0.3s; display: flex; flex-direction: column; }
.media-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); }
.media-cover { height: 120px; display: flex; align-items: center; justify-content: center; font-size: 3.5rem; }
.cover-forest { background: linear-gradient(135deg, #a7f3d0, #34d399); }
.cover-rain { background: linear-gradient(135deg, #bae6fd, #7dd3fc); }
.cover-meditation { background: linear-gradient(135deg, #ddd6fe, #a78bfa); }
.media-info { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.media-info h3 { font-size: 1.1rem; margin-bottom: 8px; }
.media-info p { font-size: 0.9rem; color: var(--text-light); margin-bottom: 15px; }
.native-player { width: 100%; margin-top: auto; outline: none; }
.native-video { width: 100%; height: 200px; object-fit: cover; background: #000; display: block; }

/* =========================================
   全站公用：弹窗提示 & 页脚
========================================= */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 9999; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.modal-overlay.show { opacity: 1; visibility: visible; }
.success-modal { background: white; width: 90%; max-width: 400px; padding: 40px 30px; border-radius: 20px; text-align: center; box-shadow: 0 15px 35px rgba(0,0,0,0.1); transform: translateY(30px) scale(0.95); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.modal-overlay.show .success-modal { transform: translateY(0) scale(1); }
.success-modal.is-error { box-shadow: 0 15px 35px rgba(30, 41, 59, 0.12); }
.success-modal.is-error .modal-title { color: #1e293b; }
.success-modal.is-error .modal-btn { background: #334155; }
.modal-icon { font-size: 4rem; margin-bottom: 15px; line-height: 1; }
.modal-title { font-size: 1.4rem; margin-bottom: 10px; }
.modal-text { font-size: 1rem; color: var(--text-light); line-height: 1.6; margin-bottom: 25px; }
.modal-btn { display: inline-block; background: var(--primary-color); color: white; padding: 10px 30px; border-radius: 25px; font-weight: bold; border: none; cursor: pointer; transition: background 0.3s; }
.modal-btn:hover { background: #2563eb; }
.success-modal.is-error .modal-btn:hover { background: #1e293b; }

.main-footer { background-color: #1e293b; color: white; text-align: center; padding: 30px 0; font-size: 0.9rem; margin-top: auto; }
.main-footer p { margin-bottom: 5px; color: #94a3b8; }

/* =========================================
   📱 终极整合：全站移动端响应式适配
========================================= */
@media (max-width: 900px) {
    .list-container { flex-direction: column; }
    .category-sidebar { width: 100%; position: static; padding: 15px; overflow-x: auto; white-space: nowrap; }
    .category-list { display: flex; gap: 10px; }
    .category-list li { margin-bottom: 0; }
}

@media (max-width: 768px) {
    /* 头部适配 */
    .logo { font-size: 1.35rem !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .header-actions { flex-shrink: 0; gap: 18px !important; }
    .sos-btn { padding: 4px 12px !important; font-size: 0.8rem !important; }
    .mobile-menu-btn { display: block; }
    .main-nav { display: none; position: absolute; top: 70px; left: 0; width: 100%; background-color: white; box-shadow: 0 4px 10px rgba(0,0,0,0.05); border-top: 1px solid #f1f5f9; z-index: 99; }
    .main-nav.active { display: block; animation: slideDown 0.3s ease-out; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav a { display: block; padding: 15px 20px; border-bottom: 1px solid #f8fafc; border-left: 4px solid transparent; }
    .main-nav a:hover, .main-nav a.active { background-color: var(--bg-mint); border-left: 4px solid var(--primary-color); border-bottom: 1px solid #f8fafc; }
    
    /* 首页适配 */
    .pure-carousel { height: 220px; }
    .pure-carousel .hero-content h1 { font-size: 1.7rem; }
    .pure-carousel .hero-content p { font-size: 1rem; }
    .quick-links { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: -20px; padding: 0 10px; }
    .card { padding: 15px 8px; }
    .card-icon { font-size: 2rem; margin-bottom: 8px; }
    .card h3 { font-size: 1.05rem; margin-bottom: 5px; }
    .card p { font-size: 0.75rem; }
    .section-title { font-size: 1.35rem !important; margin: 30px 0 20px !important; }
    .article-card { padding: 15px; gap: 12px; }
    .article-icon { width: 50px; height: 50px; font-size: 1.8rem; }
    .news-title { font-size: 0.95rem !important; line-height: 1.4 !important; }
    .news-desc { font-size: 0.8rem !important; color: #94a3b8 !important; -webkit-line-clamp: 1; }
    .news-item { padding: 12px; gap: 12px; }
    .news-date-box { min-width: 55px; height: 60px; }
    .news-date-box .day { font-size: 1.2rem; }

    /* 表单与树洞适配 */
    .appointment-card { padding: 25px 20px; }
    .time-inputs { flex-direction: column; }
    .treehole-wall { column-count: 2; }
    
    /* 阅读页适配 */
    .article-page-container { padding: 15px 10px 30px; }
    .article-card-main { padding: 25px 20px; border-radius: 12px; }
    .article-header h1 { font-size: 1.6rem; }
    .article-body { font-size: 1.05rem; }
    .article-meta { gap: 10px; flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
    .treehole-wall { column-count: 1; }
    .submit-footer { flex-direction: column; }
    .nickname-input, .treehole-btn { width: 100%; }
    .treehole-btn { margin-top: 10px; }
}

@media (max-width: 360px) {
    .logo { font-size: 1.15rem !important; }
    .header-actions { gap: 12px !important; }
    .sos-btn { padding: 4px 8px !important; font-size: 0.75rem !important; }
    .card h3 { font-size: 0.95rem; }
    .card p { font-size: 0.7rem; }
}

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