/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 星空背景动画 */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.stars, .stars2, .stars3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.stars {
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #ddd, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: zoom 20s infinite linear;
}

.stars2 {
    background-image: 
        radial-gradient(1px 1px at 40px 60px, #fff, transparent),
        radial-gradient(1px 1px at 120px 10px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 160px 90px, #eee, transparent);
    background-repeat: repeat;
    background-size: 300px 150px;
    animation: zoom 30s infinite linear;
}

.stars3 {
    background-image: 
        radial-gradient(1px 1px at 10px 10px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 150px 150px, rgba(255,255,255,0.5), transparent);
    background-repeat: repeat;
    background-size: 400px 200px;
    animation: zoom 40s infinite linear;
}

@keyframes zoom {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* 主容器 */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* 顶部标题 */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.title {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    color: #f8f9fa;
    text-shadow: 0 0 20px rgba(100, 200, 255, 0.5);
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.title-decoration {
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4cc9f0, transparent);
    margin: 0 auto;
    position: relative;
}

.title-decoration::before,
.title-decoration::after {
    content: '✦';
    position: absolute;
    top: -8px;
    color: #4cc9f0;
    font-size: 16px;
    animation: twinkle 2s infinite alternate;
}

.title-decoration::before {
    left: -20px;
}

.title-decoration::after {
    right: -20px;
}

@keyframes twinkle {
    0% { opacity: 0.5; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

/* 主功能卡片 */
.main-card {
    width: 80%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 200, 255, 0.3);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 100, 150, 0.2);
    position: relative;
    overflow: hidden;
}

.main-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 表单样式 */
.form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 选项区域 */
.option-section {
    margin-bottom: 8px;
}

.section-title {
    color: #e9ecef;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 16px;
    text-align: center;
}

.radio-group {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(100, 200, 255, 0.5);
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #4cc9f0;
    box-shadow: 0 0 15px rgba(76, 201, 240, 0.5);
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: #4cc9f0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: radioGlow 0.3s ease;
}

@keyframes radioGlow {
    0% { transform: translate(-50%, -50%) scale(0); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.radio-text {
    color: #e9ecef;
    font-weight: 400;
    user-select: none;
}

/* 输入框区域 */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    color: #adb5bd;
    font-size: 0.95rem;
    font-weight: 400;
}

.card-input {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    color: #333;
    transition: all 0.3s ease;
    text-align: center;
    letter-spacing: 1px;
}

.card-input:focus {
    outline: none;
    border-color: #4cc9f0;
    box-shadow: 0 0 15px rgba(76, 201, 240, 0.3);
    background: rgba(255, 255, 255, 0.95);
}

.card-input.error {
    border-color: #ff6b6b;
    animation: shake 0.5s ease-in-out;
}

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

/* 激活按钮 */
.activate-btn {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px 28px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.activate-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

.activate-btn:active {
    transform: scale(0.98);
}

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 右下角浮动Logo */
.floating-logo {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
}

.cursor-logo {
    width: 60px;
    height: 60px;
    position: relative;
    animation: float 3s ease-in-out infinite;
}

.cursor-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4cc9f0, #3a0ca3);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px rgba(76, 201, 240, 0.5);
}

.cursor-icon::before {
    content: '⚡';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 20px;
}

.star-orbit {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(76, 201, 240, 0.3);
    border-radius: 50%;
    animation: rotate 4s linear infinite;
}

.star-orbit::before {
    content: '✦';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    color: #4cc9f0;
    font-size: 12px;
}

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

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

/* 底部版权 */
.footer {
    position: absolute;
    bottom: 20px;
    text-align: center;
    width: 100%;
}

.footer p {
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 300;
}

/* Toast通知 */
.toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 200, 255, 0.3);
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 8px 32px rgba(0, 100, 150, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
}

.toast-icon {
    font-size: 20px;
    margin-top: 2px;
}

.toast.success .toast-icon::before {
    content: '✓';
    color: #28a745;
}

.toast.error .toast-icon::before {
    content: '✗';
    color: #dc3545;
}

.toast-text {
    flex: 1;
}

.toast-message {
    color: #333;
    font-weight: 500;
    display: block;
    margin-bottom: 10px;
}

.toast-card-info {
    background: rgba(248, 249, 250, 0.8);
    border: 1px solid rgba(76, 201, 240, 0.3);
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
}

.card-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Poppins', monospace;
}

.card-display label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.new-card-text {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 6px 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #333;
    letter-spacing: 1px;
    flex: 1;
    user-select: all;
}

.copy-btn {
    background: #4cc9f0;
    border: none;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #3a9bc1;
    transform: scale(1.1);
}

.copy-btn:active {
    transform: scale(0.95);
}

.toast-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid rgba(76, 201, 240, 0.2);
}

.toast-confirm-btn {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}

.toast-confirm-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: left 0.5s;
}

.toast-confirm-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

.toast-confirm-btn:hover::before {
    left: 100%;
}

.toast-confirm-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.toast-confirm-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.3);
}

/* 错误状态下的确认按钮样式 */
.toast.error .toast-confirm-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.toast.error .toast-confirm-btn:hover {
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

.toast.error .toast-confirm-btn:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3);
}



/* 加载动画覆盖层 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 32, 39, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.spinner-ring {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(76, 201, 240, 0.3);
    border-top: 4px solid #4cc9f0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-text {
    color: #f8f9fa;
    font-size: 1.1rem;
    font-weight: 500;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }

    .main-card {
        width: 95%;
        padding: 24px;
    }

    .radio-group {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .activate-btn {
        padding: 16px 32px;
        font-size: 1.2rem;
    }

    .floating-logo {
        bottom: 20px;
        right: 20px;
    }

    .cursor-logo {
        width: 50px;
        height: 50px;
    }

    .cursor-icon {
        width: 35px;
        height: 35px;
    }
}
