/* 移动端基础重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #93c5fd;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-gradient: linear-gradient(160deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
    --text: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.97);
    --card-text: #1f2937;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --muted: #e5e7eb;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-gradient);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}

.h5-container {
    min-height: 100vh;
    padding-bottom: calc(64px + var(--safe-area-bottom));
    position: relative;
    overflow-x: hidden;
    max-width: 100vw;
}

/* 顶部 Logo */
.h5-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: max(16px, env(safe-area-inset-top)) 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
}

.logo-icon {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
}

/* Hero 区域 */
.hero-section {
    padding: 24px 20px 32px;
    text-align: center;
}

.hero-title {
    font-size: clamp(26px, 7.5vw, 36px);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 10px;
    letter-spacing: 1px;
    background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.75) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title .highlight {
    color: #fde047;
}

.hero-subtitle {
    font-size: 15px;
    opacity: 0.85;
    margin-bottom: 28px;
    letter-spacing: 2px;
}

/* 主卡片 */
.main-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 32px 24px;
    margin: 0 12px 28px;
    color: var(--card-text);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    position: relative;
    overflow: hidden;
}

.main-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, rgba(102,126,234,0.12), rgba(118,75,162,0.08));
    border-radius: 50%;
}

.main-card::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(118,75,162,0.08), rgba(102,126,234,0.06));
    border-radius: 50%;
}

