/* JSON 格式化工具特定样式 */
.json-container {
    display: flex;
    height: calc(100vh - 55px);
    margin-top: 20px;
}
#jsonOutput {
    background-color: var(--bg-tertiary) !important;
    border: 1px dashed var(--border-color) !important;
    border-radius: 8px !important;
    padding: 16px !important;
    font-family: var(--font-family-mono) !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    overflow-x: auto !important;
    min-height: 200px !important;
    white-space: pre-wrap !important;
}

.json-input-section, .json-output-section {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.json-input-section {
    flex: 0 0 50%;
    margin-right: 0;
}

.json-output-section {
    flex: 1;
    margin-left: 0;
}

.json-input-section textarea {
    flex: 1;
    min-height: 300px;
    resize: vertical;
}

/* JSON编辑器容器样式 */
.json-editor-container {
    position: relative;
    display: flex;
    border: 1px solid var(--border-color);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    background-color: var(--bg-tertiary);
    overflow: hidden;
    flex: 1;
}

.json-editor-container textarea {
    border: none;
    border-radius: 0;
    background-color: transparent;
    resize: none;
    outline: none;
    padding: 12px;
    flex: 1;
    min-height: 300px;
    font-family: var(--font-family-mono);
    font-size: 12px;
    line-height: 1.5;
    overflow-y: auto;
    letter-spacing: 0;
    word-spacing: 0;
    box-sizing: border-box;
}

/* 行号与编辑器字体一致（覆盖 styles.css 的 .line-numbers） */
#lineNumbers,
.json-editor-container .line-numbers {
    font-size: 12px;
    line-height: 1.5;
}

.error-highlight {
    position: absolute;
    top: 0;
    left: 40px; /* 根据实际测量结果调整 */
    right: 0;
    bottom: 0;
    pointer-events: none;
    font-family: var(--font-family-mono);
    font-size: 12px;
    line-height: 1.5;
    padding: 12px 12px 12px 10px;
    white-space: pre;
    overflow: hidden;
    display: none; /* 默认隐藏 */
    z-index: 0; /* 确保在textarea之下，作为背景层 */
    box-sizing: border-box;
    letter-spacing: 0;
    word-spacing: 0;
}

.error-line {
    background-color: rgba(239, 68, 68, 0.24);
    border-left: 2px solid rgba(239, 68, 68, 0.3);
    margin: 0;
    padding: 0;
    min-height: 18px; /* line-height * font-size (12px * 1.5) */
    color: transparent; /* 确保文本不可见 */
}

.error-line-with-snippet {
    background-color: rgba(239, 68, 68, 0.24);
    border-left: 2px solid rgba(239, 68, 68, 0.25);
    margin: 0;
    padding: 0;
    min-height: 18px; /* line-height * font-size (12px * 1.5) */
    display: flex;
    align-items: center;
}

.error-line-text {
    color: transparent;
}

.error-snippet-highlight {
    background-color: rgb(255, 212, 71 , 0.5);
    color: #500000;
    font-weight: 500;
    border-radius: 2px;
    padding: 0px;
    margin: 0px;
    outline: 1px solid #500000;
    outline-offset: -1px;
    box-sizing: border-box;
}

.placeholder-line {
    background-color: transparent;
    border: none;
    margin: 0;
    padding: 0;
    min-height: 18px; /* line-height * font-size (12px * 1.5) */
    color: transparent; /* 确保文本不可见 */
    opacity: 0;
}

@keyframes snippetGlow {
    0% {
        background-color: rgba(239, 68, 68, 0.25);
        outline-color: rgba(239, 68, 68, 0.35);
    }
    100% {
        background-color: rgba(239, 68, 68, 0.15);
        outline-color: rgba(239, 68, 68, 0.2);
    }
}

.input-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.json-result-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.json-valid, .json-error {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.json-valid h4, .json-error h4 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #3c1b1a;
}

.json-valid {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.json-error {
    background-color: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 16px;
}

.json-error h4 {
    color: var(--error-color);
}

.json-valid pre {
    flex: 1;
    overflow: auto;
    margin: 0;
    padding: 0;
    font-family: var(--font-family-mono);
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-primary);
}

.json-error .error-message {
    display: block;
    margin-top: 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
    border-left: none;
    padding: 15px 0px;
    font-family: var(--font-family-mono);
    font-size: 12px;
    line-height: 1.5;
}

/* JSON查看器样式 */
.json-viewer {
    font-family: var(--font-family-mono);
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-primary);
    overflow: auto;
    padding: 0;
    margin: 0;
}

.json-item {
    display: flex;
    align-items: flex-start;
    margin: 0;
    padding: 0;
}

.json-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    margin-right: 4px;
    font-size: 12px;
    line-height: 1.5;
    min-width: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.json-toggle:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.json-toggle.collapsed::before {
    content: '+';
}

.json-toggle.expanded::before {
    content: '-';
}

.json-toggle.empty {
    cursor: default;
    opacity: 0.3;
}

.json-toggle.empty::before {
    content: '';
}

.json-key {
    color: var(--text-primary);
    font-weight: 500;
    margin-right: 4px;
    white-space: nowrap;
}

.json-colon {
    color: var(--text-muted);
    margin-right: 4px;
}

.json-value {
    color: var(--text-primary);
    max-width: 700px;
    overflow-wrap: break-word;
    white-space: nowrap;
}

.json-value.string {
    color: var(--text-color-1);
}

.json-value.number {
    color: var(--text-color-2);
}

.json-value.boolean {
    color: var(--text-color-3);
}

.json-value.null {
    color: var(--text-color-4);
}

.json-bracket {
    color: var(--text-muted);
    margin: 0 2px;
}

.json-item-count {
    color: var(--text-muted);
    font-size: 0.75em;
    margin-left: 4px;
    opacity: 0.7;
    padding-top:2px;
}

