/* ============================================================
   问渠 · 组件层
   卡片 / 按钮 / 标签 / 表格 / 表单 / 弹层 / 编辑器 / 图表
   ============================================================ */

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.card.sheen::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: var(--sheen);
  pointer-events: none;
}
.card.pad { padding: 20px 22px; }
.card.pad-sm { padding: 14px 16px; }
.card.pad-lg { padding: 26px 28px; }

.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
.card-head .title { font-family: var(--font-serif); font-size: 15.5px; font-weight: 600; letter-spacing: .02em; }
.card-head .hint { font-size: 11.5px; color: var(--ink-4); }
.card-body { padding: 18px 20px; }

.hairline {
  height: 1px; border: 0; margin: 0;
  background: linear-gradient(90deg, transparent, var(--gold-line) 22%, var(--gold-line) 78%, transparent);
  opacity: .55;
}

/* ---------- 按钮 ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink-2);
  --btn-line: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--btn-line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: .18s var(--ease);
  user-select: none;
}
.btn:hover { border-color: var(--line-strong); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn .ico { flex: none; }

.btn-primary {
  --btn-bg: linear-gradient(180deg, var(--gold), var(--gold-deep));
  --btn-fg: #1a1207;
  --btn-line: transparent;
  font-weight: 700;
  box-shadow: 0 8px 20px -14px rgba(217, 183, 103, .9), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.btn-primary:hover { color: #1a1207; filter: brightness(1.06); }

.btn-dark {
  --btn-bg: linear-gradient(180deg, #2a1f12, #16100a);
  --btn-fg: var(--gold-bright);
  --btn-line: rgba(217, 183, 103, .28);
}
.btn-dark:hover { --btn-fg: #fff3cf; border-color: rgba(217, 183, 103, .5); }

.btn-ghost { --btn-bg: var(--surface-2); --btn-fg: var(--ink-2); --btn-line: var(--line); }
.btn-ghost:hover { --btn-bg: var(--surface-3); }

.btn-ruby { --btn-bg: var(--ruby-soft); --btn-fg: var(--ruby); --btn-line: rgba(216, 87, 98, .3); }
.btn-ruby:hover { --btn-fg: var(--ruby); border-color: var(--ruby); }

.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 14px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; padding: 0; }

/* ---------- 标签 / 胶囊 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 8px;
  border-radius: 5px;
  font-size: 11px; line-height: 1;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag.gold { color: var(--gold); background: var(--gold-soft); border-color: var(--gold-line); }
.tag.ruby { color: var(--ruby); background: var(--ruby-soft); border-color: rgba(216, 87, 98, .28); }
.tag.green { color: var(--green); background: var(--green-soft); border-color: rgba(133, 178, 110, .28); }
.tag.teal { color: var(--teal); background: rgba(111, 179, 164, .1); border-color: rgba(111, 179, 164, .26); }
.tag.violet { color: var(--violet); background: rgba(183, 155, 214, .1); border-color: rgba(183, 155, 214, .26); }
.tag.blue { color: var(--blue); background: rgba(131, 168, 207, .1); border-color: rgba(131, 168, 207, .26); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 11.5px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-3);
}
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.diff {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 8px; border-radius: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  border: 1px solid transparent;
}
.diff-1 { color: var(--green); background: var(--green-soft); border-color: rgba(133, 178, 110, .25); }
.diff-2 { color: var(--teal); background: rgba(111, 179, 164, .1); border-color: rgba(111, 179, 164, .25); }
.diff-3 { color: var(--blue); background: rgba(131, 168, 207, .1); border-color: rgba(131, 168, 207, .25); }
.diff-4 { color: var(--violet); background: rgba(183, 155, 214, .1); border-color: rgba(183, 155, 214, .25); }
.diff-5 { color: var(--ruby); background: var(--ruby-soft); border-color: rgba(216, 87, 98, .25); }

.status-dot { display: inline-block; vertical-align: middle; width: 7px; height: 7px; border-radius: 50%; flex: none; }

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--gold-deep);
  background: linear-gradient(150deg, var(--surface-3), var(--surface));
  border: 1px solid var(--line-2);
  overflow: hidden;
  user-select: none;
}
.status-dot.ac { background: var(--green); box-shadow: 0 0 8px rgba(133, 178, 110, .6); }
.status-dot.wa { background: var(--ruby); }
.status-dot.try { background: var(--gold); box-shadow: 0 0 8px rgba(217, 183, 103, .5); }
.status-dot.none { background: var(--line-2); }

.verdict {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: .03em;
}
.verdict.ac { color: var(--green); }
.verdict.wa { color: var(--ruby); }
.verdict.tle { color: var(--amber); }
.verdict.ce, .verdict.re { color: var(--ink-3); }

/* ---------- 表单 ---------- */
.input, .select, .textarea {
  width: 100%;
  height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  transition: .18s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--line-strong);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239e8f74' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
