/* common.css */

:root {
    /* 基础颜色 */
    --bg-dark: #0f172a;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --text-main: #f1f5f9;
    --text-sub: #94a3b8;
    
    /* 玻璃拟态 */
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-bg-hover: rgba(30, 41, 59, 0.9);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-hover-border: rgba(56, 189, 248, 0.5);
    --input-bg: rgba(2, 6, 23, 0.6);
    
    /* 状态颜色 */
    --success: #10b981;
    --danger: #f87171;
    
    /* 透明度白色系列 */
    --white-alpha-03: rgba(255, 255, 255, 0.03);
    --white-alpha-05: rgba(255, 255, 255, 0.05);
    --white-alpha-08: rgba(255, 255, 255, 0.08);
    --white-alpha-1: rgba(255, 255, 255, 0.1);
    --white-alpha-2: rgba(255, 255, 255, 0.2);
    --white-alpha-3: rgba(255, 255, 255, 0.3);
    --white-alpha-4: rgba(255, 255, 255, 0.4);
    --white-alpha-5: rgba(255, 255, 255, 0.5);
    
    /* 间距 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 2.5rem;
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    --radius-pill: 50px;
    
    /* 阴影 */
    --shadow-sm: 0 10px 25px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 20px 40px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.3);
    
    /* 倒计时颜色 */
    --countdown-color: #facc15;
}

body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 70%);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* user-select: none;  根据具体页面需求，部分页面可能需要移除此属性 */
}

/* 全局无衬线字体继承 */
*, *::before, *::after {
    font-family: inherit;
}

input, button, select, textarea {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

/* 通用动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 复制提示弹窗 (Toast) */
#toast {
    visibility: hidden;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    min-width: 180px;
    text-align: center;
    border-radius: 50px;
    padding: 12px 24px;
    position: fixed;
    z-index: 100;
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#toast.show {
    visibility: visible;
    opacity: 1;
    top: 60px;
}

/* 玻璃拟态卡片通用类 (可选，用于减少重复) */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
}

/* 触摸反馈类 - 用于移动端交互反馈 */
.touch-feedback {
    transition: transform 0.15s ease, background-color 0.15s ease;
    position: relative;
    overflow: hidden;
}

.touch-feedback:active {
    transform: scale(0.96);
}

/* 涟漪效果 */
.touch-feedback::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
}

.touch-feedback.touched::after {
    width: 200px;
    height: 200px;
    opacity: 0;
}

/* 加载状态 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}
