/* ========== 变量定义 ========== */
:root {
    --primary: #1B4D3E;
    --primary-dark: #143D31;
    --primary-light: #2A6F54;
    --accent: #9ACD32;
    --accent-dark: #7CB518;
    --sale: #DC2626;
    --text: #333;
    --text-light: #666;
    --text-muted: #888;
    --bg: #f8f9fa;
    --bg-alt: #f1f3f5;
    --white: #ffffff;
    --border: #e9ecef;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* ========== 基础重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
    line-height: 1.8;
    color: var(--text);
    background: var(--bg);
}

/* ========== 顶部导航栏 ========== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--primary);
    display: flex;
    align-items: center;
    padding: 0 30px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
}

.logo-icon { font-size: 1.6rem; }

/* ========== 两栏布局 ========== */
.page-wrapper {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 60px;
}

/* 左侧边栏 */
.left-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 30px 20px;
    border-right: 1px solid var(--border);
    background: var(--white);
}

.toc-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}

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

.toc-list li {
    margin-bottom: 4px;
}

.toc-list a {
    display: block;
    padding: 10px 12px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.toc-list a:hover {
    background: var(--bg);
    color: var(--primary);
    border-left-color: var(--primary);
}

.toc-list a.active {
    background: rgba(27,77,62,0.08);
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
}

.toc-list .sub-item {
    padding-left: 25px;
    font-size: 0.85rem;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 40px 50px;
    background: var(--white);
}

/* ========== 文章样式 ========== */
.article-header {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.article-header h1 {
    font-size: 2rem;
    color: var(--primary);
    line-height: 1.4;
    margin-bottom: 15px;
}

.article-header .subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
}

.article-section {
    margin-bottom: 50px;
    scroll-margin-top: 80px;
}

.article-section h2 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
}

.article-section h3 {
    font-size: 1.15rem;
    color: var(--text);
    margin: 30px 0 15px;
    padding-left: 15px;
    border-left: 4px solid var(--primary);
}

.article-section h4 {
    font-size: 1.05rem;
    color: var(--text);
    margin: 20px 0 12px;
}

.article-section p {
    margin-bottom: 16px;
    line-height: 1.9;
}

.article-section ul, .article-section ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

.article-section li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.article-section strong { color: var(--primary-dark); }

.article-section a {
    color: var(--primary);
    text-decoration: none;
}

.article-section a:hover {
    text-decoration: underline;
}

/* ========== 代码块 ========== */
pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px 25px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 0.9rem;
    line-height: 1.7;
}

code {
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
}

