/* ================================================================
   菜刀客在线工具页 · js-html-minifier.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: 10px;
    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-group .btn-mode {
    flex: none;
    padding: 7px 12px;
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    font-size: 12px;
}

.toolbar-group .btn-mode:hover {
    background: #f9fafb;
    transform: none;
}

.toolbar-group .btn-mode.active {
    background: #667eea;
    color: #ffffff;
    border-color: #667eea;
}

.toolbar-group .btn-mode.active:hover {
    background: #5a6fd6;
    transform: none;
}

.indent-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.opt-check {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    white-space: nowrap;
}

.opt-check input {
    accent-color: #667eea;
}

.opt-file {
    cursor: pointer;
}

/* ---- 模式提示 ---- */
.mode-hint {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #4338ca;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    margin-bottom: 15px;
}

.mode-hint code {
    background: rgba(102,126,234,0.15);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
}

/* ---- 面板：本页为等高列布局 ---- */
.panel {
    display: flex;
    flex-direction: column;
    height: 600px;
}

.panel-header {
    flex-shrink: 0;
}

.editor {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.editor-scroll {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    overflow: hidden;
}

.line-numbers {
    flex: none;
    width: 44px;
    overflow: hidden;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    padding: 15px 6px 15px 2px;
    text-align: right;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #9ca3af;
    user-select: none;
    white-space: pre;
}

.editor-scroll textarea {
    flex: 1;
    min-width: 0;
}

.editor textarea {
    flex: 1;
    width: 100%;
    min-height: 280px;
    padding: 15px;
    border: none;
    outline: none;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    word-break: break-all;
}

#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;
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.code-line {
    display: flex;
    white-space: pre-wrap;
    word-break: break-all;
}

.line-num {
    flex: none;
    width: 40px;
    margin-right: 14px;
    text-align: right;
    color: #9ca3af;
    user-select: none;
}

.line-num::selection {
    background: transparent;
}

.line-body {
    flex: 1;
    white-space: pre-wrap;
    word-break: break-all;
}

.status-bar {
    flex-shrink: 0;
    flex-direction: column;
    align-items: stretch;
}

.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;
}

/* ---- 语法高亮 ---- */
.js-keyword {
    color: #881391;
    font-weight: 600;
}

.js-string {
    color: #0b7500;
}

.js-number {
    color: #1750eb;
}

.js-regex {
    color: #0891b2;
}

.js-comment {
    color: #9ca3af;
    font-style: italic;
}

.js-punc {
    color: #333;
}

.html-tag {
    color: #1d4ed8;
    font-weight: 600;
}

.html-attr {
    color: #881391;
}

.html-string {
    color: #0b7500;
}

.html-comment {
    color: #9ca3af;
    font-style: italic;
}

/* ---- SEO 说明面板：收拢空白 ---- */
.panel.extra-panel {
    height: auto;
}

/* ---- 小屏：双栏改上下纵向排列 ---- */
@media (max-width: 600px) {
    .main {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .panel {
        height: auto;
    }

    .editor textarea {
        min-height: 180px;
        resize: vertical;
    }

    #output {
        min-height: 180px;
        height: auto;
    }

    .toolbar-group:not(:last-child) {
        padding-right: 0;
        border-right: none;
    }
}