/* ============================================================
   IT Tools · 全局样式
   ============================================================ */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", "Fira Code", ui-monospace,
    SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --sidebar-w: 268px;
  --topbar-h: 62px;

  --transition: 160ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

html[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-soft: #eef1f8;
  --bg-sunken: #e9edf5;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --sidebar-bg: #fbfcfe;
  --border: #e2e6ef;
  --border-strong: #cdd4e2;
  --hover: rgba(70, 90, 140, 0.07);
  --text: #171a22;
  --text-soft: #3f4658;
  --muted: #5c6475;
  --accent: #4c6ef5;
  --accent-strong: #3b5bdb;
  --accent-ring: rgba(76, 110, 245, 0.18);
  --accent-soft: rgba(76, 110, 245, 0.11);
  --danger: #d64545;
  --danger-text: #a02c2c;
  --danger-soft: rgba(214, 69, 69, 0.09);
  --danger-border: rgba(214, 69, 69, 0.28);
  --warn-text: #8a5a00;
  --warn-soft: rgba(226, 168, 45, 0.12);
  --warn-border: rgba(226, 168, 45, 0.35);
  --ok-text: #1f7a4d;
  --ok-soft: rgba(38, 160, 100, 0.1);
  --ok-border: rgba(38, 160, 100, 0.3);
  --shadow-sm: 0 1px 2px rgba(23, 30, 48, 0.06);
  --shadow-md: 0 10px 30px -18px rgba(23, 30, 48, 0.4);
  --selection: rgba(76, 110, 245, 0.2);

  --tok-key: #9c36b5;
  --tok-str: #1d7a45;
  --tok-num: #b35c00;
  --tok-kw: #2b5fd9;
  --tok-com: #626b80;
  --tok-fn: #0b7285;
  --tok-bool: #c2255c;
  --tok-url: #0b7285;
  --tok-flag: #9c36b5;
  --tok-var: #b35c00;
  --tok-head: #2b5fd9;
  --tok-punct: #58637a;
}

html[data-theme="dark"] {
  --bg: #0d1017;
  --bg-soft: #11151e;
  --bg-sunken: #0a0d13;
  --surface: #151a24;
  --surface-2: #191f2b;
  --sidebar-bg: #11151d;
  --border: #242b3a;
  --border-strong: #333c50;
  --hover: rgba(140, 165, 220, 0.08);
  --text: #e7eaf2;
  --text-soft: #c0c7d7;
  --muted: #8a93a8;
  --accent: #6d8bff;
  --accent-strong: #97aaff;
  --accent-ring: rgba(109, 139, 255, 0.25);
  --accent-soft: rgba(109, 139, 255, 0.13);
  --danger: #ff7b7b;
  --danger-text: #ffb3b3;
  --danger-soft: rgba(255, 123, 123, 0.09);
  --danger-border: rgba(255, 123, 123, 0.26);
  --warn-text: #f0c674;
  --warn-soft: rgba(240, 198, 116, 0.08);
  --warn-border: rgba(240, 198, 116, 0.24);
  --ok-text: #7ee2a8;
  --ok-soft: rgba(126, 226, 168, 0.08);
  --ok-border: rgba(126, 226, 168, 0.24);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 20px 50px -28px rgba(0, 0, 0, 0.9);
  --selection: rgba(109, 139, 255, 0.28);

  --tok-key: #d3a1ff;
  --tok-str: #9adc8a;
  --tok-num: #f3c26b;
  --tok-kw: #8fb4ff;
  --tok-com: #858fa5;
  --tok-fn: #7fd8d0;
  --tok-bool: #ff9db4;
  --tok-url: #7fd8d0;
  --tok-flag: #d3a1ff;
  --tok-var: #f3c26b;
  --tok-head: #8fb4ff;
  --tok-punct: #9aa4b8;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--selection);
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  display: block;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1;
}

