/* ========================================
   卡密代理系统 - 响应式UI样式 v3.0
   统一 PC + 手机端，通过 CSS 变量和媒体查询实现
   ======================================== */

/* ========================================
   CSS 变量定义（设计令牌）
   ======================================== */
:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #8499f5;
    --secondary: #764ba2;
    --success: #27ae60;
    --success-dark: #219a52;
    --danger: #e74c3c;
    --danger-dark: #c0392b;
    --warning: #f39c12;
    --warning-dark: #d68910;
    --info: #3498db;
    --info-dark: #2980b9;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --bg-primary: #f0f2f5;
    --bg-card: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --transition: all 0.3s ease;
    --tap-min-height: 44px;
}

/* ========================================
   全局重置
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
                 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-primary);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========================================
   导航栏 - PC端顶部导航 + 手机端侧边滑出
   ======================================== */
.navbar {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.navbar .logo {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    padding: 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.navbar .logo:hover {
    color: var(--primary-light);
}

.navbar .nav-links {
    display: flex;
    align-items: center;
    gap: 5px;
}

.navbar .nav-links a {
    color: var(--gray-300);
    text-decoration: none;
    padding: 14px 16px;
    font-size: 14px;
    transition: var(--transition);
    border-radius: var(--radius-sm);
    position: relative;
}

.navbar .nav-links a:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.navbar .nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.navbar .nav-links a:hover::after {
    width: 80%;
}

.navbar .user-info {
    color: var(--gray-400);
    font-size: 13px;
    padding: 0 15px;
    border-left: 1px solid var(--gray-600);
    margin-left: 10px;
}

.navbar .btn-logout {
    color: var(--danger) !important;
    font-weight: 600;
}

.navbar .btn-logout:hover {
    background: rgba(231, 76, 60, 0.1) !important;
}

/* 汉堡菜单按钮（仅手机端显示） */
.navbar .menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: var(--tap-min-height);
    height: var(--tap-min-height);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.navbar .menu-toggle:active {
    background: rgba(255,255,255,0.1);
}

/* 菜单遮罩 */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}
.menu-overlay.show {
    display: block;
}

.admin-nav {
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);
}

/* ========================================
   移动端底部导航栏
   ======================================== */
.mobile-bottom-nav {
    display: none;
}

.mobile-user-bar {
    display: none;
}

/* ========================================
   容器和主要内容
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 120px);
}

/* ========================================
   卡片样式
   ======================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--gray-800);
    border-bottom: 2px solid var(--gray-100);
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 2px;
}

/* ========================================
   表单样式
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition);
    background: var(--gray-50);
    color: var(--gray-800);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* ========================================
   按钮样式
   ======================================== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-primary:active { transform: translateY(0); }

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.5);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.5);
}

.btn-info {
    background: linear-gradient(135deg, var(--info) 0%, var(--info-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.5);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ========================================
   表格样式
   ======================================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    overflow: hidden;
}

.table th {
    background: var(--gray-50);
    padding: 14px 18px;
    text-align: left;
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 600;
    border-bottom: 2px solid var(--gray-200);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 14px 18px;
    font-size: 14px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.table tr {
    transition: var(--transition);
}

.table tr:hover {
    background: var(--gray-50);
}

.table tr:last-child td {
    border-bottom: none;
}

.table td .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
}

.table-users th {
    background: var(--gray-800);
    color: #fff;
    border: none;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
}

.table-users td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.table-users tr:nth-child(even) {
    background: var(--gray-50);
}

/* ========================================
   徽章样式
   ======================================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.3px;
}

.badge-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
}

.badge-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
}

.badge-info {
    background: linear-gradient(135deg, var(--info) 0%, var(--info-dark) 100%);
}

.badge-secondary {
    background: linear-gradient(135deg, var(--gray-400) 0%, var(--gray-500) 100%);
}

/* ========================================
   统计卡片
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1.2);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
    cursor: default;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    transition: height 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.2);
    border-color: var(--primary-light);
}

.stat-card:hover::before { height: 6px; }

.stat-card .stat-value {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-value { transform: scale(1.05); }

.stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card.stat-green::before { background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%); }
.stat-card.stat-green:hover { box-shadow: 0 15px 30px rgba(39, 174, 96, 0.2); border-color: var(--success); }
.stat-card.stat-green .stat-value { background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.stat-card.stat-orange::before { background: linear-gradient(135deg, #f39c12 0%, #d68910 100%); }
.stat-card.stat-orange:hover { box-shadow: 0 15px 30px rgba(243, 156, 18, 0.2); border-color: #f39c12; }
.stat-card.stat-orange .stat-value { background: linear-gradient(135deg, #f39c12 0%, #d68910 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.stat-card.stat-red::before { background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%); }
.stat-card.stat-red:hover { box-shadow: 0 15px 30px rgba(231, 76, 60, 0.2); border-color: var(--danger); }
.stat-card.stat-red .stat-value { background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.stat-card.stat-blue::before { background: linear-gradient(135deg, var(--info) 0%, var(--info-dark) 100%); }
.stat-card.stat-blue:hover { box-shadow: 0 15px 30px rgba(52, 152, 219, 0.2); border-color: var(--info); }
.stat-card.stat-blue .stat-value { background: linear-gradient(135deg, var(--info) 0%, var(--info-dark) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.stat-card.stat-purple::before { background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%); }
.stat-card.stat-purple:hover { box-shadow: 0 15px 30px rgba(155, 89, 182, 0.2); border-color: #9b59b6; }
.stat-card.stat-purple .stat-value { background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ========================================
   登录/注册页面
   ======================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -150px;
    border-radius: 50%;
    animation: floatGlow 8s ease-in-out infinite;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.12) 0%, transparent 70%);
    bottom: -180px;
    left: -120px;
    border-radius: 50%;
    animation: floatGlow 6s ease-in-out infinite reverse;
}

@keyframes floatGlow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
}

.auth-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 50px 45px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-box .auth-icon {
    text-align: center;
    font-size: 56px;
    margin-bottom: 10px;
    line-height: 1;
    animation: bounceIn 0.8s ease-out 0.1s both;
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.08); }
    70% { transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 8px;
    color: var(--gray-800);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.auth-box .auth-subtitle {
    text-align: center;
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 32px;
}

.auth-box .form-group { margin-bottom: 20px; }

.auth-box .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.auth-box .form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 15px;
    background: var(--gray-50);
    transition: var(--transition);
    box-sizing: border-box;
}

.auth-box .form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.auth-box .form-control::placeholder { color: var(--gray-400); }

.auth-box .btn {
    width: 100%;
    padding: 15px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: var(--transition);
    margin-top: 10px;
}

.auth-box .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.auth-box .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.auth-box .btn-primary:active { transform: translateY(0); }

.auth-box .btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.auth-box .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.5);
}

.auth-box .switch-link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--gray-500);
}

.auth-box .switch-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-box .switch-link a:hover { color: var(--secondary); }

/* ========================================
   提示消息
   ======================================== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.alert::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    border: 1px solid #90caf9;
}

.alert-info::before { content: 'i'; background: #1976d2; color: #fff; font-size: 12px; font-weight: 700; }

.alert-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    border: 1px solid #81c784;
}

.alert-success::before { content: '\2713'; background: #2e7d32; color: #fff; font-size: 12px; font-weight: 700; }

.alert-danger {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border: 1px solid #ef5350;
}

.alert-danger::before { content: '\2717'; background: #c62828; color: #fff; font-size: 12px; font-weight: 700; }

.alert-warning {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #e65100;
    border: 1px solid #ffb74d;
}

.alert-warning::before { content: '!'; background: #e65100; color: #fff; font-size: 12px; font-weight: 700; }

/* ========================================
   分页
   ======================================== */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
    padding: 20px 0;
}

