/* ==========================================================================
   123 挂载盘 · 公共样式
   风格参考 NGINdeX.io：极简、大字重标题、细边框、克制的圆角
   ========================================================================== */

:root {
  /* 亮色 */
  --bg: #fbfbfc;
  --bg-elev: #ffffff;
  --bg-subtle: #f5f5f7;
  --bg-hover: #f0f0f2;
  --border: #e6e6e9;
  --border-strong: #d4d4d8;
  --text: #16161a;
  --text-dim: #6b6b76;
  --text-faint: #9a9aa5;
  --accent: #2a82e4;
  --accent-hover: #1c6fd0;
  --accent-soft: #eaf3fd;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --warn: #d97706;
  --warn-soft: #fffbeb;

  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow: 0 4px 12px rgba(0, 0, 0, .06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .10);

  --header-h: 56px;
}

[data-theme="dark"] {
  --bg: #0e0e11;
  --bg-elev: #17171b;
  --bg-subtle: #1c1c21;
  --bg-hover: #232329;
  --border: #2a2a32;
  --border-strong: #3a3a45;
  --text: #f2f2f5;
  --text-dim: #9a9aa8;
  --text-faint: #6e6e7c;
  --accent: #4a9eff;
  --accent-hover: #6cb0ff;
  --accent-soft: #16283d;
  --danger: #f87171;
  --danger-soft: #2a1416;
  --success: #4ade80;
  --success-soft: #14261a;
  --warn: #fbbf24;
  --warn-soft: #2a2214;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 4px 12px rgba(0, 0, 0, .4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
}

/* ── reset ── */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .18s ease, color .18s ease;
}

a { color: inherit; text-decoration: none; }

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

::selection { background: var(--accent); color: #fff; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 6px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ── 布局 ── */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.wrap-narrow { max-width: 820px; }

/* ── 顶栏 ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -.01em;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), #6cb0ff);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}

.brand-img { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; }

.topbar-spacer { flex: 1; }

.topbar-actions { display: flex; align-items: center; gap: 6px; }

/* ── 按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s, transform .06s;
  user-select: none;
}

.btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

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

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

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

.btn-icon { width: 34px; padding: 0; }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14px; }

/* ── 输入 ── */
.field { margin-bottom: 16px; }

.label {
  display: block;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 5px;
  line-height: 1.5;
}

.input, .select, .textarea {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.textarea { height: auto; min-height: 78px; padding: 9px 11px; resize: vertical; line-height: 1.6; }

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input::placeholder, .textarea::placeholder { color: var(--text-faint); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' stroke='%239a9aa5' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
  cursor: pointer;
}

/* 复选框 */
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
}
.check input {
  width: 15px; height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}

/* ── 卡片 ── */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title { font-size: 14px; font-weight: 620; letter-spacing: -.01em; }
.card-sub { font-size: 12px; color: var(--text-faint); }
.card-body { padding: 18px; }

/* ── 徽标 ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-dim);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-ok { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-err { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ── 模态框 ── */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, .42);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fade .14s ease;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: pop .16s cubic-bezier(.2, .8, .3, 1);
}

.modal-lg { max-width: 620px; }

.modal-head {
  padding: 17px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  background: var(--bg-elev);
  z-index: 1;
}

.modal-title { font-size: 15px; font-weight: 640; flex: 1; letter-spacing: -.01em; }
.modal-body { padding: 20px; }
.modal-foot {
  padding: 15px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: var(--bg-elev);
}

/* ── Toast ── */
.toasts {
  position: fixed;
  top: 68px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  animation: slidein .2s cubic-bezier(.2, .8, .3, 1);
  pointer-events: auto;
}

@keyframes slidein { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

.toast-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-top: 6px;
  flex: none;
  background: var(--text-faint);
}
.toast-ok .toast-dot { background: var(--success); }
.toast-err .toast-dot { background: var(--danger); }
.toast-warn .toast-dot { background: var(--warn); }

/* ── 空状态 ── */
.empty {
  padding: 64px 24px;
  text-align: center;
  color: var(--text-faint);
}
.empty-icon { font-size: 34px; opacity: .35; margin-bottom: 12px; line-height: 1; }
.empty-text { font-size: 13.5px; }

/* ── 加载 ── */
.spinner {
  width: 15px; height: 15px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 56px 24px;
  color: var(--text-faint);
  font-size: 13px;
}

/* ── 页脚 ── */
.footer {
  margin-top: 64px;
  padding: 26px 0 34px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 12.5px;
  text-align: center;
}

/* ── 工具类 ── */
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-sm { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

/* 分隔线 */
.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* 代码块 */
.code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
}
