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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

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

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.3);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

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

.nav-container > div:last-child {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.logo-image {
    height: 70px;
    width: auto;
    /* 将黑色logo变为白色，适合深色导航栏 */
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
}

.nav-logo:hover .logo-image {
    filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 6px;
}

.nav-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* 语言切换器 */
.language-selector {
    display: flex;
    gap: 8px;
    margin-left: 20px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    height: 34px;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.lang-btn.active {
    background: white;
    color: #dc2626;
    border-color: white;
}

.hero-author {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 10px;
    font-style: italic;
}

/* 主页面 */
.hero {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
    color: white;
    padding: 140px 0 80px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-content {
    animation: fadeInLeft 1s ease-out;
}

.hero-title {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
}

.hero-main-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0;
    color: white;
}

.hero-text {
    flex: 1;
}

.hero-logo {
    height: 100px;
    width: auto;
    /* 将黑色logo变为白色，适合深色Hero背景 */
    filter: brightness(0) invert(1);
    animation: logoGlow 2s ease-in-out infinite alternate;
    flex-shrink: 0;
}

@keyframes logoGlow {
    from {
        filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    }
    to {
        filter: brightness(0) invert(1) drop-shadow(0 0 20px rgba(255, 255, 255, 0.6));
    }
}

.hero-subtitle {
    font-size: 1.4rem;
    margin: 10px 0 0 0;
    color: #fecaca;
    font-weight: 600;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #fed7d7;
    font-style: italic;
}

.hero-badges {
    margin-bottom: 40px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-badges img {
    height: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: white;
    color: #dc2626;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    background: #f9fafb;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.4);
}

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

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

/* 代码窗口 */
.hero-code {
    animation: fadeInRight 1s ease-out;
}

.code-window {
    background: #1f2937;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid #374151;
    position: relative;
}

.code-window::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.code-header {
    background: #374151;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.code-dots {
    display: flex;
    gap: 6px;
}

.code-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6b7280;
}

.code-dots span:nth-child(1) { background: #ef4444; }
.code-dots span:nth-child(2) { background: #f59e0b; }
.code-dots span:nth-child(3) { background: #10b981; }

.code-title {
    color: #d1d5db;
    font-size: 0.9rem;
    font-weight: 500;
}

.code-content {
    padding: 25px;
    overflow-x: auto;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.code-content::-webkit-scrollbar {
    height: 8px;
}

.code-content::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 4px;
}

.code-content::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 4px;
}

.code-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.code-content pre {
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.7;
    font-weight: 400;
    letter-spacing: 0.025em;
}

.code-content code {
    color: #e5e7eb;
    font-family: inherit;
}

/* 特性部分 */
.features {
    padding: 100px 0;
    background: #f9fafb;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 60px;
    color: #1f2937;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #dc2626, #b91c1c);
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 80px;
}

.feature-card {
    background: white;
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #f3f4f6;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(220, 38, 38, 0.15);
    border-color: #fecaca;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
}

.feature-icon i {
    font-size: 2rem;
    color: white;
}

.feature-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1f2937;
}

.feature-card p {
    color: #6b7280;
    line-height: 1.7;
}

/* 对比部分 */
.comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 60px;
}

.comparison-item {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.comparison-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comparison-title.bad {
    color: #dc2626;
}

.comparison-title.good {
    color: #059669;
}

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

.comparison-list li {
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
}

.comparison-list i {
    font-size: 1.1rem;
}

.comparison-list .fa-times {
    color: #dc2626;
}

.comparison-list .fa-check {
    color: #059669;
}

/* 快速开始部分 */
.quickstart {
    padding: 100px 0;
    background: white;
}

.quickstart-steps {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.step {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1f2937;
}

.code-block {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: 12px;
    padding: 25px;
    overflow-x: auto;
    border: 1px solid #374151;
}

.code-block::-webkit-scrollbar,
.code-example::-webkit-scrollbar {
    height: 8px;
}

.code-block::-webkit-scrollbar-track,
.code-example::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 4px;
}

.code-block::-webkit-scrollbar-thumb,
.code-example::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 4px;
}

.code-block::-webkit-scrollbar-thumb:hover,
.code-example::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.code-block pre {
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #e5e7eb;
    font-weight: 400;
    letter-spacing: 0.025em;
}

/* 示例部分 */
.examples {
    padding: 100px 0;
    background: #f9fafb;
}

.examples-tabs {
    max-width: 1000px;
    margin: 0 auto;
}

.tab-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active,
.tab-btn:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
    transform: translateY(-2px);
}

.tab-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.tab-panel {
    display: none;
}

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

.tab-panel h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: #1f2937;
}

