/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #11998e;
    --primary-dark: #0d7d72;
    --secondary-color: #38ef7d;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #2d3436;
    --text-light: #636e72;
    --border-color: #e9ecef;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

img, pre, code {
    max-width: 100%;
}

/* ========== 导航栏 ========== */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
}

.nav-links a:hover {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

/* ========== 头部 Hero ========== */
.hero {
    padding: 120px 20px 60px;
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.2) 100%);
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    width: 100%;
    max-width: 800px;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 15px;
    color: white;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    word-wrap: break-word;
}

.hero-content .subtitle {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 25px;
    padding: 0 10px;
}

.hero-tags {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 10px;
}

.tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

/* ========== 主容器 ========== */
.main-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* ========== 教程章节 ========== */
.tutorial-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    position: relative;
    scroll-margin-top: 80px;
    overflow: hidden;
}

.tutorial-section h2,
.tutorial-section .section-subtitle,
.tutorial-section .tutorial-grid,
.tutorial-section .faq-container {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.section-badge {
    position: absolute;
    top: -15px;
    left: 20px;
    font-size: 2.5rem;
    background: var(--card-bg);
    border-radius: 50%;
    padding: 8px;
    box-shadow: var(--shadow);
    z-index: 1;
}

.tutorial-section h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--primary-color);
    margin-bottom: 10px;
    padding-top: 10px;
    word-wrap: break-word;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 20px;
}

/* ========== 教程网格 ========== */
.tutorial-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 25px;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.tutorial-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 25px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
    width: 100%;
}

.tutorial-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.tutorial-card.full-width {
    grid-column: 1 / -1;
}

.tutorial-card h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 15px;
    word-wrap: break-word;
}

