
:root {
    --primary: #198754;
    --primary-dark: #146c43;
    --primary-light: #e8f5ee;
    --secondary: #0d6efd;
    --danger: #dc3545;
    --warning: #fd7e14;
    --purple: #7b1fa2;
    --text-primary: #1a1a1a;
    --text-secondary: #555;
    --text-muted: #999;
    --bg-page: #f5f6fa;
    --bg-card: #ffffff;
    --border-color: #efefef;
    --shadow-sm: 0 1px 6px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: 0.2s ease;
    --nav-h: 56px;
    --header-h: 52px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    line-height: 1.5;
    overscroll-behavior-y: none;
}

a {
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

input, button, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

.page-header {
    background: var(--primary);
    color: #fff;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    padding-top: env(safe-area-inset-top, 0px);
}

.page-header h1,
.page-header .header-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin: 0;
}

.header-back {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.header-back:active {
    background: rgba(255,255,255,0.15);
}

.top-bar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px 16px 72px;
    position: relative;
}

.top-bar .brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.brand-info-row h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 2px;
    color: #fff;
}

.brand-info-row p {
    font-size: 12px;
    opacity: 0.85;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}


.float-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: -52px 14px 14px;
    position: relative;
    z-index: 10;
    box-shadow: var(--shadow-md);
}

.balance-card .label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.balance-card .amount {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    line-height: 1.2;
}

.balance-card .amount small {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
}

.balance-stats {
    display: flex;
    gap: 0;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.balance-stats .stat-item {
    flex: 1;
    text-align: center;
    padding: 0 4px;
}

.balance-stats .stat-item + .stat-item {
    border-left: 1px solid var(--border-color);
}

.balance-stats .stat-num {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.balance-stats .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    -webkit-appearance: none;
    touch-action: manipulation;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 3px 10px rgba(25,135,84,0.3);
}

.btn-primary:active {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:active {
    background: #f5f5f5;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 15px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-md);
    letter-spacing: 0.5px;
}

.btn:disabled,
.btn.loading {
    opacity: 0.55;
    pointer-events: none;
}


.quick-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--bg-card);
    margin: 0 14px 14px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.quick-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 6px;
    text-decoration: none;
    transition: background var(--transition);
    user-select: none;
}

.quick-nav a:active {
    background: #f0f9f4;
}

.nav-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 7px;
}

