/* 项目开发指南样式 */

 
.container {
   
    width: 99vw; 
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
}

.header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 导航样式 */
.nav {
    background: #2c3e50;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav ul {
    list-style: none;
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0;
    padding: 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.nav ul::-webkit-scrollbar {
    display: none; /* WebKit */
}

.nav li {
    margin: 0;
    flex-shrink: 0; /* 防止菜单项缩小 */
}

.nav a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 1rem 1.5rem;
    transition: background-color 0.3s;
    white-space: nowrap; /* 防止文本换行 */
}

.nav a:hover {
    background-color: #34495e;
}

.nav a.active {
    background-color: #e74c3c;
    color: white;
}



.section {
    margin-bottom: 3rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
    font-size: 1.3rem;
    font-weight: 500;
}

.section-content {
    padding: 2rem;
}

/* 子节样式（用于二级导航内容在父 section 内显示） */
 
.subsection {
   background: #fff; 
    
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.subsection-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}
.subsection-body { padding-left: 0.5rem; }
.subsection-item { margin-bottom: 1rem; }
.subsection-item-title { font-size: 1rem; margin-bottom: 0.25rem; }
.subsection-empty { color: #888; font-size: 0.95rem; }

/* 项目概述下的小标题行 */
.overview-subtitles {
    display: flex;
    gap: 12px;
    padding: 12px 0 8px 0;
    align-items: center;
    flex-wrap: wrap;
}
.overview-subtitle {
    background: #f1f5f9;
    border: 1px solid #e6eef6;
    padding: 8px 12px;
    border-radius: 20px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 0.95rem;
}
.overview-subtitle:hover { background: #e6eef6; }

/* 二级内容网格：每行 4 个卡片，卡片内部垂直排列（图片 -> 标题 -> subtitle -> 内容） */
.subsection-body {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: stretch;
}
.subsection-item {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 12px;
    height: 320px; /* 固定高度，保证每个卡片一致 */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    overflow: hidden;
    box-sizing: border-box;
    flex: 0 0 calc(25% - 12px); /* 四列布局，考虑 gap */
    max-width: calc(25% - 12px);
}
.subsection-item img {
    width: 100%;
    height: 120px; /* 固定图片高度 */
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
    flex: 0 0 auto; /* 确保图片为固定块，不会与内容区重叠 */
    display: block;
}

/* 专用于子节卡片的图片，覆盖内联尺寸并统一裁切展示 */
.subsection-item-img {
    width: 100%;
    height: 140px; /* 固定图片展示高度 */
    object-fit: cover; /* 裁切并保持比例 */
    border-radius: 6px;
    display: block;
    margin: 6px 0 12px;
}
.subsection-item, .subsection-item * {
    box-sizing: border-box;
}

/* 限制卡片内正文中的图片，防止用户在富文本中插入超大图片撑破卡片 */
.subsection-item .subsection-item-content img {
    max-width: 100%;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: cover;
    display: block;
    margin: 8px auto;
}
.subsection-item .subsection-item-content img {
    max-width: 100% !important;
    height: auto !important;
    max-height: 160px !important; /* 防止富文本内大图过高 */
    object-fit: cover !important;
    display: block;
    margin: 8px auto;
}
.section-content img {
    /* 限制内容区内任意图片大小，防止单张大图撑满屏幕 */
    max-width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: cover;
    display: block;
    margin: 12px auto;
}
.subsection-item .subsection-item-title { font-size: 1.05rem; margin: 6px 0; color: #2c3e50; }
.subsection-item .subtitle { font-size: 0.9rem; color: #666; margin-bottom: 8px; }
.subsection-item .subsection-item-content {
    flex: 1 1 auto;
    overflow: hidden;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 6; /* 限制行数，超出显示省略号 */
    -webkit-box-orient: vertical;
    /* 标准属性备用以提高兼容性（lint 建议） */
    line-clamp: 6;
}
.subsection-item .subsection-item-content {
    flex: 1 1 auto; /* 占据剩余空间，保证图片上方、内容下方不重叠 */
    overflow: hidden;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 6; /* 限制行数，超出显示省略号 */
    -webkit-box-orient: vertical;
    /* 标准属性备用以提高兼容性 */
    line-clamp: 6;
}

@media (max-width: 992px) {
    .subsection-item { flex: 0 0 calc(50% - 8px); max-width: calc(50% - 8px); }
}
@media (max-width: 576px) {
    .subsection-item { flex: 0 0 100%; max-width: 100%; height: auto; }
    .subsection-item .subsection-item-content { -webkit-line-clamp: 8; line-clamp: 8; }
}

/* 针对明确标记为“项目特色”的子节，强制 4 列横向卡片表现 */
.subsection-body-horizontal {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
}
.subsection-body-horizontal > .subsection-item {
    flex: 0 0 calc(25% - 12px) !important;
    max-width: calc(25% - 12px) !important;
    height: 320px !important;
}

/* 模块概览卡片 */
.module-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.module-card {
    
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* module-card 内图片统一样式 */
.module-card img, .module-card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    margin-bottom: 12px;
    flex: 0 0 auto;
}
/* 防止 module-card 或 module-header 溢出父容器 */
.module-card, .module-header {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}
.module-icon-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    margin-right: 12px;
    flex: 0 0 auto;
}

/* 兼容旧类名 module-icon，确保图片独占一行 */
.module-icon {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 12px;
}

.module-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start
}
.module-card .subsection-item-content {
    flex: 1 1 auto;
    overflow: hidden;
}
.module-card .subsection-item-title, .module-card .subsection-item-title + .subtitle {
    display: block;
    margin-top: 8px;
}

.module-card:hover {
    transform: translateY(-2px); 
}

.module-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

/* header 中的图标图片：圆形小图，覆盖 .module-card img 的横幅规则 */
.module-header .module-icon-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    margin-right: 12px;
    flex: 0 0 auto;

}

.module-icon {
    width: 40px;
    height: 40px;
    margin-right: 1rem;

    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.module-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.module-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: auto;
}

.badge-high { background: #e74c3c; color: white; }
.badge-medium { background: #f39c12; color: white; }
.badge-low { background: #27ae60; color: white; }

.module-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ====== Site Footer ====== */
.site-footer {
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
    margin-top: 24px;
}
.site-footer__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.site-footer__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: #475569;
    font-size: 14px;
}
.site-footer__item { display: inline-flex; align-items: center; gap: 6px; }
.site-footer__label { color: #0f172a; font-weight: 600; }
.site-footer__text { color: #334155; }
.site-footer__link { color: #2563eb; text-decoration: none; }
.site-footer__link:hover { text-decoration: underline; }

.site-footer__brand { margin-left: auto; }
.site-footer__logo { height: 28px; width: auto; opacity: .9; }

@media (max-width: 768px) {
    .site-footer__inner { flex-direction: column; align-items: flex-start; }
    .site-footer__brand { margin-left: 0; }
}

/* 技术栈表格 */
.tech-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.tech-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
}

.tech-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.tech-name {
    font-weight: 600;
    color: #2c3e50;
}

.tech-version {
    color: #666;
    font-size: 0.9rem;
}

/* 代码块样式 */
.code-block {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 1.5rem;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', monospace;
    overflow-x: auto;
    margin: 1rem 0;
}

/* 步骤样式 */
.steps {
    counter-reset: step-counter;
}

.step {
    counter-increment: step-counter;
    margin-bottom: 1.5rem;
    padding-left: 3rem;
    position: relative;
}

.step::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
   
    font-weight: 600;
}



/* 滚动进度条 */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    z-index: 1000;
    transition: width 0.1s;
}
