@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;700&family=Noto+Sans+JP:wght@400;500;700&family=Noto+Sans+TC:wght@400;500;700&display=swap');

:root {
    --bg-color: #0F0F11;
    --text-color: #ECECF1;
    --accent-color: #3B82F6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --card-bg: #18181B;
    --border-color: #27272A;
    --code-bg: #111113;
}

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

body {
    font-family: 'Inter', 'Noto Sans JP', 'Noto Sans TC', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
header {
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.header-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.lang-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-switch {
    color: #A1A1AA;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.lang-switch:hover,
.lang-switch.active {
    color: var(--text-color);
}

.github-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.github-link:hover {
    color: var(--accent-color);
}

/* Hero */
.hero {
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 3.25rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
    background: linear-gradient(to right, #fff, #9CA3AF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: #A1A1AA;
    max-width: 680px;
    margin: 0 auto 40px;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 14px 32px;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.2s;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

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

.feature-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 32px;
    border-radius: 12px;
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
}

.icon {
    font-size: 24px;
    margin-bottom: 16px;
    display: inline-block;
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #fff;
}

.feature-card p {
    font-size: 0.95rem;
    color: #A1A1AA;
}

/* Code Showcases */
.showcase {
    margin-bottom: 80px;
}

.showcase h2 {
    font-size: 2rem;
    margin-bottom: 32px;
    text-align: center;
}

.showcase .section-intro {
    text-align: center;
}

.showcase .section-intro a {
    color: #fff;
}

.code-block {
    background-color: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    position: relative;
}

.code-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: #1F1F22;
    padding: 8px 24px;
    font-size: 0.8rem;
    color: #71717A;
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
}

.code-content {
    margin-top: 24px;
    color: #D4D4D8;
}

.prompt {
    color: #52525B;
}

.cmd {
    color: var(--accent-color);
}

.arg {
    color: #A5B4FC;
}

.comment {
    color: #52525B;
    font-style: italic;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    padding: 60px 0 80px 0;
    text-align: center;
    color: #52525B;
    font-size: 0.9rem;
}

footer a {
    color: #71717A;
    text-decoration: none;
}

footer a:hover {
    color: var(--accent-color);
}

/* Mobile */
/* Utilities */
.lang-separator {
    color: #52525B;
}

.code-block-spacer {
    margin-bottom: 24px;
}

.footer-github {
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.25rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .github-text {
        display: none;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 0 20px;
    }

    .cta-button {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
}

/* --- Web App Integration --- */

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
}

/* Updated Button Styles */
.cta-button {
    cursor: pointer;
    /* Ensure pointer on buttons */
}

.cta-button.primary {
    background-color: var(--accent-color);
    color: white;
    border: 1px solid transparent;
}

.cta-button.secondary {
    background-color: #ffffff;
    color: #0F0F11;
    border: 1px solid #E4E4E7;
    box-shadow: 0 6px 18px rgba(255, 255, 255, 0.08);
}

.cta-button.secondary:hover {
    background-color: #F4F4F5;
    border-color: #D4D4D8;
    color: #0F0F11;
}

/* Converter Section */
.converter-section {
    padding: 80px 0;
    text-align: center;
    /* Optional background distinction if needed, but keeping simple for now */
}

.converter-section h2 {
    font-size: 2rem;
    margin-bottom: 16px;
    font-weight: 700;
}

.section-intro {
    font-size: 1.1rem;
    color: #A1A1AA;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.converter-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 28px 16px 32px;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent-color);
    background-color: rgba(59, 130, 246, 0.1);
    /* Low opacity blue */
}

.drop-content .icon,
.icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: inline-block;
}

.drop-content h2 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: #fff;
    font-weight: 600;
}

.drop-content p {
    color: #A1A1AA;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 16px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

/* Success/Error States */
#success-state h2 {
    margin-bottom: 24px;
    color: #4ADE80;
    /* Green-400 */
}

#error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-top: 12px;
}

#error-state .icon {
    margin-top: 18px;
    margin-bottom: 4px;
}

#error-state p {
    margin: 6px 0 24px 0;
    color: #F87171;
    /* Red-400 */
}

#success-filename {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-color) !important;
    font-size: 0.95rem;
    word-break: break-all;
}

/* Reset Links */
.reset-container {
    margin-top: 12px;
    color: #7A7A86;
    font-size: 0.75rem;
}

.divider {
    margin: 0 8px;
    opacity: 0.5;
}

.text-link {
    color: var(--accent-color);
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;
    border-bottom: 1px dotted transparent;
}

.text-link:hover {
    color: white;
    border-bottom-color: var(--accent-color);
}