.json-path-display,
.json-timestamp-display {
    color: var(--text-muted);
    font-size: 0.65em;
    margin-left: 8px;
    opacity: 0.6;
    float: right;
    padding-top: 7px;
    user-select: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.json-path-display:hover,
.json-timestamp-display:hover {
    opacity: 1;
    color: var(--accent-light);
    text-decoration: underline;
}

.json-content {
    overflow: visible;
    transition: max-height 0.3s ease;
}

.json-content.collapsed {
    max-height: 0;
    display: none;
}

.json-content.expanded {
    max-height: none;
    display: block;
}

.json-indent {
    margin-left: 20px;
}

.json-no-indent {
    margin-left: 0;
}

/* 新的属性布局样式 */
.json-property {
    margin-bottom: 2px;
}

.json-key-line {
    margin-bottom: 2px;
}

/* 含简单值的行：flex 不换行，值按内容宽度，path 紧跟逗号后，整行过长时由外层滚动 */
.json-value-line {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    min-width: min-content;
}

/* path、时间戳在文档流中紧跟 valueWrapper（逗号后），不贴右边界 */
.json-value-line .json-path-display,
.json-value-line .json-timestamp-display {
    flex-shrink: 0;
    margin-left: 8px;
    white-space: nowrap;
}

/* 值区域：按内容宽度，不撑满行，保证 path 在逗号后；行过长时溢出产生横向滚动 */
.json-value-wrapper {
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
    align-items: baseline;
    overflow: visible;
}

/* 有「展开」时长值截断，避免单行过宽；无展开时值自然宽度 */
.json-value-wrapper.json-value-wrapper--truncated {
    max-width: 75%;
    overflow: hidden;
}

.json-value-wrapper.json-value-wrapper--truncated .json-value.string {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.json-value-wrapper .json-value {
    min-width: 0;
    white-space: nowrap;
}

.json-value-wrapper .json-value.string {
    /* 默认不截断，整行可溢出滚动 */
}

.json-value-wrapper .json-value.string.json-value-expanded {
    overflow: visible;
    white-space: pre-wrap;
    word-break: break-word;
    text-overflow: clip;
}

/* 截断状态下展开后，值可换行，wrapper 不再限制宽度 */
.json-value-wrapper.json-value-wrapper--truncated .json-value.string.json-value-expanded {
    max-width: none;
}

/* 值区域内的逗号：紧跟值后，不参与伸缩 */
.json-value-wrapper .json-comma {
    flex-shrink: 0;
    margin-left: 2px;
}

/* 长值展开/收起按钮 */
.json-value-expand-btn {
    flex-shrink: 0;
    margin-left: 6px;
    padding: 0 6px;
    font-size: 0.7em;
    font-family: var(--font-family-base);
    color: var(--accent-color);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.85;
}

.json-value-expand-btn:hover {
    opacity: 1;
    color: var(--accent-light);
}

.json-value-container {
    /* 值容器相对于属性名有一个tab的缩进 */
    margin-left: 20px;
}

.json-property-comma {
    display: block;
    margin-top: -2px;
    margin-left: 0;
}

/* 数组项样式 */
.json-array-item {
    margin-bottom: 2px;
    /* 数组项也需要有一个tab的缩进 */
    margin-left: 20px;
}

.json-array-comma {
    display: block;
    margin-top: -2px;
    margin-left: 0;
}

/* JSON复制交互样式 */
.json-hoverable {
    cursor: pointer;
    border-radius: 3px;
    padding: 1px 3px;
    transition: all 0.2s ease;
    position: relative;
}

.json-hoverable:hover {
    background-color: var(--bg-hover);
    /* transform: translateY(-1px); */
}

.json-hoverable.copy-success {
    background-color: var(--accent-light);
    color: white;
    animation: copySuccess 1s ease-out;
}

@keyframes copySuccess {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 var(--success-color);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* 复制提示框样式 */
.json-copy-tooltip {
    position: fixed;
    z-index: 10002;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    animation: tooltipFadeIn 0.2s ease-out;
}

.copy-tooltip-content {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-tooltip-content:hover {
    background-color: var(--accent-color);
    color: white;
    border-radius: 5px;
}

.copy-icon {
    font-size: 11px;
    opacity: 0.8;
}

.copy-text {
    white-space: nowrap;
}

/* 复制提示框分隔线 */
.copy-tooltip-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 2px 0;
}

/* 同名字段高亮样式 */
.same-field-highlight {
    background-color: var(--text-color-5) !important;
    color: var(--text-primary) !important;
    /* border: 1px solid var(--accent-color) !important; */
    /* box-shadow: 0 0 0 2px var(--accent-light) !important; */
    /* animation: fieldHighlight 0.3s ease-out; */
}

@keyframes fieldHighlight {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.3);
    }
    50% {
        transform: scale(1);
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    }
}

/* 对象复制高亮样式 */
.object-copy-highlight {
    background-color: var(--bg-secondary) !important;
    /* border: 2px solid rgba(34, 197, 94, 0.4) !important; */
    border-radius: 6px !important;
    box-shadow: 0 0 0 1px var(--accent-light) !important;
    animation: objectHighlight 0.4s ease-out;
}

@keyframes objectHighlight {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.3);
    }
    50% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
    }
}

/* 对象复制成功动画 */
.object-copy-success {
    background-color: rgba(34, 197, 94, 0.3) !important;
    border: 2px solid rgba(34, 197, 94, 0.6) !important;
    color: white !important;
    animation: objectCopySuccess 1.5s ease-out;
}

@keyframes objectCopySuccess {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    }
    25% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.4);
    }
    50% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* 对象排序成功动画 */
.object-sort-success {
    background-color: rgba(168, 85, 247, 0.3) !important;
    border: 2px solid rgba(168, 85, 247, 0.6) !important;
    color: white !important;
    animation: objectSortSuccess 1.5s ease-out;
}

@keyframes objectSortSuccess {
    0% {
        transform: scale(1) rotate(0deg);
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.6);
    }
    25% {
        transform: scale(1) rotate(2deg);
        box-shadow: 0 0 0 8px rgba(168, 85, 247, 0.4);
    }
    50% {
        transform: scale(1) rotate(0deg);
        box-shadow: 0 0 0 6px rgba(168, 85, 247, 0.3);
    }
    75% {
        transform: scale(1) rotate(-1deg);
        box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.2);
    }
    100% {
        transform: scale(1) rotate(0deg);
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0);
    }
}

/* 数组排序成功动画 */
.array-sort-success {
    background-color: rgba(59, 130, 246, 0.3) !important;
    border: 2px solid rgba(59, 130, 246, 0.6) !important;
    color: white !important;
    animation: arraySortSuccess 1.5s ease-out;
}

@keyframes arraySortSuccess {
    0% {
        transform: scale(1) translateY(0);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.6);
    }
    25% {
        transform: scale(1) translateY(-2px);
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.4);
    }
    50% {
        transform: scale(1) translateY(0);
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.3);
    }
    75% {
        transform: scale(1) translateY(1px);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    }
    100% {
        transform: scale(1) translateY(0);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.json-line {
    display: flex;
    align-items: flex-start;
    margin: 1px 0;
}

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

/* JSON设计器样式 */
.schema-editor-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.schema-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.schema-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schema-name-input {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.schema-description {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 12px;
    resize: vertical;
    min-height: 40px;
}

.root-object {
    border:none;
}

.fields-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.field-item {
    margin-bottom: 8px;
    margin-top: 8px;
    margin-right: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-card);
}

.field-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    cursor: pointer;
}

