/* 全局变量 - 美团风格配色 */
:root {
    --meituan-yellow: #FFD100;
    --meituan-orange: #FF8C00;
    --meituan-red: #FF4D4F;
    --meituan-gray: #F5F5F5;
    --meituan-dark: #333333;
    --meituan-light: #666666;
    --meituan-hover: #FFC53D;
    --radius: 12px;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --container-max-width: 90%;
    --mobile-max-width: 400px;
    --container-padding: 20px;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* 美团风格渐变背景 */
    background: linear-gradient(135deg, #FFD100 0%, #FF8C00 100%);
    min-height: 100vh;
    color: #333;
    padding: 15px;
}
/* 导航栏样式 */
.nav-container {
    max-width: var(--mobile-max-width);
    margin: 0 auto 15px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    /* 默认隐藏，有MTtoken时显示 */
    display: none;
}
.nav-tabs {
    display: flex;
    width: 100%;
}
.nav-tab {
    flex: 1;
    text-align: center;
    padding: 15px 10px;
    font-size: 16px;
    font-weight: 500;
    color: var(--meituan-light);
    background: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.nav-tab.active {
    color: var(--meituan-orange);
    border-bottom: 3px solid var(--meituan-orange);
}
.nav-tab:hover {
    background: var(--meituan-gray);
}
/* 主容器样式 - 融合两个页面的容器风格 */
.main-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.page-container {
    display: none;
    width: 100%;
}
.page-container.active {
    display: block;
}
.container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: var(--container-padding);
    width: 100%;
    max-width: var(--mobile-max-width);
    margin: 0 auto;
    transition: transform 0.3s ease;
}
.container:hover {
    transform: translateY(-5px);
}
/* 津贴免配模块样式 */
.allowance-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: var(--container-padding);
    width: 100%;
    max-width: var(--mobile-max-width);
    margin: 0 auto;
    transition: transform 0.3s ease;
}
.allowance-container:hover {
    transform: translateY(-5px);
}
.header {
    display: flex;
    justify-content: center; /* 标题居中 */
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
    position: relative; /* 为关闭按钮定位 */
}
.header h2 {
    font-size: 20px;
    color: var(--meituan-dark);
    text-align: center;
}
.close {
    font-size: 24px;
    cursor: pointer;
    color: var(--meituan-light);
    position: absolute; /* 关闭按钮绝对定位 */
    right: 0; /* 靠右显示 */
    top: 50%;
    transform: translateY(-50%);
}
.close:hover {
    color: var(--meituan-orange);
}
.tab {
    /* 删除津贴免配标签后隐藏tab区域 */
    display: none;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}
