/* ============================================================
   v8 - 真实 ddc.bbbca.cn 色调
   从 ddc 源 CSS 提取的设计令牌
   ============================================================ */

:root {
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, "Menlo", "Monaco", "Consolas", monospace;

  /* === 从 ddc 提取的实际变量 === */
  --paper: #f3f5f7;
  --white: #ffffff;
  --text: #10141c;
  --muted: #697486;
  --muted-dark: #91a0b5;
  --blue: #1769ff;
  --brand-from: #4f46e5;
  --brand-via: #8b5cf6;
  --brand-to: #ec4899;
  --brand-gradient: linear-gradient(135deg, var(--brand-from), var(--brand-via));
  --brand-gradient-soft: linear-gradient(135deg, #eef2ff, #f3e8ff);
  --blue-dark: #0d4ed1;
  --line-dark: rgba(16, 20, 28, 0.11);

  /* 设计令牌映射 */
  --background: #f3f5f7;
  --foreground: #10141c;
  --card: #ffffff;
  --card-foreground: #10141c;
  --popover: #ffffff;
  --popover-foreground: #10141c;

  --primary: #1769ff;
  --primary-foreground: #ffffff;

  --destructive: #ff4d5f;
  --destructive-foreground: #ffffff;

  --secondary: #edf2f8;
  --secondary-foreground: #10141c;
  --muted-fg: #697486;
  --accent: #e6f0ff;
  --accent-foreground: #1769ff;

  --border: rgba(16, 20, 28, 0.11);
  --card-border: rgba(16, 20, 28, 0.11);
  --input: rgba(16, 20, 28, 0.15);
  --ring: #1769ff;

  --success: #1769ff;
  --warning: #ffb457;
  --info: #1769ff;

  --sidebar: #f3f5f7;
  --sidebar-foreground: #10141c;
  --sidebar-primary: #1769ff;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #edf3fb;
  --sidebar-accent-foreground: #1769ff;
  --sidebar-border: rgba(16, 20, 28, 0.08);
  --sidebar-ring: #1769ff;

  --radius: 8px;
  --radius-sm: 6px;
  --radius-card: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-2xs: 0 1px 1px rgba(16, 20, 28, 0.04);
  --shadow-xs: 0 1px 2px rgba(16, 20, 28, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 20, 28, 0.06);
  --shadow: 0 2px 4px rgba(16, 20, 28, 0.06);
  --shadow-md: 0 4px 8px rgba(16, 20, 28, 0.08);
  --shadow-lg: 0 8px 24px rgba(16, 20, 28, 0.1);
}

/* === 全局 === */
html, body {
  font-family: var(--font-sans);
  background:
    radial-gradient(at 20% 0%, rgba(79, 70, 229, 0.06) 0px, transparent 50%),
    radial-gradient(at 80% 0%, rgba(236, 72, 153, 0.04) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(139, 92, 246, 0.05) 0px, transparent 50%),
    var(--paper);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01";
  letter-spacing: -0.005em;
}

* {
  border-color: var(--border);
}

/* === 字体：ddc 用 Space Grotesk 显示字体 === */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}

h1 {
  font-size: clamp(2rem, 4vw, 2.75rem) !important;
  line-height: 1.1 !important;
  letter-spacing: -0.035em !important;
}

h2 {
  font-size: 1.625rem !important;
  line-height: 1.2 !important;
  letter-spacing: -0.03em !important;
}

h3 {
  font-size: 1.125rem !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
}

/* === 侧边栏 · 灰底统一 === */
.bg-sidebar, [class*="bg-sidebar"] {
  background: #f3f5f7 !important;
  color: #10141c !important;
  border-right: 1px solid rgba(16, 20, 28, 0.08) !important;
}

[data-slot="sidebar-inner"] {
  background: #f3f5f7 !important;
}

