WuYongJie ff41839238 feat: 实现Apple风格UI系统和产品上传功能
- 完整实现Apple HIG 2025设计系统
- 添加Modal弹窗组件(毛玻璃效果、流畅动画)
- 添加FileUpload文件上传组件(拖拽、批量上传、进度显示)
- 实现产品上传功能(支持DWG/GLB/GLTF文件)
- 优化产品列表展示(可折叠的产品+SKU结构)
- 实现Tab切换功能(3D模型管理、五金件、BOM、文档)
- 修复主题系统hydration错误
- 优化按钮和间距,符合Apple设计规范
- 添加分享页面的Apple风格重设计
- 创建测试数据脚本
2025-12-12 20:16:41 +08:00

618 lines
14 KiB
CSS

@tailwind base;
@tailwind components;
@tailwind utilities;
/* Apple 风格设计系统 CSS 变量 */
:root,
[data-theme="light"] {
/* 字体族 */
--font-family-system: -apple-system, BlinkMacSystemFont, Inter, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--font-family-chinese: -apple-system, BlinkMacSystemFont, Inter, 'Noto Sans CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
--font-family-mono: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
/* 字体尺寸 */
--font-size-xs: 11px;
--font-size-sm: 12px;
--font-size-base: 13px;
--font-size-md: 15px;
--font-size-lg: 16px;
--font-size-xl: 17px;
--font-size-2xl: 20px;
--font-size-3xl: 22px;
--font-size-4xl: 28px;
--font-size-5xl: 34px;
/* 字重 */
--font-weight-regular: 400;
--font-weight-medium: 500;
--font-weight-semibold: 600;
--font-weight-bold: 700;
/* 行高 */
--line-height-tight: 1.2;
--line-height-snug: 1.25;
--line-height-normal: 1.33;
--line-height-relaxed: 1.47;
--line-height-loose: 1.6;
/* Apple 系统颜色 - 浅色模式 */
--color-red: #FF3B30;
--color-orange: #FF9500;
--color-yellow: #FFCC00;
--color-green: #34C759;
--color-mint: #00C7BE;
--color-teal: #5AC8FA;
--color-cyan: #50E3C2;
--color-blue: #007AFF;
--color-indigo: #5856D6;
--color-purple: #AF52DE;
--color-pink: #FF2D92;
--color-brown: #A2845E;
/* 语义化颜色 - 浅色模式 */
--color-background-primary: #FFFFFF;
--color-background-secondary: #F2F2F7;
--color-background-tertiary: #FFFFFF;
--color-label-primary: #000000;
--color-label-secondary: #3C3C43;
--color-label-tertiary: #3C3C4399;
--color-label-quaternary: #3C3C432E;
--color-separator: #3C3C4349;
--color-opaque-separator: #C6C6C8;
--color-link: #007AFF;
--color-placeholder-text: #3C3C4360;
/* Liquid Glass 颜色 - 浅色模式 */
--liquid-glass-standard: rgba(255, 255, 255, 0.72);
--liquid-glass-enhanced: rgba(255, 255, 255, 0.85);
--liquid-glass-subtle: rgba(255, 255, 255, 0.60);
/* 模糊效果 */
--liquid-glass-blur: blur(20px) saturate(180%);
--liquid-glass-blur-subtle: blur(10px) saturate(150%);
--liquid-glass-blur-enhanced: blur(30px) saturate(200%);
/* 间距系统 */
--spacing-0: 0px;
--spacing-1: 4px;
--spacing-2: 8px;
--spacing-3: 12px;
--spacing-4: 16px;
--spacing-5: 20px;
--spacing-6: 24px;
--spacing-8: 32px;
--spacing-10: 40px;
--spacing-12: 48px;
--spacing-16: 64px;
--spacing-20: 80px;
--spacing-24: 96px;
/* 圆角 */
--border-radius-small: 6px;
--border-radius-medium: 10px;
--border-radius-large: 16px;
--border-radius-xlarge: 20px;
--border-radius-full: 9999px;
/* 边框宽度 */
--border-width-thin: 0.5px;
--border-width-normal: 1px;
--border-width-thick: 2px;
/* 触摸目标 */
--touch-target-minimum: 44px;
--touch-target-comfortable: 48px;
--touch-target-large: 56px;
/* 安全区域 */
--safe-area-top: env(safe-area-inset-top, 0px);
--safe-area-right: env(safe-area-inset-right, 0px);
--safe-area-bottom: env(safe-area-inset-bottom, 0px);
--safe-area-left: env(safe-area-inset-left, 0px);
/* 动画时长 */
--animation-duration-instant: 0ms;
--animation-duration-fast: 150ms;
--animation-duration-normal: 250ms;
--animation-duration-slow: 350ms;
--animation-duration-slower: 500ms;
--animation-duration-slowest: 800ms;
/* 缓动函数 */
--animation-easing-ease-out: cubic-bezier(0.25, 0.1, 0.25, 1);
--animation-easing-ease-in: cubic-bezier(0.42, 0, 1, 1);
--animation-easing-ease-in-out: cubic-bezier(0.42, 0, 0.58, 1);
--animation-easing-spring: cubic-bezier(0.5, 1.5, 0.5, 1);
--animation-easing-spring-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
--animation-easing-sharp: cubic-bezier(0.4, 0, 0.6, 1);
--animation-easing-smooth: cubic-bezier(0.4, 0, 0.2, 1);
--animation-easing-linear: linear;
}
/* 深色模式颜色覆盖 */
[data-theme="dark"] {
/* Apple 系统颜色 - 深色模式 */
--color-red: #FF453A;
--color-orange: #FF9F0A;
--color-yellow: #FFD60A;
--color-green: #32D74B;
--color-mint: #63E6E2;
--color-teal: #64D2FF;
--color-cyan: #5DE6FF;
--color-blue: #0A84FF;
--color-indigo: #5E5CE6;
--color-purple: #BF5AF2;
--color-pink: #FF375F;
--color-brown: #AC8E68;
/* 语义化颜色 - 深色模式 */
--color-background-primary: #000000;
--color-background-secondary: #1C1C1E;
--color-background-tertiary: #2C2C2E;
--color-label-primary: #FFFFFF;
--color-label-secondary: #EBEBF5;
--color-label-tertiary: #EBEBF560;
--color-label-quaternary: #EBEBF52E;
--color-separator: #54545899;
--color-opaque-separator: #38383A;
--color-link: #0A84FF;
--color-placeholder-text: #EBEBF54D;
/* Liquid Glass 颜色 - 深色模式 */
--liquid-glass-standard: rgba(22, 22, 23, 0.72);
--liquid-glass-enhanced: rgba(22, 22, 23, 0.85);
--liquid-glass-subtle: rgba(22, 22, 23, 0.60);
}
/* 全局样式重置和基础样式 */
@layer base {
/* HTML 和 body 基础样式 */
html {
scroll-behavior: smooth;
}
body {
background-color: var(--color-background-secondary);
color: var(--color-label-primary);
font-family: var(--font-family-system);
font-feature-settings: 'rlig' 1, 'calt' 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* Apple 风格滚动条样式 */
::-webkit-scrollbar {
@apply w-2 h-2;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, 0.2);
border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
background: rgba(0, 0, 0, 0.3);
}
@media (prefers-color-scheme: dark) {
::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.2);
}
::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.3);
}
}
}
/* Apple 风格组件样式 */
@layer components {
/* 3D 查看器容器 - 保留现有功能,应用 Apple 风格 */
.model-viewer {
@apply relative w-full h-full overflow-hidden;
background: var(--color-background-secondary);
border-radius: 16px; /* Apple 大组件标准圆角 */
}
/* 装配播放器样式 - 应用 Apple 风格 */
.assembly-player {
background: var(--liquid-glass-standard);
backdrop-filter: var(--liquid-glass-blur);
border-radius: 16px;
padding: 24px;
border: 1px solid var(--color-separator);
}
.assembly-player .controls {
@apply flex space-x-3 mb-6;
}
.assembly-player .step-info {
@apply mb-6;
}
.assembly-player .progress {
@apply mb-6;
}
.assembly-player .step-list {
@apply space-y-3;
}
}
/* Apple 风格工具类 */
@layer utilities {
/* 文本截断 */
.text-truncate {
@apply truncate;
}
/* 多行文本截断 */
.text-truncate-2 {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.text-truncate-3 {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
/* Apple 风格 Liquid Glass 效果 */
.liquid-glass {
background: var(--liquid-glass-standard);
backdrop-filter: var(--liquid-glass-blur);
}
.liquid-glass-enhanced {
background: var(--liquid-glass-enhanced);
backdrop-filter: var(--liquid-glass-blur-enhanced);
}
.liquid-glass-subtle {
background: var(--liquid-glass-subtle);
backdrop-filter: var(--liquid-glass-blur-subtle);
}
/* Apple 风格阴影效果 */
.shadow-apple {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
.shadow-apple-md {
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
}
.shadow-apple-lg {
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.10);
}
/* Apple 风格圆角 */
.rounded-apple-sm {
border-radius: 6px; /* 小组件 */
}
.rounded-apple-md {
border-radius: 10px; /* 中等组件 */
}
.rounded-apple-lg {
border-radius: 16px; /* 大组件 */
}
.rounded-apple-xl {
border-radius: 20px; /* 超大组件 */
}
/* 3D 变换效果 */
.transform-3d {
transform-style: preserve-3d;
}
/* 无选择 */
.no-select {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
}
/* 3D 相关样式 */
.three-canvas {
display: block;
width: 100%;
height: 100%;
outline: none;
}
/* 加载状态样式 */
.loading-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(255, 255, 255, 0.9);
display: flex;
align-items: center;
justify-content: center;
z-index: 10;
}
/* 错误状态样式 */
.error-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(255, 255, 255, 0.95);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 10;
color: #dc2626;
}
/* 响应式设计 */
@media (max-width: 768px) {
.assembly-player {
@apply p-2;
}
.assembly-player .controls {
@apply flex-col space-x-0 space-y-2;
}
}
/* 打印样式 */
@media print {
.no-print {
display: none !important;
}
body {
@apply text-black bg-white;
}
}
/* 高对比度模式支持 */
@media (prefers-contrast: high) {
.btn-primary {
@apply border-2 border-blue-800;
}
.input-field {
@apply border-2 border-gray-600;
}
}
/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* 高对比度模式支持 */
.high-contrast {
--color-background-primary-light: #FFFFFF;
--color-background-primary-dark: #000000;
--color-label-primary-light: #000000;
--color-label-primary-dark: #FFFFFF;
--color-blue-light: #0000FF;
--color-blue-dark: #0000FF;
--color-red-light: #FF0000;
--color-red-dark: #FF0000;
--color-green-light: #008000;
--color-green-dark: #008000;
--color-separator-light: #000000;
--color-separator-dark: #FFFFFF;
}
.high-contrast .btn-primary {
border: 2px solid var(--color-label-primary-light) !important;
}
.high-contrast .input-field {
border: 2px solid var(--color-label-primary-light) !important;
}
/* 减少透明度模式支持 */
.reduced-transparency {
--liquid-glass-standard-light: rgba(255, 255, 255, 0.95);
--liquid-glass-standard-dark: rgba(22, 22, 23, 0.95);
--liquid-glass-enhanced-light: rgba(255, 255, 255, 1);
--liquid-glass-enhanced-dark: rgba(22, 22, 23, 1);
--liquid-glass-subtle-light: rgba(255, 255, 255, 0.9);
--liquid-glass-subtle-dark: rgba(22, 22, 23, 0.9);
}
.reduced-transparency .liquid-glass,
.reduced-transparency .liquid-glass-enhanced,
.reduced-transparency .liquid-glass-subtle {
backdrop-filter: none;
}
/* 动态字体大小支持 */
[data-font-size="110"] {
--font-size-xs: 12px;
--font-size-sm: 13px;
--font-size-base: 14px;
--font-size-md: 17px;
--font-size-lg: 18px;
--font-size-xl: 19px;
--font-size-2xl: 22px;
--font-size-3xl: 24px;
--font-size-4xl: 31px;
--font-size-5xl: 37px;
}
[data-font-size="125"] {
--font-size-xs: 14px;
--font-size-sm: 15px;
--font-size-base: 16px;
--font-size-md: 19px;
--font-size-lg: 20px;
--font-size-xl: 21px;
--font-size-2xl: 25px;
--font-size-3xl: 28px;
--font-size-4xl: 35px;
--font-size-5xl: 43px;
}
[data-font-size="150"] {
--font-size-xs: 17px;
--font-size-sm: 18px;
--font-size-base: 20px;
--font-size-md: 23px;
--font-size-lg: 24px;
--font-size-xl: 26px;
--font-size-2xl: 30px;
--font-size-3xl: 33px;
--font-size-4xl: 42px;
--font-size-5xl: 51px;
}
[data-font-size="175"] {
--font-size-xs: 19px;
--font-size-sm: 21px;
--font-size-base: 23px;
--font-size-md: 26px;
--font-size-lg: 28px;
--font-size-xl: 30px;
--font-size-2xl: 35px;
--font-size-3xl: 39px;
--font-size-4xl: 49px;
--font-size-5xl: 60px;
}
[data-font-size="200"] {
--font-size-xs: 22px;
--font-size-sm: 24px;
--font-size-base: 26px;
--font-size-md: 30px;
--font-size-lg: 32px;
--font-size-xl: 34px;
--font-size-2xl: 40px;
--font-size-3xl: 44px;
--font-size-4xl: 56px;
--font-size-5xl: 68px;
}
/* 包容性设计支持 */
.status-indicator {
display: inline-flex;
align-items: center;
justify-content: center;
position: relative;
}
.status-indicator.success {
background-color: var(--color-green-light);
}
.status-indicator.error {
background-color: var(--color-red-light);
}
.status-indicator.warning {
background-color: var(--color-yellow-light);
}
.status-indicator.info {
background-color: var(--color-blue-light);
}
.status-indicator.success::before {
content: '✓';
color: white;
font-weight: bold;
}
.status-indicator.error::before {
content: '✕';
color: white;
font-weight: bold;
}
.status-indicator.warning::before {
content: '!';
color: white;
font-weight: bold;
}
.status-indicator.info::before {
content: 'i';
color: white;
font-weight: bold;
}
/* 形状变化支持(色盲友好) */
.status-indicator.shape-circle {
border-radius: 50%;
}
.status-indicator.shape-triangle {
border-radius: 0;
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
.status-indicator.shape-diamond {
border-radius: 0;
transform: rotate(45deg);
}
.status-indicator.shape-square {
border-radius: 2px;
}
/* 图案支持(色盲友好) */
.status-indicator.pattern-striped {
background-image: repeating-linear-gradient(
45deg,
transparent,
transparent 2px,
rgba(255, 255, 255, 0.3) 2px,
rgba(255, 255, 255, 0.3) 4px
);
}
.status-indicator.pattern-dotted {
background-image: radial-gradient(
circle at 25% 25%,
rgba(255, 255, 255, 0.3) 2px,
transparent 2px
);
background-size: 8px 8px;
}
.status-indicator.pattern-dashed {
background-image: repeating-linear-gradient(
90deg,
transparent,
transparent 4px,
rgba(255, 255, 255, 0.3) 4px,
rgba(255, 255, 255, 0.3) 8px
);
}