﻿/**
 * BWIN Telegram Mini App - Mobile Styles
 * 移动端样式文件
 */

/* ========== CSS 变量 ========== */
:root {
    /* 颜色 - 赛博朋克调色板 */
    --primary-color: #F0B90B;
    --accent-color: #FCD535;
    
    /* 霓虹辅助色 */
    --neon-purple: #B026FF;
    --neon-green: #39FF14;
    --neon-blue: #00FFFF;
    
    /* 背景色升级 */
    --dark-bg: #050510; /* 更深邃的蓝黑背景 */
    --dark-surface: rgba(30, 35, 45, 0.6); /* 半透明玻璃 */
    --dark-card: rgba(40, 45, 55, 0.8);
    
    --text-primary: #FFFFFF;
    --text-secondary: #B7BDC6;
    --border-color: rgba(255, 255, 255, 0.1); /* 边框也改为半透明 */
    
    /* 间距 */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* 字体 */
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    
    /* Z-index */
    --z-navbar: 1000;
    --z-bottom-nav: 1000;
    --z-modal: 2000;
    --z-loading: 9999;
}

/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--dark-bg);
    /* 赛博朋克背景：深色 + 径向渐变光晕 */
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(176, 38, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(57, 255, 20, 0.08) 0%, transparent 40%);
    background-attachment: fixed; /* 背景固定，营造深度 */
    color: var(--text-primary);
    font-size: var(--font-size-md);
    line-height: 1.5;
}

/* ========== 布局 ========== */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(15, 15, 25, 0.8); /* 半透明 */
    backdrop-filter: blur(12px); /* 磨砂效果 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
    z-index: var(--z-navbar);
}

.nav-brand .logo {
    font-size: 24px;
    font-weight: 800; /* 更粗的字重 */
    font-family: 'Montserrat', 'Segoe UI', sans-serif; /* 建议使用更现代的字体 */
    letter-spacing: 1px;
    
    /* 赛博朋克流光渐变文字 */
    background: linear-gradient(
        90deg, 
        #F0B90B 0%,   /* 黄 */
        #39FF14 50%,  /* 绿 */
        #B026FF 100%  /* 紫 */
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* 霓虹发光阴影 (文字本身透明，阴影给颜色) */
    filter: drop-shadow(0 0 5px rgba(240, 185, 11, 0.5));
    
    /* 缓慢的流光动画 */
    animation: logoFlow 5s linear infinite;
}

@keyframes logoFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.nav-balance {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    align-items: flex-end;
    height: 100%;
}

/* 导航栏余额项目 */
.nav-balance .balance-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    width: 125px; /* 使用固定宽度确保左对齐 */
}

.nav-balance .balance-item span {
    font-size: 17px;
}


/* 其他页面的 balance-item 保持原样 */
.balance-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.balance-item .balance-icon {
    font-size: 16px;
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: var(--spacing-xs);
}

.main-content {
    flex: 1;
    margin-top: 56px;
    margin-bottom: 64px;
    overflow-y: auto;
    overflow-x: hidden;
}

.container {
    padding: var(--spacing-md);
    max-width: 600px;
    margin: 0 auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* ========== 底部导航栏 ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(15, 15, 25, 0.85); /* 半透明 */
    backdrop-filter: blur(12px); /* 磨砂效果 */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: var(--z-bottom-nav);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-sm);
    transition: color 0.2s;
    min-width: 0;
}

.nav-item.active {
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(252, 213, 53, 0.6); /* 激活状态发光 */
}

/* SVG图标样式 */
.nav-icon {
    width: 28px;
    height: 28px;
}

/* Emoji图标样式 */
.nav-emoji {
    font-size: 28px;
    width: auto;
    height: auto;
    display: block;
}

/* ========== 卡片 (玻璃拟态升级) ========== */
.card {
    background: var(--dark-surface);
    backdrop-filter: blur(10px); /* 磨砂效果 */
    border: 1px solid rgba(255, 255, 255, 0.08); /* 微弱的白边 */
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2); /* 更柔和的阴影 */
    /* 文本换行支持 */
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.card h3,
.card p {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* NestFun.club 品牌配色边框（主页卡片专用 - 升级版）*/
.card.brand-border {
    border: 1px solid rgba(255, 255, 255, 0.1); /* 基础边框 */
    position: relative;
    overflow: hidden; /* 防止光晕溢出 */
}

/* 霓虹发光层 */
.card.brand-border::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: var(--radius-md);
    padding: 1px; /* 边框宽度 */
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* 黄色边框 - Nest (带发光) */
.card.brand-border-yellow {
    box-shadow: 0 0 20px rgba(252, 213, 53, 0.15);
}
.card.brand-border-yellow::before {
    background: linear-gradient(135deg, rgba(252, 213, 53, 0.8), rgba(252, 213, 53, 0.1));
}

/* 蓝色边框 - Fun (带发光) */
.card.brand-border-blue {
    box-shadow: 0 0 20px rgba(33, 150, 243, 0.15);
}
.card.brand-border-blue::before {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.8), rgba(33, 150, 243, 0.1));
}

/* 白色边框 - .club (带发光) */
.card.brand-border-white {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}
.card.brand-border-white::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.1));
}

.card.clickable {
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card.clickable:active {
    background: var(--dark-card);
}

.card-title {
    font-size: var(--font-size-md);
    font-weight: 600;
}

.card-arrow {
    font-size: 24px;
    color: var(--text-secondary);
}

/* ========== 用户卡片 ========== */
.user-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    /* 赛博头像框：双色渐变边框 */
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-green));
    padding: 2px; /* 边框宽度 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(176, 38, 255, 0.4); /* 紫色光晕 */
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%; /* 确保图片也是圆的 */
    object-fit: cover;
    display: block;
    background: var(--dark-bg); /* 防止透明图片透出背景色 */
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 4px;
}

.user-id {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* ========== 余额卡片 ========== */
.balance-card {
    padding: var(--spacing-lg);
}

.balance-grid {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.balance-item {
    flex: 1;
    text-align: center;
}

.balance-divider-vertical {
    width: 1px;
    height: 50px;
    background: var(--border-color);
    flex-shrink: 0;
}

.balance-info {
    width: 100%;
}

.balance-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.balance-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--accent-color);
    font-family: 'Courier New', monospace; /* 科技感等宽字体 */
    text-shadow: 0 0 10px rgba(252, 213, 53, 0.5); /* 金色发光 */
    letter-spacing: 0.5px;
}

/* ========== 按钮 ========== */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.btn {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: none;
    font-size: var(--font-size-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #000; /* 深色文字对比度更高 */
    box-shadow: 0 0 15px rgba(252, 213, 53, 0.4); /* 发光阴影 */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 0 25px rgba(252, 213, 53, 0.6); /* 点击时更亮 */
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 10px rgba(252, 213, 53, 0.1); /* 微弱发光 */
}

.btn-outline:active {
    background: rgba(240, 185, 11, 0.1);
    box-shadow: 0 0 15px rgba(252, 213, 53, 0.3);
}

/* ========== Toast 通知 ========== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: rgba(11, 14, 17, 0.95);
    color: #FCD535;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(252, 213, 53, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 85%;
    text-align: center;
    backdrop-filter: blur(10px);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== 我的页面头部 ========== */
.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.profile-header h1 {
    margin-bottom: 0;
}

.profile-header #tonConnectButton {
    flex-shrink: 0;
}



/* ========== 响应式 ========== */
@media (max-width: 360px) {
    :root {
        --font-size-xs: 11px;
        --font-size-sm: 13px;
        --font-size-md: 15px;
        --font-size-lg: 17px;
        --font-size-xl: 22px;
    }
    
    .container {
        padding: var(--spacing-sm);
    }
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--dark-card);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

/* ========== 标题 ========== */
h1 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
}

h2 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

h3 {
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

/* ========== 游戏页面 ========== */
#gamePage {
    padding: 0 !important;
}

#gamePage .container {
    padding: var(--spacing-md);
}

/* 游戏列表视图 */
#gameListView {
    display: block;
}

/* 游戏运行视图 */
#gamePlayView {
    width: 100%;
    position: fixed;
    top: 56px; /* navbar 高度 */
    left: 0;
    right: 0;
    bottom: 64px; /* bottom-nav 高度 */
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    background: var(--dark-bg);
}

