:root {
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-primary-light: #f0f0ff;
    --color-success: #10b981;
    --color-success-light: #ecfdf5;
    --color-warning: #f59e0b;
    --color-warning-light: #fffbeb;
    --color-error: #ef4444;
    --color-error-light: #fef2f2;
    --color-text-primary: #0f172a;
    --color-text-secondary: #64748b;
    --color-text-tertiary: #94a3b8;
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;
    --color-bg: #ffffff;
    --color-bg-secondary: #f8fafc;
    --color-bg-tertiary: #f1f5f9;
    
    --font-family-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    --font-family-mono: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --border-radius-sm: 6px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
}

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

/* Core Web Vitals优化 */
img {
    max-width: 100%;
    height: auto;
    /* 减少CLS，为图片预留空间 */
    aspect-ratio: attr(width) / attr(height);
}

/* 防止字体加载时的布局偏移 */

/* 减少重绘和回流 */
.lang-switcher,
.breadcrumb {
    contain: layout style paint;
}

html {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-family-primary);
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    width: 100%;
    font-display: swap; /* 减少字体闪烁，改善LCP */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    /* 性能优化 */
    font-kerning: auto;
    text-rendering: optimizeSpeed;
    contain: layout style;
}

/* Language Switcher */
.lang-switcher {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    gap: 2px;
    background: var(--color-bg);
    padding: 4px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.lang-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: all 0.15s ease;
}

.lang-btn:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

.lang-btn.active {
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Breadcrumb Navigation */
.breadcrumb {
    margin: 1rem 0 2rem 0;
    margin-right: 280px; /* 为7个语言按钮留出空间 */
    padding: 0.75rem 1rem;
    background: var(--color-bg);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border-light);
    display: inline-block; /* 让容器宽度适应内容 */
    max-width: calc(100% - 300px); /* 限制最大宽度 */
}

.breadcrumb ol {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: "›";
    color: var(--color-text-tertiary);
    margin: 0 0.5rem;
    font-weight: bold;
}

.breadcrumb a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.breadcrumb li[aria-current="page"] span {
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 80px;
    position: relative;
    padding-top: 20px;
}

header h1 {
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.025em;
    padding: 0 20px;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

header p {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Problem Solution Section */
.problem-solution {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 80px;
    width: 100%;
    max-width: 100%;
}

.problem-section, .solution-section {
    background: var(--color-bg);
    padding: 32px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.problem-section {
    border-left: 4px solid var(--color-error);
}

.solution-section {
    border-left: 4px solid var(--color-success);
}

.problem-section h2, .solution-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--color-text-primary);
}

.problem-section h2 {
    color: var(--color-error);
}

.solution-section h2 {
    color: var(--color-success);
}

.problem-list {
    line-height: 1.8;
    color: var(--color-text-secondary);
    font-size: 1rem;
    word-break: break-word;
}

.solution-section p {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    margin-bottom: 28px;
    line-height: 1.7;
}

.how-it-works h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 16px;
}

.how-it-works ul {
    list-style: none;
    padding: 0;
}

.how-it-works li {
    padding: 10px 0;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    position: relative;
    padding-left: 24px;
}

.how-it-works li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-success);
    font-weight: 600;
    font-size: 1rem;
}

/* Input Section */
.input-section {
    margin-bottom: 48px;
}

.section-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 32px;
}

.input-area {
    position: relative;
    border: 2px dashed var(--color-border);
    border-radius: var(--border-radius-lg);
    transition: all 0.2s ease;
}

.input-area.drag-over {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

#jsonInput {
    width: 100%;
    border: none;
    padding: 24px;
    font-family: var(--font-family-mono);
    font-size: 14px;
    line-height: 1.6;
    background: var(--color-bg);
    border-radius: var(--border-radius-md);
    resize: vertical;
    outline: none;
    color: var(--color-text-primary);
    min-height: 320px;
}

.drop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--border-radius-md);
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.drop-text {
    font-size: 1.125rem;
    color: var(--color-primary);
    font-weight: 500;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 16px 24px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    background: var(--color-text-tertiary);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    padding: 8px 16px;
    background: var(--color-text-secondary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

/* Stats Section */
.stats-section {
    background: var(--color-bg);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: var(--color-bg-tertiary);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border-light);
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

/* Output Section */
.output-section {
    background: var(--color-bg);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-tertiary);
}

.output-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.output-actions {
    display: flex;
    gap: 12px;
}

#jsonOutput {
    font-family: var(--font-family-mono);
    font-size: 13px;
    line-height: 1.6;
    padding: 32px;
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* SEO Content Sections */
.seo-content {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 1px solid var(--color-border);
}

.features-section, .use-cases-section {
    margin-bottom: 60px;
}

.features-section h2, .use-cases-section h2, .faq-section h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 40px;
    line-height: 1.3;
}

.features-grid, .use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin-bottom: 40px;
}

.feature-item, .use-case-item {
    background: var(--color-bg);
    padding: 32px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    text-align: center;
}

