:root {
    --primary-color: #0f766e;
    --secondary-color: #0891b2;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #1f2937;
    --light-bg: #f8fafc;
    --border-color: #e5e7eb;
    --code-bg: #1e1e1e;
}

/* 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;
    display: inline-block;
}

.tool-switch-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.tool-switch-btn.active {
    background: white;
    color: #0f766e;
    font-weight: 700;
    border-color: white;
    pointer-events: none;
}

@media (max-width: 600px) {
    .tool-switcher {
        gap: 6px;
        padding: 8px 12px;
    }

    .tool-switch-btn {
        font-size: 0.78rem;
        padding: 5px 10px;
    }
}

/* Related Tools */
.related-tools-section {
    background: white;
    border-radius: 12px;
    padding: 25px 30px;
    margin-top: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.related-tools-section h3 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.related-link {
    display: inline-block;
    padding: 8px 18px;
    background: #f0f4ff;
    color: #4a5568;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.88rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.related-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* FAQ Section */
.faq-section {
    background: white;
    border-radius: 12px;
    padding: 25px 30px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.faq-section h3 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.faq-item {
    background: #f8fafc;
    padding: 14px 18px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.faq-item summary {
    font-weight: 600;
    color: #333;
    cursor: pointer;
    padding: 4px 0;
    font-size: 0.92rem;
}

.faq-item summary:hover {
    color: var(--primary-color);
}

.faq-item p {
    margin-top: 8px;
    color: #555;
    line-height: 1.6;
    font-size: 0.9rem;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    padding: 20px;
    color: #1f2937;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    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;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin-bottom: 30px;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.card-header {
    background: var(--dark-bg);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.card-header h2 {
    font-size: 1.5rem;
}

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

.control-button {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
}

.control-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.control-button:active {
    transform: translateY(0);
}

.card-body {
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 500px;
}

@media (max-width: 1024px) {
    .card-body {
        grid-template-columns: 1fr;
    }
}

.editor-panel,
.preview-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.panel-header {
    padding: 15px 20px;
    background: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.action-button {
    background: white;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.action-button:hover {
    background: #f3f4f6;
    border-color: var(--primary-color);
}

.editor-container {
    flex: 1;
    position: relative;
    border-right: 1px solid var(--border-color);
}

@media (max-width: 1024px) {
    .editor-container {
        border-right: none;
    }
}

#markdownInput {
    width: 100%;
    height: 100%;
    min-height: 460px;
    border: none;
    padding: 20px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    background: var(--light-bg);
}

.preview-container {
    flex: 1;
    min-height: 460px;
    padding: 24px 28px;
    background: white;
    overflow: auto;
}

/* Rendered markdown preview typography */
#markdownPreview h1,
#markdownPreview h2,
#markdownPreview h3,
#markdownPreview h4,
#markdownPreview h5,
#markdownPreview h6 {
    margin: 1.1em 0 0.5em;
    line-height: 1.3;
    color: #1a202c;
}

#markdownPreview h1:first-child,
#markdownPreview h2:first-child,
#markdownPreview h3:first-child {
    margin-top: 0;
}

#markdownPreview h1 { font-size: 1.9rem; border-bottom: 1px solid var(--border-color); padding-bottom: 6px; }
#markdownPreview h2 { font-size: 1.55rem; border-bottom: 1px solid var(--border-color); padding-bottom: 4px; }
#markdownPreview h3 { font-size: 1.3rem; }
#markdownPreview h4 { font-size: 1.12rem; }
#markdownPreview h5 { font-size: 1.02rem; }
#markdownPreview h6 { font-size: 0.92rem; color: #6b7280; }

#markdownPreview p {
    margin: 0.8em 0;
    color: #374151;
}

#markdownPreview strong { color: #1a202c; }

#markdownPreview a {
    color: var(--secondary-color);
    text-decoration: underline;
}

#markdownPreview img {
    max-width: 100%;
    border-radius: 6px;
    margin: 10px 0;
}

#markdownPreview code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: #f1f5f9;
    color: #be185d;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

#markdownPreview pre {
    background: var(--code-bg);
    color: #d4d4d4;
    padding: 16px 18px;
    border-radius: 8px;
    overflow: auto;
    margin: 1em 0;
}

#markdownPreview pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: 0.88rem;
}

#markdownPreview ul,
#markdownPreview ol {
    margin: 0.8em 0;
    padding-left: 1.6em;
    color: #374151;
}

#markdownPreview li {
    margin: 0.3em 0;
}

#markdownPreview blockquote {
    margin: 1em 0;
    padding: 8px 18px;
    border-left: 4px solid var(--primary-color);
    background: var(--light-bg);
    color: #4b5563;
}

#markdownPreview hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 1.6em 0;
}

.options-panel {
    padding: 25px;
    background: var(--light-bg);
    border-top: 1px solid var(--border-color);
}

.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
}

.stat-item {
    text-align: center;
    padding: 10px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 5px;
}

.message {
    padding: 12px 15px;
    border-radius: 6px;
    margin: 15px 0;
    display: none;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.show { display: block; }

.error-message {
    background: #fef2f2;
    color: var(--error-color);
    border: 1px solid #fecaca;
}

.success-message {
    background: #f0fdf4;
    color: var(--success-color);
    border: 1px solid #bbf7d0;
}

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

.feature {
    text-align: center;
    padding: 30px 25px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.feature h4 {
    margin-bottom: 10px;
    color: #1f2937;
}

.feature p {
    color: #6b7280;
    font-size: 0.9rem;
}

.footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

.shortcuts-hint {
    margin-top: 15px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #6b7280;
    border: 1px solid var(--border-color);
}

.shortcuts-hint strong {
    color: #374151;
}

.kbd {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.85em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