/* 防止横向滚动 */
[data-slot="sidebar-inner"],
[data-sidebar="content"],
[data-sidebar="header"],
[data-sidebar="footer"] {
  overflow-x: hidden !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

[data-sidebar="header"] {
  padding: 10px 10px !important;
  background: #f3f5f7 !important;
  overflow-x: hidden !important;
  max-width: 100% !important;
}

/* 品牌卡片 - 满宽融入侧边栏 */
[data-sidebar="header"] [data-sidebar="menu"] > li > a {
  background: #f3f5f7 !important;
  border-radius: 8px !important;
  padding: 18px 14px !important;
  height: auto !important;
  border: none !important;
  box-shadow: none !important;
  transition: background 0.2s ease !important;
}
[data-sidebar="header"] [data-sidebar="menu"] > li > a:hover {
  background: #eef0f3 !important;
}

/* 品牌卡片内图标 */
[data-sidebar="header"] [data-sidebar="menu"] > li > a > div:first-child {
  width: 36px !important;
  height: 44px !important;
  min-width: 36px !important;
  background: #ffffff !important;
  box-shadow: none !important;
}
[data-sidebar="header"] [data-sidebar="menu"] > li > a > div:first-child svg {
  width: 20px !important;
  height: 20px !important;
}

[data-sidebar="footer"] {
  background: #f3f5f7 !important;
  border-top: 1px solid rgba(16, 20, 28, 0.06) !important;
}

[data-sidebar="header"] [data-sidebar="menu"] > li > a > div:last-child span {
  font-family: var(--font-display) !important;
  color: #10141c !important;
  letter-spacing: -0.025em !important;
}
[data-sidebar="header"] [data-sidebar="menu"] > li > a > div:last-child span:first-child {
  font-weight: 700 !important;
  font-size: 17px !important;
}
[data-sidebar="header"] [data-sidebar="menu"] > li > a > div:last-child span:last-child {
  font-weight: 400 !important;
  color: #8896ab !important;
  font-size: 11px !important;
  letter-spacing: 0 !important;
}

[data-sidebar="header"] svg, [data-sidebar="header"] [class*="lucide"] {
  color: #10141c !important;
}

/* 菜单项 · 微浮卡片式 */
[data-sidebar="menu-button"] {
  font-family: var(--font-sans) !important;
  font-weight: 500 !important;
  color: #697486 !important;
  background-color: hsl(210, 20%, 96%) !important;
  border-radius: 8px !important;
  margin: 4px 0 !important;
  padding: 9px 12px !important;
  position: relative !important;
  transform-origin: center left !important;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1),
              background 0.25s cubic-bezier(0.2, 0, 0, 1),
              box-shadow 0.25s cubic-bezier(0.2, 0, 0, 1),
              color 0.2s ease !important;
}

/* 左侧蓝色指示线 - 默认隐藏 */
[data-sidebar="menu-button"]::before {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) scaleY(0) !important;
  width: 2px !important;
  height: 60% !important;
  background: #1769ff !important;
  border-radius: 1px !important;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1) !important;
}

/* hover: 卡片浮起 */
[data-sidebar="menu-button"]:not([data-active="true"]):hover {
  background: #ffffff !important;
  color: #10141c !important;
  box-shadow: 0 2px 8px rgba(16, 20, 28, 0.06), 0 1px 3px rgba(16, 20, 28, 0.04) !important;
  transform: scale(1.02) !important;
}
[data-sidebar="menu-button"]:not([data-active="true"]):hover::before {
  transform: translateY(-50%) scaleY(1) !important;
}

/* 激活态 */
[data-sidebar="menu-button"][data-active="true"] {
  background: #1769ff !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 3px 10px rgba(23, 105, 255, 0.45), 0 1px 3px rgba(23, 105, 255, 0.3) !important;
  transform: scale(1.02) !important;
}

/* 激活态 hover / focus：再深一点（确保不会变成白底） */
[data-sidebar="menu-button"][data-active="true"]:hover,
[data-sidebar="menu-button"][data-active="true"]:focus,
[data-sidebar="menu-button"][data-active="true"]:focus-visible,
[data-sidebar="menu-button"][data-active="true"]:focus-within {
  background: #0d4ed1 !important;
  color: #ffffff !important;
  box-shadow: 0 3px 8px rgba(23, 105, 255, 0.4) !important;
}
[data-sidebar="menu-button"][data-active="true"]:hover svg,
[data-sidebar="menu-button"][data-active="true"]:focus svg,
[data-sidebar="menu-button"][data-active="true"]:focus-visible svg {
  color: #ffffff !important;
}

