@charset "utf-8";
/* =====================================================================
 * app.css —— new-api 日志导出台 统一样式
 * ---------------------------------------------------------------------
 * 设计 token 与站点其他工具（check/ 真伪检测站、主页 aabao.ai）保持一致：
 * 暖纸底 + 暖墨字 + 衬线标题 + JetBrains Mono 等宽数字。
 * 表格行的信息密度刻意对齐 new-api 自带的「通用日志」界面：
 * 每格最多两行（主值 + 次要值），任何字段都不换行，过长一律省略号截断。
 * ===================================================================== */
:root {
  /* 暖纸主题 */
  --paper:     #faf9f5;
  --paper-2:   #f3f1e9;
  --card:      #ffffff;
  --ink:       #14110c;
  --ink-soft:  #5b564c;
  --ink-faint: #8b8678;
  --line:      #e7e3d8;
  --line-soft: #efece3;

  /* 强调色 */
  --codex:   #10a37f;
  --claude:  #d97757;
  --gemini:  #4285f4;
  --accent:  #d97757;

  /* 语义色 */
  --pass: #3f9d6a;
  --warn: #c98a23;
  --fail: #c0392b;

  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, "Songti SC", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
  --radius: 16px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(60% 50% at 78% 8%, rgba(217,119,87,0.06), transparent 70%),
    radial-gradient(50% 40% at 12% 92%, rgba(66,133,244,0.05), transparent 70%);
  pointer-events: none; z-index: 0;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 外壳：正文 + 右侧配置栏并排。配置栏用 sticky 而非 fixed —— 滚动时一样保持可见，
   但由 flex 真实占位，不会和正文重叠，也省掉「视口宽度够不够放」的位移计算。 */
.shell {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; gap: 18px;
  max-width: 1620px; margin: 0 auto; padding: 22px 24px 80px;
}
.main { flex: 1; min-width: 0; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.topbar h1 {
  font-family: var(--serif); font-size: clamp(23px, 3.2vw, 31px); margin: 0;
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.12;
}
.topbar h1 .accent {
  background: linear-gradient(105deg, var(--claude), #e0935f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar .sub { color: var(--ink-soft); font-size: 13.5px; margin-top: 4px; max-width: 46em; }

.local-banner {
  display: flex; gap: 9px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--codex);
  border-radius: 11px; padding: 10px 14px; margin-bottom: 14px;
  font-size: 13px; color: var(--ink-soft); line-height: 1.55;
}
.local-banner .ico { flex-shrink: 0; font-size: 16px; line-height: 1.35; }
.local-banner b { color: var(--ink); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.card h2 {
  font-family: var(--serif); font-size: 17px; font-weight: 800;
  letter-spacing: -0.02em; margin: 0;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 11px;
}
.card-head .grow { flex: 1; }
.head-tools { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

/* ---------- 表单 ---------- */
.field { min-width: 0; }
.field label { display: block; font-size: 11.5px; color: var(--ink-soft); margin-bottom: 4px; font-weight: 600; }
.field input, .field select {
  width: 100%; padding: 8px 11px; background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; font-size: 13px; font-family: inherit;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field input[type=datetime-local] { font-family: var(--mono); font-size: 12px; }
.field .hint { font-size: 11px; color: var(--ink-faint); margin-top: 3px; line-height: 1.45; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row + .row { margin-top: 10px; }
.row .field { flex: 1 1 170px; }
.row .field.narrow { flex: 0 1 132px; }
.row .field.wide { flex: 2.4 1 250px; }
.row .field.time { flex: 0 1 196px; }

/* 连接信息在桌面端固定为一行：地址和令牌分配主要空间，旧版才需要的用户 ID 保持紧凑。 */
.conn-row { flex-wrap: nowrap; }
.conn-row .conn-url { flex: 1.25 1 320px; }
.conn-row .conn-token { flex: 1 1 280px; }
.conn-row .conn-user { flex: 0 0 150px; }
.conn-row .optional { color: var(--ink-faint); font-weight: 500; }
.conn-hint { margin-top: 7px; font-size: 11px; color: var(--ink-faint); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 17px; border: none; border-radius: 10px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; font-family: inherit; white-space: nowrap;
  transition: transform .12s, box-shadow .2s, background .2s, border-color .2s;
}
.btn-primary {
  background: var(--claude); color: #fff;
  box-shadow: 0 1px 2px rgba(31,30,27,0.05), inset 0 1px 0 rgba(255,255,255,0.15), 0 7px 20px -8px rgba(217,119,87,0.55);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); background: #cf6c4d; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink-faint); }
.btn-ghost:disabled { opacity: .55; cursor: not-allowed; color: var(--ink-faint); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-xs { padding: 3px 9px; font-size: 11.5px; border-radius: 7px; gap: 4px; }
a.btn, a.btn:hover { text-decoration: none; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* 时间快捷档 */
.preset-btns { display: flex; gap: 5px; flex-wrap: wrap; }
.preset-btn {
  padding: 4px 10px; border: 1.5px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink-soft); cursor: pointer;
  font-size: 11.5px; font-weight: 600; font-family: inherit; transition: .15s; white-space: nowrap;
}
.preset-btn:hover { border-color: var(--ink-faint); color: var(--ink); }
.preset-btn.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- 三步上手 ---------- */
.steps { display: flex; gap: 10px; flex-wrap: wrap; }
.step {
  flex: 1 1 250px; display: flex; gap: 10px; align-items: flex-start;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 11px; padding: 12px 14px;
}
.step-n {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--claude); color: #fff; font-size: 12px; font-weight: 700;
  font-family: var(--mono);
}
.step-t { font-size: 13.5px; font-weight: 700; line-height: 1.4; }
.step-d { font-size: 12px; color: var(--ink-soft); line-height: 1.6; margin-top: 2px; }

/* ---------- 汇总条（用量 / RPM / TPM） ---------- */
.summary { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sum-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 4px 11px 4px 9px; border-radius: 9px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-left: 3px solid var(--ink-faint);
  font-size: 12px; white-space: nowrap;
}
.sum-chip .k { color: var(--ink-soft); font-weight: 600; }
.sum-chip .v { font-family: var(--mono); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sum-chip.quota { border-left-color: var(--claude); }
.sum-chip.quota .v { color: var(--claude); }
.sum-chip.rpm { border-left-color: var(--gemini); }
.sum-chip.tpm { border-left-color: var(--codex); }
.sum-chip.total { border-left-color: var(--ink); }

/* ---------- 表格（单行密排，对齐 new-api 通用日志） ---------- */
.table-wrap {
  overflow: auto; max-height: min(70vh, 720px);
  border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  overscroll-behavior: contain;
}
table.logs { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
table.logs thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--paper-2); color: var(--ink-soft);
  font-size: 11.5px; font-weight: 700; text-align: left; letter-spacing: .02em;
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.logs tbody td {
  padding: 7px 10px; border-bottom: 1px solid var(--line-soft);
  vertical-align: middle; overflow: hidden;
}
table.logs tbody tr:last-child td { border-bottom: none; }
table.logs tbody tr:hover { background: var(--paper); }
table.logs tbody tr.is-error { background: rgba(192,57,43,.035); }
table.logs tbody tr.is-error:hover { background: rgba(192,57,43,.06); }

/* 每格统一两行结构：主值一行，次要值一行，都不换行 */
.c1, .c2 {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.c1 { line-height: 1.4; }
.c2 { line-height: 1.35; font-size: 11px; color: var(--ink-faint); margin-top: 1px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { text-align: right; }
.dim { color: var(--ink-faint); }

/* 弹性列的下限，防止窄屏下被压到看不出内容 */
col.col-auto-token { min-width: 118px; }
col.col-auto-model { min-width: 140px; }
col.col-auto-detail { min-width: 130px; }

/* 列宽由 colgroup 控制，这里只定对齐与字体 */
td.col-time .c1 { font-family: var(--mono); font-size: 12px; }
td.col-tokens, td.col-cost { text-align: right; }
td.col-tokens .c1, td.col-cost .c1, td.col-tokens .c2 { font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.col-cost .c1 { font-weight: 600; color: var(--claude); }

/* 类型：小号彩色文字（new-api 的做法），不占额外高度 */
.type-tag { font-size: 11px; font-weight: 600; }
.type-1 { color: #2f66c4; }
.type-2 { color: #2f7c53; }
.type-3 { color: #96661a; }
.type-4 { color: #6f4fa0; }
.type-5 { color: var(--fail); }
.type-6 { color: #0d7f63; }
.type-7 { color: #3f7d7d; }
.type-0 { color: var(--ink-faint); }

/* 渠道号 / 令牌名等小徽标 */
.chip {
  display: inline-block; max-width: 100%; vertical-align: bottom;
  padding: 0 6px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
  background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-soft);
  font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip.ch { color: var(--gemini); background: rgba(66,133,244,.07); border-color: rgba(66,133,244,.2); }

/* 用户：色环头像 + 名字，单行 */
.user-cell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.avatar {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; text-transform: uppercase;
}

/* 模型名 */
.model-name { font-size: 12.5px; font-weight: 500; }

/* 流式 / 耗时 */
.stream-yes { color: var(--gemini); font-size: 11.5px; font-weight: 600; }
.stream-no { color: var(--ink-faint); font-size: 11.5px; }
td.col-timing .c1 { font-family: var(--mono); font-size: 11.5px; font-weight: 600; }
.t-ok   { color: var(--pass); }
.t-warn { color: var(--warn); }
.t-bad  { color: var(--fail); }

/* 详情：单行省略，点开弹窗 */
.detail-btn {
  border: none; background: transparent; padding: 0; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--ink-soft); text-align: left;
  display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.detail-btn:hover { color: var(--ink); text-decoration: underline; }
.detail-btn .more { color: var(--ink-faint); font-size: 11px; }
.detail-btn.err { color: #a8322a; }

.empty { padding: 44px 20px; text-align: center; color: var(--ink-faint); font-size: 13.5px; }
.empty .big { font-size: 28px; display: block; margin-bottom: 7px; opacity: .55; }

/* ---------- 分页 ---------- */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-top: 11px;
}
.pager .info { font-size: 12px; color: var(--ink-soft); font-family: var(--mono); }
.pager .ctrl { display: flex; align-items: center; gap: 5px; }
.pager select {
  padding: 4px 7px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); font-size: 12px; font-family: inherit;
}
.pager input.jump {
  width: 58px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); font-family: var(--mono); font-size: 12px; text-align: center;
}

/* ---------- 右侧配置库（sticky 常驻） ---------- */
.side-rail {
  position: sticky; top: 22px;
  flex: 0 0 244px; width: 244px;
  max-height: calc(100vh - 44px); overflow-y: auto;
}
.cfg-store {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px; box-shadow: 0 8px 24px -16px rgba(20,17,12,.25);
}
.cfg-store-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%; border: none; background: transparent; cursor: pointer;
  padding: 4px 8px 8px; font-family: inherit; color: var(--ink-soft);
  font-weight: 700; font-size: 12px;
}
.cfg-store-head:hover { color: var(--ink); }
.cfg-caret { color: var(--ink-faint); font-size: 11px; transition: transform .15s; }
.cfg-store.collapsed .cfg-caret { transform: rotate(-90deg); }
.cfg-store.collapsed .cfg-store-body { display: none; }
.cfg-store-body { padding: 0 2px 2px; }

/* 配置卡片：整块可点即载入（不再额外放「载入」按钮），
   右侧只留 ✎ 重命名 与 ✕ 删除两个图标，与检测站的配置库保持一致。 */
.cfg-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 9px; }
.cfg-item {
  display: flex; align-items: stretch; gap: 0;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 9px;
  overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.cfg-item:hover { border-color: var(--accent); box-shadow: 0 4px 12px -8px var(--accent); }
.cfg-load {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 6px 10px; border: none; background: transparent; cursor: pointer;
  color: var(--ink); font-family: inherit; line-height: 1.3; text-align: left;
}
.cfg-load .nm {
  font-weight: 700; font-size: 12.5px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cfg-load .url {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cfg-icon {
  flex: 0 0 auto; border: none; background: transparent; cursor: pointer;
  padding: 0 9px; color: var(--ink-faint); font-size: 12px;
  border-left: 1px solid var(--line); line-height: 1;
}
.cfg-icon.edit:hover { color: var(--accent); background: rgba(217,119,87,.07); }
.cfg-icon.del:hover { color: var(--fail); background: rgba(192,57,43,.07); }
/* 行内重命名输入框（替换 .nm） */
.cfg-rename {
  width: 100%; font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink);
  background: var(--card); border: 1px solid var(--accent); border-radius: 6px;
  padding: 2px 6px; margin: 1px 0;
}
.cfg-rename:focus { outline: none; box-shadow: 0 0 0 2px rgba(217,119,87,.18); }
.cfg-empty { font-size: 12px; color: var(--ink-faint); padding: 4px 2px 9px; line-height: 1.5; }
.cfg-save-row { display: flex; flex-direction: column; gap: 6px; }
.cfg-save-row input {
  width: 100%; padding: 7px 10px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 9px; font-size: 12.5px; font-family: inherit; color: var(--ink);
}
.cfg-save-row input:focus { outline: none; border-color: var(--accent); }
/* .btn 是 inline-flex 且没有 justify-content，在竖排布局里被拉满宽度后
   文字仍靠左，所以这里显式居中。 */
.cfg-save-row .btn { width: 100%; justify-content: center; }
.cfg-tip { font-size: 11px; color: var(--ink-faint); margin-top: 7px; line-height: 1.5; }

/* 窄屏：侧栏内容被 JS 移到正文顶部，横向铺开成一条普通卡片 */
@media (max-width: 1180px) {
  .shell { display: block; padding: 18px 16px 70px; }
  .side-rail { position: static; top: auto; width: auto; flex: none; max-height: none; }
  #railSlotNarrow .cfg-store { margin-bottom: 12px; }
  .cfg-store { padding: 15px; border-radius: var(--radius); box-shadow: none; }
  .cfg-store-head { padding: 0 0 10px; font-size: 13px; }
  .cfg-list { flex-direction: row; flex-wrap: wrap; }
  .cfg-item { flex: 1 1 240px; }
  .cfg-save-row { flex-direction: row; }
  .cfg-save-row input { flex: 1; min-width: 180px; }
  /* 横排时按钮回到自适应宽度，不需要再拉满 */
  .cfg-save-row .btn { width: auto; }
}

/* ---------- 导出面板 ---------- */
.export-panel { background: var(--paper-2); border: 1px solid var(--line); border-radius: 11px; padding: 13px; margin-top: 11px; }
.check-row {
  display: flex; align-items: center; gap: 7px; cursor: pointer;
  font-size: 12.5px; color: var(--ink-soft); margin-top: 4px;
}
.check-row input { width: auto; accent-color: var(--claude); cursor: pointer; margin: 0; }
.check-row:hover { color: var(--ink); }
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 9px; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--claude), #e0935f); transition: width .25s; }
.export-log {
  margin-top: 9px; max-height: 124px; overflow-y: auto;
  font-family: var(--mono); font-size: 11px; line-height: 1.7; color: var(--ink-soft);
}
.export-log .err { color: var(--fail); }
.export-log .ok { color: var(--pass); }

/* ---------- 提示条 ---------- */
.notice {
  display: none; align-items: flex-start; gap: 8px;
  border-radius: 10px; padding: 10px 13px; margin-bottom: 12px;
  font-size: 12.5px; line-height: 1.55; border: 1px solid transparent;
}
.notice.show { display: flex; }
.notice.err  { background: rgba(192,57,43,.07); border-color: rgba(192,57,43,.25); color: #93291f; }
.notice.warn { background: rgba(201,138,35,.09); border-color: rgba(201,138,35,.28); color: #855a14; }
.notice.ok   { background: rgba(63,157,106,.08); border-color: rgba(63,157,106,.26); color: #2c6f4a; }
.notice code { font-family: var(--mono); font-size: .92em; background: rgba(0,0,0,.05); padding: 1px 4px; border-radius: 4px; }

/* 状态徽标（连接状态 / 传输方式） */
.role-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
}
.role-tag.okish   { background: rgba(63,157,106,.12); color: #2c6f4a; }
.role-tag.warnish { background: rgba(201,138,35,.13); color: #855a14; }
.role-tag.off     { background: var(--paper-2); color: var(--ink-faint); }

/* ---------- 详情弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(20,17,12,.42); backdrop-filter: blur(2px);
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--card); border: 1px solid var(--line); border-radius: 15px;
  width: min(560px, 100%); max-height: min(78vh, 700px); display: flex; flex-direction: column;
  box-shadow: 0 24px 60px -24px rgba(20,17,12,.4);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 17px; border-bottom: 1px solid var(--line);
}
.modal-title { font-family: var(--serif); font-size: 15.5px; font-weight: 800; }
.modal-close {
  border: none; background: transparent; cursor: pointer; font-size: 16px;
  color: var(--ink-faint); line-height: 1; padding: 4px 6px; border-radius: 7px;
}
.modal-close:hover { color: var(--ink); background: var(--paper-2); }
.modal-body { padding: 14px 17px; overflow-y: auto; }
.kv { display: grid; grid-template-columns: minmax(96px, 132px) 1fr; gap: 5px 12px; font-size: 12.5px; }
.kv dt { color: var(--ink-faint); font-size: 11.5px; }
.kv dd { margin: 0; font-family: var(--mono); font-size: 11.5px; word-break: break-all; }
.kv dd.warnv { color: #a8322a; }
.kv-sec {
  margin: 14px 0 7px; font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-faint);
}
.kv-sec:first-child { margin-top: 0; }

/* ---------- 常见问题 ----------
 * 每条独立成可折叠卡片：问题是明确的标题、答案缩进成块，
 * 避免问答挤在同一段里读不出层次。 */
.faq { display: flex; flex-direction: column; gap: 7px; margin-top: 11px; }
.faq-item {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; transition: border-color .15s;
}
.faq-item:hover { border-color: var(--ink-faint); }
.faq-item[open] { background: var(--card); border-color: var(--line); }
.faq-item > summary {
  cursor: pointer; list-style: none; padding: 10px 14px 10px 32px; position: relative;
  font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.5;
}
.faq-item > summary::-webkit-details-marker { display: none; }
/* 自绘展开箭头，避免各浏览器默认 marker 的位置差异 */
.faq-item > summary::before {
  content: '›'; position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); transition: transform .15s;
  color: var(--accent); font-size: 15px; font-weight: 700; line-height: 1;
}
.faq-item[open] > summary::before { transform: translateY(-50%) rotate(90deg); }
.faq-item > summary:hover { color: var(--accent); }

.faq-a {
  padding: 0 14px 12px 32px; font-size: 13px; color: var(--ink-soft); line-height: 1.75;
  border-top: 1px solid var(--line-soft); padding-top: 11px; margin-top: 2px;
}
.faq-a p { margin: 0 0 9px; }
.faq-a p:last-child { margin-bottom: 0; }
.faq-a b { color: var(--ink); }
.faq-a ol, .faq-a ul { margin: 0 0 9px; padding-left: 20px; }
.faq-a li { margin-bottom: 4px; }
.faq-a li:last-child { margin-bottom: 0; }
.faq-a code {
  font-family: var(--mono); font-size: .9em;
  background: var(--paper-2); border: 1px solid var(--line);
  padding: 0 4px; border-radius: 4px;
}
.faq-item[open] .faq-a code { background: var(--paper-2); }
/* 需要用户特别留意的一句，左侧加一条竖线 */
.faq-warn {
  border-left: 3px solid var(--warn); background: rgba(201,138,35,.07);
  padding: 7px 11px; border-radius: 0 7px 7px 0; margin-bottom: 0 !important;
}
.faq-more { margin-top: 2px; }
.faq-more a { font-weight: 600; }
/* 术语解释用定义列表，名词与释义对齐更好读 */
.faq-dl {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px;
  margin: 0 0 9px; align-items: baseline;
}
.faq-dl dt {
  font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--line);
  padding: 1px 7px; border-radius: 5px; justify-self: start;
}
.faq-dl dd { margin: 0; }

@media (max-width: 620px) {
  .faq-item > summary { padding-left: 28px; font-size: 13px; }
  .faq-a { padding-left: 28px; }
  .faq-dl { grid-template-columns: 1fr; gap: 1px; }
  .faq-dl dd { margin-bottom: 6px; }
}

/* ---------- 页脚 ---------- */
.site-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-faint); line-height: 1.6; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .shell { padding: 16px 13px 60px; }
  .card { padding: 14px; }
  .row .field, .row .field.narrow, .row .field.wide, .row .field.time,
  .conn-row .conn-url, .conn-row .conn-token, .conn-row .conn-user { flex: 1 1 100%; }
  .conn-row { flex-wrap: wrap; }
  .kv { grid-template-columns: 1fr; gap: 1px; }
  .kv dt { margin-top: 7px; }
  .table-wrap { max-height: 64vh; }
}
