Files
BYW-VoiceHub/app/assets/css/variables.css
T
Henry_Du 92704d6637 feat(front): 前台默认浅色模式并新增居中投稿按钮与实时空闲档期
- 主题: useTheme 默认 ModernLight + variables.css SSR-safe 浅值并精修组件对比度
- 首页: 插入居中投稿 CTA + 紧邻档期概览卡片(今日排期/待播歌曲/空闲档期数)
- 数据: useSongs 新增 fetchExpectedPlayDates 接入空闲档期并走 revision 轮询实时刷新
- 视觉: 移动端优先,少圆角硬边几何 + 概览卡片 3→1 列响应式
2026-09-13 19:32:27 +08:00

571 lines
14 KiB
CSS

/* 全局CSS变量 - 统一配色方案 */
/* SSR-safe 默认值 = ModernLight 浅色,防止 hydration 前出现深色闪屏 */
:root {
--primary: #4f46e5;
--primary-hover: #4338ca;
--primary-light: rgba(79, 70, 229, 0.1);
--primary-border: rgba(79, 70, 229, 0.2);
--success: #16a34a;
--success-hover: #15803d;
--success-light: rgba(22, 163, 74, 0.1);
--success-border: rgba(22, 163, 74, 0.2);
--warning: #ea580c;
--warning-hover: #c2410c;
--warning-light: rgba(234, 88, 12, 0.1);
--warning-border: rgba(234, 88, 12, 0.2);
--error: #e11d48;
--error-hover: #be123c;
--error-light: rgba(225, 29, 72, 0.1);
--error-border: rgba(225, 29, 72, 0.2);
--info: #0ea5e9;
--info-hover: #0284c7;
--info-light: rgba(14, 165, 233, 0.1);
--info-border: rgba(14, 165, 233, 0.2);
--bg-primary: #fafafa;
--bg-secondary: #f4f4f5;
--bg-tertiary: #e4e4e7;
--bg-quaternary: #d4d4d8;
--bg-hover: #eeeeef;
--text-primary: #09090b;
--text-secondary: #3f3f46;
--text-tertiary: #71717a;
--text-quaternary: #a1a1aa;
--text-disabled: #d4d4d8;
--border-primary: #e4e4e7;
--border-secondary: #d4d4d8;
--border-tertiary: #a1a1aa;
--border-quaternary: #71717a;
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
--shadow-md: 0 2px 8px -2px rgba(0, 0, 0, 0.05), 0 1px 3px 0 rgba(0, 0, 0, 0.03);
--shadow-lg: 0 8px 24px -4px rgba(0, 0, 0, 0.06), 0 2px 8px -4px rgba(0, 0, 0, 0.04);
--shadow-xl: 0 16px 40px -8px rgba(0, 0, 0, 0.08), 0 4px 16px -8px rgba(0, 0, 0, 0.05);
--radius-sm: 4px;
--radius-md: 6px;
--radius-lg: 8px;
--radius-xl: 10px;
--radius-2xl: 12px;
--spacing-xs: 4px;
--spacing-sm: 8px;
--spacing-md: 12px;
--spacing-lg: 16px;
--spacing-xl: 20px;
--spacing-2xl: 24px;
--spacing-3xl: 32px;
--text-xs: 12px;
--text-sm: 14px;
--text-base: 16px;
--text-lg: 18px;
--text-xl: 20px;
--text-2xl: 24px;
--text-3xl: 30px;
--font-normal: 400;
--font-medium: 500;
--font-semibold: 600;
--font-bold: 700;
--transition-fast: 0.15s ease;
--transition-normal: 0.2s ease;
--transition-slow: 0.3s ease;
--z-dropdown: 100;
--z-sticky: 200;
--z-fixed: 300;
--z-modal-backdrop: 400;
--z-modal: 500;
--z-popover: 600;
--z-tooltip: 700;
--z-toast: 800;
--status-pending: #eab308;
--status-pending-light: rgba(234, 179, 8, 0.12);
--status-approved: #22c55e;
--status-approved-light: rgba(34, 197, 94, 0.12);
--status-played: #71717a;
--status-played-light: rgba(113, 113, 122, 0.12);
--vote-heart: #ef4444;
--vote-heart-hover: #dc2626;
--vote-count: var(--text-tertiary);
--drag-over: var(--primary-light);
--drag-over-border: var(--primary);
--dragging-opacity: 0.5;
--table-header-bg: #f4f4f5;
--table-row-hover: #fafafa;
--table-border: #e4e4e7;
--table-selected: rgba(79, 70, 229, 0.08);
--card-bg: #ffffff;
--card-border: #e4e4e7;
--card-hover-border: #d4d4d8;
--card-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.05), 0 1px 3px 0 rgba(0, 0, 0, 0.03);
--btn-primary-bg: var(--primary);
--btn-primary-hover: var(--primary-hover);
--btn-primary-text: #ffffff;
--btn-primary-border: var(--primary-border);
--btn-secondary-bg: #f4f4f5;
--btn-secondary-hover: #e4e4e7;
--btn-secondary-text: #09090b;
--btn-secondary-border: #d4d4d8;
--btn-success-bg: var(--success);
--btn-success-hover: var(--success-hover);
--btn-success-text: #ffffff;
--btn-success-border: var(--success-border);
--btn-warning-bg: var(--warning);
--btn-warning-hover: var(--warning-hover);
--btn-warning-text: #ffffff;
--btn-warning-border: var(--warning-border);
--btn-error-bg: var(--error);
--btn-error-hover: var(--error-hover);
--btn-error-text: #ffffff;
--btn-error-border: var(--error-border);
--btn-disabled-bg: var(--bg-tertiary);
--btn-disabled-text: var(--text-disabled);
--input-bg: #ffffff;
--input-border: #e4e4e7;
--input-border-focus: #4f46e5;
--input-text: #09090b;
--input-placeholder: #a1a1aa;
--input-shadow-focus: 0 0 0 3px rgba(79, 70, 229, 0.12);
--modal-backdrop: rgba(0, 0, 0, 0.4);
--modal-bg: var(--bg-secondary);
--modal-border: var(--border-secondary);
--modal-header-border: var(--border-secondary);
--modal-footer-border: var(--border-secondary);
--notification-success-bg: var(--success-light);
--notification-success-border: var(--success-border);
--notification-success-text: var(--success);
--notification-warning-bg: var(--warning-light);
--notification-warning-border: var(--warning-border);
--notification-warning-text: var(--warning);
--notification-error-bg: var(--error-light);
--notification-error-border: var(--error-border);
--notification-error-text: var(--error);
--notification-info-bg: var(--info-light);
--notification-info-border: var(--info-border);
--notification-info-text: var(--info);
--spinner-primary: var(--primary);
--spinner-secondary: var(--bg-tertiary);
--scrollbar-track: #f4f4f5;
--scrollbar-thumb: #d4d4d8;
--scrollbar-thumb-hover: #a1a1aa;
}
:root[data-theme='dark'] {
--bg-primary: #111111;
--bg-secondary: #1a1a1a;
--bg-tertiary: #2a2a2a;
--bg-quaternary: #3a3a3a;
--bg-hover: #1f1f1f;
--text-primary: #ffffff;
--text-secondary: #cccccc;
--text-tertiary: #888888;
--text-quaternary: #666666;
--text-disabled: #444444;
--border-primary: #1f1f1f;
--border-secondary: #2a2a2a;
--border-tertiary: #3a3a3a;
--border-quaternary: #4a4a4a;
--card-bg: #1a1a1a;
--card-border: #2a2a2a;
--btn-secondary-bg: #3a3a3a;
--btn-secondary-hover: #4a4a4a;
--btn-secondary-text: #ffffff;
--btn-secondary-border: #555555;
--input-bg: var(--bg-tertiary);
--input-border: var(--border-tertiary);
--input-text: var(--text-primary);
--input-placeholder: var(--text-quaternary);
--scrollbar-track: var(--bg-tertiary);
--scrollbar-thumb: var(--bg-quaternary);
--scrollbar-thumb-hover: #4a4a4a;
--modal-backdrop: rgba(0, 0, 0, 0.7);
--card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
:root[data-theme='light'],
:root[data-theme='ClassicLight'],
:root[data-theme='ModernLight'] {
--bg-primary: #f8fafc;
--bg-secondary: #f1f5f9;
--bg-tertiary: #e2e8f0;
--bg-quaternary: #cbd5e1;
--bg-hover: #e2e8f0;
--text-primary: #0f172a;
--text-secondary: #334155;
--text-tertiary: #475569;
--text-quaternary: #64748b;
--text-disabled: #94a3b8;
--border-primary: #e2e8f0;
--border-secondary: #cbd5e1;
--border-tertiary: #94a3b8;
--border-quaternary: #64748b;
--modal-backdrop: rgba(0, 0, 0, 0.4);
--scrollbar-thumb-hover: #94a3b8;
--btn-secondary-bg: #f1f5f9;
--btn-secondary-hover: #e2e8f0;
--btn-secondary-text: #0f172a;
--btn-secondary-border: #cbd5e1;
--card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}
:root[data-theme='ClassicLight'] {
--primary: #1e40af;
--primary-hover: #1e3a8a;
--primary-light: rgba(30, 64, 175, 0.08);
--primary-border: rgba(30, 64, 175, 0.15);
--bg-primary: #ffffff;
--bg-secondary: #f5f7fa;
--bg-tertiary: #edf0f5;
--bg-quaternary: #d9dee7;
--bg-hover: #f0f3f8;
--success: #059669;
--success-hover: #047857;
--success-light: rgba(5, 150, 105, 0.08);
--success-border: rgba(5, 150, 105, 0.15);
--warning: #d97706;
--warning-hover: #b45309;
--warning-light: rgba(217, 119, 6, 0.08);
--warning-border: rgba(217, 119, 6, 0.15);
--error: #dc2626;
--error-hover: #b91c1c;
--error-light: rgba(220, 38, 38, 0.08);
--error-border: rgba(220, 38, 38, 0.15);
--info: #2563eb;
--info-hover: #1d4ed8;
--info-light: rgba(37, 99, 235, 0.08);
--info-border: rgba(37, 99, 235, 0.15);
--text-primary: #1a2332;
--text-secondary: #4a5568;
--text-tertiary: #6b7280;
--text-quaternary: #9ca3af;
--text-disabled: #c5cbd3;
--border-primary: #e5e7eb;
--border-secondary: #d1d5db;
--border-tertiary: #9ca3af;
--border-quaternary: #6b7280;
--input-bg: #ffffff;
--input-border: #d1d5db;
--input-border-focus: #1e40af;
--input-text: #1a2332;
--input-placeholder: #9ca3af;
--input-shadow-focus: 0 0 0 3px rgba(30, 64, 175, 0.1);
--card-bg: #ffffff;
--card-border: #e5e7eb;
--card-hover-border: #d1d5db;
--table-header-bg: #f5f7fa;
--table-row-hover: #f9fafb;
--table-border: #e5e7eb;
--table-selected: rgba(30, 64, 175, 0.06);
--scrollbar-track: #f1f5f9;
--scrollbar-thumb: #cbd5e1;
--scrollbar-thumb-hover: #94a3b8;
--status-pending: #ca8a04;
--status-pending-light: rgba(202, 138, 4, 0.08);
--status-approved: #059669;
--status-approved-light: rgba(5, 150, 105, 0.08);
--status-played: #6b7280;
--status-played-light: rgba(107, 114, 128, 0.08);
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
--radius-sm: 3px;
--radius-md: 5px;
--radius-lg: 6px;
--radius-xl: 8px;
--radius-2xl: 10px;
}
:root[data-theme='ModernLight'] {
--primary: #4f46e5;
--primary-hover: #4338ca;
--primary-light: rgba(79, 70, 229, 0.1);
--primary-border: rgba(79, 70, 229, 0.2);
--bg-primary: #fafafa;
--bg-secondary: #f4f4f5;
--bg-tertiary: #e4e4e7;
--bg-quaternary: #d4d4d8;
--bg-hover: #eeeeef;
--success: #16a34a;
--success-hover: #15803d;
--success-light: rgba(22, 163, 74, 0.1);
--success-border: rgba(22, 163, 74, 0.2);
--warning: #ea580c;
--warning-hover: #c2410c;
--warning-light: rgba(234, 88, 12, 0.1);
--warning-border: rgba(234, 88, 12, 0.2);
--error: #e11d48;
--error-hover: #be123c;
--error-light: rgba(225, 29, 72, 0.1);
--error-border: rgba(225, 29, 72, 0.2);
--info: #0ea5e9;
--info-hover: #0284c7;
--info-light: rgba(14, 165, 233, 0.1);
--info-border: rgba(14, 165, 233, 0.2);
--text-primary: #09090b;
--text-secondary: #3f3f46;
--text-tertiary: #71717a;
--text-quaternary: #a1a1aa;
--text-disabled: #d4d4d8;
--border-primary: #e4e4e7;
--border-secondary: #d4d4d8;
--border-tertiary: #a1a1aa;
--border-quaternary: #71717a;
--input-bg: #ffffff;
--input-border: #e4e4e7;
--input-border-focus: #4f46e5;
--input-text: #09090b;
--input-placeholder: #a1a1aa;
--input-shadow-focus: 0 0 0 3px rgba(79, 70, 229, 0.12);
--card-bg: #ffffff;
--card-border: #e4e4e7;
--card-hover-border: #d4d4d8;
--table-header-bg: #f4f4f5;
--table-row-hover: #fafafa;
--table-border: #e4e4e7;
--table-selected: rgba(79, 70, 229, 0.08);
--scrollbar-track: #f4f4f5;
--scrollbar-thumb: #d4d4d8;
--scrollbar-thumb-hover: #a1a1aa;
--status-pending: #eab308;
--status-pending-light: rgba(234, 179, 8, 0.12);
--status-approved: #22c55e;
--status-approved-light: rgba(34, 197, 94, 0.12);
--status-played: #71717a;
--status-played-light: rgba(113, 113, 122, 0.12);
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
--shadow-md: 0 2px 8px -2px rgba(0, 0, 0, 0.05), 0 1px 3px 0 rgba(0, 0, 0, 0.03);
--shadow-lg: 0 8px 24px -4px rgba(0, 0, 0, 0.06), 0 2px 8px -4px rgba(0, 0, 0, 0.04);
--shadow-xl: 0 16px 40px -8px rgba(0, 0, 0, 0.08), 0 4px 16px -8px rgba(0, 0, 0, 0.05);
--radius-sm: 4px;
--radius-md: 6px;
--radius-lg: 8px;
--radius-xl: 10px;
--radius-2xl: 12px;
}
/* 深色主题特定调整 */
@media (prefers-color-scheme: dark) {
:root {
/* 在深色模式下可以进行微调 */
}
}
/* 高对比度模式支持 */
@media (prefers-contrast: high) {
:root {
--border-primary: #444444;
--border-secondary: #555555;
--border-tertiary: #666666;
--text-tertiary: #aaaaaa;
--text-quaternary: #888888;
}
}
/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
:root {
--transition-fast: 0s;
--transition-normal: 0s;
--transition-slow: 0s;
}
}
/* 全局滚动条样式 */
* {
scrollbar-width: thin;
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
*::-webkit-scrollbar {
width: 8px;
height: 8px;
}
*::-webkit-scrollbar-track {
background: var(--scrollbar-track);
}
*::-webkit-scrollbar-thumb {
background: var(--scrollbar-thumb);
border-radius: var(--radius-md);
}
*::-webkit-scrollbar-thumb:hover {
background: var(--scrollbar-thumb-hover);
}
/* 全局选择文本样式 */
::selection {
background: var(--primary-light);
color: var(--text-primary);
}
/* 全局焦点样式 */
*:focus {
outline: 2px solid var(--primary);
outline-offset: 2px;
}
*:focus:not(:focus-visible) {
outline: none;
}
/* 全局禁用状态样式 */
*:disabled {
cursor: not-allowed;
opacity: 0.6;
}
/* 全局链接样式 */
a {
color: var(--primary);
text-decoration: none;
transition: color var(--transition-normal);
}
a:hover {
color: var(--primary-hover);
}
/* 全局按钮重置 */
button {
border: none;
background: none;
cursor: pointer;
font-family: inherit;
}
* {
-webkit-tap-highlight-color: transparent;
}
button,
a,
input,
textarea {
-webkit-tap-highlight-color: transparent;
}
@media (hover: none) and (pointer: coarse) {
*:focus {
outline: none !important;
}
button,
a {
-webkit-user-select: none;
user-select: none;
}
}
/* 全局输入框重置 */
input,
textarea,
select {
font-family: inherit;
font-size: inherit;
}
/* 全局图片样式 */
img {
max-width: 100%;
height: auto;
}
/* 全局表格样式 */
table {
border-collapse: collapse;
width: 100%;
}
/* 全局代码样式 */
code,
pre {
font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
background: var(--bg-tertiary);
border-radius: var(--radius-sm);
}
code {
padding: 2px 4px;
font-size: 0.875em;
}
pre {
padding: var(--spacing-lg);
overflow-x: auto;
}
pre code {
padding: 0;
background: none;
}