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

:root {
    --primary-color: #ff6b35;
    --secondary-color: #f7931e;
    --dark-color: #1a1a1a;
    --light-color: #f8f9fa;
    --text-color: #333;
    --text-secondary: #666;
    --border-color: #e9ecef;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-logo i {
    margin-right: 0.5rem;
    font-size: 2rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.cta {
    background: var(--gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: transform 0.3s ease;
}

.nav-link.cta:hover {
    transform: translateY(-2px);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

.hero-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-title .highlight {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 10px 25px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-3px);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tech-stack {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: center;
    /* 确保在移动端也能合理布局 */
    grid-auto-flow: row;
}

.tech-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.tech-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.tech-item i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.tech-item span {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Section Styles */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--dark-color);
}

/* Features Section */
.features {
    padding: 80px 0;
    background: white;
}

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

.feature-card {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    z-index: 20;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Architecture Section */
.architecture {
    padding: 80px 0;
    background: var(--light-color);
}

.architecture-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.architecture-diagram {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.layer {
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    color: white;
    font-weight: 600;
    position: relative;
}

.layer.frontend {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.layer.backend {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.layer.distributed {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.layer.storage {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.layer h4 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.layer p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.architecture-info h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.architecture-info ul {
    list-style: none;
}

.architecture-info li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    color: var(--text-secondary);
}

.architecture-info i {
    color: var(--success-color);
    margin-right: 0.5rem;
}

/* Benefits Section */
.benefits {
    padding: 80px 0;
    background: white;
}

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

.benefit-item {
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.benefit-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 1rem;
    opacity: 0.1;
}

.benefit-item h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.benefit-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Get Started Section */
.get-started {
    padding: 80px 0;
    background: var(--light-color);
}

.get-started-content {
    max-width: 800px;
    margin: 0 auto;
    /* 确保容器能正确处理内容宽度 */
    width: 100%;
    box-sizing: border-box;
}

.install-steps {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.step {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    /* 确保步骤不会超出容器 */
    width: 100%;
    box-sizing: border-box;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    /* 确保内容区域正确处理宽度 */
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.step-content h4 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
    /* 确保标题不换行 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
    /* 确保段落文字正确换行 */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

pre {
    background: var(--dark-color);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    /* 基础宽度设置 */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-align: left;
    display: block;
    margin: 1rem 0;
    /* 代码格式保持 */
    white-space: pre;
    word-wrap: normal;
    word-break: normal;
    /* 滚动优化 */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    /* 防止撑破容器 */
    contain: layout;
    /* Flex 布局修复 */
    flex-shrink: 1;
    min-width: 0;
}

/* 自定义滚动条样式 */
pre::-webkit-scrollbar {
    height: 8px;
}

pre::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

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

code {
    font-family: 'Courier New', monospace;
    text-align: left;
    display: inline-block;
    /* 防止内联代码撑破容器 */
    word-break: break-all;
    overflow-wrap: break-word;
}

/* 确保包含代码块的容器正确处理宽度 */
.step-content,
.feature-card,
.container {
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* 代码块在容器中的优化 */
.step-content pre,
.feature-card pre {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    opacity: 0.8;
    line-height: 1.6;
}

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

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    opacity: 0.8;
}

.footer-bottom a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .tech-stack {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* 移动端横屏优化 - tech-stack */
    @media (max-width: 768px) and (orientation: landscape) {
        .tech-stack {
            grid-template-columns: repeat(3, 1fr);
            gap: 0.8rem;
        }
        
        .tech-item {
            padding: 1.2rem;
        }
        
        .tech-item i {
            font-size: 2rem;
            margin-bottom: 0.5rem;
        }
        
        .tech-item span {
            font-size: 0.9rem;
        }
    }

    .architecture-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .step {
        flex-direction: column;
        text-align: left;
        gap: 1rem;
    }

    .step-number {
        margin: 0 auto;
    }

    .step-content {
        text-align: left;
        width: 100%;
    }

    .step-content h4 {
        text-align: left;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
    
    /* 移动端横屏优化 */
    @media (max-width: 768px) and (orientation: landscape) {
        .features-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 1.5rem;
        }
        
        .feature-card {
            padding: 1.5rem;
        }
        
        .feature-icon {
            width: 60px;
            height: 60px;
            font-size: 1.5rem;
            margin-bottom: 1rem;
        }
        
        .feature-card h3 {
            font-size: 1.2rem;
            margin-bottom: 0.8rem;
        }
        
        .feature-card p {
            font-size: 0.9rem;
            line-height: 1.4;
        }
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    /* Fix for code blocks on mobile */
    pre {
        font-size: 0.8rem;
        line-height: 1.3;
        padding: 0.8rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        text-align: left;
        white-space: pre;
        word-wrap: normal;
        word-break: normal;
        margin: 0.8rem 0;
        border-radius: 6px;
        min-width: 0;
        flex-shrink: 1;
    }
    
    /* 移动端滚动条优化 */
    pre::-webkit-scrollbar {
        height: 6px;
    }
    
    pre::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.4);
        border-radius: 3px;
    }

    code {
        font-size: 0.8rem;
        text-align: left;
        word-wrap: normal;
        word-break: normal;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .feature-card {
        padding: 2rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    /* 小屏幕横屏优化 - tech-stack */
    @media (max-width: 480px) and (orientation: landscape) {
        .tech-stack {
            grid-template-columns: repeat(3, 1fr);
            gap: 0.6rem;
        }
        
        .tech-item {
            padding: 1rem;
        }
        
        .tech-item i {
            font-size: 1.8rem;
            margin-bottom: 0.4rem;
        }
        
        .tech-item span {
            font-size: 0.8rem;
        }
    }
    
    /* 小屏幕横屏优化 */
    @media (orientation: landscape) {
        .features-grid {
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
        }
        
        .feature-card {
            padding: 1rem;
        }
        
        .feature-icon {
            width: 50px;
            height: 50px;
            font-size: 1.2rem;
            margin-bottom: 0.8rem;
        }
        
        .feature-card h3 {
            font-size: 1rem;
            margin-bottom: 0.5rem;
        }
        
        .feature-card p {
            font-size: 0.8rem;
            line-height: 1.3;
        }
    }

    /* Enhanced fix for code blocks on very small screens */
    pre {
        font-size: 0.7rem;
        line-height: 1.2;
        padding: 0.6rem;
        margin: 0.5rem 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        border-radius: 6px;
        text-align: left;
        white-space: pre;
        word-wrap: normal;
        word-break: normal;
        min-width: 0;
        flex-shrink: 1;
        overscroll-behavior-x: contain;
    }
    
    /* 超小屏幕滚动条 */
    pre::-webkit-scrollbar {
        height: 4px;
    }
    
    pre::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.5);
        border-radius: 2px;
    }

    code {
        font-size: 0.7rem;
        text-align: left;
        word-wrap: normal;
        word-break: normal;
    }

    /* Fix for step content on very small screens */
    .step-content {
        text-align: left;
        padding: 0 1rem;
    }

    .step-content h4 {
        text-align: left;
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .step-content pre {
        margin: 0.5rem 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}