.pagination a,
.pagination span {
    padding: 12px 18px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1.2);
    background: #fff;
    min-width: var(--tap-min-height);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.pagination a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.pagination a:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

.pagination a:hover::before { left: 100%; }

.pagination .active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    position: relative;
    z-index: 1;
}

.pagination .active::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-md);
    z-index: -1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.pagination .ellipsis {
    padding: 12px 8px;
    color: var(--gray-500);
    border: none;
    background: transparent;
    cursor: default;
}

.pagination .ellipsis:hover {
    background: transparent;
    color: var(--gray-500);
    transform: none;
    box-shadow: none;
    border: none;
}

/* ========================================
   页脚
   ======================================== */
.footer {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
    color: var(--gray-400);
    text-align: center;
    padding: 24px 0;
    font-size: 13px;
    margin-top: auto;
}

/* ========================================
   Dashboard 布局
   ======================================== */
.dashboard-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* 快捷操作按钮 */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-action-btn {
    padding: 16px 12px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    min-height: 80px;
    color: white;
    border: none;
    cursor: pointer;
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.quick-action-btn .icon { font-size: 24px; line-height: 1; }
.quick-action-btn .text { line-height: 1.2; }
.quick-action-btn.btn-primary  { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.quick-action-btn.btn-warning   { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.quick-action-btn.btn-secondary { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }

/* 等级分布进度条 */
.level-dist { display: flex; flex-direction: column; gap: 16px; }

.level-row { display: flex; align-items: center; gap: 12px; }

.level-label { min-width: 80px; flex-shrink: 0; }

.level-label .badge { font-size: 13px; padding: 6px 14px; }

.level-bar-wrap {
    flex: 1;
    height: 24px;
    background: var(--gray-100);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.level-bar {
    height: 100%;
    border-radius: 12px;
    transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1.2);
    min-width: 0;
    position: relative;
}

.level-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.2) 0%, transparent 50%, rgba(255,255,255,0.15) 100%);
    border-radius: 12px;
}

.level-count {
    min-width: 48px;
    text-align: right;
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-700);
    flex-shrink: 0;
}

/* ========================================
   提取卡密页面组件
   ======================================== */