.field-header:hover {
    background-color: var(--bg-hover);
    border-radius: 6px;
}

.field-type-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    min-width: 50px;
    text-align: center;
}

.field-type-badge.string { background-color: #3b82f6; color: white; }
.field-type-badge.number { background-color: #10b981; color: white; }
.field-type-badge.integer { background-color: #059669; color: white; }
.field-type-badge.boolean { background-color: #f59e0b; color: white; }
.field-type-badge.array { background-color: #8b5cf6; color: white; }
.field-type-badge.object { background-color: #ef4444; color: white; }

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

.field-name-root {
    font-weight: 500;
    color: var(--text-primary);
}

.field-name-container {
    flex: 1;
}

.field-actions {
    display: flex;
    gap: 4px;
}

.btn-icon {
    width: 24px;
    height: 24px;
    border: none;
    background-color: var(--accent-light);
    color: var(--bg-primary);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

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

.field-children {
    padding-left: 20px;
}

.field-edit-form {
    padding: 10px;
    border-top: 1px solid var(--border-color);
    display: none;
}

.field-edit-form.active {
    display: block;
    border-radius: 6px;
}

/* 表单行布局 */
.field-edit-form .form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: flex-end;
}

.field-edit-form .form-row:last-child {
    margin-bottom: 0;
}

/* 表单组样式 */
.field-edit-form .form-group {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.field-edit-form .form-group-narrow {
    flex: 1;
}

.field-edit-form .form-group-wide {
    flex: 2;
}

.field-edit-form .form-group label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
}

.field-edit-form .form-group input,
.field-edit-form .form-group select,
.field-edit-form .form-group textarea {
    width: 100%;
    padding: 6px 8px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
}

.field-edit-form .form-group textarea {
    resize: vertical;
    min-height: 40px;
    line-height: 1.4;
}

.field-edit-form .form-group input:focus,
.field-edit-form .form-group select:focus,
.field-edit-form .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-light);
    background-color: var(--bg-tertiary);
}

.field-edit-form .form-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 必填字段样式 */
.field-required {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    white-space: nowrap;
    margin-bottom: 6px;
}

.field-required input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.field-required label {
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 500;
    margin: 0;
}

.json-example-editor {
    position: relative;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.example-editor-container {
    position: relative;
    display: flex;
    height: 100%;
}

.example-editor-container .line-numbers {
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 12px 8px;
    color: var(--text-secondary);
    font-family: var(--font-family-mono);
    font-size: 12px;
    line-height: 1.5;
    white-space: pre;
    user-select: none;
    min-width: 40px;
    text-align: right;
}

.example-editor-container textarea {
    flex: 1;
    border: none;
    background-color: transparent;
    color: var(--text-primary);
    font-family: var(--font-family-mono);
    font-size: 12px;
    line-height: 1.5;
    padding: 12px;
    resize: none;
    outline: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: hidden;
    overflow-y: auto;
}

.parse-status {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
}

.parse-status.success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    color: var(--accent-light);
}

.parse-status.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

.field-item.collapsed .field-children {
    display: none;
}

.field-header .expand-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
}

.field-header .expand-icon:before {
    content: '▼';
    font-size: 8px;
    transition: transform 0.2s;
}

.field-item.collapsed .field-header .expand-icon:before {
    transform: rotate(-90deg);
} 

.field-required-indicator {
    font-weight: bold;
    margin-left: 4px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
    user-select: none;
}

/* 必填状态 - 红色星号 */
.field-required-indicator.required {
    color: var(--error-color);
}

/* 非必填状态 - 灰色星号 */
.field-required-indicator.optional {
    color: var(--text-muted);
    opacity: 0.6;
}

/* 悬停效果 */
.field-required-indicator:hover {
    background-color: var(--bg-primary);
    transform: scale(1.2);
}

.field-required-indicator.required:hover {
    color: #ff6b6b;
}

.field-required-indicator.optional:hover {
    color: var(--text-secondary);
    opacity: 1;
}

.btn-icon:disabled {
    background-color: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
}

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

/* Array items 编辑器样式 */
.array-items-container {
    margin-top: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
}

.array-items-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    border-radius: 6px 6px 0 0;
}

.array-items-header[onclick] {
    cursor: pointer;
}

.array-items-header[onclick]:hover {
    background-color: var(--nav-hover);
}

.array-field-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

.array-items-header .expand-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
}

.array-items-header .expand-icon:before {
    content: '▼';
    font-size: 8px;
    transition: transform 0.2s;
}

.array-items-container.collapsed .array-items-header .expand-icon:before {
    transform: rotate(-90deg);
}

.array-items-container.collapsed .array-items-editor {
    display: none !important;
}

.array-items-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.array-items-editor {
    padding: 8px;
    background-color: var(--bg-card);
    display: block;
}

.array-items-title {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-light);
}

.btn-small {
    padding: 4px 8px;
    font-size: 11px;
    margin-top: 8px;
}

.array-items-container .field-item {
    margin-bottom: 6px;
}

.array-items-container .field-children {
    padding-left: 16px;
}

.array-items-editor .field-header:hover {
    background-color: var(--bg-hover);
} 

