* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 a {
    color: white;
    text-decoration: none;
    font-size: 24px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

.main-nav ul li a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.3s;
}

.main-nav ul li a:hover {
    background: rgba(255,255,255,0.2);
}

.user-info {
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 20px;
}

.user-info .balance {
    font-weight: bold;
    font-size: 18px;
    color: #ffd700;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 40px 0;
}

/* 充值页面 */
.recharge-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.recharge-main {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.operator-selector h3, .amount-selector h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

.operator-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.operator-btn {
    display: inline-block;
    padding: 12px 30px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    text-decoration: none;
    color: #333;
}

.operator-btn:hover, .operator-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.amount-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.amount-btn {
    position: relative;
    cursor: pointer;
}

.amount-btn input {
    position: absolute;
    opacity: 0;
}

.amount-btn span {
    display: block;
    padding: 20px 15px;
    text-align: center;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s;
}

.amount-btn small {
    display: block;
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.amount-btn input:checked + span {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.phone-input {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.phone-input label {
    width: 100%;
    font-weight: bold;
    margin-bottom: 5px;
}

.phone-input input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
}

.btn-submit {
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
}

.recharge-info {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: fit-content;
}

.recharge-info ul {
    list-style: none;
    margin-top: 15px;
}

.recharge-info ul li {
    padding: 8px 0 8px 25px;
    position: relative;
}

.recharge-info ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4caf50;
}

/* 用户中心 */
.user-center {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

.user-sidebar {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    height: fit-content;
}

.avatar-placeholder {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
}

.user-balance {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.user-balance strong {
    font-size: 24px;
    color: #667eea;
}

.user-stats {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.user-orders {
    grid-column: 2;
    background: white;
    border-radius: 15px;
    padding: 25px;
}

.orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-new-order {
    display: inline-block;
    padding: 8px 20px;
    background: #28a745;
    color: white;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
}

/* 表格 */
.orders-table, .data-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th, .orders-table td,
.data-table th, .data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.orders-table th, .data-table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* 状态标签 */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-block;
}
.status-success { background: #d4edda; color: #155724; }
.status-pending { background: #fff3cd; color: #856404; }
.status-processing { background: #d1ecf1; color: #0c5460; }
.status-failed { background: #f8d7da; color: #721c24; }
.status-refunded { background: #e2d5f5; color: #6f42c1; }
.status-cancelled { background: #e9ecef; color: #6c757d; }

/* 登录注册 */
.auth-container {
    max-width: 450px;
    margin: 0 auto;
}

.auth-box {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 30px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.btn-auth {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
}

/* 管理后台 */
.admin-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
}

.admin-sidebar {
    background: white;
    border-radius: 15px;
    padding: 20px;
    height: fit-content;
}

.admin-sidebar h3 {
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 15px;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar ul li {
    margin-bottom: 10px;
}

.admin-sidebar ul li a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.admin-sidebar ul li a:hover,
.admin-sidebar ul li a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.admin-main {
    background: white;
    border-radius: 15px;
    padding: 25px;
}

.welcome-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card-admin {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-card-admin .stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #667eea;
}

.stat-card-admin .stat-label {
    color: #666;
    margin-top: 8px;
}

.section-title {
    font-size: 18px;
    margin: 20px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar input, .filter-bar select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.filter-bar button {
    padding: 8px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* 操作按钮 */
.btn-action {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin: 0 2px;
    text-decoration: none;
    display: inline-block;
}
.btn-refund { background: #ffc107; color: #333; }
.btn-retry { background: #17a2b8; color: white; }
.btn-view { background: #6c757d; color: white; }
.btn-adjust { background: #28a745; color: white; }

.btn-save {
    background: #28a745;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.btn-cancel {
    background: #6c757d;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}
.pagination a, .pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    color: #667eea;
}
.pagination .current {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 提示框 */
.alert {
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.message-box {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 100px auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fff;
    margin: 50px auto;
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    animation: slideDown 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

/* 表单控件 */
.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.hint {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.checkbox label {
    display: inline-block;
    margin-left: 10px;
}

.checkbox input {
    width: auto;
}

/* 产品状态切换 */
.status-toggle {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
}
.status-on { background: #d4edda; color: #155724; }
.status-off { background: #f8d7da; color: #721c24; }

/* 图表 */
.chart-container {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}
.chart-bar-item {
    margin-bottom: 10px;
}
.chart-bar-label {
    display: inline-block;
    width: 60px;
}
.chart-bar {
    display: inline-block;
    height: 25px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    color: white;
    line-height: 25px;
    padding-left: 10px;
    font-size: 12px;
}

/* 系统设置表单 */
.settings-form {
    max-width: 600px;
}
.settings-group {
    margin-bottom: 20px;
}
.settings-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.empty-orders {
    text-align: center;
    padding: 60px 20px;
}

.btn-go-recharge {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 30px;
    background: #667eea;
    color: white;
    border-radius: 25px;
    text-decoration: none;
}

/* Footer */
.main-footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* 响应式 */
@media (max-width: 768px) {
    .recharge-container, .user-center, .admin-container {
        grid-template-columns: 1fr;
    }
    .user-stats, .user-orders {
        grid-column: 1;
    }
    .main-header .container {
        flex-direction: column;
        gap: 15px;
    }
    .amount-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    .modal-content {
        width: 95%;
        margin: 30px auto;
    }
}
/* ========== Logo 区域样式 ========== */
.logo-area {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: opacity 0.3s;
}

.logo-link:hover {
    opacity: 0.9;
}

.logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    padding: 5px;
}

.logo-text {
    font-size: 20px;
    font-weight: bold;
    color: white;
    letter-spacing: 1px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .logo-img {
        width: 40px;
        height: 40px;
    }
    .logo-text {
        font-size: 16px;
    }
}