/* 全局通用样式 */

/* CSS变量定义 */
:root {
    /* --primary-color: #2563EB;      
    --primary-light: #3B82F6;      
    --primary-dark: #1D4ED8;       
    --secondary-color: #06B6D4;    
    --accent-color: #8B5CF6;        */

    --primary-color: #109AF1;      
    --primary-light: #22D4CE;      
    --primary-dark: #81D4FA;       
    --secondary-color: #4FC3F7;    
    --accent-color: #2482FE;  


    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-dark: #2C3E50;
    --border-color: #E9ECEF;
    --success-color: #28A745;
    --warning-color: #FFC107;
    --danger-color: #DC3545;
    --info-color: #17A2B8;
}

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    position: relative;
    /* 禁用缩放功能 */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 背景图片：2026 子页使用 ghdt-page-bg；首页使用 hero 背景 */
body.ghdt-page::before,
body.home-page::before {
    display: none !important;
}

body:not(.ghdt-page):not(.home-page)::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/common/bg-default.jpg');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: -1;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

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

.loading-spinner p {
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* 微信环境提示 */
.wechat-tip {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.wechat-tip-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    max-width: 300px;
    margin: 0 1rem;
}

.wechat-tip-content i {
    font-size: 3rem;
    color: var(--warning-color);
    margin-bottom: 1rem;
}

.wechat-tip-content p {
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* 微信扫码登录 */
.wechat-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.wechat-login-content {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    margin: 0 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.5s ease-out;
}

.login-header {
    margin-bottom: 2rem;
}

.login-header h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.qr-code-container {
    margin: 2rem 0;
}

.qr-code {
    max-width: 200px;
    height: auto;
}

.login-status {
    margin: 1rem 0;
}

.login-status p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-actions {
    margin-top: 1.5rem;
}

/* 页面头部通用样式 */
.page-header {
    background: transparent;
    color: var(--text-primary);
    padding: 0.75rem 0;
    position: relative;
    overflow: visible;
    min-height: 60px;
}

.page-header::before { content: none; }

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.header-title {
    flex: 1;
    text-align: center;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.header-title .subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

.back-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--primary-color);
    border-radius: 20px;
    padding: 8px 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.header-actions { display: none; }

.header-actions .btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header-actions .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.header-actions .btn i {
    font-size: 1.2rem;
}

/* 答题卡按钮样式 */
.answer-sheet-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 20px;
    padding: 8px 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-sheet-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.answer-sheet-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.answer-sheet-btn i {
    font-size: 1.2rem;
}

/* 首页顶部按钮样式 */
.hero-top-actions .btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 20px;
    padding: 8px 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-left: 8px;
}

.hero-top-actions .btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-top-actions .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.hero-top-actions .btn i {
    font-size: 1.1rem;
}

/* 按钮样式 */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary {
    background-color: #ffffff;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 卡片样式 */
.card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* 进度条样式 */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: var(--bg-secondary);
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-title h1 {
        font-size: 1.25rem;
    }
    
    .header-title .subtitle {
        font-size: 0.8rem;
    }
    
    .wechat-login-content {
        padding: 2rem;
        margin: 0 0.5rem;
    }
}

/* 动画效果 */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* 工具类 */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* 隐藏类 */
.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

/* 间距工具类 */
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }
