/* ========================================
   字体和颜色优化 - 确保所有文字清晰可读
   ======================================== */

/* ===== 全局字体优化 ===== */
body {
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e50; /* 更深的文字颜色 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== 导航栏文字颜色修复 ===== */
.navbar,
.admin-navbar {
    background: var(--primary-gradient);
}

.navbar .navbar-brand,
.admin-navbar .admin-navbar-brand {
    color: #ffffff !important;
    font-size: 22px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.navbar-user {
    color: #ffffff !important;
}

/* 用户名 - 确保白色并加粗 */
.username {
    color: #ffffff !important;
    font-weight: 600;
    font-size: 16px;
    margin-right: 12px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    display: inline-block;
}

/* 管理员页面的用户信息 */
.admin-navbar-user {
    color: #ffffff !important;
}

.admin-badge {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    font-weight: 600;
}

/* ===== 按钮文字优化 ===== */
.btn {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.btn-sm {
    font-size: 13px;
    padding: 8px 16px;
}

.btn-primary {
    color: #ffffff !important;
}

.btn-success {
    color: #ffffff !important;
}

.btn-danger {
    color: #ffffff !important;
}

.btn-warning {
    color: #ffffff !important;
}

.btn-secondary {
    color: #ffffff !important;
}

.btn-info {
    color: #ffffff !important;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%) !important;
}

/* ===== 表单文字优化 ===== */
.form-control,
.filter-select,
.search-input {
    color: #2c3e50 !important;
    font-size: 15px;
    font-weight: 500;
}

.form-control::placeholder,
.filter-select::placeholder,
.search-input::placeholder {
    color: #95a5a6 !important;
}

.form-control:focus,
.filter-select:focus,
.search-input:focus {
    color: #2c3e50 !important;
}

.form-label,
.filter-label {
    color: #2c3e50 !important;
    font-weight: 600;
    font-size: 14px;
}

.form-label.required::after {
    color: #e74c3c !important;
}

/* ===== 卡片文字优化 ===== */
.todo-title {
    color: #2c3e50 !important;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.todo-content {
    color: #5a6c7d !important;
    font-size: 15px;
    line-height: 1.6;
}

.todo-meta {
    color: #7f8c8d !important;
    font-size: 13px;
    font-weight: 500;
}

/* 已完成的待办 - 但仍保持可读性 */
.todo-card.completed .todo-title {
    color: #95a5a6 !important;
    text-decoration: line-through;
}

.todo-card.completed .todo-content {
    color: #bdc3c7 !important;
}

/* ===== 标签徽章文字 ===== */
.badge,
.tag-badge {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ===== Alert提示文字优化 ===== */
.alert {
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    color: #155724 !important;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
}

.alert-error {
    color: #721c24 !important;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%) !important;
}

.alert-warning {
    color: #856404 !important;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%) !important;
}

.alert-info {
    color: #0c5460 !important;
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%) !important;
}

/* ===== 表格文字优化 ===== */
.table thead th {
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 700;
}

.table tbody td {
    color: #2c3e50 !important;
    font-size: 14px;
}

.users-table thead th {
    color: #ffffff !important;
    background: var(--primary-gradient) !important;
}

.users-table tbody td {
    color: #2c3e50 !important;
    font-size: 14px;
}

.user-name {
    color: #2c3e50 !important;
    font-weight: 700;
    font-size: 15px;
}

.user-email {
    color: #7f8c8d !important;
    font-size: 13px;
}

/* ===== 统计卡片文字优化 ===== */
.stat-label {
    color: #5a6c7d !important;
    font-size: 13px;
    font-weight: 600;
}

.stat-value {
    color: #2c3e50 !important;
    font-size: 36px;
    font-weight: 800;
}

.stat-trend {
    color: #7f8c8d !important;
    font-size: 13px;
    font-weight: 500;
}

.stat-trend.positive {
    color: #27ae60 !important;
}

.stat-trend.negative {
    color: #e74c3c !important;
}

/* ===== 模态框文字优化 ===== */
.modal-title {
    color: #ffffff !important;
    font-size: 20px;
    font-weight: 700;
}

.modal-body label,
.modal-body .form-label {
    color: #2c3e50 !important;
    font-weight: 600;
    font-size: 14px;
}

/* ===== 附件文字优化 ===== */
.attachment-name {
    color: #2c3e50 !important;
    font-weight: 600;
    font-size: 14px;
}

.attachment-size {
    color: #7f8c8d !important;
    font-size: 12px;
}

/* ===== 空状态文字 ===== */
.empty-state-text,
.empty-users-text {
    color: #7f8c8d !important;
    font-size: 18px;
    font-weight: 600;
}

.empty-state-hint {
    color: #95a5a6 !important;
    font-size: 14px;
}

/* ===== 登录页面文字优化 ===== */
.auth-header h2 {
    color: #2c3e50 !important;
    font-size: 28px;
    font-weight: 700;
}

.auth-header p {
    color: #7f8c8d !important;
    font-size: 14px;
}

.auth-banner h1 {
    color: #ffffff !important;
    font-size: 36px;
    font-weight: 800;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.auth-banner p {
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.6;
}

.auth-footer {
    color: #5a6c7d !important;
    font-size: 14px;
}

.auth-footer a {
    color: #667eea !important;
    font-weight: 700;
}

/* ===== 文字对比度强制规则 ===== */
/* 确保所有重要文字都足够深色 */
h1, h2, h3, h4, h5, h6 {
    color: #2c3e50 !important;
    font-weight: 700;
}

p, span, div {
    color: #2c3e50;
}

/* 链接颜色 */
a {
    color: #667eea !important;
    font-weight: 600;
    text-decoration: none;
}

a:hover {
    color: #5568d3 !important;
}

/* 小字提示文字 */
small,
.form-hint {
    color: #7f8c8d !important;
    font-size: 12px;
}

/* ===== 移动端字体优化 ===== */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .navbar-brand,
    .admin-navbar-brand {
        font-size: 18px !important;
    }

    .username {
        font-size: 14px !important;
        padding: 4px 10px;
    }

    .todo-title {
        font-size: 16px !important;
    }

    .todo-content {
        font-size: 14px !important;
    }

    .btn {
        font-size: 13px;
    }

    .form-control,
    .filter-select {
        font-size: 14px !important;
    }
}

/* ===== 高对比度模式支持 ===== */
@media (prefers-contrast: high) {
    body {
        color: #000000 !important;
    }

    .todo-title,
    .user-name,
    .stat-value {
        color: #000000 !important;
    }
}

/* ===== 确保按钮文字清晰可见 ===== */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff !important;
    font-weight: 700;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    color: #ffffff !important;
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #ffffff !important;
    font-weight: 700;
}

.btn-warning {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: #ffffff !important;
    font-weight: 700;
}

.btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: #ffffff !important;
    font-weight: 700;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: #ffffff !important;
    font-weight: 700;
}

/* ===== 选择框选项文字颜色 ===== */
select option {
    color: #2c3e50 !important;
    background: #ffffff;
}

select option:hover {
    background: #f8f9fa;
}
