/* ====================
   全局样式与重置
==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

html, body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}

/* ====================
   毛玻璃主容器
==================== */
.glass-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ====================
   头部样式
==================== */
.glass-header {
    text-align: center;
    padding: 20px 15px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-header h1 {
    color: white;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.stats-live {
    display: flex;
    justify-content: center;
    color: white;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.stats-live span {
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 30px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: inline-block;
}

.stats-live strong {
    color: #ffd700;
    font-size: 1.5em;
    margin-left: 8px;
    margin-right: 3px;
}

/* ====================
   主卡片
==================== */
.glass-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.glass-card {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 40px;
    padding: clamp(25px, 6vw, 40px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
}

/* 号码显示区域 */
.number-display {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: clamp(30px, 8vw, 50px);
    text-align: center;
    margin-bottom: 30px;
    border: 2px dashed rgba(255, 255, 255, 0.5);
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-all;
}

.number-display .placeholder {
    color: rgba(255, 255, 255, 0.8);
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.number-display.has-number {
    background: rgba(255, 215, 0, 0.25);
    border: 2px solid rgba(255, 215, 0, 0.6);
    font-size: clamp(1.3rem, 5vw, 2rem);
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Turnstile 容器 */
.turnstile-container {
    margin: 20px 0;
    display: none; /* 默认隐藏 */
    justify-content: center;
    min-height: 70px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 5px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 确保Turnstile小部件在毛玻璃上可见 */
.turnstile-container iframe {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 验证状态 */
.verify-status {
    text-align: center;
    font-size: 0.9rem;
    margin: 10px 0;
    padding: 5px;
    border-radius: 20px;
    color: white;
}

.verify-status.success {
    background: rgba(76, 175, 80, 0.3);
    border: 1px solid #4caf50;
}

.verify-status.error {
    background: rgba(244, 67, 54, 0.3);
    border: 1px solid #f44336;
}

/* 按钮区域 */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.glass-btn {
    flex: 1;
    min-width: 140px;
    padding: 15px 20px;
    border: none;
    border-radius: 50px;
    font-size: clamp(1rem, 4vw, 1.2rem);
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-btn.primary {
    background: rgba(255, 215, 0, 0.25);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.glass-btn.primary:hover:not(:disabled) {
    background: rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

.glass-btn.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(128, 128, 128, 0.3);
}

.glass-btn.secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.glass-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1.3em;
}

/* 加载状态 */
.glass-btn.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.glass-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ====================
   浮动历史按钮
==================== */
.history-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 60px;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 100;
    color: white;
    font-weight: bold;
}

.history-float-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.history-icon {
    font-size: 1.5rem;
}

.history-text {
    font-size: 1rem;
}

.history-badge {
    background: #ff4757;
    color: white;
    border-radius: 50px;
    padding: 2px 8px;
    font-size: 0.8rem;
    min-width: 24px;
    text-align: center;
}

/* ====================
   历史记录弹窗
==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.modal-header h3 {
    font-size: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px 25px;
    max-height: calc(80vh - 100px);
    overflow-y: auto;
}

.history-list {
    list-style: none;
}

.history-list li {
    padding: 12px 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    border-radius: 15px;
    color: white;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    word-break: break-all;
    transition: all 0.3s ease;
}

.history-list li:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(5px);
}

/* ====================
   响应式调整
==================== */
@media (max-width: 768px) {
    .glass-container {
        padding: 10px;
    }
    
    .glass-header {
        padding: 15px 10px;
        margin-bottom: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .glass-btn {
        width: 100%;
    }
    
    .history-float-btn {
        bottom: 20px;
        right: 20px;
        padding: 15px;
        border-radius: 50px;
    }
    
    .history-text {
        display: none;
    }
    
    .history-icon {
        font-size: 1.8rem;
    }
    
    .modal-content {
        width: 95%;
        max-height: 70vh;
    }
    
    .stats-live span {
        padding: 10px 25px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .number-display {
        min-height: 150px;
    }
    
    .stats-live strong {
        font-size: 1.3em;
    }
}