1562 lines
35 KiB
SCSS
1562 lines
35 KiB
SCSS
/**
|
||
* 全局样式入口
|
||
* Cursor 风格设计系统
|
||
* 参考 Cursor 官方网站 (cursor.com) 的设计规范
|
||
*/
|
||
|
||
@import './variables.scss';
|
||
|
||
// ===== CSS 变量(用于 JavaScript 访问)=====
|
||
:root {
|
||
// 背景色
|
||
--bg-primary: #{$bg-primary};
|
||
--bg-secondary: #{$bg-secondary};
|
||
--bg-tertiary: #{$bg-tertiary};
|
||
--bg-card: #{$bg-card};
|
||
--bg-card-hover: #{$bg-card-hover};
|
||
--bg-elevated: #{$bg-elevated};
|
||
|
||
// 文字色
|
||
--text-primary: #{$text-primary};
|
||
--text-secondary: #{$text-secondary};
|
||
--text-tertiary: #{$text-tertiary};
|
||
--text-disabled: #{$text-disabled};
|
||
|
||
// 品牌色
|
||
--brand-primary: #{$brand-primary};
|
||
--brand-hover: #{$brand-hover};
|
||
--brand-pressed: #{$brand-pressed};
|
||
|
||
// 功能色
|
||
--color-success: #{$color-success};
|
||
--color-warning: #{$color-warning};
|
||
--color-error: #{$color-error};
|
||
--color-info: #{$color-info};
|
||
|
||
// 边框色
|
||
--border-primary: #{$border-primary};
|
||
--border-secondary: #{$border-secondary};
|
||
--border-divider: #{$border-divider};
|
||
|
||
// 间距
|
||
--space-sm: #{$space-sm};
|
||
--space-md: #{$space-md};
|
||
--space-lg: #{$space-lg};
|
||
--space-xl: #{$space-xl};
|
||
|
||
// 圆角
|
||
--radius-small: #{$radius-small};
|
||
--radius-medium: #{$radius-medium};
|
||
--radius-large: #{$radius-large};
|
||
|
||
// 过渡
|
||
--transition-fast: #{$transition-fast};
|
||
--transition-base: #{$transition-base};
|
||
--transition-slow: #{$transition-slow};
|
||
--ease-out: #{$ease-out};
|
||
|
||
// 布局
|
||
--navbar-height: #{$navbar-height};
|
||
--container-max-width: #{$container-max-width};
|
||
}
|
||
|
||
// ===== 全局重置 =====
|
||
*,
|
||
*::before,
|
||
*::after {
|
||
box-sizing: border-box;
|
||
margin: 0;
|
||
padding: 0;
|
||
}
|
||
|
||
html {
|
||
font-size: 16px;
|
||
-webkit-font-smoothing: antialiased;
|
||
-moz-osx-font-smoothing: grayscale;
|
||
text-rendering: optimizeLegibility;
|
||
}
|
||
|
||
body {
|
||
margin: 0;
|
||
font-family: $font-family-zh;
|
||
font-size: $font-size-base;
|
||
line-height: 1.5;
|
||
color: $text-primary;
|
||
background: $bg-primary;
|
||
overflow-x: hidden;
|
||
}
|
||
|
||
// ===== 链接样式 =====
|
||
a {
|
||
color: $brand-primary;
|
||
text-decoration: none;
|
||
transition: color $transition-base $ease-out;
|
||
|
||
&:hover {
|
||
color: $brand-hover;
|
||
}
|
||
}
|
||
|
||
// ===== 滚动条样式(Cursor 风格:更细腻的滚动条)=====
|
||
::-webkit-scrollbar {
|
||
width: 6px;
|
||
height: 6px;
|
||
}
|
||
|
||
::-webkit-scrollbar-track {
|
||
background: transparent;
|
||
}
|
||
|
||
::-webkit-scrollbar-thumb {
|
||
background: $border-primary;
|
||
border-radius: $radius-full;
|
||
|
||
&:hover {
|
||
background: $border-color;
|
||
}
|
||
}
|
||
|
||
// ===== 通用工具类 =====
|
||
|
||
// 容器
|
||
.container {
|
||
max-width: $container-max-width;
|
||
margin: 0 auto;
|
||
padding: 0 $space-xl;
|
||
|
||
@media (max-width: $breakpoint-tablet) {
|
||
padding: 0 $space-lg;
|
||
}
|
||
|
||
@media (max-width: $breakpoint-mobile) {
|
||
padding: 0 $space-md;
|
||
}
|
||
}
|
||
|
||
// 卡片(Cursor 风格:更简洁的卡片)
|
||
.card {
|
||
background: $bg-card;
|
||
border: 1px solid $border-primary;
|
||
border-radius: $radius-md;
|
||
padding: $space-lg;
|
||
transition: all $transition-base $ease-out;
|
||
|
||
&:hover {
|
||
border-color: $border-color;
|
||
background: $bg-card-hover;
|
||
box-shadow: $shadow-base;
|
||
}
|
||
}
|
||
|
||
// 按钮样式(Cursor 风格:更柔和的按钮)
|
||
.btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: $space-sm;
|
||
padding: 10px 20px;
|
||
font-size: $font-size-base;
|
||
font-weight: $font-weight-medium;
|
||
line-height: 1.5;
|
||
border-radius: $radius-md;
|
||
border: none;
|
||
cursor: pointer;
|
||
transition: all $transition-base $ease-out;
|
||
white-space: nowrap;
|
||
user-select: none;
|
||
|
||
&:disabled {
|
||
opacity: 0.5;
|
||
cursor: not-allowed;
|
||
}
|
||
}
|
||
|
||
.btn-primary {
|
||
background: $brand-primary;
|
||
color: #000000 !important; // 黑色文字
|
||
|
||
&:hover:not(:disabled) {
|
||
background: $brand-hover;
|
||
color: #000000 !important; // 黑色文字
|
||
box-shadow: 0 2px 8px rgba($brand-primary, 0.25);
|
||
}
|
||
|
||
&:active:not(:disabled) {
|
||
background: $brand-pressed;
|
||
color: #000000 !important; // 黑色文字
|
||
transform: scale(0.98);
|
||
}
|
||
|
||
// 确保按钮内的所有文字和图标都是黑色
|
||
span,
|
||
.anticon {
|
||
color: #000000 !important;
|
||
}
|
||
}
|
||
|
||
.btn-secondary {
|
||
background: $bg-tertiary;
|
||
color: $text-primary;
|
||
border: 1px solid $border-primary;
|
||
|
||
&:hover:not(:disabled) {
|
||
background: $bg-card;
|
||
border-color: $border-color;
|
||
color: $text-primary;
|
||
}
|
||
}
|
||
|
||
.btn-text {
|
||
background: transparent;
|
||
color: $text-secondary;
|
||
padding: $space-sm $space-md;
|
||
|
||
&:hover:not(:disabled) {
|
||
color: $brand-primary;
|
||
}
|
||
}
|
||
|
||
// 输入框(Cursor 风格:更柔和的输入框)
|
||
.input {
|
||
width: 100%;
|
||
padding: 10px 16px;
|
||
font-size: $font-size-base;
|
||
line-height: 1.5;
|
||
color: $text-primary;
|
||
background: $bg-tertiary;
|
||
border: 1px solid $border-primary;
|
||
border-radius: $radius-md;
|
||
transition: all $transition-base $ease-out;
|
||
|
||
&:focus {
|
||
outline: none;
|
||
border-color: $brand-primary;
|
||
background: $bg-card;
|
||
box-shadow: 0 0 0 2px rgba($brand-primary, 0.08);
|
||
}
|
||
|
||
&::placeholder {
|
||
color: $text-tertiary;
|
||
}
|
||
|
||
&:disabled {
|
||
opacity: 0.5;
|
||
cursor: not-allowed;
|
||
}
|
||
}
|
||
|
||
// ===== 全局 Ant Design 输入框样式统一 =====
|
||
// 统一所有页面的输入框样式(与登录页面一致)
|
||
|
||
// 基础输入框
|
||
.ant-input,
|
||
.ant-input-affix-wrapper {
|
||
background: $bg-secondary !important;
|
||
border: 1px solid $border-color !important;
|
||
border-radius: $radius-md !important;
|
||
color: $text-white !important;
|
||
font-size: $font-size-base;
|
||
transition: all 0.2s ease;
|
||
height: 48px !important;
|
||
line-height: 48px !important;
|
||
padding: 0 12px !important;
|
||
box-sizing: border-box;
|
||
|
||
&::placeholder {
|
||
color: $text-tertiary !important;
|
||
line-height: normal;
|
||
}
|
||
|
||
&:hover {
|
||
background: $bg-secondary !important;
|
||
border-color: rgba($brand-primary, 0.5) !important;
|
||
color: $text-white !important;
|
||
}
|
||
|
||
&:focus,
|
||
&.ant-input-focused,
|
||
&:focus-visible {
|
||
background: $bg-secondary !important;
|
||
border-color: $brand-primary !important;
|
||
box-shadow: 0 0 0 2px rgba($brand-primary, 0.1) !important;
|
||
color: $text-white !important;
|
||
outline: none !important;
|
||
}
|
||
|
||
&:disabled {
|
||
background: $bg-tertiary !important;
|
||
border-color: $border-primary !important;
|
||
color: $text-disabled !important;
|
||
cursor: not-allowed;
|
||
}
|
||
}
|
||
|
||
// 输入框大小变体
|
||
.ant-input-sm {
|
||
height: 32px !important;
|
||
line-height: 32px !important;
|
||
font-size: $font-size-sm !important;
|
||
padding: 0 8px !important;
|
||
}
|
||
|
||
.ant-input-lg {
|
||
height: 48px !important;
|
||
line-height: 48px !important;
|
||
font-size: $font-size-base !important;
|
||
padding: 0 12px !important;
|
||
}
|
||
|
||
// 搜索框
|
||
.ant-input-search {
|
||
.ant-input {
|
||
border-radius: $radius-md 0 0 $radius-md !important;
|
||
}
|
||
|
||
.ant-input-search-button {
|
||
background: $bg-secondary !important;
|
||
border: 1px solid $border-color !important;
|
||
border-left: none !important;
|
||
color: $text-white !important;
|
||
height: 48px !important;
|
||
border-radius: 0 $radius-md $radius-md 0 !important;
|
||
|
||
&:hover {
|
||
background: $bg-tertiary !important;
|
||
border-color: rgba($brand-primary, 0.5) !important;
|
||
color: $text-white !important;
|
||
}
|
||
}
|
||
|
||
&:hover .ant-input,
|
||
&.ant-input-search-focused .ant-input {
|
||
border-color: rgba($brand-primary, 0.5) !important;
|
||
}
|
||
|
||
&.ant-input-search-focused .ant-input {
|
||
border-color: $brand-primary !important;
|
||
box-shadow: 0 0 0 2px rgba($brand-primary, 0.1) !important;
|
||
}
|
||
}
|
||
|
||
// 密码输入框
|
||
.ant-input-password {
|
||
background: $bg-secondary !important;
|
||
border: 1px solid $border-color !important;
|
||
border-radius: $radius-md !important;
|
||
height: 48px !important;
|
||
width: 100% !important;
|
||
box-shadow: none !important;
|
||
transition: all 0.2s ease;
|
||
padding: 0 !important;
|
||
display: flex;
|
||
align-items: center;
|
||
|
||
.ant-input {
|
||
background: transparent !important;
|
||
border: none !important;
|
||
box-shadow: none !important;
|
||
color: $text-white !important;
|
||
height: 48px;
|
||
line-height: 48px;
|
||
font-size: $font-size-base;
|
||
padding: 0 40px 0 12px !important;
|
||
text-align: left;
|
||
flex: 1;
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
|
||
&::placeholder {
|
||
color: $text-tertiary !important;
|
||
line-height: normal;
|
||
}
|
||
|
||
&:hover {
|
||
background: transparent !important;
|
||
color: $text-white !important;
|
||
}
|
||
|
||
&:focus,
|
||
&:focus-visible {
|
||
background: transparent !important;
|
||
color: $text-white !important;
|
||
outline: none !important;
|
||
box-shadow: none !important;
|
||
}
|
||
}
|
||
|
||
.ant-input-password-icon {
|
||
color: $text-secondary;
|
||
right: 12px;
|
||
|
||
&:hover {
|
||
color: $text-primary;
|
||
}
|
||
}
|
||
|
||
&:hover {
|
||
background: $bg-secondary !important;
|
||
border-color: rgba($brand-primary, 0.5) !important;
|
||
}
|
||
|
||
&.ant-input-password-focused,
|
||
&:focus,
|
||
&:focus-visible {
|
||
background: $bg-secondary !important;
|
||
border-color: $brand-primary !important;
|
||
box-shadow: 0 0 0 2px rgba($brand-primary, 0.1) !important;
|
||
outline: none !important;
|
||
}
|
||
}
|
||
|
||
// 下拉选择框
|
||
.ant-select {
|
||
.ant-select-selector {
|
||
background: $bg-secondary !important;
|
||
border: 1px solid $border-color !important;
|
||
border-radius: $radius-md !important;
|
||
color: $text-white !important;
|
||
height: 48px !important;
|
||
transition: all 0.2s ease;
|
||
|
||
.ant-select-selection-item,
|
||
.ant-select-selection-placeholder {
|
||
color: $text-white !important;
|
||
line-height: 46px !important;
|
||
}
|
||
|
||
.ant-select-selection-placeholder {
|
||
color: $text-tertiary !important;
|
||
}
|
||
}
|
||
|
||
&:hover .ant-select-selector {
|
||
border-color: rgba($brand-primary, 0.5) !important;
|
||
}
|
||
|
||
&.ant-select-focused .ant-select-selector {
|
||
border-color: $brand-primary !important;
|
||
box-shadow: 0 0 0 2px rgba($brand-primary, 0.1) !important;
|
||
}
|
||
|
||
.ant-select-arrow {
|
||
color: $text-secondary !important;
|
||
}
|
||
|
||
// 大小变体
|
||
&.ant-select-sm .ant-select-selector {
|
||
height: 32px !important;
|
||
|
||
.ant-select-selection-item,
|
||
.ant-select-selection-placeholder {
|
||
line-height: 30px !important;
|
||
}
|
||
}
|
||
|
||
&.ant-select-lg .ant-select-selector {
|
||
height: 48px !important;
|
||
|
||
.ant-select-selection-item,
|
||
.ant-select-selection-placeholder {
|
||
line-height: 46px !important;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 下拉菜单样式
|
||
.ant-select-dropdown {
|
||
background: $bg-card !important;
|
||
border: 1px solid $border-color !important;
|
||
border-radius: $radius-md !important;
|
||
box-shadow: $shadow-elevated !important;
|
||
|
||
.ant-select-item {
|
||
color: $text-white !important;
|
||
background: transparent !important;
|
||
|
||
&:hover {
|
||
background: $bg-tertiary !important;
|
||
}
|
||
|
||
&.ant-select-item-option-selected {
|
||
background: rgba($brand-primary, 0.1) !important;
|
||
color: $brand-primary !important;
|
||
}
|
||
|
||
&.ant-select-item-option-active {
|
||
background: $bg-tertiary !important;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 文本域(Textarea)
|
||
.ant-textarea,
|
||
textarea.ant-input {
|
||
background: $bg-secondary !important;
|
||
border: 1px solid $border-color !important;
|
||
border-radius: $radius-md !important;
|
||
color: $text-white !important;
|
||
font-size: $font-size-base !important;
|
||
transition: all 0.2s ease !important;
|
||
min-height: auto !important;
|
||
padding: 12px !important;
|
||
line-height: 1.5 !important;
|
||
height: auto !important;
|
||
resize: vertical !important;
|
||
|
||
&::placeholder {
|
||
color: $text-tertiary !important;
|
||
}
|
||
|
||
&:hover {
|
||
background: $bg-secondary !important;
|
||
border-color: rgba($brand-primary, 0.5) !important;
|
||
}
|
||
|
||
&:focus,
|
||
&:focus-visible {
|
||
background: $bg-secondary !important;
|
||
border-color: $brand-primary !important;
|
||
box-shadow: 0 0 0 2px rgba($brand-primary, 0.1) !important;
|
||
outline: none !important;
|
||
}
|
||
}
|
||
|
||
// Textarea 包装器
|
||
.ant-input-textarea {
|
||
.ant-input {
|
||
background: $bg-secondary !important;
|
||
border: 1px solid $border-color !important;
|
||
|
||
&:hover {
|
||
border-color: rgba($brand-primary, 0.5) !important;
|
||
}
|
||
|
||
&:focus {
|
||
border-color: $brand-primary !important;
|
||
box-shadow: 0 0 0 2px rgba($brand-primary, 0.1) !important;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 数字输入框
|
||
.ant-input-number {
|
||
width: 100%;
|
||
background: $bg-secondary !important;
|
||
border: 1px solid $border-color !important;
|
||
border-radius: $radius-md !important;
|
||
height: 48px !important;
|
||
|
||
.ant-input-number-input {
|
||
background: transparent !important;
|
||
border: none !important;
|
||
color: $text-white !important;
|
||
height: 46px !important;
|
||
line-height: 46px !important;
|
||
padding: 0 12px !important;
|
||
|
||
&::placeholder {
|
||
color: $text-tertiary !important;
|
||
}
|
||
}
|
||
|
||
&:hover {
|
||
border-color: rgba($brand-primary, 0.5) !important;
|
||
}
|
||
|
||
&.ant-input-number-focused {
|
||
border-color: $brand-primary !important;
|
||
box-shadow: 0 0 0 2px rgba($brand-primary, 0.1) !important;
|
||
}
|
||
}
|
||
|
||
// ===== 全局 Ant Design 按钮样式统一 =====
|
||
// 统一所有页面的主要按钮(绿色按钮)文字颜色为黑色
|
||
|
||
// 确保所有 primary 按钮都是绿色(覆盖 Ant Design 默认蓝色)
|
||
.ant-btn-primary,
|
||
.ant-btn[type="primary"],
|
||
button.ant-btn-primary,
|
||
a.ant-btn-primary {
|
||
background: $brand-primary !important;
|
||
border-color: $brand-primary !important;
|
||
color: #000000 !important; // 黑色文字
|
||
|
||
&:hover:not(:disabled),
|
||
&:hover:not(.ant-btn-loading) {
|
||
background: $brand-hover !important;
|
||
border-color: $brand-hover !important;
|
||
color: #000000 !important; // 黑色文字
|
||
}
|
||
|
||
&:active:not(:disabled),
|
||
&:focus:not(:disabled) {
|
||
background: $brand-pressed !important;
|
||
border-color: $brand-pressed !important;
|
||
color: #000000 !important; // 黑色文字
|
||
}
|
||
|
||
&:disabled,
|
||
&.ant-btn-loading {
|
||
background: $bg-tertiary !important;
|
||
border-color: $bg-tertiary !important;
|
||
color: $text-disabled !important;
|
||
opacity: 0.5;
|
||
}
|
||
|
||
// 确保按钮内的所有文字和图标都是黑色
|
||
span,
|
||
.anticon,
|
||
.ant-btn-loading-icon,
|
||
.anticon-loading {
|
||
color: #000000 !important;
|
||
}
|
||
|
||
// 确保加载状态下的图标也是黑色
|
||
&.ant-btn-loading {
|
||
.anticon-loading {
|
||
color: #000000 !important;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 确保登录页面的按钮也是黑色文字
|
||
.login-button {
|
||
color: #000000 !important;
|
||
|
||
span,
|
||
.anticon {
|
||
color: #000000 !important;
|
||
}
|
||
}
|
||
|
||
// 单选按钮组(Radio Button Group)- 现代化独立按钮设计
|
||
.ant-radio-group {
|
||
display: flex;
|
||
gap: 8px; // 按钮之间的间距
|
||
align-items: center; // 垂直居中对齐
|
||
|
||
.ant-radio-button-wrapper {
|
||
background: $bg-tertiary !important;
|
||
border: 1px solid transparent !important; // 默认透明边框
|
||
border-radius: 8px !important; // 圆角
|
||
color: $text-secondary !important;
|
||
padding: 6px 16px !important; // 增加垂直padding
|
||
font-size: 13px !important;
|
||
line-height: 20px !important; // 固定行高,确保文字居中
|
||
height: 32px !important; // 固定高度
|
||
display: inline-flex !important; // 使用flex布局
|
||
align-items: center !important; // 垂直居中
|
||
justify-content: center !important; // 水平居中
|
||
transition: all 0.2s ease !important;
|
||
margin: 0 !important; // 移除默认 margin
|
||
|
||
// 移除默认的连接样式
|
||
&::before {
|
||
display: none !important; // 隐藏分隔线
|
||
}
|
||
|
||
&:first-child {
|
||
border-radius: 8px !important; // 确保第一个按钮也是圆角
|
||
}
|
||
|
||
&:last-child {
|
||
border-radius: 8px !important; // 确保最后一个按钮也是圆角
|
||
}
|
||
|
||
&:hover:not(.ant-radio-button-wrapper-checked) {
|
||
background: rgba($brand-primary, 0.05) !important;
|
||
border-color: rgba($brand-primary, 0.3) !important;
|
||
color: $brand-primary !important;
|
||
transform: translateY(-1px);
|
||
}
|
||
|
||
&.ant-radio-button-wrapper-checked {
|
||
background: rgba($brand-primary, 0.12) !important;
|
||
border-color: $brand-primary !important;
|
||
color: $brand-primary !important;
|
||
font-weight: 500 !important;
|
||
box-shadow: 0 0 0 2px rgba($brand-primary, 0.1) !important;
|
||
|
||
&:hover {
|
||
background: rgba($brand-primary, 0.15) !important;
|
||
border-color: $brand-primary !important;
|
||
color: $brand-primary !important;
|
||
}
|
||
|
||
&:active {
|
||
background: rgba($brand-primary, 0.2) !important;
|
||
border-color: $brand-primary !important;
|
||
color: $brand-primary !important;
|
||
}
|
||
}
|
||
|
||
&:focus-within {
|
||
box-shadow: 0 0 0 2px rgba($brand-primary, 0.1) !important;
|
||
}
|
||
|
||
// 确保内部文字也垂直居中
|
||
> span {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
line-height: 20px;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 普通单选按钮(Radio)
|
||
.ant-radio-wrapper {
|
||
color: $text-primary !important;
|
||
|
||
.ant-radio {
|
||
.ant-radio-inner {
|
||
background: $bg-secondary !important;
|
||
border-color: $border-primary !important;
|
||
}
|
||
|
||
&:hover .ant-radio-inner {
|
||
border-color: $brand-primary !important;
|
||
}
|
||
|
||
&.ant-radio-checked .ant-radio-inner {
|
||
background: $brand-primary !important;
|
||
border-color: $brand-primary !important;
|
||
|
||
&::after {
|
||
background: #000000 !important; // 选中时内部圆点为黑色
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// Switch 开关 - 全局统一样式
|
||
.ant-switch {
|
||
background: $bg-tertiary !important;
|
||
border-color: $border-primary !important;
|
||
color: $text-primary !important;
|
||
|
||
// 未选中状态的文字
|
||
.ant-switch-inner {
|
||
color: $text-primary !important;
|
||
}
|
||
|
||
&.ant-switch-checked {
|
||
background: $brand-primary !important;
|
||
border-color: $brand-primary !important;
|
||
|
||
// 选中状态的文字(checked-children)必须是黑色
|
||
.ant-switch-inner {
|
||
color: #000000 !important;
|
||
}
|
||
|
||
// 选中状态的文字内容也要是黑色
|
||
.ant-switch-inner-checked {
|
||
color: #000000 !important;
|
||
}
|
||
}
|
||
|
||
.ant-switch-handle {
|
||
&::before {
|
||
background: $text-primary !important;
|
||
}
|
||
}
|
||
|
||
&.ant-switch-checked .ant-switch-handle {
|
||
&::before {
|
||
background: #000000 !important; // 选中时手柄为黑色
|
||
}
|
||
}
|
||
}
|
||
|
||
// 额外确保所有选中的 Switch 文字都是黑色(最高优先级)
|
||
.ant-switch.ant-switch-checked {
|
||
.ant-switch-inner,
|
||
.ant-switch-inner-checked {
|
||
color: #000000 !important;
|
||
}
|
||
}
|
||
|
||
// 日期选择器 - 选中日期的文字必须是黑色
|
||
.ant-picker-cell-selected {
|
||
.ant-picker-cell-inner {
|
||
background: $brand-primary !important;
|
||
color: #000000 !important; // 选中日期文字为黑色
|
||
}
|
||
}
|
||
|
||
// 日期选择器下拉面板中的选中日期
|
||
.ant-picker-dropdown {
|
||
.ant-picker-cell-selected .ant-picker-cell-inner {
|
||
background: $brand-primary !important;
|
||
color: #000000 !important; // 选中日期文字为黑色
|
||
}
|
||
}
|
||
|
||
// Tag 标签 - 绿色 Tag 的文字必须是黑色
|
||
.ant-tag-green,
|
||
.ant-tag[class*="green"] {
|
||
background: $brand-primary !important;
|
||
border-color: $brand-primary !important;
|
||
color: #000000 !important; // 绿色 Tag 文字为黑色
|
||
}
|
||
|
||
// 确保所有带有绿色背景的 Tag 文字都是黑色
|
||
.ant-tag {
|
||
&.ant-tag-green {
|
||
background: $brand-primary !important;
|
||
border-color: $brand-primary !important;
|
||
color: #000000 !important;
|
||
}
|
||
}
|
||
|
||
// 徽章
|
||
.badge {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
min-width: 20px;
|
||
height: 20px;
|
||
padding: 0 6px;
|
||
font-size: $font-size-xs;
|
||
font-weight: $font-weight-medium;
|
||
line-height: 1;
|
||
color: $text-white;
|
||
background: $color-error;
|
||
border-radius: $radius-full;
|
||
}
|
||
|
||
// 标签
|
||
.tag {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: $space-xs;
|
||
padding: 4px 12px;
|
||
font-size: $font-size-sm;
|
||
font-weight: $font-weight-medium;
|
||
border-radius: $radius-small;
|
||
|
||
&.tag-success {
|
||
color: $color-success;
|
||
background: rgba($color-success, 0.1);
|
||
border: 1px solid rgba($color-success, 0.3);
|
||
}
|
||
|
||
&.tag-warning {
|
||
color: $color-warning;
|
||
background: rgba($color-warning, 0.1);
|
||
border: 1px solid rgba($color-warning, 0.3);
|
||
}
|
||
|
||
&.tag-error {
|
||
color: $color-error;
|
||
background: rgba($color-error, 0.1);
|
||
border: 1px solid rgba($color-error, 0.3);
|
||
}
|
||
|
||
&.tag-info {
|
||
color: $color-info;
|
||
background: rgba($color-info, 0.1);
|
||
border: 1px solid rgba($color-info, 0.3);
|
||
}
|
||
}
|
||
|
||
// 文本工具类
|
||
.text-primary {
|
||
color: $text-primary;
|
||
}
|
||
|
||
.text-secondary {
|
||
color: $text-secondary;
|
||
}
|
||
|
||
.text-tertiary {
|
||
color: $text-tertiary;
|
||
}
|
||
|
||
.text-brand {
|
||
color: $brand-primary;
|
||
}
|
||
|
||
.text-success {
|
||
color: $color-success;
|
||
}
|
||
|
||
.text-warning {
|
||
color: $color-warning;
|
||
}
|
||
|
||
.text-error {
|
||
color: $color-error;
|
||
}
|
||
|
||
// 间距工具类
|
||
.mt-sm { margin-top: $space-sm; }
|
||
.mt-md { margin-top: $space-md; }
|
||
.mt-lg { margin-top: $space-lg; }
|
||
.mt-xl { margin-top: $space-xl; }
|
||
|
||
.mb-sm { margin-bottom: $space-sm; }
|
||
.mb-md { margin-bottom: $space-md; }
|
||
.mb-lg { margin-bottom: $space-lg; }
|
||
.mb-xl { margin-bottom: $space-xl; }
|
||
|
||
.ml-sm { margin-left: $space-sm; }
|
||
.ml-md { margin-left: $space-md; }
|
||
.ml-lg { margin-left: $space-lg; }
|
||
|
||
.mr-sm { margin-right: $space-sm; }
|
||
.mr-md { margin-right: $space-md; }
|
||
.mr-lg { margin-right: $space-lg; }
|
||
|
||
.p-sm { padding: $space-sm; }
|
||
.p-md { padding: $space-md; }
|
||
.p-lg { padding: $space-lg; }
|
||
.p-xl { padding: $space-xl; }
|
||
|
||
// Flex 布局
|
||
.flex {
|
||
display: flex;
|
||
}
|
||
|
||
.flex-center {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.flex-between {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.flex-col {
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.gap-sm { gap: $space-sm; }
|
||
.gap-md { gap: $space-md; }
|
||
.gap-lg { gap: $space-lg; }
|
||
|
||
// 隐藏/显示
|
||
.hidden {
|
||
display: none !important;
|
||
}
|
||
|
||
@media (max-width: $breakpoint-mobile) {
|
||
.hidden-mobile {
|
||
display: none !important;
|
||
}
|
||
}
|
||
|
||
@media (min-width: calc(#{$breakpoint-mobile} + 1px)) {
|
||
.show-mobile {
|
||
display: none !important;
|
||
}
|
||
}
|
||
|
||
// 加载动画
|
||
@keyframes spin {
|
||
from {
|
||
transform: rotate(0deg);
|
||
}
|
||
to {
|
||
transform: rotate(360deg);
|
||
}
|
||
}
|
||
|
||
.loading-spinner {
|
||
width: 20px;
|
||
height: 20px;
|
||
border: 2px solid $border-primary;
|
||
border-top-color: $brand-primary;
|
||
border-radius: $radius-full;
|
||
animation: spin 0.8s linear infinite;
|
||
}
|
||
|
||
// ===== 全局 Ant Design 表格样式统一 =====
|
||
// 统一所有页面的表格样式(深色主题,避免悬停闪白)
|
||
:deep(.ant-table) {
|
||
// 表头统一样式
|
||
.ant-table-thead > tr > th {
|
||
background: $bg-tertiary !important;
|
||
border-color: $border-primary !important;
|
||
color: $text-primary !important;
|
||
font-weight: $font-weight-semibold !important;
|
||
font-size: 14px !important;
|
||
padding: 16px 12px !important;
|
||
text-align: left !important;
|
||
white-space: nowrap !important;
|
||
|
||
// 第一个表头单元格
|
||
&:first-child {
|
||
padding-left: 20px !important;
|
||
border-top-left-radius: $radius-md !important;
|
||
}
|
||
|
||
// 最后一个表头单元格(通常是操作列)
|
||
&:last-child {
|
||
padding-right: 20px !important;
|
||
text-align: center !important;
|
||
border-top-right-radius: $radius-md !important;
|
||
}
|
||
|
||
// 固定列样式
|
||
&.ant-table-cell-fix-right,
|
||
&.ant-table-cell-fix-left {
|
||
background: $bg-tertiary !important;
|
||
}
|
||
}
|
||
|
||
.ant-table-tbody > tr {
|
||
background: $bg-card !important;
|
||
transition: none !important; // 移除过渡避免闪烁
|
||
|
||
> td {
|
||
background: $bg-card !important;
|
||
transition: none !important;
|
||
}
|
||
|
||
&:hover {
|
||
background: $bg-card-hover !important;
|
||
transition: none !important;
|
||
|
||
> td {
|
||
background: $bg-card-hover !important;
|
||
transition: none !important;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 覆盖 Ant Design 默认样式
|
||
.ant-table-tbody > tr.ant-table-row {
|
||
background: $bg-card !important;
|
||
transition: none !important;
|
||
|
||
> td {
|
||
background: $bg-card !important;
|
||
transition: none !important;
|
||
}
|
||
|
||
&:hover {
|
||
background: $bg-card-hover !important;
|
||
transition: none !important;
|
||
|
||
> td {
|
||
background: $bg-card-hover !important;
|
||
transition: none !important;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 确保所有悬停状态都是深色
|
||
.ant-table-tbody > tr:hover > td,
|
||
.ant-table-tbody > tr.ant-table-row:hover > td {
|
||
background: $bg-card-hover !important;
|
||
transition: none !important;
|
||
}
|
||
}
|
||
|
||
// ===== 全局 Ant Design 分页样式统一 =====
|
||
// 统一所有页面的分页组件样式(深色主题)
|
||
:deep(.ant-pagination) {
|
||
.ant-pagination-item {
|
||
background: $bg-tertiary !important;
|
||
border-color: $border-primary !important;
|
||
|
||
a {
|
||
color: $text-primary !important;
|
||
}
|
||
|
||
&:hover:not(.ant-pagination-item-active) {
|
||
border-color: $brand-primary !important;
|
||
|
||
a {
|
||
color: $brand-primary !important;
|
||
}
|
||
}
|
||
|
||
&.ant-pagination-item-active {
|
||
background: $brand-primary !important;
|
||
border-color: $brand-primary !important;
|
||
|
||
a {
|
||
color: #000000 !important; // 当前页文字为黑色
|
||
}
|
||
|
||
&:hover {
|
||
background: $brand-hover !important;
|
||
border-color: $brand-hover !important;
|
||
|
||
a {
|
||
color: #000000 !important;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
.ant-pagination-prev,
|
||
.ant-pagination-next {
|
||
.ant-pagination-item-link {
|
||
background: $bg-tertiary !important;
|
||
border-color: $border-primary !important;
|
||
color: $text-primary !important;
|
||
|
||
&:hover:not(:disabled) {
|
||
border-color: $brand-primary !important;
|
||
color: $brand-primary !important;
|
||
}
|
||
|
||
&:disabled {
|
||
opacity: 0.5;
|
||
cursor: not-allowed;
|
||
}
|
||
}
|
||
}
|
||
|
||
.ant-pagination-jump-prev,
|
||
.ant-pagination-jump-next {
|
||
.ant-pagination-item-link {
|
||
color: $text-primary !important;
|
||
|
||
&:hover {
|
||
color: $brand-primary !important;
|
||
}
|
||
}
|
||
}
|
||
|
||
.ant-pagination-options {
|
||
.ant-select {
|
||
.ant-select-selector {
|
||
background: $bg-tertiary !important;
|
||
border-color: $border-primary !important;
|
||
color: $text-primary !important;
|
||
}
|
||
}
|
||
|
||
.ant-pagination-options-size-changer {
|
||
color: $text-primary !important;
|
||
}
|
||
}
|
||
|
||
.ant-pagination-total-text {
|
||
color: $text-primary !important;
|
||
}
|
||
|
||
// 表格内分页样式
|
||
&.ant-pagination {
|
||
.ant-pagination-item {
|
||
background: $bg-tertiary !important;
|
||
border-color: $border-primary !important;
|
||
|
||
a {
|
||
color: $text-primary !important;
|
||
}
|
||
|
||
&.ant-pagination-item-active {
|
||
background: $brand-primary !important;
|
||
border-color: $brand-primary !important;
|
||
|
||
a {
|
||
color: #000000 !important; // 当前页文字为黑色
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// 表格分页容器
|
||
:deep(.ant-table-pagination) {
|
||
.ant-pagination {
|
||
.ant-pagination-item {
|
||
background: $bg-tertiary !important;
|
||
border-color: $border-primary !important;
|
||
|
||
a {
|
||
color: $text-primary !important;
|
||
}
|
||
|
||
&.ant-pagination-item-active {
|
||
background: $brand-primary !important;
|
||
border-color: $brand-primary !important;
|
||
|
||
a {
|
||
color: #000000 !important; // 当前页文字为黑色
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// ===== 全局 Ant Design Modal 弹窗样式统一 =====
|
||
// 统一所有页面的弹窗样式(深色主题)
|
||
.ant-modal {
|
||
.ant-modal-content {
|
||
background: $bg-card !important;
|
||
border: 1px solid $border-primary !important;
|
||
border-radius: $radius-lg !important;
|
||
box-shadow: $shadow-elevated !important;
|
||
}
|
||
|
||
.ant-modal-header {
|
||
background: $bg-card !important;
|
||
border-bottom: 1px solid $border-primary !important;
|
||
padding: $space-lg $space-xl !important;
|
||
|
||
.ant-modal-title {
|
||
color: $text-primary !important;
|
||
font-size: $font-size-xl !important;
|
||
font-weight: $font-weight-semibold !important;
|
||
}
|
||
}
|
||
|
||
.ant-modal-body {
|
||
background: $bg-card !important;
|
||
padding: $space-xl !important;
|
||
color: $text-primary !important;
|
||
}
|
||
|
||
.ant-modal-footer {
|
||
background: $bg-card !important;
|
||
border-top: 1px solid $border-primary !important;
|
||
padding: $space-md $space-xl !important;
|
||
|
||
.ant-btn {
|
||
min-width: 80px;
|
||
}
|
||
}
|
||
|
||
.ant-modal-close {
|
||
color: $text-secondary !important;
|
||
|
||
&:hover {
|
||
color: $text-primary !important;
|
||
}
|
||
}
|
||
}
|
||
|
||
// Modal 确认框样式
|
||
.ant-modal-confirm {
|
||
.ant-modal-confirm-title {
|
||
color: $text-primary !important;
|
||
}
|
||
|
||
.ant-modal-confirm-content {
|
||
color: $text-secondary !important;
|
||
}
|
||
}
|
||
|
||
// ===== 全局 Ant Design Drawer 抽屉样式统一 =====
|
||
.ant-drawer {
|
||
.ant-drawer-content {
|
||
background: $bg-card !important;
|
||
}
|
||
|
||
.ant-drawer-header {
|
||
background: $bg-card !important;
|
||
border-bottom: 1px solid $border-primary !important;
|
||
padding: $space-lg $space-xl !important;
|
||
|
||
.ant-drawer-title {
|
||
color: $text-primary !important;
|
||
font-size: $font-size-xl !important;
|
||
font-weight: $font-weight-semibold !important;
|
||
}
|
||
|
||
.ant-drawer-close {
|
||
color: $text-secondary !important;
|
||
|
||
&:hover {
|
||
color: $text-primary !important;
|
||
}
|
||
}
|
||
}
|
||
|
||
.ant-drawer-body {
|
||
background: $bg-card !important;
|
||
padding: $space-xl !important;
|
||
color: $text-primary !important;
|
||
}
|
||
|
||
.ant-drawer-footer {
|
||
background: $bg-card !important;
|
||
border-top: 1px solid $border-primary !important;
|
||
padding: $space-md $space-xl !important;
|
||
}
|
||
}
|
||
|
||
// ===== 全局 Ant Design Form 表单样式统一 =====
|
||
.ant-form {
|
||
.ant-form-item-label > label {
|
||
color: $text-primary !important;
|
||
font-weight: $font-weight-medium;
|
||
}
|
||
|
||
.ant-form-item-required::before {
|
||
color: $color-error !important;
|
||
}
|
||
|
||
.ant-form-item-explain-error {
|
||
color: $color-error !important;
|
||
font-size: $font-size-sm;
|
||
}
|
||
}
|
||
|
||
// ===== 全局 Ant Design Descriptions 描述列表样式统一 =====
|
||
.ant-descriptions {
|
||
.ant-descriptions-header {
|
||
.ant-descriptions-title {
|
||
color: $text-primary !important;
|
||
}
|
||
}
|
||
|
||
.ant-descriptions-view {
|
||
border-color: $border-primary !important;
|
||
}
|
||
|
||
.ant-descriptions-item-label {
|
||
background: $bg-tertiary !important;
|
||
color: $text-secondary !important;
|
||
border-color: $border-primary !important;
|
||
}
|
||
|
||
.ant-descriptions-item-content {
|
||
background: $bg-card !important;
|
||
color: $text-primary !important;
|
||
border-color: $border-primary !important;
|
||
}
|
||
|
||
&.ant-descriptions-bordered {
|
||
.ant-descriptions-item-label,
|
||
.ant-descriptions-item-content {
|
||
border-color: $border-primary !important;
|
||
}
|
||
}
|
||
}
|
||
|
||
// ===== 全局 Ant Design Checkbox 复选框样式统一 =====
|
||
.ant-checkbox-wrapper {
|
||
color: $text-primary !important;
|
||
|
||
.ant-checkbox {
|
||
.ant-checkbox-inner {
|
||
background: $bg-secondary !important;
|
||
border-color: $border-primary !important;
|
||
}
|
||
|
||
&:hover .ant-checkbox-inner {
|
||
border-color: $brand-primary !important;
|
||
}
|
||
|
||
&.ant-checkbox-checked .ant-checkbox-inner {
|
||
background: $brand-primary !important;
|
||
border-color: $brand-primary !important;
|
||
|
||
&::after {
|
||
border-color: #000000 !important; // 勾选标记为黑色
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// ===== 全局 Ant Design Menu 菜单样式统一 =====
|
||
.ant-dropdown-menu {
|
||
background: $bg-card !important;
|
||
border: 1px solid $border-primary !important;
|
||
border-radius: $radius-md !important;
|
||
box-shadow: $shadow-elevated !important;
|
||
|
||
.ant-dropdown-menu-item {
|
||
color: $text-primary !important;
|
||
|
||
&:hover {
|
||
background: $bg-tertiary !important;
|
||
}
|
||
|
||
&.ant-dropdown-menu-item-danger {
|
||
color: $color-error !important;
|
||
|
||
&:hover {
|
||
background: rgba($color-error, 0.1) !important;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// ===== 全局 Ant Design Popconfirm 确认弹出框样式统一 =====
|
||
.ant-popconfirm {
|
||
.ant-popover-inner {
|
||
background: $bg-card !important;
|
||
border: 1px solid $border-primary !important;
|
||
border-radius: $radius-md !important;
|
||
}
|
||
|
||
.ant-popconfirm-message-title {
|
||
color: $text-primary !important;
|
||
}
|
||
|
||
.ant-popconfirm-description {
|
||
color: $text-secondary !important;
|
||
}
|
||
}
|
||
|
||
// ===== 全局 Ant Design Tooltip 提示框样式统一 =====
|
||
.ant-tooltip {
|
||
.ant-tooltip-inner {
|
||
background: $bg-elevated !important;
|
||
color: $text-primary !important;
|
||
border-radius: $radius-sm !important;
|
||
}
|
||
|
||
.ant-tooltip-arrow-content {
|
||
background: $bg-elevated !important;
|
||
}
|
||
}
|
||
|
||
// ===== 全局 Ant Design Message 消息提示样式统一 =====
|
||
.ant-message {
|
||
.ant-message-notice-content {
|
||
background: $bg-card !important;
|
||
border: 1px solid $border-primary !important;
|
||
border-radius: $radius-md !important;
|
||
box-shadow: $shadow-elevated !important;
|
||
color: $text-primary !important;
|
||
}
|
||
}
|
||
|
||
// ===== 全局 Ant Design Spin 加载组件样式统一 =====
|
||
.ant-spin {
|
||
.ant-spin-dot-item {
|
||
background: $brand-primary !important;
|
||
}
|
||
}
|
||
|
||
// ===== 全局 Ant Design Empty 空状态样式统一 =====
|
||
.ant-empty {
|
||
.ant-empty-description {
|
||
color: $text-secondary !important;
|
||
}
|
||
}
|
||
|
||
// ===== 深色日期选择器样式 =====
|
||
.dark-date-picker {
|
||
.ant-picker-panel-container {
|
||
background: $bg-card !important;
|
||
border: 1px solid $border-primary !important;
|
||
border-radius: $radius-md !important;
|
||
box-shadow: $shadow-elevated !important;
|
||
}
|
||
|
||
.ant-picker-header {
|
||
color: $text-primary !important;
|
||
border-bottom: 1px solid $border-divider !important;
|
||
|
||
button {
|
||
color: $text-secondary !important;
|
||
|
||
&:hover {
|
||
color: $brand-primary !important;
|
||
}
|
||
}
|
||
|
||
.ant-picker-header-view {
|
||
button {
|
||
color: $text-primary !important;
|
||
|
||
&:hover {
|
||
color: $brand-primary !important;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
.ant-picker-content {
|
||
th {
|
||
color: $text-secondary !important;
|
||
}
|
||
|
||
td {
|
||
color: $text-primary !important;
|
||
}
|
||
}
|
||
|
||
.ant-picker-cell {
|
||
color: $text-secondary !important;
|
||
|
||
&:hover:not(.ant-picker-cell-selected):not(.ant-picker-cell-disabled) {
|
||
.ant-picker-cell-inner {
|
||
background: rgba($brand-primary, 0.1) !important;
|
||
}
|
||
}
|
||
|
||
&.ant-picker-cell-in-view {
|
||
color: $text-primary !important;
|
||
}
|
||
|
||
&.ant-picker-cell-selected {
|
||
.ant-picker-cell-inner {
|
||
background: $brand-primary !important;
|
||
color: #000 !important;
|
||
}
|
||
}
|
||
|
||
&.ant-picker-cell-today {
|
||
.ant-picker-cell-inner::before {
|
||
border-color: $brand-primary !important;
|
||
}
|
||
}
|
||
}
|
||
|
||
.ant-picker-month-panel,
|
||
.ant-picker-year-panel {
|
||
.ant-picker-cell-inner {
|
||
border-radius: $radius-sm !important;
|
||
}
|
||
}
|
||
|
||
.ant-picker-footer {
|
||
border-top: 1px solid $border-divider !important;
|
||
|
||
.ant-picker-today-btn {
|
||
color: $brand-primary !important;
|
||
}
|
||
}
|
||
}
|
||
|
||
// ===== 全局 Ant Design DatePicker 输入框深色样式 =====
|
||
.ant-picker {
|
||
background: $bg-tertiary !important;
|
||
border-color: $border-primary !important;
|
||
|
||
input {
|
||
color: $text-primary !important;
|
||
|
||
&::placeholder {
|
||
color: $text-tertiary !important;
|
||
}
|
||
}
|
||
|
||
.ant-picker-suffix {
|
||
color: $text-tertiary !important;
|
||
}
|
||
|
||
.ant-picker-clear {
|
||
background: $bg-tertiary !important;
|
||
color: $text-tertiary !important;
|
||
|
||
&:hover {
|
||
color: $text-secondary !important;
|
||
}
|
||
}
|
||
|
||
&:hover {
|
||
border-color: $brand-primary !important;
|
||
}
|
||
|
||
&.ant-picker-focused {
|
||
border-color: $brand-primary !important;
|
||
box-shadow: 0 0 0 2px rgba($brand-primary, 0.2) !important;
|
||
}
|
||
}
|
||
|