/* ModeLoop 品牌换肤 v3 — 直接覆盖 --primary 变量(整站派生自它) */

/* 关键:原CSS在:root和.dark里用#3ea4ec和lab()定义--primary。
   用最高优先级选择器 + !important 强行覆盖成品牌紫。
   :root/:host/html/body 多重覆盖,确保盖过后加载的 index.css */
:root, :host, html, body,
:root:root, [data-theme-preset], .light, .dark {
  --primary: #5e35b1 !important;          /* 品牌紫 */
  --primary-foreground: #ffffff !important;
  --ring: #7E57C2 !important;
  --accent: #ede7f6 !important;
  --accent-foreground: #311B92 !important;
  --sidebar-primary: #4A148C !important;
}

/* 主按钮:品牌紫渐变(登录按钮就是 .bg-primary) */
.bg-primary {
  background: linear-gradient(90deg,#4A148C,#7E57C2) !important;
  background-color:#5e35b1 !important;
  color:#fff !important;
}
.text-primary { color:#5e35b1 !important; }
.border-primary, .border-t-primary, .border-b-primary { border-color:#7E57C2 !important; }

/* 登录/注册卡片放大 —— 卡片用 max-w-sm/xs 限宽,直接放宽这些 */
.max-w-sm { max-width:480px !important; }
.max-w-xs { max-width:440px !important; }
.max-w-md { max-width:520px !important; }
/* 卡片本体:圆角+品牌阴影(rounded-* 类) */
.rounded-lg, .rounded-xl, .rounded-2xl {
  box-shadow:0 12px 40px rgba(74,20,140,0.10);
}

/* 输入框聚焦:品牌紫描边 */
input:focus, input:focus-visible {
  border-color:#7E57C2 !important;
  box-shadow:0 0 0 3px rgba(126,87,194,0.15) !important;
  outline:none !important;
}

/* 链接品牌紫(已生效,保留) */
a:not(.bg-primary) { color:#5e35b1 !important; }

/* ===== 加高:输入框 + 按钮更高更舒展 ===== */
/* 输入框加高(默认约36-40px -> 48px) */
input[type="text"], input[type="password"], input[type="email"],
input:not([type="checkbox"]):not([type="radio"]) {
  height:48px !important;
  font-size:15px !important;
  padding-top:12px !important;
  padding-bottom:12px !important;
}

/* 登录按钮加高 + 字大一点 */
.bg-primary, button.bg-primary, button[type="submit"] {
  min-height:50px !important;
  height:50px !important;
  font-size:16px !important;
  font-weight:600 !important;
  border-radius:12px !important;
}

/* 输入框圆角跟按钮统一 */
input:not([type="checkbox"]):not([type="radio"]) {
  border-radius:12px !important;
}

/* 卡片内边距放宽,元素间距更松 */
.max-w-sm, .max-w-xs, .max-w-md { padding:4px !important; }

/* ===== 模型广场(定价表格)品牌化 ===== */
/* 1. 硬编码的蓝色 -> 品牌紫(表格里的 bg-blue-500 等) */
.bg-blue-500,.hover\:bg-blue-500:hover{background-color:#5e35b1 !important}
.text-blue-500,.text-blue-600{color:#5e35b1 !important}
.border-blue-500{border-color:#7E57C2 !important}
:root,[data-theme-preset]{--color-blue-500:#5e35b1 !important;--color-blue-600:#4A148C !important}

/* 2. 表格行做出卡片感 + hover 变紫 */
[class*="data-table-card"]{
  border-radius:12px !important;
}
.table-row:hover,tr:hover{
  background-color:color-mix(in srgb,var(--mid) 8%,transparent) !important;
}
/* 表头品牌紫 */
thead .table-cell,thead th,[data-slot="table-header"]{
  color:var(--brand) !important;font-weight:600 !important;
}

/* 3. 分组标签/分组行标题 品牌紫 */
.text-muted-foreground:has(+ table),[class*="group-header"]{color:var(--brand-2) !important}

/* 4. 定价页里的"分组切换"pill、搜索框聚焦 都吃品牌色(已被--primary覆盖,补强) */
[role="tab"][data-state="active"],[data-state="active"][role="tab"]{
  background:var(--wash) !important;color:var(--brand) !important;
}

/* 2026-09-09:上面 a:not(.bg-primary){color:#5e35b1 !important} 会把首页 hero 里
   紫色渐变按钮的白字也刷成紫色(内联 color:#fff 打不过 !important)。
   内联明确写了白字的链接(深色/渐变底的按钮)保持白色。放在文件末尾,同优先级后者胜。 */
a[style*="color:#fff"], a[style*="color: #fff"], a[style*="color:#ffffff"] { color:#fff !important; }

/* 2026-09-11:登录按钮是 bg-foreground(黑底)+text-background(白字),
   被上面的 a:not(.bg-primary){color:紫} 刷成紫字,黑底上几乎看不见(移动端抽屉实测)。
   深色底上的链接一律用 --background(浅色模式=白,深色模式=深),两套主题都正确。 */
a.bg-foreground, a.bg-black, a.text-background,
.bg-foreground a, .bg-black a,
a.bg-foreground *, a.bg-black * { color: var(--background, #fff) !important; }

/* ===== ModeLoop i18n (2026-09-19) =====
   首页/关于页是自定义 HTML，三种语言的文字并排写在一起，靠包裹元素上的
   data-mllang 决定显示哪一份；该属性由 /ml-lang.js 从 i18nextLng 同步。
   ⚠️ 不能用 html[lang] 这类祖先选择器：new-api 把这些内容渲染进 Shadow DOM
   （htmlVariant:"isolated"），shadow 树里没有 html 祖先，跨边界匹配不到。
   默认中文：脚本没跑到时不白屏。变体一律用行内 span，不破坏 grid/flex。 */
.ml-i18n .mle,.ml-i18n .mlj{display:none}
.ml-i18n[data-mllang="en"] .mlz{display:none}
.ml-i18n[data-mllang="en"] .mle{display:inline}
.ml-i18n[data-mllang="ja"] .mlz{display:none}
.ml-i18n[data-mllang="ja"] .mlj{display:inline}
/* ===== /ModeLoop i18n ===== */