.textarea { height: auto; min-height: 90px; padding: 9px 11px; resize: vertical; line-height: 1.7; }

.field-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--ink-3); margin-bottom: 6px;
}

/* 分段控件 */
.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.seg button {
  height: 27px; padding: 0 12px;
  border: 0; border-radius: 6px; background: transparent;
  color: var(--ink-3); font-size: 12px; cursor: pointer;
  transition: .16s var(--ease);
  white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button.active {
  background: var(--surface);
  color: var(--gold);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18), inset 0 0 0 1px var(--line);
  font-weight: 600;
}

/* 开关 */
.switch { position: relative; width: 34px; height: 19px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.switch .track {
  position: absolute; inset: 0; border-radius: 99px;
  background: var(--surface-3); border: 1px solid var(--line-2);
  transition: .2s var(--ease);
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--ink-3); transition: .2s var(--ease);
}
.switch input:checked + .track { background: var(--gold-soft); border-color: var(--gold-line); }
.switch input:checked + .track::after { left: 17px; background: var(--gold); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-4);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--surface);
}
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
  vertical-align: middle;
}
.table tbody tr { transition: background .15s var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table .num { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }

/* ---------- 进度 ---------- */
.bar { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
  transition: width .7s var(--ease-out);
}
.bar.green > i { background: linear-gradient(90deg, #4a6e3f, var(--green)); }
.bar.soft > i { background: var(--line-strong); }

.ring {
  --p: 0;
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--surface-3) 0);
  position: relative; flex: none;
}
.ring::before {
  content: ""; position: absolute; inset: 5px;
  border-radius: 50%; background: var(--surface);
}
.ring > span { position: relative; font-family: var(--font-mono); font-size: 13px; color: var(--gold); }

/* ---------- 空状态 ---------- */
.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--ink-4);
}
.empty .mark {
  width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 14px; display: grid; place-items: center;
  border: 1px dashed var(--line-2);
  color: var(--ink-4);
}
.empty .t { font-size: 13.5px; color: var(--ink-3); margin-bottom: 4px; }
.empty .s { font-size: 12px; }

/* ---------- 弹层 ---------- */
.modal-layer {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: 24px;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  animation: fade-in .18s var(--ease) both;
}
.modal {
  width: min(520px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  animation: pop-in .24s var(--ease-out) both;
}
.modal.wide { width: min(760px, 100%); }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 20px 22px 12px;
}
.modal-title { font-family: var(--font-serif); font-size: 18px; font-weight: 600; }
.modal-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.modal-body { padding: 6px 22px 20px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.toast-layer {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  z-index: 120; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  min-width: 220px; max-width: 460px;
  padding: 10px 15px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  color: var(--ink-2);
  animation: fade-up .26s var(--ease-out) both;
}
.toast.out { animation: fade-in .2s var(--ease) reverse both; }
.toast .ico { color: var(--gold); flex: none; }
.toast.ok .ico { color: var(--green); }
.toast.err .ico { color: var(--ruby); }

/* 下拉 */
.dropdown {
  position: absolute; z-index: 60;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 11px;
  box-shadow: var(--shadow-pop);
  padding: 6px;
  animation: pop-in .18s var(--ease-out) both;
}
.dropdown .dd-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 7px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}
.dropdown .dd-item:hover { background: var(--surface-2); color: var(--ink); }
.dropdown .dd-head {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-4); padding: 7px 10px 5px;
}
.dropdown .dd-empty { padding: 14px 10px; font-size: 12px; color: var(--ink-4); text-align: center; }

/* ---------- 搜索下拉 ---------- */
.search-pop {
  position: absolute; top: 42px; left: 0; right: 0; z-index: 70;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 11px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: pop-in .18s var(--ease-out) both;
}
.search-pop .item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.search-pop .item:last-child { border-bottom: 0; }
.search-pop .item:hover, .search-pop .item.sel { background: var(--surface-2); }
.search-pop .empty { padding: 18px; }

