/* =============================================
   葫芦乐园 - 白色清爽主题
   支持 Web + 移动端自适应
   ============================================= */

/* ---------- CSS变量 ---------- */
:root {
    --primary: #4F6EF7;
    --primary-dark: #3B5BDB;
    --primary-light: #748FFC;
    --primary-glow: rgba(79, 110, 247, 0.18);
    --secondary: #1A1A2E;
    --secondary-light: #2D2D44;
    --bg-dark: #F5F7FA;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F0F2F8;
    --text-primary: #1A1A2E;
    --text-secondary: #5C5C7A;
    --text-muted: #9999B0;
    --border: #E4E7EF;
    --border-light: #D0D4E0;
    --success: #22C55E;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #4F6EF7;
    --gold: #F59E0B;
    --gold-dark: #D97706;
    --gold-light: #FBBF24;
    --sky: #4F6EF7;
    --sky-dark: #3B5BDB;
    --sky-light: #748FFC;
    --gourd: #F59E0B;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.04);
    --shadow-gold: 0 4px 20px rgba(245, 158, 11, 0.12);
    --transition: all 0.3s ease;
    --nav-height: 60px;
    --bottom-nav-height: 65px;
}

/* ---------- Reset ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--nav-height);
    padding-bottom: 0;
    -webkit-font-smoothing: antialiased;
}

/* 全局背景纹理 - 柔和渐变 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(79, 110, 247, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(116, 143, 252, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- 导航栏 ---------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    backdrop-filter: blur(12px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-brand::before {
    content: '🍈';
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: rgba(79, 110, 247, 0.06);
}

.nav-link-logout {
    color: var(--danger);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ---------- 用户信息栏 ---------- */
.user-bar {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
}

.user-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-gourds {
    color: var(--gold-dark);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-gourds::before {
    content: '🫛';
}

.user-gourds strong {
    font-size: 1.2rem;
}

.user-stats {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ---------- 公告栏 ---------- */
.announcement-bar {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--primary-light));
    padding: 8px 0;
    overflow: hidden;
}

.announcement-scroll {
    display: flex;
    gap: 40px;
    animation: scrollAnnouncement 20s linear infinite;
    white-space: nowrap;
    padding: 0 20px;
}

.announcement-item {
    color: #fff;
    font-size: 0.85rem;
    flex-shrink: 0;
}

@keyframes scrollAnnouncement {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ---------- 主内容区 ---------- */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - var(--nav-height) - 100px);
}

/* ---------- 底部导航(移动端) ---------- */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--border);
    z-index: 1000;
    padding: 5px 0;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-decoration: none;
    transition: var(--transition);
    padding: 4px 0;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--primary);
}

.bottom-nav-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.bottom-nav-label {
    margin-top: 2px;
}

/* ---------- 卡片通用 ---------- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 110, 247, 0.15), transparent);
}

.card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary::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-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--primary-glow);
    color: #fff;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    animation: none;
}

/* 下注按钮脉动动画 */
#confirmBetBtn:not(:disabled) {
    animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 4px 15px var(--primary-glow); }
    50% { box-shadow: 0 4px 30px var(--primary-glow), 0 0 40px rgba(79, 110, 247, 0.1); }
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #16A34A);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #DC2626);
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.btn-block {
    display: flex;
    width: 100%;
}

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

.form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: #F8F9FC;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.1);
    background: #fff;
}

.form-input::placeholder {
    color: var(--text-muted);
}

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

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235C5C7A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ---------- 游戏区域 ---------- */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 20px 0;
}

.game-cards {
    display: flex;
    gap: 20px;
    justify-content: center;
    perspective: 1200px;
    margin: 10px 0;
}

/* ========== 卡牌核心样式 ========== */
.game-card {
    width: 150px;
    height: 210px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius);
}

.game-card:hover {
    transform: translateY(-6px) scale(1.02);
}

.game-card.flipped {
    transform: rotateY(180deg);
}

.game-card-front,
.game-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* --- 卡牌正面（未翻开） --- */
.game-card-front {
    background: linear-gradient(145deg, #F0F2F8, #E8EAF2);
    border: 2px solid var(--border-light);
    color: var(--text-muted);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* 正面装饰角花 */
.game-card-front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 14px 14px, rgba(79, 110, 247, 0.12) 0%, transparent 10px),
        radial-gradient(circle at calc(100% - 14px) 14px, rgba(79, 110, 247, 0.12) 0%, transparent 10px),
        radial-gradient(circle at 14px calc(100% - 14px), rgba(79, 110, 247, 0.12) 0%, transparent 10px),
        radial-gradient(circle at calc(100% - 14px) calc(100% - 14px), rgba(79, 110, 247, 0.12) 0%, transparent 10px),
        linear-gradient(45deg, transparent 35%, rgba(79, 110, 247, 0.03) 45%, rgba(79, 110, 247, 0.03) 55%, transparent 65%),
        linear-gradient(-45deg, transparent 35%, rgba(79, 110, 247, 0.03) 45%, rgba(79, 110, 247, 0.03) 55%, transparent 65%);
    border-radius: var(--radius);
    pointer-events: none;
}

