/* ================================================================
   菜刀客在线工具页 · json-viewer.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;
}

.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: 640px;
}

/* ---- 面板头部/状态条/标签页重排 ---- */
.panel-header {
    border-bottom: none;
    order: 4;
    flex-shrink: 0;
}

.panel-header:first-child {
    border-top: 1px solid #e5e7eb;
}

.status-bar {
    flex-direction: column;
    align-items: stretch;
    order: 3;
    flex-shrink: 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%;
    height: 552px;
    padding: 15px;
    border: none;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

/* ---- 视图工具条（搜索/展开/收起） ---- */
.view-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 15px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    align-items: center;
    order: 1;
    flex-shrink: 0;
}

.view-search {
    position: relative;
    flex: 1;
    min-width: 160px;
    display: flex;
    align-items: center;
}

.view-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.view-search input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

.view-search .search-count {
    position: absolute;
    right: 8px;
    font-size: 12px;
    color: #9ca3af;
    pointer-events: none;
}

.view-toolbar .btn {
    padding: 5px 12px;
    font-size: 13px;
}

/* ---- 树形视图容器 ---- */
.viewer-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
    order: 2;
    padding: 5px 0;
}

.tree-view {
    padding: 8px 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.7;
}

/* ---- 节点行 ---- */
.jv-node {
    display: flex;
    align-items: flex-start;
    padding: 1px 8px;
    white-space: nowrap;
}

.jv-row-hover:hover {
    background: #f5f7ff;
}

.jv-dir {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.jv-arrow {
    display: inline-block;
    width: 16px;
    text-align: center;
    color: #9ca3af;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.jv-arrow.collapsed {
    transform: rotate(-90deg);
}

.jv-arrow.spacer {
    visibility: hidden;
    color: transparent;
}

.jv-bracket {
    color: #6b7280;
}

.jv-key {
    color: #881391;
    font-weight: 500;
    margin-right: 4px;
}

.jv-index {
    color: #6b7280;
    font-style: italic;
    margin-right: 4px;
}

.jv-colon {
    color: #6b7280;
    margin-right: 6px;
}

.jv-children {
    display: block;
}

.jv-children.hidden {
    display: none;
}

/* ---- 类型徽标 ---- */
.jv-summary {
    color: #9ca3af;
    font-size: 12px;
}

/* ---- 值高亮 ---- */
.jv-string {
    color: #0b7500;
    white-space: pre-wrap;
    word-break: break-all;
}

.jv-number {
    color: #1750eb;
}

.jv-boolean {
    color: #ff6d01;
}

.jv-null {
    color: #999;
}

/* ---- 搜索命中 ---- */
.jv-hit {
    background: #ffe9a8;
    border-radius: 2px;
}

.jv-current {
    background: #ffd54d;
    border-radius: 2px;
    box-shadow: 0 0 0 1px #f5a623;
}

/* ---- 空态 ---- */
.empty-state .icon {
    font-size: 42px;
}

/* ---- 统计 ---- */
.stats {
    display: flex;
    gap: 20px;
}

.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;
    }

    .editor-wrap {
        flex: none;
    }

    .editor-wrap textarea {
        height: 220px;
    }

    textarea {
        height: auto;
        min-height: 180px;
        resize: vertical;
    }

    .tree-view {
        height: auto;
        min-height: 180px;
        white-space: normal;
    }

    .viewer-wrap {
        overflow: visible;
    }
}

/*  底部 SEO 说明面板美化 ---- */
.panel.extra-panel {
    background: #ffffff;
    overflow: hidden;
    width: 1360px;
  margin: 0 auto;
  height: auto;
}

.panel.extra-panel .result-body {
    gap: 18px;
    padding: 24px 28px;
}

.panel.extra-panel .seo-article {
    margin: 0 auto;
    width: 100%;
}

.panel.extra-panel .seo-article h2 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 22px 0 10px;
    padding-left: 12px;
    border-left: 3px solid #667eea;
    line-height: 1.4;
}

.panel.extra-panel .seo-article h2:first-child {
    margin-top: 0;
}

.panel.extra-panel .seo-article p {
    font-size: 14px;
    line-height: 1.9;
    color: #4b5563;
    text-align: justify;
}

.panel.extra-panel .seo-article ul {
    margin: 10px 0 0 20px;
    font-size: 14px;
    line-height: 2.1;
    color: #4b5563;
    list-style: none;
}

.panel.extra-panel .seo-article ul li {
    position: relative;
    padding-left: 6px;
}

.panel.extra-panel .seo-article ul li::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 0.75em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #667eea;
    opacity: 0.6;
}