.card-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.card-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.card-desc {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 22px;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

/* 特性列表 */
.card-features {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 18px 0 6px;
    position: relative;
    z-index: 1;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #4b5563;
    font-weight: 500;
}

.feature-icon {
    color: var(--success);
    font-weight: 800;
    font-size: 15px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 14px 28px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(102,126,234,0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    letter-spacing: 1px;
}

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

.btn-primary.full {
    width: 100%;
}

.btn-query {
    width: 100%;
    padding: 18px 24px;
    font-size: 18px;
    border-radius: 16px;
}

.btn-arrow {
    font-size: 20px;
    transition: transform 0.2s;
}

.btn-primary:hover .btn-arrow,
.btn-primary:active .btn-arrow {
    transform: translateX(3px);
}

.btn-primary.yellow {
    background: linear-gradient(135deg, #fde047, #facc15);
    color: #1f2937;
    box-shadow: 0 4px 12px rgba(250,204,21,0.3);
}

.btn-primary.yellow:active {
    box-shadow: 0 2px 6px rgba(250,204,21,0.3);
}

/* 底部标语 */
.footer-slogan {
    text-align: center;
    font-size: 16px;
    opacity: 0.9;
    margin: 0 16px 20px;
    letter-spacing: 2px;
}

/* 底部 Tab Bar */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    padding-bottom: var(--safe-area-bottom, env(safe-area-inset-bottom));
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 100;
    overflow: visible;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    color: rgba(255,255,255,0.6) !important;
    text-decoration: none;
    font-size: 10px !important;
    line-height: 1.2 !important;
    gap: 3px;
    padding: 0;
    min-height: 44px;
    transition: color 0.2s;
    overflow: visible;
    position: relative;
}

.tab-item.active,
.tab-item:hover,
.tab-item:active {
    color: #fff !important;
}

.tab-icon {
    width: 24px;
    height: 24px;
    display: block !important;
    object-fit: contain;
    flex-shrink: 0;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 强制文字显示 - 覆盖一切可能的隐藏 */
.tab-item span {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    flex-basis: auto !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
}

/* 表单页 */
.page-header {
    padding: 20px 20px 10px;
    text-align: center;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.page-header p {
    font-size: 14px;
    opacity: 0.85;
}

.form-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 24px;
    margin: 0 16px 24px;
    color: var(--card-text);
}

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

.form-group label {
    display: block;
    font-size: 14px;
    color: #374151;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 16px;
    background: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-tip {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

.price-tag {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    color: var(--danger);
    font-weight: 700;
}

.price-tag .num {
    font-size: 28px;
}

/* 支付页 */
.pay-qr {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.pay-qr img {
    max-width: 220px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.pay-qr .tip {
    margin-top: 12px;
    color: #6b7280;
    font-size: 14px;
}

.order-info {
    background: #eff6ff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.order-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.order-info-item:last-child {
    margin-bottom: 0;
}

.order-info-label {
    color: #6b7280;
}

.order-info-value {
    color: #1f2937;
    font-weight: 500;
}

/* 结果页 */
.result-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 32px 24px;
    margin: 0 16px 24px;
    text-align: center;
    color: var(--card-text);
}

.result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 16px;
}

.result-icon.success { background: #dcfce7; color: var(--success); }
.result-icon.danger { background: #fee2e2; color: var(--danger); }
.result-icon.warning { background: #fef3c7; color: var(--warning); }
.result-icon.info { background: #dbeafe; color: #3b82f6; }

.result-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-desc {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 24px;
}

.result-detail {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    text-align: left;
    margin-bottom: 24px;
}

.result-detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.result-detail-item:last-child {
    margin-bottom: 0;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.status-badge.unpaid { background: #fef3c7; color: #92400e; }
.status-badge.paid { background: #dcfce7; color: #166534; }

/* 我的页 */
.mine-header {
    padding: 30px 20px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mine-header .mine-info {
    flex: 1;
    min-width: 0;
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
}

.mine-info h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.mine-info p {
    font-size: 14px;
    opacity: 0.85;
}

.menu-list {
    background: var(--card-bg);
    border-radius: 16px;
    margin: 0 16px 24px;
    overflow: hidden;
    color: var(--card-text);
}

.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: #1f2937;
    transition: background 0.2s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:active {
    background: #f3f4f6;
}

.menu-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}

.menu-item-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.menu-item-arrow {
    color: #9ca3af;
    font-size: 18px;
}

/* 订单列表 */
.order-list {
    padding: 0 16px 24px;
}

.order-item {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    color: var(--card-text);
}

.order-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-item-title {
    font-weight: 600;
    font-size: 15px;
}

.order-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.order-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-item-price {
    color: var(--danger);
    font-weight: 700;
    font-size: 16px;
}

.order-item-action {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}

/* 加载与提示 */
.loading-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    color: #fff;
    flex-direction: column;
    gap: 12px;
}

.loading-mask.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 300;
    display: none;
}

.toast.active {
    display: block;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 14px;
}

/* 协议弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 400;
    display: none;
    align-items: flex-end;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-height: 80vh;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    color: #1f2937;
    overflow-y: auto;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
}

.modal-body {
    font-size: 14px;
    line-height: 1.7;
    color: #4b5563;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

.modal-close {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
}

/* 客服二维码 */
.qr-wrap {
    text-align: center;
    padding: 20px;
}

.qr-wrap img {
    max-width: 200px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.qr-wrap p {
    margin-top: 12px;
    color: #6b7280;
    font-size: 14px;
}

/* 隐藏滚动条但保持滚动 */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}

#query-form.disabled {
    opacity: 0.55;
    pointer-events: none;
}

#query-form.disabled .btn-primary {
    background: #9ca3af;
    box-shadow: none;
}

/* 响应式：小屏幕适配 */
@media (max-width: 380px) {
    .hero-title {
        font-size: clamp(22px, 7vw, 28px);
        letter-spacing: 0;
    }
    .card-title {
        font-size: 19px;
    }
    .card-features {
        gap: 12px;
    }
    .feature-item {
        font-size: 12px;
    }
    .main-card {
        padding: 24px 18px;
        margin: 0 8px 24px;
    }
}

@media (min-width: 414px) {
    .main-card {
        padding: 36px 28px;
    }
}

/* 超小屏幕（iPhone SE 等） */
@media (max-width: 360px) {
    .hero-section {
        padding: 20px 16px 28px;
    }
    .card-features {
        flex-wrap: wrap;
        gap: 10px;
    }
}
