/*
 * Qenda 前端样式文件 - 主要样式文件
 * 开发规范：深色毛玻璃(Dark Glassmorphism)风格
 * 安全修改：仅局部调整，保护现有交互，兼容HTML结构
 */

/* --- 全局重置 --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: auto; }

body {
    background: radial-gradient(circle at top center, #1e293b, #0f172a); /* 深空背景 */
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #fff;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

/* CSS 变量定义 */
:root {
    /* 毛玻璃风格变量 */
    --glass-bg: rgba(255, 255, 255, 0.03); /* 极低透明度背景 */
    --glass-border: rgba(255, 255, 255, 0.1); /* 毛玻璃边框 */
    --glass-blur: 16px; /* 毛玻璃模糊度 */
    
    /* 主要强调色 - 科技蓝渐变 */
    --accent-primary: #3b82f6; /* 主科技蓝 */
    --accent-secondary: #2563eb; /* 辅助科技蓝 */
    --accent-tertiary: #60a5fa; /* 悬停科技蓝 */
    
    /* 中性质感色 */
    --neutral-dark: #0f172a; /* 深空色 */
    --neutral-medium: #1e293b; /* 深灰蓝 */
    --neutral-light: #334155; /* 灰色 */
    --neutral-lighter: #475569; /* 浅灰色 */
    
    /* 文字颜色 */
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0; /* 次要文字 */
    --text-tertiary: #94a3b8; /* 微弱文字 */
    --text-muted: #64748b; /* 柔和灰色 */
    
    /* 状态色 */
    --success: #10b981; /* 绿色 */
    --warning: #f59e0b; /* 橙色 */
    --error: #ef4444; /* 红色 */
    
    /* 过渡效果 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 24px; /* 毛玻璃圆角 */
    
    /* 阴影效果 */
    --shadow-light: 0 5px 15px rgba(0, 0, 0, 0.2);
    --shadow-medium: 0 12px 30px rgba(0, 0, 0, 0.25);
    --shadow-heavy: 0 25px 50px -12px rgba(0, 0, 0, 0.5); /* 毛玻璃阴影 */
}

/* SEO隐藏层 */
.seo-content { 
    position: absolute; 
    left: -9999px; 
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden; 
}

/* --- 登录页 (居中布局) --- */
.login-page {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    position: relative;
    z-index: 10;
}
.login-page.hidden { display: none; }

/* --- 登录卡片 (毛玻璃效果) --- */
.login-card, .card {
    background: var(--glass-bg); /* 极低透明度背景 */
    backdrop-filter: blur(var(--glass-blur)); /* 核心：背景模糊 */
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border); /* 微微发光的边框 */
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-heavy);
    padding: 40px;
    width: 100%; max-width: 400px;
    text-align: center;
    transition: transform var(--transition-fast);
    position: relative;
    overflow: hidden;
}

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

/* --- 标题与文字 --- */
h1, .logo-area h1 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.logo-area { 
    margin-bottom: 20px; 
}
.logo-area img {
    width: 84px; height: 84px;
    border-radius: 22px;
    margin-bottom: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.logo-area p, .card-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-bottom: 30px;
}

/* 消息提示 */
.error-msg, .warning-msg, .success-msg {
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    animation: slideDown 0.3s ease-out;
}
@keyframes slideDown { from{transform:translateY(-10px);opacity:0} to{transform:translateY(0);opacity:1} }

.error-msg {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fecaca;
}
.warning-msg {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fed7aa;
}
.success-msg {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}
.error-msg.show, .warning-msg.show, .success-msg.show { display: block; }

/* --- 输入框美化 --- */
.input-group { 
    margin-bottom: 20px; text-align: left; 
}

.input-group.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.input-label {
    display: block; color: var(--text-tertiary); font-size: 12px; font-weight: 700;
    margin-bottom: 10px; margin-left: 6px; text-transform: uppercase;
    letter-spacing: 1px;
}

input[type="text"], input[type="tel"] {
    background: rgba(0, 0, 0, 0.2) !important; /* 深色半透明底 */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-radius: var(--radius-medium);
    height: 50px;
    width: 100%;
    padding: 0 20px;
    font-size: 16px;
    letter-spacing: 1px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

input[type="text"]:focus, input[type="tel"]:focus {
    background: rgba(0, 0, 0, 0.4) !important;
    border-color: var(--accent-primary) !important; /* 聚焦时亮蓝光 */
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    outline: none;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* --- 按钮升级 (流光渐变) --- */
.btn-primary, .btn-submit, .login-btn {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%); /* 科技蓝渐变 */
    border: none;
    border-radius: var(--radius-medium);
    height: 50px;
    width: 100%;
    font-weight: 600;
    font-size: 16px;
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    margin-bottom: 20px;
}

.btn-primary:hover, .login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, var(--accent-tertiary) 0%, var(--accent-primary) 100%);
}

