/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== 面包屑导航 ===== */
.breadcrumb {
    background: var(--card-bg);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--secondary-color);
}

.breadcrumb .separator {
    margin: 0 0.5rem;
    color: var(--text-secondary);
}

.breadcrumb .current {
    color: var(--text-secondary);
}

/* ===== 主容器 ===== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===== 文章头部 ===== */
.article-header {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.header-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.article-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* ===== 内容区块 ===== */
.content-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s;
}

.content-section:hover {
    box-shadow: var(--shadow-md);
}

.section-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.badge-number {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: white;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.2rem;
}

.badge-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-content {
    padding-left: 0;
}

/* ===== 信息卡片 ===== */
.info-card {
    background: #f7fafc;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.info-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 150px;
    flex-shrink: 0;
}

.info-value {
    color: var(--text-primary);
}

.info-value strong {
    color: var(--secondary-color);
}

.info-value code {
    background: #e2e8f0;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.highlight-blue {
    color: var(--primary-color);
    font-weight: 600;
}

.highlight-red {
    color: #e53e3e;
    font-weight: 600;
}

.highlight-green {
    color: #38a169;
    font-weight: 600;
}

/* ===== 引言文本 ===== */
.intro-text {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* ===== 代码块 ===== */
.code-block {
    background: #282c34;
    border-radius: 8px;
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #21252b;
    border-bottom: 1px solid #3e4451;
}

.code-lang {
    color: #abb2bf;
    font-size: 0.85rem;
    font-weight: 600;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.copy-btn.copied {
    background: #38a169;
}

.code-block pre {
    padding: 1.5rem;
    overflow-x: auto;
    margin: 0;
    background: #282c34;
}

.code-block code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #abb2bf;
}

/* ===== 结果框 ===== */
.result-box {
    background: #f7fafc;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin: 1.5rem 0;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #e2e8f0;
    font-weight: 600;
    color: var(--text-primary);
}

.result-icon {
    color: var(--primary-color);
}

.result-content {
    padding: 1rem;
}

.result-list {
    list-style: none;
    padding-left: 0;
}

.result-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.result-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

.result-content code {
    background: #e2e8f0;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ===== 决策框 ===== */
.decision-box {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.decision-header {
    background: var(--primary-gradient);
    color: white;
}

.decision-list {
    list-style: none;
    padding-left: 0;
    counter-reset: decision-counter;
}

.decision-list li {
    padding: 1rem 0;
    padding-left: 2.5rem;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.decision-list li:last-child {
    border-bottom: none;
}

.decision-list li:before {
    counter-increment: decision-counter;
    content: counter(decision-counter);
    position: absolute;
    left: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.85rem;
}

.decision-label {
    font-weight: 600;
    color: var(--text-primary);
}

.neutral {
    color: var(--text-secondary);
    font-style: italic;
}

/* ===== 警告框 ===== */
.warning-box {
    display: flex;
    gap: 1rem;
    background: #fff5f5;
    border-left: 4px solid #fc8181;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
}

.warning-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.warning-content {
    flex: 1;
}

.warning-content strong {
    color: #c53030;
}

/* ===== 信息框 ===== */
.info-box {
    display: flex;
    gap: 1rem;
    background: #ebf8ff;
    border-left: 4px solid #4299e1;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
}

.info-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.info-content {
    flex: 1;
}

.info-content code {
    background: #bee3f8;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ===== 返回按钮 ===== */
.back-btn-container {
    text-align: center;
    margin: 3rem 0;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-gradient);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* ===== 页脚 ===== */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .article-header h1 {
        font-size: 1.8rem;
    }

    .header-icon {
        font-size: 3rem;
    }

    .content-section {
        padding: 1.5rem;
    }

    .section-badge {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .info-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .info-label {
        min-width: auto;
    }

    .code-block pre {
        padding: 1rem;
        font-size: 0.85rem;
    }

    .decision-list li {
        padding-left: 2rem;
    }
}
