/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding-bottom: 70px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 15px;
    border-radius: 0 0 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-size: 0.9rem;
}

.user-level {
    background: #ff6b6b;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* 标签导航 */
.tabs {
    display: flex;
    flex-direction: row;
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 10;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 15px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    background: transparent;
}

.tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border-bottom: 3px solid #5a67d8 !important;
}

.tab:hover:not(.active) {
    background: #f5f7fa;
}

/* 优惠券子标签 */
.coupon-tabs {
    display: flex;
    background: #f5f7fa;
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 20px;
}

.coupon-tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 8px;
    color: #666;
}

.coupon-tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.coupon-tab:hover {
    color: #667eea;
}

/* 内容区域 */
.content-section {
    display: none;
    margin-bottom: 20px;
}

.content-section.active {
    display: block;
}

.content-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #333;
}

/* 优惠券列表 */
.coupon-list {
    display: grid;
    gap: 15px;
}

.coupon-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.coupon-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
}

.coupon-card.online::before {
    background: #4CAF50;
}

.coupon-card.offline::before {
    background: #FF9800;
}

.coupon-info {
    flex: 1;
}

.coupon-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.coupon-desc {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.coupon-validity {
    font-size: 0.75rem;
    color: #999;
}

.coupon-action {
    text-align: right;
}

.coupon-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #e53e3e;
    margin-bottom: 5px;
}

.btn-claim {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-claim:hover {
    transform: scale(1.05);
}

.btn-claim.claimed {
    background: #cccccc;
    cursor: not-allowed;
}

/* 商城筛选 */
.mall-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter {
    padding: 8px 15px;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 商品列表 */
.product-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    width: 100%;
    height: 120px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.product-info {
    padding: 12px;
}

.product-name {
    font-weight: 500;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-desc {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-weight: bold;
    color: #e53e3e;
    font-size: 1rem;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.8rem;
}

.btn-buy {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.nav-item {
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-item.active .nav-icon {
    color: #667eea;
}

.nav-item.active span {
    color: #667eea;
    font-weight: 500;
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 3px;
    color: #666;
}

.nav-item span {
    display: block;
    font-size: 0.75rem;
    color: #666;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
}

.modal-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.modal-content h3 {
    margin-bottom: 10px;
    color: #333;
}

.modal-content p {
    color: #666;
    margin-bottom: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: scale(1.05);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.coupon-detail, .product-detail {
    text-align: left;
}

.detail-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-label {
    font-weight: 500;
    margin-bottom: 5px;
    color: #555;
}

.detail-value {
    color: #333;
}

/* 订单标签 */
.order-tabs {
    display: flex;
    background: #f5f7fa;
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.order-tab {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 8px;
    color: #666;
    font-size: 0.85rem;
    white-space: nowrap;
    min-width: 60px;
}

.order-tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.order-tab:hover {
    color: #667eea;
}

/* 订单列表 */
.order-list {
    display: grid;
    gap: 15px;
}

.order-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.order-id {
    font-size: 0.85rem;
    color: #666;
}

.order-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.order-status.pending {
    background: #fff3cd;
    color: #856404;
}

.order-status.paid {
    background: #d1ecf1;
    color: #0c5460;
}

.order-status.completed {
    background: #d4edda;
    color: #155724;
}

.order-content {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.order-image {
    width: 80px;
    height: 80px;
    background: #f5f7fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.order-info {
    flex: 1;
}

.order-name {
    font-weight: 500;
    margin-bottom: 5px;
}

.order-desc {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
}

.order-price {
    font-weight: bold;
    color: #e53e3e;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.order-time {
    font-size: 0.75rem;
    color: #999;
}

.order-actions {
    display: flex;
    gap: 8px;
}

.btn-order {
    padding: 6px 12px;
    border-radius: 15px;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-order.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-order.secondary {
    background: #f5f7fa;
    color: #666;
    border: 1px solid #ddd;
}

/* 个人中心 */
.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 30px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    color: white;
}

.profile-avatar {
    width: 70px;
    height: 70px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.profile-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.profile-level {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    display: inline-block;
}

.profile-stats {
    display: flex;
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-item {
    flex: 1;
    text-align: center;
    border-right: 1px solid #f0f0f0;
}

.stat-item:last-child {
    border-right: none;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
}

.profile-menu {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f5f7fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-item:hover {
    background: #f8f9fa;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-icon {
    font-size: 1.3rem;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.menu-text {
    flex: 1;
    font-size: 0.95rem;
    color: #333;
}

.menu-arrow {
    font-size: 1.2rem;
    color: #999;
}

/* 商家页面样式 */
.location-bar {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.location-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.location-icon {
    font-size: 1.2rem;
}

.location-text {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.btn-refresh-location {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-refresh-location:hover {
    transform: scale(1.05);
}

.merchant-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.merchant-filter {
    padding: 8px 15px;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.merchant-filter.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.merchant-sort {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
}

.merchant-sort select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
}

.merchant-list {
    display: grid;
    gap: 15px;
}

.merchant-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.merchant-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.merchant-image {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    flex-shrink: 0;
}

.merchant-info {
    flex: 1;
    min-width: 0;
}

.merchant-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 5px;
    color: #333;
}

.merchant-category {
    display: inline-block;
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 8px;
}

.merchant-address {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.merchant-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.merchant-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
}

.rating-stars {
    color: #ffc107;
}

.merchant-distance {
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 500;
}

.merchant-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-merchant {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-merchant.navigate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-merchant.call {
    background: #f5f7fa;
    color: #333;
    border: 1px solid #ddd;
}

.btn-merchant.coupon {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.btn-merchant:hover {
    transform: scale(1.02);
}

.merchant-tags {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.merchant-tag {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* 商家详情弹窗 */
.merchant-detail-header {
    text-align: center;
    margin-bottom: 20px;
}

.merchant-detail-image {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 15px;
}

.merchant-detail-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.merchant-detail-rating {
    color: #ffc107;
    font-size: 1rem;
}

.merchant-detail-info {
    margin-bottom: 20px;
}

.merchant-detail-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.merchant-detail-item:last-child {
    border-bottom: none;
}

.merchant-detail-label {
    width: 80px;
    color: #666;
    font-size: 0.9rem;
}

.merchant-detail-value {
    flex: 1;
    color: #333;
    font-size: 0.9rem;
}

.merchant-detail-actions {
    display: flex;
    gap: 10px;
}

.btn-detail-action {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-detail-action.navigate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-detail-action.call {
    background: #f5f7fa;
    color: #333;
    border: 1px solid #ddd;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.3rem;
    }
    
    .product-list {
        grid-template-columns: 1fr;
    }
}