/* 雨烟商户助手 H5 样式 */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { height:100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f5f7;
    color: #333;
    font-size: 14px;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    padding-bottom: 70px;
}
a { text-decoration:none; color:inherit; }
img { display:block; max-width:100%; }
button { border:none; outline:none; cursor:pointer; font-family:inherit; }
input, textarea, select { font-family:inherit; outline:none; border:none; }

/* 主题色 */
:root {
    --primary: #FFB800;
    --primary-dark: #F5A623;
    --primary-light: #FFF3D6;
    --bg-warm: #FFF9EC;
    --text-main: #1a1a1a;
    --text-sub: #999;
    --border: #eee;
    --danger: #ff3b30;
    --success: #34c759;
}

/* 顶部导航 */
.top-bar {
    background: linear-gradient(135deg, #FFD54F 0%, #FFB800 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.top-bar .back-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #333;
}
.top-bar .title {
    flex: 1;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
}
.top-bar .right-action {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}

/* 页面头部 - 暖黄色渐变背景 */
.page-header {
    background: linear-gradient(180deg, #FFE8A3 0%, #FFF9EC 60%, #f5f5f7 100%);
    padding: 0 16px 16px;
}

/* 搜索栏 */
.search-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 0;
}
.search-box {
    flex: 1;
    background: #fff;
    border-radius: 24px;
    padding: 10px 16px;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.search-box input {
    flex: 1; background: transparent; font-size: 14px;
}
.search-box .search-icon { color: #999; font-size: 16px; }
.cs-btn {
    width: 40px; height: 40px;
    background: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* 轮播图 */
.carousel {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    aspect-ratio: 2.5/1;
    background: #fff;
}
.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    height: 100%;
}
.carousel-slide {
    min-width: 100%;
    height: 100%;
}
.carousel-slide img {
    width: 100%; height: 100%; object-fit: cover;
}
.carousel-dots {
    position: absolute;
    bottom: 8px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 6px;
}
.carousel-dots span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: all 0.3s;
}
.carousel-dots span.active {
    width: 18px; border-radius: 3px;
    background: #fff;
}

/* 分类标签 */
.category-tabs {
    display: flex; gap: 10px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display:none; }
.category-tab {
    padding: 8px 20px;
    border-radius: 20px;
    background: #fff;
    font-size: 14px;
    white-space: nowrap;
    color: #666;
    transition: all 0.2s;
}
.category-tab.active {
    background: #1a1a1a;
    color: #fff;
}

/* 商品网格 */
.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px 16px;
}
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.product-card .product-img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: var(--bg-warm);
}
.product-card .product-info {
    padding: 10px;
}
.product-card .product-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 40px;
}
.product-card .product-bottom {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 8px;
}
.product-card .price {
    color: var(--danger);
    font-size: 18px;
    font-weight: 700;
}
.product-card .price small { font-size: 12px; }
.product-card .original-price {
    color: #bbb;
    font-size: 12px;
    text-decoration: line-through;
    margin-left: 4px;
}
.product-card .sales {
    color: #999;
    font-size: 12px;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    display: flex;
    border-top: 1px solid #f0f0f0;
    padding: 6px 0 env(safe-area-inset-bottom, 8px);
    z-index: 100;
}
.nav-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 4px 0;
    color: #999;
    font-size: 11px;
}
.nav-item .nav-icon { font-size: 22px; }
.nav-item.active { color: var(--primary-dark); }