/* 游戎工具栏 */
.game-toolbar {
    height: 50px;
    background: var(--dark-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: stretch; /* 改为stretch让子元素填满高度 */
    justify-content: space-between;
    padding: 0; /* 移除padding让边框到达边缘 */
    flex-shrink: 0;
    gap: 0; /* 移除间距让边框紧密相连 */
}

.toolbar-btn {
    background: transparent;
    border: 3px solid #FCD535; /* Nest黄色边框 */
    border-radius: 0; /* 直角边框 */
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0; /* 移除padding让边框填满 */
    transition: all 0.2s;
    box-shadow: 0 0 12px rgba(252, 213, 53, 0.5);
    flex: 1; /* 占据剩余空间 */
    height: 100%; /* 填满高度 */
}

.toolbar-btn:active {
    transform: scale(0.95);
}

.toolbar-btn span:first-child {
    font-size: 24px;
}

.toolbar-exit {
    color: var(--text-secondary);
    border-color: #FFFFFF !important; /* Club白色边框 */
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.5) !important;
}

.toolbar-exit span:first-child {
    font-size: 24px;
    font-weight: 300;
}

.toolbar-exit:hover {
    color: var(--primary-color);
}

/* Jackpot 徽章样式 */
.game-jackpot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 16px;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15), rgba(33, 150, 243, 0.25));
    border: 3px solid #2196F3; /* 加粗边框 */
    border-radius: 0; /* 直角边框 */
    box-shadow: 0 0 12px rgba(33, 150, 243, 0.5);
    flex: 2; /* JP占据更多空间 */
    height: 100%; /* 填满高度 */
}

.jackpot-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ff3333;
    text-transform: uppercase;
    margin-bottom: 2px;
    text-shadow: 0 0 8px rgba(255, 51, 51, 0.8),
                 0 0 15px rgba(255, 51, 51, 0.6);
}

.jackpot-amount {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(
        90deg,
        #00FFFF 0%,   /* Cyan */
        #0080FF 33%,  /* Blue */
        #FF00FF 66%,  /* Pink/Magenta */
        #00FFFF 100%  /* Cyan */
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.6)); /* 增强发光 */
    animation: gradientScroll 3s linear infinite, jackpotBlink 1.5s ease-in-out infinite;
}

/* 渐变滚动动画 */
@keyframes gradientScroll {
    0% {
        background-position: 200% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 闪烁动画 */
@keyframes jackpotBlink {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.9));
    }
    50% {
        opacity: 0.7;
        filter: drop-shadow(0 0 20px rgba(0, 255, 255, 1)) 
                drop-shadow(0 0 30px rgba(255, 0, 255, 0.8));
    }
}

/* 旋转动画 (用于刷新按钮) */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 更新时的高光闪烁效果 */
.jackpot-amount.updating {
    animation: flashBlink 0.1s ease-in-out 8 !important;
    background-position: 50% 50% !important;
}

@keyframes flashBlink {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        filter: drop-shadow(0 0 25px rgba(255, 255, 255, 1))
                drop-shadow(0 0 40px rgba(0, 255, 255, 1));
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
        filter: drop-shadow(0 0 50px rgba(255, 255, 255, 1))
                drop-shadow(0 0 60px rgba(0, 255, 255, 1));
    }
}

#party-crisis-game-container {
    width: 100%;
    height: 100%;
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #0a0a0a;
}

#game-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #0a0a0a;
    z-index: 1;
}