/* ---------- 代码编辑器 ---------- */
.editor {
  position: relative;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: #0b0805;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
}
:root[data-theme="light"] .editor { background: #1d1811; }
.editor-bar {
  display: flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 13px;
  background: #14100a;
  border-bottom: 1px solid #2a2115;
  color: #9a8b6d;
  font-family: var(--font-sans);
  font-size: 11.5px;
}
.editor-dots { display: flex; gap: 6px; flex: none; margin-right: 2px; }
.editor-dots i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.editor-dots i:nth-child(1) { background: #df625c; }
.editor-dots i:nth-child(2) { background: #d9b767; }
.editor-dots i:nth-child(3) { background: #7fae6b; }
.editor-bar .lang {
  flex: none;
  height: 26px; padding: 0 12px; border-radius: 99px;
  border: 1px solid #3a2c18; background: #1a140d; color: #dccca0;
  font-family: var(--font-mono); font-size: 11px; cursor: pointer;
  max-width: 108px;
}
.editor-bar #fileName { flex: none; white-space: nowrap; color: #7f735e; }
.editor-bar .spacer { flex: 1; }
.editor-bar .mini {
  flex: none; white-space: nowrap;
  height: 24px; padding: 0 6px; border-radius: 5px;
  border: 1px solid transparent; background: transparent; color: #8a7c62;
  font-size: 11px; cursor: pointer;
}
.editor-bar .mini:hover { background: #221a11; color: #e9ce83; }

.editor-body { position: relative; display: flex; height: 560px; overflow: hidden; }
@media (max-width: 1280px) { .editor-body { height: 520px; } }
@media (max-width: 900px) { .editor-body { height: 440px; } }
@media (max-width: 620px) { .editor-body { height: 380px; } }
.editor-gutter {
  flex: none; width: 46px; padding: 12px 8px 12px 0;
  text-align: right; color: #4e4433; user-select: none;
  overflow: hidden;
  font-size: 12px; line-height: 1.65;
  background: #0d0906;
  border-right: 1px solid #201a10;
}
.editor-gutter .inner { will-change: transform; }
.editor-scroll { position: relative; flex: 1; min-width: 0; }
.editor-pre, .editor-input {
  margin: 0; padding: 12px 16px;
  font-family: inherit; font-size: inherit; line-height: inherit;
  white-space: pre; tab-size: 2;
}
.editor-pre {
  position: absolute; top: 0; left: 0;
  pointer-events: none;
  color: #d8cbb0;
  will-change: transform;
}
.editor-input {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; outline: none; resize: none;
  background: transparent;
  color: transparent;
  caret-color: #f0d79a;
  display: block;
  overflow: auto;
  white-space: pre;
}
.editor-input::-webkit-scrollbar { width: 8px; height: 8px; }
.editor-input::-webkit-scrollbar-thumb { background: #332818; border: 2px solid #0b0805; }
.editor-input::selection { background: rgba(217, 183, 103, .28); }
.editor.status-error .editor-bar { color: #d85762; }

.judge-state {
  flex: none;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .02em;
  color: #8a7c62;
  border: 1px solid #3a2c18;
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 106px;
  text-align: center;
}
.judge-state.ok { color: #9dc287; border-color: rgba(133, 178, 110, .38); background: rgba(133, 178, 110, .08); }
.judge-state.off { color: #e08089; border-color: rgba(216, 87, 98, .38); background: rgba(216, 87, 98, .08); }

.draft-state { flex: none; font-family: var(--font-mono); font-size: 9px; color: #8a7c62; }
.draft-state.ok { color: #9dc287; }
.draft-state.err { color: #e08089; }

.compile-log {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: 12px 14px;
  background: #0b0805;
  color: #e2b4b4;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  border-bottom: 1px solid var(--line);
}

.tok-key { color: #d79a6a; }
.tok-type { color: #c9b06a; }
.tok-fn { color: #e6cf94; }
.tok-str { color: #8fb07a; }
.tok-num { color: #9fb8d8; }
.tok-com { color: #6b5f4a; font-style: italic; }
.tok-pre { color: #b79bd6; }
.tok-op { color: #b9a98c; }

/* 评测面板 */
.judge-panel { border-top: 1px solid var(--line); background: var(--surface-2); }
.judge-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  font-size: 12px; color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}
.judge-tests { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; max-height: 190px; overflow: auto; }
.judge-test {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3);
}
.judge-test .name { width: 66px; }
.judge-test .res { margin-left: auto; }
.judge-test.running { background: var(--gold-soft); color: var(--gold); }
.judge-test.pass .res { color: var(--green); }
.judge-test.fail .res { color: var(--ruby); }
.judge-test .time { width: 58px; text-align: right; color: var(--ink-4); }

.judge-verdict {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px;
  border-top: 1px solid var(--line);
}
.judge-verdict .big {
  font-family: var(--font-serif); font-size: 20px; font-weight: 600; letter-spacing: .04em;
}
.judge-verdict.ac .big { color: var(--green); }
.judge-verdict.wa .big { color: var(--ruby); }
.judge-verdict .meta { margin-left: auto; text-align: right; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-4); line-height: 1.7; }

/* ---------- 图表 ---------- */
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font-mono); font-size: 9px; fill: var(--ink-4); letter-spacing: .06em; }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; opacity: .8; }
.chart .area { fill: url(#areaGold); }
.chart .line { fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--surface); stroke: var(--gold); stroke-width: 1.6; }
.chart .radar-shape { fill: var(--gold-soft); stroke: var(--gold); stroke-width: 1.4; }
.chart .radar-shape-2 { fill: rgba(111, 179, 164, .08); stroke: var(--teal); stroke-width: 1.2; stroke-dasharray: 3 3; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); }
.pager .info { font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); }
.pager .pages { display: flex; gap: 4px; }
.pager .pg {
  min-width: 28px; height: 28px; padding: 0 8px;
  border-radius: 6px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-3);
  font-family: var(--font-mono); font-size: 11.5px; cursor: pointer;
}
.pager .pg:hover:not(:disabled) { border-color: var(--line-strong); color: var(--ink); }
.pager .pg.active { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold); }
.pager .pg:disabled { opacity: .35; cursor: default; }

/* ---------- 代码块 / 题面 ---------- */
.prose { font-size: 14px; line-height: 1.95; color: var(--ink-2); }
.prose p { margin: 0 0 12px; }
.prose code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--surface-3); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px; color: var(--gold-bright);
}
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin-bottom: 4px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose .math {
  font-family: var(--font-serif); font-style: italic;
  color: var(--ink); padding: 0 1px;
  white-space: nowrap;
}
.prose .math sub, .prose .math sup {
  font-size: .68em; line-height: 0; font-style: normal;
  font-family: var(--font-mono); color: var(--ink-2);
}
.prose sub, .prose sup { font-size: .72em; line-height: 0; }

.sample {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: var(--bg-deep);
}
.sample-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em;
  color: var(--ink-4); text-transform: uppercase;
}
.sample-head button {
  border: 0; background: transparent; color: var(--ink-4);
  font-size: 10.5px; cursor: pointer; font-family: var(--font-mono);
  display: inline-flex; align-items: center; gap: 4px;
}
.sample-head button:hover { color: var(--gold); }
.sample pre {
  margin: 0; padding: 11px 12px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7;
  color: var(--ink-2); overflow-x: auto;
}

/* 抽屉 */
.drawer-layer {
  position: fixed; inset: 0; z-index: 80;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  display: flex; justify-content: flex-end;
  animation: fade-in .18s var(--ease) both;
}
.drawer {
  width: min(620px, 100%);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--line-2);
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
  animation: drawer-in .28s var(--ease-out) both;
}
@keyframes drawer-in { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }

/* 工具 */
.divider-y { width: 1px; align-self: stretch; background: var(--line); }
.vr { height: 16px; width: 1px; background: var(--line); }
.kbd {
  font-family: var(--font-mono); font-size: 10px;
  border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 4px; color: var(--ink-4); background: var(--surface-2);
}
.copy-btn {
  border: 0; background: transparent; cursor: pointer; color: var(--ink-4);
  padding: 2px; border-radius: 4px;
}
.copy-btn:hover { color: var(--gold); }


.gesp-mini {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .04em;
  color: var(--gold-deep); background: var(--gold-soft);
  border: 1px solid var(--gold-line); border-radius: 99px;
  padding: 1px 7px; white-space: nowrap;
}