/* 正面问号 */
.game-card-front::after {
    content: '?';
    font-size: 3.5rem;
    color: var(--primary);
    text-shadow: 0 0 16px rgba(79, 110, 247, 0.15);
    z-index: 1;
}

.game-card-front .card-number {
    position: absolute;
    top: 10px;
    left: 12px;
    font-size: 0.85rem;
    color: var(--primary-light);
    z-index: 2;
}

/* 卡牌角花装饰 */
.card-deco {
    position: absolute;
    font-size: 0.55rem;
    color: rgba(79, 110, 247, 0.2);
    z-index: 2;
}
.card-deco-tl { top: 8px; right: 10px; }
.card-deco-tr { top: 8px; right: 10px; }
.card-deco-bl { bottom: 8px; left: 10px; }
.card-deco-br { bottom: 8px; right: 10px; }

/* --- 卡牌背面（翻开后） --- */
.game-card-back {
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    border: 2px solid var(--primary-light);
    color: #fff;
    transform: rotateY(180deg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* 背面装饰纹理 */
.game-card-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 8px,
            rgba(255, 255, 255, 0.04) 8px,
            rgba(255, 255, 255, 0.04) 16px
        );
    pointer-events: none;
}

.game-card-back::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    transform: translate(-50%, -50%) rotate(45deg);
    border: 2px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

/* 非K牌背面 */
.game-card-back:not(.is-k) .card-content {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.6);
}

/* --- K牌金色特效 --- */
.game-card-back.is-k {
    background: linear-gradient(145deg, #D97706, #F59E0B, #FBBF24);
    border-color: var(--gold-light);
    animation: glowGold 1.5s ease-in-out infinite alternate;
}

.game-card-back.is-k::before {
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 6px,
            rgba(255, 255, 255, 0.06) 6px,
            rgba(255, 255, 255, 0.06) 12px
        );
}

.game-card-back.is-k::after {
    border-color: rgba(255, 255, 255, 0.25);
    width: 100px;
    height: 100px;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
}

.game-card-back.is-k .card-content {
    font-size: 4.5rem;
    color: #fff;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.4),
        0 0 30px rgba(245, 158, 11, 0.35),
        0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 2;
    position: relative;
}

/* K牌皇冠装饰 */
.card-back-deco {
    position: absolute;
    top: 14px;
    font-size: 1.2rem;
    z-index: 2;
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.4));
}

@keyframes glowGold {
    from { box-shadow: 0 0 15px rgba(245, 158, 11, 0.2), inset 0 0 15px rgba(245, 158, 11, 0.06); }
    to { box-shadow: 0 0 35px rgba(245, 158, 11, 0.4), inset 0 0 25px rgba(245, 158, 11, 0.1); }
}

/* --- 卡牌选中效果 --- */
.game-card.selected {
    transform: translateY(-8px) scale(1.03);
}

.game-card.selected .game-card-front {
    border-color: var(--primary);
    box-shadow:
        0 0 20px rgba(79, 110, 247, 0.15),
        0 0 40px rgba(79, 110, 247, 0.08),
        inset 0 0 20px rgba(79, 110, 247, 0.03);
}

.game-card.selected .game-card-front::after {
    color: var(--primary-dark);
    text-shadow: 0 0 20px rgba(79, 110, 247, 0.2);
}

/* 卡牌hover */
.game-card:hover .game-card-front {
    border-color: var(--primary-light);
    box-shadow: 0 0 12px rgba(79, 110, 247, 0.1);
}

