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

:root {
  --bg: #f7f9fc;
  --card: #fff;
  --border: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --radius: 12px;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  --error: #dc2626;
  --ok: #16a34a;
}

body {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== 顶部 Header ===== */
.app-header {
  text-align: center;
  padding: 18px 16px 8px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin: 0 !important;
}
.app-header h1 {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}
.app-header .subtitle {
  color: var(--muted);
  margin-top: 4px;
  margin-bottom: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ===== 主体布局 ===== */
.app-header + .app-main { margin-top: 6px !important; }

.app-main {
  flex: 1;
  max-width: 1400px;
  width: 90%;
  margin: 6px auto 24px !important;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start; /* 顶齐 */
}
@media(max-width:960px){
  .app-main{
    grid-template-columns:1fr;
    margin:6px auto 20px !important;
  }
}

/* ===== 面板通用 ===== */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-top: 0 !important;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-head h2 {
  font-size: 1rem;
  margin: 0;
}

.toolbar {
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: #fafbff;
}
.divider { width: 1px; background: var(--border); }

/* ===== 输入区（编辑器） ===== */
.editor-wrap {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  height: 460px;
  min-height: 460px;
  max-height: 460px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.editor-wrap:focus-within {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* 行号栏 */
#gutter {
  background: #f9fafb;
  border-right: 1px solid var(--border);
  color: #9ca3af;
  padding: 10px 8px;
  font: 13px/1.6 monospace;
  user-select: none;
  white-space: pre;
  overflow: hidden;
  height: 100%;
}

/* 输入框 */
#json-input {
  flex: 1;
  font: 14px/1.6 Consolas, monospace;
  padding: 12px 16px;
  border: none;
  outline: none;
  resize: none;
  width: 100%;
  height: 100%;
  background: #fff;
  color: var(--text);
  overflow: auto;
}
#json-input::selection { background: rgba(37, 99, 235, 0.15); }

/* 滚动条 */
#json-input::-webkit-scrollbar,
.output::-webkit-scrollbar {
  width: 8px;
}
#json-input::-webkit-scrollbar-thumb,
.output::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}
#json-input::-webkit-scrollbar-thumb:hover,
.output::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ===== 输出区 ===== */
.output {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  font: 14px/1.6 Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;              /* ✅ 可下拉滚动 */
  height: 460px;               /* ✅ 与输入区等高 */
  min-height: 460px;
  max-height: 460px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.output:hover {
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* ===== 错误提示 ===== */
.error-hint {
  padding: 10px 16px;
  background: #fff8f8;
  color: var(--error);
  border-top: 1px dashed #f5c2c2;
  font-size: 13px;
  white-space: pre-wrap;
}

/* ===== JSON 高亮 ===== */
.output .k { color: #2563eb; font-weight: 600; }
.output .s { color: #047857; }
.output .n { color: #9333ea; }
.output .b { color: #b45309; }
.output .nl { color: #6b7280; font-style: italic; }

/* ===== 按钮 ===== */
.btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: 0.2s;
}
.btn:hover { background: #eef2ff; }
.btn.primary { background: var(--primary); color: #fff; border: none; }
.btn.primary:hover { background: #1d4ed8; }
.btn.ghost { background: #f3f4f6; }

/* ===== 页脚 ===== */
.app-footer {
  text-align: center;
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* ===== 品牌徽章 ===== */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}
.brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, #3b82f6, #2563eb);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  user-select: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.brand-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.35);
}

/* ===== 导航兼容 ===== */
#navbar {
  position: relative;
  z-index: 200;
}

/* ===== 移动端更友好：减少高度 ===== */
@media (max-width: 960px) {
  .editor-wrap,
  .output {
    height: 360px;
    min-height: 360px;
    max-height: 360px;
  }
}

/* ==== 尺寸微调补丁：只改输入/输出框体的长宽 ==== */

/* 两列整体再宽一点点：总宽 +20px，等于每列约 +10px */
.app-main{
  width: calc(90% + 20px) !important;
  max-width: 1420px !important; /* 原 1400 -> 1420，仅对应 +20px */
}

/* 输入区框体（editor-wrap）高度改为 660px */
.editor-wrap{
  height: 660px !important;
  min-height: 660px !important;
  max-height: 660px !important;
}

/* 结果区框体（.output）同高 660px，内部可滚动 */
.output{
  height: 660px !important;
  min-height: 660px !important;
  max-height: 660px !important;
  overflow: auto !important;
}

/* 移动端仍按你原先的 360px，不改其它布局 */
@media (max-width: 960px) {
  .editor-wrap,
  .output {
    height: 360px !important;
    min-height: 360px !important;
    max-height: 360px !important;
  }
}