/* 4宫格游戏布局 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

/* 游戏卡片 */
.game-card {
    background: var(--dark-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-card:active {
    transform: scale(0.95);
}

.game-card:not(.coming-soon):hover {
    box-shadow: 0 0 20px rgba(240, 185, 11, 0.4);
    transform: translateY(-2px);
    border: 1px solid rgba(240, 185, 11, 0.5); /* 悬停时边框发光 */
}

.game-poster {
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    overflow: hidden;
    position: relative;
}

.game-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-tags {
    position: absolute;
    bottom: var(--spacing-sm);
    left: var(--spacing-sm);
    right: var(--spacing-sm);
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    z-index: 2;
}

.game-tag {
    background: rgba(240, 185, 11, 0.95);
    color: #0B0E11;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

/* 即将上线样式 */
.game-card.coming-soon {
    opacity: 0.7;
    cursor: default;
}

.game-card.coming-soon .game-poster {
    filter: grayscale(0.3);
}

/* ========== 排行榜样式 ========== */
.leaderboard-modal {
    max-width: 500px;
}

.leaderboard-list {
    max-height: 60vh;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--dark-surface);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.leaderboard-item:hover {
    background: var(--dark-card);
}

.leaderboard-item.current-user {
    background: rgba(240, 185, 11, 0.1);
    border: 2px solid #F0B90B;
}

.leaderboard-rank {
    font-size: 20px;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
}

.leaderboard-rank.top1 {
    color: #FFD700;
    font-size: 24px;
}

.leaderboard-rank.top2 {
    color: #C0C0C0;
    font-size: 24px;
}

.leaderboard-rank.top3 {
    color: #CD7F32;
    font-size: 24px;
}

.leaderboard-info {
    flex: 1;
    margin-left: 12px;
}

.leaderboard-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.leaderboard-uid {
    font-size: 12px;
    color: var(--text-secondary);
}

.leaderboard-amount {
    font-size: 18px;
    font-weight: 700;
    color: #FCD535;
    text-align: right;
}


/* ========== 安全区域适配 ========== */
@supports (padding: max(0px)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .navbar {
        padding-top: env(safe-area-inset-top);
        height: calc(56px + env(safe-area-inset-top));
    }
    
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(64px + env(safe-area-inset-bottom));
    }
}

/* ========== �̼�ϵͳ��ʽ ========== */
/* Tabs */
.merchant-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--dark-surface);
    border-radius: var(--radius-md);
    padding: 4px;
}

.merchant-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.merchant-tab.active {
    background: var(--primary-color);
    color: #000;
}

.merchant-tab span:first-child {
    font-size: 18px;
}

/* Content */
.merchant-content {
    min-height: 300px;
}

/* Actions */
.merchant-actions {
    margin-bottom: 16px;
}

/* �̼��б� */
.merchant-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.merchant-card {
    background: var(--dark-surface);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.merchant-card:active {
    transform: scale(0.98);
    background: var(--dark-card);
}

.merchant-card.official {
    border: 1px solid rgba(240, 185, 11, 0.3);
}

.official-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary-color);
    color: #000;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.merchant-avatar {
    font-size: 48px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-bg);
    border-radius: var(--radius-md);
}

.merchant-info {
    flex: 1;
}

