/* ========================================
   卡密验证系统 — 暗色科技风 + 毛玻璃主题
   ======================================== */

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

:root {
    --bg-deep: #0a0e17;
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a8;
    --accent-1: #6366f1;
    --accent-2: #a855f7;
    --accent-3: #06b6d4;
    --glow: rgba(99, 102, 241, 0.3);
    --danger: #ef4444;
    --success: #22c55e;
    --radius: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', 'SF Pro Display', system-ui, -apple-system, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-deep);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

/* --- Gradient Orbs --- */
.bg-orbs {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-orbs::before,
.bg-orbs::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: orbDrift 20s ease-in-out infinite;
}

.bg-orbs::before {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-1), transparent 70%);
    top: -10%;
    left: -10%;
}

.bg-orbs::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-2), transparent 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -10s;
}

@keyframes orbDrift {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(40px, -30px) scale(1.15);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    75% {
        transform: translate(30px, 10px) scale(1.1);
    }
}

/* --- Particle Canvas --- */
#particleCanvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* --- Main Container --- */
.page-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

/* --- Glass Card --- */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 40px 36px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    animation: cardEnter 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Heading --- */
.glass-card h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent-3), var(--accent-1), var(--accent-2));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.glass-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 32px;
}

/* --- Icon --- */
.glass-card .icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.glass-card .icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 0 24px var(--glow);
}

/* --- Input --- */
.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.input-field {
    position: relative;
}

.input-field input {
    width: 100%;
    padding: 14px 16px;
    padding-right: 48px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

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

/* 屏蔽浏览器自带的密码可见按钮 */
.input-field input[type="password"]::-ms-reveal,
.input-field input[type="password"]::-ms-clear {
    display: none;
}

.input-field input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px var(--glow);
    background: rgba(255, 255, 255, 0.06);
}

/* --- Password Toggle --- */
.pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    transition: var(--transition);
    z-index: 2;
}

.pw-toggle:hover {
    color: var(--text-primary);
}

/* --- Button --- */
.btn-glow {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    box-shadow: 0 4px 16px var(--glow);
    transition: var(--transition);
    letter-spacing: 0.01em;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 40%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 60%);
    transform: translateX(-100%) rotate(0deg);
    transition: transform 0.6s ease;
}

.btn-glow:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--glow);
}

.btn-glow:hover::after {
    transform: translateX(100%) rotate(0deg);
}

.btn-glow:active {
    transform: translateY(0) scale(0.98);
}

.btn-glow:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* --- Loading Spinner --- */
.btn-glow.loading {
    pointer-events: none;
}

.btn-glow .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

.btn-glow.loading .spinner {
    display: inline-block;
}

.btn-glow.loading .btn-text {
    display: inline;
}

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

/* --- Toast Notification --- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(15, 15, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    animation: toastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    min-width: 280px;
    max-width: 400px;
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

.toast-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.info .toast-icon {
    color: var(--accent-3);
}

.toast-body {
    flex: 1;
}

.toast-body .toast-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.toast-body .toast-msg {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px;
    flex-shrink: 0;
    transition: var(--transition);
}

.toast-close:hover {
    color: var(--text-primary);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(120%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(120%);
    }
}

/* --- Info Card (download page) --- */
.info-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 32px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: cardEnter 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    text-align: center;
}

.info-card .success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
    box-shadow: 0 0 24px rgba(34, 197, 94, 0.3);
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%,
    100% {
        box-shadow: 0 0 24px rgba(34, 197, 94, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(34, 197, 94, 0.5);
    }
}

.info-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.info-card .info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row .info-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.info-row .info-value {
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', monospace;
    letter-spacing: 0.02em;
    color: var(--accent-3);
    cursor: pointer;
    transition: var(--transition);
}

.info-row .info-value:hover {
    color: var(--accent-1);
}

.info-card .btn-glow {
    margin-top: 24px;
}

/* --- Error Message --- */
.error-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: var(--danger);
    text-align: center;
    margin-bottom: 20px;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-6px);
    }
    75% {
        transform: translateX(6px);
    }
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .page-wrapper {
        padding: 12px;
    }

    .glass-card {
        padding: 28px 20px;
    }

    .glass-card h1 {
        font-size: 1.4rem;
    }

    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}