/* ========================================
   前台样式 - 首页 & 用户端共享
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* 动态背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 200, 255, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* 浮动粒子效果 */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float 15s infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

.container {
    max-width: 520px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* 头部Logo区域 */
.logo-section {
    text-align: center;
    padding: 30px 0;
}
.logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.logo-icon i {
    font-size: 36px;
    color: #fff;
}
.logo-icon.logo-custom {
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}
.logo-icon.logo-custom img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 16px;
}
.logo-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.logo-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

/* 统计信息 */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
}
.stat-item {
    text-align: center;
}
.stat-num {
    font-size: 24px;
    font-weight: 700;
    color: #4facfe;
    text-shadow: 0 0 20px rgba(79, 172, 254, 0.5);
}
.stat-label {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}

/* 主卡片 */
.main-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* 标签页 */
.tab-container {
    display: flex;
    background: #f8f9fa;
}
.tab-btn {
    flex: 1;
    padding: 18px 15px;
    border: none;
    background: transparent;
    font-size: 15px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
}
.tab-btn.active {
    color: #667eea;
    background: #fff;
}
.tab-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}
.tab-btn:hover:not(.active) {
    background: rgba(102, 126, 234, 0.05);
    color: #667eea;
}
.tab-btn i {
    margin-right: 8px;
}

/* 标签内容 */
.tab-content {
    display: none;
    padding: 30px;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}
.form-group label i {
    margin-right: 6px;
    color: #667eea;
}

.input-wrapper {
    position: relative;
}
.input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    transition: color 0.3s;
}
.form-control {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
}
.form-control:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}
.form-control:focus + i,
.input-wrapper:focus-within i {
    color: #667eea;
}
.form-control::placeholder {
    color: #aaa;
}

/* 按钮样式 */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 8px;
}
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.35);
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.45);
}
.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f0f2f5;
    color: #333;
    padding: 10px 20px;
    font-size: 14px;
    width: auto;
    box-shadow: none;
}
.btn-secondary:hover {
    background: #e4e6e9;
    transform: translateY(-1px);
}

/* 提示信息 */
.msg {
    margin: 20px 0;
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { transform: translateX(-15px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.msg-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}
.msg-error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border-left: 4px solid #f44336;
}
.msg i {
    font-size: 18px;
}

/* 账号结果 */
.account-result {
    margin-top: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    font-size: 14px;
    color: #333;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.8;
}
.account-result::-webkit-scrollbar {
    width: 6px;
}
.account-result::-webkit-scrollbar-track {
    background: transparent;
}
.account-result::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* 卡密信息卡片 */
.info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
    color: #fff;
}
.info-card h4 {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}
.info-item {
    background: rgba(255,255,255,0.15);
    padding: 12px;
    border-radius: 10px;
}
.info-item .label {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 4px;
}
.info-item .value {
    font-size: 16px;
    font-weight: 600;
}

/* 历史记录 */
.history-section {
    margin-top: 25px;
}
.history-section h4 {
    font-size: 15px;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.history-section h4 i {
    color: #667eea;
}
.history-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid #e8e8e8;
}
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.history-time {
    color: #666;
    font-size: 13px;
}
.history-num {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}
.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalPop 0.3s ease;
    position: relative;
}
@keyframes modalPop {
    from { transform: scale(0.8) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-content .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: all 0.3s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.modal-content .close:hover {
    color: #333;
    background: #f0f0f0;
}
.modal-header {
    text-align: center;
    margin-bottom: 25px;
}
.modal-header .icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}
.modal-header .icon i {
    font-size: 24px;
    color: #fff;
}
.modal-header h3 {
    color: #333;
    font-size: 20px;
}
.remain-info {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}
.remain-info .label {
    color: #666;
    font-size: 13px;
    margin-bottom: 5px;
}
.remain-info .num {
    font-size: 32px;
    font-weight: 700;
    color: #2e7d32;
}

/* 广告按钮区域 */
.ad-section {
    margin-top: 25px;
    text-align: center;
}
.ad-section .ad-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}
.ad-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 50px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    letter-spacing: 0.5px;
}
.ad-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    filter: brightness(1.1);
}
.ad-btn:active {
    transform: translateY(-1px);
}

/* 用户状态栏 */
.user-bar {
    text-align: right;
    margin-bottom: 10px;
    padding: 8px 0;
}
.user-bar a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.3s;
    border: 1px solid rgba(255,255,255,0.2);
}
.user-bar a:hover {
    color: #fff;
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
}
.user-bar .welcome {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    margin-right: 8px;
}
.user-bar .divider {
    color: rgba(255,255,255,0.3);
    margin: 0 5px;
}

/* 权限遮罩 */
.perm-overlay {
    text-align: center;
    padding: 40px 20px;
}
.perm-overlay i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
    display: block;
}
.perm-overlay p {
    color: #999;
    font-size: 14px;
    margin-bottom: 15px;
}
.perm-overlay a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}
.perm-overlay a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.4);
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 25px;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
}
.footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
}
.footer a:hover {
    color: #fff;
}

/* 联系客服区域 */
.contact-section {
    margin-top: 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(10px);
}
.contact-title {
    color: rgba(255,255,255,0.9);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.contact-title i {
    color: #4facfe;
}
.contact-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255,255,255,0.15);
    border-radius: 50px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
}
.contact-item:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.contact-item i {
    font-size: 14px;
    opacity: 0.9;
}

/* 进度条 */
.progress-wrap {
    display: none;
    margin: 15px 0 5px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    overflow: hidden;
    height: 8px;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}
.progress-info {
    display: none;
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

/* 界面公告 */
.tab-notice {
    background: linear-gradient(135deg, #fff8e6 0%, #fff3cd 100%);
    border: 1px solid #ffc107;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #856404;
    line-height: 1.6;
}
.tab-notice i {
    color: #ffc107;
    margin-right: 8px;
}

/* 响应式 */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    .logo-section {
        padding: 20px 0;
    }
    .logo-icon {
        width: 60px;
        height: 60px;
    }
    .logo-icon i {
        font-size: 28px;
    }
    .logo-icon.logo-custom img {
        width: 60px;
        height: 60px;
    }
    .logo-title {
        font-size: 22px;
    }
    .tab-btn {
        padding: 14px 10px;
        font-size: 13px;
    }
    .tab-btn i {
        display: none;
    }
    .tab-content {
        padding: 20px;
    }
    .btn {
        padding: 14px;
    }
    .info-grid {
        grid-template-columns: 1fr;
    }
    .btn-group {
        flex-direction: column;
    }
    .btn-secondary {
        width: 100%;
    }
}
