video-shuoshan/web/src/components/UniversalUpload.module.css
seaislee1209 f0f47e8368 feat(theme): 亮色主题切换完整实现 — dark/light 双套 var + Sidebar 切换 + 浅色色板
Stage 1 (var 化, 350 处): 425 处硬编码颜色 → CSS var, 涉及 49 个 tsx/css module 文件,
   按 hot files (DashboardPage/TeamDashboardPage/RecordDetailModal/ReferenceList) →
   Modal/Asset/Profile/Login → 生成页家族/管理后台/公共 UI 三波 8 个 sub-agent 并行处理。
   index.css :root 加 ~70 个新 var (modal/text 层级/状态色 bg 变体/chart/mention pill 等)。
Stage 2 (双套 var): :root 保留 DARK 默认值, [data-theme="light"] 覆盖 ~95 个 token。
   浅色色板按 Vercel Geist (#fafafa / #171717 / shadow-border) + Linear Light surface 分层规范,
   主色 #6c63ff → #5048cc 加深 18% 满足 WCAG AA。aurora 极光在 light 下 display:none。
Stage 3 (切换机制): 新建 store/theme.ts (Zustand + localStorage 持久化),
   Sidebar 加月亮/太阳 SVG 切换按钮 (位于头像上方),
   DashboardPage/TeamDashboardPage/ProfilePage 的 ECharts 配 key={theme} 强制重渲染。
Stage 4 (微调): LandingPage 强制 data-theme="dark" 保持品牌识别 (登录流程一直深色),
   sidebar bg / card bg / border 在浅色下加深 0.02 提升轮廓辨识度。
Stage 5 (验证): Playwright 头无浏览器自动登录 admin + screenshot_user, 截深/浅各 12 个页面 = 24 张
   到 docs/screenshots/ (本地档, .gitignore 排除 png 不入库)。
   vitest 71fail/162pass 与改造前基线完全一致, 无新增回归。

完成报告: docs/todo/亮色主题切换-完成报告.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 11:10:35 +08:00

309 lines
6.8 KiB
CSS

.wrapper {
flex-shrink: 0;
display: flex;
align-items: flex-start;
position: relative;
z-index: 10;
}
/* hasFiles state: fixed dimensions via inline style, overflow visible for expanded content */
.wrapperActive {
overflow: visible;
align-self: flex-start;
}
.hiddenInput {
display: none;
}
.trigger {
height: var(--thumbnail-size);
aspect-ratio: 3 / 4;
border: 1.5px dashed var(--color-border-modal);
background: rgba(255, 255, 255, 0.03); /* near-match: ~--color-bg-upload (0.04) */
border-radius: var(--radius-btn);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 4px;
cursor: pointer;
transition: all 0.2s;
flex-shrink: 0;
}
.trigger:hover {
border-color: #5a5a6a; /* unmapped: hover border lighter than --color-border-modal */
background: var(--color-bg-card);
}
.triggerText {
font-size: 11px;
color: var(--color-text-disabled);
}
/* Always absolute — no position toggling to avoid jitter */
.thumbRow {
position: absolute;
top: 0;
left: 0;
display: flex;
align-items: flex-start;
flex-shrink: 0;
}
/* Expanded: overlay on top of prompt text */
.thumbRowExpanded {
z-index: 11;
padding-right: 12px;
}
/* Add-more button gets opaque background when expanded (overlays prompt text) */
.thumbRowExpanded .addMore {
background: var(--color-bg-modal-elevated);
border-color: var(--color-border-modal);
}
.thumbRowExpanded .addMore:hover {
background: #1e1e2a; /* unmapped: hover variant of bg-modal-elevated */
border-color: #5a5a6a; /* unmapped: hover border lighter than --color-border-modal */
}
/* Each thumbnail card — 3:4 portrait ratio, overflow visible for tooltip */
.thumbItem {
position: relative;
height: var(--thumbnail-size);
aspect-ratio: 3 / 4;
overflow: visible;
flex-shrink: 0;
cursor: default;
transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Inner container: clips media, label, close button within rounded corners */
.thumbInner {
width: 100%;
height: 100%;
border-radius: var(--radius-thumbnail);
overflow: hidden;
background: var(--color-bg-dropdown-elevated);
border: 1.5px solid var(--color-border-modal);
position: relative;
}
.thumbItem:hover .thumbInner {
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3); /* unmapped: shadow alpha 0.3 */
}
.thumbMedia {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
/* Close / remove button — inside thumbInner */
.thumbClose {
position: absolute;
top: 4px;
right: 4px;
width: 18px;
height: 18px;
background: var(--color-overlay-strong);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
opacity: 0;
pointer-events: none;
transition: opacity 0.15s;
}
.itemExpanded .thumbClose {
pointer-events: auto;
}
.itemExpanded:hover .thumbClose {
opacity: 1;
}
/* Tooltip above thumbnail on hover — outside thumbInner */
.thumbTooltip {
position: absolute;
bottom: calc(100% + 6px);
left: 50%;
transform: translateX(-50%);
white-space: nowrap;
padding: 4px 10px;
border-radius: 6px;
background: var(--color-bg-dropdown);
border: 1px solid var(--color-border-card);
color: var(--color-text-primary);
font-size: 12px;
pointer-events: none;
opacity: 0;
transition: opacity 0.15s;
z-index: 20;
}
.itemExpanded:hover .thumbTooltip {
opacity: 1;
}
/* Label at bottom of thumbnail — inside thumbInner */
.thumbLabel {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 2px 4px;
text-align: center;
font-size: 10px;
color: var(--color-on-overlay);
background: linear-gradient(transparent, var(--color-overlay-strong));
opacity: 0;
transition: opacity 0.25s;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
border-radius: 0 0 var(--radius-thumbnail) var(--radius-thumbnail);
}
.itemExpanded .thumbLabel {
opacity: 1;
}
/* Add more button — 3:4 to match thumbnails */
.addMore {
position: relative;
height: var(--thumbnail-size);
aspect-ratio: 3 / 4;
border: 1.5px dashed var(--color-border-modal);
background: rgba(255, 255, 255, 0.03); /* near-match: ~--color-bg-upload (0.04) */
border-radius: var(--radius-btn);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 4px;
cursor: pointer;
flex-shrink: 0;
overflow: visible;
transition:
margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1),
opacity 0.25s,
border-color 0.2s,
background 0.2s;
}
.addMore:hover {
border-color: #5a5a6a; /* unmapped: hover border lighter than --color-border-modal */
background: var(--color-bg-card);
}
.addMoreVisible {
opacity: 1;
pointer-events: auto;
}
/* Tooltip for add-more button */
.addMoreTooltip {
position: absolute;
bottom: calc(100% + 6px);
left: 50%;
transform: translateX(-50%);
white-space: nowrap;
padding: 4px 10px;
border-radius: 6px;
background: var(--color-bg-dropdown);
border: 1px solid var(--color-border-card);
color: var(--color-text-primary);
font-size: 12px;
pointer-events: none;
opacity: 0;
transition: opacity 0.15s;
z-index: 20;
}
.addMore:hover .addMoreTooltip {
opacity: 1;
}
/* "+" badge — positioned relative to .wrapper, left set via inline style */
.countBadge {
position: absolute;
bottom: -6px;
width: 28px;
height: 28px;
border-radius: 50%;
background: var(--color-bg-on-media);
backdrop-filter: blur(4px);
border: 1px solid var(--color-progress-track);
color: var(--color-on-overlay);
font-size: 16px;
font-weight: 400;
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
cursor: pointer;
transition: background 0.15s;
}
.countBadge:hover {
background: var(--color-bg-on-media-hover);
}
/* Tooltip for "+" badge */
.badgeTooltip {
position: absolute;
bottom: calc(100% + 6px);
right: -8px;
white-space: nowrap;
padding: 4px 10px;
border-radius: 6px;
background: var(--color-bg-dropdown);
border: 1px solid var(--color-border-card);
color: var(--color-text-primary);
font-size: 12px;
pointer-events: none;
z-index: 101;
}
/* Audio placeholder icon */
.audioPlaceholder {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: var(--color-bg-dropdown-elevated);
color: var(--color-text-secondary);
}
/* Upload status overlay */
.uploadOverlay {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.5); /* near-match: between --color-modal-overlay (0.6) and lighter overlays */
border-radius: var(--radius-thumbnail);
z-index: 2;
}
.uploadError {
background: rgba(239, 68, 68, 0.25); /* unmapped: danger-text (#ef4444) alpha 0.25 */
cursor: pointer;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.spinner {
animation: spin 1s linear infinite;
}