.btn-primary:active, .login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled { 
    opacity: 0.6; 
    cursor: not-allowed; 
}
.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
}
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { 
    opacity: 0.6; 
    cursor: not-allowed; 
    transform: translateZ(50px);
    box-shadow: none;
}

/* --- 底部链接 --- */
a {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #fff;
    text-decoration: underline;
}

.help-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 20px;
}

/* 备案号 (底部) */
.footer-icp {
    position: absolute; bottom: 20px; width: 100%; text-align: center;
    opacity: 0.25; font-size: 12px; z-index: 5;
    transition: opacity 0.3s;
}
.footer-icp a { color: #fff; text-decoration: none; }
.footer-icp:hover { opacity: 0.8; }

/* --- 弹窗样式 --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: none; justify-content: center; align-items: center;
    z-index: 9999; padding: 20px;
}
.modal-overlay.show { 
    display: flex; 
    animation: fadeIn 0.3s forwards; 
}

.modal-content {
    background: var(--glass-bg); /* 毛玻璃效果 */
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-heavy);
    border-radius: var(--radius-large);
    padding: 30px 25px;
    width: fit-content;
    min-width: 320px;
    max-width: 90%;
    text-align: left;
    position: relative;
    animation: popIn var(--transition-slow);
    max-height: 95vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-content::-webkit-scrollbar {
    display: none;
}

.modal-title {
    text-align: center; margin-bottom: 20px;
    font-size: 22px; font-weight: 800;
    color: var(--text-primary);
}
.modal-title span { margin-right: 10px; font-size: 26px; vertical-align: middle; -webkit-text-fill-color: initial; }