/* ============================================================
   布局
   ============================================================ */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 14px 14px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 2px;
  text-decoration: none;
  border-radius: var(--radius-md);
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(140deg, #5b7cfa, #8b5cf6);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.04em;
  box-shadow: 0 8px 20px -10px rgba(91, 124, 250, 0.9);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box .search-icon {
  position: absolute;
  left: 11px;
  display: grid;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
}

.search-box .search-icon .icon {
  width: 16px;
  height: 16px;
}

.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 58px 0 35px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box input::-webkit-search-cancel-button {
  filter: grayscale(1);
  opacity: 0.6;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  background: var(--surface);
}

.search-kbd {
  position: absolute;
  right: 8px;
  pointer-events: none;
  font-size: 9.5px;
  min-width: 0;
  padding: 0 4px;
  opacity: 0.85;
  background: var(--surface);
}

.nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 10px;
}

.nav-group-label {
  padding: 2px 10px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 13.5px;
  transition: background var(--transition), color var(--transition);
}

.nav-item .icon {
  color: var(--muted);
  transition: color var(--transition);
}

.nav-item:hover {
  background: var(--hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
}

.nav-item.active .icon {
  color: var(--accent);
}

.nav-empty {
  padding: 18px 10px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 10px 4px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2fbf71;
  box-shadow: 0 0 0 3px rgba(47, 191, 113, 0.16);
  flex: none;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 20;
}

.menu-btn {
  display: none !important;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb a {
  text-decoration: none;
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb .sep {
  opacity: 0.5;
}

.breadcrumb .current {
  color: var(--text);
  font-weight: 600;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.shortcut-hint {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
}

.shortcut-hint kbd {
  height: 17px;
  min-width: 17px;
  padding: 0 4px;
  font-size: 9.5px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition);
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.icon-btn:focus-visible,
.btn:focus-visible,
.nav-item:focus-visible,
.tool-card:focus-visible,
.tab:focus-visible,
.segmented button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.content {
  flex: 1;
  width: 100%;
  max-width: 1420px;
  margin: 0 auto;
  padding: 26px 30px 64px;
  outline: none;
}

/* ============================================================
   通用控件
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition),
    color var(--transition), transform var(--transition);
}

.btn:hover {
  background: var(--hover);
  border-color: var(--border-strong);
}

.btn:active {
  transform: translateY(1px);
}

.btn .icon {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--hover);
  border-color: transparent;
  color: var(--text);
}

.btn-sm {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
  border-radius: 7px;
  gap: 5px;
}

.btn-sm .icon {
  width: 13px;
  height: 13px;
}

.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 7px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn-icon:hover {
  background: var(--hover);
  color: var(--text);
}

.btn-icon .icon {
  width: 15px;
  height: 15px;
}

/* 分段控制器 */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
}

.segmented button {
  height: 27px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* 开关 */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  color: var(--text-soft);
  white-space: nowrap;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  position: relative;
  width: 34px;
  height: 20px;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-sunken);
  transition: background var(--transition), border-color var(--transition);
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform var(--transition), background var(--transition);
}

.switch input:checked + .switch-track {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked + .switch-track::after {
  transform: translateX(14px);
  background: #fff;
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 下拉与输入 */
.field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.field select {
  height: 32px;
  padding: 0 28px 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ============================================================
   工具页
   ============================================================ */

.tool {
  animation: rise 320ms ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tool-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tool-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 6px;
}

.tool-title {
  margin: 0;
  font-size: 25px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.tool-desc {
  margin: 6px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 13.5px;
}

.tool-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 11px 14px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.toolbar .spacer {
  flex: 1;
}

.toolbar .divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.toolbar-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.toolbar-note .icon {
  width: 14px;
  height: 14px;
}

/* 双栏 */
.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: clamp(470px, 64vh, 800px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: none;
  min-height: 44px;
  padding: 7px 10px 7px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.pane-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-soft);
}

.pane-title .lang-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.pane-title .lang-dot.sql {
  background: #e8a33d;
}

.pane-title .lang-dot.curl {
  background: #2fbf71;
}

.pane-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}

.pane-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pane-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 6px 14px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--muted);
}

.pane-foot .foot-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-ok,
.status-bad,
.status-idle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
}

.status-ok {
  color: var(--ok-text);
}

.status-bad {
  color: var(--danger-text);
}

.status-warn {
  color: var(--warn-text);
}

.status-ok .icon,
.status-bad .icon,
.status-warn .icon {
  width: 13px;
  height: 13px;
}

/* ============================================================
   代码编辑器
   ============================================================ */

.editor {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--surface);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.editor:focus-within {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.editor-highlight,
.editor-input {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 14px 16px 22px;
  border: 0;
  font-family: var(--font-mono);
  font-size: 12.75px;
  line-height: 1.72;
  letter-spacing: 0;
  tab-size: 2;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

.editor-highlight {
  pointer-events: none;
  user-select: none;
  color: var(--text);
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.editor-input {
  resize: none;
  outline: none;
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: var(--text);
  scrollbar-width: thin;
}

.editor-input::placeholder {
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  opacity: 0.75;
}

.editor-input::selection {
  background: var(--selection);
}

.editor-input::-webkit-scrollbar,
.editor-highlight::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.editor-input::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
  border: 4px solid transparent;
  background-clip: padding-box;
}

.editor-highlight::-webkit-scrollbar-thumb {
  background: transparent;
}

.editor-input::-webkit-scrollbar-track,
.editor-highlight::-webkit-scrollbar-track {
  background: transparent;
}

/* 语法高亮 */
.tok-key { color: var(--tok-key); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-kw { color: var(--tok-kw); font-weight: 500; }
.tok-com { color: var(--tok-com); font-style: italic; }
.tok-fn { color: var(--tok-fn); }
.tok-bool { color: var(--tok-bool); }
.tok-url { color: var(--tok-url); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--tok-url) 40%, transparent); }
.tok-flag { color: var(--tok-flag); }
.tok-var { color: var(--tok-var); }
.tok-head { color: var(--tok-head); }
.tok-punct { color: var(--tok-punct); }
.tok-cmd { color: var(--tok-kw); font-weight: 600; }

/* ============================================================
   提示 / 错误
   ============================================================ */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 13px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.6;
}

.notice .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  flex: none;
}

