/* 商铺列表页面样式 - 移动端 */
#shop-list-page {
    background-color: #f5f5f5;
    height: 100vh;
    max-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#shop-list-page.active {
    display: flex;
}

/* 固定头部区域 */
.shop-list-header {
    flex-shrink: 0;
}

/* 用户信息栏 */
.user-info-bar {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #fff;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-right: 12px;
}

.user-detail {
    flex: 1;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.user-phone {
    font-size: 13px;
    opacity: 0.8;
}

.logout-btn, .my-btn {
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    transition: background-color 0.2s;
    margin-left: 8px;
}

.logout-btn:active, .my-btn:active {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 顶部导航 */
.shop-header {
    background-color: #fff;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 #f0f0f0;
}

/* 商户列表滚动区域 */
.shop-list-container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom);
    min-height: 0;
}

/* 搜索框 */
.shop-search {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: #fff;
    gap: 10px;
}

.shop-search input {
    flex: 1;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    font-size: 14px;
    outline: none;
    background-color: #f5f5f5;
}

.shop-search input:focus {
    border-color: #1a73e8;
    background-color: #fff;
}

.shop-search-btn {
    height: 36px;
    padding: 0 16px;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #fff;
    border-radius: 18px;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

/* 分账类型Tabs */
.shop-tabs {
    display: flex;
    background-color: #fff;
    padding: 12px 20px;
    gap: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
    background-color: #f5f5f5;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
}

.tab-item:active {
    transform: scale(0.98);
}

.tab-item.active {
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #fff;
}

/* 顶部导航 */
.shop-header {
    background-color: #fff;
    padding: 12px 20px;
    box-shadow: 0 1px 0 #f0f0f0;
}

/* 位置选择栏 */
.location-bar {
    display: flex;
    align-items: center;
}

.location-icon {
    font-size: 18px;
    margin-right: 6px;
}

#selected-city {
    font-size: 17px;
    color: #333;
    font-weight: 600;
}

.change-city {
    font-size: 15px;
    color: #1a73e8;
    margin-left: auto;
    padding: 4px 8px;
}

.change-city:active {
    opacity: 0.7;
}

/* 城市选择弹窗 */
.current-location {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f5f5f5;
}

.current-location span:first-child {
    color: #999;
    font-size: 14px;
}

