.filter-bar { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.filter-btn { padding:6px 10px; }
/* 基础样式和CSS变量 */
:root {
    --primary-color: #2563eb; /* 调整为更清爽的蓝色 */
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --sidebar-width: 220px;
    --header-height: 52px;
    --border-radius: 8px;
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s ease-in-out;
}

/* 通用隐藏 */
.hidden { display: none !important; }

/* 深色主题 */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --border-color: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
}

/* 应用容器 */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 头部样式 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    color: var(--text-primary);
}

.sidebar-toggle-btn:hover {
    background-color: var(--bg-secondary);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.theme-toggle {
    display: flex;
    align-items: center;
}

.theme-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.theme-btn:hover {
    background-color: var(--bg-secondary);
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding-top: var(--header-height);
    overflow-y: auto;
    transition: width 0.3s ease, margin-left 0.3s ease;
}

.sidebar.collapsed {
    width: 60px;
    overflow: hidden;
}

.sidebar.collapsed .category-text,
.sidebar.collapsed .nav-category-items {
    display: none;
}

.sidebar.collapsed .category-arrow {
    display: none;
}

.nav-menu {
    padding: 16px 0; /* 收紧侧边栏内边距 */
}

.nav-category {
    margin-bottom: 16px;
}

.nav-category-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 12px 24px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.nav-category-title:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.category-icon {
    font-size: 1rem;
    min-width: 20px;
    text-align: center;
}

.category-text {
    flex: 1;
}

.category-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.nav-category.collapsed .category-arrow {
    transform: rotate(-90deg);
}

.nav-category-items {
    list-style: none;
    max-height: 1000px; /* 展开状态允许更多条目 */
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-category.collapsed .nav-category-items {
    max-height: 0;
}

.nav-category-items li a {
    display: block;
    padding: 8px 16px 8px 48px; /* 缩小左侧缩进与垂直间距 */
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}

.nav-category-items li a:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-category-items li a.active {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    padding: var(--header-height) 0 0;
    overflow-y: auto;
    background-color: var(--bg-primary);
}

.tool-panel {
    display: none;
    padding: 16px; /* 收紧外围留白 */
    max-width: 1200px;
    margin: 0 auto;
}

.tool-panel.active {
    display: block;
}

.tool-header {
    margin-bottom: 12px; /* 缩小标题区高度 */
}

.tool-header h2 {
    font-size: 1.5rem; /* 缩小标题字号 */
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
}

.tool-header p { /* 隐藏标题下的详细解释 */
    display: none;
}

/* 欢迎页面样式 */
.welcome-section {
    text-align: center;
    padding: 64px 0;
}

.welcome-section h2 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.welcome-section p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 48px;
}

.feature-card {
    background-color: var(--bg-secondary);
    padding: 32px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--box-shadow-lg);
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

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

/* 工具内容样式 */
.tool-content {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 16px; /* 收紧内容区留白 */
    box-shadow: var(--box-shadow);
}

/* 分栏布局 */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.split-left, .split-right {
    min-height: 400px;
}

.input-section, .output-section {
    margin-bottom: 24px;
}

.input-section:last-child, .output-section:last-child {
    margin-bottom: 0;
}

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

textarea, input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    transition: var(--transition);
    resize: vertical;
}

/* 为大型textarea设置更大的默认高度 */
textarea[rows="12"] {
    min-height: 300px;
}

textarea[rows="15"] {
    min-height: 380px;
}

textarea[rows="20"] {
    min-height: 500px;
}

textarea[rows="25"] {
    min-height: 600px;
}

/* JSON统计信息样式 */
.json-stats {
    margin-top: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    border-radius: var(--border-radius);
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.json-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}

.json-stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 4px;
}

.json-stat-value {
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* 移动端统计信息适配 */
@media (max-width: 768px) {
    .json-stats {
        gap: 15px;
    }
    
    .json-stat-item {
        min-width: 80px;
    }
}

textarea:focus, input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

input[type="datetime-local"] {
    font-family: inherit;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
}

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

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

.btn.primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn.secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.btn.secondary:hover:not(:disabled) {
    background-color: var(--bg-primary);
    transform: translateY(-1px);
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* 标签页样式 */
.convert-tabs, .encode-decode-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

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

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 输出区域样式 */
.json-output, .code-output, .xml-output {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    min-height: 300px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-x: auto;
}

/* JSON输出框的textarea样式 */
.json-output-textarea {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    width: 100%;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
    resize: vertical;
    min-height: 500px;
    white-space: pre-wrap;
    overflow-y: auto;
}

.json-output-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.json-output-textarea.error {
    border-color: #ef4444;
    color: #ef4444;
}

/* XML输出框的textarea样式 */
.xml-output-textarea {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    width: 100%;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
    resize: vertical;
    min-height: 500px;
    white-space: pre-wrap;
    overflow-y: auto;
}

.xml-output-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.xml-output-textarea.error {
    border-color: #ef4444;
    color: #ef4444;
}

/* 可编辑输出区域 */
.editable {
    outline: none;
    cursor: text;
    transition: var(--transition);
}

.editable:hover {
    border-color: var(--primary-color);
}

.editable:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.editable:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    font-style: italic;
}

.code-output {
    background-color: #1e1e1e;
    color: #d4d4d4;
}

[data-theme="dark"] .code-output {
    background-color: #000000;
    color: #ffffff;
}

/* JSON对比样式 */
.compare-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px; /* 缩小列间距 */
    align-items: start;
}