.nav-icon.green { background: var(--primary-light); color: var(--primary); }
.nav-icon.blue  { background: #e5f0ff; color: var(--secondary); }
.nav-icon.orange{ background: #fff3e0; color: var(--warning); }
.nav-icon.purple{ background: #f3e5f5; color: var(--purple); }

.nav-label {
    font-size: 11.5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.notice-bar {
    background: var(--bg-card);
    margin: 0 14px 14px;
    border-radius: var(--radius-md);
    padding: 11px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.notice-icon {
    background: var(--primary-light);
    color: var(--primary);
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.notice-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    margin: 20px 0 12px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 17px;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}

.section-link {
    font-size: 13px;
    color: var(--text-muted);
}


.project-list {
    padding: 0 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    display: flex;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.project-card:active {
    transform: scale(0.985);
    box-shadow: var(--shadow-sm);
}

.project-card .cover {
    width: 100px;
    min-height: 100px;
    object-fit: cover;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: var(--primary);
    flex-shrink: 0;
}

.project-card .cover img {
    width: 100px;
    height: 100%;
    object-fit: cover;
}

.project-card .info {
    padding: 12px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.project-card .proj-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.project-card .proj-organizer {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.charity-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.original-price {
    font-size: 12px;
    color: #c0c4cc;
    text-decoration: line-through;
}

.cashback-badge {
    background: #fff3e0;
    color: #e65100;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 500;
}


.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 52px;
    color: #d5d8df;
    margin-bottom: 14px;
    display: block;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(25,135,84,0.12);
}

.form-control::placeholder {
    color: #bfc4cc;
}

textarea.form-control {
    height: auto;
    min-height: 90px;
    padding: 12px 14px;
    resize: none;
    line-height: 1.5;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.badge-success { background: var(--primary-light); color: var(--primary); }
.badge-warning { background: #fff3e0; color: #d97706; }
.badge-danger  { background: #fde8e8; color: var(--danger); }
.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-gray    { background: #f3f4f6; color: #6b7280; }

.order-card {
    background: var(--bg-card);
    margin: 10px 14px 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.order-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    background: #fafcff;
}

.order-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 10px;
}

.order-card-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.order-card-body {
    padding: 10px 14px;
}

.order-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    line-height: 1.5;
}

.order-meta-row i {
    font-size: 13px;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    color: #bbb;
}

.appoint-block {
    background: #f8faff;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-top: 8px;
    border-left: 3px solid var(--secondary);
}

.appoint-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.appoint-row i {
    width: 14px;
    text-align: center;
    color: #94a3b8;
    flex-shrink: 0;
}

.order-card-foot {
    padding: 10px 14px 12px;
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--border-color);
}

.order-card-foot .btn {
    flex: 1;
    height: 38px;
    padding: 0;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.fund-header-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    margin: 14px;
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
    color: #fff;
    box-shadow: 0 4px 16px rgba(25,135,84,0.25);
}

.fund-header-card .fund-label {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 6px;
}

.fund-header-card .fund-num {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.fund-header-card .fund-hint {
    font-size: 12px;
    opacity: 0.75;
    margin-top: 6px;
}

.log-list {
    background: var(--bg-card);
    margin: 0 14px 14px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.log-item {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

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

.log-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.log-item-icon.in  { background: var(--primary-light); color: var(--primary); }
.log-item-icon.out { background: #fde8e8; color: var(--danger); }
.log-item-icon.ref { background: #fff3e0; color: var(--warning); }

.log-left { flex: 1; min-width: 0; }

.log-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.log-money {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.log-money.out { color: var(--danger); }


.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    display: flex;
    box-shadow: 0 -1px 0 rgba(0,0,0,0.06), 0 -4px 12px rgba(0,0,0,0.05);
    z-index: 100;
    height: var(--nav-h);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.footer-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #b0b8c4;
    font-size: 10.5px;
    transition: color var(--transition);
    gap: 3px;
    padding-bottom: 2px;
    user-select: none;
}

.footer-nav a i {
    font-size: 22px;
    line-height: 1;
}

.footer-nav a.active {
    color: var(--primary);
}

.footer-nav a.active i {
    transform: scale(1.08);
}

.footer-nav a:active {
    background: rgba(25,135,84,0.05);
}


.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--bg-card);
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    transform: translateY(20px);
    transition: transform var(--transition);
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}
.modal-overlay.center {
    align-items: center;
}

.modal-overlay.center .modal-box {
    width: 88%;
    max-width: 340px;
    border-radius: var(--radius-xl);
    padding: 28px 22px;
    transform: scale(0.92);
}

.modal-overlay.center.active .modal-box {
    transform: scale(1);
}

.modal-title {
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 18px;
    color: var(--text-primary);
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: 0 auto 16px;
}

.toast {
    position: fixed;
    bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: rgba(20, 20, 20, 0.85);
    color: #fff;
    padding: 10px 22px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    white-space: nowrap;
    backdrop-filter: blur(6px);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    align-items: center;
    padding: 14px 0;
    font-size: 13px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}

.pagination a:active {
    background: var(--primary-light);
    color: var(--primary);
}

.pagination a.current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}

.pagination .disabled {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
}

.pagination span.dots {
    background: transparent;
    border: none;
    min-width: auto;
    padding: 0 2px;
}

.menu-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin: 0 14px 14px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.menu-item {
    display: flex;
    padding: 14px 16px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background var(--transition);
    user-select: none;
}

.menu-item:active { background: #f5f5f5; }
.menu-item:last-child { border-bottom: none; }

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

.menu-item-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.menu-item-text {
    font-size: 15px;
    color: var(--text-primary);
}

.menu-item-arrow {
    color: #c8ccd4;
    font-size: 13px;
}

.wx-status {
    font-size: 12px;
    padding: 3px 9px;
    border-radius: 20px;
}

.wx-status.bind    { background: var(--primary-light); color: var(--primary); }
.wx-status.unbind  { background: #fde8e8; color: var(--danger); }

.user-head {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 28px 20px 64px;
    text-align: center;
}

.avatar {
    width: 68px;
    height: 68px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.45);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nickname {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 3px;
}

.phone {
    font-size: 13px;
    opacity: 0.8;
}

.team-box {
    background: var(--bg-card);
    margin: -42px 14px 14px;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
}

.team-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.team-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.team-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.team-phone {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

.team-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
}

.auth-page {
    min-height: 100vh;
    background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 40%, #0d3d23 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 20px 40px;
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
    color: #fff;
}

.auth-logo i {
    font-size: 48px;
    opacity: 0.9;
    display: block;
    margin-bottom: 10px;
}

.auth-logo h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
}

.auth-logo p {
    font-size: 13px;
    opacity: 0.75;
    margin-top: 4px;
}

.auth-card {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 28px 20px;
    box-shadow: var(--shadow-lg);
}

.auth-card .card-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.auth-card .card-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 22px;
}

.auth-tabs {
    display: flex;
    background: #f4f5f8;
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    padding: 9px;
    border: none;
    background: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.auth-tab.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    font-weight: 600;
}

.msg-box {
    background: #fde8e8;
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    font-size: 13.5px;
    text-align: center;
    line-height: 1.4;
}

.code-row {
    display: flex;
    gap: 8px;
}

.code-row .form-control {
    flex: 1;
}

.code-btn {
    height: 48px;
    padding: 0 14px;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition);
}

.code-btn:active {
    background: #c5e8d5;
}

.code-btn:disabled {
    opacity: 0.55;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

.detail-cover {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    background: var(--primary-light);
}

.detail-cover-placeholder {
    width: 100%;
    height: 180px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 50px;
}

.info-card {
    background: var(--bg-card);
    margin: 10px 14px;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.info-card h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.4;
}

.info-card h5 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.sale-price {
    font-size: 26px;
    color: var(--primary);
    font-weight: 800;
    line-height: 1;
}

.origin-price {
    font-size: 13px;
    color: #c0c4cc;
    text-decoration: line-through;
}

.rebate-tag {
    background: #fff3e0;
    color: #e65100;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.desc-content {
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.9;
}

.buy-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    z-index: 150;
    display: flex;
    gap: 8px;
    flex-direction: row;
    align-items: center;
}

.btn-buy {
    display: block;
    flex: 1;
    width: auto;
    background: linear-gradient(90deg, #27ae60 0%, var(--primary) 100%);
    color: #fff;
    text-align: center;
    line-height: 48px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(25,135,84,0.35);
    text-decoration: none;
    transition: all var(--transition);
}

.btn-buy:active {
    opacity: 0.88;
    box-shadow: 0 2px 6px rgba(25,135,84,0.2);
}

.btn-share {
    display: block;
    flex: 1;
    width: auto;
    background: var(--primary-light);
    color: var(--primary);
    text-align: center;
    line-height: 48px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 14px;
    border: 1px solid rgba(25,135,84,0.2);
    text-decoration: none;
    transition: all var(--transition);
}

.btn-share:active {
    background: #c5e8d5;
}
.pay-page {
    padding: 14px 14px calc(90px + env(safe-area-inset-bottom, 0px));
}

.pay-amount-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
    color: #fff;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(25,135,84,0.25);
}

.pay-label {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 8px;
}

.pay-amount {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
}

.pay-amount small {
    font-size: 20px;
    font-weight: 500;
    opacity: 0.8;
}

.pay-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.pay-card-title {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 500;
}

.store-info {
    background: #f8faf9;
    padding: 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
}

.store-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
    flex-shrink: 0;
}

.store-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.store-address {
    font-size: 12px;
    color: var(--text-muted);
}

.pay-method-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pay-method-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: all var(--transition);
}

.pay-method-item.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.pay-method-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    background: #f0f0f0;
    flex-shrink: 0;
    transition: all var(--transition);
}

.pay-method-item.active .pay-method-icon {
    background: var(--primary);
    color: #fff;
}

.pay-method-info {
    flex: 1;
}

.pay-method-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.pay-method-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.pay-method-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all var(--transition);
}

.pay-method-item.active .pay-method-check {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.fund-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
}

.fund-bar-icon { color: var(--primary); font-size: 16px; }

.fund-bar-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.fund-bar-text strong { color: var(--primary); }

.fund-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
}

.fund-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.pay-sticky-btn {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 12px rgba(0,0,0,0.07);
    z-index: 50;
}

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

.fade-in {
    animation: fadeInUp 0.3s ease forwards;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.04); }
}

.pulse { animation: pulse 2s infinite; }

.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-danger  { color: var(--danger); }
.text-small   { font-size: 12px; }
.text-bold    { font-weight: 600; }
.mt-1  { margin-top: 8px; }
.mt-2  { margin-top: 16px; }
.mt-3  { margin-top: 24px; }
.mb-1  { margin-bottom: 8px; }
.mb-2  { margin-bottom: 16px; }
.mb-3  { margin-bottom: 24px; }
.p-0   { padding: 0 !important; }
.p-1   { padding: 8px; }
.p-2   { padding: 16px; }
.d-flex { display: flex; }
.align-items-center    { align-items: center; }
.align-items-baseline  { align-items: baseline; }
.justify-content-between { justify-content: space-between; }
.justify-content-center  { justify-content: center; }
.gap-1  { gap: 6px; }
.gap-2  { gap: 12px; }
.gap-3  { gap: 20px; }
.flex-1 { flex: 1; }
.w-100  { width: 100%; }
.rounded { border-radius: var(--radius-md); }
.small  { font-size: 12px; }
.mb-0   { margin-bottom: 0 !important; }
.m-0    { margin: 0 !important; }

body.no-nav {
    padding-bottom: 0;
}

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.12);
    border-radius: 3px;
}

::selection {
    background: var(--primary-light);
    color: var(--primary-dark);
}