/* 内联编辑器样式 */
.inline-name-editor {
    width: 60%;
    background-color: var(--bg-card);
    border: 2px solid var(--accent-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    padding: 2px 6px;
    outline: none;
    min-width: 80px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    animation: nameEditorFadeIn 0.2s ease-out;
}

@keyframes nameEditorFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.inline-name-editor:focus {
    border-color: var(--accent-hover);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2), 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 增强字段交互提示 */
.field-type-badge {
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.field-type-badge:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.field-name {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px 6px;
    border-radius: 4px;
    position: relative;
}

.field-name:hover {
    background-color: var(--border-light);
    transform: scale(1.02);
}

.field-name:before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border: 1px dashed transparent;
    border-radius: 4px;
    transition: border-color 0.2s ease;
}

.field-name:hover:before {
    border-color: var(--accent-light);
    opacity: 0.5;
}

.field-name:after {
    content: '✏️';
    font-size: 10px;
    margin-left: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.field-name:hover:after {
    opacity: 0.6;
}

.field-name[style*="display: none"]:after {
    display: none;
}

.field-header {
    position: relative;
}

.field-type-badge,
.field-name {
    position: relative;
}

/* 类型选择器悬浮框样式 */
.type-selector-popup {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1000;
    animation: typePopupFadeIn 0.15s ease-out;
}

@keyframes typePopupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.type-option {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin: 0;
    position: relative;
}

.type-option:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.type-option.current-type {
    box-shadow: 0 0 0 2px var(--accent-color);
    outline: 1px solid rgba(255, 255, 255, 0.2);
    filter: brightness(1.1);
}

.type-selector-popup {
    position: fixed !important;
    z-index: 10000 !important;
}

.array-item-popup {
    border-color: var(--accent-light);
}

.array-items-header .field-type-badge {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.array-items-header .field-type-badge:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.array-items-header .field-type-badge:before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 1px dashed transparent;
    border-radius: 6px;
    transition: border-color 0.2s ease;
}

.array-items-header .field-type-badge:hover:before {
    border-color: var(--accent-light);
    opacity: 0.6;
}

/* JSON 格式化工具响应式样式 */
@media (max-width: 1300px) {
    .json-container {
        display: flex;
        height: calc(100vh - 55px);
        margin-top: 20px;
    }
    
    .json-input-section textarea {
        min-height: 200px;
    }
    
    .json-editor-container {
        min-height: 200px;
    }
    
    .json-editor-container textarea {
        min-height: 200px;
        font-size: 11px;
        padding: 8px;
    }
    
    .input-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .input-actions button {
        width: 100%;
    }
    
    .json-viewer {
        font-size: 11px;
    }
    
    .json-indent {
        margin-left: 12px;
    }
    
    .json-toggle {
        min-width: 10px;
        font-size: 10px;
    }
}




/* 响应式设计 */
@media (max-width: 1300px) {
    
    .data-types-grid,
    .use-cases,
    .feature-grid,
    .schema-features,
    .use-cases-schema,
    .standards-grid,
    .tools-grid,
    .best-practices {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    
    .step-number {
        align-self: center;
    }
}

/* 拖拽分隔条样式 */
.resize-handle {
    width: 12px;
    background-color: var(--bg-primary);
    cursor: col-resize;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    min-width: 8px;
    flex-shrink: 0;
}


.resize-line {
    width: 2px;
    height: 60px;
    background-color: var(--border-color);
    border-radius: 1px;
    transition: background-color 0.2s ease;
}

.resize-handle:hover .resize-line {
    background-color: var(--text-primary);
}

.resize-handle:active .resize-line {
    background-color: var(--text-primary);
}

/* 拖拽时的样式 */
.resizing {
    user-select: none;
}

/* 🔥 拖动时临时隐藏复杂渲染，提升性能 */
.resizing #jsonOutput {
    position: relative;
    opacity: 0.2;
    pointer-events: none;
}

/* 拖动时隐藏 JSON 输出的所有子元素（减少重排计算） */
.resizing #jsonOutput > * {
    visibility: hidden;
}

/* 拖动时显示提示文本 */
.resizing #jsonOutput::before {
    content: '⚡ 拖动中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 500;
    color: var(--text-primary);
    visibility: visible;
    z-index: 1;
    white-space: nowrap;
}

/* 拖动时也降低左侧面板的渲染复杂度 */
.resizing #lineNumbers {
    visibility: hidden;
}

.resizing #jsonInput {
    opacity: 0.5;
}

.resizing .resize-line {
    background-color: var(--text-primary);
}

/* 🔥 浏览器窗口 resize 时的性能优化 */
.window-resizing {
    /* 禁用过渡动画，减少计算 */
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* 窗口 resize 时临时降低复杂渲染 */
.window-resizing #jsonOutput {
    position: relative;
    opacity: 0.3;
}

.window-resizing #jsonOutput > * {
    visibility: hidden;
}

.window-resizing #jsonOutput::before {
    content: '📐 调整窗口中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    visibility: visible;
    z-index: 1;
    white-space: nowrap;
}

.window-resizing #lineNumbers {
    visibility: hidden;
}

.window-resizing #jsonInput {
    opacity: 0.5;
}

/* 全屏模态框样式 */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-primary);
    z-index: 9999;
    display: none;
    flex-direction: column;
}

.fullscreen-modal.active {
    display: flex;
}

/* 全屏搜索功能样式 */
.fullscreen-search-section {
    padding: 16px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    min-height: 60px;
    box-sizing: border-box;
}

.fullscreen-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.fullscreen-controls {
    display: flex;
    gap: 8px;
}

.fullscreen-controls .btn-secondary {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 6px;
    white-space: nowrap;
}

.fullscreen-content {
    flex: 1;
    display: flex;
    background-color: var(--bg-primary);
    overflow: hidden;
}

.fullscreen-main-area {
    flex: 1;
    padding: 20px;
    overflow: auto;
    min-width: 0; /* 防止flex子项溢出 */
}

.fullscreen-filter-area {
    width: 350px;
    background-color: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fullscreen-filter-section {
    flex: 1;
    padding: 20px;
    overflow: auto;
}

.fullscreen-filter-section .filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.fullscreen-filter-section .filter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.fullscreen-filter-section .filter-icon {
    font-size: 16px;
}

.fullscreen-filter-section .filter-text {
    font-size: 14px;
}

.fullscreen-filter-section .filter-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: normal;
}

.fullscreen-filter-section .filter-actions {
    display: flex;
    gap: 8px;
}

.fullscreen-filter-section .btn-filter-clear,
.fullscreen-filter-section .btn-filter-help {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fullscreen-filter-section .btn-filter-clear:hover,
.fullscreen-filter-section .btn-filter-help:hover {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--accent-light);
}

.fullscreen-filter-section .filter-rules-container {
    margin-bottom: 16px;
}

.fullscreen-filter-section .filter-empty-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 20px;
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px dashed var(--border-color);
}

.fullscreen-filter-section .filter-stats {
    display: flex;
    padding: 12px;
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 12px;
}

.fullscreen-filter-section .stats-text {
    color: var(--text-secondary);
    line-height: 1.4;
}

.fullscreen-filter-section .stats-text span {
    color: var(--text-primary);
    font-weight: 600;
}

.fullscreen-json-viewer {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    font-family: var(--font-family-mono);
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    min-height: calc(100vh - 120px) !important;
    box-sizing: border-box !important;
}

/* 全屏模式下的JSON样式继承 */
.fullscreen-json-viewer .json-key {
    color: var(--json-key-color);
    font-weight: 600;
}

.fullscreen-json-viewer .json-string {
    color: var(--json-string-color);
}

.fullscreen-json-viewer .json-number {
    color: var(--json-number-color);
}

.fullscreen-json-viewer .json-boolean {
    color: var(--json-boolean-color);
    font-weight: 600;
}

.fullscreen-json-viewer .json-null {
    color: var(--json-null-color);
    font-weight: 600;
}

.fullscreen-json-viewer .json-punctuation {
    color: var(--text-muted);
}

.fullscreen-json-viewer .json-expandable {
    cursor: pointer;
    user-select: none;
}

.fullscreen-json-viewer .json-expandable:hover {
    background-color: var(--bg-hover);
    border-radius: 4px;
}

