/* ============================================
   叩门 - 古典美学样式表
   ============================================ */

/* CSS 变量定义 */
:root {
    /* 色彩系统 */
    --bg-primary: #F5F0E8;        /* 主背景 - 暖米黄 */
    --bg-secondary: #EDE8E0;      /* 次级背景 */
    --bg-card: #FAF8F4;           /* 卡片背景 */
    --text-primary: #2C2C2C;      /* 主文字 - 深炭色 */
    --text-secondary: #5A5A5A;    /* 次级文字 */
    --text-muted: #8A8A8A;        /* 弱化文字 */
    --accent-red: #C41E3A;        /* 中国红 - 强调色 */
    --accent-red-hover: #A01830;  /* 红色悬停 */
    --border-color: #D4CFC7;      /* 边框色 */
    --shadow-color: rgba(0, 0, 0, 0.08);
    
    /* 字体 */
    --font-serif: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
    --font-calligraphy: 'Ma Shan Zheng', 'Kaiti', cursive;
    
    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-serif);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 飘雪 Canvas 层 */
#snow-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* 主容器 */
.app-container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 80px; /* 为底部导航留空间 */
}

/* ============================================
   顶部标题区
   ============================================ */
.page-header {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    padding-top: 40px;
}

.main-title {
    font-family: var(--font-calligraphy);
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.1em;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

.sub-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================
   精选先贤推荐卡
   ============================================ */
.featured-mentor {
    padding: 0 var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.mentor-card-large {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: 0 4px 20px var(--shadow-color);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mentor-card-large:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px var(--shadow-color);
}

/* 先贤肖像 */
.mentor-portrait {
    width: 300px;
    height: 350px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 0;
    margin-right: var(--spacing-lg);
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.mentor-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none;
}

/* 先贤信息 */
.mentor-name {
    font-family: var(--font-calligraphy);
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.mentor-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.05em;
}

/* 引导语气泡 */
.greeting-bubble {
    background: linear-gradient(135deg, #FFF9F0 0%, #FFF5E6 100%);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    position: relative;
    border: 1px solid var(--border-color);
    max-width: 100%;
}

.greeting-bubble::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 15px;
    font-family: var(--font-serif);
    font-size: 3rem;
    color: var(--accent-red);
    opacity: 0.3;
    line-height: 1;
}

.greeting-bubble p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: left;
    padding-left: var(--spacing-sm);
}

/* 叩门按钮 */
.knock-btn {
    background: var(--accent-red);
    color: white;
    border: none;
    padding: 14px 48px;
    border-radius: var(--radius-sm);
    font-family: var(--font-calligraphy);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
    letter-spacing: 0.15em;
}

.knock-btn:hover {
    background: var(--accent-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
}

.knock-btn:active {
    transform: translateY(0);
}

/* ============================================
   先贤网格布局区（三列两排）
   ============================================ */
.mentors-carousel {
    padding: 0 var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    text-align: center;
    font-weight: 500;
}

.carousel-container {
    width: 100%;
}

.carousel-track {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
}

/* 先贤小卡片 */
.mentor-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow-color);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mentor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px var(--shadow-color);
}

.mentor-card.active {
    border-color: var(--accent-red);
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.2);
}

.card-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
}

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

.mentor-card:hover .card-image img {
    transform: scale(1.05);
}

.card-info {
    padding: var(--spacing-sm);
    text-align: center;
}

.card-name {
    font-family: var(--font-calligraphy);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.card-era {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   底部导航栏
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: var(--spacing-sm) 0;
    z-index: 100;
    box-shadow: 0 -2px 10px var(--shadow-color);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    padding: var(--spacing-xs) var(--spacing-md);
    transition: color 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
    color: var(--accent-red);
}

.nav-icon {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

.nav-text {
    font-size: 0.75rem;
    font-weight: 500;
}

/* ============================================
   响应式适配
   ============================================ */
@media (max-width: 380px) {
    .main-title {
        font-size: 2rem;
    }
    
    .mentor-portrait {
        width: 120px;
        height: 120px;
    }
    
    .mentor-name {
        font-size: 1.7rem;
    }
    
    .knock-btn {
        padding: 12px 40px;
        font-size: 1.1rem;
    }
    
    .mentor-card {
        flex: 0 0 120px;
    }
}

@media (min-width: 768px) {
    .app-container {
        max-width: 600px;
    }
    
    .mentor-card-large {
        flex-direction: row;
        text-align: left;
        padding: var(--spacing-xl);
    }
    
    .mentor-portrait {
        margin-bottom: 0;
        margin-right: var(--spacing-lg);
    }
    
    .mentor-info {
        flex: 1;
    }
    
    .knock-btn {
        align-self: flex-start;
    }
}

/* ============================================
   动画效果
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mentor-card-large {
    animation: fadeIn 0.6s ease-out;
}

.mentor-card {
    animation: fadeIn 0.6s ease-out;
    animation-fill-mode: both;
}

.mentor-card:nth-child(1) { animation-delay: 0.1s; }
.mentor-card:nth-child(2) { animation-delay: 0.2s; }
.mentor-card:nth-child(3) { animation-delay: 0.3s; }
.mentor-card:nth-child(4) { animation-delay: 0.4s; }
