/* 招标:详情 / 投标 / 收到的投标 / 我的需求 / 我投的标(js/tender-bid.js)2026-09-19
   视觉要求:字大、偏粗、不密;按钮 ≥48px;手机无横向滚动 */
:root {
    --tb-orange: #FF6E30;
    --tb-orange-dark: #E85A1E;
    --tb-text: #1F1F1F;
    --tb-muted: #6B6B6B;
    --tb-line: #ECECEC;
    --tb-green: #1E9E4A;
}
html.tb-lock, html.tb-lock body { overflow: hidden !important; }

/* ---------- 弹层 ---------- */
/* 不做淡入:后台标签页里 requestAnimationFrame 不跑,靠 .show 显形的话弹层会一直是透明的 */
.tb-layer { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
.tb-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.tb-panel { position: relative; background: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .22); width: 100%; max-width: 720px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; color: var(--tb-text); font-size: 17px; line-height: 1.6; }
.tb-size-sm .tb-panel { max-width: 540px; }
.tb-size-lg .tb-panel { max-width: 960px; }
.tb-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--tb-line); flex-shrink: 0; }
.tb-title { flex: 1; min-width: 0; margin: 0; font-size: 21px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.tb-x { flex-shrink: 0; width: 48px; height: 48px; border: 0; background: #F4F4F4; border-radius: 50%; font-size: 28px; line-height: 1; cursor: pointer; color: #333; }
.tb-x:hover { background: #E8E8E8; }
.tb-body { padding: 18px 22px; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; flex: 1; min-height: 0; }
.tb-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--tb-line); flex-shrink: 0; }
.tb-foot:empty { display: none; }

/* ---------- 按钮 ---------- */
.tb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 20px; border-radius: 12px; font-size: 17px; font-weight: 700; line-height: 1.2; cursor: pointer; text-decoration: none; border: 2px solid transparent; box-sizing: border-box; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.tb-btn-primary { background: var(--tb-orange); color: #fff !important; border-color: var(--tb-orange); }
.tb-btn-primary:hover { background: var(--tb-orange-dark); border-color: var(--tb-orange-dark); }
.tb-btn-ghost { background: #fff; color: var(--tb-text) !important; border-color: #D9D9D9; }
.tb-btn-ghost:hover { border-color: var(--tb-orange); color: var(--tb-orange) !important; }
.tb-btn-danger { background: #fff; color: #D93025 !important; border-color: #F2C4C0; }
.tb-btn-danger:hover { background: #FFF4F3; }
.tb-btn-disabled, .tb-btn:disabled { background: #D6D6D6 !important; border-color: #D6D6D6 !important; color: #fff !important; cursor: not-allowed; }
.tb-btn-block { display: flex; width: 100%; margin-top: 14px; }
.tb-btn-inline { min-height: 44px; }
.tb-textbtn { background: none; border: 0; padding: 6px 0; min-height: 40px; color: var(--tb-orange); font-size: 16px; font-weight: 700; cursor: pointer; }

/* ---------- 通用小件 ---------- */
.tb-muted { color: var(--tb-muted); }
.tb-small { font-size: 15px; line-height: 1.55; }
.tb-loading, .tb-empty { padding: 36px 12px; text-align: center; color: var(--tb-muted); font-size: 18px; font-weight: 600; }
.tb-link { color: var(--tb-orange); font-weight: 800; text-decoration: none; word-break: break-all; }
.tb-link:hover { text-decoration: underline; }
.tb-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 8px; font-size: 14px; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.tb-badge-orange { background: var(--tb-orange); color: #fff; }
.tb-badge-orange-soft { background: #FFF0E8; color: #C24A12; }
.tb-badge-grey { background: #EFEFEF; color: #7A7A7A; }
.tb-badge-green { background: var(--tb-green); color: #fff; }
.tb-badge-green-soft { background: #E6F6EC; color: #16783A; }
.tb-badge-blue { background: #E8F0FE; color: #1A56C4; }
.tb-badge-warn { background: #FFF3D6; color: #8A5A00; }
.tb-badge-soft { background: #F4F4F4; color: #444; }
.tb-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tb-tags:empty { display: none; }
.tb-info { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; color: var(--tb-muted); font-size: 15px; font-weight: 600; }
.tb-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ---------- 详情 ---------- */
.tb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 8px; color: var(--tb-muted); font-size: 16px; font-weight: 600; }
.tb-meta b { color: var(--tb-orange); font-size: 18px; }
.tb-rows { border-top: 1px solid var(--tb-line); }
.tb-row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 4px 16px; padding: 14px 0; border-bottom: 1px solid var(--tb-line); align-items: start; }
.tb-label { color: var(--tb-muted); font-weight: 700; font-size: 16px; }
.tb-value { font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.tb-content { white-space: pre-wrap; font-weight: 500; }
.tb-locked { color: #8A8A8A; font-weight: 800; }
.tb-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.tb-imgs img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; cursor: zoom-in; background: #F4F4F4; }
.tb-masked { background: #FFF8F3; border: 2px dashed #FFC8AE; border-radius: 12px; padding: 14px 16px; font-weight: 500; }
.tb-masked-title { font-size: 18px; font-weight: 800; color: #C24A12; margin-bottom: 6px; }
.tb-masked p { margin: 4px 0; }
.tb-gaps { margin: 6px 0 10px; padding-left: 22px; font-weight: 800; }
.tb-gaps li { margin: 2px 0; }
.tb-masked-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tb-masked-actions .tb-muted { flex-basis: 100%; margin: 4px 0 0; font-size: 15px; }
.tb-dialog-text { margin: 4px 0 10px; font-size: 18px; font-weight: 700; white-space: pre-wrap; overflow-wrap: anywhere; }
.tb-viewer .tb-body { display: flex; align-items: center; justify-content: center; background: #111; }
.tb-viewer-img { max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: 8px; }

/* ---------- 投标表单 ---------- */
.tb-ai { padding: 10px 14px; border-radius: 10px; font-size: 15px; font-weight: 700; margin-bottom: 12px; background: #F4F4F4; color: #555; }
.tb-ai[data-state="loading"] { background: #FFF6EF; color: #C24A12; }
.tb-ai[data-state="ready"] { background: #E6F6EC; color: #16783A; }
.tb-bidfor { font-size: 18px; font-weight: 800; margin-bottom: 10px; overflow-wrap: anywhere; }
.tb-kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--tb-line); font-size: 16px; }
.tb-kv span { color: var(--tb-muted); font-weight: 700; }
.tb-kv b { text-align: right; overflow-wrap: anywhere; min-width: 0; }
.tb-field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-weight: 700; font-size: 16px; min-width: 0; }
.tb-field input, .tb-field textarea { width: 100%; box-sizing: border-box; min-height: 52px; padding: 12px 14px; border: 2px solid #DADADA; border-radius: 12px; font-size: 18px; font-weight: 600; font-family: inherit; color: var(--tb-text); background: #fff; }
.tb-field textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
.tb-field input:focus, .tb-field textarea:focus { outline: none; border-color: var(--tb-orange); box-shadow: 0 0 0 3px rgba(255, 110, 48, .15); }
.tb-field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.tb-form-err { min-height: 24px; margin-top: 10px; color: #D93025; font-weight: 800; font-size: 16px; }

/* ---------- 投标卡(业主看) ---------- */
.tb-bid { border: 2px solid var(--tb-line); border-radius: 14px; padding: 14px 16px; margin-top: 12px; }
.tb-bid.is-won { border-color: var(--tb-green); background: #F6FCF8; }
.tb-bid.is-dismissed { opacity: .6; background: #FAFAFA; }
.tb-bid-top { display: flex; gap: 12px; align-items: flex-start; }
.tb-avatar { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: #F4F4F4; }
.tb-bid-who { min-width: 0; flex: 1; }
.tb-bid-name { font-size: 19px; font-weight: 800; overflow-wrap: anywhere; }
.tb-bid-quote { margin-top: 10px; font-size: 17px; font-weight: 700; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.tb-bid-quote b { color: var(--tb-orange); font-size: 20px; }
.tb-bid-dur { color: #444; }
.tb-bid-msg { margin-top: 8px; font-size: 16px; font-weight: 500; color: #333; white-space: pre-wrap; overflow-wrap: anywhere; }
.tb-bid-msg.is-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 我的需求 / 我投的标 卡片 ---------- */
.tb-cards { display: flex; flex-direction: column; gap: 14px; }
.tb-mycard { border: 2px solid var(--tb-line); border-radius: 14px; padding: 16px; background: #fff; }
.tb-mycard.is-expired { background: #FAFAFA; }
.tb-mycard.is-expired .tb-mycard-title { color: #888; }
.tb-mycard.is-won { border-color: var(--tb-green); }
.tb-mycard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tb-mycard-title { font-size: 19px; font-weight: 800; overflow-wrap: anywhere; min-width: 0; }
.tb-mycard-text { margin-top: 8px; font-size: 16px; color: #444; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tb-wonbox { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #E6F6EC; color: #16783A; font-weight: 800; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }

/* ---------- 大厅卡片补充 ---------- */
.tb-card { cursor: pointer; }
.tb-card.is-expired { opacity: .6; background: #FAFAFA; }
.tb-card .tender-card-title { font-size: 18px; font-weight: 800; overflow-wrap: anywhere; }
.tb-card .tb-title-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; margin-left: 6px; }
.tb-card .tender-card-type { font-weight: 800; color: var(--tb-orange); white-space: nowrap; }
.tb-card.is-expired .tender-card-type { color: #999; }
.tb-card .btn-view { min-height: 48px; min-width: 88px; font-size: 16px; font-weight: 700; }
.tb-hall-empty { padding: 48px 12px; text-align: center; font-size: 18px; font-weight: 700; color: var(--tb-muted); }

/* ---------- Toast ---------- */
.tb-toast { position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px); max-width: min(560px, calc(100vw - 32px)); padding: 14px 22px; border-radius: 14px; background: rgba(30, 30, 30, .94); color: #fff; font-size: 17px; font-weight: 700; line-height: 1.5; z-index: 20000; opacity: 0; transition: opacity .2s, transform .2s; text-align: center; box-sizing: border-box; overflow-wrap: anywhere; }
.tb-toast.show { opacity: 1; transform: translate(-50%, 0); }
.tb-toast-ok { background: rgba(22, 120, 58, .96); }
.tb-toast-err { background: rgba(200, 40, 30, .96); }
.tb-toast-warn { background: rgba(200, 90, 20, .96); }

/* ---------- 手机 ---------- */
@media (max-width: 640px) {
    .tb-layer { padding: 0; align-items: flex-end; }
    .tb-panel { max-width: 100% !important; max-height: 94vh; border-radius: 18px 18px 0 0; }
    .tb-body { padding: 14px 16px; }
    .tb-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
    .tb-foot .tb-btn { flex: 1 1 calc(50% - 5px); }
    .tb-head { padding: 10px 10px 10px 16px; }
    .tb-title { font-size: 19px; }
    .tb-row { grid-template-columns: 1fr; gap: 4px; padding: 12px 0; }
    .tb-field-2 { grid-template-columns: 1fr; }
    .tb-actions .tb-btn { flex: 1 1 calc(50% - 5px); padding: 0 10px; }
    .tb-btn { white-space: normal; text-align: center; }
    .tb-viewer-img { max-height: 60vh; }
}
