/**
 * 汉堡三角洲电竞系统 - 前端通用样式
 * 包含所有前端页面的公共样式，减少重复代码，提升加载速度
 */

/* ==================== CSS变量定义 ==================== */
:root {
    /* 主色调 */
    --primary-color: #007aff;
    --primary-light: #3395ff;
    --primary-dark: #0066cc;
    --secondary-color: #8b5cf6;
    --accent-color: #10b981;
    
    /* 文字颜色 */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    
    /* 背景颜色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-gradient: linear-gradient(135deg, #f6f8ff 0%, #f0f4ff 100%);
    
    /* 边框和阴影 */
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* 过渡动画 */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Tab栏高度 */
    --tab-bar-height: 65px;
}

/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== 顶部导航栏 ==================== */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    overflow: hidden;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-text h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.logo-text p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 用户操作区 */
.user-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-actions a {
    text-decoration: none;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(148, 163, 184, 0.5);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-nickname {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* ==================== 底部Tab栏 ==================== */
.custom-tab-bar {
    font-size: 16px;
    display: block;
    z-index: 999;
    position: fixed;
    bottom: 3%;
    left: 5%;
    right: 5%;
    width: 90%;
    box-shadow: 0 0 24px rgba(231,231,231,.65);
    border-radius: 1.5625rem;
    background: #ffffff;
}

.nav-box {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 10px 0;
    height: var(--tab-bar-height);
}

.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    padding: 4px 0;
}

.nav-tab-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-tab img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

.nav-tab-text {
    font-size: 12px;
    margin-top: 4px;
    color: rgb(171, 169, 169);
    transition: color 0.3s ease;
}

.nav-tab-active .nav-tab-text {
    background: linear-gradient(135deg, #0b6bff 0%, #0066ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 500;
}

.nav-tab:hover {
    opacity: 0.8;
}

.nav-tab-active {
    opacity: 1;
}

.nav-tab-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: rgb(171, 169, 169);
    transition: all 0.3s ease;
}

.nav-tab-active .nav-tab-icon {
    background: linear-gradient(135deg, #0b6bff 0%, #0066ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== 主要内容区域 ==================== */
.main-content {
    padding: 0 16px 100px;
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
}

/* ==================== 卡片样式 ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ==================== 按钮样式 ==================== */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ==================== 服务/订单卡片 ==================== */
.escort-service-card,
.order-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}

.escort-service-card:hover,
.order-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.escort-service-card-anim {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.escort-service-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: #ffffff;
}

.escort-service-info {
    padding: 12px;
}

.escort-service-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.escort-service-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.escort-service-prices {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.escort-service-price {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.escort-service-price.pc {
    color: #28a745;
}

.escort-service-price.mobile {
    color: #ffc107;
}

/* ==================== 轮播图 ==================== */
.carousel-container {
    margin: 10px 16px 8px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    position: relative;
}

.carousel {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.carousel-dot.active {
    background: white;
    transform: scale(1.2);
}

/* ==================== 公告栏 ==================== */
.announcement-bar {
    margin: 0 16px 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0,122,255,0.08), rgba(51,149,255,0.08));
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    box-shadow: 0 6px 12px rgba(0, 122, 255, 0.08);
}

.announcement-icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, #007aff, #3395ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    flex-shrink: 0;
}

.announcement-text {
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    white-space: nowrap;
    flex: 1;
}

.announcement-marquee {
    display: inline-block;
    min-width: 100%;
    padding-left: 100%;
    animation: announcement-scroll 10s linear infinite;
}

@keyframes announcement-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* ==================== 章节标题 ==================== */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==================== 网格布局 ==================== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* ==================== 加载动画 ==================== */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.empty-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==================== 状态标签 ==================== */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-success {
    background: #d1fae5;
    color: #065f46;
}

.status-danger {
    background: #fee2e2;
    color: #991b1b;
}

.status-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ==================== 动画效果 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 动画类 */
.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
    opacity: 0;
}

.slide-in-left {
    animation: slideInLeft 0.4s ease forwards;
    opacity: 0;
}

.slide-in-right {
    animation: slideInRight 0.4s ease forwards;
    opacity: 0;
}

/* 延迟动画辅助类 */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0 12px 100px;
    }
    
    .top-nav {
        padding: 10px 12px;
    }
}

/* ==================== 工具类 ==================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