/* 押注选项 */
.bet-section {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.bet-title {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.bet-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.bet-option {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.bet-option:hover {
    border-color: var(--primary-light);
    background: var(--bg-card-hover);
}

.bet-option.active {
    border-color: var(--primary);
    background: rgba(79, 110, 247, 0.06);
    color: var(--primary);
    box-shadow: 0 0 12px rgba(79, 110, 247, 0.1);
}

.bet-option.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(79, 110, 247, 0.06), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.bet-option:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 游戏结果 */
.game-result {
    text-align: center;
    padding: 20px;
    border-radius: var(--radius);
    animation: fadeInUp 0.5s ease;
}

.game-result.win {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(251, 191, 36, 0.03));
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.game-result.lose {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.06), rgba(239, 68, 68, 0.03));
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.game-result-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.game-result-text {
    font-size: 1.3rem;
    font-weight: 700;
}

.game-result.win .game-result-text {
    color: var(--gold-dark);
}

.game-result.lose .game-result-text {
    color: var(--danger);
}

.game-result-amount {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* 倒计时 */
.countdown {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    animation: pulse 1s ease-in-out infinite;
}

/* 开奖倒计时 */
.cooldown-timer {
    text-align: center;
    padding: 16px 20px;
    background: rgba(79, 110, 247, 0.04);
    border: 1px solid rgba(79, 110, 247, 0.12);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1rem;
}

.cooldown-time {
    display: inline-block;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin-left: 8px;
    font-variant-numeric: tabular-nums;
    min-width: 60px;
}

.btn-cooldown {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.4);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

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

/* ---------- 兑换商城 ---------- */
.exchange-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.exchange-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.exchange-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 110, 247, 0.12), transparent);
}

.exchange-item:hover {
    transform: translateY(-4px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.exchange-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.exchange-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.exchange-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.exchange-price {
    color: var(--gold-dark);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.exchange-price::before {
    content: '🫛 ';
}

.exchange-stock {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 16px;
}

.exchange-btn {
    width: 100%;
}

/* ---------- 勋章 ---------- */
.medal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.medal-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 16px;
    border: 1px solid var(--border);
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.medal-item.earned {
    border-color: var(--gold);
    background: rgba(245, 158, 11, 0.03);
}

.medal-item.locked {
    opacity: 0.5;
    filter: grayscale(0.8);
}

.medal-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.medal-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.medal-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.medal-status {
    margin-top: 8px;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

.medal-status.earned {
    background: rgba(245, 158, 11, 0.08);
    color: var(--gold-dark);
}

.medal-status.locked {
    background: rgba(100, 116, 139, 0.08);
    color: var(--text-muted);
}

/* ---------- 记录列表 ---------- */
.record-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.record-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.record-item:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.record-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.record-title {
    font-size: 0.95rem;
    font-weight: 500;
}

.record-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.record-right {
    text-align: right;
}

.record-amount {
    font-weight: 700;
    font-size: 1.05rem;
}

.record-amount.positive {
    color: var(--gold-dark);
}

.record-amount.negative {
    color: var(--danger);
}

.record-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ---------- 登录/注册页面 ---------- */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--nav-height));
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary));
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

/* ---------- 用户中心 ---------- */
.profile-header {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary));
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 16px;
    box-shadow: 0 0 20px var(--primary-glow);
}

.profile-name {
    font-size: 1.3rem;
    font-weight: 600;
}

