/* ============== 全局样式 ============== */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f3f4f6;
    --bg-dark: #1f2937;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-sm: 4px;
}

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

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

/* ============== 布局 ============== */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-dark);
    color: white;
    box-shadow: var(--shadow);
    z-index: 100;
}

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

.logo {
    font-size: 18px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ============== 侧边栏 ============== */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.route-list-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.route-list-title h2 {
    font-size: 14px;
    font-weight: 600;
}

.group-filter-select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: white;
    cursor: pointer;
}

.sidebar-search {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--primary-color);
}

.route-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.route-list-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* ============== 颜色选择器 ============== */
.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #1f2937;
    box-shadow: 0 0 0 2px white;
}

/* ============== 路由列表分组标签 ============== */
.route-item-group {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
}

.route-item {
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.route-item:hover {
    background: #f9fafb;
    border-color: var(--border-color);
}

.route-item.active {
    background: #eff6ff;
    border-color: var(--primary-color);
}

.route-item.disabled {
    opacity: 0.5;
}

.route-item-method {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
}

.route-item-method.GET { background: #dbeafe; color: #1d4ed8; }
.route-item-method.POST { background: #dcfce7; color: #15803d; }
.route-item-method.PUT { background: #fef3c7; color: #b45309; }
.route-item-method.DELETE { background: #fee2e2; color: #dc2626; }
.route-item-method.PATCH { background: #f3e8ff; color: #7c3aed; }

.route-item-name {
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-item-path {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============== 日志面板 ============== */
.logs-panel {
    flex: 1;
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 400px;
}

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

.panel-header h2 {
    font-size: 14px;
    font-weight: 600;
}

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

.log-count {
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 8px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
}

.logs-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.logs-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.logs-empty .hint {
    font-size: 12px;
    margin-top: 5px;
}

.logs-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.log-item {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: var(--radius);
    background: var(--bg-color);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.log-item:hover {
    background: #f0f0f0;
}

.log-item.success { border-left-color: var(--success-color); }
.log-item.error { border-left-color: var(--danger-color); }
.log-item.warning { border-left-color: var(--warning-color); }

.log-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.log-item-method-path {
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-item-method {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.log-item-method.GET { background: #dbeafe; color: #1d4ed8; }
.log-item-method.POST { background: #dcfce7; color: #15803d; }
.log-item-method.PUT { background: #fef3c7; color: #b45309; }
.log-item-method.DELETE { background: #fee2e2; color: #dc2626; }
.log-item-method.PATCH { background: #f3e8ff; color: #7c3aed; }

.log-item-path {
    font-weight: 500;
    font-size: 13px;
}

.log-item-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 500;
}

.log-item-status.success { background: #d1fae5; color: #065f46; }
.log-item-status.error { background: #fee2e2; color: #991b1b; }
.log-item-status.warning { background: #fef3c7; color: #92400e; }

.log-item-time {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============== 配置面板 ============== */
.config-panel {
    width: 400px;
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header h2 {
    font-size: 14px;
    font-weight: 600;
}

.config-form {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.form-group-method {
    flex: 0 0 100px !important;
}

.form-group-response {
    flex: 1;
}

.form-group-checkbox {
    display: flex;
    align-items: flex-end;
    padding-bottom: 8px;
}

.form-group-checkbox label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.form-group-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.hint-toggle {
    float: right;
    font-size: 11px;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: normal;
}

.hint-box {
    margin-bottom: 10px;
}

.hint-box pre {
    background: #f8f9fa;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    line-height: 1.6;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

/* ============== 按钮 ============== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

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

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

.btn-secondary {
    background: #e5e7eb;
    color: var(--text-color);
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-danger {
    background: #fee2e2;
    color: var(--danger-color);
}

.btn-danger:hover {
    background: #fecaca;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-icon {
    padding: 5px 8px;
    background: transparent;
    color: var(--text-muted);
}

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

.icon {
    font-size: 14px;
}

/* ============== 模态框 ============== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-lg {
    max-width: 600px;
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============== Toast ============== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius);
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.toast.success { background: var(--success-color); }
.toast.error { background: var(--danger-color); }
.toast.warning { background: var(--warning-color); }
.toast.info { background: var(--primary-color); }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============== 空状态 ============== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 15px;
}

/* ============== 设置相关 ============== */
.settings-info {
    margin-top: 15px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
}

.settings-info p {
    margin-bottom: 8px;
    font-size: 13px;
}

.settings-info code {
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* ============== 滚动条 ============== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ============== 响应式 ============== */
@media (max-width: 1200px) {
    .config-panel {
        width: 350px;
    }
}

@media (max-width: 900px) {
    .main {
        flex-direction: column;
    }

    .sidebar, .logs-panel, .config-panel {
        width: 100%;
        min-width: unset;
    }

    .logs-panel, .config-panel {
        max-height: 40vh;
    }
}

/* ============== 分组导航 ============== */
.group-nav {
    border-bottom: 1px solid var(--border-color);
    background: #fafafa;
}

.group-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.group-nav-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.group-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 6px 0;
}

.group-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
    gap: 8px;
}

.group-item:hover {
    background: #f0f0f0;
}

.group-item.active {
    background: #eff6ff;
}

.group-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.group-item-name {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-item-count {
    font-size: 11px;
    color: var(--text-muted);
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 10px;
}

.group-item-actions {
    display: none;
    gap: 4px;
}

.group-item:hover .group-item-actions {
    display: flex;
}

.group-item:hover .group-item-count {
    display: none;
}

/* ============== 工具类 ============== */
.hidden {
    display: none !important;
}

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

.text-small {
    font-size: 12px;
}

.mt-10 {
    margin-top: 10px;
}

.mb-10 {
    margin-bottom: 10px;
}

/* ============== 参数校验 ============== */
.validation-group {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 15px;
}

.validation-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.validation-empty .hint {
    font-size: 12px;
    margin-top: 5px;
}

.validation-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.validation-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.validation-item.disabled {
    opacity: 0.5;
    background: #f5f5f5;
}

.validation-item.disabled .validation-item-name {
    text-decoration: line-through;
}

.validation-item-name[title] {
    cursor: help;
}

.validation-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    margin-right: 8px;
    flex-shrink: 0;
}

.validation-toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.validation-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.2s;
    border-radius: 20px;
}

.validation-toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

.validation-toggle-input:checked + .validation-toggle-slider {
    background-color: var(--success-color);
}

.validation-toggle-input:checked + .validation-toggle-slider:before {
    transform: translateX(16px);
}

.validation-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: nowrap;
    overflow-x: auto;
}

.validation-item-header::-webkit-scrollbar {
    height: 4px;
}

.validation-item-header::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.validation-item-name {
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

.validation-item-in {
    font-size: 10px;
    padding: 2px 5px;
    background: #e5e7eb;
    border-radius: 3px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.validation-item-type {
    font-size: 10px;
    padding: 2px 5px;
    background: #dbeafe;
    border-radius: 3px;
    color: #1d4ed8;
    flex-shrink: 0;
}

.validation-item-required {
    font-size: 10px;
    padding: 2px 5px;
    background: #fee2e2;
    border-radius: 3px;
    color: #dc2626;
    flex-shrink: 0;
}

.validation-item-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.validation-item-rules {
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rule-tag {
    font-size: 11px;
    padding: 3px 8px;
    background: var(--bg-color);
    border-radius: 3px;
    color: var(--text-muted);
}

/* ============== JSON 编辑器 ============== */
.response-editor-wrapper {
    margin-bottom: 12px;
}

.response-preview-wrapper {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    max-height: 200px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 500;
}

.preview-content {
    flex: 1;
    overflow: auto;
    padding: 12px;
    margin: 0;
    font-size: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: #f8f9fa;
    white-space: pre-wrap;
    word-break: break-all;
}

/* JSON 编辑器主体 */
.json-editor {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
}

.json-editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border-color);
}

.json-editor-tabs {
    display: flex;
    gap: 4px;
}

.json-editor-tab {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.json-editor-tab:hover {
    background: #f0f0f0;
}

.json-editor-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.json-editor-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.json-editor-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.json-editor-btn-add {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.json-editor-content {
    max-height: 350px;
    overflow: auto;
}

.json-editor-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* 树形结构 */
.json-editor-tree {
    padding: 10px;
    white-space: nowrap;
}

.json-editor-node {
    margin-bottom: 2px;
}

.json-editor-node-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}

.json-editor-node-row:hover {
    background: #f5f5f5;
}

.json-editor-toggle {
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.json-editor-toggle:hover {
    color: var(--text-color);
}

.json-editor-toggle-placeholder {
    width: 18px;
    flex-shrink: 0;
}

.json-editor-key {
    font-weight: 500;
    color: #1f2937;
    font-size: 13px;
}

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

.json-editor-value {
    font-size: 13px;
    color: #059669;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    white-space: nowrap;
    display: inline-block;
    padding: 2px 4px;
    border-radius: 2px;
}

.json-editor-value-truncated {
    background: #fef3c7;
}

.json-editor-value-container {
    color: var(--text-muted);
    font-style: italic;
}

.json-editor-value-template {
    color: #dc2626;
    font-weight: 500;
}

.json-editor-value-null {
    color: var(--text-muted);
    font-style: italic;
}

.json-editor-type-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
    flex-shrink: 0;
}

.json-editor-btn-icon {
    padding: 3px 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.json-editor-node-row:hover .json-editor-btn-icon {
    opacity: 1;
}

.json-editor-btn-icon:hover {
    opacity: 1;
    background: #e5e7eb;
    border-radius: 3px;
}

.json-editor-children {
    margin-left: 10px;
}

.json-editor-empty-child {
    padding: 8px 12px 8px 44px;
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

/* 源码编辑 */
.json-editor-source {
    padding: 10px;
}

.json-editor-source-textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    resize: vertical;
    background: #f8f9fa;
}

.json-editor-source-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

.json-editor-source-info {
    margin-top: 8px;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 4px;
}

.json-editor-source-info.success {
    color: #059669;
    background: #d1fae5;
}

.json-editor-source-info.error {
    color: #dc2626;
    background: #fee2e2;
}

/* 模板变量选择器 */
.json-editor-template-picker {
    border-top: 1px solid var(--border-color);
    background: #fafafa;
}

.json-editor-template-picker-header {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.json-editor-template-picker-content {
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.json-editor-template-category {
    min-width: 150px;
}

.json-editor-template-category-name {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.json-editor-template-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.json-editor-template-item {
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}

.json-editor-template-item:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ============== 配置区段折叠 ============== */
.config-section {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}

.config-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f9fafb;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.config-section-header:hover {
    background: #f0f0f0;
}

.config-section-title {
    font-weight: 600;
    font-size: 13px;
}

.config-section-toggle {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.config-section.collapsed .config-section-toggle {
    transform: rotate(-90deg);
}

.config-section-content {
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

.config-section.collapsed .config-section-content {
    display: none;
}

.btn-block {
    width: 100%;
    margin-top: 10px;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .config-panel {
        width: 350px;
    }
}

@media (max-width: 900px) {
    .main {
        flex-direction: column;
    }

    .sidebar, .logs-panel, .config-panel {
        width: 100%;
        min-width: unset;
    }

    .logs-panel, .config-panel {
        max-height: 40vh;
    }
}