.user-status-bar {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #dee2e6;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.status-content { flex: 1; }

.status-label {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 3px;
}

.status-value {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

/* 筛选栏 */
.card-filter-bar {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-group { display: flex; align-items: center; gap: 8px; }

.filter-label { font-size: 13px; color: #6c757d; white-space: nowrap; }

.filter-input,
.filter-select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.filter-input { min-width: 200px; }
.filter-select { min-width: 150px; }

.filter-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.filter-btn:hover { background: #2980b9; }
.filter-btn.reset { background: #6c757d; }
.filter-btn.reset:hover { background: #5a6268; }

/* 卡密分组 */
.card-group-container { margin: 20px 0; }

.card-group {
    background: white;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.card-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: background 0.2s;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.card-group-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.group-info { flex: 1; }

.group-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.group-count {
    font-size: 13px;
    color: #6c757d;
    font-weight: normal;
    margin-left: 5px;
}

.group-prices { display: flex; gap: 15px; font-size: 14px; }

.original-price { color: #6c757d; text-decoration: line-through; }
.discount-price { color: #e74c3c; font-weight: 600; }
.saving { color: #27ae60; font-weight: 500; }

.group-actions { display: flex; align-items: center; gap: 10px; }

.group-extract-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.group-extract-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #2471a3 100%);
    transform: translateY(-1px);
}

.group-toggle { font-size: 12px; color: #6c757d; transition: transform 0.3s; }

.card-group-content { display: none; }

.group-cards-container { padding: 15px 20px; border-top: 1px solid #e9ecef; }

/* 提取控件 */
.extract-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.quantity-control { display: flex; align-items: center; gap: 10px; }

.quantity-control label { font-size: 14px; color: #495057; font-weight: 500; }

.quantity-input-group {
    display: flex;
    align-items: center;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f8f9fa;
    color: #495057;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover { background: #e9ecef; }

.quantity-input {
    width: 60px;
    height: 36px;
    border: none;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.quantity-hint { font-size: 12px; color: #6c757d; }

.price-summary { display: flex; gap: 20px; align-items: center; }

.price-item { font-size: 14px; color: #6c757d; }

.price-item.total { font-weight: 600; color: #e74c3c; }

.price-item.total .price-value { font-size: 18px; }

.price-value { color: #2c3e50; font-weight: 500; }

.extract-actions { display: flex; gap: 10px; margin-left: auto; }

.extract-btn {
    background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 36px;
    min-width: 60px;
}

.extract-btn:hover {
    background: linear-gradient(135deg, #219a52 0%, #1e8449 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 154, 82, 0.3);
}

.extract-btn:active { transform: translateY(0); }
.extract-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.extract-btn.primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
}

.extract-btn.primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #2471a3 100%);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.extract-btn.quick {
    background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
}

.extract-btn.quick:hover {
    background: linear-gradient(135deg, #219a52 0%, #1e8449 100%);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.2);
}

.batch-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.batch-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-1px);
}

.batch-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.batch-btn.secondary { background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%); }
.batch-btn.secondary:hover { background: linear-gradient(135deg, #7f8c8d 0%, #6c7b7d 100%); }

/* 模态弹窗 */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.show { opacity: 1; visibility: visible; }

.modal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.show .modal { transform: translateY(0); }

.modal-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.card-detail {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.card-detail-item { 
    margin-bottom: 14px; 
    display: flex;
    flex-direction: column;
}

.card-detail-item.card-detail-item-action {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.card-detail-item-action .card-detail-label {
    margin-bottom: 0;
    min-width: 40px;
    flex-shrink: 0;
}

.card-detail-item-action .card-detail-value {
    flex: 1;
    min-width: 120px;
}

.card-detail-label { 
    font-size: 13px; 
    color: #6c757d; 
    margin-bottom: 6px; 
    font-weight: 500;
}

.card-detail-value {
    font-family: 'Courier New', monospace;
    font-size: 15px;
    font-weight: 500;
    color: #2c3e50;
    padding: 10px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    word-break: break-all;
}

.card-detail-separator {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

/* 边框型复制按钮 — 与主按钮协调 */
.copy-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 14px;
    border: 2px solid #667eea;
    border-radius: 6px;
    background: transparent;
    color: #667eea;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.copy-btn-outline:hover {
    background: rgba(102, 126, 234, 0.08);
    border-color: #5568d3;
    color: #5568d3;
}

.copy-btn-outline:active {
    background: rgba(102, 126, 234, 0.15);
    transform: scale(0.97);
}

/* 弹窗内滚动区域 */
.modal-scroll-area {
    max-height: 400px;
    overflow-y: auto;
    margin: 15px 0;
    padding-right: 4px;
}

.modal-scroll-area::-webkit-scrollbar {
    width: 5px;
}

.modal-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.modal-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

.modal-scroll-area::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* 弹窗警告文字 */
.modal-warning-text {
    color: #e74c3c;
    font-weight: bold;
    margin: 15px 0;
    font-size: 14px;
}

/* 弹窗底部按钮区 */
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
    min-height: 44px;
    font-size: 15px;
}

/* Toast 通知 */
.toast-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    padding: 12px 28px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    z-index: 3000;
    pointer-events: none;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1.2);
    white-space: nowrap;
    letter-spacing: 0.5px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.toast-notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 保留旧 .copy-btn 兼容管理后台等处 */
.copy-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.copy-btn:hover { background: #2980b9; }
.copy-btn.copied { background: #27ae60; }

.empty-state { text-align: center; padding: 50px 20px; color: #6c757d; }

.empty-icon { font-size: 48px; margin-bottom: 15px; opacity: 0.3; }

.no-results { text-align: center; padding: 40px 20px; color: #6c757d; }

.no-results-icon { font-size: 36px; margin-bottom: 10px; opacity: 0.3; }

/* ========================================
   充值页面组件 — PC 端（双栏重构版）
   ======================================== */

/* 双栏容器 */
.recharge-wrapper {
    display: grid;
    grid-template-columns: 55% 45%;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    align-items: start;
}

/* 左侧列 */
.recharge-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 右侧列 */
.recharge-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---- 余额卡片（右侧顶部） ---- */
.balance-card {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
    border-radius: 14px;
    padding: 20px 24px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
    transition: box-shadow 0.3s ease;
}

.balance-card:hover {
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.35);
}

.balance-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.balance-amount {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.balance-info {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.balance-info-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.balance-info-item .info-label {
    color: rgba(255, 255, 255, 0.45);
}

.balance-info-item .info-value {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
}

/* ---- 特色说明卡片 ---- */
.feature-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.feature-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.feature-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.feature-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.feature-text strong {
    font-size: 14px;
    color: #1f2937;
    font-weight: 600;
}

.feature-text span {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

/* ---- 金额选择卡片 ---- */
.amount-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.amount-card .card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.amount-card .card-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 2px;
}

/* 预设金额网格 */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.preset-btn {
    min-height: 44px;
    padding: 0;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

.preset-btn.active {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

/* 自定义金额输入 */
.custom-input-group {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-input-group:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.currency-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: #f9fafb;
    font-size: 17px;
    font-weight: 700;
    color: #3b82f6;
    flex-shrink: 0;
    border-right: 1px solid #e5e7eb;
}

.custom-input {
    flex: 1;
    min-height: 46px;
    border: none;
    padding: 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    outline: none;
    -moz-appearance: textfield;
}

.custom-input::-webkit-outer-spin-button,
.custom-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.custom-input::placeholder {
    color: #d1d5db;
    font-weight: 400;
}

/* ---- 支付方式卡片 ---- */
.payment-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.payment-card .card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
    padding-bottom: 0;
    border-bottom: none;
}

.payment-card .card-title::before {
    display: none;
}

.payment-methods {
    display: flex;
    gap: 10px;
}

.payment-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
}

.payment-option:hover {
    border-color: #93c5fd;
    background: #f8faff;
}

.payment-option.active {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.payment-option input[type="radio"] {
    display: none;
}

.payment-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-name {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.payment-option.active .payment-name {
    color: #2563eb;
}

/* ---- 提交按钮 ---- */
.submit-btn {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
    letter-spacing: 0.5px;
}

.submit-btn:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

.submit-btn:not(:disabled):hover {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.submit-btn:not(:disabled):active {
    transform: translateY(0);
}

/* ---- 充值记录入口 ---- */
.records-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 0;
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.records-link:hover {
    color: #3b82f6;
}

.records-link svg {
    flex-shrink: 0;
}

/* ---- 说明卡片（保留兼容旧引用） ---- */
.info-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.info-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.info-card p {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
    line-height: 1.5;
}

/* 未配置提示 */
.not-configured {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 14px 16px;
    color: #92400e;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    margin-top: 16px;
}

/* ---- 响应式：≤768px 恢复单栏 ---- */
@media (max-width: 768px) {
    .recharge-wrapper {
        grid-template-columns: 1fr;
        gap: 16px;
        max-width: 100%;
    }

    .feature-cards {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .feature-card {
        padding: 12px 10px;
        gap: 8px;
    }

    .feature-icon {
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }

    .feature-icon svg {
        width: 18px;
        height: 18px;
    }

    .feature-text strong {
        font-size: 13px;
    }

    .feature-text span {
        font-size: 11px;
        overflow-wrap: break-word;
    }

    .balance-card {
        padding: 28px 20px;
    }

    .balance-amount {
        font-size: 34px;
    }

    /* 提升按钮最小宽度，375px 下每列 ≥80px */
    .preset-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .preset-btn {
        min-height: 48px;
        font-size: 16px;
        -webkit-appearance: none;
    }

    .custom-input-group {
        margin-bottom: 0;
    }

    .currency-symbol {
        width: 48px;
        height: 48px;
    }

    .custom-input {
        min-height: 48px;
        font-size: 16px;
        -webkit-appearance: none;
    }

    .payment-methods {
        gap: 8px;
    }

    .payment-option {
        padding: 14px 12px;
    }

    .submit-btn {
        min-height: 50px;
        font-size: 16px;
        -webkit-appearance: none;
    }
}



/* ========================================
   升级代理页面组件
   ======================================== */
.upgrade-container { max-width: 700px; margin: 0 auto; width: 100%; }

.current-level-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    color: #fff;
    margin-bottom: 25px;
    text-align: center;
}

.current-level-label { font-size: 14px; opacity: 0.85; margin-bottom: 8px; }

.current-level-value { font-size: 32px; font-weight: 700; }

.level-comparison {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.level-card {
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.25s;
    cursor: pointer;
    background: #fff;
}

.level-card:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.15);
}

.level-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f0ff 0%, #e8e0f0 100%);
}

.level-card.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.level-card .level-name { font-size: 16px; font-weight: 600; color: #2c3e50; margin-bottom: 8px; }

.level-card .level-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.level-card .level-price { margin-bottom: 6px; }

.level-card .level-price .price-original {
    display: block;
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 4px;
    min-height: 1.2em;
}

.level-card .level-price .price-diff { font-size: 24px; font-weight: 700; color: #e74c3c; }

.level-card.disabled .level-price .price-diff { color: #999; }

.level-card .level-desc { font-size: 12px; color: #888; line-height: 1.5; }

.level-card .check-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: transparent;
    transition: all 0.2s;
}

.level-card.selected .check-icon { border-color: #667eea; background: #667eea; color: #fff; }

/* ========================================
   价格标签
   ======================================== */
.price-tag {
    font-size: 20px;
    font-weight: 700;
    color: var(--danger);
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-original {
    text-decoration: line-through;
    color: var(--gray-400);
    font-size: 14px;
    margin-left: 8px;
}

/* ========================================
   卡密展示
   ======================================== */
.card-key {
    background: var(--gray-50);
    border: 2px dashed var(--gray-300);
    padding: 18px;
    border-radius: var(--radius-md);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 1px;
    margin: 12px 0;
    word-break: break-all;
    color: var(--gray-700);
    transition: var(--transition);
}

.card-key:hover {
    background: var(--gray-100);
    border-color: var(--primary);
}

/* ========================================
   动画效果
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in { animation: fadeIn 0.5s ease-out; }
.slide-up { animation: slideUp 0.5s ease-out; }

/* ========================================
   滚动条美化
   ======================================== */
::-webkit-scrollbar { width: 8px; height: 8px; }

::-webkit-scrollbar-track { background: var(--gray-100); }

::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 4px; }

::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

/* ========================================
   管理员后台样式
   ======================================== */
.table-payments th {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
}

.table-payments td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); font-size: 13px; }

.table-payments tr:nth-child(even) { background: var(--gray-50); }

.search-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.search-form .form-group { margin-bottom: 0; }

.search-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1.2);
    background: var(--gray-50);
    color: var(--gray-800);
}

.search-form .form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.search-form .form-control:hover { border-color: var(--gray-300); background: #fff; }

.search-form .form-row:last-child {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.search-form .form-row:last-child .btn {
    min-width: 100px;
    padding: 12px 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.users-search-recharge {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.users-search-recharge .card { margin-bottom: 0; }

.users-search-recharge .card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 8px;
}

.users-search-recharge .card-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 2px;
}

#rechargeForm {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

#rechargeForm input {
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all 0.3s ease;
    background: var(--gray-50);
    color: var(--gray-800);
}

#rechargeForm input:focus {
    outline: none;
    border-color: var(--success);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.1);
}

#rechargeForm input[name="user_id"] { width: 120px; }

#rechargeForm input[name="amount"] { width: 140px; }

#rechargeForm .btn-success {
    min-width: 100px;
    padding: 12px 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.admin-balance-info {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-balance-info strong { color: var(--success); font-weight: 700; }

.admin-balance-info .mode-indicator {
    color: var(--primary);
    font-weight: 600;
    padding: 2px 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

/* ========================================
   工具类
   ======================================== */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.p-20  { padding: 20px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.w-100 { width: 100%; }

/* ========================================
   响应式 - 平板 / 手机 (768px) - 现代APP风格重构
   ======================================== */

/* ========================================
   响应式 - 手机端 (max-width: 768px)
   完全重写 - 极简设计
   ======================================== */

/* ========================================
   响应式 - 移动端 (max-width: 768px) — 完全重写
   所有选择器基于实际PHP输出的HTML class/id
   ======================================== */

/* ========================================
   响应式 - 移动端 (max-width: 768px) — 逐选择器验证修复版
   所有选择器严格基于PHP实际HTML class/id
   修复日期: 2026-06-30
   ======================================== */
@media (max-width: 768px) {

    /* ========================================
       滚动体系 — html/body 为唯一滚动容器
       使用 !important 确保不被PC端任何规则覆盖
       ======================================== */
    html {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        height: auto !important;
        max-height: none !important;
        -webkit-overflow-scrolling: touch;
    }

    body {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        height: auto !important;
        max-height: none !important;
        min-height: 100vh;
        padding-top: 56px;
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
        font-size: 14px;
        background: #f0f2f5;
        -webkit-overflow-scrolling: touch;
    }

    /* 强制所有容器 overflow:visible，禁止独立滚动条 */
    .container,
    .main-content,
    .card,
    .card-group-container,
    .card-group-content,
    .group-cards-container,
    .recharge-container,
    .upgrade-container,
    .table-responsive,
    .level-comparison,
    .stats-grid,
    .dashboard-two-col,
    .quick-actions,
    .card-detail {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }

    .container {
        padding: 0 12px;
        max-width: 100%;
    }

    .main-content {
        padding: 12px 0 20px;
    }

    /* ========================================
       顶部导航 nav.navbar — header.php
       ======================================== */
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        height: 56px;
        padding: 0 12px;
        background: #ffffff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10);
    }

    .navbar .container {
        padding: 0;
        height: 56px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .navbar .logo {
        font-size: 18px;
        font-weight: 700;
        color: #1f2937;
        padding: 0;
        text-decoration: none;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .navbar .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        font-size: 22px;
        color: #374151;
        cursor: pointer;
        border-radius: 8px;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        z-index: 1;
    }

    .navbar .menu-toggle:active {
        background: rgba(0, 0, 0, 0.05);
    }

    .navbar .nav-links {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        width: 270px;
        height: 100vh;
        height: 100dvh;
        background: #ffffff;
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.12);
        z-index: 1001;
        padding: 60px 0 24px;
        overflow-y: auto;
    }

    .navbar .nav-links.show {
        display: flex;
    }

    .navbar .nav-links a {
        display: block;
        padding: 14px 24px;
        font-size: 15px;
        color: #374151;
        text-decoration: none;
        border-bottom: 1px solid #f3f4f6;
        transition: background 0.15s;
    }

    .navbar .nav-links a:active {
        background: #f9fafb;
    }

    .navbar .nav-links .btn-logout {
        color: #ef4444 !important;
        font-weight: 600;
    }

    /* 菜单内用户信息块 — 匹配内联 style div */
    .navbar .nav-links div[style*="border-top"] {
        margin: 8px 16px !important;
        padding: 14px 0 !important;
        border-top: 1px solid #e5e7eb !important;
    }

    .navbar .nav-links div[style*="border-top"] div {
        font-size: 13px !important;
        color: #6b7280 !important;
        margin-bottom: 2px !important;
    }

    /* 汉堡菜单遮罩 */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.45);
        z-index: 999;
    }

    .menu-overlay.show {
        display: block;
    }

    /* ========================================
       移动端用户信息条 .mobile-user-bar — header.php
       ======================================== */
    .mobile-user-bar {
        display: flex !important;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        margin: 0 -12px 12px;
        background: #ffffff;
        border-bottom: 1px solid #e5e7eb;
        font-size: 13px;
    }

    .mobile-user-avatar {
        font-size: 22px;
        line-height: 1;
        flex-shrink: 0;
    }

    .mobile-user-info {
        flex: 1;
        min-width: 0;
    }

    .mobile-user-name {
        font-weight: 600;
        font-size: 14px;
        color: #1f2937;
    }

    .mobile-user-meta {
        font-size: 12px;
        color: #6b7280;
        margin-top: 2px;
    }

    .mobile-user-level {
        flex-shrink: 0;
        background: #3b82f6;
        color: #ffffff;
        font-size: 11px;
        font-weight: 600;
        padding: 4px 10px;
        border-radius: 12px;
    }

    /* ========================================
       底部导航 .mobile-bottom-nav — header.php
       ======================================== */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        height: 60px;
        background: #ffffff;
        box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.08);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .mobile-bottom-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        text-decoration: none;
        color: #9ca3af;
        font-size: 10px;
        font-weight: 500;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.15s;
    }

    .mobile-bottom-nav a .nav-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        font-size: 20px;
        line-height: 1;
    }

    .mobile-bottom-nav a .nav-icon svg {
        width: 22px;
        height: 22px;
    }

    .mobile-bottom-nav a .nav-text {
        font-size: 10px;
        line-height: 1;
    }

    .mobile-bottom-nav a.active {
        color: #3b82f6;
    }

    .mobile-bottom-nav a.active .nav-icon {
        color: #3b82f6;
    }

    .mobile-bottom-nav a:active {
        opacity: 0.7;
    }

    /* 充值Tab居中突起按钮 */
    .mobile-bottom-nav a.nav-center {
        position: relative;
    }

    .mobile-bottom-nav a.nav-center .nav-icon {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: #3b82f6;
        color: #ffffff;
        font-size: 18px;
        font-weight: 700;
        margin-top: -8px;
        box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
    }

    .mobile-bottom-nav a.nav-center.active .nav-icon {
        background: #2563eb;
    }


    .mobile-hide { display: none !important; }
        /* ========================================
       Dashboard — 统计卡片 .stats-grid / .stat-card
       ======================================== */
    .stats-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 16px;
    }

    .stat-card {
        background: #ffffff;
        border-radius: 10px;
        padding: 16px 12px;
        text-align: center;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .stat-card .stat-value {
        font-size: 20px;
        font-weight: 700;
        color: #1f2937;
        margin-bottom: 4px;
        word-break: break-all;
    }

    .stat-card .stat-label {
        font-size: 11px;
        color: #9ca3af;
        font-weight: 500;
    }

    /* ========================================
       Dashboard — 通用卡片 .card / .card-title
       ======================================== */
    .card {
        background: #ffffff;
        border-radius: 10px;
        padding: 16px 14px;
        margin-bottom: 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .card-title {
        font-size: 15px;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 14px;
        padding-bottom: 10px;
        border-bottom: 1px solid #f3f4f6;
    }

    /* ========================================
       Dashboard — 双栏变单栏
       ======================================== */
    .dashboard-two-col {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .dashboard-two-col .card {
        margin-bottom: 0;
    }

    /* ========================================
       Dashboard — 表格 .table → 卡片列表
       【修复】PHP 使用裸 <tr><th> 无 <thead>/<tbody>
       所以直接针对 tr:first-child 隐藏表头行
       ======================================== */
    /* 等级折扣表格 level-table */
    .table.level-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0 6px;
    }

    .table.level-table tr:first-child {
        display: none;  /* 隐藏表头行 (<tr><th>) — PHP无<thead> */
    }

    .table.level-table tr {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f9fafb;
        border-radius: 8px;
        padding: 10px 12px;
    }

    .table.level-table tr:first-child {
        display: none;  /* 重新声明确保对 <tr> 生效 */
    }

    .table.level-table td {
        padding: 4px 6px;
        font-size: 13px;
        border: none;
    }

    .table.level-table td:first-child {
        flex: 0 0 auto;
    }

    .table.level-table td:nth-child(2) {
        font-weight: 600;
        color: #3b82f6;
        text-align: center;
    }

    .table.level-table td:last-child {
        font-size: 12px;
        color: #6b7280;
        text-align: right;
    }

    /* 最近提卡记录表格 recent-orders-table — 卡片式 */
    .table.recent-orders-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0 8px;
    }

    .table.recent-orders-table tr:first-child {
        display: none;
    }

    .table.recent-orders-table tr {
        display: flex;
        flex-direction: column;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        padding: 12px 14px;
    }

    .table.recent-orders-table td {
        padding: 3px 0;
        font-size: 13px;
        border: none;
        text-align: left;
    }

    .col-name {
        font-weight: 600;
        font-size: 14px;
        color: #1f2937;
        padding-bottom: 6px;
    }

    .col-cardno {
        font-size: 13px;
        color: #3b82f6;
        font-family: 'Consolas', 'Monaco', monospace;
    }

    .col-original, .col-paid {
        display: none;
    }

    .col-time {
        font-size: 11px;
        color: #9ca3af;
    }

    /* ========================================
       Dashboard — 快捷操作 .quick-actions
       ======================================== */
    .quick-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .quick-action-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 68px;
        border: none;
        border-radius: 10px;
        text-decoration: none;
        font-size: 13px;
        font-weight: 600;
        color: #ffffff;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    /* span.icon 和 span.text 子元素 */
    .quick-action-btn .icon {
        font-size: 24px;
        line-height: 1;
    }

    .quick-action-btn .text {
        font-size: 12px;
    }

    .quick-action-btn:active {
        opacity: 0.85;
    }

    /* ========================================
       Dashboard — 表单控件
       ======================================== */
    .form-group {
        margin-bottom: 14px;
    }

    .form-group label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        color: #374151;
        margin-bottom: 6px;
    }

    .form-control {
        width: 100%;
        min-height: 44px;
        padding: 10px 12px;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        font-size: 14px;
        background: #ffffff;
        color: #1f2937;
        outline: none;
        -webkit-appearance: none;
        box-sizing: border-box;
    }

    .form-control:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    }

    .form-control[readonly] {
        background: #f9fafb;
        color: #6b7280;
    }

    /* 邀请链接行 — PHP 中 <div style="display:flex;gap:8px;"> */
    .form-group div[style*="display:flex"] {
        display: flex !important;
        gap: 8px;
    }

    .form-group div[style*="display:flex"] .form-control {
        flex: 1;
    }

    /* ========================================
       Dashboard — 按钮
       ======================================== */
    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 10px 18px;
        border: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .btn:active {
        opacity: 0.8;
    }

    .btn-primary {
        background: #3b82f6;
        color: #ffffff;
    }

    .btn-warning {
        background: #f59e0b;
        color: #ffffff;
    }

    .btn-secondary {
        background: #6b7280;
        color: #ffffff;
    }

    .btn-success {
        background: #10b981;
        color: #ffffff;
    }

    .btn-sm {
        min-height: 36px;
        padding: 6px 14px;
        font-size: 13px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* ========================================
       Dashboard — 公告弹窗 #announcement-overlay
       ======================================== */
    #announcement-overlay {
        display: none;
    }

    #announcement-overlay.show {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 3000;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

    #announcement-overlay .announcement-modal {
        background: #ffffff;
        border-radius: 12px;
        padding: 20px;
        width: 100%;
        max-width: 400px;
        max-height: 80vh;
        overflow-y: auto;
    }

    /* ========================================
       get_card.php — 页面标题 (h1 在 .main-content 内)
       ======================================== */
    h1 {
        font-size: 20px;
        font-weight: 700;
        color: #1f2937;
        margin-bottom: 14px;
        padding: 0;
    }

    /* ========================================
       get_card.php — 用户状态栏 .user-status-bar
       ======================================== */
    .user-status-bar {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        margin-bottom: 16px;
    }

    .status-item {
        background: #ffffff;
        border-radius: 10px;
        padding: 12px 10px;
        text-align: center;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .status-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        color: #ffffff;
        flex-shrink: 0;
    }

    .status-content {
        min-width: 0;
    }

    .status-label {
        font-size: 11px;
        color: #9ca3af;
        margin-bottom: 2px;
    }

    .status-value {
        font-size: 14px;
        font-weight: 700;
        color: #1f2937;
    }

    /* ========================================
       get_card.php — 筛选栏 .card-filter-bar
       ======================================== */
    .card-filter-bar {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 14px;
        padding: 12px;
        background: #ffffff;
        border-radius: 10px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .filter-group {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .filter-label {
        font-size: 12px;
        color: #6b7280;
        white-space: nowrap;
        min-width: 60px;
    }

    .filter-input,
    .filter-select {
        flex: 1;
        min-height: 38px;
        min-width: 120px;
        padding: 8px 10px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        font-size: 13px;
        background: #ffffff;
        color: #1f2937;
        outline: none;
        -webkit-appearance: none;
    }

    .filter-input:focus,
    .filter-select:focus {
        border-color: #3b82f6;
    }

    .filter-btn {
        min-height: 38px;
        padding: 8px 16px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        background: #ffffff;
        font-size: 13px;
        color: #374151;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .filter-btn.reset {
        color: #ef4444;
        border-color: #ef4444;
        align-self: flex-start;
    }

    .filter-btn:active {
        opacity: 0.7;
    }

    /* ========================================
       get_card.php — 卡密分组 .card-group
       ======================================== */
    .card-group-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .card-group {
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
        overflow: hidden;
    }

    .card-group-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }

    .card-group-header:active {
        background: rgba(0, 0, 0, 0.02);
    }

    .group-info {
        flex: 1;
        min-width: 0;
    }

    .group-name {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 15px;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 6px;
    }

    .group-count {
        font-weight: 400;
        color: #9ca3af;
        font-size: 13px;
        margin-left: 4px;
    }

    .group-prices {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        font-size: 13px;
    }

    .original-price {
        color: #9ca3af;
        text-decoration: line-through;
        font-size: 12px;
    }

    .discount-price {
        color: #ef4444;
        font-weight: 600;
        font-size: 14px;
    }

    .saving {
        display: inline-block;
        background: #ecfdf5;
        color: #059669;
        font-size: 11px;
        font-weight: 600;
        padding: 2px 6px;
        border-radius: 4px;
    }

    .group-actions {
        flex-shrink: 0;
        padding-left: 12px;
    }

    .group-toggle {
        display: inline-block;
        font-size: 12px;
        color: #9ca3af;
        transition: transform 0.2s ease;
    }

    /* 展开内容区 */
    .card-group-content {
        padding: 0;
    }

    .group-cards-container {
        padding: 0 14px 14px;
    }

    /* ========================================
       get_card.php — 提取控制 .extract-controls
       ======================================== */
    .extract-controls {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* 数量选择 */
    .quantity-control {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .quantity-control label {
        font-size: 13px;
        color: #6b7280;
        font-weight: 500;
    }

    .quantity-input-group {
        display: inline-flex;
        align-items: center;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        overflow: hidden;
    }

    .quantity-btn {
        width: 36px;
        height: 36px;
        border: none;
        background: #f3f4f6;
        font-size: 16px;
        font-weight: 600;
        color: #374151;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
    }

    .quantity-btn:active {
        background: #e5e7eb;
    }

    .quantity-input {
        width: 52px;
        height: 36px;
        border: none;
        border-left: 1px solid #d1d5db;
        border-right: 1px solid #d1d5db;
        text-align: center;
        font-size: 14px;
        font-weight: 600;
        color: #1f2937;
        -moz-appearance: textfield;
        outline: none;
    }

    .quantity-input::-webkit-outer-spin-button,
    .quantity-input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    .quantity-hint {
        font-size: 12px;
        color: #9ca3af;
    }

    /* 价格汇总 */
    .price-summary {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-top: 1px solid #f3f4f6;
        border-bottom: 1px solid #f3f4f6;
    }

    .price-item {
        font-size: 13px;
        color: #6b7280;
    }

    .price-item.total {
        font-weight: 600;
        color: #1f2937;
    }

    .price-value {
        font-weight: 700;
        color: #ef4444;
    }

    /* 提取按钮 */
    .extract-actions {
        display: flex;
        gap: 8px;
    }

    .extract-btn {
        min-height: 44px;
        padding: 0 16px;
        border: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .extract-btn.primary {
        flex: 1;
        background: #3b82f6;
        color: #ffffff;
    }

    .extract-btn.quick {
        flex: 0 0 auto;
        background: #f3f4f6;
        color: #374151;
    }

    .extract-btn:active {
        opacity: 0.8;
    }

    /* ========================================
       get_card.php — 提卡成功弹窗 #extractModal
       ======================================== */
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 2000;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

    .modal-overlay.show {
        display: flex;
    }

    .modal {
        background: #ffffff;
        border-radius: 14px;
        padding: 24px 18px;
        width: 100%;
        max-width: 400px;
        max-height: 80vh;
        overflow-y: auto;
    }

    .modal-title {
        font-size: 17px;
        font-weight: 700;
        color: #1f2937;
        margin-bottom: 16px;
        text-align: center;
    }

    .card-detail {
        background: #f9fafb;
        border-radius: 10px;
        padding: 14px;
        margin-bottom: 10px;
    }

    .card-detail-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .card-detail-item:last-child {
        border-bottom: none;
    }

    .card-detail-item.card-detail-item-action {
        flex-wrap: wrap;
    }

    .card-detail-label {
        font-size: 12px;
        color: #9ca3af;
        flex-shrink: 0;
        white-space: nowrap;
        min-width: 48px;
    }

    .card-detail-value {
        flex: 1;
        font-size: 13px;
        font-weight: 600;
        color: #1f2937;
        word-break: break-all;
        text-align: right;
    }

    .card-detail-separator {
        font-size: 12px;
        color: #9ca3af;
        margin-bottom: 8px;
        padding-bottom: 6px;
        border-bottom: 1px solid #e5e7eb;
    }

    .copy-btn-outline {
        min-height: 32px;
        padding: 4px 12px;
        border: 2px solid #667eea;
        border-radius: 6px;
        background: transparent;
        color: #667eea;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }

    .copy-btn-outline:active {
        background: rgba(102, 126, 234, 0.12);
        opacity: 0.85;
    }

    /* 弹窗底部按钮 — 移动端上下堆叠 */
    .modal-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }

    .modal-actions .btn {
        width: 100%;
        min-height: 46px;
        font-size: 15px;
    }

    .modal-warning-text {
        color: #e74c3c;
        font-weight: bold;
        margin: 15px 0;
        font-size: 13px;
        text-align: center;
    }

    /* 弹窗滚动区域 */
    .modal-scroll-area {
        max-height: 40vh;
        overflow-y: auto;
        margin: 12px 0;
    }

    .modal-scroll-area::-webkit-scrollbar {
        width: 4px;
    }

    .modal-scroll-area::-webkit-scrollbar-track {
        background: transparent;
    }

    .modal-scroll-area::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.12);
        border-radius: 2px;
    }

    /* Toast 通知 */
    .toast-notification {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.8);
        background: rgba(0, 0, 0, 0.85);
        color: #fff;
        padding: 12px 26px;
        border-radius: 24px;
        font-size: 15px;
        font-weight: 600;
        z-index: 3000;
        pointer-events: none;
        opacity: 0;
        transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1.2);
        white-space: nowrap;
    }

    .toast-notification.show {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    /* ========================================
       get_card.php — 无结果 .no-results
       ======================================== */
    .no-results {
        text-align: center;
        padding: 48px 20px;
    }

    .no-results-icon {
        font-size: 44px;
        margin-bottom: 12px;
    }

    .no-results p {
        color: #9ca3af;
        font-size: 14px;
    }

    /* ========================================
       recharge.php — 充值样式（移动端）
       双栏布局已在 PC 端 @media 中回退为单栏，此处仅做全局补强
       ======================================== */

    /* 容器加固：确保在全局 media 中不残留 PC 端 max-width */
    .recharge-wrapper {
        max-width: 100% !important;
    }

    /* 余额卡片移动端微调 */
    .balance-label { font-size: 13px; }

    .balance-info { gap: 12px; }

    .balance-info-item .info-label { color: rgba(255, 255, 255, 0.5); }

    /* 预设按钮触控优化 */
    .preset-btn {
        -webkit-tap-highlight-color: transparent;
        -webkit-appearance: none;
    }

    .preset-btn:active {
        opacity: 0.8;
    }

    /* 提交按钮触控优化 */
    .submit-btn {
        -webkit-tap-highlight-color: transparent;
        -webkit-appearance: none;
    }

    .submit-btn:not(:disabled):active {
        opacity: 0.9;
    }

    /* 说明卡片（保留兼容） */
    .info-card {
        border-radius: 10px;
        padding: 16px 14px;
    }

    .info-card h3 {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .info-card p {
        font-size: 13px;
        margin-bottom: 6px;
        line-height: 1.6;
    }

    /* 记录链接移动端 */
    .records-link {
        padding: 12px 0;
        font-size: 14px;
    }

    /* ========================================
       recharge.php — 未配置提示
       ======================================== */
    .not-configured {
        background: #fef3c7;
        border: 1px solid #fcd34d;
        border-radius: 10px;
        padding: 14px 16px;
        color: #92400e;
        font-size: 14px;
        font-weight: 500;
        text-align: center;
    }

    /* ========================================
       upgrade.php — 升级样式
       【修复】h1 不在 .upgrade-container 内，已通过全局 h1 覆盖
       ======================================== */

    /* 当前等级卡片 */
    .current-level-card {
        background: #ffffff;
        border-radius: 12px;
        padding: 24px 20px;
        text-align: center;
        margin-bottom: 18px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .current-level-label {
        font-size: 13px;
        color: #9ca3af;
        margin-bottom: 8px;
    }

    .current-level-value {
        font-size: 28px;
        font-weight: 700;
        color: #3b82f6;
    }

    /* 等级选项列表 */
    .level-comparison {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 18px;
    }

    .level-card {
        position: relative;
        background: #ffffff;
        border: 2px solid #e5e7eb;
        border-radius: 12px;
        padding: 18px 16px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: border-color 0.15s;
    }

    .level-card.selected {
        border-color: #3b82f6;
        background: #f8faff;
    }

    .level-card.disabled {
        opacity: 0.45;
        pointer-events: none;
    }

    .level-card:not(.disabled):active {
        background: #f9fafb;
    }

    /* 选中勾 ✓ */
    .check-icon {
        display: none;
        position: absolute;
        top: 12px;
        right: 12px;
        width: 26px;
        height: 26px;
        border-radius: 50%;
        background: #3b82f6;
        color: #ffffff;
        font-size: 13px;
        font-weight: 700;
        line-height: 26px;
        text-align: center;
    }

    .level-card.selected .check-icon {
        display: block;
    }

    .level-badge {
        display: inline-block;
        padding: 4px 12px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 700;
        margin-bottom: 10px;
    }

    .level-name {
        font-size: 16px;
        font-weight: 700;
        color: #1f2937;
        margin-bottom: 8px;
    }

    .level-price {
        display: flex;
        align-items: baseline;
        gap: 8px;
        margin-bottom: 10px;
    }

    .price-original {
        font-size: 13px;
        color: #9ca3af;
        text-decoration: line-through;
    }

    .price-diff {
        font-size: 20px;
        font-weight: 700;
        color: #ef4444;
    }

    .level-desc {
        font-size: 12px;
        color: #6b7280;
        line-height: 1.6;
    }

    /* 提交按钮 #submitBtn (upgrade 专用细化) */
    #submitBtn {
        width: 100%;
        min-height: 48px;
        border: none;
        border-radius: 10px;
        background: #3b82f6;
        color: #ffffff;
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    #submitBtn:disabled {
        background: #d1d5db;
        color: #9ca3af;
        cursor: not-allowed;
    }

    #submitBtn:not(:disabled):active {
        background: #2563eb;
    }

    /* ========================================
       index.php — 登录/注册页
       ======================================== */
    body.auth-page {
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        min-height: 100dvh;
        background: #f0f2f5;
    }

    .auth-box {
        width: 100%;
        max-width: 380px;
        background: #ffffff;
        border-radius: 16px;
        padding: 32px 22px;
        margin: 16px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    }

    .auth-icon {
        font-size: 44px;
        text-align: center;
        margin-bottom: 12px;
        line-height: 1;
    }

    .auth-box h2 {
        font-size: 22px;
        font-weight: 700;
        text-align: center;
        color: #1f2937;
        margin-bottom: 6px;
    }

    .auth-subtitle {
        font-size: 13px;
        color: #9ca3af;
        text-align: center;
        margin-bottom: 24px;
    }

    .auth-box .form-group {
        margin-bottom: 16px;
    }

    .auth-box .form-group label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        color: #374151;
        margin-bottom: 6px;
    }

    .auth-box .form-control {
        width: 100%;
        min-height: 46px;
        padding: 12px 14px;
        border: 1px solid #d1d5db;
        border-radius: 10px;
        font-size: 15px;
        color: #1f2937;
        background: #ffffff;
        outline: none;
        -webkit-appearance: none;
        box-sizing: border-box;
    }

    .auth-box .form-control:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    }

    .auth-box .btn {
        width: 100%;
        min-height: 46px;
        border: none;
        border-radius: 10px;
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .auth-box .btn-primary {
        background: #3b82f6;
        color: #ffffff;
    }

    .auth-box .btn-success {
        background: #10b981;
        color: #ffffff;
    }

    .auth-box .btn:active {
        opacity: 0.85;
    }

    .auth-box .switch-link {
        text-align: center;
        margin-top: 18px;
        font-size: 13px;
        color: #6b7280;
    }

    .auth-box .switch-link a {
        color: #3b82f6;
        text-decoration: none;
        font-weight: 600;
    }

    /* ========================================
       通用 — 提示框 .alert
       ======================================== */
    .alert {
        padding: 12px 14px;
        border-radius: 10px;
        font-size: 13px;
        line-height: 1.5;
        margin-bottom: 14px;
    }

    .alert-success {
        background: #ecfdf5;
        border: 1px solid #a7f3d0;
        color: #065f46;
    }

    .alert-danger {
        background: #fef2f2;
        border: 1px solid #fecaca;
        color: #991b1b;
    }

    /* ========================================
       通用 — Badge .badge
       ======================================== */
    .badge {
        display: inline-block;
        padding: 3px 10px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
    }

    .badge-warning { background: #fef3c7; color: #92400e; }
    .badge-info    { background: #dbeafe; color: #1e40af; }
    .badge-success { background: #d1fae5; color: #065f46; }
    .badge-secondary { background: #f3f4f6; color: #374151; }

    /* ========================================
       通用 — 空状态 .empty-state
       ======================================== */
    .empty-state {
        text-align: center;
        padding: 48px 20px;
    }

    .empty-icon {
        font-size: 48px;
        margin-bottom: 14px;
    }

    .empty-state h3 {
        font-size: 16px;
        color: #374151;
        margin-bottom: 8px;
    }

    .empty-state p {
        font-size: 13px;
        color: #9ca3af;
    }

    /* ========================================
       通用 — h2 / h3
       ======================================== */
    h2 {
        font-size: 18px;
        font-weight: 700;
    }

    h3 {
        font-size: 16px;
        font-weight: 600;
    }

    /* ========================================
       通用 — 链接
       ======================================== */
    a {
        color: #3b82f6;
    }

    /* ========================================
       通用 — 滚动公告
       ======================================== */
    .scroll-announcement {
        font-size: 12px;
        padding: 6px 12px;
    }

}

@media print {
    .navbar,
    .mobile-bottom-nav,
    .btn,
    .quick-actions { display: none !important; }
}
