/* ===== 基础样式 ===== */
:root {
    /* DeepSeek色彩风格 */
    --color-primary: #10a37f;
    --color-primary-dark: #0d8c6c;
    --color-primary-light: #e6f7f3;

    /* 中性色 */
    --color-surface: #ffffff;
    --color-background: #f9fafb;
    --color-border: #e5e7eb;
    --color-border-light: #f1f5f9;

    /* 文本色 */
    --color-text-primary: #1f2937;
    --color-text-secondary: #6b7280;
    --color-text-tertiary: #9ca3af;

    /* 功能色 */
    --color-error: #ef4444;
    --color-success: #10a37f;
    --color-warning: #f59e0b;

    /* 间距系统 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;

    /* 动画时间 */
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 350ms;

    /* 曲线切割路径 */
    --curve-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 减少动效支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== 网格布局系统 ===== */
.register-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl);
    min-height: calc(100vh - 80px);
    align-items: center;
}

@media (min-width: 1024px) {
    .register-grid {
        grid-template-columns: 1fr 1.2fr;
        gap: var(--space-2xl);
    }

    /* 非对称分栏：左侧稍窄，右侧稍宽 */
    .content-section {
        padding-right: var(--space-2xl);
    }
}

/* ===== 左侧内容区 ===== */
.content-section {
    animation: fadeSlideUp var(--duration-slow) ease-out;
}

/* 超大标题设计 */
.mega-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
    color: var(--color-text-primary);
}

.text-gradient {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2xl);
    font-weight: 400;
}

.accent-number {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
    font-weight: 500;
    color: var(--color-primary);
    margin: 0 var(--space-xs);
}

/* 设计原则卡片（模块化设计） */
.design-principles {
    display: grid;
    gap: var(--space-lg);
    margin-top: var(--space-2xl);
}

.principle-card {
    padding: var(--space-lg);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    transition: all var(--duration-normal) ease;
    position: relative;
    overflow: hidden;
}

.principle-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
}

.principle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(16, 163, 127, 0.15);
    border-color: var(--color-primary-light);
}

.principle-icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
    color: var(--color-primary);
}

.principle-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--color-text-primary);
}

.principle-card p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* ===== 右侧表单区 ===== */
.form-section {
    position: relative;
    animation: fadeSlideUp var(--duration-slow) ease-out 100ms both;
}

/* 曲线切割容器 */
.form-section::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-primary-light) 100%);
    clip-path: var(--curve-path);
    z-index: -1;
    opacity: 0.8;
}

.register-form {
    background: var(--color-surface);
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
    box-shadow:
        0 20px 40px -16px rgba(0, 0, 0, 0.08),
        0 1px 0 0 var(--color-border-light) inset;
    border: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}

/* 细微纹理背景 */
.register-form::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(16, 163, 127, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(16, 163, 127, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* 表单头部 */
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    position: relative;
    z-index: 1;
}

.form-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.step {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: 'SF Mono', Monaco, monospace;
    background: var(--color-background);
    color: var(--color-text-tertiary);
    transition: all var(--duration-normal) ease;
}

.step.active {
    background: var(--color-primary);
    color: white;
}

.step-line {
    width: 20px;
    height: 1px;
    background: var(--color-border);
}

/* 表单网格布局 */
.form-grid {
    display: grid;
    gap: var(--space-lg);
    position: relative;
    z-index: 1;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* 表单字段样式 */
.form-group {
    position: relative;
}

.form-group.stacked {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.field-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: var(--space-xs);
}

.label-text {
    font-variation-settings: 'wght' 500;
}

.required-marker {
    color: var(--color-error);
    font-size: 0.75em;
}

.optional-marker {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    font-weight: 400;
    margin-left: auto;
}

/* 输入容器 */
.input-container {
    position: relative;
    background: var(--color-background);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    transition: all var(--duration-normal) ease;
    overflow: hidden;
}

.input-container:focus-within {
    border-color: var(--color-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.input-container input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    color: var(--color-text-primary);
    outline: none;
    transition: all var(--duration-normal) ease;
    font-variation-settings: 'wght' 400;
}

.input-container input::placeholder {
    color: var(--color-text-tertiary);
    font-weight: 300;
}

.input-status {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border);
    transition: all var(--duration-fast) ease;
}

.input-container:focus-within .input-status {
    background: var(--color-primary);
}

/* 密码强度指示器 */
.password-strength {
    margin-top: var(--space-sm);
}

.strength-bar {
    height: 3px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-xs);
    position: relative;
}

.strength-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: var(--color-error);
    transition: all var(--duration-normal) ease;
}

