/* ================================================================
   菜刀客在线工具页 · xml-converter.html 私有样式
   需在 /css/common.css 之后加载。
   ================================================================ */

/* ---- 覆盖公共值：本页容器更宽 ---- */
.container {
    max-width: 1400px;
}

.footer {
    max-width: 1400px;
}

/* ---- 覆盖公共布局：双栏并排 ---- */
.main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ---- 工具栏 ---- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    align-items: center;
}

.toolbar-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toolbar-group:not(:last-child) {
    padding-right: 15px;
    border-right: 1px solid #e5e7eb;
}

.toolbar .toolbar-label {
    font-size: 13px;
    color: #6b7280;
}

.indent-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* ---- 面板：等高列布局 ---- */
.panel {
    display: flex;
    flex-direction: column;
    height: 620px;
    min-height: 0;
}

.panel.extra-panel {
    height: auto;
    min-height: 0;
}

/* ---- 输入 / 输出编辑器 ---- */
.editor-wrap {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.line-numbers {
    flex-shrink: 0;
    min-width: 44px;
    padding: 15px 8px 15px 10px;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    text-align: right;
    color: #9ca3af;
    white-space: pre;
    user-select: none;
    overflow: hidden;
}

.editor-wrap textarea {
    flex: 1;
    width: auto;
    min-width: 0;
    height: auto;
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: none;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

/* ---- 输出高亮容器（用于格式化/排序的彩色显示） ---- */
.output-container {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: auto;
    order: 2;
}

.output-wrap {
    display: flex;
    flex: 1;
    min-height: 100%;
}

.output-pane {
    flex: 1;
    min-width: 0;
}

#output {
    padding: 15px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    width: auto;
    min-width: 0;
}

/* ---- 面板内部 order 布局（面板头置底）---- */
.panel-header {
    border-bottom: none;
    order: 4;
    flex-shrink: 0;
}

.panel-header:first-child {
    border-top: 1px solid #e5e7eb;
}

.editor-wrap {
    order: 1;
}

#output {
    order: 2;
}

.status-bar {
    flex-direction: column;
    align-items: stretch;
    order: 3;
    flex-shrink: 0;
}

/* ---- 语法高亮 ---- */
.hl-tag {
    color: #1750eb;
}

.hl-attr {
    color: #881391;
}

.hl-string {
    color: #0b7500;
}

.hl-comment {
    color: #999;
}

/* YAML 高亮 */
.yl-key {
    color: #1750eb;
}

.yl-string {
    color: #0b7500;
}

.yl-number {
    color: #ff6d01;
}

.yl-bool {
    color: #881391;
}

/* JSON 高亮 */
.js-key {
    color: #881391;
}

.js-string {
    color: #0b7500;
}

.js-number {
    color: #1750eb;
}

.js-bool {
    color: #ff6d01;
}

.js-null {
    color: #999;
}

.js-bracket {
    color: #333;
}

/* ---- 统计 ---- */
.stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-label {
    color: #9ca3af;
}

.stat-value {
    font-weight: 600;
    color: #374151;
}

/* ---- 文件上传 ---- */
.file-input {
    display: none;
}

/* ---- 小屏：双栏改上下纵向排列 ---- */
@media (max-width: 600px) {
    .main {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .panel {
        height: auto;
        min-height: 0;
    }

    .editor-wrap {
        flex: none;
    }

    .editor-wrap textarea {
        height: 220px;
    }

    textarea,
    #output {
        height: auto;
        min-height: 180px;
    }
}