/* === 卡片 === */
.bg-card, [class*="bg-card"] {
  background: #f3f5f7 !important;
}

[class*="rounded-xl"][class*="border"][class*="bg-card"],
[class*="rounded-lg"][class*="border"][class*="bg-card"] {
  border: 1px solid rgba(16, 20, 28, 0.08) !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow:
    0 1px 2px rgba(16, 20, 28, 0.04),
    0 4px 16px rgba(16, 20, 28, 0.04) !important;
  transition: box-shadow 250ms cubic-bezier(0.2, 0, 0, 1), transform 250ms cubic-bezier(0.2, 0, 0, 1) !important;
}

[class*="rounded-xl"][class*="border"][class*="bg-card"]:hover,
[class*="rounded-lg"][class*="border"][class*="bg-card"]:hover {
  box-shadow:
    0 2px 4px rgba(16, 20, 28, 0.04),
    0 12px 32px rgba(16, 20, 28, 0.08) !important;
  transform: translateY(-1px) !important;
}

/* === 圆角 === */
/* === 圆角分级：卡片 14 / 按钮 8 / 输入 6 / 标签 pill === */
.rounded-xl, .rounded-lg {
  border-radius: 14px !important;
}
.rounded-md { border-radius: 8px !important; }
.rounded-sm { border-radius: 6px !important; }
.rounded-xs { border-radius: 4px !important; }
.rounded-full { border-radius: 999px !important; }

/* === 边框 === */
[class*="border-card-border"], [class*="border-border"] {
  border-color: rgba(16, 20, 28, 0.08) !important;
}

/* === 按钮 === */
button, [role="button"] {
  letter-spacing: -0.005em !important;
  transition: all 180ms ease !important;
  font-weight: 500 !important;
}

/* 通用按钮 hover：轻微下沉 */
button:not([disabled]):hover,
[role="button"]:not([disabled]):hover {
  transform: translateY(1px) !important;
}

/* 通用按钮 active（按下）：再下沉 + 内阴影 */
button:not([disabled]):active,
[role="button"]:not([disabled]):active {
  transform: translateY(3px) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12) !important;
  transition-duration: 60ms !important;
}

/* 主按钮 · 蓝紫渐变 + 品牌光晕 */
button[class*="bg-primary"], [role="button"][class*="bg-primary"]:not([class*="bg-primary/"]) {
  background: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 100%) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border: 1px solid transparent !important;
  box-shadow:
    0 1px 2px rgba(79, 70, 229, 0.2),
    0 4px 14px rgba(79, 70, 229, 0.3) !important;
}

button[class*="bg-primary"]:hover, [role="button"][class*="bg-primary"]:not([class*="bg-primary/"]):hover {
  background: linear-gradient(135deg, #4338ca 0%, #7c3aed 100%) !important;
  border-color: transparent !important;
  box-shadow:
    0 2px 4px rgba(79, 70, 229, 0.25),
    0 8px 24px rgba(79, 70, 229, 0.4) !important;
  transform: translateY(1px) !important;
}

button[class*="bg-primary"]:active, [role="button"][class*="bg-primary"]:not([class*="bg-primary/"]):active {
  transform: translateY(3px) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  transition-duration: 60ms !important;
}

/* 次按钮 · 浅描边 */
button[class*="variant-outline"], [class*="variant-outline"] {
  background: #ffffff !important;
  border: 1px solid rgba(16, 20, 28, 0.15) !important;
  color: #10141c !important;
  font-weight: 500 !important;
}

button[class*="variant-outline"]:hover, [class*="variant-outline"]:hover {
  background: #f3f5f7 !important;
  border-color: rgba(16, 20, 28, 0.2) !important;
  transform: translateY(1px) !important;
}

button[class*="variant-outline"]:active, [class*="variant-outline"]:active {
  transform: translateY(3px) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  transition-duration: 60ms !important;
}

/* Ghost */
button[class*="variant-ghost"], [class*="variant-ghost"] {
  background: #ffffff !important;
  color: #10141c !important;
}
button[class*="variant-ghost"]:hover, [class*="variant-ghost"]:hover {
  background: rgba(23, 105, 255, 0.06) !important;
  color: #10141c !important;
  transform: translateY(1px) !important;
}

button[class*="variant-ghost"]:active, [class*="variant-ghost"]:active {
  transform: translateY(3px) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08) !important;
  transition-duration: 60ms !important;
}

