/**
 * 全局文字可读性修复
 * 确保所有页面文字清晰可读
 */

/* ========== 强制修复浅色文字 ========== */

/* 卡片标题 */
.card h1, .card h2, .card h3,
.shadcn-card h1, .shadcn-card h2, .shadcn-card h3,
.provider-card h1, .provider-card h2, .provider-card h3 {
  color: var(--text-primary) !important;
}

/* 卡片正文 */
.card p, .shadcn-card p, .provider-card p {
  color: var(--text-secondary) !important;
}

/* 卡片说明文字 */
.card .text-sm, .shadcn-card .text-sm {
  color: var(--text-tertiary) !important;
}

/* 表格文字 */
table th {
  color: var(--text-primary) !important;
  font-weight: var(--font-semibold);
}

table td {
  color: var(--text-secondary) !important;
}

/* 表单 Label */
label {
  color: var(--text-primary) !important;
  font-weight: var(--font-medium);
}

/* 输入框 */
input, textarea, select {
  color: var(--text-primary) !important;
}

input::placeholder, textarea::placeholder {
  color: var(--text-quaternary) !important;
}

/* 按钮文字 */
button {
  font-weight: var(--font-medium);
}

/* 导航文字 */
nav a {
  color: var(--nav-item-text);
}

nav a:hover {
  color: var(--text-primary);
}

/* 侧边栏文字 */
.sidebar a, .apple-sidebar a {
  color: var(--sidebar-item-text);
}

.sidebar a:hover, .apple-sidebar a:hover {
  color: var(--text-primary);
}

/* 链接 */
a {
  color: var(--text-link);
}

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

/* 代码块 */
code {
  color: var(--code-text);
  background-color: var(--code-bg);
}

/* 强制覆盖 Tailwind 浅色类 */
.text-gray-400, .text-gray-500, .text-gray-600 {
  color: var(--text-tertiary) !important;
}

.text-gray-700, .text-gray-800, .text-gray-900 {
  color: var(--text-secondary) !important;
}

/* 白色背景卡片中的文字 */
.bg-white h1, .bg-white h2, .bg-white h3 {
  color: var(--text-primary) !important;
}

.bg-white p {
  color: var(--text-secondary) !important;
}

/* 统计数字 */
.stat-value, .metric-value {
  color: var(--text-primary) !important;
  font-weight: var(--font-semibold);
}

/* 状态文字 */
.status-text {
  font-weight: var(--font-medium);
}

/* Footer 文字 */
footer {
  color: var(--text-tertiary);
}

footer a {
  color: var(--text-secondary);
}

footer a:hover {
  color: var(--text-primary);
}

/* 面包屑 */
.breadcrumb {
  color: var(--text-tertiary);
}

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

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

/* 徽章 */
.badge {
  font-weight: var(--font-medium);
}

/* 标签 */
.tag {
  font-weight: var(--font-medium);
}

/* 通知 */
.notification {
  color: var(--text-secondary);
}

/* 模态框 */
.modal h1, .modal h2, .modal h3 {
  color: var(--text-primary) !important;
}

.modal p {
  color: var(--text-secondary) !important;
}

/* 下拉菜单 */
.dropdown-item {
  color: var(--text-secondary);
}

.dropdown-item:hover {
  color: var(--text-primary);
}

/* ========== 确保对比度 ========== */

/* 白色背景上的主要文字至少 var(--text-primary) */
[class*="bg-white"] h1,
[class*="bg-white"] h2,
[class*="bg-white"] h3,
[class*="bg-white"] [class*="font-semibold"],
[class*="bg-white"] [class*="font-bold"] {
  color: var(--text-primary) !important;
}

/* 白色背景上的次要文字至少 #404040 */
[class*="bg-white"] p,
[class*="bg-white"] span,
[class*="bg-white"] div {
  color: #404040 !important;
}

/* 说明文字可以稍浅 #737373 */
[class*="bg-white"] .text-xs,
[class*="bg-white"] .text-sm {
  color: #737373 !important;
}

/* ========== 暗色模式 ========== */
/* 已禁用：使用 data-theme="dark" 控制，不使用系统偏好 */