p code, li code {
    background: var(--bg-alt);
    color: var(--primary);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.comment { color: #6b7280; }

/* ========== 图片 ========== */
.article-image {
    margin: 25px 0;
    text-align: center;
}

.article-image img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.3s;
}

.article-image img:hover { transform: scale(1.02); }

.article-image figcaption {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========== 提示框 ========== */
.alert {
    padding: 18px 22px;
    border-radius: 10px;
    margin: 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

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

.alert-content { flex: 1; }
.alert-content strong { display: block; margin-bottom: 5px; }
.alert-content ul { margin-top: 8px; margin-bottom: 0; }

.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-tip { background: #f5f3ff; border: 1px solid #c4b5fd; color: #5b21b6; }

/* ========== 功能特点网格 ========== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 25px 0;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.feature-item .feature-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.feature-item strong {
    display: block;
    margin-bottom: 4px;
}

.feature-item p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ========== 名称演变历史 ========== */
.name-history {
    text-align: center;
    padding: 20px;
    background: var(--bg);
    border-radius: 10px;
    margin: 25px 0;
}

.name-history h4 {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.timeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.timeline-item {
    padding: 8px 16px;
    background: var(--white);
    border-radius: 6px;
    font-weight: 500;
    border: 1px solid var(--border);
}

.timeline-item.current {
    background: rgba(27,77,62,0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.timeline-arrow {
    color: var(--text-muted);
}

/* ========== 服务器推荐框 ========== */
.hosting-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.hosting-box.visible {
    opacity: 1;
    transform: translateY(0);
}

.hosting-box h4 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.hosting-box p {
    color: #166534;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.hosting-box .features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.hosting-box .feature {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    font-size: 0.88rem;
    background: white;
    padding: 6px 12px;
    border-radius: 15px;
}

.hosting-box .btn-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.hosting-box .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.hosting-box .btn:hover { background: var(--primary-dark); }

.hosting-box .price-tag {
    background: var(--sale);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.95rem;
}

/* ========== VPS 选项网格 ========== */
.vps-options {
    background: var(--bg);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.vps-options h4 {
    margin-bottom: 15px;
    font-size: 1rem;
}

.vps-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.vps-card {
    display: flex;
    flex-direction: column;
    padding: 15px 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
    min-width: 150px;
}

.vps-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.vps-card.featured {
    border-color: var(--accent);
    border-width: 2px;
}

.vps-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.vps-price {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.vps-badge {
    position: absolute;
    top: -8px;
    right: 10px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.vps-tip {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* ========== 配置向导步骤 ========== */
.wizard-steps {
    margin: 20px 0;
}

.wizard-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 10px;
}

.wizard-num {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.wizard-item strong {
    display: block;
    margin-bottom: 4px;
}

.wizard-item p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ========== 表格 ========== */
.config-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.config-table th, .config-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.config-table th {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.config-table tr:last-child td { border-bottom: none; }
.config-table tr:hover { background: var(--bg); }

/* ========== FAQ 折叠面板 ========== */
.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child { border-bottom: none; }

.faq-question {
    padding: 18px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--text);
    transition: color 0.3s;
}

.faq-question:hover { color: var(--primary); }

.faq-question .icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
    color: var(--primary);
}

.faq-item.active .faq-question .icon { transform: rotate(45deg); }

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer { max-height: 300px; }

.faq-answer-content {
    padding-bottom: 18px;
    color: var(--text-light);
    line-height: 1.8;
}

/* ========== 底部 CTA ========== */
.footer-cta {
    background: var(--primary);
    border-radius: 16px;
    padding: 50px 40px;
    text-align: center;
    margin: 50px 0 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.footer-cta.visible {
    opacity: 1;
    transform: translateY(0);
}

.footer-cta h2 {
    color: white;
    font-size: 1.6rem;
    margin-bottom: 12px;
    border: none;
}

.footer-cta p {
    color: rgba(255,255,255,0.8);
    margin-bottom: 25px;
}

.footer-cta .btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent);
    color: var(--primary-dark);
    padding: 15px 35px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    transition: all 0.3s;
}

.footer-cta .btn:hover { background: white; }

.footer-cta .price-note {
    display: block;
    margin-top: 15px;
    color: var(--accent);
    font-weight: 600;
}

/* ========== 页脚 ========== */
footer {
    background: var(--primary-dark);
    padding: 30px;
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

.footer-note {
    margin-top: 10px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

/* ========== 图片放大框 ========== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.lightbox.active { display: flex; }

.lightbox img {
    max-width: 95%;
    max-height: 95%;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
    .left-sidebar { width: 220px; }
    .main-content { padding: 30px; }
}

@media (max-width: 900px) {
    .left-sidebar { display: none; }
    .main-content { padding: 30px 20px; }
    .features-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    header { padding: 0 15px; }
    .article-header h1 { font-size: 1.6rem; }
    .hosting-box .features { flex-direction: column; }
    .hosting-box .btn-row { flex-direction: column; align-items: stretch; }
    .vps-grid { flex-direction: column; }
    .vps-card { width: 100%; }
}

@media (max-width: 480px) {
    .main-content { padding: 20px 15px; }
    .article-section h2 { font-size: 1.3rem; }
    .footer-cta { padding: 30px 20px; }
    .footer-cta h2 { font-size: 1.3rem; }
}