input[data-strength-meter="true"]:valid~.password-strength .strength-bar::after {
    background: var(--color-warning);
    width: 60%;
}

input[data-strength-meter="true"]:valid:not(:placeholder-shown):not(:focus)~.password-strength .strength-bar::after {
    background: var(--color-success);
    width: 100%;
}

.strength-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
}

.strength-labels span {
    transition: color var(--duration-normal) ease;
}

.strength-labels span[data-strength] {
    color: var(--color-text-tertiary);
}

/* 密码切换按钮 */
.password-toggle {
    position: absolute;
    right: var(--space-lg);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-tertiary);
    cursor: pointer;
    padding: var(--space-xs);
    font-size: 0.875rem;
    opacity: 0.6;
    transition: all var(--duration-fast) ease;
    z-index: 2;
}

.password-toggle:hover {
    opacity: 1;
    color: var(--color-primary);
}

/* 错误状态 */
.error {
    font-size: 0.75rem;
    color: var(--color-error);
    margin-top: var(--space-xs);
    min-height: 1rem;
    transition: all var(--duration-fast) ease;
    opacity: 0;
    transform: translateY(-4px);
}

.error:not(:empty) {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 提交按钮 ===== */
.submit-button {
    position: relative;
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-normal) ease;
    margin-top: var(--space-xl);
    overflow: hidden;
    z-index: 1;
}

.submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--duration-slow) ease;
    z-index: -1;
}

.submit-button:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -8px rgba(16, 163, 127, 0.4);
}

.submit-button:hover::before {
    left: 100%;
}

.submit-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px -4px rgba(16, 163, 127, 0.3);
}

.submit-button:disabled {
    background: var(--color-text-tertiary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.submit-button:disabled::before {
    display: none;
}

.button-text {
    transition: opacity var(--duration-fast) ease;
}

.submit-button.loading .button-text {
    opacity: 0;
}

.button-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0;
    transition: opacity var(--duration-fast) ease;
}

.submit-button.loading .button-loader {
    opacity: 1;
}

/* ===== 表单底部 ===== */
.form-footer {
    margin-top: var(--space-xl);
    text-align: center;
    border-top: 1px solid var(--color-border-light);
    padding-top: var(--space-lg);
}

.login-link {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.legal-note {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    line-height: 1.4;
}

.link-underline {
    color: var(--color-primary);
    text-decoration: none;
    position: relative;
    font-weight: 500;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-primary);
    transform: scaleX(0);
    transition: transform var(--duration-normal) ease;
}

.link-underline:hover::after {
    transform: scaleX(1);
}

.link-minimal {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--color-border);
    text-underline-offset: 2px;
    transition: all var(--duration-fast) ease;
}

.link-minimal:hover {
    color: var(--color-primary);
    text-decoration-color: var(--color-primary);
}

/* ===== 成功状态 ===== */
.success-state {
    text-align: center;
    padding: var(--space-2xl);
    animation: fadeSlideUp var(--duration-normal) ease-out;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: var(--color-success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 auto var(--space-lg);
    animation: scaleIn var(--duration-slow) ease-out;
}

.success-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--color-text-primary);
}

.success-state p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
}

.progress-bar {
    height: 3px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    overflow: hidden;
    max-width: 200px;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    background: var(--color-success);
    width: 0%;
    animation: progressFill 3s linear forwards;
}

/* ===== 动画定义 ===== */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes progressFill {
    to {
        width: 100%;
    }
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .register-grid {
        padding: var(--space-md);
        gap: var(--space-xl);
    }

    .register-form {
        padding: var(--space-xl) var(--space-lg);
    }

    .mega-title {
        font-size: clamp(2.5rem, 6vw, 3.5rem);
    }
}

@media (max-width: 480px) {
    .register-grid {
        padding: var(--space-sm);
    }

    .register-form {
        padding: var(--space-lg) var(--space-md);
    }

    .content-section {
        padding-right: 0;
    }

    .principle-card {
        padding: var(--space-md);
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --color-border: #1f2937;
        --color-text-secondary: #1f2937;
    }

    .input-container {
        border-width: 2px;
    }
}

/* 深色模式支持（可选） */
@media (prefers-color-scheme: dark) {
    :root {
        --color-surface: #1f2937;
        --color-background: #111827;
        --color-border: #374151;
        --color-border-light: #374151;
        --color-text-primary: #f9fafb;
        --color-text-secondary: #d1d5db;
        --color-text-tertiary: #9ca3af;
    }

    .register-form::after {
        opacity: 0.3;
    }
}