.profile-username {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.profile-stat {
    text-align: center;
}

.profile-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.profile-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.profile-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.profile-menu-item:hover {
    border-color: var(--primary-light);
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.profile-menu-item .menu-icon {
    font-size: 1.3rem;
    margin-right: 12px;
}

.profile-menu-item .menu-label {
    flex: 1;
    font-size: 0.95rem;
}

.profile-menu-item .menu-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    transition: var(--transition);
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

/* ---------- Toast通知 ---------- */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.9rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    animation: slideInRight 0.3s ease;
    max-width: 350px;
    backdrop-filter: blur(8px);
}

.toast.success { background: linear-gradient(135deg, rgba(34, 197, 94, 0.92), rgba(22, 163, 74, 0.92)); }
.toast.error { background: linear-gradient(135deg, rgba(239, 68, 68, 0.92), rgba(220, 38, 38, 0.92)); }
.toast.warning { background: linear-gradient(135deg, rgba(245, 158, 11, 0.92), rgba(217, 119, 6, 0.92)); }
.toast.info { background: linear-gradient(135deg, rgba(79, 110, 247, 0.92), rgba(59, 91, 219, 0.92)); }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------- 卡密兑换弹窗 ---------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px;
    max-width: 450px;
    width: 100%;
    border: 1px solid var(--border);
    animation: scaleIn 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary));
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
    color: var(--text-primary);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-card-code {
    background: #F8F9FC;
    border: 2px dashed var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    font-family: monospace;
    font-size: 1.1rem;
    word-break: break-all;
    color: var(--gold-dark);
    margin: 12px 0;
    user-select: all;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

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

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ---------- 标签页 ---------- */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab {
    padding: 10px 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.tab:hover, .tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

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

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1rem;
}

/* ---------- 标签 ---------- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgba(34, 197, 94, 0.08); color: var(--success); }
.badge-danger { background: rgba(239, 68, 68, 0.08); color: var(--danger); }
.badge-warning { background: rgba(245, 158, 11, 0.08); color: var(--warning); }
.badge-info { background: rgba(79, 110, 247, 0.08); color: var(--info); }
.badge-gold { background: rgba(245, 158, 11, 0.08); color: var(--gold); }

/* ---------- 页面标题 ---------- */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ---------- 网格布局 ---------- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

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

/* ---------- 每日签到 ---------- */
.daily-bonus {
    text-align: center;
    padding: 20px;
    background: rgba(79, 110, 247, 0.03);
    border-radius: var(--radius);
    border: 1px dashed var(--primary-light);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.daily-bonus::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
}

.daily-bonus-text {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

/* =============================================
   响应式 - 移动端
   ============================================= */
@media (max-width: 768px) {
    body {
        padding-top: var(--nav-height);
        padding-bottom: var(--bottom-nav-height);
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: #FFFFFF;
        flex-direction: column;
        padding: 10px;
        border-bottom: 1px solid var(--border);
        display: none;
        z-index: 999;
        box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 12px;
    }

    .bottom-nav {
        display: flex;
    }

    .main-content {
        padding: 16px;
    }

    .user-bar-inner {
        padding: 0 16px;
        font-size: 0.85rem;
    }

    /* 游戏卡片移动端 */
    .game-cards {
        gap: 12px;
    }

    .game-card {
        width: 105px;
        height: 155px;
    }

    .game-card-front::after {
        font-size: 2.5rem;
    }

    .game-card-back.is-k .card-content {
        font-size: 3rem;
    }

    .game-card-back:not(.is-k) .card-content {
        font-size: 1.8rem;
    }

    .bet-options {
        gap: 8px;
    }

    .bet-option {
        padding: 8px 14px;
        font-size: 0.9rem;
    }

    /* 兑换商城 */
    .exchange-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .exchange-item {
        padding: 16px 12px;
    }

    .exchange-icon {
        font-size: 2rem;
    }

    /* 勋章 */
    .medal-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .medal-item {
        padding: 14px 10px;
    }

    /* 认证页面 */
    .auth-card {
        padding: 30px 20px;
    }

    /* 用户中心 */
    .profile-stats {
        gap: 16px;
    }

    .profile-header {
        padding: 20px;
    }

    /* 记录 */
    .record-item {
        padding: 12px 14px;
    }

    /* 网格 */
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    /* Toast */
    .toast-container {
        top: auto;
        bottom: 80px;
        right: 10px;
        left: 10px;
    }

    .toast {
        max-width: 100%;
    }

    /* 弹窗 */
    .modal-content {
        padding: 24px 20px;
    }
}

@media (max-width: 480px) {
    .game-card {
        width: 90px;
        height: 135px;
    }

    .game-card-front::after {
        font-size: 2rem;
    }

    .game-card-front .card-number {
        font-size: 0.7rem;
        top: 6px;
        left: 8px;
    }

    .game-card-back.is-k .card-content {
        font-size: 2.5rem;
    }

    .game-card-back:not(.is-k) .card-content {
        font-size: 1.5rem;
    }

    .exchange-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .medal-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-avatar {
        width: 64px;
        height: 64px;
        font-size: 2rem;
    }
}

/* ---------- 加载动画 ---------- */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

/* ---------- 管理后台样式 ---------- */
.admin-layout {
    display: flex;
    min-height: calc(100vh - var(--nav-height));
}

.admin-sidebar {
    width: 240px;
    background: #FFFFFF;
    border-right: 1px solid var(--border);
    padding: 20px 0;
    flex-shrink: 0;
}

.admin-sidebar-brand {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.admin-nav-item:hover, .admin-nav-item.active {
    background: rgba(79, 110, 247, 0.04);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.admin-nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.admin-main {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: var(--bg-dark);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.admin-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* 管理后台统计卡片 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 110, 247, 0.12), transparent);
}

.stat-card-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* 管理后台表格 */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.admin-table thead {
    background: #F8F9FC;
}

.admin-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.admin-table td {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.admin-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.admin-table .actions {
    display: flex;
    gap: 6px;
}

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 10px 0;
        display: flex;
        overflow-x: auto;
    }

    .admin-sidebar-brand {
        display: none;
    }

    .admin-nav-item {
        padding: 8px 16px;
        white-space: nowrap;
        border-right: none;
        border-bottom: 3px solid transparent;
    }

    .admin-nav-item.active {
        border-right: none;
        border-bottom-color: var(--primary);
    }

    .admin-table {
        font-size: 0.8rem;
    }

    .admin-table th, .admin-table td {
        padding: 8px 10px;
    }
}
