* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #F4F3EE; color: #1A1B1C; font-size: 14px; }
.header { background: #fff; border-bottom: 1px solid #E4E3DD; padding: 0 20px; height: 54px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.brand { font-size: 16px; font-weight: 600; }
.brand span { color: #3B82F6; }
.nav { display: flex; gap: 6px; }
.nav button { border: none; background: transparent; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; color: #4B5563; }
.nav button.active { background: #EFF6FF; color: #2563EB; font-weight: 600; }
.user-box { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #6B7280; }
.user-box button { border: 1px solid #D1D5DB; background: #fff; padding: 5px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.container { max-width: 720px; margin: 24px auto; padding: 0 16px; }
.card { background: #fff; border: 1px solid #E4E3DD; border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin-bottom: 14px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 13px; color: #6B7280; margin-bottom: 5px; }
.form-row input, .form-row select, .form-row textarea { width: 100%; padding: 9px 12px; border: 1px solid #D1D5DB; border-radius: 8px; font-size: 14px; background: #fff; }
.btn { display: inline-block; border: none; border-radius: 8px; padding: 9px 18px; font-size: 14px; cursor: pointer; background: #2563EB; color: #fff; }
.btn:hover { opacity: 0.9; }
.btn.secondary { background: #fff; color: #1A1B1C; border: 1px solid #D1D5DB; }
.btn.danger { background: #EF4444; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.err { color: #DC2626; font-size: 13px; margin-top: 8px; min-height: 18px; }
.ok { color: #16A34A; font-size: 13px; margin-top: 8px; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button { flex: 1; padding: 9px; border: 1px solid #D1D5DB; background: #fff; border-radius: 8px; cursor: pointer; font-size: 14px; }
.tabs button.active { background: #2563EB; color: #fff; border-color: #2563EB; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.b-AWAIT_SELLER { background: #FEF3C7; color: #92400E; }
.b-MARKET { background: #E0E7FF; color: #3730A3; }
.b-INVITE { background: #F3F4F6; color: #4B5563; }
.b-AWAIT_BUYER_PAYMENT { background: #DBEAFE; color: #1E40AF; }
.b-BUYER_PAID { background: #D1FAE5; color: #065F46; }
.b-DISPUTED { background: #FEE2E2; color: #991B1B; }
.b-SETTLED { background: #D1FAE5; color: #065F46; }
.b-CANCELLING { background: #FED7AA; color: #7C2D12; }
.b-CANCELLED { background: #E5E7EB; color: #374151; }
.order-item { border: 1px solid #E4E3DD; border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.order-item .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.order-item .meta { font-size: 13px; color: #6B7280; line-height: 1.7; }
.order-item .invite { background: #F9FAFB; border: 1px dashed #D1D5DB; border-radius: 8px; padding: 8px 10px; margin-top: 8px; font-size: 12px; word-break: break-all; color: #374151; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.invite-link { display: none; }
.hidden { display: none; }
.copy { cursor: pointer; color: #2563EB; white-space: nowrap; font-size: 12px; }
.pm-item { display: flex; justify-content: space-between; align-items: center; border: 1px solid #E4E3DD; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.pm-item .info { font-size: 13px; }
.pm-item .info b { display: block; }
.pm-item .ops { display: flex; gap: 6px; }
.empty { color: #9CA3AF; text-align: center; padding: 24px 0; font-size: 13px; }
.payline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tip { font-size: 12px; color: #6B7280; line-height: 1.6; }
@media (max-width: 480px) { .header { padding: 0 12px; } .nav button { padding: 6px 8px; font-size: 13px; } }

/* ===== 订单流程进度条 ===== */
.steps { display: flex; align-items: flex-start; margin: 12px 0 16px; }
.step { flex: 1; text-align: center; position: relative; font-size: 12px; color: #9CA3AF; min-width: 0; }
.step .dot { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #E5E7EB; color: #9CA3AF; font-size: 11px; font-weight: 600; margin-bottom: 5px; position: relative; z-index: 1; }
.step .label { display: block; line-height: 1.3; word-break: break-all; }
.step:not(:first-child)::before { content: ''; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: #E5E7EB; }
.step.done { color: #16A34A; }
.step.done .dot { background: #16A34A; color: #fff; }
.step.done::before { background: #16A34A; }
.step.active { color: #2563EB; font-weight: 600; }
.step.active .dot { background: #2563EB; color: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.step.active::before { background: #16A34A; }
.step.wait { color: #9CA3AF; }
.step.fail { color: #DC2626; }
.step.fail .dot { background: #DC2626; color: #fff; }
.step.fail::before { background: #DC2626; }

/* ===== 地址展示（大字+复制） ===== */
.addr { background: #F9FAFB; border: 1px solid #E4E3DD; border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.addr .addr-label { font-size: 12px; color: #6B7280; display: block; margin-bottom: 4px; }
.addr .addr-row { display: flex; align-items: center; gap: 8px; }
.addr .addr-value { font-family: Consolas, Menlo, monospace; font-size: 15px; font-weight: 600; color: #111827; word-break: break-all; flex: 1; min-width: 0; }
.copy-btn { flex-shrink: 0; border: 1px solid #D1D5DB; background: #fff; color: #2563EB; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.copy-btn:hover { background: #EFF6FF; }
.addr.warn .addr-value { color: #B45309; }
.addr.ok .addr-value { color: #16A34A; }

/* ===== 订单操作区 ===== */
.ops-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.btn.green { background: #16A34A; }
.btn.outline { background: #fff; color: #2563EB; border: 1px solid #2563EB; }
.proof-box { margin-top: 8px; }
.proof-box img { max-width: 220px; width: 100%; border-radius: 8px; border: 1px solid #E4E3DD; }
.proof-box .proof-text { background: #F9FAFB; border: 1px dashed #D1D5DB; border-radius: 8px; padding: 8px 10px; font-size: 13px; color: #374151; word-break: break-all; }
.meta b.hl { font-size: 16px; color: #111827; }
.meta b.price { font-size: 16px; color: #DC2626; }

/* ===== 卖单大厅 ===== */
.market-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.market-count { font-size: 13px; color: #6B7280; }
.market-count b { color: #2563EB; font-size: 18px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-bar select, .filter-bar input { width: auto; padding: 7px 10px; border: 1px solid #D1D5DB; border-radius: 8px; font-size: 13px; background: #fff; }
.filter-bar input { width: 90px; }
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.market-card { background: #fff; border: 1px solid #E4E3DD; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow 0.15s; }
.market-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.market-card .mc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.market-card .mc-seller { font-size: 13px; color: #374151; font-weight: 600; }
.market-card .mc-price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.market-card .mc-qty { font-size: 22px; font-weight: 700; color: #111827; }
.market-card .mc-qty span { font-size: 13px; font-weight: 400; color: #6B7280; }
.market-card .mc-total { font-size: 16px; font-weight: 700; color: #DC2626; }
.market-card .mc-meta { font-size: 12px; color: #6B7280; line-height: 1.7; }
.market-card .mc-addr { font-family: Consolas, Menlo, monospace; font-size: 12px; background: #F9FAFB; border: 1px solid #E4E3DD; border-radius: 6px; padding: 5px 8px; color: #374151; }
.market-card .mc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.market-card .mc-expire { font-size: 12px; color: #6B7280; }
.market-card .mc-expire.hot { color: #DC2626; font-weight: 600; }
.btn.buy { background: #16A34A; color: #fff; padding: 9px 20px; font-size: 14px; border-radius: 8px; text-decoration: none; text-align: center; }
.btn.buy:hover { opacity: 0.9; }

/* ===== 卖单大厅入口 ===== */
.market-link { background: linear-gradient(135deg, #2563EB, #3B82F6); color: #fff; padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; text-decoration: none; box-shadow: 0 2px 8px rgba(37,99,235,0.25); transition: transform 0.15s, box-shadow 0.15s; }
.market-link:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,0.35); }
.market-banner { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #1D4ED8, #3B82F6); border-radius: 14px; padding: 14px 16px; color: #fff; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.market-banner:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37,99,235,0.3); }
.mb-title { font-size: 15px; font-weight: 700; }
.mb-sub { font-size: 12px; color: rgba(255,255,255,0.85); margin-top: 3px; }
.mb-btn { flex-shrink: 0; background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.35); padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; }

/* ===== 移动端适配 ===== */
@media (max-width: 480px) {
  .market-grid { grid-template-columns: 1fr; }
  .addr .addr-value { font-size: 13px; }
  .market-card .mc-qty { font-size: 19px; }
}

/* ===== 统一弹窗组件（modal.js） ===== */
.modal-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.55); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: min(92vw, 400px); padding: 22px 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25); animation: modalIn 0.18s ease; }
@keyframes modalIn { from { transform: translateY(14px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 9px; }
.m-icon { width: 24px; height: 24px; border-radius: 50%; background: #EFF6FF; color: #2563EB; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.m-icon.danger { background: #FEE2E2; color: #DC2626; }
.m-icon.success { background: #D1FAE5; color: #16A34A; }
.m-icon.info { background: #E0E7FF; color: #3730A3; }
.modal-title { font-size: 16px; font-weight: 600; color: #111827; margin: 0; }
.modal-body { margin: 12px 0 4px; }
.m-line { font-size: 14px; color: #4B5563; line-height: 1.8; word-break: break-all; }
.m-line.gap { height: 10px; }
.m-line.hl { color: #111827; font-weight: 600; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-btn { border: none; border-radius: 10px; padding: 9px 20px; font-size: 14px; cursor: pointer; font-weight: 500; transition: opacity 0.15s, transform 0.1s; }
.modal-btn:hover { opacity: 0.9; }
.modal-btn:active { transform: scale(0.98); }
.modal-btn.cancel { background: #F3F4F6; color: #374151; }
.modal-btn.ok { background: #2563EB; color: #fff; }
.modal-btn.ok.danger { background: #DC2626; }
.modal-btn.ok.success { background: #16A34A; }
/* 表单弹窗 */
.m-field { margin-bottom: 14px; }
.m-field-label { font-size: 13px; color: #374151; font-weight: 600; margin-bottom: 6px; }
.m-input { width: 100%; box-sizing: border-box; border: 1px solid #D1D5DB; border-radius: 10px; padding: 9px 12px; font-size: 14px; background: #fff; color: #111827; outline: none; }
.m-input:focus { border-color: #2563EB; box-shadow: 0 0 0 2px rgba(37,99,235,0.12); }
textarea.m-input { min-height: 76px; resize: vertical; }
.m-fileline { display: flex; gap: 8px; align-items: center; }
.m-field-tip { font-size: 12px; color: #9CA3AF; margin-top: 6px; }
.req { font-size: 12px; color: #DC2626; font-weight: 500; margin-left: 6px; }

/* 轻提示 toast */
.toast { position: fixed; top: 74px; left: 50%; transform: translateX(-50%) translateY(-10px); background: rgba(17, 24, 39, 0.92); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; z-index: 1100; opacity: 0; pointer-events: none; transition: all 0.25s; max-width: 86vw; line-height: 1.5; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: rgba(22, 163, 74, 0.95); }
.toast.error { background: rgba(220, 38, 38, 0.95); }

/* ===== 发起订单界面美化 ===== */
.section-icon { width: 30px; height: 30px; border-radius: 9px; background: #EFF6FF; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } }
.btn-lg { padding: 13px 20px; font-size: 15px; font-weight: 600; background: linear-gradient(135deg, #2563EB, #3B82F6); box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28); border-radius: 10px; }
.btn-lg:hover { opacity: 0.95; box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35); }
.btn.outline { background: #fff; color: #2563EB; border: 1px solid #2563EB; }

/* 开关（上架卖单大厅） */
.switch-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; user-select: none; }
.switch-row input { display: none; }
.switch { flex-shrink: 0; width: 40px; height: 22px; border-radius: 11px; background: #D1D5DB; position: relative; transition: background 0.2s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 0.2s; }
.switch-row input:checked + .switch { background: #2563EB; }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-text { font-size: 13px; line-height: 1.4; }
.switch-text b { display: block; color: #111827; font-size: 14px; }
.switch-sub { display: block; font-size: 12px; color: #6B7280; margin-top: 2px; }

/* 收款码缩略图（点击展开，不跳链接不下载） */
.qr-line { margin-top: 4px; }
.qr-thumb { display: block; max-width: 180px; width: 100%; border-radius: 8px; border: 1px solid #E4E3DD; margin-top: 6px; }
