/* =====================================================
   快三游戏 - 主样式文件
   =====================================================*/

/* CSS Variables - 主题配置 */
:root {
    /* 主色调 - 渐变紫蓝（更现代） */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-light: #9f7aea;
    --primary-dark: #553c9a;
    --primary: #667eea;
    --success: #22c55e;
    
    /* 强调色 - 更柔和的霓虹效果 */
    --accent-cyan: #00d9ff;
    --accent-pink: #ff6b9d;
    --accent-gold: #ffc947;
    --accent-green: #00ff88;
    
    /* 背景色 - 更深的背景，更好的对比度 */
    --bg-dark: #0a0a1a;
    --bg-dark-light: #141428;
    --bg-card: rgba(20, 20, 45, 0.95);
    --bg-card-hover: rgba(30, 30, 70, 0.98);
    --bg-input: rgba(255, 255, 255, 0.08);
    
    /* 文字色 - 更好的可读性 */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.5);
    
    /* 边框 - 更明显的边框 */
    --border-color: rgba(255, 255, 255, 0.15);
    --border-glow: rgba(102, 126, 234, 0.6);
    
    /* 阴影 - 更立体的阴影 */
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(102, 126, 234, 0.4);
    --shadow-neon: 0 0 20px var(--accent-cyan), 0 0 40px var(--accent-cyan);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    
    /* 圆角 - 更统一的圆角 */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    /* 动画 - 更流畅的动画 */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 字体 */
    --font-main: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Orbitron', monospace;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

button {
    font-family: inherit;
    border: none;
    cursor: pointer;
    background: none;
}

input {
    font-family: inherit;
    border: none;
    outline: none;
    background: none;
}

/* =====================================================
   动态背景
   =====================================================*/
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* 浮动骰子 */
.floating-dice {
    position: absolute;
    font-size: 3rem;
    opacity: 0.08;
    animation: floatDice 20s infinite ease-in-out;
    filter: blur(1px);
}

.dice-1 { top: 10%; left: 5%; animation-delay: 0s; }
.dice-2 { top: 20%; right: 10%; animation-delay: -3s; font-size: 2.5rem; }
.dice-3 { top: 50%; left: 15%; animation-delay: -6s; font-size: 4rem; }
.dice-4 { top: 70%; right: 5%; animation-delay: -9s; }
.dice-5 { bottom: 20%; left: 8%; animation-delay: -12s; font-size: 3.5rem; }
.dice-6 { bottom: 10%; right: 15%; animation-delay: -15s; font-size: 2rem; }

@keyframes floatDice {
    0%, 100% { 
        transform: translateY(0) rotate(0deg); 
    }
    25% { 
        transform: translateY(-30px) rotate(90deg); 
    }
    50% { 
        transform: translateY(-10px) rotate(180deg); 
    }
    75% { 
        transform: translateY(-40px) rotate(270deg); 
    }
}

/* 发光球体 */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: orbFloat 15s infinite ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    opacity: 0.15;
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-cyan);
    opacity: 0.1;
    bottom: -5%;
    right: -5%;
    animation-delay: -5s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: var(--accent-pink);
    opacity: 0.08;
    top: 40%;
    right: 20%;
    animation-delay: -10s;
}

@keyframes orbFloat {
    0%, 100% { 
        transform: translate(0, 0) scale(1); 
    }
    33% { 
        transform: translate(30px, -30px) scale(1.1); 
    }
    66% { 
        transform: translate(-20px, 20px) scale(0.9); 
    }
}

/* =====================================================
   认证页面样式 (登录/注册)
   =====================================================*/
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: 
        radial-gradient(ellipse at top left, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
        var(--bg-dark);
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft), var(--shadow-glow);
    animation: cardAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.register-card {
    max-width: 450px;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo 区域 */
.logo-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    animation: logoFloat 3s infinite ease-in-out;
}

.dice-icon {
    font-size: 3rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.auth-logo-img {
    width: 100px;
    height: auto;
    max-height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.4));
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.logo-text {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, var(--accent-cyan) 50%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.logo-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
}

/* 表单样式 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    position: relative;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.1rem;
    z-index: 1;
    transition: var(--transition-fast);
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-normal);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.input-wrapper input:focus + .input-focus-border {
    opacity: 1;
    transform: scaleX(1);
}

.input-focus-border {
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 2px;
    opacity: 0;
    transform: scaleX(0);
    transition: var(--transition-normal);
}

.toggle-password {
    position: absolute;
    right: 1rem;
    padding: 0.5rem;
    opacity: 0.5;
    transition: var(--transition-fast);
}

.toggle-password:hover {
    opacity: 1;
}

/* 表单选项 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.remember-me input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.remember-me input:checked + .checkmark {
    background: var(--primary-gradient);
    border-color: transparent;
}

.remember-me input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 0.75rem;
}

.forgot-password,
.terms-link {
    color: var(--primary-light);
}

.forgot-password:hover,
.terms-link:hover {
    color: var(--accent-cyan);
    text-decoration: underline;
}

/* 按钮样式 */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.125rem 2rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    /* 移动端优化 */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    cursor: pointer;
    min-height: 48px; /* 确保可点击区域足够大 */
}

.btn::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: var(--transition-slow);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-login,
.btn-register {
    margin-top: 0.5rem;
}

.btn-demo {
    margin-top: 0.5rem;
}

/* 加载状态 */
.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .btn-loader {
    display: block;
}

.btn-loader {
    display: none;
    position: absolute;
    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;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 底部链接 */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.register-link {
    color: var(--accent-cyan);
    font-weight: 600;
}

.register-link:hover {
    text-shadow: 0 0 10px var(--accent-cyan);
}

/* 装饰圆环 */
.decorations {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
}

.decoration-ring {
    position: absolute;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    opacity: 0.3;
}

.ring-1 {
    width: 500px;
    height: 500px;
    top: -250px;
    left: -250px;
    animation: ringPulse 4s infinite ease-in-out;
}

.ring-2 {
    width: 600px;
    height: 600px;
    top: -300px;
    left: -300px;
    animation: ringPulse 4s infinite ease-in-out 1s;
}

@keyframes ringPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.3;
    }
    50% { 
        transform: scale(1.05);
        opacity: 0.15;
    }
}

/* =====================================================
   响应式设计
   =====================================================*/
@media (max-width: 480px) {
    .auth-page {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
    }
    
    .logo-icon {
        width: 60px;
        height: 60px;
    }
    
    .dice-icon {
        font-size: 2rem;
    }
    
    .logo-text {
        font-size: 2rem;
    }
    
    .form-options {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
}

/* =====================================================
   工具类
   =====================================================*/
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glow-text {
    text-shadow: 0 0 10px currentColor;
}

.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