.fullscreen-json-viewer .json-content {
    margin-left: 20px;
    border-left: 1px solid var(--border-color);
    padding-left: 12px;
    margin-top: 4px;
}

.fullscreen-json-viewer .json-content.json-no-indent {
    margin-left: 0;
    border-left: none;
    padding-left: 0;
}

.fullscreen-json-viewer .json-property {
    margin-bottom: 2px;
}

.fullscreen-json-viewer .json-value-container {
    margin-left: 20px;
}

.fullscreen-json-viewer .json-array-item {
    margin-left: 20px;
}

.fullscreen-json-viewer .json-content.collapsed {
    display: none;
}

/* 全屏模式下的动画效果 */
.fullscreen-modal {
    animation: fadeIn 0.3s ease-out;
}

.fullscreen-modal.closing {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* 导入模态框样式 */
.import-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.import-modal.active {
    display: flex;
}

.import-content {
    background-color: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.3s ease-out;
}

.import-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    border-radius: 12px 12px 0 0;
}

.import-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.btn-close {
    width: 32px;
    height: 32px;
    border: none;
    background-color: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

.import-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.import-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background-color: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

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

.import-tab.active {
    color: var(--accent-light);
    border-bottom-color: var(--accent-light);
    background-color: var(--bg-primary);
}

.import-body {
    padding: 24px;
}

.import-tab-content {
    display: none;
}

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

.import-section {
    margin-bottom: 20px;
}

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

.import-section input[type="file"],
.import-section input[type="url"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.import-section input[type="file"]:focus,
.import-section input[type="url"]:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.import-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.import-hint.warning {
    color: var(--warning-color);
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 12px;
}

.import-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    border-radius: 0 0 12px 12px;
}


.import-footer,
.import-footer {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.import-footer{
    background-color: var(--accent-light);
    border: 1px solid var(--success-color);
    color: white;
}

.import-footer{
    background-color: var(--success-hover);
}

.import-footer{
    background-color: var(--text-muted);
    border-color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.import-footer{
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.import-footer{
    background-color: var(--bg-tertiary);
}

/* 动画效果 */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.import-modal.closing .import-content {
    animation: slideOutDown 0.3s ease-out forwards;
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

/* 响应式适配 */
@media (max-width: 1300px) {
    .fullscreen-header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
        min-height: auto;
    }
    
    .fullscreen-header h2 {
        font-size: 16px;
    }
    
    .fullscreen-controls {
        width: 100%;
        justify-content: center;
    }
    
    .fullscreen-content {
        flex-direction: column;
    }
    
    .fullscreen-main-area {
        padding: 16px;
        flex: 1;
    }
    
    .fullscreen-filter-area {
        width: 100%;
        max-height: 40vh;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    
    .fullscreen-filter-section {
        padding: 16px;
    }
    
    .fullscreen-json-viewer {
        padding: 16px;
        font-size: 12px;
        min-height: calc(100vh - 140px);
    }

    .import-content {
        width: 95%;
        margin: 16px;
    }
    
    .import-header,
    .import-body,
    .import-footer {
        padding: 16px;
    }
    
    .import-footer {
        flex-direction: column;
    }
    
    .import-footer .btn-primary,
    .import-footer .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* 时间戳悬浮提示样式 */
.json-timestamp-tooltip {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    min-width: 280px;
    max-width: 400px;
    font-size: 13px;
    line-height: 1.4;
    backdrop-filter: blur(10px);
    animation: timestampTooltipFadeIn 0.2s ease-out;
}

.json-timestamp-tooltip.tooltip-bottom::before {
    top: -8px;
    border-bottom-color: var(--border-color);
    border-top-color: transparent;
}

.json-timestamp-tooltip.tooltip-bottom::after {
    top: -7px;
    border-bottom-color: var(--bg-card);
    border-top-color: transparent;
}

.json-timestamp-tooltip::before,
.json-timestamp-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    pointer-events: none;
}

.json-timestamp-tooltip::before {
    bottom: -8px;
    border-top-color: var(--border-color);
    border-bottom-color: transparent;
}

.json-timestamp-tooltip::after {
    bottom: -7px;
    border-top-color: var(--bg-card);
    border-bottom-color: transparent;
}

.timestamp-tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: 8px 8px 0 0;
}

.timestamp-icon {
    font-size: 16px;
    animation: timestampIconPulse 2s infinite;
}

@keyframes timestampIconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.timestamp-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.timestamp-tooltip-content {
    padding: 12px 16px;
}

.timestamp-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 12px;
}

.timestamp-info-row:last-child {
    margin-bottom: 0;
}

.timestamp-label {
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0;
    min-width: 70px;
}

.timestamp-value {
    color: var(--text-primary);
    text-align: right;
    word-break: break-word;
    font-family: var(--font-family-mono);
    font-size: 12px;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.timestamp-info-row:first-child .timestamp-value {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border-color: #4f46e5;
}

.timestamp-info-row:nth-child(2) .timestamp-value {
    background: linear-gradient(135deg, #059669, #0d9488);
    color: white;
    border-color: #059669;
}

.timestamp-info-row:nth-child(3) .timestamp-value {
    background: linear-gradient(135deg, #dc2626, #ea580c);
    color: white;
    border-color: #dc2626;
}

.timestamp-info-row:last-child .timestamp-value {
    background: linear-gradient(135deg, #7c2d12, #a16207);
    color: white;
    border-color: #7c2d12;
}

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

/* 时间戳提示响应式设计 */
@media (max-width: 1300px) {
    #jsonOutput {
        font-size: 11px;
    }
    .json-timestamp-tooltip {
        min-width: 240px;
        max-width: calc(100vw - 32px);
        font-size: 12px;
    }
    
    .timestamp-tooltip-header {
        padding: 10px 12px;
    }
    
    .timestamp-tooltip-content {
        padding: 10px 12px;
    }
    
    .timestamp-info-row {
        flex-direction: column;
        gap: 4px;
        margin-bottom: 10px;
    }
    
    .timestamp-label {
        min-width: auto;
    }
    
    .timestamp-value {
        text-align: left;
        font-size: 11px;
    }
}

/* 复制提示中的时间戳信息样式 */
.copy-tooltip-timestamp {
    padding: 12px 16px;
    /* background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary)); */
    border-radius: 6px;
    margin-bottom: 8px;
}

.timestamp-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.copy-tooltip-timestamp .timestamp-icon {
    font-size: 14px;
    animation: timestampIconPulse 2s infinite;
}

.copy-tooltip-timestamp .timestamp-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.timestamp-info-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timestamp-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.copy-tooltip-timestamp .timestamp-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    flex-shrink: 0;
}

.copy-tooltip-timestamp .timestamp-value {
    font-size: 11px;
    color: var(--text-primary);
    font-family: var(--font-family-mono);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    text-align: right;
    word-break: break-word;
}

.timestamp-info-item:first-child .timestamp-value {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border-color: #4f46e5;
}

.timestamp-info-item:nth-child(2) .timestamp-value {
    background: linear-gradient(135deg, #059669, #0d9488);
    color: white;
    border-color: #059669;
}

.timestamp-info-item:last-child .timestamp-value {
    background: linear-gradient(135deg, #7c2d12, #a16207);
    color: white;
    border-color: #7c2d12;
}

/* 复制提示中时间戳信息的响应式设计 */
@media (max-width: 768px) {
    .copy-tooltip-timestamp {
        padding: 10px 12px;
    }
    
    .timestamp-info-header {
        margin-bottom: 8px;
        padding-bottom: 6px;
    }
    
    .copy-tooltip-timestamp .timestamp-title {
        font-size: 12px;
    }
    
    .timestamp-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .copy-tooltip-timestamp .timestamp-label {
        font-size: 10px;
    }
    
    .copy-tooltip-timestamp .timestamp-value {
        font-size: 10px;
        text-align: left;
        width: 100%;
    }
}

/* ===== 可视化筛选器样式 ===== */

/* 筛选器区域 */
.visual-filter-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
    animation: filterSectionSlideIn 0.3s ease-out;
}

@keyframes filterSectionSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 300px;
    }
}

/* 筛选器头部 */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.filter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-icon {
    font-size: 16px;
    animation: filterIconPulse 2s infinite;
}

@keyframes filterIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.filter-text {
    font-size: 14px;
}

.filter-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.filter-actions {
    display: flex;
    gap: 8px;
}

.btn-filter-clear,
.btn-filter-help {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-filter-clear:hover,
.btn-filter-help:hover {
    background-color: var(--bg-hover);
    border-color: var(--accent-light);
}

/* 规则容器 */
.filter-rules-container {
    padding: 12px 16px;
    max-height: 200px;
    overflow-y: auto;
}

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

/* 筛选规则项 */
.filter-rule-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 5px 5px 0px 5px;
    margin-bottom: 8px;
    position: relative;
    animation: ruleSlideIn 0.3s ease-out;
}

@keyframes ruleSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.filter-rule-item:last-child {
    margin-bottom: 0;
}

.rule-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    gap: 8px;
    flex-wrap: wrap;
}

.rule-path {
    font-family: var(--font-family-mono);
    font-size: 12px;
    color: var(--accent-light);
    font-weight: 600;
    background-color: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    /* max-width: 280px;
    overflow: hidden; */
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.rule-separator {
    color: var(--text-secondary);
    font-size: 12px;
    flex-shrink: 0;
}

.rule-remove {
    background: none;
    border: none;
    color: var(--error-color);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.rule-remove:hover {
    background-color: var(--error-color);
    color: white;
    transform: scale(1.1);
}

.rule-condition {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.rule-mode {
    color: var(--warning-color);
    font-weight: 500;
    font-size: 12px;
    flex-shrink: 0;
}

.rule-value {
    font-family: var(--font-family-mono);
    background-color: var(--bg-tertiary);
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    font-size: 12px;
    /* max-width: 120px;
    overflow: hidden; */
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}

.rule-stats {
    font-size: 11px;
    color: var(--accent-light);
    font-weight: 500;
}

/* 筛选统计 */
.filter-stats {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background-color: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    font-size: 12px;
}

.stats-text {
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
}

.stats-text span {
    font-weight: 600;
    color: var(--accent-light);
}

/* JSON搜索功能样式 */
.json-search-section {
    padding: 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.search-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.json-search-icon {
    font-size: 16px;
}

.search-text {
    font-size: 14px;
}

.search-actions {
    display: flex;
    gap: 8px;
}

.btn-search-close {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-search-close:hover {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--accent-light);
}

.search-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.search-input {
    flex: 1 !important;
    padding: 8px 12px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    font-size: 13px !important;
    transition: all 0.2s ease !important;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-light) !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1) !important;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.btn-search,
.btn-search-clear {
    padding: 8px 16px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap;
}

.btn-search {
    background-color: var(--accent-light) !important;
    color: white !important;
    border-color: var(--accent-light) !important;
}

.btn-search:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover) !important;
}

.btn-search-clear {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}

.btn-search-clear:hover {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-color: var(--accent-light) !important;
}

/* 搜索选项 */
.search-options-container {

    padding: 6px 0px !important;
    background-color: rgba(255, 255, 255, 0.02) !important;
    border-radius: 6px !important;
}

.search-options-row {
    display: flex;
    gap: 16px;
}

.search-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.search-checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent-light);
    flex-shrink: 0;
    margin-top: 2px;
}

.search-option-label {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    flex: 1;
    line-height: 1.4;
}

.checkbox-icon {
    font-size: 14px;
    margin-right: 6px;
}

.option-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
}

.option-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-top: 2px;
}