.feature-item h3, .use-case-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.feature-item p, .use-case-item p {
    color: var(--color-text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.use-case-item {
    border-left: 4px solid var(--color-primary);
}

.faq-section {
    max-width: 800px;
    margin: 0 auto;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.faq-item {
    background: var(--color-bg);
    padding: 32px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.faq-item h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.faq-item p {
    color: var(--color-text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 32px 20px;
    }
    
    header h1 {
        font-size: 3rem;
    }
    
    .problem-solution {
        gap: 28px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 24px 16px;
        padding-top: 80px;
    }
    
    .breadcrumb {
        margin-right: 160px; /* 在中等屏幕上为语言按钮留出空间 */
    }
    
    .lang-switcher {
        top: 16px;
        right: 16px;
        padding: 3px;
        gap: 1px;
    }
    
    .lang-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    header {
        margin-bottom: 50px;
    }
    
    header h1 {
        font-size: 2rem;
        line-height: 1.2;
        padding: 0 10px;
        white-space: normal;
        word-break: keep-all;
    }
    
    header p {
        font-size: 1.125rem;
        line-height: 1.6;
        padding: 0 10px;
    }
    
    .problem-solution {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-bottom: 50px;
    }
    
    .problem-section, .solution-section {
        padding: 24px;
    }
    
    .problem-list {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    .solution-section p {
        font-size: 1rem;
    }
    
    .how-it-works li {
        font-size: 0.9rem;
        padding: 8px 0;
    }
    
    .section-title {
        font-size: 1.3rem;
        margin-bottom: 24px;
    }
    
    #jsonInput {
        padding: 20px;
        font-size: 13px;
        min-height: 280px;
    }
    
    .btn-primary {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .stat-item {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .output-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
        padding: 20px 24px;
    }
    
    .output-header h3 {
        font-size: 1.125rem;
        text-align: center;
    }
    
    .output-actions {
        justify-content: center;
    }
    
    #jsonOutput {
        padding: 20px;
        font-size: 12px;
    }
    
    .seo-content {
        margin-top: 60px;
        padding-top: 40px;
    }
    
    .features-section, .use-cases-section, .faq-section {
        margin-bottom: 40px;
    }
    
    .features-section h2, .use-cases-section h2, .faq-section h2 {
        font-size: 1.75rem;
        margin-bottom: 32px;
    }
    
    .features-grid, .use-cases-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .feature-item, .use-case-item, .faq-item {
        padding: 24px;
    }
    
    .feature-item h3, .faq-item h3 {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px 12px;
        padding-top: 70px;
    }
    
    .breadcrumb {
        margin-right: 0; /* 小屏幕上移除右边距 */
        margin-bottom: 1rem;
    }
    
    .lang-switcher {
        top: 12px;
        right: 12px;
        padding: 2px;
        transform: scale(0.9); /* 稍微缩小语言切换器 */
    }
    
    .lang-btn {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    header {
        margin-bottom: 40px;
    }
    
    header h1 {
        font-size: 1.6rem;
        margin-bottom: 12px;
        padding: 0 10px;
        white-space: normal;
    }
    
    header p {
        font-size: 1rem;
        padding: 0 5px;
    }
    
    .problem-solution {
        gap: 20px;
        margin-bottom: 40px;
    }
    
    .problem-section, .solution-section {
        padding: 20px;
    }
    
    .problem-section h2, .solution-section h2 {
        font-size: 1.25rem;
        margin-bottom: 16px;
    }
    
    .problem-list {
        font-size: 0.9rem;
    }
    
    .solution-section p {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }
    
    .how-it-works h3 {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .how-it-works li {
        font-size: 0.85rem;
        padding: 6px 0;
        padding-left: 20px;
    }
    
    .section-title {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }
    
    #jsonInput {
        padding: 16px;
        font-size: 13px;
        min-height: 240px;
    }
    
    .btn-primary {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-item {
        padding: 16px 12px;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    .output-header {
        padding: 16px 20px;
    }
    
    .output-header h3 {
        font-size: 1rem;
    }
    
    .btn-secondary {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    #jsonOutput {
        padding: 16px;
        font-size: 11px;
        max-height: 400px;
    }
    
    .seo-content {
        margin-top: 40px;
        padding-top: 30px;
    }
    
    .features-section h2, .faq-section h2 {
        font-size: 1.5rem;
        margin-bottom: 24px;
    }
    
    .feature-item, .faq-item {
        padding: 20px;
    }
    
    .feature-item h3, .faq-item h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .feature-item p, .faq-item p {
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 16px 8px;
        padding-top: 60px;
    }
    
    .breadcrumb {
        padding: 0.5rem 0.75rem; /* 减少面包屑内边距 */
        font-size: 0.8rem;
    }
    
    .lang-switcher {
        transform: scale(0.8); /* 进一步缩小语言切换器 */
    }
    
    header h1 {
        font-size: 1.4rem;
        padding: 0 5px;
        white-space: normal;
    }
    
    header p {
        font-size: 0.95rem;
    }
    
    .problem-section, .solution-section {
        padding: 16px;
    }
    
    #jsonInput {
        padding: 12px;
        min-height: 200px;
    }
    
    .output-header {
        padding: 12px 16px;
    }
    
    #jsonOutput {
        padding: 12px;
    }
    
    .seo-content {
        margin-top: 30px;
        padding-top: 20px;
    }
    
    .features-section h2, .faq-section h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .feature-item, .faq-item {
        padding: 16px;
    }
}