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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f6f8;
    color: #1a1a1a;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ========== 顶部导航 ========== */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.25);
}

.nav-bar .back-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
}

.nav-bar .back-btn:active { background: rgba(255,255,255,0.15); }

.nav-bar .title {
    font-size: 17px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.nav-bar .nav-right {
    width: 32px;
    text-align: right;
    font-size: 13px;
    cursor: pointer;
}

/* ========== 底部Tab ========== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    border-top: 1px solid #eee;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
}

.tab-bar .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0 6px;
    color: #999;
    font-size: 11px;
    cursor: pointer;
}

.tab-bar .tab-item.active { color: #07c160; }

.tab-bar .tab-item .icon {
    font-size: 22px;
    margin-bottom: 2px;
}

/* ========== 卡片 ========== */
.card {
    background: #fff;
    border-radius: 12px;
    margin: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* ========== 收款首页 ========== */
.pay-header {
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    color: #fff;
    padding: 30px 20px 40px;
    text-align: center;
}

.pay-header .shop-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.pay-header .shop-desc {
    font-size: 13px;
    opacity: 0.85;
}

.amount-section {
    background: #fff;
    margin: -24px 16px 0;
    border-radius: 16px;
    padding: 24px 20px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
    z-index: 10;
}

.amount-label {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-bottom: 8px;
}

.amount-display {
    text-align: center;
    font-size: 42px;
    font-weight: 700;
    color: #1a1a1a;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.amount-display .currency {
    font-size: 24px;
    margin-right: 4px;
    font-weight: 500;
}

.amount-display .placeholder {
    color: #ccc;
    font-size: 36px;
}

.remark-input {
    width: 100%;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    margin-top: 16px;
    outline: none;
    background: #fafafa;
}

.remark-input:focus {
    border-color: #07c160;
    background: #fff;
}

/* 数字键盘 */
.keyboard {
    background: #f0f1f3;
    padding: 8px 4px;
    margin-top: 12px;
}

.keyboard-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.key-btn {
    flex: 1;
    height: 50px;
    background: #fff;
    border: none;
    border-radius: 8px;
    font-size: 22px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    user-select: none;
}

.key-btn:active { background: #e8e8e8; }

.key-btn.confirm {
    background: linear-gradient(135deg, #07c160, #06ad56);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
}

.key-btn.confirm:active { opacity: 0.85; }

.key-btn.confirm:disabled {
    background: #b5e3c5;
    cursor: not-allowed;
}

/* ========== 订单详情页 ========== */
.order-detail {
    padding: 16px;
}

.status-banner {
    text-align: center;
    padding: 30px 20px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.status-banner.pending {
    background: linear-gradient(135deg, #fff8e6, #fff3d6);
    color: #b8860b;
}

.status-banner.paid {
    background: linear-gradient(135deg, #e8f8ef, #d6f2e2);
    color: #07c160;
}

.status-banner.submitted {
    background: linear-gradient(135deg, #e6f4ff, #d6eaff);
    color: #1890ff;
}

.status-banner.expired,
.status-banner.cancelled {
    background: linear-gradient(135deg, #f5f5f5, #ececec);
    color: #999;
}

.status-banner .status-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.status-banner .status-text {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.status-banner .status-amount {
    font-size: 36px;
    font-weight: 700;
    margin-top: 8px;
}

.status-banner .countdown {
    font-size: 14px;
    margin-top: 8px;
    opacity: 0.8;
}

.order-info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.order-info-row:last-child { border-bottom: none; }

.order-info-row .label { color: #888; }

.order-info-row .value {
    color: #1a1a1a;
    font-weight: 500;
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

.order-info-row .value.money { color: #07c160; font-weight: 600; }

/* 二维码区域 */
.qr-section {
    text-align: center;
    padding: 20px;
}

.qr-box {
    width: 180px;
    height: 180px;
    margin: 0 auto 12px;
    background: #fff;
    border: 2px solid #eee;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.qr-placeholder {
    text-align: center;
    color: #999;
    font-size: 12px;
}

.qr-placeholder .qr-icon {
    font-size: 48px;
    margin-bottom: 8px;
    display: block;
}

.qr-tip {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

/* 操作按钮 */
.btn-group {
    display: flex;
    gap: 12px;
    padding: 16px;
}

.btn {
    flex: 1;
    height: 46px;
    border: none;
    border-radius: 23px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #07c160, #06ad56);
    color: #fff;
}

.btn-primary:active { opacity: 0.85; }

.btn-outline {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

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

.btn-danger {
    background: #fff;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

/* ========== 订单列表 ========== */
.list-container {
    padding: 12px;
    padding-bottom: 80px;
}

.filter-tabs {
    display: flex;
    background: #fff;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 12px;
    gap: 4px;
}

.filter-tab {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
}

.filter-tab.active {
    background: #07c160;
    color: #fff;
    font-weight: 500;
}

.order-item {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.order-item:active { background: #f9f9f9; }

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

.order-item-id {
    font-size: 13px;
    color: #999;
    font-family: monospace;
}

.order-item-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.order-item-status.pending { background: #fff8e6; color: #d4a017; }
.order-item-status.submitted { background: #e6f4ff; color: #1890ff; }
.order-item-status.paid { background: #e8f8ef; color: #07c160; }
.order-item-status.expired { background: #f5f5f5; color: #999; }
.order-item-status.cancelled { background: #f5f5f5; color: #999; }

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

.order-item-remark {
    font-size: 14px;
    color: #333;
    flex: 1;
    margin-right: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-item-remark.empty { color: #bbb; }

.order-item-amount {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.order-item-time {
    font-size: 12px;
    color: #bbb;
    margin-top: 6px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
}

.empty-state .empty-icon {
    font-size: 56px;
    margin-bottom: 12px;
}

.empty-state .empty-text {
    font-size: 14px;
}

.load-more {
    text-align: center;
    padding: 16px;
    color: #999;
    font-size: 13px;
}

/* ========== 统计页 ========== */
.stats-header {
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    color: #fff;
    padding: 24px 20px 36px;
}

.stats-header .label {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 4px;
}

.stats-header .total-amount {
    font-size: 38px;
    font-weight: 700;
}

.stats-header .total-count {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 4px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 12px;
    margin-top: -20px;
    position: relative;
    z-index: 10;
}

.stats-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stats-card .card-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}

.stats-card .card-value {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

.stats-card .card-value.green { color: #07c160; }
.stats-card .card-value.orange { color: #fa8c16; }
.stats-card .card-value.gray { color: #999; }

.stats-card .card-sub {
    font-size: 11px;
    color: #bbb;
    margin-top: 4px;
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    max-width: 80%;
    text-align: center;
    animation: toastIn 0.2s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* ========== Loading ========== */
.loading-mask {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e8e8e8;
    border-top-color: #07c160;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 底部安全区 */
.page-content { padding-bottom: 70px; }

/* ========== 商品管理 ========== */
.form-section {
    background: #fff;
    margin: 12px;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.form-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
    color: #1a1a1a;
    display: flex;
    align-items: center;
}

.form-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 16px;
    background: #07c160;
    border-radius: 2px;
    margin-right: 8px;
}

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

.form-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    background: #fafafa;
}

.form-input:focus { border-color: #07c160; background: #fff; }

textarea.form-input {
    resize: none;
    min-height: 70px;
}

.price-input-wrap { position: relative; }

.price-input-wrap .price-prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
}

.price-input-wrap .form-input { padding-left: 28px; }

.image-upload {
    width: 100%;
    height: 160px;
    border: 2px dashed #ddd;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #fafafa;
    position: relative;
    overflow: hidden;
}

.image-upload:active { background: #f0f0f0; }

.image-upload .upload-icon { font-size: 36px; margin-bottom: 6px; }
.image-upload .upload-text { font-size: 13px; color: #999; }
.image-upload img { width: 100%; height: 100%; object-fit: cover; }

.image-upload .remove-img {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
}

.product-grid { padding: 0 12px 80px; }

.product-card {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.product-card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f0f0f0;
    display: block;
}

.product-card-img-placeholder {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 40px;
}

.product-card-body { padding: 12px 14px; }

.product-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card-desc {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.product-card-price {
    font-size: 20px;
    font-weight: 700;
    color: #ff4d4f;
}

.product-card-price .yuan {
    font-size: 13px;
    font-weight: 500;
}

.product-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-card-sales { font-size: 11px; color: #bbb; }

.product-status-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.product-status-tag.on { background: #e8f8ef; color: #07c160; }
.product-status-tag.off { background: #f5f5f5; color: #999; }

.product-card-actions {
    display: flex;
    border-top: 1px solid #f5f5f5;
}

.product-action-btn {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    border-right: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.product-action-btn:last-child { border-right: none; }
.product-action-btn:active { background: #f9f9f9; }
.product-action-btn.primary { color: #07c160; }
.product-action-btn.danger { color: #ff4d4f; }

/* ========== 付款端商品页 ========== */
.pay-product-page {
    background: #fff;
    min-height: 100vh;
    padding-bottom: 80px;
}

.pay-product-img {
    width: 110px;
    height: 100px;
    border-radius: 14px;
    object-fit: cover;
    background: #f0f0f0;
    display: block;
    margin: 12px auto 0;
}

.pay-product-img-placeholder {
    width: 110px;
    height: 100px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 40px;
    margin: 12px auto 0;
}

.pay-product-info { padding: 16px; background: #fff; }

.pay-product-name {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.4;
}

.pay-product-price-row {
    display: flex;
    align-items: baseline;
    margin-bottom: 12px;
}

.pay-product-price {
    font-size: 32px;
    font-weight: 700;
    color: #ff4d4f;
}

.pay-product-price .yuan {
    font-size: 18px;
    font-weight: 500;
    margin-right: 2px;
}

.pay-product-sales {
    font-size: 13px;
    color: #999;
    margin-left: 12px;
}

.pay-product-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.7;
    padding: 12px 0;
    border-top: 1px solid #f5f5f5;
}

.pay-product-desc-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.pay-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
    z-index: 100;
}

.pay-bottom-price { flex: 1; }
.pay-bottom-price .label { font-size: 11px; color: #999; }
.pay-bottom-price .value { font-size: 22px; font-weight: 700; color: #ff4d4f; }

.pay-bottom-btn {
    flex: 1.2;
    height: 46px;
    background: linear-gradient(135deg, #07c160, #06ad56);
    color: #fff;
    border: none;
    border-radius: 23px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
}

.pay-bottom-btn:active { opacity: 0.85; }
.pay-bottom-btn:disabled { background: #b5e3c5; cursor: not-allowed; }

.share-modal-mask {
    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;
}

.share-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 360px;
    padding: 20px;
}

.share-modal-title {
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
}

.share-link-box {
    background: #f5f6f8;
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    color: #333;
    word-break: break-all;
    margin-bottom: 16px;
    max-height: 120px;
    overflow-y: auto;
}

.share-modal-actions { display: flex; gap: 10px; }
.share-modal-actions .btn { flex: 1; height: 42px; font-size: 15px; }
