* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --primary-light: #a78bfa;
    --success: #28a745;
    --success-dark: #218838;
    --error: #ef4444;
    --warning: #f59e0b;
    --dark-bg: #f8f9fa;
    --surface: #ffffff;
    --surface-light: #f1f5f9;
    --border: #e2e8f0;
    --text: #1f2937;
    --text-muted: #475569;
    --text-dim: #94a3b8;
    --mono: 'JetBrains Mono', 'Consolas', monospace;
    --sans: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: var(--sans);
    min-height: 100vh;
    padding: 24px 20px;
    color: var(--text);
}

body.dark-theme {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    --dark-bg: #1e293b;
    --surface: #0f172a;
    --surface-light: #334155;
    --border: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Navigation */
.site-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 7px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.28);
    color: white;
}

.nav-separator {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

/* Breadcrumb */
.breadcrumb-nav {
    margin-bottom: 16px;
}

.breadcrumb {
    list-style: none;
    display: flex;
    gap: 6px;
    font-size: 0.88rem;
    flex-wrap: wrap;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.85);
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: opacity 0.2s;
}

.breadcrumb a:hover {
    opacity: 0.75;
    text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
    color: white;
    font-weight: 600;
}

/* Tool Switcher */
.tool-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 10px 16px;
    margin-bottom: 16px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.tool-switcher-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
    white-space: nowrap;
}

.tool-switch-btn {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
    white-space: nowrap;
}

.tool-switch-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.tool-switch-btn.active {
    background: white;
    color: #8b5cf6;
    font-weight: 700;
    border-color: white;
    pointer-events: none;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
    animation: fadeInDown 0.5s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 8px;
}

.header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}

.badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    padding: 4px 14px;
    font-size: 0.75rem;
    font-family: var(--mono);
    color: white;
    margin-top: 12px;
}

/* Main Card */
.card {
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    background: var(--dark-bg);
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.card-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Options Bar */
.options-bar {
    padding: 16px 28px;
    background: var(--dark-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
}

.option-group input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--primary);
}

.option-select {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 10px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.8rem;
    cursor: pointer;
}

/* File Upload Area */
.file-upload-area {
    margin: 16px 28px;
    padding: 24px;
    background: var(--dark-bg);
    border: 2px dashed var(--border);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.file-info {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

#fileInput {
    display: none;
}

/* Panels Grid */
.panels-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

@media (max-width: 800px) {
    .panels-grid {
        grid-template-columns: 1fr;
    }
}

.panel {
    display: flex;
    flex-direction: column;
    min-height: 450px;
}

.panel:first-child {
    border-right: 1px solid var(--border);
}

@media (max-width: 800px) {
    .panel:first-child {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

.panel-header {
    padding: 14px 20px;
    background: var(--dark-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.panel-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    font-family: var(--sans);
}

.icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

textarea {
    flex: 1;
    width: 100%;
    min-height: 400px;
    padding: 20px;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.6;
    background: #f8fafc;
    color: #1f2937;
    border: none;
    resize: vertical;
    outline: none;
}

textarea:focus {
    background: #ffffff;
}

textarea::placeholder {
    color: #94a3b8;
}

textarea[readonly] {
    background: #f1f5f9;
    color: #334155;
}

body.dark-theme textarea {
    background: #2d2d2d;
    color: #d4d4d4;
}

body.dark-theme textarea:focus {
    background: #333;
}

body.dark-theme textarea[readonly] {
    background: #252525;
    color: #b0b0b0;
}

.panel-footer {
    padding: 10px 20px;
    font-size: 0.7rem;
    color: var(--text-dim);
    background: var(--dark-bg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
}

/* Action Buttons */
.action-bar {
    padding: 20px 28px;
    background: var(--dark-bg);
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.btn {
    padding: 12px 28px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--sans);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--error);
    color: var(--error);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    transform: translateY(-2px);
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    padding: 20px 28px;
    background: var(--dark-bg);
    border-top: 1px solid var(--border);
}

.stat-card {
    text-align: center;
    padding: 12px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--mono);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Message */
.message {
    margin: 0 28px 20px 28px;
    padding: 12px 18px;
    border-radius: 12px;
    display: none;
    animation: slideIn 0.25s ease;
    font-size: 0.85rem;
}

.message.show {
    display: block;
}

.message-error {
    background: #fef2f2;
    border-left: 4px solid var(--error);
    color: #dc2626;
}

.message-success {
    background: #f0fdf4;
    border-left: 4px solid var(--success);
    color: #16a34a;
}

body.dark-theme .message-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
}

body.dark-theme .message-success {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Related Tools & FAQ */
.related-tools-section,
.faq-section,
.seo-content {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px 28px;
    margin-top: 24px;
    border: 1px solid var(--border);
}

.related-tools-section h3,
.faq-section h3,
.seo-content h2 {
    color: var(--text);
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.related-link {
    display: inline-block;
    padding: 8px 18px;
    background: var(--dark-bg);
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.related-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.faq-item {
    background: var(--dark-bg);
    padding: 14px 18px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.faq-item summary {
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
}

.faq-item summary:hover {
    color: var(--primary);
}

.faq-item p {
    margin-top: 8px;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.85rem;
}

.seo-content p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.seo-content code {
    background: var(--dark-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.8rem;
}

.footer {
    text-align: center;
    margin-top: 32px;
    color: var(--text-dim);
    font-size: 0.75rem;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.shortcuts {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-dim);
}

.kbd {
    background: var(--surface-light);
    padding: 2px 8px;
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 0.7rem;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s;
}