.compare-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-self: center;
}

.compare-result {
    margin-top: 24px;
}

.compare-output {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    min-height: 200px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 时间戳工具样式 */
.timestamp-info {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
}

.current-time h3 {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.timestamp-display {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.datetime-display {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.result-display {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-top: 16px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    min-height: 60px;
}

/* Cron 工具样式 */
.cron-desc { margin-bottom: 8px; color: var(--text-secondary); }
.cron-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-top: 8px; }
.cron-field { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.cron-field code { background: var(--bg-primary); border: 1px solid var(--border-color); padding: 2px 6px; border-radius: 4px; }
.cron-field-values { color: var(--text-muted); }
.next-times { margin-top: 12px; }
.next-times ol { margin-left: 16px; max-height: 260px; overflow: auto; padding-right: 8px; }
.next-times li { white-space: nowrap; }

.options {
    display: flex;
    gap: 16px;
    margin: 16px 0;
    align-items: center;
    flex-wrap: wrap;
}

.options label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    font-weight: normal;
}

/* 样式选择选项 */
.style-options {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: transparent;
}

.radio-label:hover {
    background: var(--bg-secondary);
}

.radio-label input[type="radio"] {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.radio-label span {
    font-size: 0.9rem;
    color: var(--text-primary);
    user-select: none;
    font-weight: 500;
}

/* 二维码样式 */
.qrcode-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

/* 每周预设行内紧凑布局 */
#cron-generate-tab [data-preset-area="weeklyAt"] label {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Cron 生成风格单选行内展示 */
#cron-generate-tab .option-group .radio-group {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.option-group label {
    margin-bottom: 0;
    white-space: nowrap;
}

.qrcode-container {
    text-align: center;
    padding: 24px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 文件上传样式 */
.file-input {
    padding: 12px;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-primary);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 16px;
}

.file-input:hover {
    border-color: var(--primary-color);
}

/* 上传区域样式 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 48px 24px;
    text-align: center;
    background-color: var(--bg-primary);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 16px;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.1);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.upload-text p {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.upload-tip {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* 解码预览样式 */
.decode-preview {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.decode-result {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    min-height: 100px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.compress-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.image-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

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

.preview-item h4 {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.image-container {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.image-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--border-radius);
}

.image-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px; /* 与桌面一致更紧凑 */
    }
    
    .split-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .compare-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .compare-controls {
        flex-direction: row;
        justify-content: center;
    }
    
    .image-preview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        z-index: 999;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar.collapsed {
        left: -60px;
    }
    
    .sidebar.collapsed.open {
        left: 0;
        width: 60px;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .tool-panel {
        padding: 16px;
    }
    
    .tool-content {
        padding: 24px 16px;
    }
    
    .split-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .welcome-section h2 {
        font-size: 2rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .qrcode-options, .compress-options {
        grid-template-columns: 1fr;
    }
    
    .options {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .style-options {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }
    
    .button-group {
        justify-content: center;
    }
    
    .decode-preview {
        gap: 16px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-panel.active {
    animation: fadeIn 0.3s ease-out;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-primary);
    color: var(--bg-primary);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
} 

/* 可折叠格式化展示样式 */
.collapsible-output {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    max-height: 600px;
    overflow-y: auto;
    white-space: pre-wrap;
    tab-size: 2;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.collapsible-output:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    font-style: italic;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.collapsible-output.error {
    color: var(--error-color);
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--error-color);
}

/* 可折叠节点样式 */
.collapsible-node {
    margin: 0;
    padding: 0;
    display: block;
    width: 100%;
}

.collapsible-line {
    position: relative;
    line-height: 1.5;
    margin: 0;
    cursor: default;
    display: block;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

/* 折叠/展开按钮 */
.collapse-toggle {
    position: absolute;
    left: -16px;
    top: 0;
    width: 14px;
    height: 14px;
    margin-top: 1px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: var(--transition);
}

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

.collapse-toggle::before {
    content: "−";
    line-height: 1;
}

.collapse-toggle.collapsed::before {
    content: "+";
}

/* 可折叠内容 */
.collapsible-content {
    margin-left: 16px;
    transition: all 0.2s ease;
    overflow: visible;
    display: block;
    width: calc(100% - 16px);
    box-sizing: border-box;
}

.collapsible-content.collapsed {
    display: none;
}

/* 折叠状态的省略号 */
.collapse-ellipsis {
    color: var(--text-muted);
    font-style: italic;
    cursor: pointer;
    margin-left: 4px;
}

.collapse-ellipsis:hover {
    color: var(--text-primary);
}

/* 语法高亮样式 */
.json-key {
    color: #0451a5;
}

[data-theme="dark"] .json-key {
    color: #9cdcfe;
}

.json-string {
    color: #a31515;
}

[data-theme="dark"] .json-string {
    color: #ce9178;
}

.json-number {
    color: #09885a;
}

.json-bigint {
    color: #d73a49;
    font-weight: 600;
    position: relative;
}

.json-bigint::after {
    content: "L";
    font-size: 0.75em;
    color: #6f42c1;
    vertical-align: super;
    margin-left: 2px;
}

[data-theme="dark"] .json-number {
    color: #b5cea8;
}

[data-theme="dark"] .json-bigint {
    color: #ff7b72;
    font-weight: 600;
}

[data-theme="dark"] .json-bigint::after {
    color: #d2a8ff;
}

.json-boolean {
    color: #0000ff;
}

[data-theme="dark"] .json-boolean {
    color: #569cd6;
}

.json-null {
    color: #795e26;
}

[data-theme="dark"] .json-null {
    color: #dcdcaa;
}

.json-punctuation {
    color: var(--text-primary);
}

/* XML语法高亮 */
.xml-tag {
    color: #800000;
}

[data-theme="dark"] .xml-tag {
    color: #569cd6;
}

.xml-attribute {
    color: #ff0000;
}

[data-theme="dark"] .xml-attribute {
    color: #92c5f8;
}

.xml-value {
    color: #0000ff;
}

[data-theme="dark"] .xml-value {
    color: #ce9178;
}

.xml-content {
    color: var(--text-primary);
}

.xml-comment {
    color: #008000;
    font-style: italic;
}

[data-theme="dark"] .xml-comment {
    color: #6a9955;
}

/* 缩进线 */
.indent-line {
    position: absolute;
    left: -8px;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: var(--border-color);
    opacity: 0.3;
}

/* JSON编辑器单布局样式 */
.single-layout {
    display: block;
    width: 100%;
}

.json-editor-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* JSON工具栏 */
.json-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    gap: 16px;
    flex-wrap: wrap;
}

.toolbar-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}



/* 小号按钮 */
.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

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

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

.btn-small.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-small.secondary:hover {
    background: var(--border-color);
}

.btn-icon {
    font-size: 0.8em;
}

/* JSON编辑器容器 */
.json-editor-container {
    position: relative;
    width: 100%;
    min-height: 520px; /* 降低最小高度，更多空间给编辑区下方展示 */
}

/* JSON文本编辑器 */
.json-editor {
    width: 100%;
    min-height: 520px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    resize: vertical;
    outline: none;
    transition: var(--transition);
    box-sizing: border-box;
}

.json-editor:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* JSON格式化显示器 */
.json-formatted-display {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 520px;
    font-size: 14px;
    line-height: 1.5;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    overflow-y: auto;
    display: none;
    box-sizing: border-box;
}

.json-formatted-display.active {
    display: block;
}

/* 状态信息 */
.status-info {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 0.85rem;
}

.status-text {
    color: var(--text-primary);
    font-weight: 500;
}

.stats-text {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* 状态文本样式 */
.status-text.success {
    color: var(--success-color);
}

.status-text.error {
    color: var(--error-color);
}

.status-text.warning {
    color: var(--warning-color);
}

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

/* 响应式调整 */
@media (max-width: 768px) {
    .editor-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .editor-controls {
        justify-content: center;
    }
    
    .collapsible-output {
        font-size: 12px;
        padding: 12px;
    }
    
    .collapse-toggle {
        left: -12px;
        width: 12px;
        height: 12px;
        font-size: 10px;
    }
    
    .collapsible-content {
        margin-left: 12px;
    }
}

/* 控制按钮容器样式 */
.collapse-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0;
    padding: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.collapse-controls .btn {
    font-size: 12px;
    padding: 4px 8px;
    height: auto;
    min-height: auto;
    line-height: 1.2;
}

.collapse-controls .btn:hover {
    transform: none;
    box-shadow: none;
}

/* 选择文本时的样式 */
.collapsible-output::selection {
    background-color: var(--primary-color);
    color: white;
}

.collapsible-output ::-moz-selection {
    background-color: var(--primary-color);
    color: white;
} 

/* 站点索引样式 */
.site-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.site-section { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 16px; }
.site-section-title { margin: 0 0 12px; font-size: 1.1rem; }
.site-card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.site-card { display: block; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-primary); text-decoration: none; color: var(--text-primary); transition: transform .1s ease, box-shadow .1s ease; }
.site-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.site-card-title { font-weight: 600; margin-bottom: 6px; }
.site-card-desc { font-size: .9rem; color: var(--text-muted); }