.notice-body {
  min-width: 0;
  flex: 1;
}

.notice-title {
  font-weight: 600;
}

.notice-detail {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  white-space: pre-wrap;
  word-break: break-word;
}

.notice.error {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.notice.warn {
  background: var(--warn-soft);
  border-color: var(--warn-border);
  color: var(--warn-text);
}

.notice.ok {
  background: var(--ok-soft);
  border-color: var(--ok-border);
  color: var(--ok-text);
}

.notice.info {
  background: var(--accent-soft);
  border-color: var(--accent-ring);
  color: var(--accent-strong);
}

/* ============================================================
   JSON / SQL 辅助排版
   ============================================================ */

.error-loc {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px;
  border-radius: 99px;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 10.5px;
  opacity: 0.9;
}

/* ============================================================
   cURL 工具
   ============================================================ */

.curl-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.curl-grid > .pane {
  height: clamp(620px, 78vh, 900px);
}

.curl-right .editor {
  min-height: 200px;
}

.summary {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.method-badge {
  flex: none;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.method-badge.get { background: var(--ok-soft); color: var(--ok-text); }
.method-badge.post { background: var(--accent-soft); color: var(--accent-strong); }
.method-badge.put { background: var(--warn-soft); color: var(--warn-text); }
.method-badge.patch { background: var(--warn-soft); color: var(--warn-text); }
.method-badge.delete { background: var(--danger-soft); color: var(--danger-text); }
.method-badge.head,
.method-badge.options { background: var(--hover); color: var(--muted); }

.summary-url {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-soft);
}

.chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.chip strong {
  color: var(--text-soft);
  font-weight: 600;
}

.summary-details {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  overflow: hidden;
}

.summary-details summary {
  padding: 7px 10px;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.summary-details summary::-webkit-details-marker {
  display: none;
}

.summary-details summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform var(--transition);
  color: var(--muted);
}

.summary-details[open] summary::before {
  transform: rotate(90deg);
}

.details-body {
  max-height: 190px;
  overflow: auto;
  border-top: 1px solid var(--border);
  padding: 8px 10px;
  font-size: 11.5px;
}

.kv-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.4fr) minmax(0, 1fr);
  gap: 10px;
  padding: 3px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  border-bottom: 1px dashed color-mix(in srgb, var(--border) 60%, transparent);
}

