/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-disabled: #999999;
    --border-color: #E5E5E5;
    --bg-color: #F5F5F5;
    --white: #FFFFFF;
    --success-color: #52C41A;
    --warning-color: #FAAD14;
    --error-color: #FF4D4F;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 微信小程序适配 */
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

/* Banner样式 */
.banner {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 页面标题 */
.page-header {
    background: var(--white);
    padding: 16px;
    text-align: center;
    margin-bottom: 8px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* 用户信息栏（已废弃，保留样式以防兼容） */
.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--white);
    margin-bottom: 8px;
}

.user-phone {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.phone-label {
    color: var(--text-secondary);
    margin-right: 8px;
}

.phone-number {
    color: var(--text-primary);
    font-weight: 500;
}

.btn-login {
    padding: 6px 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #FF8787 100%);
    color: var(--white);
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
}

.btn-login:active {
    transform: scale(0.95);
}

/* 容器 */
.container {
    padding: 16px;
    max-width: 750px;
    margin: 0 auto;
}

/* 章节标题 */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-left: 8px;
    border-left: 4px solid var(--primary-color);
}

/* 权益列表 */
.benefit-list {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.benefit-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s;
}

.benefit-item:last-child {
    border-bottom: none;
}

.benefit-item:active {
    background-color: #F9F9F9;
}

.benefit-icon {
    width: 60px;
    height: 60px;
    margin-right: 12px;
    flex-shrink: 0;
}

.benefit-icon img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.benefit-info {
    flex: 1;
    min-width: 0;
}

.benefit-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.benefit-desc {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-exchange {
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #FF8787 100%);
    color: var(--white);
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
}

.btn-exchange:active {
    transform: scale(0.95);
}

/* 权益说明 */
.benefit-description {
    background: var(--white);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.desc-content {
    display: none;
}

.desc-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.desc-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.desc-content ul {
    list-style: none;
    padding: 0;
}

.desc-content li {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    padding-left: 16px;
    position: relative;
}

.desc-content li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* 订单查询入口 */
.order-entry {
    margin-top: 16px;
}

.btn-order-query {
    width: 100%;
    padding: 14px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.btn-order-query:active {
    background-color: #F9F9F9;
}

.btn-order-query .arrow {
    color: var(--text-disabled);
    font-size: 18px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    width: 85%;
    max-width: 400px;
    overflow: hidden;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.close {
    font-size: 24px;
    color: var(--text-disabled);
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px 20px;
}

/* 兑换弹窗 */
.benefit-name-display {
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
}

.exchange-tip {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 16px;
    line-height: 1.6;
}

.exchange-tip a {
    color: var(--primary-color);
    text-decoration: none;
}

/* 登录弹窗（兼容保留） */
.login-tip {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.phone-input-wrapper {
    margin-bottom: 20px;
}

.phone-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
    /* 移动端优化 */
    -webkit-appearance: none;
    appearance: none;
}

.phone-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.1);
}

.btn-confirm-exchange {
    margin-bottom: 0;
}

.btn-one-click-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #FF8787 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

.btn-one-click-login:active {
    transform: scale(0.98);
}

.login-agreement {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 16px;
    line-height: 1.6;
}

.login-agreement a {
    color: var(--primary-color);
    text-decoration: none;
}

/* 导航栏 */
.nav-bar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.btn-back {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    margin-right: 8px;
}

.arrow-left {
    font-size: 18px;
    margin-right: 4px;
}

.nav-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-right: 48px;
}

/* 详情页样式 */
.detail-container {
    padding-bottom: 80px;
}

.detail-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.detail-header {
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(78, 205, 196, 0.1) 100%);
}

.detail-icon {
    width: 80px;
    height: 80px;
    margin-right: 16px;
    flex-shrink: 0;
}

.detail-icon img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
}

.detail-info {
    flex: 1;
}

.detail-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.detail-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-content {
    padding: 16px 20px;
}

.content-section {
    margin-bottom: 20px;
}

.content-section:last-child {
    margin-bottom: 0;
}

.content-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.section-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.instructions ul,
.notices ul {
    list-style: none;
    padding: 0;
}

.instructions li,
.notices li {
    padding-left: 16px;
    position: relative;
    margin-bottom: 6px;
}

.instructions li:before,
.notices li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* 操作栏 */
.action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px 16px;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #FF8787 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* 成功弹窗 */
.success-content {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 60px;
    height: 60px;
    line-height: 60px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--success-color);
    color: var(--white);
    font-size: 36px;
    font-weight: bold;
}

.success-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.success-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* 手机号查询区域 */
.phone-query-section {
    background: var(--white);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.phone-query-section .phone-input-wrapper {
    margin-bottom: 12px;
}

.btn-query {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

/* 订单列表 */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.filter-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--white);
    outline: none;
    /* 移动端优化 */
    -webkit-appearance: none;
    appearance: none;
}

.order-list {
    margin-bottom: 16px;
}

.order-item {
    background: var(--white);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
}

.order-item:active {
    transform: scale(0.98);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.order-number {
    font-size: 13px;
    color: var(--text-secondary);
}

.order-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.order-status.pending {
    background: rgba(250, 173, 20, 0.1);
    color: var(--warning-color);
}

.order-status.processing {
    background: rgba(24, 144, 255, 0.1);
    color: #1890FF;
}

.order-status.completed {
    background: rgba(82, 196, 26, 0.1);
    color: var(--success-color);
}

.order-status.failed {
    background: rgba(255, 77, 79, 0.1);
    color: var(--error-color);
}

/* 订单状态标签（新样式） */
.order-status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 12px;
}

.order-status-badge.completed {
    background: rgba(82, 196, 26, 0.1);
    color: var(--success-color);
}

.order-status-badge.pending {
    background: rgba(250, 173, 20, 0.1);
    color: var(--warning-color);
}

.order-info {
    display: flex;
    align-items: center;
}

.order-icon {
    width: 50px;
    height: 50px;
    margin-right: 12px;
    border-radius: 8px;
    background: var(--bg-color);
}

.order-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.order-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.order-time {
    font-size: 12px;
    color: var(--text-disabled);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 14px;
    color: var(--text-disabled);
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 16px;
}

.btn-load-more {
    padding: 8px 24px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-load-more:active {
    background-color: #F9F9F9;
}

/* 订单详情 */
.order-detail-body {
    font-size: 14px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Loading */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading.show {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--white);
    font-size: 14px;
    margin-top: 12px;
}

/* Toast */
.toast {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--white);
    border-radius: 8px;
    font-size: 14px;
    z-index: 3000;
    white-space: nowrap;
    max-width: 80%;
}

.toast.show {
    display: block;
    animation: toastFadeIn 0.3s, toastFadeOut 0.3s 2.7s;
}

@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes toastFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 微信小程序适配 */
@media screen and (max-width: 414px) {
    .banner {
        height: 180px;
    }
    
    .benefit-icon {
        width: 50px;
        height: 50px;
    }
    
    .benefit-name {
        font-size: 15px;
    }
    
    .modal-content {
        width: 90%;
    }
}

/* 小屏幕优化 */
@media screen and (max-width: 375px) {
    .banner {
        height: 160px;
    }
    
    .container {
        padding: 12px;
    }
    
    .benefit-item {
        padding: 12px;
    }
    
    .btn-exchange {
        padding: 6px 16px;
        font-size: 13px;
    }
}

/* 大屏适配 */
@media (min-width: 750px) {
    .container {
        max-width: 750px;
    }
    
    body {
        background: #E5E5E5;
    }
    
    .banner,
    .page-header,
    .nav-bar {
        max-width: 750px;
        margin: 0 auto;
    }
}

/* 横屏适配 */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .banner {
        height: 120px;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .btn-exchange,
    .btn-primary,
    .btn-order-query,
    .order-item {
        -webkit-tap-highlight-color: transparent;
    }
}

/* 暗色模式适配（可选） */
@media (prefers-color-scheme: dark) {
    /* 可在此添加暗色模式样式 */
}

