/* 
 * AU3学习页面样式表
 * 优化版本：窗口居中、浅色背景、复制功能
 */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 页面基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* 主容器居中 */
.main {
    max-width: 800px;
    margin: 40px auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 10px;
    position: relative;
    overflow: hidden;
}

/* 标题区域 */
.title {
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #eaeaea;
}

.source-cdoe {
    display: none;
}

.run-image {
    display: none;
}

.title h1 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 段落样式 */
p {
    text-indent: 2em;
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.7;
    color: #555;
}

/* 小标题 */
h3 {
    color: #2c3e50;
    margin: 15px 0 5px 0;
    padding-left: 10px;
    border-left: 4px solid #3498db;
    font-size: 1.4em;
}

/* 代码容器样式 */
.code-container {
    position: relative;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* 代码头部（含复制按钮） */
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-family: 'Consolas', monospace;
    font-size: 14px;
}

.language-tag {
    background: #e9ecef;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #495057;
}

/* 复制按钮样式 */
.show-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    /* display: flex; */
    align-items: center;
    gap: 6px;
}


/* 浅色代码背景区域 */
pre {
    margin: 0;
    padding: 20px;
    background: #f8f9fa;
    /* 浅灰色背景 */
    overflow-x: auto;
    border-radius: 0 0 8px 8px;
    max-height: 400px;
    overflow-y: auto;
}

/* 代码文本样式 */
code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #2c3e50;
}

/* 代码块滚动条样式 */
pre::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

pre::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* 装饰性元素 */
.main::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
}

.example-img {
    width: 600px;
}

/* 响应式设计 */
@media (max-width: 840px) {
    .main {
        margin: 20px;
        padding: 25px;
    }

    .title h1 {
        font-size: 2em;
    }

    pre {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .main {
        margin: 10px;
        padding: 20px;
    }

    .code-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .copy-btn {
        align-self: flex-end;
    }
}