/* css/common_subpage_styles.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

:root {
    --primary-color: #3a86ff;
    --secondary-color: #5a8dee;
    --light-blue: #a2d2ff;
    --very-light-blue: #cdedfd;
    --text-dark: #2c3e50;
    --text-light: #5d6d7e;
    --white: #ffffff;
    --shadow: rgba(58, 134, 255, 0.1);
    --transition: all 0.3s ease;
}

body {
    background-color: #f8fafd;
    color: var(--text-dark);
    line-height: 1.7; /* 增加行高 */
    min-height: 100vh;
    background-image: linear-gradient(135deg, #f5f7ff 0%, #f0f8ff 100%);
    animation: fadeIn 1s ease-out;
}

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

/* 头部样式 */
header {
    padding: 25px 0;
    text-align: center;
    background-color: var(--white);
    box-shadow: 0 4px 12px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideDown 0.8s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.logo-icon {
    color: var(--primary-color);
    font-size: 32px;
    animation: pulse 2s infinite alternate;
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tagline {
    color: var(--text-light);
    font-size: 16px;
    letter-spacing: 1px;
}

/* 返回主页按钮 */
.back-home {
    margin-top: 15px;
}

.back-btn {
    display: inline-block;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(58, 134, 255, 0.3);
}

.back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(58, 134, 255, 0.4);
}

/* 子页面内容 */
.subpage-content {
    padding: 40px 0;
    animation: fadeIn 1s ease-out 0.3s both;
}

.subpage-section {
    background-color: var(--white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    border-left: 6px solid var(--primary-color);
    transition: var(--transition);
}

.subpage-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(58, 134, 255, 0.15);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--very-light-blue);
}

.section-title i {
    color: var(--primary-color);
    font-size: 24px;
}

.section-title h1 {
    font-size: 32px;
    color: var(--text-dark);
}

.section-title h2 {
    font-size: 28px;
    color: var(--text-dark);
    margin-top: 10px; /* Added for consistency */
}

/* 文本内容通用样式 */
.text-content {
    font-size: 18px;
    color: var(--text-light);
}

.text-content p {
    margin-bottom: 1em; /* 段落间距 */
    line-height: 1.7;
}

.text-content strong {
    color: var(--text-dark);
    font-weight: 600;
}

.text-content em {
    font-style: italic;
    color: var(--secondary-color);
}

.text-content h3 {
    font-size: 24px;
    color: var(--primary-color);
    margin-top: 2em;
    margin-bottom: 1em;
    border-bottom: 1px dashed var(--light-blue);
    padding-bottom: 0.5em;
}

.text-content h4 {
    font-size: 20px;
    color: var(--text-dark);
    margin-top: 1.5em;
    margin-bottom: 0.8em;
}
.text-content h5 { /* For sub-sections in text like "核心概念" */
    font-size: 19px;
    color: var(--secondary-color);
    margin-top: 1.2em;
    margin-bottom: 0.6em;
}


.text-content ul,
.text-content ol {
    margin-bottom: 1em;
    padding-left: 1.8em; /* 增加左边距 */
    list-style-type: disc; /* 默认使用实心圆点 */
}

.text-content ol {
    list-style-type: decimal; /* 有序列表使用数字 */
}

.text-content ul li,
.text-content ol li {
    margin-bottom: 0.5em;
    line-height: 1.7;
    color: var(--text-light);
}
.text-content ul ul, .text-content ol ul, .text-content ul ol, .text-content ol ol {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}


.highlight {
    background-color: var(--very-light-blue);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    color: var(--primary-color);
}

/* 信息卡片样式 (用于睡眠阶段、质量要素、习惯等) */
.info-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.info-card-item {
    background-color: #f8fafd;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--very-light-blue);
}

.info-card-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08);
}

