/* ========================================
   CPR 知识分享页面 - 移动端优先样式
   ======================================== */

/* CSS 变量 - 配色方案 */
:root {
    --primary-blue: #2563EB;
    --primary-blue-dark: #1D4ED8;
    --accent-red: #DC2626;
    --accent-red-light: #FEE2E2;
    --bg-light: #F8FAFC;
    --bg-white: #FFFFFF;
    --text-dark: #1E293B;
    --text-gray: #64748B;
    --border-color: #E2E8F0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Header
   ======================================== */
.header {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: white;
    padding: 0.75rem 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.header-icon {
    font-size: 1.5rem;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(1.1); }
    20%, 40% { transform: scale(1); }
}

.header h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.header-subtitle {
    display: none;
}

/* ========================================
   Section 通用样式
   ======================================== */
.section {
    padding: 1.5rem 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.section h2 {
    font-size: 1.25rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

/* ========================================
   简介区
   ======================================== */
.intro-section p {
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.highlight-box {
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    border-left: 4px solid var(--primary-blue);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.highlight-box.warning {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border-left-color: #F59E0B;
}

.highlight-box strong {
    color: var(--primary-blue);
    display: block;
    margin-bottom: 0.5rem;
}

.highlight-box.warning strong {
    color: #B45309;
}

/* ========================================
   流程图
   ======================================== */
.flow-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* ========================================
   步骤卡片（手风琴）
   ======================================== */
.steps-section {
    background: var(--bg-light);
}

.step-card {
    background: var(--bg-white);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.step-card:hover {
    box-shadow: var(--shadow-lg);
}

.step-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    background: var(--bg-white);
    transition: background-color 0.2s ease;
}

.step-header:active {
    background: var(--bg-light);
}

.step-number {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.step-card:nth-child(5) .step-number {
    background: linear-gradient(135deg, var(--accent-red), #B91C1C);
}

.step-title {
    flex: 1;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.step-arrow {
    color: var(--text-gray);
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.step-card.active .step-arrow {
    transform: rotate(180deg);
}

.step-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: var(--bg-light);
}

.step-card.active .step-content {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

.step-list {
    list-style: none;
    padding: 1rem 1rem 1rem 3.5rem;
}

.step-list > li {
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    line-height: 1.7;
}

.step-list > li:last-child {
    margin-bottom: 0;
}

.sub-list {
    list-style: disc;
    margin-top: 0.5rem;
    margin-left: 1rem;
}

.sub-list li {
    color: var(--text-gray);
    margin-bottom: 0.25rem;
}

/* ========================================
   视频区域
   ======================================== */
.video-player {
    width: 100%;
    max-height: 400px;
    background: #000;
    border-radius: 8px;
    display: block;
}

.video-tip {
    text-align: center;
    color: var(--text-gray);
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

/* ========================================
   下载区域
   ======================================== */
.download-section p {
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: white;
    text-decoration: none;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow);
}

.download-btn:active {
    transform: scale(0.98);
}

.download-btn.secondary {
    background: linear-gradient(135deg, #64748B, #475569);
}

.download-btn:hover {
    box-shadow: var(--shadow-lg);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--text-dark);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 2rem;
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer-note {
    font-size: 0.8rem;
    color: var(--text-gray);
}

/* ========================================
   响应式适配
   ======================================== */
@media (min-width: 768px) {
    .header {
        padding: 1rem 2rem;
    }

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

    .header h1 {
        font-size: 1.5rem;
    }

    .header-subtitle {
        display: inline;
        font-size: 0.9rem;
        opacity: 0.8;
        margin-left: 0.5rem;
    }

    .section {
        padding: 2rem;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .content-card {
        padding: 1.5rem;
    }

    .step-header {
        padding: 1.25rem;
    }

    .step-title {
        font-size: 1.1rem;
    }

    .step-list {
        padding: 1.25rem 1.25rem 1.25rem 4rem;
    }
}

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

.section {
    animation: fadeIn 0.5s ease-out;
}

.section:nth-child(2) { animation-delay: 0.1s; }
.section:nth-child(3) { animation-delay: 0.2s; }
.section:nth-child(4) { animation-delay: 0.3s; }
.section:nth-child(5) { animation-delay: 0.4s; }
.section:nth-child(6) { animation-delay: 0.5s; }
.section:nth-child(7) { animation-delay: 0.6s; }