.code-example {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: 12px;
    padding: 30px;
    overflow-x: auto;
    border: 1px solid #374151;
}

.code-example pre {
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    color: #e5e7eb;
    font-weight: 400;
    letter-spacing: 0.025em;
}

/* 联系部分 */
.contact {
    padding: 100px 0;
    background: white;
}

.contact-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: #f9fafb;
    border-radius: 12px;
    border-left: 4px solid #dc2626;
}

.contact-item i {
    font-size: 2rem;
    color: #dc2626;
    width: 50px;
    text-align: center;
}

.contact-item h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #1f2937;
}

.contact-item p {
    color: #6b7280;
    margin: 0;
}

.contact-item a {
    color: #dc2626;
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

.support-section {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
}

.support-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.support-section p {
    margin-bottom: 30px;
    line-height: 1.7;
    color: #fecaca;
}

/* 页脚 */
.footer {
    background: #1f2937;
    color: white;
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.footer-logo-image {
    height: 50px;
    width: auto;
    /* 将黑色logo变为红色 #dc2626，适合页脚 */
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%);
}

.footer-left p {
    color: #9ca3af;
    line-height: 1.7;
}

.footer-links {
    display: flex;
    gap: 60px;
}

.footer-column h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #dc2626;
}

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

.footer-column li {
    margin-bottom: 10px;
}

.footer-column a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 30px;
    text-align: center;
    color: #9ca3af;
}

/* 动画 */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Prism.js 自定义样式 */
.code-content pre[class*="language-"],
.code-block pre[class*="language-"],
.code-example pre[class*="language-"] {
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

.code-content code[class*="language-"],
.code-block code[class*="language-"],
.code-example code[class*="language-"] {
    background: transparent !important;
    color: #e5e7eb !important;
    text-shadow: none !important;
}

/* 行号样式 */
.line-numbers .line-numbers-rows {
    border-right: 1px solid #374151 !important;
    background: rgba(55, 65, 81, 0.3) !important;
}

.line-numbers-rows > span:before {
    color: #6b7280 !important;
}

/* 自定义语法高亮颜色 */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #6b7280 !important;
}

.token.punctuation {
    color: #e5e7eb !important;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #f472b6 !important;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #10b981 !important;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #06b6d4 !important;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #f59e0b !important;
}

.token.function,
.token.class-name {
    color: #3b82f6 !important;
}

.token.regex,
.token.important,
.token.variable {
    color: #f97316 !important;
}

.token.annotation {
    color: #8b5cf6 !important;
}

/* 改善代码块的整体外观 */
.code-window,
.code-block,
.code-example {
    position: relative;
    overflow: hidden;
}

/* 复制按钮样式 */
.copy-btn {
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

.code-window:hover .copy-btn,
.code-block:hover .copy-btn,
.code-example:hover .copy-btn,
.code-content:hover .copy-btn {
    opacity: 1;
}

/* Prism.js 工具栏样式覆盖 */
div.code-toolbar {
    position: relative;
}

div.code-toolbar > .toolbar {
    position: absolute;
    top: 0.3em;
    right: 0.3em;
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
}

div.code-toolbar:hover > .toolbar {
    opacity: 1;
}

div.code-toolbar > .toolbar .toolbar-item {
    display: inline-block;
}

div.code-toolbar > .toolbar a,
div.code-toolbar > .toolbar button,
div.code-toolbar > .toolbar span {
    color: white !important;
    background: #dc2626 !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 0.8rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

div.code-toolbar > .toolbar a:hover,
div.code-toolbar > .toolbar button:hover {
    background: #b91c1c !important;
    transform: translateY(-2px) !important;
}

.code-window::before,
.code-block::before,
.code-example::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* 代码行号样式（可选） */
.code-with-lines {
    counter-reset: line;
}

.code-with-lines pre {
    padding-left: 3em;
}

.code-with-lines pre::before {
    counter-increment: line;
    content: counter(line);
    position: absolute;
    left: 1em;
    color: #6b7280;
    font-size: 0.8em;
    line-height: inherit;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-logo {
        height: 70px;
    }
    
    .logo-image {
        height: 55px;
    }
    
    .footer-logo-image {
        height: 40px;
    }
    
    .hero-title {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }
    
    .hero-main-title {
        font-size: 2.5rem;
    }
    
    .nav-container {
        height: 85px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .language-selector {
        margin-left: 0;
    }
    
    .lang-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    
    .comparison {
        grid-template-columns: 1fr;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .tab-buttons {
        flex-direction: column;
        align-items: center;
    }
}