/* 危险按钮 */
button[class*="bg-destructive"], [role="button"][class*="bg-destructive"]:not([class*="bg-destructive/"]) {
  background: #ff4d5f !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(255, 77, 95, 0.2), 0 4px 14px rgba(255, 77, 95, 0.3) !important;
  transition: all 180ms ease !important;
}

button[class*="bg-destructive"]:hover, [role="button"][class*="bg-destructive"]:not([class*="bg-destructive/"]):hover {
  background: #e63e4f !important;
  box-shadow: 0 2px 4px rgba(255, 77, 95, 0.25), 0 8px 24px rgba(255, 77, 95, 0.4) !important;
  transform: translateY(1px) !important;
}

button[class*="bg-destructive"]:active, [role="button"][class*="bg-destructive"]:not([class*="bg-destructive/"]):active {
  transform: translateY(3px) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  transition-duration: 60ms !important;
}

/* === 输入框 === */
input, textarea, select,
input[class*="bg-primary"], textarea[class*="bg-primary"], select[class*="bg-primary"] {
  font-family: var(--font-sans) !important;
  border: 1px solid rgba(16, 20, 28, 0.15) !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  color: #10141c !important;
  transition: all 160ms ease !important;
}

input:focus, textarea:focus, select:focus {
  outline: none !important;
  border-color: #10141c !important;
  box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.12) !important;
}

::placeholder {
  color: #91a0b5 !important;
  font-weight: 400 !important;
}

/* === 表格 === */
table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-feature-settings: "tnum";
}

thead th {
  background: #f3f5f7 !important;
  color: #697486 !important;
  font-family: var(--font-sans) !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid rgba(16, 20, 28, 0.08) !important;
}

tbody tr {
  transition: background 120ms ease !important;
}

tbody tr:hover {
  background: #f3f5f7 !important;
}

tbody td {
  border-bottom: 1px solid rgba(16, 20, 28, 0.06) !important;
  padding: 14px 16px !important;
  font-size: 0.875rem !important;
  color: #10141c !important;
}

/* === 隐藏 antd Table 测距行（measure-row）===
.ant-table-measure-row,
.ant-table-measure-row td,
.ant-table-measure-row td > div {
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
  visibility: hidden !important;
  border: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  pointer-events: none !important;
}

/* === Badge === */
[class*="rounded"][class*="border"]:not([class*="border-card-border"]):not([class*="border-border"]) {
  font-family: var(--font-mono) !important;
  font-size: 0.6875rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  border-radius: 4px !important;
}

/* === 主内容区 === */
main, [class*="flex-1"][class*="overflow-auto"] {
  background: var(--paper);
}

/* === 进度条 === */
[role="progressbar"] > div,
.progress > div {
  background: #1769ff !important;
  border-radius: 3px !important;
}

/* === 链接 === */
a {
  color: #10141c !important;
  text-decoration: none;
  transition: color 180ms ease;
}

a:hover {
  color: #0d4ed1 !important;
}

/* === 分隔线 === */
hr {
  border: 0 !important;
  border-top: 1px solid rgba(16, 20, 28, 0.08) !important;
  margin: 32px 0 !important;
}

/* === Tabs === */
[role="tablist"] {
  border-bottom: 1px solid rgba(16, 20, 28, 0.08) !important;
  gap: 0 !important;
}

[role="tab"] {
  border-radius: 0 !important;
  font-family: var(--font-sans) !important;
  font-weight: 500 !important;
  padding: 10px 16px !important;
  color: #697486 !important;
  border-bottom: 2px solid transparent !important;
  margin-bottom: -1px !important;
  transition: all 160ms ease !important;
}

[role="tab"]:hover {
  color: #10141c !important;
}

[role="tab"][data-state="active"] {
  background: #ffffff !important;
  color: #10141c !important;
  font-weight: 600 !important;
  border-bottom-color: #10141c !important;
}