/* 分类页 */
.category-section {
    margin: 12px 16px;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
}
.category-section .section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f5f5f5;
}
.game-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.game-product-item {
    text-align: center;
}
.game-product-item .gp-img {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 12px;
    object-fit: cover;
    background: var(--bg-warm);
    margin-bottom: 6px;
}
.game-product-item .gp-name {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 分类页Tab切换 */
.view-tabs {
    display: flex;
    margin: 12px 16px;
    background: #fff;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}
.view-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    font-size: 15px;
    color: #666;
}
.view-tab.active {
    background: #1a1a1a;
    color: #fff;
}

/* 我的页面 */
.profile-header {
    background: linear-gradient(180deg, #FFE8A3 0%, #FFF9EC 100%);
    padding: 20px 16px;
    position: relative;
}
.profile-header .settings-btn {
    position: absolute; top: 16px; right: 16px;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #666;
}
.profile-info {
    display: flex; align-items: center; gap: 12px;
}
.profile-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: #ddd;
}
.profile-name {
    font-size: 20px;
    font-weight: 700;
    display: flex; align-items: center; gap: 8px;
}
.profile-level {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.profile-id {
    color: #999;
    font-size: 13px;
    margin-top: 4px;
}
.role-switch-btn {
    margin-left: auto;
    background: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    display: flex; align-items: center; gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* 订单状态卡片 */
.order-card {
    margin: 12px 16px;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    position: relative;
}
.order-card .card-title {
    position: absolute;
    top: -10px; left: 12px;
    background: var(--primary);
    color: #333;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
}
.order-card .card-more {
    position: absolute; top: 16px; right: 16px;
    color: #999; font-size: 13px;
}
.order-status-list {
    display: flex;
    margin-top: 8px;
}
.order-status-item {
    flex: 1;
    text-align: center;
    color: #666;
}
.order-status-item .os-icon {
    font-size: 26px;
    margin-bottom: 4px;
}
.order-status-item .os-text {
    font-size: 12px;
}

/* 余额和客服 */
.action-row {
    display: flex; gap: 12px;
    margin: 0 16px 12px;
}
.action-box {
    flex: 1;
    border-radius: 12px;
    padding: 16px;
    color: #fff;
}
.action-box.balance-box {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
}
.action-box.cs-box {
    background: linear-gradient(135deg, #FFD54F, #FFB800);
    color: #333;
}
.action-box .ab-label {
    font-size: 13px;
    opacity: 0.8;
    display: flex; align-items: center; gap: 4px;
}
.action-box .ab-value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 8px;
}

/* 更多功能 */
.more-functions {
    margin: 0 16px 16px;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
}
.more-functions .mf-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}
.func-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 0;
}
.func-item {
    text-align: center;
    color: #666;
}
.func-item .fi-icon {
    font-size: 26px;
    margin-bottom: 4px;
}
.func-item .fi-text {
    font-size: 12px;
}

/* 消息页 */
.msg-tabs {
    display: flex;
    margin: 12px 16px;
    background: #fff;
    border-radius: 12px;
    padding: 4px;
}
.msg-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    font-size: 15px;
    color: #666;
}
.msg-tab.active {
    background: #1a1a1a;
    color: #fff;
}
.msg-list {
    margin: 0 16px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}
