/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6C5CE7;
    --primary-dark: #5A4BD1;
    --bg: #0F0F1A;
    --bg-alt: #161625;
    --surface: #1E1E30;
    --text: #E8E8F0;
    --text-muted: #9090A8;
    --border: #2A2A40;
    --radius: 12px;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === Navbar === */
.navbar {
    background: rgba(15, 15, 26, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

.lang-switch {
    display: flex;
    gap: 8px;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
}

.lang-switch a {
    font-size: 0.8rem !important;
    padding: 2px 6px;
    border-radius: 4px;
}

.lang-switch a.active-lang {
    color: var(--text) !important;
    background: rgba(108, 92, 231, 0.2);
}

/* === Hero === */
.hero {
    padding: 120px 20px 40px;
    text-align: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(108, 92, 231, 0.15) 0%, transparent 60%);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 550px;
    margin: 0 auto 40px;
}

.cta-button {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 14px 40px;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.cta-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    color: #fff;
}

.hero-note {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* === Sections === */
.section {
    padding: 60px 20px;
}

.section-alt {
    background: var(--bg-alt);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 50px;
    letter-spacing: -0.5px;
}

/* === Steps === */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
}

.step {
    text-align: center;
    padding: 40px 24px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    position: relative;
}

.step-number {
    position: absolute;
    top: 16px;
    left: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(108, 92, 231, 0.15);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.step h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.step p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* === Features === */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.feature-card {
    padding: 32px 24px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

.feature-card:hover {
    border-color: var(--primary);
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text);
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* === FAQ === */
.faq-list {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-question {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.faq-answer {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* === CTA Section === */
.cta-section {
    text-align: center;
    background: radial-gradient(ellipse at 50% 100%, rgba(108, 92, 231, 0.12) 0%, transparent 60%);
}

.cta-section h2 {
    font-size: 1.8rem;
    margin-bottom: 24px;
}

/* === Tool Page === */
.tool-section {
    padding-top: 100px;
}

.tool-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.tool-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.gradio-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 40px;
}

.gradio-iframe {
    width: 100%;
    height: 850px;
    border: none;
    display: block;
}

.tips {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-top: 32px;
}

.tips h2 {
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.tips ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tips li {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding-left: 20px;
    position: relative;
}

.tips li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* === Ad Container === */
.ad-container {
    max-width: 728px;
    margin: 0 auto;
    text-align: center;
    overflow: hidden;
    min-height: 280px;
}

/* === Blog === */
.blog-page {
    padding-top: 80px;
    min-height: 100vh;
}

.blog-container {
    max-width: 800px;
}

.blog-page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.blog-page-subtitle {
    color: var(--text-muted);
    margin-bottom: 40px;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blog-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    transition: border-color 0.2s;
}

.blog-card:hover {
    border-color: var(--primary);
}

.blog-card h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.blog-card-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
    line-height: 1.6;
}

.blog-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.blog-read-more {
    color: var(--primary);
}

/* Blog Article */
.blog-article-header {
    margin-bottom: 32px;
}

.blog-article-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.blog-article-meta {
    display: flex;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.blog-article-body {
    line-height: 1.8;
    color: var(--text);
}

.blog-article-body h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 32px 0 12px;
    color: var(--text);
}

.blog-article-body h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 24px 0 8px;
    color: var(--text);
}

.blog-article-body p {
    margin-bottom: 16px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.blog-article-body ul {
    margin-bottom: 16px;
    padding-left: 24px;
}

.blog-article-body li {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 8px;
    line-height: 1.6;
}

.blog-article-body a {
    color: var(--primary);
    text-decoration: underline;
}

.blog-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.blog-article-body th,
.blog-article-body td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.blog-article-body th {
    background: var(--surface);
    color: var(--text);
}

.blog-related {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.blog-related h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.blog-related-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.blog-related-item {
    color: var(--primary);
    font-size: 0.9rem;
    text-decoration: none;
}

.blog-related-item:hover {
    text-decoration: underline;
}

.blog-back-btn {
    display: inline-block;
    margin-top: 24px;
}

/* === Footer === */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* === Responsive === */
@media (max-width: 768px) {
    .nav-links {
        gap: 16px;
    }

    .hero {
        padding: 100px 20px 30px;
    }

    .section {
        padding: 60px 20px;
    }

    .gradio-iframe {
        height: 700px;
    }
}

@media (max-width: 480px) {
    .nav-links {
        display: none;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .gradio-iframe {
        height: 600px;
    }
}