.city-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.city-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.city-item {
    padding: 12px 20px;
    text-align: center;
    background-color: #f5f5f5;
    border-radius: 25px;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.city-item:active {
    transform: scale(0.95);
}

.city-item.selected {
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #fff;
    border-color: #1a73e8;
}

/* 商铺列表 */
.shop-list {
    padding: 8px 12px;
}

.shop-item {
    background-color: #fff;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.shop-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 商铺图片 */
.shop-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background-color: #f8f8f8;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
}

.shop-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

/* 商铺详情 */
.shop-detail {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.shop-name {
    font-size: 14px;
    color: #333;
    font-weight: 600;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shop-address {
    font-size: 11px;
    color: #888;
    display: flex;
    align-items: flex-start;
    line-height: 1.3;
    margin-bottom: 2px;
}

.shop-address .icon {
    flex-shrink: 0;
    margin-right: 2px;
    margin-top: 0;
}

.shop-distance {
    font-size: 12px;
    color: #1a73e8;
    font-weight: 500;
}

.shop-number {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.shop-phone {
    font-size: 11px;
    color: #666;
}

.shop-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.shop-tag {
    padding: 2px 6px;
    background: linear-gradient(135deg, #e8f0fe 0%, #d2e3fc 100%);
    color: #1a73e8;
    border-radius: 3px;
    font-size: 10px;
}

.shop-tag.status-active {
    background: linear-gradient(135deg, #e8f8f0 0%, #c4f0d8 100%);
    color: #00a854;
}

/* 底部操作栏 */
.shop-action {
    display: none;
}

.exchange-btn {
    padding: 10px 32px;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #fff;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(26, 115, 232, 0.3);
    transition: all 0.2s;
}

.exchange-btn:active {
    transform: scale(0.96);
    box-shadow: 0 1px 5px rgba(26, 115, 232, 0.3);
}

/* 刷新按钮 */
.refresh-btn {
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 99;
    transition: all 0.3s;
}

.refresh-btn:active {
    transform: rotate(180deg);
}

/* 商户详情页面 */
#shop-detail-page {
    background-color: #f5f5f5;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 详情页用户信息栏 - 适配iPhone顶部安全区域 */
#shop-detail-page .user-info-bar {
    padding-top: calc(16px + env(safe-area-inset-top));
    flex-shrink: 0;
}

.shop-detail-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.shop-detail-header .back-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    padding: 8px;
    cursor: pointer;
    margin-right: 12px;
}

.shop-detail-header h3 {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin-right: 40px;
}

.shop-detail-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    padding-bottom: env(safe-area-inset-bottom);
}

.detail-section {
    margin-bottom: 16px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    padding-left: 4px;
    border-left: 3px solid #1a73e8;
}

.detail-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.detail-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item .label {
    color: #888;
    width: 80px;
    flex-shrink: 0;
}

.detail-item .value {
    color: #333;
    flex: 1;
    word-break: break-all;
}

/* 余额样式 */
.balance-item {
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    margin: -16px -16px 10px -16px;
    padding: 16px;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.balance-item .label {
    color: rgba(255, 255, 255, 0.8);
    width: auto;
    font-size: 14px;
    margin-bottom: 4px;
}

.balance-item .balance-value {
    color: #fff;
    font-size: 28px;
    font-weight: 600;
}

.detail-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.detail-img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.detail-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 权益金规格列表 */
.specs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 20px;
}

.specs-item {
    background-color: #fff;
    border-radius: 10px;
    padding: 14px;
    width: calc(50% - 5px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    text-align: center;
    cursor: pointer;
    border: 2px solid #1a73e8;
    transition: all 0.2s;
    position: relative;
    overflow: visible;
}

/* 可兑换状态 - 蓝色边框+背景 */
.specs-item {
    background: linear-gradient(135deg, #e8f0fe 0%, #f0f7ff 100%);
    border-color: #1a73e8;
}

.specs-item:active {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
}

/* 不可兑换状态 */
.specs-item.disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    position: relative;
    border: 1px solid #e0e0e0;
}

.specs-item.disabled::before {
    display: none;
}

.specs-item.disabled .specs-amount {
    color: #999;
}

.specs-item.disabled .specs-type {
    background: #e0e0e0;
    color: #999;
}

/* 余额不足标签 */
.specs-status {
    position: absolute;
    top: 6px;
    right: -5px;
    background: #ff4d4f;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
}

/* 规格标签 */
.specs-tag {
    position: absolute;
    top: 6px;
    right: -5px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    color: #fff;
}

.specs-tag-ok {
    background: #52c41a;
}

.specs-tag-no {
    background: #ff4d4f;
}

/* 兑换成功弹框 */
.exchange-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.exchange-modal.active {
    display: flex;
}

.exchange-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 85%;
    max-width: 400px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.exchange-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.exchange-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.exchange-modal-close {
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.exchange-modal-body {
    padding: 24px 20px;
    text-align: center;
}

.exchange-qrcode {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.exchange-qrcode canvas {
    border-radius: 8px;
}

.exchange-code-label {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
}

.exchange-code {
    font-size: 20px;
    font-weight: 600;
    color: #1a73e8;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    word-break: break-all;
    margin-bottom: 12px;
}

.exchange-amount {
    font-size: 14px;
    color: #666;
}

.exchange-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
}

.exchange-copy-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.specs-amount {
    font-size: 24px;
    font-weight: 700;
    color: #1a73e8;
    margin-bottom: 6px;
}

.specs-amount span {
    font-size: 14px;
    font-weight: normal;
}

.specs-num {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.specs-type {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #e8f0fe 0%, #d2e3fc 100%);
    color: #1a73e8;
    border-radius: 10px;
    font-size: 11px;
}

/* 详情页加载 */
.detail-loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.detail-loading.active {
    display: block;
}

/* 我的页面 */
#my-page {
    background-color: #f5f5f5;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#my-page .user-info-bar {
    padding-top: calc(16px + env(safe-area-inset-top));
    flex-shrink: 0;
}

/* 余额卡片 */
.my-balance-card {
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    padding: 24px 20px;
    text-align: center;
    color: #fff;
}

.my-balance-label {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.my-balance-value {
    font-size: 36px;
    font-weight: 600;
}

/* 券记录 */
.my-records {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    margin-top: 10px;
    border-radius: 16px 16px 0 0;
    padding-top: 10px;
}

.my-records-tabs {
    display: flex;
    padding: 0 20px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
}

.my-tab-item {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 15px;
    color: #666;
    cursor: pointer;
    position: relative;
}

.my-tab-item.active {
    color: #1a73e8;
    font-weight: 600;
}

.my-tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: #1a73e8;
    border-radius: 2px;
}

.my-records-list {
    padding: 10px 20px;
}

.my-record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f5f5f5;
}

.my-record-info {
    flex: 1;
}

.my-record-amount {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.my-record-type, .my-record-month {
    font-size: 12px;
    font-weight: normal;
    color: #1a73e8;
    background: #e8f0fe;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.my-record-month {
    color: #666;
    background: #f5f5f5;
}

.my-record-time {
    font-size: 12px;
    color: #999;
}

.my-record-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.my-record-qrbtn {
    padding: 4px 10px;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
}

.my-record-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.my-record-status.status-pending {
    background: #fff7e6;
    color: #fa8c16;
}

.my-record-status.status-done {
    background: #f6ffed;
    color: #52c41a;
}

.my-records-loading {
    display: none;
    padding: 40px 0;
    text-align: center;
    color: #999;
}

.my-records-loading.active {
    display: block;
}
