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

:root {
    --bg: #09090B;
    --bg-secondary: #111113;
    --bg-card: #18181B;
    --bg-card-hover: #1F1F23;
    --bg-input: #0C0C0E;
    --border: #27272A;
    --border-focus: #6366F1;
    --text: #FAFAFA;
    --text-secondary: #A1A1AA;
    --text-muted: #71717A;
    --text-inverse: #09090B;
    --primary: #6366F1;
    --primary-hover: #818CF8;
    --primary-foreground: #FFFFFF;
    --secondary: #8B5CF6;
    --success: #22C55E;
    --warning: #F59E0B;
    --error: #EF4444;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --transition: 150ms ease;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

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

img {
    max-width: 100%;
    display: block;
}

::selection {
    background-color: rgba(99, 102, 241, 0.3);
    color: var(--text);
}

:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

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

@media (min-width: 768px) {
    .container {
        padding: 0 32px;
    }
}

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: 64px;
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

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

.nav-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.nav-logo svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.nav-links {
    display: none;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
}

.nav-links a.active {
    color: var(--primary);
}

.nav-mobile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }

    .nav-mobile-btn {
        display: none;
    }
}

.nav-mobile-menu {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    z-index: 40;
}

.nav-mobile-menu.open {
    display: block;
}

.nav-mobile-menu a {
    display: block;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.nav-mobile-menu a:last-child {
    border-bottom: none;
}

.nav-mobile-menu a:hover {
    color: var(--text);
}

.hero {
    padding-top: 120px;
    padding-bottom: 80px;
    text-align: center;
}

@media (min-width: 768px) {
    .hero {
        padding-top: 140px;
        padding-bottom: 100px;
    }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 100px;
    margin-bottom: 24px;
}

.hero-badge-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

.hero h1 {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 20px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .hero h1 {
        font-size: 52px;
    }
}

.hero h1 .highlight {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 36px;
}

@media (min-width: 768px) {
    .hero p {
        font-size: 18px;
    }
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-examples {
    margin-top: 64px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-example-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    transition: border-color var(--transition);
}

.hero-example-card:hover {
    border-color: var(--primary);
}

.hero-example-card svg {
    max-width: 80px;
    max-height: 80px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: var(--primary-foreground);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg-card);
    border-color: var(--text-muted);
    color: var(--text);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}

.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text);
}

.btn-lg {
    font-size: 15px;
    padding: 12px 24px;
}

.btn-sm {
    font-size: 13px;
    padding: 6px 14px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.section {
    padding: 80px 0;
}

@media (min-width: 768px) {
    .section {
        padding: 100px 0;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .section-header h2 {
        font-size: 34px;
    }
}

.section-header p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all var(--transition);
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: rgba(99, 102, 241, 0.1);
    margin-bottom: 16px;
}

.card-icon svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.card-icon.violet {
    background: rgba(139, 92, 246, 0.1);
}

.card-icon.violet svg {
    color: var(--secondary);
}

.card-icon.green {
    background: rgba(34, 197, 94, 0.1);
}

.card-icon.green svg {
    color: var(--success);
}

.card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
}

.card p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
}

.input-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

textarea,
select {
    width: 100%;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    transition: border-color var(--transition);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

textarea::placeholder {
    color: var(--text-muted);
}

textarea:focus,
select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.tool-layout {
    padding-top: 88px;
    padding-bottom: 60px;
    min-height: calc(100vh - 64px);
}

@media (min-width: 768px) {
    .tool-layout {
        padding-top: 88px;
    }
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 1024px) {
    .tool-grid {
        grid-template-columns: 400px 1fr;
        gap: 32px;
    }
}

.tool-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.tool-panel h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-panel h2 svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.usage-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.usage-bar-count {
    font-weight: 500;
    color: var(--text-secondary);
}

.result-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.result-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    gap: 12px;
}

.result-empty svg {
    width: 48px;
    height: 48px;
    opacity: 0.3;
}

.result-empty p {
    font-size: 14px;
}

.result-content {
    display: none;
    flex-direction: column;
    flex: 1;
    gap: 20px;
}

.result-content.active {
    display: flex;
}

.result-preview {
    background: #FFFFFF;
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    overflow: hidden;
}

.result-preview svg {
    max-width: 100%;
    max-height: 300px;
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.result-code-toggle {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 0;
    transition: color var(--transition);
}

.result-code-toggle:hover {
    color: var(--text);
}

.result-code {
    display: none;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    max-height: 240px;
    overflow: auto;
}

.result-code.active {
    display: block;
}

.result-code pre {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
}

.loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(9, 9, 11, 0.8);
    border-radius: var(--radius-lg);
    z-index: 10;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
    font-size: 14px;
    color: var(--text-secondary);
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-area svg {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
    margin: 0 auto 12px;
}

.upload-area p {
    font-size: 14px;
    color: var(--text-secondary);
}

.upload-area .upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.upload-preview {
    display: none;
    margin-top: 16px;
}

.upload-preview.active {
    display: block;
}

.upload-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    margin: 0 auto;
}

.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.compare-item {
    text-align: center;
}

.compare-item-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.compare-item-content {
    background: #FFFFFF;
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    overflow: hidden;
}

.compare-item-content img,
.compare-item-content svg {
    max-width: 100%;
    max-height: 180px;
}

.steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 800px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .steps {
        grid-template-columns: repeat(3, 1fr);
    }
}

.step {
    text-align: center;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.step h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.step p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.cta-section {
    text-align: center;
    padding: 80px 0;
}

.cta-section h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .cta-section h2 {
        font-size: 34px;
    }
}

.cta-section p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 32px;
}

footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

@media (min-width: 768px) {
    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer-brand {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.footer-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.footer-links a {
    font-size: 14px;
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--text);
}

.footer-copy {
    font-size: 13px;
    color: var(--text-muted);
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 100;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background: var(--success);
    color: #FFFFFF;
}

.toast-error {
    background: var(--error);
    color: #FFFFFF;
}

.toast-warning {
    background: var(--warning);
    color: #09090B;
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    padding-top: 80px;
    padding-bottom: 0;
}

.breadcrumb a {
    color: var(--text-muted);
}

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

.breadcrumb span {
    margin: 0 8px;
}

.text-mono {
    font-family: var(--font-mono);
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 16px;
}

.mt-6 {
    margin-top: 24px;
}

.hidden {
    display: none !important;
}

@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}
