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

:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --accent: #f5576c;
    --gold: #ffd700;
    --gold-dark: #f0a500;
    --success: #43e97b;
    --bg-deep: #070b1a;
    --bg-mid: #0f1638;
    --bg-card: rgba(255,255,255,0.04);
    --border: rgba(255,255,255,0.08);
    --text: #e8eaf6;
    --text-dim: rgba(255,255,255,0.45);
    --text-mid: rgba(255,255,255,0.7);
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0,0,0,0.3);
    --glow-primary: 0 0 20px rgba(102,126,234,0.3);
    --glow-gold: 0 0 24px rgba(255,215,0,0.35);
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ========== Animated Background ========== */
.bg-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-scene::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background:
        radial-gradient(ellipse 600px 600px at 20% 30%, rgba(102,126,234,0.12) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 80% 60%, rgba(118,75,162,0.10) 0%, transparent 70%),
        radial-gradient(ellipse 400px 400px at 50% 80%, rgba(245,87,108,0.06) 0%, transparent 70%);
    animation: bgDrift 30s ease-in-out infinite alternate;
}

@keyframes bgDrift {
    0%   { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-40px, -30px) rotate(2deg); }
}

/* Floating particles */
.bg-particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.bg-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.25s;
}

.btn:hover::after {
    opacity: 1;
}

.btn:active {
    transform: scale(0.97);
}

.btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 16px rgba(102,126,234,0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(102,126,234,0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #f5576c, #ff6b6b);
    color: #fff;
    box-shadow: 0 4px 16px rgba(245,87,108,0.25);
}

.btn-danger:hover {
    box-shadow: 0 6px 24px rgba(245,87,108,0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    color: #0f1638;
    box-shadow: 0 4px 16px rgba(67,233,123,0.25);
}

.btn-warning {
    background: linear-gradient(135deg, #f6d365, #fda085);
    color: #0f1638;
    box-shadow: 0 4px 16px rgba(246,211,101,0.25);
}

.btn-ghost {
    background: rgba(255,255,255,0.06);
    color: var(--text-mid);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-lg {
    padding: 16px 44px;
    font-size: 18px;
    border-radius: 12px;
}

.btn-xl {
    padding: 18px 56px;
    font-size: 22px;
    border-radius: 14px;
    font-weight: 700;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}

/* ========== Inputs ========== */
.input-field {
    background: rgba(255,255,255,0.06);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 18px;
    color: #fff;
    font-size: 15px;
    width: 100%;
    outline: none;
    transition: all 0.25s;
    font-family: inherit;
}

.input-field::placeholder {
    color: rgba(255,255,255,0.3);
}

.input-field:focus {
    border-color: var(--primary);
    background: rgba(102,126,234,0.06);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.input-field-lg {
    padding: 16px 20px;
    font-size: 17px;
    border-radius: 12px;
}

input, textarea, select {
    background: rgba(255,255,255,0.06);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 18px;
    color: #fff;
    font-size: 15px;
    width: 100%;
    outline: none;
    transition: all 0.25s;
    font-family: inherit;
}

input::placeholder, textarea::placeholder {
    color: rgba(255,255,255,0.3);
}

input:focus, textarea:focus {
    border-color: var(--primary);
    background: rgba(102,126,234,0.06);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

/* ========== Cards ========== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.card-glow {
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* ========== Typography ========== */
.text-gold {
    color: var(--gold);
}

.text-glow {
    text-shadow: 0 0 12px rgba(255,215,0,0.4);
}

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

.text-gradient-gold {
    background: linear-gradient(135deg, var(--gold), #ff6b6b, var(--gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========== Animations ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.02); }
}

.fade-in {
    animation: fadeIn 0.5s cubic-bezier(.4,0,.2,1) both;
}

.fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(.4,0,.2,1) both;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }

/* ========== Decorations ========== */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 20px 0;
}

.icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.icon-circle-primary {
    background: rgba(102,126,234,0.15);
    color: var(--primary);
}

.icon-circle-gold {
    background: rgba(255,215,0,0.15);
    color: var(--gold);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-primary { background: rgba(102,126,234,0.15); color: var(--primary); }
.badge-danger  { background: rgba(245,87,108,0.15); color: var(--accent); }
.badge-gold    { background: rgba(255,215,0,0.15); color: var(--gold); }
.badge-success { background: rgba(67,233,123,0.15); color: var(--success); }
.badge-dim     { background: rgba(255,255,255,0.06); color: var(--text-dim); }

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}
