/* ==================== 主题配置区域 ==================== */
/* 在这里修改变量即可快速更改整体主题 */

:root {
    /* 颜色方案 */
    --primary-color: #2563eb;        /* 主色调 */
    --secondary-color: #1e40af;      /* 次要色 */
    --accent-color: #3b82f6;         /* 强调色 */
    --bg-color: #ffffff;             /* 背景色 */
    --text-color: #1f2937;           /* 文字颜色 */
    --text-light: #6b7280;           /* 浅色文字 */

    /* 字体设置 */
    --font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    --font-size-h1: 3.5rem;          /* 主标题字号 */
    --font-size-h2: 2.5rem;          /* 二级标题字号 */
    --font-size-h3: 1.5rem;          /* 三级标题字号 */
    --font-size-body: 1.2rem;        /* 正文字号 */

    /* 布局比例 */
    --slide-width: 1200px;           /* 幻灯片宽度 */
    --slide-height: 675px;           /* 幻灯片高度 (16:9) */
    --content-padding: 60px;         /* 内容内边距 */

    /* 动画速度 */
    --transition-speed: 0.3s;
}

/* ==================== 基础样式 ==================== */

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

body {
    font-family: var(--font-family);
    background: #f3f4f6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.presentation {
    width: var(--slide-width);
    height: var(--slide-height);
    position: relative;
    background: var(--bg-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* ==================== 幻灯片样式 ==================== */

.slide {
    width: 100%;
    height: 100%;
    padding: var(--content-padding);
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    position: absolute;
    top: 0;
    left: 0;
}

.slide.active {
    display: flex;
    animation: slideIn var(--transition-speed) ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ==================== 幻灯片布局属性 ==================== */
/* 用法: <section class="slide" data-direction="row" data-justify="center" data-align="center"> */

/* 排列方向 */
.slide[data-direction="row"]    { flex-direction: row; }
.slide[data-direction="column"] { flex-direction: column; }

/* 主轴对齐 (justify-content) */
.slide[data-justify="start"]   { justify-content: flex-start; }
.slide[data-justify="center"]  { justify-content: center; }
.slide[data-justify="end"]     { justify-content: flex-end; }
.slide[data-justify="between"] { justify-content: space-between; }
.slide[data-justify="around"]  { justify-content: space-around; }

/* 交叉轴对齐 (align-items) */
.slide[data-align="start"]     { align-items: flex-start; }
.slide[data-align="center"]    { align-items: center; }
.slide[data-align="end"]       { align-items: flex-end; }
.slide[data-align="stretch"]   { align-items: stretch; }

/* ==================== 标题样式 ==================== */

h1 {
    font-size: var(--font-size-h1);
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
}

h2 {
    font-size: var(--font-size-h2);
    color: var(--primary-color);
    margin-bottom: 25px;
    border-bottom: 4px solid var(--accent-color);
    padding-bottom: 10px;
    flex-shrink: 0;
}

h3 {
    font-size: var(--font-size-h3);
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.title-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.title-logo {
    width: 200px;
    height: 200px;
    margin-bottom: 30px;
}

.subtitle {
    font-size: 1.8rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.author {
    font-size: var(--font-size-body);
    color: var(--text-light);
    font-style: italic;
}

/* ==================== 内容网格布局 ==================== */

.content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
}

.feature-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid var(--primary-color);
    transition: transform var(--transition-speed);
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.feature-box h3 {
    margin-bottom: 8px;
}

.feature-box p {
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.6;
}

/* ==================== 图表样式 ==================== */

.chart-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-title {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 30px;
    font-weight: 600;
}

.bar-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    width: 80%;
    height: 350px;
    border-bottom: 3px solid var(--text-color);
    border-left: 3px solid var(--text-color);
    padding: 20px;
    gap: 40px;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
}

.bar {
    width: 100%;
    min-height: 20px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: 8px 8px 0 0;
    position: relative;
    transition: all var(--transition-speed);
}

.bar::after {
    content: attr(data-value);
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 700;
    color: var(--text-color);
    font-size: 1.2rem;
}

.bar:hover {
    opacity: 0.8;
}

.bar-label {
    margin-top: 15px;
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 600;
}

/* ==================== 公式样式 ==================== */

.formula-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.formula-title {
    font-size: 1.3rem;
    color: var(--secondary-color);
    font-weight: 600;
}

.formula {
    background: #f9fafb;
    padding: 12px 30px;
    border-radius: 10px;
    border: 2px solid var(--accent-color);
    font-size: 1.4rem;
    color: var(--text-color);
    text-align: center;
}

/* ==================== 流程图样式 ==================== */

.mermaid {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* ==================== 图片样式 ==================== */

.image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.demo-image {
    max-width: 70%;
    max-height: 400px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    object-fit: cover;
}

.image-caption {
    font-size: 1.1rem;
    color: var(--text-light);
    font-style: italic;
}

/* ==================== 列表样式 ==================== */

.summary-list {
    list-style: none;
    font-size: var(--font-size-body);
    line-height: 2.2;
    color: var(--text-color);
}

.summary-list li {
    padding-left: 40px;
    position: relative;
    margin-bottom: 15px;
}

.summary-list li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.5rem;
}

/* ==================== 参数表格 ==================== */

.param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.param-table th,
.param-table td {
    border: 1px solid #e5e7eb;
    padding: 10px 14px;
    text-align: left;
}

.param-table thead th {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.param-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.param-table code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ==================== 代码块 ==================== */

.code-block {
    background: #1f2937;
    color: #a5f3fc;
    padding: 14px 20px;
    border-radius: 8px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
}

/* ==================== 布局演示 ==================== */

.layout-demo-row {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.demo-box {
    flex: 1;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.demo-box h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.demo-box p {
    font-size: 0.95rem;
    color: var(--text-light);
}

.cta {
    margin-top: 40px;
    text-align: center;
}

.cta p {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 10px;
}

/* ==================== 导航控制 ==================== */

.controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    align-items: center;
    background: rgba(255,255,255,0.95);
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.controls button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.controls button:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.controls button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: scale(1);
}

#slideNumber {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    min-width: 80px;
    text-align: center;
}

/* ==================== 响应式设计 ==================== */

/* ==================== 导出按钮 ==================== */

#exportBtn {
    background: #10b981;
}

#exportBtn:hover {
    background: #059669;
}

/* ==================== 打印导出 ==================== */

@media print {
    body {
        background: none;
        padding: 0;
        min-height: auto;
    }

    .controls {
        display: none !important;
    }

    .presentation {
        width: 100vw;
        height: auto;
        box-shadow: none;
        overflow: visible;
        position: static;
    }

    .slide {
        display: flex !important;
        position: relative !important;
        width: 100vw;
        height: 100vh;
        page-break-after: always;
        break-after: page;
        animation: none !important;
    }

    .slide:last-child {
        page-break-after: avoid;
        break-after: avoid;
    }
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 1300px) {
    .presentation {
        width: 95vw;
        height: calc(95vw * 9 / 16);
    }

    :root {
        --font-size-h1: 2.5rem;
        --font-size-h2: 2rem;
        --font-size-h3: 1.3rem;
        --font-size-body: 1rem;
        --content-padding: 40px;
    }
}