.search-stats {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 12px;
}

.search-result-text {
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 搜索导航按钮 */
.search-navigation {
    display: flex;
    gap: 4px;
    align-items: center;
}

.btn-nav {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.btn-nav:hover {
    background-color: var(--accent-light);
    color: white;
    border-color: var(--accent-light);
}

.btn-nav:active {
    transform: scale(0.95);
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--bg-input);
    color: var(--text-muted);
    border-color: var(--border-color);
}

.btn-nav:disabled:hover {
    background-color: var(--bg-input);
    color: var(--text-muted);
    border-color: var(--border-color);
    transform: none;
}

/* 搜索计数显示 */
.search-count-display {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.search-label {
    min-width: 50px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* 替换输入容器 */
.replace-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* 替换选项容器 */
.replace-options-container {
    padding: 6px 0px;
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
}

.replace-options-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

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

.option-group-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.radio-group {
    display: flex;
    gap: 16px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

.replace-radio {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-light);
}

.radio-option:hover .option-text {
    color: var(--text-primary);
}

/* 切换选项按钮 */
.btn-toggle-options {
    padding: 6px 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
}

.btn-toggle-options:hover {
    background-color: var(--bg-primary);
    border-color: var(--accent-light);
}

.btn-toggle-options .toggle-icon {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.btn-toggle-options.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* 替换切换按钮 */
.btn-toggle-replace {
    padding: 8px 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.btn-toggle-replace:hover {
    background-color: var(--bg-primary);
    border-color: var(--accent-light);
    color: var(--text-primary);
}

.btn-toggle-replace.active {
    background-color: var(--accent-light);
    border-color: var(--accent-light);
    color: white;
}

.btn-toggle-replace .toggle-replace-icon {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.btn-toggle-replace.active .toggle-replace-icon {
    transform: rotate(180deg);
}

/* 替换区域 */
.replace-section {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}


/* 搜索高亮样式 */
.json-search-highlight {
    background-color: rgba(255, 235, 59, 0.6);
    color: var(--text-primary);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 700;
    box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.4);
    animation: searchHighlightPulse 0.3s ease-out;
}

@keyframes searchHighlightPulse {
    0% {
        background-color: rgba(255, 235, 59, 0.8);
        transform: scale(1.05);
    }
    100% {
        background-color: rgba(255, 235, 59, 0.6);
        transform: scale(1);
    }
}

/* 当前激活的搜索高亮 */
.json-search-highlight.current {
    background-color: rgba(255, 87, 34, 0.8);
    color: white;
    box-shadow: 0 0 0 2px rgba(255, 87, 34, 0.4);
    animation: currentHighlightPulse 0.5s ease-out;
}

@keyframes currentHighlightPulse {
    0% {
        background-color: rgba(255, 87, 34, 1);
        transform: scale(1.1);
        box-shadow: 0 0 0 4px rgba(255, 87, 34, 0.6);
    }
    100% {
        background-color: rgba(255, 87, 34, 0.8);
        transform: scale(1);
        box-shadow: 0 0 0 2px rgba(255, 87, 34, 0.4);
    }
}

/* 移动端搜索样式 */
@media (max-width: 768px) {
    .json-search-section {
        padding: 12px;
    }
    
    .search-input-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-input {
        width: 100%;
    }
    
    .btn-search,
    .btn-search-clear {
        width: 100%;
        padding: 10px;
    }
    
    .search-options-container {
        padding: 10px 12px;
        margin-top: 10px;
    }
    
    .search-options-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .option-text {
        font-size: 12px;
    }
    
    .option-desc {
        font-size: 10px;
    }
    
    .search-stats {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* 悬停提示框增强 */
.json-hover-tooltip {
    position: fixed;
    z-index: 10003;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    animation: hoverTooltipFadeIn 0.2s ease-out;
    min-width: 200px;
    backdrop-filter: blur(10px);
}

@keyframes hoverTooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tooltip-path {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: 8px 8px 0 0;
    font-family: var(--font-family-mono);
    font-size: 12px;
    color: var(--accent-light);
    font-weight: 600;
}

.tooltip-actions {
    display: flex;
    padding: 8px;
    gap: 8px;
}

.tooltip-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tooltip-btn:hover {
    background-color: var(--bg-hover);
    border-color: var(--accent-light);
    transform: translateY(-1px);
}

.filter-btn {
    background-color: var(--accent-light) !important;
    color: white !important;
    border-color: var(--accent-light) !important;
}

.filter-btn:hover {
    background-color: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
}

.copy-btn {
    background-color: var(--success-color) !important;
    color: white !important;
    border-color: var(--success-color) !important;
}

.copy-btn:hover {
    background-color: var(--success-hover) !important;
    border-color: var(--success-hover) !important;
}

.tooltip-hint {
    padding: 6px 12px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* 筛选规则配置弹窗 */
.filter-rule-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease-out;
}

.filter-rule-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.filter-rule-modal .modal-content {
    background-color: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
    z-index: 1;
}

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

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.filter-rule-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    border-radius: 12px 12px 0 0;
}

.filter-rule-modal .modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background-color: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

.filter-rule-modal .modal-body {
    padding: 24px;
}

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

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

.path-input,
.mode-select,
.value-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.path-input:focus,
.mode-select:focus,
.value-input:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.path-input {
    font-family: var(--font-family-mono);
}

.input-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.preview-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
}

.preview-result {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.filter-rule-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    border-radius: 0 0 12px 12px;
}

.cancel-btn,
.add-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.cancel-btn:hover {
    background-color: var(--bg-tertiary);
}

.add-btn {
    background-color: var(--accent-light);
    color: white;
}

.add-btn:hover {
    background-color: var(--bg-card);
}

.add-btn:disabled {
    background-color: var(--text-muted);
    border-color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

/* 筛选结果高亮 */
.json-filter-match {
    background-color: rgba(59, 130, 246, 0.2) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    border-radius: 4px !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1) !important;
    animation: filterMatchPulse 0.5s ease-in-out;
}

@keyframes filterMatchPulse {
    0% { 
        background-color: transparent; 
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.3);
    }
    50% { 
        background-color: rgba(59, 130, 246, 0.3); 
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    }
    100% { 
        background-color: rgba(59, 130, 246, 0.2); 
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .filter-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .filter-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .filter-stats {
        padding: 6px 12px;
    }
    
    .stats-text {
        font-size: 11px;
    }
    
    .rule-header {
        gap: 6px;
    }
    
    .rule-path {
        max-width: 120px;
        font-size: 11px;
    }
    
    .rule-mode {
        font-size: 11px;
    }
    
    .rule-value {
        max-width: 80px;
        font-size: 11px;
    }
    
    .rule-separator {
        font-size: 10px;
    }
    
    .filter-rule-modal .modal-content {
        width: 95%;
        margin: 16px;
    }
    
    .filter-rule-modal .modal-header,
    .filter-rule-modal .modal-body,
    .filter-rule-modal .modal-footer {
        padding: 16px;
    }
    
    .filter-rule-modal .modal-footer {
        flex-direction: column;
    }
    
    .cancel-btn,
    .add-btn {
        width: 100%;
        justify-content: center;
    }
    
    .json-hover-tooltip {
        min-width: 180px;
        max-width: calc(100vw - 32px);
    }
    
    .tooltip-actions {
        flex-direction: column;
        gap: 6px;
    }
    
    .tooltip-btn {
        font-size: 11px;
        padding: 6px 10px;
    }

    .resize-handle{
        display: none;
    }
}

/* 通用按钮禁用样式 */
button:disabled,
button[disabled] {
    opacity: 0.6;
    cursor: not-allowed !important;
    pointer-events: auto !important;
}

button:disabled:hover,
button[disabled]:hover {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    /* 禁止改变背景色和其他hover效果 */
    filter: none !important;
    transform: none !important;
}

/* ===== 代码生成功能样式 ===== */

/* 标签页导航 */
.tab-items {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}



.tab-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
    user-select: none;
    min-width: 80px;
}

/* 自定义 tooltip 样式 */
.tab-item:not(.active)::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--bg-tooltip, rgba(0, 0, 0, 0.85));
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.05s ease, visibility 0.05s ease;
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); */
    z-index: 1000;
    max-width: 250px;
    text-align: center;
    line-height: 1.4;
}

.tab-item:not(.active)::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--bg-tooltip, rgba(0, 0, 0, 0.85));
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.05s ease, visibility 0.05s ease;
    z-index: 1000;
}

