/* Vibrant Theme - 7748 Game Trading */

:root {
    /* Main Colors */
    --primary: #ff6b6b;
    --primary-dark: #ff4757;
    --secondary: #ff8e53;
    --accent: #feca57;
    --success: #2ed573;
    --warning: #ffa502;
    --danger: #ff4757;

    /* Text Colors */
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --text-muted: #b2bec3;

    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #fff5f5;
    --bg-gradient: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    --hero-gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);

    /* UI Elements */
    --card-shadow: 0 4px 20px rgba(255, 107, 107, 0.15);
    --card-shadow-hover: 0 8px 30px rgba(255, 107, 107, 0.2);
    --btn-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    --btn-shadow-hover: 0 6px 20px rgba(255, 107, 107, 0.4);

    /* Layout */
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --border-radius-lg: 24px;
}

* { box-sizing: border-box; }

body {
    background: var(--bg-gradient) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

[v-cloak] { display: none !important; }

.hero-gradient {
    background: var(--hero-gradient) !important;
}

.card-pop {
    background: var(--bg-primary) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--card-shadow) !important;
}

.price-hot {
    color: var(--danger) !important;
    font-weight: 700;
}

/* Tags */
.tag-hot {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    color: white !important;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 500;
}

.tag-sale {
    background: #fff3cd;
    color: #856404;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
}

.tag-new {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
}

.tag-gray {
    background: #f5f5f5;
    color: #666;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
}

/* Animations */
.bounce { animation: bounce 2s infinite; }

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    color: white !important;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--btn-shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--btn-shadow-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: #f5f5f5;
    color: var(--text-primary);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover { background: #eee; }

/* Inputs */
.input-vibrant {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
}

.input-vibrant:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.search-box {
    background: white;
    border-radius: 25px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.search-box input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 14px;
    background: transparent;
}

/* Game Icons */
.game-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.game-icon-orange { background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%); }
.game-icon-green { background: linear-gradient(135deg, #2ed573 0%, #17c0eb 100%); }
.game-icon-blue { background: linear-gradient(135deg, #70a1ff 0%, #5352ed 100%); }
.game-icon-purple { background: linear-gradient(135deg, #a55eea 0%, #8854d0 100%); }
.game-icon-pink { background: linear-gradient(135deg, #ff6b81 0%, #ff4757 100%); }

/* Product Cards */
.product-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s;
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

.product-card-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #ffe8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-body { padding: 12px; }

.product-card-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--danger);
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary) !important;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-around;
    padding: 8px 16px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #999 !important;
    font-size: 10px;
    transition: all 0.3s;
}

.bottom-nav-item svg { width: 24px; height: 24px; }

.bottom-nav-item.active { color: var(--primary) !important; }

.bottom-nav-item.active .nav-icon-wrapper {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    border-radius: 50%;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav-item.active .nav-icon-wrapper svg {
    fill: white !important;
    color: white !important;
    width: 20px;
    height: 20px;
}

.page-content { padding-bottom: 80px; }

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; }

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    color: #ddd;
}

.empty-state-title {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 14px;
    color: var(--text-muted);
}

/* Loading */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: var(--primary) !important;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Utils */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.tap-active { transition: all 0.2s; }
.tap-active:active { transform: scale(0.96); opacity: 0.8; }

.status-bar-placeholder { height: env(safe-area-inset-top, 20px); }

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.num-font {
    font-family: 'DIN Alternate', 'Roboto', sans-serif;
    font-variant-numeric: tabular-nums;
}

.divider { height: 8px; background: #f5f5f5; }

.list-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: white;
    border-bottom: 1px solid #f5f5f5;
}

.list-item:last-child { border-bottom: none; }

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* Forms */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
}

.tab-item {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-item.active {
    color: var(--primary);
    font-weight: 600;
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

/* Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 16px;
}

/* Page Header 组件样式 */
.page-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary);
}

.status-bar-placeholder {
    height: env(safe-area-inset-top, 0);
    background: var(--bg-primary);
}

.page-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    padding: 0 8px;
    background: var(--bg-primary);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.page-header-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-primary);
}

.page-header-title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Vue Transition 动画 - fade */
.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

/* Vue Transition 动画 - slide */
.slide-enter-active,
.slide-leave-active {
    transition: transform 0.3s ease;
}

.slide-enter-from {
    transform: translateX(100%);
}

.slide-leave-to {
    transform: translateX(-100%);
}

/* 响应式商品网格 - 大屏支持更多列 */
@media (min-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==================== 骨架屏样式 ==================== */
.skeleton-box {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 14px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-text-sm {
    height: 12px;
    width: 60%;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    height: 140px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.skeleton-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.skeleton-card .skeleton-body {
    padding: 12px;
}

/* ==================== 网络状态提示 ==================== */
.network-offline-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--danger);
    color: white;
    text-align: center;
    padding: 8px 16px;
    font-size: 13px;
    z-index: 9999;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.slide-down-enter-active,
.slide-down-leave-active {
    transition: transform 0.3s ease;
}

.slide-down-enter-from,
.slide-down-leave-to {
    transform: translateY(-100%);
}

/* ==================== 表单验证状态 ==================== */
.form-input.is-valid {
    border-color: var(--success);
}

.form-input.is-invalid {
    border-color: var(--danger);
}

.form-input.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(46, 213, 115, 0.1);
}

.form-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.1);
}

.form-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-success {
    color: var(--success);
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==================== 密码强度指示器 ==================== */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.password-strength-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
    transition: background 0.3s;
}

.password-strength.weak .password-strength-bar:nth-child(1) {
    background: var(--danger);
}

.password-strength.medium .password-strength-bar:nth-child(1),
.password-strength.medium .password-strength-bar:nth-child(2) {
    background: var(--warning);
}

.password-strength.strong .password-strength-bar {
    background: var(--success);
}

.password-strength-text {
    font-size: 12px;
    margin-top: 4px;
}

.password-strength-text.weak { color: var(--danger); }
.password-strength-text.medium { color: var(--warning); }
.password-strength-text.strong { color: var(--success); }

/* ==================== 确认对话框动画 ==================== */
@keyframes bounce-in {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.animate-bounce-in {
    animation: bounce-in 0.3s ease-out;
}

/* ==================== 下拉刷新样式 ==================== */
.pull-refresh {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.pull-refresh-icon {
    display: inline-block;
    transition: transform 0.3s;
}

.pull-refresh.pulling .pull-refresh-icon {
    transform: rotate(180deg);
}

.pull-refresh.refreshing .pull-refresh-icon {
    animation: spin 1s linear infinite;
}

/* ==================== 加载更多样式 ==================== */
.load-more {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.load-more-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f0f0f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* ==================== 图片懒加载占位 ==================== */
.img-placeholder {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #ffe8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-placeholder svg {
    width: 32px;
    height: 32px;
    color: #ddd;
}

/* ==================== 徽章样式 ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

.badge-gray {
    background: #e0e0e0;
    color: #666;
}

/* ==================== 分割线 ==================== */
.divider-text {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 12px;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.divider-text::before { margin-right: 12px; }
.divider-text::after { margin-left: 12px; }

/* ==================== 禁用状态 ==================== */
.btn-disabled,
.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==================== 安全文本（防止选中复制） ==================== */
.no-select {
    user-select: none;
    -webkit-user-select: none;
}
