* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.8;
    color: #202124;
    background-color: #ffffff;
    overflow-x: hidden;
}

/* 顶部导航 */
header {
    position: sticky;
    top: 0;
    background: #ffffff;
    border-bottom: 1px solid #dadce0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    height: 70px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #202124;
    font-size: 24px;
    font-weight: 600;
    transition: opacity 0.3s;
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4285F4 0%, #34A853 50%, #EA4335 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
}

.nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: #5f6368;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #4285F4;
}

/* 页面标题 */
.page-header {
    background: linear-gradient(135deg, #4285F4 0%, #1e88e5 100%);
    color: white;
    padding: 60px 40px;
    text-align: center;
}

.page-header h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 15px;
}

.page-header p {
    font-size: 18px;
    opacity: 0.95;
    font-weight: 300;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 14px;
    opacity: 0.9;
    font-weight: 300;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-icon {
    font-size: 16px;
}

@media (max-width: 768px) {
    .article-meta {
        gap: 15px;
    }
}

/* 主容器 */
.main-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
    gap: 40px;
}

.content-area {
    flex: 1;
    min-width: 0;
}

/* 文章内容 */
article {
    max-width: 700px;
}

article h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 60px 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #4285F4;
    color: #202124;
    scroll-margin-top: 100px;
}

article h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 40px 0 15px 0;
    color: #202124;
    scroll-margin-top: 100px;
}

article p {
    font-size: 16px;
    margin-bottom: 16px;
    color: #5f6368;
    line-height: 1.8;
}

article img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: block;
}

article ul, article ol {
    margin: 20px 0 20px 30px;
    color: #5f6368;
}

article li {
    margin-bottom: 10px;
    line-height: 1.8;
}

article blockquote {
    border-left: 4px solid #4285F4;
    padding: 15px 20px;
    margin: 20px 0;
    background: #f8f9fa;
    border-radius: 4px;
    color: #5f6368;
}

.tip {
    background: #e8f5e9;
    border-left: 4px solid #34A853;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.tip strong {
    color: #1b8e47;
}

.warning {
    background: #fff3e0;
    border-left: 4px solid #f57c00;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.warning strong {
    color: #e65100;
}

.step-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #dadce0;
}

.step-container strong {
    color: #4285F4;
}

/* 侧边栏目录 */
.sidebar {
    width: 280px;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.toc {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #dadce0;
}

.toc-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #202124;
}

.toc-list {
    list-style: none;
}

.toc-item {
    margin-bottom: 10px;
}

.toc-link {
    text-decoration: none;
    color: #4285F4;
    font-size: 14px;
    transition: all 0.3s;
    display: block;
    padding: 5px 10px;
    border-radius: 4px;
}

.toc-link:hover {
    background: #e8f0fe;
    color: #1e88e5;
}

.toc-link.active {
    background: #4285F4;
    color: white;
    font-weight: 600;
}

.toc-item.level-2 .toc-link {
    padding-left: 20px;
    font-size: 13px;
}

.toc-item.level-3 .toc-link {
    padding-left: 40px;
    font-size: 12px;
}

/* 页脚 */
footer {
    background: #202124;
    color: #e8eaed;
    padding: 40px;
    text-align: center;
    font-size: 14px;
    margin-top: 60px;
}

.footer-links {
    margin-bottom: 20px;
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-links a {
    color: #e8eaed;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #4285F4;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
    }
    
    .toc {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 20px;
        height: 60px;
    }
    
    .nav-links {
        gap: 20px;
    }
    
    .nav-links a {
        font-size: 14px;
    }
    
    .page-header h1 {
        font-size: 32px;
    }
    
    .page-header p {
        font-size: 16px;
    }
    
    article h2 {
        font-size: 24px;
    }
    
    article h3 {
        font-size: 18px;
    }
    
    .main-container {
        padding: 15px;
    }
}

/* 图文混排 */
.image-text {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
    margin: 30px 0;
}

.image-text img {
    margin: 0;
}

.image-text.reverse {
    grid-template-columns: 1fr 1fr;
    direction: rtl;
}

.image-text.reverse > * {
    direction: ltr;
}

@media (max-width: 768px) {
    .image-text {
        grid-template-columns: 1fr;
    }
    
    .image-text.reverse {
        grid-template-columns: 1fr;
        direction: ltr;
    }
}

/* 返回顶部 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #4285F4;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
    z-index: 999;
    text-decoration: none;
    font-size: 20px;
}

.back-to-top.show {
    opacity: 1;
}

.back-to-top:hover {
    background: #1e88e5;
    transform: translateY(-5px);
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

table th {
    background: linear-gradient(135deg, #4285F4 0%, #1e88e5 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 15px;
}

table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dadce0;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:nth-child(even) {
    background-color: #f8f9fa;
}

table tr:hover {
    background-color: #f1f3f5;
}
