/* 岐黄青年说 - 全局样式 */
:root {
    --primary-color: #8B4513;
    --secondary-color: #D2691E;
    --accent-color: #FFD700;
    --text-dark: #2C1810;
    --text-light: #5D4037;
    --bg-light: #FFF8DC;
    --bg-cream: #FAF0E6;
    --border-color: #D4A574;
    --success-color: #4CAF50;
    --error-color: #F44336;
    --shadow: 0 2px 10px rgba(139, 69, 19, 0.1);
    --shadow-hover: 0 5px 20px rgba(139, 69, 19, 0.15);
}

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

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #FFF8DC 0%, #FAF0E6 100%);
    min-height: 100vh;
}

/* 导航栏 */
.navbar {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

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

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

.logo-icon {
    font-size: 2rem;
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.nav-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.search-box {
    display: flex;
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.search-box input {
    border: none;
    padding: 8px 15px;
    width: 200px;
    outline: none;
}

.search-box button {
    background: var(--accent-color);
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #FFD700;
}

.btn-login, .btn-register, .btn-logout {
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-login {
    color: white;
    border: 1px solid white;
}

.btn-register, .btn-logout {
    background: var(--accent-color);
    color: var(--text-dark);
}

.btn-login:hover, .btn-register:hover, .btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* 英雄区域 */
.hero {
    margin-top: 70px;
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at center, rgba(255,215,0,0.1) 0%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 20px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.title-line1, .title-line2 {
    display: block;
    animation: fadeInUp 1s ease;
}

.title-line2 {
    animation-delay: 0.3s;
}

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

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

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

.hero-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.floating-symbol {
    position: absolute;
    font-size: 3rem;
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
    animation-delay: var(--delay);
}

.floating-symbol:nth-child(1) { top: 20%; left: 10%; }
.floating-symbol:nth-child(2) { top: 60%; right: 15%; }
.floating-symbol:nth-child(3) { bottom: 20%; left: 20%; }

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

/* 内容区域 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin: 60px 0 40px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.title-decorator {
    font-size: 1.5rem;
    color: var(--accent-color);
}

/* 推荐卡片 */
.recommendations {
    padding: 60px 0;
    background: white;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.knowledge-card {
    background: var(--bg-cream);
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.category-tag, .season-tag {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

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

.season-tag {
    background: var(--accent-color);
    color: var(--text-dark);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.card-content {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 15px;
}

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

.view-count {
    color: var(--text-light);
    font-size: 0.9rem;
}

.learn-more {
    color: var(--primary-color);
    font-weight: 500;
    transition: transform 0.3s;
}

.knowledge-card:hover .learn-more {
    transform: translateX(5px);
}

/* 知识分类 */
.knowledge-categories {
    padding: 60px 0;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.tab-btn {
    padding: 10px 25px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    color: var(--text-dark);
}

.tab-btn:hover, .tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.knowledge-item {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

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

.item-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.knowledge-item h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.item-desc {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.btn-detail {
    padding: 8px 20px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-detail:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

/* 知识图谱 */
.knowledge-graph {
    padding: 60px 0;
    background: white;
}

.graph-container {
    width: 100%;
    height: 500px;
    background: var(--bg-cream);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#graphCanvas {
    width: 100%;
    height: 100%;
}

/* 热门内容 */
.popular-content {
    padding: 60px 0;
}

.popular-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.popular-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.popular-card:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-hover);
}

.rank-badge {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 1.2rem;
}

.popular-info {
    flex: 1;
}

.popular-info h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

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

.hot-indicator {
    color: #FF6B6B;
    font-weight: 500;
}

/* 页脚 */
.footer {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 40px 0 20px;
    margin-top: 80px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h5 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    transition: color 0.3s;
}

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

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
}

.close:hover {
    color: var(--primary-color);
}

/* Flash消息 */
.flash-message {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: var(--shadow-hover);
    z-index: 3000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.flash-success {
    background: var(--success-color);
    color: white;
}

.flash-error {
    background: var(--error-color);
    color: white;
}

.flash-warning {
    background: #FF9800;
    color: white;
}

.flash-info {
    background: #2196F3;
    color: white;
}

/* 认证页面样式 */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #D2B48C 0%, #A0522D 100%);
    position: relative;
    padding: 40px 20px; 
    background-attachment: fixed; 
    overflow-x: hidden; 
}

.auth-page::before {
    content: '';
    /* 关键修改：从 absolute 改为 fixed，让它不撑开页面高度 */
    position: fixed; 
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="100" fill="rgba(255,255,255,0.03)">☯</text></svg>');
    animation: backgroundMove 20s linear infinite;
    /* 确保它在最底层 */
    z-index: 0; 
    pointer-events: none; /* 确保不阻挡鼠标点击 */
}

@keyframes backgroundMove {
    from { transform: translate(0, 0); }
    to { transform: translate(-50%, -50%); }
}

.auth-container {
    display: flex;
    width: 90%;
    max-width: 1200px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.auth-container.login-container {
    max-width: 500px;
    flex-direction: column;
}

.auth-box {
    flex: 1;
    padding: 40px;
    position: relative;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-section {
    margin-bottom: 20px;
}

.logo-section .logo-icon {
    font-size: 4rem;
    color: var(--primary-color);
    display: block;
    margin-bottom: 10px;
}

.logo-section h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 10px;
}

.tagline {
    color: var(--text-light);
    font-size: 1rem;
}

.auth-form {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.form-title {
    color: var(--text-dark);
    margin-bottom: 30px;
    font-size: 1.5rem;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-checkbox label {
    color: var(--text-light);
    font-size: 0.95rem;
    cursor: pointer;
}

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

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: var(--secondary-color);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 69, 19, 0.3);
}

.quick-login {
    margin-top: 30px;
}

.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    color: var(--text-light);
}

.divider::before, .divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: #e0e0e0;
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.divider span {
    padding: 0 15px;
    background: white;
    position: relative;
}

.social-login {
    display: flex;
    gap: 15px;
}

.social-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.social-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-cream);
    transform: translateY(-2px);
}

.auth-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.auth-footer p {
    color: var(--text-light);
    margin-bottom: 10px;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.auth-footer a:hover {
    color: var(--secondary-color);
}

.link-home {
    display: inline-block;
    margin-top: 10px;
}

/* 认证页面装饰 */
.auth-decoration {
    /* 关键修改：从 absolute 改为 fixed */
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0; 
}

.floating-icon {
    position: absolute;
    font-size: 2rem;
    opacity: 0.1;
    animation: floatIcon 15s ease-in-out infinite;
    animation-delay: calc(var(--index) * 2s);
}

.floating-icon:nth-child(1) { top: 10%; left: 10%; }
.floating-icon:nth-child(2) { top: 70%; right: 10%; }
.floating-icon:nth-child(3) { bottom: 10%; left: 50%; }
.floating-icon:nth-child(4) { top: 40%; right: 30%; }

@keyframes floatIcon {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* 侧边栏（注册页面） */
.auth-sidebar {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-sidebar::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    top: -150px;
    right: -150px;
}

.auth-sidebar::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    bottom: -100px;
    left: -100px;
}

.sidebar-content {
    position: relative;
    z-index: 1;
    color: white;
}

.sidebar-content h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.feature-list {
    list-style: none;
}

.feature-list li {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: start;
}

.feature-icon {
    font-size: 1.5rem;
    min-width: 40px;
}

.feature-list strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.feature-list p {
    opacity: 0.9;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* 每日小贴士（登录页面） */
.daily-tips {
    /* 关键修改：不再绝对定位，改为固定在右下角，但增加层级处理 */
    position: fixed; 
    bottom: 20px;
    right: 20px;
    z-index: 10;
}

/* 关键修改：针对高度较小的屏幕（比如笔记本），隐藏小贴士或者改变位置 */
@media (max-height: 800px) {
    .daily-tips {
        display: none; /* 屏幕太矮时直接隐藏，保证登录框可见 */
    }
}

.tips-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow-hover);
    max-width: 300px;
    border: 2px solid var(--border-color);
}

.tips-card h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.tip-content {
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 10px;
}

.tip-footer {
    text-align: right;
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .card-grid, .knowledge-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-container {
        flex-direction: column;
        width: 95%;
    }
    
    .auth-sidebar {
        display: none;
    }
    
    .daily-tips {
        position: static;
        margin-top: 20px;
    }
    
    .tips-card {
        max-width: 100%;
    }
    
    .search-box input {
        width: 150px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .auth-box {
        padding: 20px;
    }
    
    .nav-actions {
        flex-direction: column;
        gap: 10px;
    }
}

/* 加载动画 */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
/* 导航栏欢迎语 */
.nav-welcome {
    color: white;
    font-size: 0.9rem;
    white-space: nowrap; /* 防止换行 */
}

/* 个人中心弹窗内容 */
.personal-center-content h3 {
    color: var(--primary-color);
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 25px;
}

.personal-center-content h4 {
    color: var(--text-dark);
    margin-top: 30px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}

/* 用户统计 */
.user-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    background-color: var(--bg-cream);
    padding: 20px;
    border-radius: 10px;
}

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

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-light);
}

/* 收藏列表 */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.favorite-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.favorite-card .category-badge {
    background: var(--accent-color);
    color: var(--text-dark);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 10px;
}

.favorite-card h4 {
    color: var(--primary-color);
    margin: 0 0 10px 0;
    padding: 0;
    border: none;
    font-size: 1.2rem;
}

.favorite-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 1. 减小导航栏右侧各项之间的整体间距 */
.nav-actions {
    gap: 15px; /* 原来是 20px, 稍微减小一些 */
}

/* 2. 减小按钮的内部水平边距，让按钮变得更窄 */
.nav-actions .btn-register,
.nav-actions .btn-logout {
    padding: 8px 15px; /* 原来是 8px 20px, 左右各减少5px */
    white-space: nowrap; /* 强制按钮文字不换行 */
}

/* 3. 稍微缩短搜索框的默认宽度，释放空间 */
.search-box input {
    width: 180px; /* 原来是 200px */
}

/* 4. 调整欢迎语的样式，避免与按钮靠太近 */
.nav-welcome {
    /* 之前的样式已经可以，这里可以微调字体大小 */
    font-size: 0.9rem; /* 如果还是拥挤可以尝试 0.85rem */
}
/* =================================== */
/* 体质测试页面样式 (新增)             */
/* =================================== */

/* --- 首页入口 --- */
.constitution-test-promo {
    padding: 60px 0;
    background: white;
}
.promo-box {
    background: linear-gradient(135deg, var(--bg-cream), #fff);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--primary-color);
}
.promo-text h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 10px;
}
.promo-text p {
    color: var(--text-light);
    max-width: 600px;
}
.btn-promo {
    padding: 15px 30px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.btn-promo:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-hover);
}

/* --- 测试页面主体 --- */
.test-container {
    padding-top: 100px; /* 避开导航栏 */
    padding-bottom: 60px;
}
.test-header {
    text-align: center;
    margin-bottom: 40px;
}
.test-intro {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto;
}

/* --- 表单与题目 --- */
.test-form {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}
.question-group {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
}
.question-group:last-of-type {
    border-bottom: none;
}
.group-title {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 25px;
}
.question-block {
    margin-bottom: 20px;
}
.question-text {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 15px;
}
.options-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.radio-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.2s ease;
}
.radio-label input[type="radio"] {
    display: none; /* 隐藏原始的radio按钮 */
}
.radio-label span {
    color: var(--text-light);
}
.radio-label:hover {
    background-color: var(--bg-cream);
}
.radio-label input[type="radio"]:checked + span {
    font-weight: bold;
}
.radio-label input[type="radio"]:checked {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-submit-test {
    display: block;
    width: 250px;
    margin: 40px auto 0;
    padding: 15px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-submit-test:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* --- 结果弹窗 --- */
.result-content h4 {
    color: var(--primary-color);
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 20px;
}
.result-list {
    list-style-type: none;
    padding: 0;
    text-align: center;
}
.result-list li {
    font-size: 1.2rem;
    color: var(--text-dark);
    background: var(--bg-cream);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}
.result-tip {
    text-align: center;
    margin-top: 30px;
    color: var(--text-light);
    font-style: italic;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .promo-box {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .test-form {
        padding: 20px;
    }
}
/* =================================== */
/* 体质测试页面最终简化版样式          */
/* =================================== */

/* 1. 为选中的选项添加黄色背景 */
.radio-label.selected {
    background-color: var(--accent-color); /* 黄色背景 */
    border-color: var(--secondary-color);
}

.radio-label.selected span {
    color: var(--text-dark);
    font-weight: bold;
}

/* 2. 为性别专属问题添加一个标记，方便用户识别 */
.gender-question::before {
    content: '★';
    color: var(--primary-color);
    margin-right: 5px;
    font-size: 1.2rem;
}
/* =================================== */
/* 体质测试分页样式 (新增)             */
/* =================================== */

/* 默认隐藏所有问题组（页面） */
.question-group {
    display: none;
    border-bottom: none; /* 移除分页间的横线 */
    padding-bottom: 0;
}

/* 只显示当前激活的页面 */
.question-group.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    background-color: #eee;
    border-radius: 10px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 10px;
    background-color: var(--primary-color);
    width: 0%;
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* 分页导航按钮 */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.btn-nav {
    padding: 12px 30px;
    border: 2px solid var(--primary-color);
    background-color: white;
    color: var(--primary-color);
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* 隐藏按钮的样式 */
.btn-nav.hidden {
    visibility: hidden;
}

/* =================================== */
/* 新版知识图谱 & 详情弹窗样式           */
/* =================================== */

.graph-wrapper {
    position: relative;
    width: 100%;
    height: 600px;
    background: #fffaf0; /* 淡米色背景，配合中医主题 */
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* 详情弹窗样式 */
/* 修改这部分样式 */
.graph-detail-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 450px; /* 从 350px 增加到 450px，更宽 */
    max-height: 85%; /* 使用百分比，适应不同屏幕 */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: -5px 5px 20px rgba(139, 69, 19, 0.15);
    border: 1px solid rgba(139, 69, 19, 0.1);
    padding: 25px; /* 增加内边距 */
    overflow-y: auto;
    z-index: 10;
    
    /* 动画相关保持不变 */
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 弹窗激活状态 */
.graph-detail-modal.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.modal-header h3 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.3rem;
}

.close-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--error-color);
}

/* 详情内容排版 */
.detail-section {
    margin-bottom: 15px;
}

.detail-section h4 {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 8px;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.detail-section h4::before {
    content: '•';
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-right: 5px;
    line-height: 0;
}

.detail-section p, .detail-section li {
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 5px;
}

.detail-section ul {
    padding-left: 15px;
}

/* =================================== */
/* 养生宝典详情页样式 (找回丢失的样式)   */
/* =================================== */

.knowledge-detail {
    max-width: 100%;
}

.detail-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.detail-header h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.detail-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    background: var(--accent-color);
    color: var(--text-dark);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.view-tag {
    color: var(--text-light);
}

.detail-content section {
    margin-bottom: 25px;
}

.detail-content h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.detail-content p {
    color: var(--text-dark);
    line-height: 1.8;
}

.detail-actions {
    display: flex;
    gap: 15px;
    margin: 30px 0;
}

.btn-favorite, .btn-comment {
    padding: 10px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-favorite {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-favorite.favorited {
    background: #FF6B6B;
}

.btn-comment {
    background: var(--accent-color);
    color: var(--text-dark);
}

.btn-favorite:hover, .btn-comment:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* 评论区样式 */
.comment-form {
    margin: 20px 0;
}

.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    resize: vertical;
    min-height: 100px;
    font-size: 1rem;
    font-family: inherit;
}

.comment-form button {
    margin-top: 10px;
    padding: 10px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comment-form button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.comments-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.comments-section h4 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.comment-item {
    background: var(--bg-cream);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

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

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

.comment-item p {
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
}

/* =================================== */
/* 找回丢失的动画效果                   */
/* =================================== */

/* 1. 定义淡入上浮动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 2. 定义 fade-in 类，用于分类切换 */
.fade-in {
    animation: fadeInUp 0.5s ease-in-out forwards;
}

/* 3. 定义 animate-in 类，用于滚动加载 */
.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* 4. 初始状态隐藏 (配合滚动加载) */
.knowledge-item, .popular-card, .knowledge-card {
    opacity: 0; /* 默认隐藏，等待 JS 添加动画类 */
}

/* =================================== */
/* 搜索结果卡片样式 (找回丢失的样式)     */
/* =================================== */

.search-results-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.search-result-item {
    background: var(--bg-cream); /* 使用米色背景 */
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.search-result-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    background: white;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.category-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.result-header h4 {
    color: var(--text-dark);
    margin: 0;
    font-size: 1.1rem;
    font-weight: bold;
}

.search-result-item p {
    color: var(--text-light);
    margin: 0;
    line-height: 1.6;
    font-size: 0.95rem;
}