/* =========================================
   1. 全局变量与基础设置
   ========================================= */
:root {
    --primary-color: #4f46e5; 
    --primary-hover: #4338ca;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    --bg-overlay: rgba(255, 255, 255, 0.92);
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow-x: hidden; /* 防止横向滚动 */
    min-height: 86vh;
    background-color: #f3f4f6;
    padding-bottom: 50px; /* 为底部黑色备案条留出空间 */
}

/* =========================================
   2. 动态流体背景
   ========================================= */
.bg-fixed {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    background: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    background-size: 200% 200%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* =========================================
   3. 玻璃拟态登录卡片
   ========================================= */
.glass-card {
    background: var(--bg-overlay);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    border-radius: 16px;
    padding: 40px 30px;
    width: 100%;
    max-width: 400px;
    position: relative; 
    overflow: hidden; 
    transition: all 0.3s ease;
    margin-bottom: 60px; /* 防止卡片与底部备案条重叠 */
}

.icon-box {
    width: 64px; height: 64px;
    background: var(--primary-gradient) !important;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

/* =========================================
   4. 右上角切换角标 (三角形效果)
   ========================================= */
.corner-switch {
    position: absolute;
    top: 0; right: 0;
    width: 64px; height: 64px;
    cursor: pointer;
    z-index: 10;
}

.corner-switch::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 0; height: 0;
    border-top: 64px solid var(--primary-color);
    border-left: 64px solid transparent;
    transition: border-top-color 0.3s;
}

.corner-switch:hover::before {
    border-top-color: var(--primary-hover);
}

.corner-switch i {
    position: absolute;
    top: 10px; right: 10px;
    color: #fff;
    font-size: 24px;
    z-index: 11;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}

.corner-switch:hover i {
    transform: scale(1.1);
}

/* 提示气泡 */
.corner-tip {
    position: absolute;
    top: 15px; right: 70px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}
.corner-tip::after {
    content: '';
    position: absolute;
    right: -4px; top: 50%;
    transform: translateY(-50%);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 4px solid rgba(0, 0, 0, 0.8);
}
.corner-switch:hover + .corner-tip {
    opacity: 1; visibility: visible; transform: translateX(0);
}

/* =========================================
   5. 表单样式
   ========================================= */
.input-group {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}
.input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.input-group-text { background: #fff; border: none; color: #9ca3af; padding-left: 15px; }
.form-control { border: none; padding: 12px; font-size: 14px; color: #333; }
.form-control:focus { box-shadow: none; }

.btn-primary {
    background: var(--primary-gradient);
    border: none; padding: 10px; font-size: 16px;
    transition: all 0.3s;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}
.btn-primary:disabled { background: #a5a6f6; cursor: not-allowed; }

/* =========================================
   6. 微信二维码区域
   ========================================= */
.qr-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    width: 180px;
    height: 180px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.qr-container img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}

/* 手动刷新文字 */
.refresh-text {
    color: var(--primary-color);
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 12px;
    display: inline-block;
    transition: all 0.2s;
    user-select: none;
}
.refresh-text:hover {
    color: var(--primary-hover);
    text-decoration: underline;
    transform: translateY(-1px);
}

/* 过期遮罩 */
.expired-mask {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    cursor: pointer; z-index: 5;
}

/* =========================================
   7. 底部备案号 (黑底白字版)
   ========================================= */
.beian-footer {
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    background-color: #000000; /* 纯黑背景 */
    padding: 10px 0;
    text-align: center;
    z-index: 100;
    font-size: 12px;
}

.beian-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    color: #ffffff; /* 纯白文字 */
}

.beian-footer a {
    color: #ffffff;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.beian-footer a:hover {
    color: #ffffff;
    opacity: 1;
    text-decoration: underline;
}

.beian-footer span {
    color: #ffffff;
    opacity: 0.5;
}

@media (max-height: 500px) {
    .beian-footer { display: none; }
}

/* =========================================
   8. 动画
   ========================================= */
.fade-in { animation: fadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards; opacity: 0; transform: translateY(20px); }
.fade-in-fast { animation: fadeInFast 0.3s ease forwards; }

@keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInFast { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }