* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    min-height: 100vh;
    padding: 16px;
}

.page {
    display: none;
    max-width: 420px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 通用组件 */
.input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    background: white;
    transition: border-color 0.2s;
}

.input:focus {
    outline: none;
    border-color: #4A90D9;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
}

.btn-primary {
    background: linear-gradient(135deg, #4A90D9, #357ABD);
    color: white;
}

.btn-primary:active {
    transform: scale(0.96);
    opacity: 0.9;
}

.btn-block {
    width: 100%;
}

.btn-outline {
    background: transparent;
    border: 2px solid #e1e5e9;
    color: #666;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.link-group {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #888;
}

.link-group a {
    color: #4A90D9;
    text-decoration: none;
    font-weight: 600;
}

.link-group a:active {
    opacity: 0.7;
}

.form-group {
    margin-bottom: 16px;
}

/* 登录/注册页面 */
.login-container, .register-container {
    background: white;
    border-radius: 20px;
    padding: 32px 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    margin-top: 40px;
}

.login-container h1, .register-container h1 {
    font-size: 28px;
    text-align: center;
    margin-bottom: 8px;
}

.subtitle {
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-bottom: 24px;
}

/* 首页 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-info .email {
    font-size: 14px;
    color: #666;
}

.user-info .points {
    font-size: 18px;
    font-weight: 700;
    color: #4A90D9;
}

.points-expire {
    background: #fff3cd;
    color: #856404;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* 商家列表 */
.merchant-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.merchant-card {
    background: white;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: transform 0.15s;
}

.merchant-card:active {
    transform: scale(0.98);
}

.merchant-card .info {
    flex: 1;
}

.merchant-card .name {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
}

.merchant-card .address {
    font-size: 13px;
    color: #888;
}

.merchant-card .status {
    font-size: 12px;
    color: #27ae60;
    background: #e8f5e9;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
    margin-left: 12px;
}

.merchant-card .status.locked {
    color: #e74c3c;
    background: #fde8e8;
}

/* 充值页 */
.recharge-container {
    background: white;
    border-radius: 20px;
    padding: 32px 24px;
    margin-top: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.recharge-container h2 {
    text-align: center;
    margin-bottom: 24px;
}

.recharge-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 20px;
}

.recharge-amount {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.recharge-price {
    font-size: 24px;
    opacity: 0.9;
    margin-bottom: 12px;
}

.recharge-desc {
    font-size: 14px;
    opacity: 0.8;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 20px;
    font-size: 28px;
    color: #aaa;
    cursor: pointer;
}

.close-btn:active {
    color: #333;
}

.modal-content h3 {
    font-size: 20px;
    margin-bottom: 16px;
}

.modal-content p {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.6;
}

#modal-guide {
    margin: 12px 0;
}

#modal-guide-image {
    max-height: 200px;
    object-fit: cover;
}

/* 加载和提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 2000;
    max-width: 90%;
    text-align: center;
    animation: slideDown 0.3s ease;
}

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 响应式 */
@media (max-width: 420px) {
    .login-container, .register-container, .recharge-container {
        padding: 24px 16px;
    }
    
    .recharge-amount {
        font-size: 28px;
    }
}

.merchant-card .hours {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

/* 解锁后显示的地址 */
.merchant-card .address-unlocked {
    font-size: 13px;
    color: #27ae60;
    margin-top: 4px;
    padding: 4px 8px;
    background: #e8f5e9;
    border-radius: 6px;
    display: inline-block;
}

/* 解锁后显示的指引图提示 */
.merchant-card .guide-unlocked {
    font-size: 12px;
    color: #4A90D9;
    margin-top: 4px;
}

/* 解锁状态标签 */
.merchant-card .status.unlocked {
    color: #27ae60;
    background: #e8f5e9;
}

.merchant-card .status.locked {
    color: #e74c3c;
    background: #fde8e8;
}

/* 弹窗中隐藏信息的过渡效果 */
#modal-hidden-info {
    animation: fadeIn 0.3s ease;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

/* 引导图加载占位 */
#modal-guide-image {
    background: #f5f5f5;
    min-height: 100px;
}

/* 在原有CSS基础上添加以下样式 */

/* 积分不足提示条 */
.points-insufficient {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    animation: slideDown 0.3s ease;
}

.points-insufficient .warning-icon {
    font-size: 20px;
    margin-right: 8px;
}

.points-insufficient .warning-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.btn-warning {
    background: #ffc107;
    color: #856404;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
    white-space: nowrap;
}

.btn-warning:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.btn-warning:hover {
    background: #ffb300;
}

/* 积分过期提示 */
.points-expire {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 16px;
    animation: slideDown 0.3s ease;
}

/* 商家卡片锁定状态 - 积分不足时特殊样式 */
.merchant-card .status.no-points {
    color: #856404;
    background: #fff3cd;
}

/* 解锁按钮 - 积分不足时 */
.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* 成功状态按钮 */
.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* Toast 信息提示优化 */
.toast.info {
    background: #17a2b8;
}

/* 添加 slideDown 动画（如果不存在） */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 在原有CSS基础上添加或修改以下样式 */

/* 用户信息区域 */
.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.user-info .email {
    font-size: 14px;
    color: #666;
}

.points-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-info .points {
    font-size: 18px;
    font-weight: 700;
    color: #4A90D9;
}

.user-info .points-expire-time {
    font-size: 12px;
    color: #999;
    transition: all 0.3s;
}

/* 积分即将到期（3天内） */
.user-info .points-expire-time.soon {
    color: #f39c12;
    font-weight: 500;
}

/* 积分已过期 */
.user-info .points-expire-time.expired {
    color: #e74c3c;
    font-weight: 600;
}

/* 积分充足（10天以上） */
.user-info .points-expire-time.healthy {
    color: #27ae60;
}

/* 积分不足提示条 */
.points-insufficient {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    animation: slideDown 0.3s ease;
}

.points-insufficient .warning-icon {
    font-size: 20px;
    margin-right: 8px;
}

.points-insufficient .warning-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.btn-warning {
    background: #ffc107;
    color: #856404;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
    white-space: nowrap;
}

.btn-warning:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.btn-warning:hover {
    background: #ffb300;
}

/* 积分过期提示 */
.points-expire {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 16px;
    animation: slideDown 0.3s ease;
}

/* 商家卡片锁定状态 - 积分不足时特殊样式 */
.merchant-card .status.no-points {
    color: #856404;
    background: #fff3cd;
}

/* 解锁按钮 - 积分不足时 */
.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* 成功状态按钮 */
.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* Toast 信息提示优化 */
.toast.info {
    background: #17a2b8;
}

/* 添加 slideDown 动画（如果不存在） */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 头部布局优化 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* style.css - 添加积分到期时间样式 */

/* 用户信息区域 */
.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.user-info .email {
    font-size: 14px;
    color: #666;
}

.points-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-info .points {
    font-size: 18px;
    font-weight: 700;
    color: #4A90D9;
}

.user-info .points-expire-time {
    font-size: 12px;
    color: #999;
    transition: all 0.3s;
}

/* 积分即将到期（3天内） */
.user-info .points-expire-time.soon {
    color: #f39c12;
    font-weight: 500;
}

/* 积分已过期 */
.user-info .points-expire-time.expired {
    color: #e74c3c;
    font-weight: 600;
}

/* 积分充足（10天以上） */
.user-info .points-expire-time.healthy {
    color: #27ae60;
}

/* 积分不足提示条 */
.points-insufficient {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    animation: slideDown 0.3s ease;
}

.points-insufficient .warning-icon {
    font-size: 20px;
    margin-right: 8px;
}

.points-insufficient .warning-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.btn-warning {
    background: #ffc107;
    color: #856404;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
    white-space: nowrap;
}

.btn-warning:active {
    transform: scale(0.95);
    opacity: 0.8;
}

/* 积分过期提示 */
.points-expire {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 16px;
    animation: slideDown 0.3s ease;
}

/* 商家卡片状态 */
.merchant-card .status.no-points {
    color: #856404;
    background: #fff3cd;
}

.merchant-card .status.unlocked {
    color: #27ae60;
    background: #e8f5e9;
}

.merchant-card .status.locked {
    color: #e74c3c;
    background: #fde8e8;
}

/* 解锁按钮状态 */
.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:active {
    transform: scale(0.96);
    opacity: 0.9;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* Toast 提示 */
.toast.info {
    background: #17a2b8;
}

/* 动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 头部布局 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* 商家卡片解锁后显示地址 */
.merchant-card .address-unlocked {
    font-size: 13px;
    color: #27ae60;
    margin-top: 4px;
    padding: 4px 8px;
    background: #e8f5e9;
    border-radius: 6px;
    display: inline-block;
}

.merchant-card .guide-unlocked {
    font-size: 12px;
    color: #4A90D9;
    margin-top: 4px;
}

.merchant-card .hours {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

#modal-hidden-info {
    animation: fadeIn 0.3s ease;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

#modal-guide-image {
    background: #f5f5f5;
    min-height: 100px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}