.kv-row:last-child {
  border-bottom: 0;
}

.kv-row .k {
  color: var(--tok-key);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kv-row .v {
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.body-preview {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--bg-sunken);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 120px;
  overflow: auto;
}

.details-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin: 6px 0 2px;
}

.details-empty {
  color: var(--muted);
  font-size: 11.5px;
  padding: 2px 0;
}

.tabs-wrap {
  flex: none;
  padding: 7px 10px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  flex: none;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px 7px 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.tab:hover {
  color: var(--text);
  background: var(--hover);
}

.tab.active {
  color: var(--text);
  font-weight: 600;
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* ============================================================
   首页
   ============================================================ */

.home {
  animation: rise 320ms ease both;
}

.hero {
  position: relative;
  padding: 34px 0 8px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -80px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 66%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  font-size: 11px;
  color: var(--muted);
}

.hero-eyebrow .icon {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.16;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.hero h1 .accent {
  background: linear-gradient(120deg, #6d8bff, #a78bfa 55%, #4dd4ac);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin: 16px 0 0;
  max-width: 620px;
  font-size: 14.5px;
  color: var(--muted);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 11.5px;
}

.meta-pill .icon {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 36px 0 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.section-head span {
  font-size: 12px;
  color: var(--muted);
}

.tool-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 14px;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 176px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform var(--transition), border-color var(--transition),
    box-shadow var(--transition);
  overflow: hidden;
}

.tool-card::after {
  content: "→";
  position: absolute;
  right: 17px;
  top: 17px;
  font-size: 15px;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--transition), transform var(--transition);
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: var(--shadow-md);
}

.tool-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.card-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 2px;
}

.card-icon .icon {
  width: 20px;
  height: 20px;
}

.tool-card h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.tool-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.card-tags {
  margin-top: auto;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding-top: 6px;
}

.tag {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--muted);
}

.home-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 34px;
}

.note-card {
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
}

.note-card h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
}

.note-card h4 .icon {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.note-card p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
}

.note-card code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
}

/* ============================================================
   Toast
   ============================================================ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 15px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.5);
  font-size: 12.5px;
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast .icon {
  width: 15px;
  height: 15px;
  color: var(--ok-text);
}

.toast.error .icon {
  color: var(--danger);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(5, 8, 14, 0.5);
  backdrop-filter: blur(2px);
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1120px) {
  .content {
    padding: 22px 22px 56px;
  }

  .topbar {
    padding: 0 20px;
  }
}

@media (max-width: 980px) {
  .tool-grid,
  .curl-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pane {
    height: clamp(420px, 56vh, 620px);
  }

  .curl-grid > .pane {
    height: clamp(540px, 68vh, 760px);
  }
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(300px, 84vw);
    transform: translateX(-104%);
    transition: transform 220ms cubic-bezier(0.2, 0.7, 0.3, 1);
    box-shadow: 24px 0 60px -30px rgba(0, 0, 0, 0.8);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-btn {
    display: grid !important;
  }

  .shortcut-hint {
    display: none;
  }

  .topbar {
    padding: 0 14px;
    gap: 6px;
  }

  .content {
    padding: 18px 16px 48px;
  }

  .tool-head {
    margin-bottom: 14px;
  }

  .tool-title {
    font-size: 22px;
  }

  .toolbar {
    gap: 12px;
    padding: 10px 12px;
  }
}

@media (max-width: 520px) {
  .tool-actions {
    width: 100%;
  }

  .tool-actions .btn {
    flex: 1;
  }

  .hero h1 {
    font-size: 30px;
  }

  .toolbar .divider {
    display: none;
  }

  .pane-foot {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}