.msg-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f8f8f8;
}
.msg-item:last-child { border-bottom:none; }
.msg-avatar {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: var(--primary-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.msg-content { flex:1; }
.msg-name { font-size:15px; font-weight:600; }
.msg-preview { font-size:13px; color:#999; margin-top:2px; }
.msg-action { font-size:13px; color:var(--primary-dark); }

/* 接单大厅 */
.hall-header {
    background: linear-gradient(180deg, #FFD54F 0%, #FFE8A3 100%);
    padding: 12px 16px;
}
.hall-search {
    background: #fff;
    border-radius: 24px;
    padding: 10px 16px;
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px;
}
.hall-search input { flex:1; background:transparent; font-size:14px; }
.hall-filters {
    display: flex; gap: 8px;
    margin-bottom: 10px;
}
.hall-filter {
    padding: 8px 20px;
    border-radius: 8px;
    background: rgba(255,255,255,0.6);
    font-size: 14px;
    color: #666;
}
.hall-filter.active {
    background: #1a1a1a;
    color: #fff;
}
.order-card-hall {
    margin: 12px 16px;
    background: #FFF9E6;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #FFE8A3;
}
.order-card-hall .och-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px;
}
.order-card-hall .och-zone {
    font-size: 16px; font-weight: 700;
}
.order-card-hall .och-fee {
    color: var(--primary-dark);
    font-size: 14px;
}
.order-card-hall .och-product {
    display: flex; gap: 12px;
    margin-bottom: 12px;
}
.order-card-hall .och-img {
    width: 72px; height: 72px;
    border-radius: 10px;
    object-fit: cover;
    background: #fff;
}
.order-card-hall .och-info { flex:1; }
.order-card-hall .och-title {
    font-size: 16px; font-weight: 600; margin-bottom: 4px;
}
.order-card-hall .och-desc {
    font-size: 13px; color: #999;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
}
.order-card-hall .och-price {
    color: var(--danger);
    font-size: 18px; font-weight: 700;
    margin-top: 4px;
}
.order-card-hall .och-fields {
    border-top: 1px dashed #FFE8A3;
    padding-top: 10px;
}
.och-field {
    display: flex; justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}
.och-field .label { color: #666; }
.och-field .value { color: #333; font-weight: 500; }
.och-field .value.hidden { color: #ccc; }
.och-field .value.amount { color: var(--danger); font-weight: 700; }
.och-actions {
    display: flex; justify-content: flex-end;
    margin-top: 12px;
}
.btn-primary {
    background: linear-gradient(135deg, #FFD54F, #FFB800);
    color: #333;
    padding: 10px 32px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
}
.btn-primary:disabled {
    opacity: 0.5;
}
.btn-lock {
    background: #ccc;
    color: #fff;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
}

/* 通用按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}
.btn-block { width:100%; }
.btn-dark { background:#1a1a1a; color:#fff; }
.btn-outline { background:#fff; border:1px solid #ddd; color:#333; }
.btn-danger { background:var(--danger); color:#fff; }
.btn-sm { padding:6px 14px; font-size:12px; }

/* 表单 */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}
.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--primary); }
textarea.form-input { min-height: 80px; resize: vertical; }
select.form-input { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L2 4h8z' fill='%23999'/%3E%3C/svg%3E") no-repeat right 14px center; }

/* 卡片 */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 16px;
}

/* 弹窗 */
.modal-overlay {
    position: fixed; top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex; align-items: flex-end;
    justify-content: center;
}
.modal-content {
    background: #fff;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { font-size: 22px; color: #999; background:none; }

/* 身份切换弹窗 */
.role-option {
    display: flex; align-items: center; gap: 12px;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 2px solid transparent;
    background: #f9f9f9;
}
.role-option.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, #FFF9E6, #FFF3D6);
}
.role-radio {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid #ddd;
    display: flex; align-items: center; justify-content: center;
}
.role-option.selected .role-radio {
    border-color: var(--primary-dark);
}
.role-radio::after {
    content: '';
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--primary-dark);
    display: none;
}
.role-option.selected .role-radio::after { display:block; }
.role-option .ro-info { flex:1; }
.role-option .ro-name { font-size:17px; font-weight:600; }
.role-option .ro-desc { font-size:13px; color:#999; margin-top:2px; }

/* 登录注册页 */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #FFE8A3 0%, #FFF9EC 30%, #f5f5f7 100%);
    padding: 40px 24px;
}
.auth-logo {
    text-align: center;
    margin-bottom: 40px;
}
.auth-logo h1 {
    font-size: 28px;
    color: #333;
    margin-top: 12px;
}
.auth-logo p { color: #999; margin-top: 8px; }
.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.auth-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}
.auth-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-size: 16px;
    color: #999;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.auth-tab.active {
    color: #333;
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.auth-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #FFD54F, #FFB800);
    color: #333;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
}
.auth-link {
    text-align: center;
    margin-top: 16px;
    color: var(--primary-dark);
    font-size: 14px;
}
.code-row {
    display: flex; gap: 10px;
}
.code-row .form-input { flex:1; }
.code-btn {
    padding: 0 16px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
}
.code-btn:disabled { opacity:0.5; }

/* 排行榜 */
.rank-tabs {
    display: flex;
    margin: 12px 16px;
    background: #fff;
    border-radius: 12px;
    padding: 4px;
}
.rank-tab {
    flex:1; text-align:center; padding:10px;
    border-radius:10px; font-size:14px; color:#666;
}
.rank-tab.active { background:#1a1a1a; color:#fff; }
.rank-list { margin: 0 16px; }
.rank-item {
    display: flex; align-items: center; gap: 12px;
    background: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
}
.rank-num {
    width: 28px; text-align: center;
    font-size: 16px; font-weight: 700; color: #999;
}
.rank-item:nth-child(1) .rank-num { color: #FFD700; }
.rank-item:nth-child(2) .rank-num { color: #C0C0C0; }
.rank-item:nth-child(3) .rank-num { color: #CD7F32; }
.rank-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
}
.rank-name { flex:1; font-weight:500; }
.rank-value { color: var(--danger); font-weight: 700; }

/* 商品详情/下单页 */
.detail-img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: var(--bg-warm);
}
.detail-info {
    background: #fff;
    padding: 16px;
    margin-bottom: 10px;
}
.detail-price {
    color: var(--danger);
    font-size: 24px;
    font-weight: 700;
}
.detail-price small { font-size: 14px; }
.detail-title {
    font-size: 18px;
    font-weight: 600;
    margin: 8px 0;
    line-height: 1.5;
}
.detail-meta {
    color: #999;
    font-size: 13px;
}
.detail-section {
    background: #fff;
    padding: 16px;
    margin-bottom: 10px;
}
.detail-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
}
.bottom-bar-action {
    position: fixed;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    display: flex; gap: 10px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 100;
}
.bottom-bar-action .btn { flex:1; }

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-state .es-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* Toast */
.toast {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    pointer-events: none;
}

/* 俱乐部入口页 */
.club-entry {
    min-height: 100vh;
    background: linear-gradient(180deg, #FFE8A3, #FFF9EC);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 20px;
}
.club-entry h1 { font-size: 28px; margin-bottom: 8px; }
.club-entry p { color: #666; margin-bottom: 30px; }
.club-entry .btn { width: 260px; margin-bottom: 12px; }

/* 协议页 */
.agreement-box {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 16px;
    max-height: 50vh;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.8;
    color: #666;
}
.check-row {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px;
    font-size: 14px;
}
.check-row input[type=checkbox] { width:18px; height:18px; accent-color: var(--primary); }

/* 数字徽章 */
.badge {
    display: inline-block;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
}

/* 列表项 */
.list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid #f8f8f8;
}
.list-item:last-child { border-bottom:none; }
.list-item .li-icon { font-size: 20px; width:24px; text-align:center; }
.list-item .li-text { flex:1; font-size:15px; }
.list-item .li-arrow { color:#ccc; }
.list-item .li-value { color:#999; font-size:13px; }

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}
.tag-warning { background:#FFF3D6; color:#F5A623; }
.tag-success { background:#E8F8EC; color:#34c759; }
.tag-danger { background:#FFE8E6; color:#ff3b30; }
.tag-info { background:#E6F0FF; color:#007aff; }