.merchant-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.merchant-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.merchant-price,
.merchant-remaining {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.merchant-arrow {
    font-size: 24px;
    color: var(--text-secondary);
}

/* �����б� */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-card {
    background: var(--dark-surface);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.order-card:active {
    transform: scale(0.98);
    background: var(--dark-card);
}

.order-card.pending-highlight {
    border: 1px solid rgba(255, 184, 0, 0.5);
    background: rgba(255, 184, 0, 0.05);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.order-id {
    font-family: monospace;
    color: var(--text-secondary);
    font-size: 13px;
}

.order-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.order-row span:first-child {
    color: var(--text-secondary);
}

.order-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--text-secondary);
}

/* ״̬���� */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.status-warning {
    background: rgba(255, 184, 0, 0.2);
    color: #FFB800;
}

.status-badge.status-info {
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

.status-badge.status-success {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.status-badge.status-secondary {
    background: rgba(183, 189, 198, 0.2);
    color: var(--text-secondary);
}

.status-badge.status-active {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

/* ����/��/����״̬ */
.loading-state,
.empty-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon,
.error-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.loading-state p,
.empty-state p,
.error-state p {
    color: var(--text-secondary);
    margin-top: 12px;
}

/* �̼�״̬��Ƭ */
.merchant-status-card {
    margin-bottom: 20px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

/* �̼�����ҳ */
.merchant-detail-page,
.order-detail-page,
.merchant-order-detail-page {
    padding-bottom: 20px;
}

.btn-back {
    margin-bottom: 16px;
}

.merchant-detail-header,
.order-detail-header {
    text-align: center;
    margin-bottom: 20px;
}

.merchant-avatar-large {
    font-size: 80px;
    margin: 0 auto 12px;
}

.merchant-desc {
    color: var(--text-secondary);
    margin-top: 8px;
}

.reputation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 12px;
}

.reputation-item {
    text-align: center;
}

.reputation-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

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

/* �۸�λ */
.price-tiers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.price-tier {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--dark-bg);
    border-radius: var(--radius-sm);
}

.tier-label {
    font-weight: 600;
}

.tier-range {
    flex: 1;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.tier-rate {
    font-weight: 700;
    color: var(--primary-color);
}

/* ��� */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-textarea {
    resize: vertical;
}

/* 收款类型选择框 - 移动端优化 */
select.payment-method-select,
.payment-method-select {
    /* 重置为原生样式 */
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    appearance: menulist !important;
    
    /* 基本样式 */
    display: block !important;
    width: 100% !important;
    min-height: 48px !important;
    padding: 12px 40px 12px 12px !important;
    margin: 0 !important;
    
    /* 颜色 */
    background-color: rgba(255, 255, 255, 0.05) !important;
    background-image: none !important;
    color: #FFFFFF !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
    
    /* 字体 */
    font-size: 16px !important;
    line-height: 1.5 !important;
    
    /* 交互 */
    cursor: pointer !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    
    /* 层级 */
    position: relative !important;
    z-index: 1 !important;
    
    /* 移除可能干扰的效果 */
    box-shadow: none !important;
    transform: none !important;
    opacity: 1 !important;
}

/* iOS/Safari 特殊处理 */
@supports (-webkit-touch-callout: none) {
    select.payment-method-select,
    .payment-method-select {
        -webkit-appearance: menulist-button !important;
        padding-right: 30px !important;
    }
}

/* 移动设备点击高亮 */
@media (hover: none) and (pointer: coarse) {
    select.payment-method-select:active,
    .payment-method-select:active {
        background-color: rgba(240, 185, 11, 0.1) !important;
        border-color: rgba(240, 185, 11, 0.5) !important;
    }
}

/* 选项样式 */
.payment-method-select option {
    background-color: #1E2329 !important;
    color: #FFFFFF !important;
    padding: 12px !important;
    font-size: 16px !important;
}

.payment-method-select option:checked {
    background-color: #2B3139 !important;
    color: #F0B90B !important;
}

/* �۸�Ԥ�� */
.price-preview {
    background: var(--dark-bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.preview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.preview-row:last-child {
    margin-bottom: 0;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

/* ������Ϣ�� */
.order-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.order-info-row:last-child {
    border-bottom: none;
}

.copyable {
    cursor: pointer;
    color: var(--primary-color);
    text-decoration: underline;
}

.copyable:hover {
    opacity: 0.8;
}

/* ͷ��ѡ���� */
.avatar-selector {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.avatar-option {
    padding: 12px;
    background: var(--dark-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-option.active {
    border-color: var(--primary-color);
    background: rgba(240, 185, 11, 0.1);
}

/* Alert */
.alert {
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.3);
    color: #2196F3;
}

.alert strong {
    display: block;
    margin-bottom: 4px;
}

.alert p {
    margin: 0;
    font-size: 14px;
}

/* ��ť���� */
.btn-danger {
    background: #ff4444;
    color: #fff;
}

.btn-danger:hover {
    background: #cc0000;
}

/* ========== 对话框 (移动端优化) ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 16px;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--dark-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.modal-close:active {
    color: var(--primary-color);
}

.modal-body {
    padding: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

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

/* 对话框内的信息显示 */
.order-ad-info,
.order-info-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.order-ad-info h4,
.order-info-section h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.info-row .label {
    color: var(--text-secondary);
    font-weight: 500;
}

.info-row .value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    word-break: break-all;
}

/* 输入提示 */
.input-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* 表单标签 */
.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-label .required {
    color: #ff4444;
    margin-left: 4px;
}

/* 收款方式单选按钮 */
.payment-method-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.payment-method-radio {
    flex: 1;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.payment-method-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
}

.payment-method-radio .radio-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    pointer-events: none;
    transition: color 0.2s;
}

/* 选中状态 */
.payment-method-radio:has(input:checked) {
    background: rgba(240, 185, 11, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(240, 185, 11, 0.3);
}

.payment-method-radio:has(input:checked) .radio-label {
    color: var(--primary-color);
}

/* 点击效果 */
.payment-method-radio:active {
    transform: scale(0.98);
}

/* 移动端小屏幕优化 */
@media (max-width: 400px) {
    .modal {
        padding: 12px;
    }
    
    .modal-header,
    .modal-body {
        padding: 16px;
    }
    
    .modal-content {
        max-height: 90vh;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}