/* === 大数字 · Geist display + 渐变 === */
.text-2xl, .text-3xl, .text-6xl, h1.text-2xl, h1.text-3xl {
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  letter-spacing: -0.035em !important;
  line-height: 1.05 !important;
  color: #10141c !important;
  font-feature-settings: "tnum" !important;
}

/* 关键标题渐变（页面 H1） */
h1.text-2xl.font-bold,
h1.text-2xl.font-semibold {
  background: linear-gradient(90deg, #10141c 0%, #4f46e5 65%, #8b5cf6 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  letter-spacing: -0.03em !important;
}

/* === 滚动条 === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(16, 20, 28, 0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #1769ff; }

/* ============================================================
   Dialog 弹窗 · 精准修复（基于实际 JSX 结构）
   ============================================================ */

/* === 遮罩层 === */
[data-slot="dialog-overlay"],
[data-state="open"][data-slot="dialog-overlay"] {
  position: fixed !important;
  inset: 0 !important;
  z-index: 50 !important;
  background: rgba(16, 20, 28, 0.45) !important;
}

/* === Dialog 根容器 === */
/* 用 CSS 变量方式，不与 Tailwind transform 冲突 */
[role="dialog"],
[data-slot="dialog-content"] {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  /* 使用 translate 变量，与 Tailwind 的 --tw-translate-x/y 兼容 */
  --tw-translate-x: -50% !important;
  --tw-translate-y: -50% !important;
  --tw-translate-z: 0 !important;
  transform: translate(var(--tw-translate-x), var(--tw-translate-y), var(--tw-translate-z)) !important;
  z-index: 51 !important;
  outline: none !important;
  display: flex !important;
  flex-direction: column !important;
  width: calc(100vw - 32px) !important;
  max-width: 500px !important;
  max-height: calc(100vh - 32px) !important;
  background: #ffffff !important;
  border: 1px solid rgba(16, 20, 28, 0.1) !important;
  border-radius: 12px !important;
  box-shadow: 0 20px 60px rgba(16, 20, 28, 0.18) !important;
  overflow: hidden !important;
  margin: 0 !important;
}

/* 兜底：如果 Tailwind translate 加载晚了，使用 !important 的 margin 兜底 */
@media (max-width: 640px) {
  [role="dialog"],
  [data-slot="dialog-content"] {
    transform: translate(-50%, -50%) !important;
  }
}

/* === Header === */
[role="dialog"] h2,
[role="dialog"] h3,
[data-slot="dialog-content"] h2,
[data-slot="dialog-content"] h3 {
  font-family: var(--font-display) !important;
  font-size: 1.0625rem !important;
  font-weight: 700 !important;
  color: #10141c !important;
  letter-spacing: -0.02em !important;
  margin: 0 !important;
  padding: 12px 36px 0 0 !important;
  line-height: 1.2 !important;
  flex-shrink: 0 !important;
  white-space: normal !important;
  word-break: break-word !important;
  text-align: left !important;
  display: block !important;
}

[role="dialog"] p,
[role="dialog"] [class*="DialogDescription"] {
  font-size: 0.75rem !important;
  color: #697486 !important;
  margin: 0 !important;
  padding: 3px 0 8px !important;
  line-height: 1.4 !important;
  flex-shrink: 0 !important;
  word-break: break-word !important;
  text-align: left !important;
  font-weight: 400 !important;
}

/* === Body 内容区（应用用 space-y-4 py-4）=== */
[role="dialog"] > div,
[role="dialog"] [class*="space-y-4"] {
  padding: 4px 12px 6px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  overflow-y: auto !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

/* === 单个字段容器 (space-y-2) === */
[role="dialog"] [class*="space-y-2"] {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  padding: 0 !important;
  width: 100% !important;
}

[role="dialog"] label,
[role="dialog"] [class*="FormLabel"] {
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  color: #10141c !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  line-height: 1.3 !important;
  text-align: left !important;
}

/* === 输入框 === */
[role="dialog"] input,
[role="dialog"] textarea,
[role="dialog"] select {
  width: 100% !important;
  font-size: 0.8125rem !important;
  padding: 5px 10px !important;
  border: 1px solid rgba(16, 20, 28, 0.15) !important;
  border-radius: 5px !important;
  background: #ffffff !important;
  color: #10141c !important;
  box-sizing: border-box !important;
}

[role="dialog"] textarea {
  min-height: 48px !important;
  resize: vertical !important;
}

/* === 关键修复：质量标记按钮组 === */
/* 这是真实结构: <div class="flex items-center gap-2"> 包裹两个 <button class="flex-1 flex items-center justify-center gap-2 h-10"> */
[role="dialog"] .flex.items-center.gap-2 {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  gap: 8px !important;
  width: 100% !important;
}

[role="dialog"] .flex.items-center.gap-2 > button,
[role="dialog"] .flex.items-center.gap-2 > [role="radio"] {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  min-height: 72px !important;
  height: auto !important;
  padding: 8px 10px !important;
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  border-radius: 6px !important;
  border: 1px solid rgba(16, 20, 28, 0.15) !important;
  background: #ffffff !important;
  color: #697486 !important;
  cursor: pointer !important;
  transition: all 150ms ease !important;
}

/* === 选中态 · 强化高亮 === */
/* Q 质量问题 选中 - 红品色 */
[role="dialog"] button.border-destructive,
[role="dialog"] .flex.items-center.gap-2 > button[class*="border-destructive"] {
  background: #fff1f0 !important;
  border: 2px solid #ff4d5f !important;
  color: #ff4d5f !important;
  font-weight: 600 !important;
  box-shadow: 0 0 0 3px rgba(255, 77, 95, 0.1) !important;
}

/* 非Q 选中 - 蓝绿色 */
[role="dialog"] button.border-primary,
[role="dialog"] .flex.items-center.gap-2 > button[class*="border-primary"] {
  background: #e6f0ff !important;
  border: 2px solid #1769ff !important;
  color: #10141c !important;
  font-weight: 600 !important;
  box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.1) !important;
}

/* 质量标记 button 内的 svg 图标 */
[role="dialog"] .flex.items-center.gap-2 > button > svg,
[role="dialog"] .flex.items-center.gap-2 > [role="radio"] > svg {
  display: inline-block !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  color: inherit !important;
}

/* === Footer · 底部按钮 === */
[role="dialog"] footer,
[role="dialog"] [class*="DialogFooter"] {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 12px !important;
  margin: 0 !important;
  border-top: 1px solid rgba(16, 20, 28, 0.08) !important;
  background: #f9fafb !important;
  flex-shrink: 0 !important;
  min-height: 44px !important;
}

/* 底部按钮样式 */
[role="dialog"] footer button,
[role="dialog"] [class*="DialogFooter"] button {
  height: 32px !important;
  padding: 0 14px !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  min-width: 80px !important;
  max-width: none !important;
  width: auto !important;
  border-radius: 5px !important;
}

/* === 关闭按钮 === */
[role="dialog"] button[class*="DialogClose"],
[role="dialog"] button[aria-label*="lose"],
[role="dialog"] button[aria-label*="关"] {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
  background: #ffffff !important;
  border: none !important;
  border-radius: 5px !important;
  color: #697486 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 2 !important;
  min-width: 24px !important;
}

/* === 描述段落（用于分析看板...）=== */
[role="dialog"] .text-xs.text-muted-foreground {
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  max-width: 100% !important;
  margin: 2px 0 0 0 !important;
  padding: 0 !important;
  line-height: 1.4 !important;
  text-align: left !important;
  font-size: 0.75rem !important;
}


/* === 去除页面灰色背景 · 更清爽 === */
/* 1. 上传文件区域虚线框 */
[class*="border-dashed"],
div[class*="border-dashed"] {
  background: #fafbfc;
  border-color: rgba(16, 20, 28, 0.15);
  border-width: 1.5px;
}

/* 2. 导入模式卡片 - 改为白色背景 */
[class*="bg-slate-50"],
[class*="bg-gray-50"],
[class*="bg-zinc-50"] {
  background: #f3f5f7 !important;
}

/* 3. 底部提示卡片 - 浅绿色背景 */
.bg-info, [class*="bg-blue-50"]:not([role="dialog"] *) {
  background: #f0f6f4 !important;
  color: #1f6b5c !important;
}

/* 4. 所有 Card 浅边框无背景 */
[class*="rounded-xl"]:not([role="dialog"] *):not([class*="bg-primary"]):not([class*="bg-card"]) {
  background: #f3f5f7 !important;
}

/* 5. muted 区域改为浅色 */
.bg-muted\/50, [class*="bg-muted/50"] {
  background: rgba(16, 20, 28, 0.02) !important;
}

.bg-secondary\/50, [class*="bg-secondary/50"] {
  background: #fafbfc !important;
}

/* 6. 移除任何灰底 */
[class*="bg-neutral-50"] {
  background: #f3f5f7 !important;
}

/* === 选中 === */
::selection {
  background: #1769ff;
  color: #ffffff;
}

/* === 等宽 === */
.font-mono, code, pre {
  font-family: var(--font-mono) !important;
  font-feature-settings: "tnum", "zero";
}

/* === 警告色 · ddc 风格 === */
.bg-amber-50 { background: #fff2df !important; color: #8B5A1E !important; }
.bg-red-50 { background: #ffe8e8 !important; color: #c92a3a !important; }
.bg-green-50 { background: #e6f0ff !important; color: #10141c !important; }
.text-amber-700 { color: #8B5A1E !important; }
.text-red-700 { color: #c92a3a !important; }
.text-red-800 { color: #a51c2a !important; }

/* === 章节标签 === */
.kicker, .section-label {
  font-family: var(--font-mono) !important;
  font-size: 0.6875rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: #10141c !important;
  display: inline-block !important;
}

/* === 指标卡片 === */
.metric-card {
  background: #ffffff;
  border: 1px solid rgba(16, 20, 28, 0.08);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(16, 20, 28, 0.04);
  transition: box-shadow 200ms ease;
}

.metric-card:hover {
  box-shadow: 0 4px 12px rgba(16, 20, 28, 0.06);
}

.metric-value {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #10141c;
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #697486;
  margin-bottom: 12px;
}

/* === Dropdown === */
[data-radix-select-trigger], [data-radix-popover-trigger] {
  border-radius: 6px !important;
  border: 1px solid rgba(16, 20, 28, 0.15) !important;
  background: #f3f5f7 !important;
}

/* === 顶部工具栏 === */
[class*="border-b"][class*="bg-background"] {
  border-color: rgba(16, 20, 28, 0.08) !important;
  background: #f3f5f7 !important;
}

/* === 文本色调 === */
.text-muted-foreground {
  color: #697486 !important;
}
.text-foreground {
  color: #10141c !important;
}

/* === 状态色背景 === */
.bg-warning\/20, [class*="bg-warning"] {
  background: #fff2df !important;
  color: #8B5A1E !important;
}
.bg-success\/20, [class*="bg-success"] {
  background: #e6f0ff !important;
  color: #10141c !important;
}
.bg-info\/20, [class*="bg-info"] {
  background: #e6f0ff !important;
  color: #10141c !important;
}

.bg-card\/50, [class*="bg-card\/"] {
  background: rgba(255, 255, 255, 0.6) !important;
}
.bg-muted { background: #edf2f8 !important; }
.bg-secondary { background: #edf2f8 !important; }
.bg-accent { background: #e6f0ff !important; }

/* === Toast === */
.toast-editorial {
  background: #ffffff !important;
  border: 1px solid rgba(16, 20, 28, 0.1) !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 32px rgba(16, 20, 28, 0.12) !important;
  font-family: var(--font-sans) !important;
}

/* === 图标粗细 === */
.lucide, svg[class*="lucide"] {
  stroke-width: 1.5 !important;
}





/* === 数据导入页面：文件要求/字段识别规则区，去掉左边距 === */
section#data-import > div.space-y-5.ml-9 {
  margin-left: 0 !important;
}

/* === 数据导入页面：顶部介绍段落，去掉左边距 === */
section#data-import > div.mb-6 > p.text-sm.text-muted-foreground.mt-2.ml-9 {
  margin-left: 0 !important;
}