.tab span {
    padding: 8px 16px;
    font-size: 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.tab span.active {
    color: var(--meituan-orange);
    border-bottom: 2px solid var(--meituan-orange);
}
.content {
    padding: 0;
}
.input-group {
    margin: 15px 0;
    position: relative;
}
.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--meituan-dark);
}
.input-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
/* 按钮通用样式 - 统一为美团风格 */
.btn {
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}
/* 美团风格按钮渐变 */
.btn-primary {
    background: linear-gradient(135deg, #FFD100 0%, #FF8C00 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 209, 0, 0.3);
}
.btn-secondary {
    background: linear-gradient(135deg, #FF6700 0%, #FF3D00 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 103, 0, 0.3);
}
.btn-wechat-green {
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(7, 193, 96, 0.3);
}
.btn-tutorial {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.btn-coupon-link {
    background: linear-gradient(135deg, #00C9FF 0%, #92FE9D 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 201, 255, 0.3);
}
.btn-allowance {
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}
.btn-favorite {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
.btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}
/* 搜索框样式 */
.search-box {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.search-box input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
/* 地址操作区域样式 */
.location-group {
    margin: 15px 0;
}
.location-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--meituan-dark);
}
.location-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.location-btn {
    flex: 1;
    background: linear-gradient(135deg, #FFD100 0%, #FF8C00 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 209, 0, 0.2);
    transition: all 0.3s ease;
}
.location-btn.secondary {
    background: linear-gradient(135deg, #666 0%, #333 100%);
}
.location-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}
.address-input-wrap {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.address-input-wrap input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 10px;
    box-sizing: border-box;
}
.address-input-wrap button {
    padding: 12px 18px;
    background: linear-gradient(135deg, #FFD100 0%, #FF8C00 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(255, 209, 0, 0.2);
    transition: all 0.3s ease;
}
.address-input-wrap button:hover {
    background: linear-gradient(135deg, #FFC53D 0%, #FF7A00 100%);
}
/* 历史记录样式 */
.history-section {
    margin: 15px 0;
}
.history-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--meituan-dark);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.clear-history {
    font-size: 12px;
    color: #FF4D4F;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}
.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}
.history-item {
    background: var(--meituan-gray);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--meituan-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}
.history-item:hover {
    background: var(--meituan-hover);
    transform: scale(1.05);
}
.history-item.selected {
    background: var(--meituan-orange);
    color: white;
}
.delete-button {
    margin-top: 10px;
    background: linear-gradient(135deg, #FF4D4F 0%, #E53E3E 100%);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: none;
    width: 100%;
    text-align: center;
}
.delete-button.show {
    display: block;
}
/* 店铺列表样式 */
.result-item {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: #fff;
    position: relative;
}
.result-item:last-child {
    border-bottom: none;
}
.result-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
}
.result-info {
    flex: 1;
    margin-left: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.result-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--meituan-dark);
}
.result-detail {
    font-size: 14px;
    color: var(--meituan-light);
}
.scheme-info {
    /* 隐藏参数显示 */
    display: none;
    font-size: 12px;
    color: var(--meituan-orange);
    margin-top: 8px;
    word-break: break-all;
}
.detail-btn {
    background: linear-gradient(135deg, #FFD100 0%, #FF8C00 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    align-self: flex-start;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(255, 209, 0, 0.2);
}
.detail-btn:hover {
    background: linear-gradient(135deg, #FFC53D 0%, #FF7A00 100%);
}
.favorite-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}
.favorite-btn.favorited {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}
.favorite-btn:hover {
    opacity: 0.9;
}
/* 状态提示样式 */
.status-message {
    text-align: center;
    padding: 10px;
    margin: 10px 0;
    border-radius: 6px;
    font-weight: bold;
}
.success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}
.error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}
.loading {
    background-color: #d9edf7;
    color: #31708f;
    border: 1px solid #bce8f1;
}
.hidden {
    display: none;
}
.token-tip {
    color: var(--meituan-light);
    font-size: 12px;
    margin-top: 5px;
    padding: 8px;
    background-color: #f8f8f8;
    border-radius: 4px;
}
/* 领券模块样式 */
.logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: bold;
}
h1, h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}
.subtitle {
    color: #666;
    font-size: 16px;
    margin-bottom: 5px;
    line-height: 1.5;
    text-align: center;
}
.subtitlee {
    color: #adadad;
    font-size: 13px;
    margin-bottom: 5px;
    line-height: 0.5;
    text-align: center;
}
.buttons-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 15px 0;
}
.two-row-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.button-row {
    display: flex;
    gap: 15px;
}
.button-row .btn {
    flex: 1;
}
#errorMsg {
    color: #e74c3c;
    margin-top: 25px;
    padding: 12px;
    background: #fdf2f2;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    display: none;
    text-align: center;
}
.app-icon {
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.footer {
    margin-top: 30px;
    color: #999;
    font-size: 14px;
    text-align: center;
}
/* 状态标志样式 */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f7f7f9;
    color: #333;
}
.status-badge .status-icon {
    font-weight: 700;
}
.status-badge.ok {
    border: 1px solid #22c55e;
}
.status-badge.ok .status-icon {
    color: #22c55e;
}
.status-badge.fail {
    border: 1px solid #ef4444;
}
.status-badge.fail .status-icon {
    color: #ef4444;
}
/* 非微信环境提示 */
.tip-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 1999;
}
.tip-image {
    max-width: 100%;
    height: auto;
    display: none;
    margin: 20px auto;
    border-radius: 8px;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
}
/* 红包模块样式 */
.domain-container {
    width: 100%;
    max-width: var(--mobile-max-width);
    margin: 15px auto 0;
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
}
.domain-image-box {
    flex: 1;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.domain-image-box:hover {
    transform: translateY(-3px);
}
.domain-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 8px;
}
.domain-text {
    font-size: 14px;
    color: var(--meituan-dark);
    font-weight: 600;
    text-align: center;
}
/* 商家查询相关样式 */
.merchant-result-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #FFD100;
}

.merchant-result-item .merchant-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.merchant-result-item .merchant-id {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.merchant-result-item .merchant-link {
    font-size: 12px;
    color: #999;
    word-break: break-all;
    margin-bottom: 10px;
}

/* 响应式适配 */
@media (max-width: 480px) {
    .container, .allowance-container {
        padding: 15px 10px;
    }
    h1, h3 {
        font-size: 20px;
    }
    .btn {
        padding: 14px;
        font-size: 14px;
    }
    .status-bar {
        flex-direction: row;
    }
    .status-badge {
        font-size: 12px;
        padding: 6px 8px;
    }
    .button-row {
        gap: 10px;
    }
    .two-row-buttons {
        gap: 10px;
    }
    .domain-container {
        flex-wrap: nowrap;
        gap: 8px;
    }
    .domain-image-box {
        padding: 10px;
        min-width: 0;
    }
    .nav-tab {
        padding: 12px 8px;
        font-size: 14px;
    }
    
    .history-item {
        max-width: 100px;
        font-size: 11px;
    }
    
    .merchant-result-item {
        padding: 12px;
    }
    
    .merchant-result-item .merchant-name {
        font-size: 14px;
    }
    
    .merchant-result-item .merchant-id {
        font-size: 12px;
    }
}