.tab-item:not(.active):hover::after,
.tab-item:not(.active):hover::before {
    opacity: 1;
    visibility: visible;
}

.tab-item:hover:not(.active) {
    background: var(--text-color-2);
    color: white;
    /* transform: translateY(-1px); */
}

.tab-item.active {
    background: var(--accent-color);
    color: #ffffff;
    /* box-shadow: 
        0 2px 4px rgba(16, 185, 129, 0.2),
        0 1px 2px rgba(16, 185, 129, 0.1);
    transform: translateY(0); */
}

/* 激活状态的渐变光晕效果已禁用 */
/* .tab-item.active::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 6px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
} */

.tab-icon {
    font-size: 16px;
    margin-right: 4px;
}

.tab-text {
    white-space: nowrap;
    font-weight: inherit;
    line-height: 1.4;
}

/* 标签页内容 */
.tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

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

/* 语言选择器 */
.language-selector-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 150px;
}

.language-select:hover {
    border-color: var(--accent-light);
}

.language-select:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* 文件Tab导航 */
.file-tabs-container {
    /* margin-top: 16px; */
}

.file-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 4px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
}

.file-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family-mono);
}

.file-tab:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-light);
}

.file-tab.active {
    background-color: var(--accent-light);
    color: white;
    font-weight: 600;
    border: none;
}

