/* ============================================================================
 * 鱼控 · 全站主题（yk-theme.css）
 * ----------------------------------------------------------------------------
 * 视觉规范全部取自参考站 PandaV7 的实际计算样式：
 *   卡片底 #161b22 / 边框 #2b313a / 分隔线 #21262d / 圆角 12px
 *   主文字 #e6edf3 / 次要 #8b949e / 强调蓝 #1f6feb / 成功 #238636 / 危险 #f85149
 *   标签胶囊 height 24px、padding 0 7px、radius 4px
 *   信息行 padding 4px 0、底部分隔线、13px
 * 只覆盖样式，不动任何 DOM 与业务逻辑。
 * ========================================================================== */

/* ---------- 1. shadcn 设计令牌 → GitHub Dark ---------- */
:root {
  --radius: .625rem;

  --background: #0d1117;
  --foreground: #e6edf3;
  --card: #161b22;
  --card-foreground: #e6edf3;
  --popover: #161b22;
  --popover-foreground: #e6edf3;

  --primary: #1f6feb;
  --primary-foreground: #ffffff;
  --secondary: #21262d;
  --secondary-foreground: #e6edf3;
  --muted: #161b22;
  --muted-foreground: #8b949e;
  --accent: #1f6feb;
  --accent-foreground: #ffffff;
  --destructive: #f85149;

  --border: #30363d;
  --input: #30363d;
  --ring: #1f6feb;

  --chart-1: #1f6feb;
  --chart-2: #3fb950;
  --chart-3: #d29922;
  --chart-4: #a371f7;
  --chart-5: #f85149;

  --sidebar: #0d1117;
  --sidebar-background: 215 21% 11%;
  --sidebar-foreground: 210 17% 90%;
  --sidebar-primary: 212 92% 52%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 215 15% 16%;
  --sidebar-accent-foreground: 210 17% 90%;
  --sidebar-border: 215 14% 20%;
  --sidebar-ring: 212 92% 52%;
}

/* ---------- 2. 全局底色与排版 ---------- */
html, body {
  background-color: #0d1117 !important;
  color: #e6edf3;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

/* 顶部细渐变条换成本站蓝 */
body::before {
  background: linear-gradient(90deg, #1f6feb 0%, #3fb950 55%, #58a6ff 100%) !important;
  height: 2px !important;
}

::selection { background: rgba(31, 111, 235, .4); color: #fff; }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: #0d1117; }
*::-webkit-scrollbar-thumb { background: #30363d; border-radius: 6px; border: 2px solid #0d1117; }
*::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* ---------- 3. 卡片 ---------- */
main [data-slot="card"] {
  background-color: #161b22 !important;
  border: 1px solid #30363d !important;
  border-radius: 12px !important;
  color: #e6edf3;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .2);
  transition: border-color .15s ease;
}
main [data-slot="card"]:hover { border-color: #484f58 !important; }

/* ---------- 4. 按钮 ---------- */
main button:not([class*="sidebar"]):not(.relative):not([role="switch"]) {
  border-radius: 6px;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
main button:hover:not(:disabled) { filter: brightness(1.12); }
main button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 5. 标签胶囊（参考站 bk-badge-pill）---------- */
main [data-slot="card"] span[class*="rounded-full"],
main [data-slot="card"] span[class*="rounded-md"],
main [data-slot="card"] span[class*="rounded"] {
  height: 22px;
  line-height: 20px;
  padding: 0 7px;
  font-size: 11.5px !important;
  border-radius: 4px !important;
}

/* ---------- 6. 表格 ---------- */
main table { border-collapse: collapse; font-size: 13px; }
main table thead th {
  text-align: left;
  padding: 10px 14px;
  color: #8b949e;
  font-weight: 500;
  font-size: 12px;
  background: #0d1117;
  border-bottom: 1px solid #21262d;
  white-space: nowrap;
}
main table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #21262d;
  color: #e6edf3;
  vertical-align: middle;
}
main table tbody tr:hover td { background: #1c2128; }

/* ---------- 7. 输入框 / 下拉 ---------- */
main input:not([type="checkbox"]):not([type="radio"]),
main textarea,
main select {
  background-color: #0d1117 !important;
  border: 1px solid #30363d !important;
  border-radius: 6px !important;
  color: #e6edf3 !important;
  font-size: 13px;
}
main input:focus, main textarea:focus, main select:focus {
  border-color: #1f6feb !important;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .15) !important;
  outline: none !important;
}
main input::placeholder, main textarea::placeholder { color: #484f58 !important; }

/* ---------- 8. 侧边栏 ---------- */
[data-slot="sidebar"] {
  background-color: #010409 !important;
  border-right: 1px solid #21262d !important;
}
[data-slot="sidebar-menu-button"] {
  border-radius: 7px !important;
  font-size: 13.5px;
  color: #8b949e;
  transition: background-color .13s ease, color .13s ease;
}
[data-slot="sidebar-menu-button"]:hover {
  background-color: #161b22 !important;
  color: #e6edf3 !important;
}
[data-slot="sidebar-menu-button"][data-active="true"] {
  background-color: #1f6feb !important;
  color: #ffffff !important;
  font-weight: 500;
}
[data-slot="sidebar-menu-button"][data-active="true"] svg { color: #ffffff !important; }

/* ---------- 9. 对话框 / 弹出层 ---------- */
[role="dialog"], [data-slot="dialog-content"] {
  background-color: #161b22 !important;
  border: 1px solid #30363d !important;
  border-radius: 12px !important;
  color: #e6edf3;
}
[role="menu"], [data-slot="dropdown-menu-content"], [data-radix-popper-content-wrapper] > div {
  background-color: #161b22 !important;
  border: 1px solid #30363d !important;
  border-radius: 8px !important;
}

/* ---------- 10. 顶部条 ---------- */
header, [data-slot="header"] {
  background-color: #161b22 !important;
  border-bottom: 1px solid #21262d !important;
}

/* ---------- 11. 代码 / 等宽内容（构建日志等）---------- */
pre, code, .font-mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}
pre {
  background: #0d1117 !important;
  border: 1px solid #21262d !important;
  border-radius: 8px;
  color: #e6edf3;
}

/* ---------- 12. 去掉旧品牌蓝青渐变，统一到参考站配色 ---------- */
.bg-gradient-to-r.from-red-500,
.bg-gradient-to-r.from-red-500.to-orange-500,
[class*="from-red-500"][class*="bg-clip-text"],
[class*="from-blue-500"][class*="bg-clip-text"] {
  background-image: linear-gradient(92deg, #58a6ff 0%, #1f6feb 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
}
