/* ============================================
   极速陪玩 - UI重制版（参考紫色渐变风格）
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --bg: #f5f7fa;
    --card: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --radius: 16px;
    --radius-sm: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 70px;
}

/* ============ 通用 ============ */
.container {
    padding: 15px;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.btn {
    display: block;
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}

.btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 7px 18px;
    font-size: 13px;
    width: auto;
    display: inline-block;
    border-radius: 20px;
}

.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-muted { color: var(--text-light); }
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

/* ============ 顶部导航 ============ */
.navbar {
    background: var(--primary-gradient);
    color: #fff;
    padding: 15px;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ============ Banner轮播 ============ */
.banner {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    margin: 0 15px 15px;
    border-radius: var(--radius);
    padding: 30px 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(102,126,234,0.3);
}

.banner::after {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.banner h1 {
    font-size: 22px;
    margin-bottom: 6px;
}

.banner p {
    opacity: 0.9;
    font-size: 13px;
}

.banner-dots {
    position: absolute;
    bottom: 12px;
    left: 20px;
    display: flex;
    gap: 5px;
}

.banner-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
}

.banner-dots span.active {
    background: #fff;
    width: 18px;
    border-radius: 3px;
}

/* ============ 功能入口九宫格 ============ */
.func-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 16px;
    background: var(--card);
    margin: 0 15px 15px;
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.func-item {
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s;
}

.func-item:active {
    transform: scale(0.95);
}

.func-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 6px;
}

.func-icon.purple { background: #ede9fe; }
.func-icon.yellow { background: #fef3c7; }
.func-icon.green { background: #d1fae5; }
.func-icon.gray { background: #f3f4f6; }

.func-label {
    font-size: 12px;
    color: var(--text-light);
}

/* ============ 公告条 ============ */
.notice-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin: 0 15px 15px;
    background: #fefce8;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: #92400e;
}

/* ============ 区块标题（带竖线） ============ */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    margin: 20px 0 12px;
}

.section-title h3 {
    font-size: 16px;
    font-weight: 700;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
}

.section-title .more {
    font-size: 12px;
    color: var(--text-light);
    text-decoration: none;
}

/* ============ 游戏分类横滑 ============ */
.game-scroll {
    display: flex;
    gap: 12px;
    padding: 0 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.game-item {
    flex-shrink: 0;
    width: 72px;
    text-align: center;
    text-decoration: none;
}

.game-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s;
}

.game-item.active .game-icon {
    background: var(--primary-gradient);
    color: #fff;
    transform: scale(1.05);
}

.game-name {
    font-size: 12px;
    color: var(--text-light);
}

.game-item.active .game-name {
    color: var(--primary);
    font-weight: 600;
}

/* ============ 筛选标签 ============ */
.filter-tabs {
    display: flex;
    gap: 10px;
    padding: 12px 15px 0;
}

.filter-tab {
    padding: 6px 20px;
    background: var(--card);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-light);
    text-decoration: none;
    border: 1px solid var(--border);
}

.filter-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ============ 陪玩师卡片 ============ */
.payer-card {
    display: flex;
    padding: 14px;
    background: var(--card);
    border-radius: var(--radius);
    margin: 0 15px 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.payer-card:active {
    transform: scale(0.99);
}

.payer-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    flex-shrink: 0;
    margin-right: 12px;
}

.payer-info {
    flex: 1;
    overflow: hidden;
}

.payer-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.payer-name {
    font-size: 15px;
    font-weight: 600;
}

.payer-rating {
    font-size: 12px;
    color: #f59e0b;
}

.payer-desc {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.payer-tags {
    margin-bottom: 8px;
}

.payer-tags span {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    background: #ede9fe;
    color: var(--primary);
    border-radius: 10px;
    margin-right: 4px;
}

.payer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.payer-price {
    color: var(--danger);
    font-weight: 700;
    font-size: 16px;
}

.payer-price small {
    font-size: 11px;
    font-weight: normal;
    color: var(--text-light);
}

/* ============ 表单 ============ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-light);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    background: var(--card);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* ============ 状态标签 ============ */
.status-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-accepted { background: #dbeafe; color: #1e40af; }
.status-in_service { background: #e0e7ff; color: #4338ca; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* ============ 钱包 ============ */
.wallet-card {
    background: var(--primary-gradient);
    color: #fff;
    padding: 25px 20px;
    border-radius: var(--radius);
    margin: 15px;
    box-shadow: 0 4px 20px rgba(102,126,234,0.3);
}

.wallet-card .label {
    font-size: 13px;
    opacity: 0.9;
}

.wallet-card .amount {
    font-size: 36px;
    font-weight: 700;
    margin: 5px 0;
}

.wallet-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.wallet-actions .btn {
    flex: 1;
}

/* ============ 个人中心 ============ */
.user-header {
    background: var(--primary-gradient);
    color: #fff;
    padding: 35px 20px 25px;
    text-align: center;
    border-radius: 0 0 25px 25px;
}

.user-avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 10px;
}

.menu-list {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 15px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s;
}

.menu-item:active {
    background: #f9fafb;
}

.menu-item:last-child {
    border-bottom: none;
}

/* ============ 底部导航 ============ */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--card);
    display: flex;
    border-top: 1px solid var(--border);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
}

.tabbar a {
    flex: 1;
    text-align: center;
    color: var(--text-light);
    text-decoration: none;
    font-size: 11px;
    position: relative;
}

.tabbar a.active {
    color: var(--primary);
}

.tabbar a .icon {
    font-size: 22px;
    display: block;
    margin-bottom: 2px;
}

.tabbar .badge {
    position: absolute;
    top: -2px;
    right: 22%;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 16px;
}

/* ============ 提示 ============ */
.alert {
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    margin: 0 15px 15px;
    font-size: 13px;
}

.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* ============ 空状态 ============ */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty .icon {
    font-size: 50px;
    margin-bottom: 15px;
}

/* ============ 充值金额选择 ============ */
.amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.amount-item {
    text-align: center;
    padding: 18px 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card);
}

.amount-item.selected {
    border-color: var(--primary);
    background: #ede9fe;
}

.amount-item:active {
    transform: scale(0.97);
}

.amount-item .num {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

/* ============ 支付方式 ============ */
.pay-method {
    display: flex;
    align-items: center;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.pay-method.selected {
    border-color: var(--primary);
    background: #ede9fe;
}

.pay-method input {
    margin-right: 10px;
}

/* ============ 后台管理 ============ */
.admin-body {
    max-width: 100%;
    background: #f0f2f5;
}

.admin-container {
    padding: 20px;
}

.admin-header {
    background: #1e1b4b;
    color: #fff;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.admin-header a {
    color: #fff;
    text-decoration: none;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-card .num {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .label {
    color: var(--text-light);
    font-size: 12px;
    margin-top: 5px;
}

.admin-table {
    width: 100%;
    background: #fff;
    border-radius: 10px;
    border-collapse: collapse;
    overflow: hidden;
}

.admin-table th, .admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.admin-table th {
    background: #f9fafb;
    font-weight: 600;
}
