:root {
    --primary-color: #6366f1;
    --primary-gradient: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    --background-color: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.6);
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.04);
    --img-placeholder-bg: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --transition-fast: 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-main);
    line-height: 1.7;
    padding-top: 70px;
    background-image: radial-gradient(circle at 80% 20%, rgba(168, 85, 247, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 10% 70%, rgba(99, 102, 241, 0.05) 0%, transparent 40%);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: #4f46e5;
}

/* 导航栏 - 与首页完全一致 */
.navbar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.navbar {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.nav-logo span {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.75rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.nav-links a.active,
.nav-links a:hover {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-github-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1e293b;
    color: #fff !important;
    padding: 0.4rem 1rem !important;
    border-radius: 50px !important;
    border-bottom: none !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    transition: background 0.25s ease, transform 0.2s ease !important;
}

.nav-github-link:hover {
    background: #0f172a !important;
    color: #fff !important;
    transform: translateY(-1px);
    border-bottom: none !important;
}

/* 主布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
}

@media (max-width: 968px) {
    .container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
}

/* 步骤卡片 */
.step-block {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.step-number {
    background: var(--primary-gradient);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.step-text h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
    border: none;
    padding: 0;
}

.step-text p {
    color: #475569;
    margin: 0;
}

/* 内容主体 */
.content-body {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
    margin-top: 1rem;
}

.content-body h2 {
    font-size: 1.55rem;
    margin: 2.25rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f1f5f9;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-body h2:first-of-type {
    margin-top: 0;
}

.content-body p {
    margin-bottom: 1.25rem;
    color: #475569;
    text-align: justify;
}

.inline-code {
    background: #f1f5f9;
    color: #ef4444;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 0.9em;
}

/* 图片占位 */
.post-img-placeholder {
    display: block;
    width: 100%;
    height: auto;
    min-height: 250px;
    max-height: 380px;
    background: var(--img-placeholder-bg);
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    border: 1px dashed #cbd5e1;
    object-fit: cover;
}

.post-img-float {
    float: right;
    width: 290px;
    height: 190px;
    margin: 0 0 1rem 1.5rem;
    background: var(--img-placeholder-bg);
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    object-fit: cover;
}

@media (max-width: 640px) {
    .post-img-float {
        float: none;
        width: 100%;
        margin: 1rem 0;
    }
}

/* 代码块 */
.code-container {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    margin: 1.25rem 0;
    border-left: 4px solid var(--primary-color);
    white-space: pre-wrap;
}

/* 提示卡片 */
.tip-callout {
    display: flex;
    gap: 1rem;
    background: #fef9c3;
    border: 1px solid #fde047;
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin: 1.5rem 0;
    align-items: flex-start;
}

.tip-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.tip-content strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #854d0e;
}

.tip-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #475569;
}

/* 场景卡片 */
.scenario-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

@media (max-width: 700px) {
    .scenario-cards {
        grid-template-columns: 1fr;
    }
}

.scenario-card {
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s;
}

.scenario-card:hover {
    box-shadow: 0 6px 20px rgba(31, 38, 135, 0.05);
}

.scenario-head {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #1e293b;
}

.scenario-card p {
    font-size: 0.88rem;
    color: #64748b;
    margin: 0;
    text-align: left;
}

/* 侧边栏 */
.sidebar {
    position: sticky;
    top: 94px;
    height: fit-content;
}

.widget {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.toc-list {
    list-style: none;
}

.toc-list li {
    margin-bottom: 0.7rem;
    font-size: 0.9rem;
}

.toc-list a {
    color: var(--text-muted);
    transition: color var(--transition-fast), padding-left 0.2s ease;
    display: inline-block;
}

.toc-list a:hover {
    color: var(--primary-color);
    padding-left: 4px;
}

/* 页脚 - 与首页完全一致 */
footer {
    margin-top: 4rem;
    background: #0f172a;
    color: #94a3b8;
    padding: 3rem 1.5rem 2rem;
    font-size: 0.9rem;
}

.footer-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 640px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.footer-col h4 {
    color: #e2e8f0;
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.6rem;
}

.footer-col ul li a {
    color: #94a3b8;
    font-size: 0.88rem;
    transition: color var(--transition-fast);
}

.footer-col ul li a:hover {
    color: #ffffff;
}

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    text-align: center;
    font-size: 0.82rem;
    color: #64748b;
}