.file-tab-icon {
    font-size: 14px;
}

.file-tab-name {
    white-space: nowrap;
}

.file-tab-main-badge {
    font-size: 10px;
    padding: 1px 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    margin-left: 4px;
}

/* 代码展示容器 */
.code-display-container {
    flex: 1;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: auto;
    margin-top: 0;
}

.file-tabs-container ~ .code-display-container {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
    margin-top: 0;
}

.code-display-container pre {
    margin: 0;
    padding: 16px;
    overflow: auto;
    height: 100%;
}

.code-display-container code {
    font-family: var(--font-family-mono);
    font-size: 13px;
    line-height: 1.6;
    display: block;
}

/* Prism.js 主题覆盖 */
.code-display-container pre[class*="language-"] {
    background-color: transparent;
    border: none;
    margin: 0;
    padding: 16px;
}

.code-display-container code[class*="language-"] {
    background-color: transparent;
    text-shadow: none;
}

/* 代码高亮颜色调整（与主题一致） */
.token.comment {
    color: var(--text-secondary);
}

.token.keyword {
    color: #c678dd;
}

.token.string {
    color: #98c379;
}

.token.function {
    color: #61afef;
}

.token.number {
    color: #d19a66;
}

.token.operator {
    color: #56b6c2;
}

.token.class-name {
    color: #e5c07b;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .output-tabs {
        padding: 4px 4px 0 4px;
        gap: 2px;
    }
    
    .tab-items {
        gap: 3px;
        padding: 3px;
    }
    
    .tab-item {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 70px;
    }
    
    .tab-icon {
        font-size: 14px;
        margin-right: 3px;
    }
    
    .language-selector-container {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 4px;
    }
    
    .language-selector-container label {
        font-size: 12px;
    }
    
    .language-select {
        width: 100%;
        min-width: auto;
    }
    
    .section-header .actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .section-header .actions button {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .file-tabs {
        padding: 2px;
    }
    
    .file-tab {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .file-tab-icon {
        font-size: 12px;
    }
    
    .code-display-container pre {
        padding: 12px;
    }
    
    .code-display-container code {
        font-size: 12px;
    }
}

/* 高级功能使用说明样式 */
.advanced-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.feature-usage {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.feature-usage:hover {
    border-color: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.feature-usage h4 {
    color: var(--text-primary);
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
}

.feature-usage p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .advanced-features {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ==================== JSON 编辑功能样式 ==================== */

/* 行内编辑 input */
.json-inline-edit {
    background: transparent;
    border: none !important;
    border-bottom: 1px dashed var(--accent-color) !important;
    border-radius: 0 !important;
    color: inherit !important;
    font-family: var(--font-family-mono);
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    min-width: 20px;
    max-width: 400px;
    text-align: center !important;
}

.json-inline-edit:focus {
    border-bottom-color: var(--accent-color);
    box-shadow: none;
}

.json-inline-edit.error {
    border-bottom-color: #ef4444;
    box-shadow: none;
}

/* 删除选项红色样式 */
.copy-tooltip-content.danger {
    color: #ef4444;
}

.copy-tooltip-content.danger:hover {
    background-color: #ef4444;
    color: white;
}

/* 快捷方式提示标签 */
.shortcut-hint {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.6;
    padding-left: 12px;
}

.copy-tooltip-content:hover .shortcut-hint {
    color: rgba(255, 255, 255, 0.7);
}

.copy-tooltip-content.danger:hover .shortcut-hint {
    color: rgba(255, 255, 255, 0.7);
}

/* 撤销 Toast */
.json-undo-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10010;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.json-undo-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.undo-toast-text {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
}

.undo-toast-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.undo-toast-btn:hover {
    filter: brightness(1.1);
}

.undo-toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.undo-toast-close:hover {
    opacity: 1;
}


/* Boolean 翻转动画 */
.json-value.boolean.toggling {
    animation: booleanToggle 0.3s ease;
}

@keyframes booleanToggle {
    0% { transform: scale(1); }
    30% { transform: scale(0.85); opacity: 0.5; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 可编辑元素 hover 样式（非大JSON模式） */
.json-hoverable.json-editable:hover {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    text-decoration-color: var(--text-muted);
}

/* ==================== 类型选择器 ==================== */

.json-type-selector {
    position: fixed;
    z-index: 10002;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: typeSelectorFadeIn 0.15s ease;
}

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

.json-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.15s, color 0.15s;
    font-family: var(--font-family-mono);
}

.json-type-btn:hover {
    background: var(--accent-color);
    color: white;
}

.json-type-btn .type-icon {
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

.json-type-btn .type-label {
    font-size: 10px;
    line-height: 1;
    opacity: 0.7;
    font-family: var(--font-family-base);
}

.json-type-btn:hover .type-label {
    opacity: 1;
}

/* ==================== 添加占位行 ==================== */

.json-add-placeholder {
    animation: addPlaceholderFadeIn 0.2s ease;
    padding-left: 20px;
}

@keyframes addPlaceholderFadeIn {
    from { opacity: 0; background: var(--accent-light); }
    to { opacity: 1; background: transparent; }
}

.json-add-label {
    color: var(--text-muted);
    font-family: var(--font-family-mono);
    font-size: inherit;
}

.json-add-value-area {
    color: var(--text-muted);
    font-size: inherit;
    font-family: var(--font-family-mono);
}

.json-add-key-input {
    color: var(--text-primary);
}

.json-add-value-input {
    min-width: 60px;
}