.tutorial-card h4 {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.tutorial-card p {
    color: var(--text-light);
    margin-bottom: 12px;
    font-size: 1rem;
}

.tutorial-card ul, 
.tutorial-card ol {
    margin-left: 20px;
    color: var(--text-light);
    font-size: 1rem;
    overflow-x: auto;
}

.tutorial-card li {
    margin-bottom: 8px;
    word-wrap: break-word;
}

.tutorial-card a {
    color: var(--primary-color);
    word-break: break-word;
}

/* ========== 代码块 ========== */
pre, .code-block {
    background: #2d3436;
    color: #dfe6e9;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 12px 0;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.code-block {
    padding: 15px;
}

.code-block code,
pre code {
    color: #dfe6e9;
    white-space: pre;
    word-wrap: normal;
    word-break: normal;
}

.output {
    background: #1a1a2e;
    border-left: 4px solid var(--secondary-color);
}

/* ========== 步骤列表 ========== */
.step-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.step-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.step-number {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-content h4 {
    margin-bottom: 8px;
}

/* ========== 信息框和注释 ========== */
.info-box {
    background: linear-gradient(135deg, rgba(17, 153, 142, 0.1) 0%, rgba(56, 239, 125, 0.1) 100%);
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 0.95rem;
}

.info-box strong {
    color: var(--primary-color);
}

.note {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    border-radius: 6px;
    margin-top: 12px;
    color: #856404;
    font-size: 0.95rem;
}

/* ========== OS 标签页 ========== */
.os-tabs {
    display: grid;
    gap: 15px;
    width: 100%;
}

.tab-content {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.tab-content h4 {
    margin-bottom: 12px;
    color: var(--primary-color);
    font-size: 1rem;
}

/* ========== 常见问题 ========== */
.faq-container {
    margin-top: 25px;
}

.faq-item {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: var(--shadow-hover);
}

.faq-question {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.faq-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.faq-question h4 {
    color: var(--primary-color);
    font-size: 1.05rem;
    word-wrap: break-word;
}

.faq-answer {
    color: var(--text-light);
    padding-left: 36px;
    font-size: 0.95rem;
}

.faq-answer ul, 
.faq-answer ol {
    margin-left: 20px;
}

.faq-answer li {
    margin-bottom: 6px;
    word-wrap: break-word;
}

.faq-answer pre {
    margin-top: 10px;
}

.faq-answer code {
    word-break: break-all;
}

/* ========== 页脚 ========== */
.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.footer p {
    font-size: 0.9rem;
}

/* ========== 响应式 - 平板 (768px) ========== */
@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        gap: 12px;
        padding: 12px 15px;
    }

    .nav-links {
        gap: 8px;
        justify-content: center;
    }

    .nav-links a {
        padding: 5px 10px;
        font-size: 0.85rem;
    }

    .hero {
        padding: 100px 15px 50px;
        min-height: 35vh;
    }

    .hero-content h1 {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
    }

    .hero-content .subtitle {
        font-size: clamp(0.9rem, 3vw, 1.1rem);
    }

    .tag {
        padding: 5px 12px;
        font-size: 0.85rem;
    }

    .tutorial-section {
        padding: 25px 15px;
        border-radius: 12px;
    }

    .section-badge {
        font-size: 2rem;
        top: -10px;
        left: 15px;
    }

    .tutorial-section h2 {
        font-size: clamp(1.3rem, 4vw, 1.6rem);
    }

    .tutorial-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tutorial-card {
        padding: 18px;
    }

    .tutorial-card h3 {
        font-size: 1.1rem;
    }

    .main-container {
        padding: 0 15px 30px;
    }

    .faq-answer {
        padding-left: 30px;
    }
}

/* ========== 响应式 - 手机 (480px) ========== */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .nav-content {
        padding: 10px 12px;
    }

    .logo {
        font-size: 1.1rem;
        text-align: center;
    }

    .nav-links {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links a {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    .hero {
        padding: 80px 12px 40px;
        min-height: 30vh;
    }

    .hero-content h1 {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }

    .hero-content .subtitle {
        font-size: clamp(0.85rem, 3.5vw, 1rem);
    }

    .hero-tags {
        gap: 8px;
    }

    .tag {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .tutorial-section {
        padding: 20px 12px;
        margin-bottom: 20px;
        border-radius: 10px;
    }

    .section-badge {
        font-size: 1.5rem;
        top: -8px;
        left: 12px;
    }

    .tutorial-section h2 {
        font-size: clamp(1.2rem, 5vw, 1.4rem);
    }

    .tutorial-card {
        padding: 15px;
    }

    .tutorial-card h3 {
        font-size: 1rem;
    }

    .tutorial-card p,
    .tutorial-card ul,
    .tutorial-card ol {
        font-size: 0.85rem;
    }

    pre, .code-block {
        padding: 12px;
        font-size: 0.75rem;
    }

    .step-number {
        width: 28px;
        height: 28px;
        min-width: 28px;
        font-size: 0.8rem;
    }

    .step-item {
        gap: 10px;
    }

    .info-box, .note {
        padding: 12px;
        font-size: 0.85rem;
    }

    .tab-content {
        padding: 12px;
    }

    .faq-item {
        padding: 15px;
    }

    .faq-question h4 {
        font-size: 0.95rem;
    }

    .faq-answer {
        padding-left: 25px;
        font-size: 0.85rem;
    }

    .footer {
        padding: 20px 12px;
        font-size: 0.8rem;
    }

    .main-container {
        padding: 0 12px 25px;
    }
}

/* ========== 响应式 - 小手机 (360px) ========== */
@media (max-width: 360px) {
    html {
        font-size: 13px;
    }

    .nav-links {
        gap: 4px;
    }

    .nav-links a {
        padding: 3px 6px;
        font-size: 0.75rem;
    }

    .hero {
        padding: 70px 10px 35px;
    }

    .hero-content h1 {
        font-size: 1.4rem;
    }

    .tutorial-section {
        padding: 15px 10px;
    }

    .tutorial-card {
        padding: 12px;
    }

    pre, .code-block {
        padding: 10px;
        font-size: 0.7rem;
    }
}