.compare-box {
    background: rgba(25, 42, 65, 0.5);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.bad-title { color: #ef5350; font-weight: 800; margin-bottom: 8px; display: flex; align-items: center; }
.bad-list { list-style: none; color: #8892b0; margin-bottom: 10px; }
.bad-list li { margin-bottom: 8px; position: relative; padding-left: 20px; }
.bad-list li::before { content: "✕"; color: #ef5350; position: absolute; left: 0; font-weight: 800; }

.divider { height: 1px; background: rgba(255,255,255,0.08); margin: 15px 0; }

.good-title { color: #66bb6a; font-weight: 800; margin-bottom: 8px; display: flex; align-items: center; }
.good-list { list-style: none; color: #ccd6f6; }
.good-list li { margin-bottom: 8px; position: relative; padding-left: 20px; }
.good-list li::before { content: "✓"; color: #66bb6a; position: absolute; left: 0; font-weight: 900; }
.highlight { color: #ffca28; font-weight: 700; }

.scan-area { text-align: center; margin-top: 10px; }
.scan-head { font-size: 16px; color: #fff; margin-bottom: 15px; font-weight: 700; }
.scan-tag { color: var(--accent-primary); text-shadow: 0 0 10px rgba(212, 175, 55, 0.3); }

.qr-img {
    width: 140px; height: 140px;
    border-radius: 14px;
    border: 3px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    margin-bottom: 10px;
    transition: transform 0.3s;
}
.qr-img:hover { transform: scale(1.05); }

.scan-note { color: #8892b0; font-size: 12px; line-height: 1.8; }
.scan-note strong { color: var(--accent-primary); display: block; margin-bottom: 6px; font-size: 14px; }

.close-btn, .modal-close {
    width: 100%; background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.05); 
    padding: 12px; margin-top: 15px;
    border-radius: 12px; color: #aaa; 
    cursor: pointer; transition: all 0.3s;
    font-weight: 600;
}
.close-btn:hover, .modal-close:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* 复制助手样式 */
.copy-methods { text-align: left; }
.copy-method {
    margin-bottom: 25px; padding: 20px;
    background: rgba(212, 175, 55, 0.05);
    border-radius: 16px; border: 1px solid rgba(212, 175, 55, 0.15);
}
.copy-method h4 { color: var(--text-tertiary); margin-bottom: 15px; font-size: 15px; font-weight: 700; }
.copy-method textarea {
    width: 100%; height: 100px; padding: 15px;
    background: rgba(25, 42, 65, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px; color: var(--text-primary);
    resize: none; margin: 12px 0;
    font-family: inherit; font-size: 14px;
    transition: all 0.3s;
}
.copy-method textarea:focus { outline: none; border-color: var(--accent-primary); background: var(--primary-bg); }
.copy-method .btn {
    width: 100%; padding: 14px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border: none; border-radius: 12px;
    color: #fff; cursor: pointer; font-size: 15px; font-weight: 700;
    transition: all 0.3s;
}
.copy-method .btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3); }

.shortcut-tips { background: rgba(212, 175, 55, 0.08); padding: 18px; border-radius: 12px; margin: 12px 0; border: 1px solid rgba(212, 175, 55, 0.1); }
.shortcut-tips p { margin: 8px 0; font-size: 14px; color: var(--text-tertiary); }
.shortcut-tips strong { color: var(--accent-primary); font-weight: 700; margin-right: 10px; }

/* --- APP容器 --- */
.app-page { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; }
.app-page.show { display: block; }

.loading-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at top center, #1e293b, #0f172a); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 100;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; transition: opacity 0.8s ease; }
.loading-spinner {
    width: 60px; height: 60px;
    border: 5px solid rgba(59, 130, 246, 0.15);
    border-top-color: var(--accent-primary); border-radius: 50%;
    animation: spin 1s var(--transition-normal) infinite;
    margin-bottom: 25px;
}
.loading-text { color: var(--text-tertiary); font-size: 16px; font-weight: 500; letter-spacing: 1px; }

.app-iframe { width: 100%; height: 100%; border: none; }

.float-btns {
    position: fixed; bottom: 30px; right: 30px;
    display: none; flex-direction: column; gap: 12px; z-index: 1000;
    opacity: 0.5; transition: all 0.4s;
}
.float-btns:hover { opacity: 1; transform: translateY(-5px); }
.float-btn {
    width: 48px; height: 48px; border-radius: 16px; border: none; cursor: pointer;
    font-size: 20px; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4); transition: all 0.3s;
}
.float-btn:hover { transform: scale(1.1) rotate(5deg); }
.btn-logout { background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)); color: #fff; }

.online-indicator {
    position: absolute; top: -4px; right: -4px;
    width: 14px; height: 14px; background: #4caf50;
    border: 2.5px solid #fff; border-radius: 50%;
    animation: pulse 2s infinite;
}

/* 动画 */
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes popIn { from{transform:scale(0.92) translateY(20px);opacity:0} to{transform:scale(1) translateY(0);opacity:1} }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(76,175,80,0.7)} 70%{box-shadow:0 0 0 10px rgba(76,175,80,0)} 100%{box-shadow:0 0 0 0 rgba(76,175,80,0)} }

/* 响应式 */
@media (max-width: 480px) {
    .login-card { padding: 45px 30px; width: 92%; }
    .logo-area h1 { font-size: 28px; }
    .float-btns { bottom: 20px; right: 20px; }
    .float-btn { width: 44px; height: 44px; border-radius: 14px; }
}

/* 横屏设备支持 */
@media screen and (orientation: landscape) {
    .login-card {
        max-width: 600px;
        width: 80%;
        padding: 45px 35px;
    }
    
    .login-page {
        perspective: 1500px;
    }
    
    /* 针对移动设备的横屏优化 */
    @media (max-width: 768px) {
        .login-card {
            width: 90%;
            max-width: 500px;
            padding: 30px 25px;
        }
        
        .input-group {
            margin-bottom: 15px;
        }
        
        input[type="text"], input[type="tel"] {
            height: 45px;
            padding: 0 15px;
            font-size: 14px;
        }
        
        .login-btn {
            height: 45px;
            font-size: 14px;
        }
    }
}

/* 横屏且小屏幕设备 */
@media screen and (min-width: 481px) and (max-width: 768px) and (orientation: landscape) {
    .login-card {
        width: 70%;
        max-width: 500px;
    }
}

/* 针对小屏幕移动设备的横屏优化 */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .login-card {
        width: 95% !important;
        max-width: 600px;
        padding: 25px 20px;
    }
    
    .input-label {
        font-size: 10px;
        margin-bottom: 6px;
    }
    
    input[type="text"], input[type="tel"] {
        height: 40px;
        padding: 0 12px;
        font-size: 14px;
        letter-spacing: 0.5px;
    }
    
    .login-btn {
        height: 45px;
        font-size: 15px;
    }
    
    .help-links {
        gap: 15px;
    }
    
    .help-links a {
        font-size: 12px;
    }
}
