/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8fafc;
    overflow-x: hidden;
}

/* 移动端菜单切换按钮 */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: #667eea;
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* 左侧边栏 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.sidebar-header .subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.4;
}

/* QR Code 在侧边栏中的样式 */
.sidebar .qr-code-container {
    position: static;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.sidebar .qr-code-wrapper {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.75rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar #qr-code-image {
    max-width: 80px;
    max-height: 80px;
    border-radius: 6px;
}

.sidebar .qr-code-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: rgba(255, 255, 255, 0.9);
}

/* 导航菜单 */
.nav-menu {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: rgba(255, 255, 255, 0.3);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: white;
    font-weight: 600;
}

.nav-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-text {
    font-size: 0.95rem;
}

/* 主内容区域 */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    background: #f8fafc;
    transition: margin-left 0.3s ease;
}

/* 内容区块 */
.content-section {
    display: none;
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-in-out;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 2rem;
    text-align: center;
}

.section-header h2 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.section-header p {
    color: #718096;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* 主要操作按钮 */
.main-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-height: 60px;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.action-icon {
    font-size: 1.2rem;
}

/* 按钮主题色 */
.install-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.install-button:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.api-button {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.api-button:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.git-bash-button {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.git-bash-button:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.wiki-button {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.wiki-button:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

/* 一键安装卡片 */
.quick-install-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.quick-install-card h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    text-align: center;
}

.quick-install-card p {
    color: #4a5568;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* 系统要求卡片 */
.requirements-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.requirements-card h3 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    text-align: center;
}

.requirements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.req-icon {
    font-size: 1.2rem;
}

/* 安装方法 */
.install-method {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.install-method h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.install-command-card {
    background: #2d3748;
    border-radius: 12px;
    overflow: hidden;
    margin: 1rem 0;
}

.command-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.command-header h4 {
    margin: 0;
    font-size: 1rem;
}

/* 步骤容器 */
.steps-container {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.step-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.2s ease;
}

.step-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* 配置标签页 */
.config-tabs {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.tab-buttons {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tab-button {
    flex: 1;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #718096;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-button.active {
    color: #667eea;
    background: white;
    border-bottom-color: #667eea;
}

.tab-button:hover:not(.active) {
    background: #edf2f7;
    color: #4a5568;
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

/* 环境变量和配置文件 */
.env-vars, .config-files {
    display: grid;
    gap: 1.5rem;
}

.env-item, .config-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid #667eea;
}

.env-item h4, .config-item h4 {
    color: #2d3748;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.env-note {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #e0f2fe;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #0369a1;
    border-left: 3px solid #0ea5e9;
}

/* 配置说明 */
.config-notes {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.config-notes h3 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.note-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
}

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

.note-item strong {
    color: #2d3748;
}

/* 使用指南网格 */
.usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.usage-item {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.usage-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.usage-item h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.usage-note {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #718096;
    font-style: italic;
}

/* 卸载步骤 */
.uninstall-steps {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.uninstall-step {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.2s ease;
}

.uninstall-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.uninstall-step .step-number {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.env-cleanup {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.cleanup-item {
    background: #fef2f2;
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid #ef4444;
}

.cleanup-item h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.cleanup-item p {
    color: #4a5568;
    font-size: 0.9rem;
    margin: 0;
}

.verify-note {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f0fdf4;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #166534;
    border-left: 3px solid #22c55e;
}

.uninstall-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border-left: 4px solid #f59e0b;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.1);
}

.warning-icon {
    font-size: 1.5rem;
    color: #d97706;
    flex-shrink: 0;
}

.warning-content h3 {
    color: #92400e;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.warning-content ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.warning-content li {
    padding: 0.25rem 0;
    position: relative;
    padding-left: 1.5rem;
    color: #78350f;
}

.warning-content li::before {
    content: '⚠️';
    position: absolute;
    left: 0;
    font-size: 0.9rem;
}

/* FAQ 网格 */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.faq-item {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.faq-item h3 {
    color: #2d3748;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.faq-item p {
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
}

/* 命令包装器 */
.command-wrapper {
    position: relative;
    margin-top: 0.75rem;
}

.command-wrapper .copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
}

/* 代码块样式 */
pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    margin: 0;
}

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

code {
    background: #e2e8f0;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
}

/* 复制按钮样式 */
.copy-button {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.copy-button:active {
    transform: translateY(0);
}

.api-key-note {
    margin-top: 1rem;
    padding: 1rem;
    background: #fef3c7;
    border-radius: 8px;
    border-left: 4px solid #fbbf24;
    color: #92400e;
    font-size: 0.9rem;
}

/* 错误消息样式 */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
}

.error-content {
    background: #fed7d7;
    color: #c53030;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.error-close {
    background: none;
    border: none;
    color: #c53030;
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: auto;
}

/* 加载状态样式 */
#loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 动画 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .sidebar {
        width: 260px;
    }
    
    .main-content {
        margin-left: 260px;
    }
    
    .content-section {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-section {
        padding: 1rem;
        padding-top: 5rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .main-actions {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .requirements-grid {
        grid-template-columns: 1fr;
    }
    
    .usage-grid {
        grid-template-columns: 1fr;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .step-card, .uninstall-step {
        flex-direction: column;
        text-align: center;
    }
    
    .uninstall-warning {
        flex-direction: column;
        text-align: center;
    }
    
    .tab-buttons {
        flex-direction: column;
    }
    
    .tab-button {
        border-bottom: none;
        border-right: 3px solid transparent;
    }
    
    .tab-button.active {
        border-right-color: #667eea;
        border-bottom-color: transparent;
    }
}

@media (max-width: 480px) {
    .content-section {
        padding: 0.75rem;
        padding-top: 4.5rem;
    }
    
    .section-header h2 {
        font-size: 1.3rem;
    }
    
    .install-method, .requirements-card, .config-tabs, .config-notes, .uninstall-warning {
        padding: 1.25rem;
    }
    
    .step-card, .uninstall-step, .usage-item, .faq-item {
        padding: 1.25rem;
    }
    
    .action-button {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
        min-height: 50px;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    pre {
        font-size: 0.8rem;
        padding: 0.75rem 1rem;
    }
    
    .copy-button {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
}

/* 键盘导航样式 */
.keyboard-navigation *:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}