.info-card-icon {
    font-size: 42px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.info-card-item h3 {
    font-size: 22px;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.info-card-item p {
    color: var(--text-light);
    font-size: 16px;
    line-height: 1.6;
}

/* 列表项卡片样式 (用于睡眠阶段、习惯、障碍) */
.list-card-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
}

.list-card-item {
    background-color: #f8fafd;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: flex-start; /* 顶部对齐 */
    gap: 25px;
    transition: var(--transition);
    border: 1px solid var(--very-light-blue);
}

.list-card-item:hover {
    transform: translateX(10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.list-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.list-card-details h3 {
    font-size: 22px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.list-card-details p {
    color: var(--text-light);
    font-size: 16px;
    line-height: 1.6;
}

/* 脑电波图表样式 (sub1独有) */
.brainwave-chart {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

.brainwave-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: #f8fafd;
    border-radius: 10px;
    transition: var(--transition);
    border: 1px solid var(--very-light-blue);
}

.brainwave-item:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.brainwave-bar {
    height: 20px;
    border-radius: 10px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    flex-grow: 1; /* 允许bar增长 */
}

.brainwave-label {
    min-width: 120px;
    font-weight: 600;
    color: var(--text-dark);
}

.brainwave-freq {
    min-width: 80px; /* 确保频率显示完整 */
    text-align: right;
    color: var(--text-dark);
}


/* 通用表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.data-table thead {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

.data-table th {
    color: white;
    padding: 18px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 17px;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:nth-child(even) {
    background-color: #f8fafd;
}

.data-table tbody tr:hover {
    background-color: var(--very-light-blue);
}

.data-table td {
    padding: 16px 15px;
    border-bottom: 1px solid #eee;
    color: var(--text-light);
    font-size: 16px;
}

/* 提示框样式 */
.tip-box {
    background-color: #f0f7ff;
    border-left: 5px solid var(--primary-color);
    padding: 20px;
    margin: 25px 0;
    border-radius: 8px;
    color: var(--text-dark); /* 确保文字颜色可见 */
}

.tip-box h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tip-box p {
    color: var(--text-light);
    font-size: 16px;
}


/* 警告框样式 */
.warning-box {
    background-color: #fff3cd;
    border-left: 5px solid #ffc107;
    padding: 20px;
    margin: 25px 0;
    border-radius: 8px;
}

.warning-box h4 {
    color: #856404;
    margin-bottom: 10px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.warning-box p {
    color: #856404;
    font-size: 16px;
}

/* 页脚样式 */
footer {
    background-color: var(--text-dark);
    color: var(--white);
    padding: 30px 0;
    text-align: center;
    margin-top: 40px;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-logo {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--light-blue);
}

.copyright {
    color: #bdc3c7;
    font-size: 14px;
}

/* 动画定义 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .subpage-section {
        padding: 25px;
    }

    .section-title h1 {
        font-size: 28px;
    }

    .section-title h2 {
        font-size: 24px;
    }
    .text-content {
        font-size: 16px;
    }

    .text-content h3 {
        font-size: 20px;
    }
    .text-content h4 {
        font-size: 18px;
    }
    .text-content h5 {
        font-size: 17px;
    }
    .text-content ul, .text-content ol {
        padding-left: 1.2em;
    }

    /* info-card-grid for smaller screens */
    .info-card-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* list-card-item for smaller screens */
    .list-card-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        align-items: center;
    }

    .list-card-icon {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
    .list-card-details h3 {
        font-size: 20px;
    }
    .list-card-details p {
        font-size: 15px;
    }


    /* brainwave-item for smaller screens */
    .brainwave-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 15px;
    }

    .brainwave-label {
        min-width: auto;
    }
    .brainwave-bar {
        width: 100% !important; /* Force full width on small screens */
    }
    .brainwave-freq {
        width: 100%;
        text-align: left;
    }


    /* data-table for smaller screens */
    .data-table {
        display: block;
        overflow-x: auto; /* Enable horizontal scrolling for tables */
        width: 100%;
    }
    .data-table thead {
        display: none; /* Hide header on small screens for better vertical flow */
    }
    .data-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #eee;
        border-radius: 8px;
        background-color: var(--white) !important; /* Override alternating background */
    }
    .data-table td {
        display: block;
        text-align: left;
        border: none; /* Remove cell borders */
        border-bottom: 1px dashed #eee;
        padding: 12px 15px;
        position: relative;
        padding-left: 100px; /* Space for data-label */
    }
    .data-table td:last-child {
        border-bottom: none;
    }
    /* Adding labels for table cells on small screens */
    .data-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 80px;
        font-weight: 600;
        color: var(--primary-color);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Specific adjustments for sub3's symptom-table */
    .symptom-table td:nth-child(1)::before { content: "症状:"; }
    .symptom-table td:nth-child(2)::before { content: "相关障碍:"; }
    .symptom-table td:nth-child(3)::before { content: "严重程度:"; }
	.symptom-table td:nth-child(3)::before { content: "严重程度:"; }

}

/* --- Styles for short_sleep_science.html (天赋短睡页面) --- */

/* 页面顶部的介绍段落 */
.intro-paragraph.talent-sleep-intro {
    background-color: #e6f7ff; /* 浅蓝背景 */
    border-left: 5px solid var(--primary-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 500;
}
.intro-paragraph.talent-sleep-intro strong {
    color: var(--primary-color);
}

/* 维度卡片容器 */
.dimension-card {
    background-color: #f8fafd;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}
.dimension-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.dimension-card h4 { /* 维度标题 */
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 15px;
    border-bottom: 1px dashed var(--light-blue);
    padding-bottom: 10px;
}
.dimension-card ul {
    list-style-type: '✔️ '; /* 自定义列表符号 */
    padding-left: 25px;
    margin-bottom: 15px;
}
.dimension-card ul li {
    margin-bottom: 8px;
}

/* 天赋短睡者/补偿性短睡者 类型标题 */
.type-header {
    font-size: 18px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dark);
}
.type-header i {
    color: var(--secondary-color);
}

/* 科普建议的行动指南框 */
.action-guide-box {
    background-color: #f9f9e0; /* 浅黄 */
    border-left: 5px solid #f7b731;
    padding: 18px;
    border-radius: 8px;
    margin: 25px 0;
    font-size: 17px;
    line-height: 1.6;
}
.action-guide-box strong {
    color: #f7b731;
}
.action-guide-box p {
    margin-bottom: 0.5em;
}
.action-guide-box ul {
    list-style-type: '💡 ';
    padding-left: 20px;
    margin-top: 10px;
}
.action-guide-box li {
    margin-bottom: 5px;
}

/* 总结强调框 */
.summary-callout-box {
    background-color: #f0f7ff; /* 浅蓝 */
    border-left: 5px solid var(--primary-color);
    padding: 18px;
    border-radius: 8px;
    margin: 25px 0;
    font-size: 17px;
    line-height: 1.6;
}
.summary-callout-box strong {
    color: var(--primary-color);
}
.summary-callout-box em {
    color: var(--secondary-color);
    font-weight: 600;
}

/* 分隔线 */
.divider {
    border: none;
    border-top: 2px dashed var(--very-light-blue);
    margin: 40px auto;
    width: 80%;
}

/* 确保子页面内的h2标题样式与主页一致 */
.subpage-section .text-content h2 {
    font-size: 28px;
    color: var(--text-dark);
    margin-top: 35px;
    margin-bottom: 20px;
    position: relative;
    padding-left: 0; /* 移除左边距，如果需要 */
    border-bottom: 2px solid var(--very-light-blue); /* 添加底部边框 */
    padding-bottom: 10px;
}
/* 确保子页面内的h3标题样式与主页一致 */
.subpage-section .text-content h3 {
    font-size: 26px; /* H3标题 */
    color: var(--primary-color);
    margin-top: 35px;
    margin-bottom: 20px;
    position: relative;
    padding-left: 15px;
}

.subpage-section .text-content h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 80%;
    background-color: var(--primary-color);
    border-radius: 3px;
}

