/* 服务工作台 */
#app { height: 100%; display: flex; flex-direction: column; }
.svc-pick { display: flex; align-items: center; gap: 8px; }
.svc-pick select { min-width: 220px; }
.saved { font-size: 12px; color: var(--ink-3); }

.layout { flex: 1; display: grid; grid-template-columns: 1fr; min-height: 0; }
.layout.with-yaml { grid-template-columns: minmax(340px, 34%) 1fr; }
.editor-pane { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--paper); min-height: 0; }
.pane-head { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; font-weight: 600; }
.pane-head .hint { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.yaml {
  flex: 1; border: 0; border-radius: 0; outline: 0; resize: none; padding: 12px 14px; tab-size: 2; box-shadow: none !important;
  font: 12.5px/1.6 var(--mono); color: var(--ink); background: #fbfaf8; white-space: pre; overflow: auto;
}
.parse-error { padding: 8px 14px; background: var(--rose-l); color: var(--rose-d); border-top: 1px solid #e5cfcb; font-size: 12px; }

.result-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.tabs { display: flex; gap: 2px; padding: 0 16px; background: var(--paper); border-bottom: 1px solid var(--line); flex: none; align-items: center; }
.tabs button.tab {
  font: inherit; border: 0; background: none; padding: 12px 14px; cursor: pointer; color: var(--ink-2);
  border-bottom: 2px solid transparent; display: flex; gap: 6px; align-items: center;
}
.tabs button.tab.active { color: var(--ink); border-bottom-color: var(--sage-d); font-weight: 600; }
.tabs .yaml-toggle { margin-left: auto; }
.count { font-size: 11px; background: var(--paper-2); color: var(--ink-2); border-radius: 9px; padding: 0 6px; font-weight: 500; }
.count.err { background: var(--rose); color: #fff; }
.count.warn { background: var(--sand-l); color: var(--sand-d); }
.tab-body { flex: 1; overflow: auto; padding: 18px 20px; min-height: 0; }
.tab-body.flush { padding: 0; overflow: hidden; }

.cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { text-align: center; margin: 0; color: var(--ink-2); }
.stat .num { font-size: 24px; font-weight: 600; color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.note { color: var(--ink-3); margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
table.kv th { text-align: left; color: var(--ink-3); font-weight: 400; width: 80px; padding: 4px 0; vertical-align: top; }
table.kv td { padding: 4px 0; }
.judge { margin: 0; padding-left: 20px; color: var(--ink-3); }
.judge li { padding: 2px 0; }
.judge li.hit { color: var(--ink); font-weight: 600; }
.judge .why { font-weight: 400; color: var(--ink-3); }
.trans { white-space: nowrap; }
.legend { display: inline-flex; gap: 4px; }
.edit-link { margin-left: auto; font-size: 12px; font-weight: 400; }

/* 校验 */
.verdict { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; font-weight: 600; }
.verdict.good { background: var(--sage-l); color: var(--sage-d); }
.verdict.bad { background: var(--rose-l); color: var(--rose-d); }
.rules { list-style: none; margin: 0; padding: 0; }
.rules li { padding: 4px 0; display: flex; align-items: center; gap: 8px; }
.rules .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.rules li.pass .dot { background: var(--sage); }
.rules li.fail { color: var(--rose-d); font-weight: 600; }
.rules li.fail .dot { background: var(--rose); }
.lvl { font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.lvl.error { background: var(--rose-l); color: var(--rose-d); }
.lvl.warn { background: var(--sand-l); color: var(--sand-d); }

/* 生成结果 */
.files { display: grid; grid-template-columns: 320px 1fr; height: 100%; min-height: 0; }
.files > .empty { grid-column: 1 / -1; }
.file-side { border-right: 1px solid var(--line); background: var(--paper); display: flex; flex-direction: column; min-height: 0; }
.kinds { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; border-bottom: 1px solid var(--line); }
.kind-filter { font: inherit; font-size: 11px; border: 1px solid currentColor; background: #fff; border-radius: 10px; padding: 1px 8px; cursor: pointer; }
.kind-filter.off { opacity: .35; text-decoration: line-through; }
.k-full { color: var(--sage-d); }
.k-skeleton { color: var(--sand-d); }
.k-dir { color: var(--ink-3); }
.k-stub { color: var(--lav-d); }
.k-snapshot { color: var(--blue-d); }
.todo-total { padding: 6px 12px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.tree { overflow: auto; flex: 1; padding: 6px 0 20px; font-size: 12.5px; }
.tn-children { padding-left: 14px; }
.tn-dir { padding: 2px 10px; cursor: pointer; color: var(--ink-2); white-space: nowrap; font-weight: 500; }
.caret { display: inline-block; width: 14px; color: var(--ink-3); }
.tn-file { padding: 2px 10px 2px 24px; cursor: pointer; white-space: nowrap; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.tn-file:hover { background: var(--paper-2); }
.tn-file.sel { background: var(--sage-l); }
.kdot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.tn-file.k-full .kdot { background: var(--sage); }
.tn-file.k-skeleton .kdot { background: var(--sand); }
.tn-file.k-dir .kdot { background: var(--ink-3); }
.tn-file.k-stub .kdot { background: var(--lav); }
.tn-file.k-snapshot .kdot { background: var(--blue); }
.tn-todo { margin-left: auto; font-size: 10px; background: var(--sand-l); color: var(--sand-d); border-radius: 8px; padding: 0 5px; }
.file-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.file-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 14px; background: var(--paper); border-bottom: 1px solid var(--line); }
.fpath { background: none; padding: 0; font-size: 12px; }
.kind-badge { font-size: 11px; border: 1px solid currentColor; border-radius: 10px; padding: 0 8px; }
.todo { font-size: 11px; background: var(--sand-l); color: var(--sand-d); border-radius: 10px; padding: 0 8px; }
.file-head .rule { margin-left: auto; }
pre.code { margin: 0; flex: 1; overflow: auto; padding: 14px 16px; background: #fbfaf8; font: 12.5px/1.6 var(--mono); }
pre.code code { background: none; padding: 0; font: inherit; }
mark.todo-mark { background: #f3e2b8; color: #7a5a1f; padding: 0 2px; border-radius: 2px; font-weight: 700; }
/* highlight.js 莫兰迪 */
.hljs { color: var(--ink); background: none; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in { color: #7a6a94; }
.hljs-string, .hljs-attr-value { color: #6f8676; }
.hljs-comment { color: #a69f97; font-style: italic; }
.hljs-meta, .hljs-annotation { color: #a07a52; }
.hljs-title, .hljs-title.class_, .hljs-type { color: #5f7286; }
.hljs-number, .hljs-literal { color: #a0625d; }
.hljs-attr, .hljs-name, .hljs-tag { color: #5f7286; }

@media (max-width: 1100px) {
  .layout.with-yaml { grid-template-columns: 1fr; grid-template-rows: 40vh 1fr; }
  .editor-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .files { grid-template-columns: 240px 1fr; }
}
