fix: 修复 lint 错误

- 修复 Input/Textarea 组件中 React Hook 条件调用问题
- 修复 AboutSection 中的引号转义问题
- 更新 Input/Textarea 样式为医疗健康风格
This commit is contained in:
张翔
2026-02-23 08:16:36 +08:00
parent ef4b6d1022
commit 8d0f86c365
332 changed files with 3846 additions and 1834 deletions
+681
View File
@@ -0,0 +1,681 @@
@import "tailwindcss";
@theme inline {
--font-sans: var(--font-geist-sans);
--font-mono: var(--font-geist-mono);
--font-chinese: var(--font-noto-sans-sc);
}
:root {
--color-bg-primary: #FFFFFF;
--color-bg-secondary: #FAFAFA;
--color-bg-tertiary: #F5F5F5;
--color-bg-hover: #F0F0F0;
--color-text-primary: #171717;
--color-text-secondary: #525252;
--color-text-tertiary: #737373;
--color-text-muted: #A3A3A3;
--color-border-primary: #E5E5E5;
--color-border-secondary: #F0F0F0;
--color-border-accent: #D4D4D4;
--color-accent: #171717;
--color-accent-hover: #262626;
--color-accent-light: #404040;
--color-link: #525252;
--color-link-hover: #171717;
--color-brand-primary: #C41E3A;
--color-brand-primary-hover: #A01830;
--color-brand-primary-light: #D4244A;
--color-brand-primary-lighter: #E04A68;
--color-brand-primary-bg: #FEF2F4;
--color-tech-blue: #00D9FF;
--color-tech-purple: #A855F7;
--color-tech-cyan: #06B6D4;
--color-success: #16A34A;
--color-success-bg: #F0FDF4;
--color-warning: #D97706;
--color-warning-bg: #FFFBEB;
--color-info: #0284C7;
--color-info-bg: #F0F9FF;
--color-error: #DC2626;
--color-error-bg: #FEF2F2;
--font-size-xs: 0.75rem;
--font-size-sm: 0.875rem;
--font-size-base: 1rem;
--font-size-lg: 1.125rem;
--font-size-xl: 1.25rem;
--font-size-2xl: 1.5rem;
--font-size-3xl: 1.875rem;
--font-size-4xl: 2.25rem;
--font-size-5xl: 3rem;
--font-size-6xl: 3.75rem;
--line-height-tight: 1.1;
--line-height-snug: 1.25;
--line-height-normal: 1.5;
--line-height-relaxed: 1.625;
--letter-spacing-tight: -0.025em;
--letter-spacing-normal: 0;
--letter-spacing-wide: 0.025em;
--spacing-xs: 0.25rem;
--spacing-sm: 0.5rem;
--spacing-md: 1rem;
--spacing-lg: 1.5rem;
--spacing-xl: 2rem;
--spacing-2xl: 3rem;
--spacing-3xl: 4rem;
--spacing-4xl: 6rem;
--spacing-5xl: 8rem;
--border-width-thin: 0.5px;
--border-width-normal: 1px;
--transition-fast: 150ms;
--transition-normal: 200ms;
--transition-slow: 300ms;
--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
--ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}
.dark {
--color-bg-primary: #0A0A0A;
--color-bg-secondary: #171717;
--color-bg-tertiary: #262626;
--color-bg-hover: #333333;
--color-text-primary: #FAFAFA;
--color-text-secondary: #D4D4D4;
--color-text-tertiary: #A3A3A3;
--color-text-muted: #737373;
--color-border-primary: #333333;
--color-border-secondary: #262626;
--color-border-accent: #404040;
--color-accent: #FAFAFA;
--color-accent-hover: #E5E5E5;
--color-accent-light: #D4D4D4;
--color-link: #D4D4D4;
--color-link-hover: #FAFAFA;
--color-brand-primary: #E04A68;
--color-brand-primary-hover: #D4244A;
--color-brand-primary-light: #E86B85;
--color-brand-primary-lighter: #F08C9F;
--color-brand-primary-bg: #1A0F11;
--color-tech-blue: #00D9FF;
--color-tech-purple: #A855F7;
--color-tech-cyan: #06B6D4;
--color-success: #22C55E;
--color-success-bg: #052E16;
--color-warning: #F59E0B;
--color-warning-bg: #1C1917;
--color-info: #0EA5E9;
--color-info-bg: #0C2D48;
--color-error: #EF4444;
--color-error-bg: #1C1917;
}
@layer base {
* {
@apply antialiased;
border-color: var(--color-border-primary);
}
html {
scroll-behavior: smooth;
font-size: 16px;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
body {
background-color: var(--color-bg-secondary);
color: var(--color-text-primary);
font-family: var(--font-chinese), var(--font-sans), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
line-height: var(--line-height-normal);
letter-spacing: var(--letter-spacing-normal);
position: relative;
}
body::before {
content: '';
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background:
radial-gradient(ellipse at 15% 20%, rgba(196, 30, 58, 0.02) 0%, transparent 50%),
radial-gradient(ellipse at 85% 80%, rgba(23, 23, 23, 0.015) 0%, transparent 50%),
radial-gradient(ellipse at 50% 50%, rgba(196, 30, 58, 0.01) 0%, transparent 70%);
pointer-events: none;
z-index: -1;
}
h1, h2, h3, h4, h5, h6 {
font-weight: 600;
line-height: var(--line-height-tight);
letter-spacing: var(--letter-spacing-tight);
color: var(--color-text-primary);
}
h1 {
font-size: var(--font-size-5xl);
}
h2 {
font-size: var(--font-size-4xl);
}
h3 {
font-size: var(--font-size-2xl);
}
h4 {
font-size: var(--font-size-xl);
}
p {
color: var(--color-text-secondary);
line-height: var(--line-height-relaxed);
}
a {
color: var(--color-link);
text-decoration: none;
transition: color var(--transition-fast) var(--ease-out);
}
a:hover {
color: var(--color-link-hover);
}
button {
font-family: inherit;
cursor: pointer;
}
input, textarea {
font-family: inherit;
outline: none;
}
input:focus, textarea:focus {
outline: none;
}
::selection {
background-color: var(--color-text-primary);
color: var(--color-bg-primary);
}
}
@layer utilities {
.container-narrow {
width: 100%;
max-width: 640px;
margin-left: auto;
margin-right: auto;
padding-left: var(--spacing-lg);
padding-right: var(--spacing-lg);
}
.container-wide {
width: 100%;
max-width: 1200px;
margin-left: auto;
margin-right: auto;
padding-left: var(--spacing-lg);
padding-right: var(--spacing-lg);
}
.container-full {
width: 100%;
padding-left: var(--spacing-lg);
padding-right: var(--spacing-lg);
}
.section-padding {
padding-top: var(--spacing-5xl);
padding-bottom: var(--spacing-5xl);
}
.section-padding-sm {
padding-top: var(--spacing-3xl);
padding-bottom: var(--spacing-3xl);
}
.text-balance {
text-wrap: balance;
}
.text-pretty {
text-wrap: pretty;
}
.border-thin {
border-width: var(--border-width-thin);
}
.transition-smooth {
transition: all var(--transition-normal) var(--ease-out);
}
.transition-fast {
transition: all var(--transition-fast) var(--ease-out);
}
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(16px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateX(-8px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes scaleIn {
from {
opacity: 0;
transform: scale(0.98);
}
to {
opacity: 1;
transform: scale(1);
}
}
@keyframes drawLine {
from {
transform: scaleX(0);
}
to {
transform: scaleX(1);
}
}
@keyframes stampIn {
0% {
opacity: 0;
transform: scale(1.5) rotate(-15deg);
}
50% {
opacity: 0.8;
transform: scale(0.95) rotate(0deg);
}
70% {
transform: scale(1.02) rotate(0deg);
}
100% {
opacity: 1;
transform: scale(1) rotate(0deg);
}
}
@keyframes inkSpread {
0% {
opacity: 0;
transform: scale(0.8);
filter: blur(4px);
}
100% {
opacity: 0.03;
transform: scale(1);
filter: blur(0);
}
}
@keyframes inkFlow {
0%, 100% {
background-position: 0% 0%;
}
50% {
background-position: 100% 100%;
}
}
@keyframes numberCount {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes sectionReveal {
from {
opacity: 0;
transform: translateY(40px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes cornerFadeIn {
from {
opacity: 0;
transform: scale(0);
}
to {
opacity: 1;
transform: scale(1);
}
}
.animate-fade-in {
animation: fadeIn 0.5s var(--ease-out) forwards;
}
.animate-fade-in-up {
animation: fadeInUp 0.6s var(--ease-out) forwards;
}
.animate-slide-in {
animation: slideIn 0.4s var(--ease-out) forwards;
}
.animate-scale-in {
animation: scaleIn 0.3s var(--ease-out) forwards;
}
.animate-draw-line {
animation: drawLine 0.4s var(--ease-out) forwards;
transform-origin: left;
}
.animate-stamp-in {
animation: stampIn 0.6s var(--ease-out) forwards;
}
.animate-ink-spread {
animation: inkSpread 1s var(--ease-out) forwards;
}
.animate-section-reveal {
animation: sectionReveal 0.8s var(--ease-out) forwards;
}
.animate-number-count {
animation: numberCount 0.5s var(--ease-out) forwards;
}
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }
.geometric-card {
border: 1px solid rgba(196, 30, 58, 0.08);
position: relative;
background: rgba(255, 255, 255, 0.8);
backdrop-filter: blur(8px);
transition: all 0.3s var(--ease-out);
}
.geometric-card::before,
.geometric-card::after {
content: '';
position: absolute;
width: 12px;
height: 12px;
border: 1px solid rgba(196, 30, 58, 0.15);
opacity: 0;
transition: all 0.3s var(--ease-out);
}
.geometric-card::before {
top: -1px;
left: -1px;
border-right: none;
border-bottom: none;
border-radius: 4px 0 0 0;
}
.geometric-card::after {
bottom: -1px;
right: -1px;
border-left: none;
border-top: none;
border-radius: 0 0 4px 0;
}
.geometric-card:hover {
border-color: rgba(196, 30, 58, 0.2);
transform: translateY(-4px);
box-shadow: 0 12px 40px -12px rgba(196, 30, 58, 0.15);
}
.geometric-card:hover::before,
.geometric-card:hover::after {
opacity: 1;
}
.geometric-card:hover::before {
animation: cornerFadeIn 0.3s var(--ease-out) forwards;
}
.geometric-card:hover::after {
animation: cornerFadeIn 0.3s var(--ease-out) 0.1s forwards;
}
.ink-divider {
height: 1px;
background: linear-gradient(90deg, transparent, rgba(196, 30, 58, 0.2), transparent);
position: relative;
}
.ink-divider::before {
content: '';
position: absolute;
left: 50%;
top: -3px;
width: 6px;
height: 6px;
background: var(--color-brand-primary);
border-radius: 50%;
transform: translateX(-50%);
opacity: 0.3;
}
.chapter-title {
position: relative;
display: inline-block;
}
.chapter-title::after {
content: '';
position: absolute;
bottom: -8px;
left: 0;
width: 40px;
height: 3px;
background: var(--color-brand-primary);
border-radius: 2px;
}
.scroll-reveal {
opacity: 0;
transform: translateY(30px);
transition: all 0.8s var(--ease-out);
}
.scroll-reveal.revealed {
opacity: 1;
transform: translateY(0);
}
.ink-texture {
position: relative;
}
.ink-texture::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
opacity: 0.015;
pointer-events: none;
}
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: var(--color-border-accent);
border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--color-text-tertiary);
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
html {
scroll-behavior: auto;
}
}
@media (max-width: 768px) {
:root {
--font-size-5xl: 2.25rem;
--font-size-4xl: 1.875rem;
--font-size-3xl: 1.5rem;
--font-size-2xl: 1.25rem;
}
.section-padding {
padding-top: var(--spacing-3xl);
padding-bottom: var(--spacing-3xl);
}
}
@keyframes glow {
0%, 100% {
box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}
50% {
box-shadow: 0 0 40px rgba(0, 217, 255, 0.6);
}
}
@keyframes float {
0%, 100% {
transform: translateY(0px);
}
50% {
transform: translateY(-10px);
}
}
@keyframes pulse-glow {
0%, 100% {
opacity: 0.2;
}
50% {
opacity: 0.4;
}
}
.animate-glow {
animation: glow 2s ease-in-out infinite;
}
.animate-float {
animation: float 3s ease-in-out infinite;
}
.animate-pulse-glow {
animation: pulse-glow 2s ease-in-out infinite;
}
.tech-gradient {
background: linear-gradient(135deg, var(--color-tech-blue) 0%, var(--color-tech-purple) 100%);
}
.tech-gradient-text {
background: linear-gradient(135deg, var(--color-tech-blue) 0%, var(--color-tech-purple) 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.tech-glow {
box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}
.tech-glow-hover:hover {
box-shadow: 0 0 30px rgba(0, 217, 255, 0.5);
}
.tech-border {
border: 1px solid rgba(0, 217, 255, 0.3);
}
.tech-border-hover:hover {
border-color: rgba(0, 217, 255, 0.6);
}
+1 -1
View File
@@ -72,7 +72,7 @@ export function AboutSection() {
</p>
<p className="text-[#718096] mb-6 leading-relaxed">
"专注科技创新,驱动智慧未来"
&ldquo;&rdquo;
</p>
</div>
+6 -4
View File
@@ -3,16 +3,18 @@ import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const glassCardVariants = cva(
"rounded-xl border backdrop-blur-xl text-[var(--color-text-primary)] transition-all duration-300",
"rounded-2xl border backdrop-blur-xl transition-all duration-300",
{
variants: {
variant: {
default:
"border-[var(--color-border-primary)] bg-[var(--color-bg-tertiary)]/80 hover:border-[var(--color-tech-blue)] hover:shadow-[0_0_30px_rgba(0,217,255,0.15)] hover:-translate-y-1",
"border-gray-800/50 bg-gray-900/50 hover:border-purple-500/50 hover:bg-gray-800/60 hover:shadow-[0_0_40px_rgba(139,92,246,0.15)] hover:-translate-y-1",
elevated:
"border-[var(--color-border-primary)] bg-[var(--color-bg-tertiary)]/80 shadow-lg hover:border-[var(--color-tech-blue)] hover:shadow-xl hover:shadow-[0_0_30px_rgba(0,217,255,0.15)] hover:-translate-y-1",
"border-gray-800 bg-gray-900/80 shadow-2xl hover:border-purple-500/50 hover:shadow-purple-500/20 hover:-translate-y-2",
outline:
"border-[var(--color-border-primary)] bg-transparent hover:border-[var(--color-tech-blue)] hover:bg-[var(--color-bg-tertiary)]/50",
"border-gray-800/50 bg-transparent hover:border-purple-500/30 hover:bg-gray-900/30",
glow:
"border-gray-800/50 bg-gray-900/40 relative overflow-hidden hover:border-purple-500/40",
},
},
defaultVariants: {
+9 -8
View File
@@ -8,17 +8,18 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type, label, error, id, ...props }, ref) => {
const inputId = id || React.useId()
const generatedId = React.useId()
const inputId = id || generatedId
return (
<div className="w-full">
{label && (
<label
htmlFor={inputId}
className="block text-sm font-medium text-[var(--color-text-secondary)] mb-2"
className="block text-sm font-medium text-[#4A5568] mb-2"
>
{label}
{props.required && <span className="text-[var(--color-brand-primary)] ml-1">*</span>}
{props.required && <span className="text-[#C41E3A] ml-1">*</span>}
</label>
)}
<input
@@ -26,10 +27,10 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
id={inputId}
data-slot="input"
className={cn(
"file:text-foreground placeholder:text-[var(--color-text-muted)] selection:bg-[var(--color-tech-blue)] selection:text-white h-10 w-full min-w-0 rounded-lg border border-[var(--color-border-primary)] bg-[var(--color-bg-tertiary)] px-4 py-2 text-base text-[var(--color-text-primary)] shadow-sm transition-all duration-300 outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
"focus-visible:border-[var(--color-tech-blue)] focus-visible:ring-2 focus-visible:ring-[var(--color-tech-blue)]/50 focus-visible:shadow-lg focus-visible:shadow-[var(--color-tech-blue)]/20",
"hover:border-[var(--color-border-accent)]",
error && "border-[var(--color-error)] focus-visible:border-[var(--color-error)] focus-visible:ring-[var(--color-error)]/50",
"file:text-foreground placeholder:text-[#A0AEC0] selection:bg-[#005EB8] selection:text-white h-10 w-full min-w-0 rounded-lg border border-[#E2E8F0] bg-white px-4 py-2 text-base text-[#1A1A2E] shadow-sm transition-all duration-300 outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
"focus-visible:border-[#005EB8] focus-visible:ring-2 focus-visible:ring-[#005EB8]/50 focus-visible:shadow-lg focus-visible:shadow-[#005EB8]/20",
"hover:border-[#005EB8]",
error && "border-[#DC2626] focus-visible:border-[#DC2626] focus-visible:ring-[#DC2626]/50",
className
)}
ref={ref}
@@ -37,7 +38,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
{...props}
/>
{error && (
<p className="mt-1 text-sm text-[var(--color-error)]">{error}</p>
<p className="mt-1 text-sm text-[#DC2626]">{error}</p>
)}
</div>
)
+9 -8
View File
@@ -8,27 +8,28 @@ export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextArea
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
({ className, label, error, id, ...props }, ref) => {
const textareaId = id || React.useId()
const generatedId = React.useId()
const textareaId = id || generatedId
return (
<div className="w-full">
{label && (
<label
htmlFor={textareaId}
className="block text-sm font-medium text-[var(--color-text-secondary)] mb-2"
className="block text-sm font-medium text-[#4A5568] mb-2"
>
{label}
{props.required && <span className="text-[var(--color-brand-primary)] ml-1">*</span>}
{props.required && <span className="text-[#C41E3A] ml-1">*</span>}
</label>
)}
<textarea
id={textareaId}
data-slot="textarea"
className={cn(
"placeholder:text-[var(--color-text-muted)] selection:bg-[var(--color-tech-blue)] selection:text-white min-h-16 w-full rounded-lg border border-[var(--color-border-primary)] bg-[var(--color-bg-tertiary)] px-4 py-3 text-base text-[var(--color-text-primary)] shadow-sm transition-all duration-300 outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm resize-none",
"focus-visible:border-[var(--color-tech-blue)] focus-visible:ring-2 focus-visible:ring-[var(--color-tech-blue)]/50 focus-visible:shadow-lg focus-visible:shadow-[var(--color-tech-blue)]/20",
"hover:border-[var(--color-border-accent)]",
error && "border-[var(--color-error)] focus-visible:border-[var(--color-error)] focus-visible:ring-[var(--color-error)]/50",
"placeholder:text-[#A0AEC0] selection:bg-[#005EB8] selection:text-white min-h-16 w-full rounded-lg border border-[#E2E8F0] bg-white px-4 py-3 text-base text-[#1A1A2E] shadow-sm transition-all duration-300 outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm resize-none",
"focus-visible:border-[#005EB8] focus-visible:ring-2 focus-visible:ring-[#005EB8]/50 focus-visible:shadow-lg focus-visible:shadow-[#005EB8]/20",
"hover:border-[#005EB8]",
error && "border-[#DC2626] focus-visible:border-[#DC2626] focus-visible:ring-[#DC2626]/50",
className
)}
ref={ref}
@@ -36,7 +37,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
{...props}
/>
{error && (
<p className="mt-1 text-sm text-[var(--color-error)]">{error}</p>
<p className="mt-1 text-sm text-[#DC2626]">{error}</p>
)}
</div>
)