/* 现场安排 / 项目申请表 / 团队名册 */
.sb-wrap { padding: 4px 0 40px; }
.sb-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.sb-toolbar .sb-spacer { flex: 1; }
.sb-btn { border: 1px solid #cbd5e1; background: #fff; color: #334155; padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.sb-btn:hover { background: #f1f5f9; }
.sb-btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.sb-btn.primary:hover { background: #1d4ed8; }
.sb-btn.warn { background: #fff7ed; border-color: #fdba74; color: #9a3412; }
.sb-btn.small { padding: 4px 9px; font-size: 13px; }
.sb-btn[disabled] { opacity: .5; cursor: not-allowed; }
.sb-badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 9px; background: #dc2626; color: #fff; font-size: 12px; text-align: center; }
.sb-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.sb-stat { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; }
.sb-stat b { display: block; font-size: 22px; color: #0f172a; }
.sb-stat span { font-size: 12px; color: #64748b; }
.sb-note { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.sb-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 8px; }
.sb-section { margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.sb-section h3 { margin: 0; font-size: 16px; color: #0f172a; }
.sb-section .sb-count { color: #64748b; font-size: 13px; }
.sb-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.sb-card.sug { border-left: 4px solid #16a34a; }
.sb-card.ready { border-left: 4px solid #2563eb; }
.sb-card.prog { border-left: 4px solid #f59e0b; }
.sb-card.blocked { border-left: 4px solid #94a3b8; background: #f8fafc; }
.sb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sb-title { font-weight: 600; color: #0f172a; }
.sb-sub { color: #64748b; font-size: 13px; margin-top: 3px; }
.sb-reason { color: #475569; font-size: 13px; margin-top: 4px; }
.sb-chip { display: inline-block; background: #f1f5f9; border-radius: 12px; padding: 2px 9px; font-size: 12px; color: #334155; margin: 2px 3px 2px 0; }
.sb-chip.skilled { background: #dbeafe; color: #1e40af; }
.sb-chip.free { background: #dcfce7; color: #166534; }
.sb-chip.off { background: #fee2e2; color: #991b1b; }
.sb-tag { font-size: 12px; padding: 1px 7px; border-radius: 6px; background: #fef3c7; color: #92400e; }
.sb-bar { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; width: 140px; }
.sb-bar i { display: block; height: 100%; background: #f59e0b; }
.sb-empty { text-align: center; padding: 36px 12px; color: #64748b; background: #fff; border: 1px dashed #cbd5e1; border-radius: 10px; }

/* 弹层（独立于系统原有的模态框，打开时不会把别的弹窗顶掉） */
.sb-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 5000; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 4vh 12px; }
.sb-dialog { background: #fff; border-radius: 12px; width: 100%; max-width: 760px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.sb-dialog.narrow { max-width: 520px; }
.sb-dialog header { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid #e2e8f0; }
.sb-dialog header h3 { margin: 0; font-size: 17px; flex: 1; }
.sb-dialog header button { border: 0; background: transparent; font-size: 24px; cursor: pointer; color: #64748b; }
.sb-dialog .sb-body { padding: 16px 18px; }
.sb-dialog footer { padding: 12px 18px; border-top: 1px solid #e2e8f0; display: flex; justify-content: flex-end; gap: 8px; }
.sb-form-sec { margin: 0 0 16px; }
.sb-form-sec h4 { margin: 0 0 8px; font-size: 15px; color: #1e293b; border-bottom: 1px solid #e2e8f0; padding-bottom: 4px; }
.sb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 14px; }
.sb-field label { display: block; font-size: 13px; color: #475569; margin-bottom: 3px; }
.sb-field input[type=number], .sb-field input[type=text], .sb-field select, .sb-field textarea { width: 100%; padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 7px; font-size: 14px; box-sizing: border-box; }
.sb-field.check label { display: flex; align-items: center; gap: 7px; font-size: 14px; color: #1e293b; margin: 0; }
.sb-field .hint { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.sb-member-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f1f5f9; }
.sb-member-row .sb-grow { flex: 1; }
.sb-skill-box { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.sb-skill-box label { font-size: 13px; display: flex; align-items: center; gap: 4px; }
.sb-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: #475569; }
.sb-sev-high { color: #b91c1c; font-weight: 600; }
.sb-sev-medium { color: #b45309; font-weight: 600; }
.sb-sev-low { color: #15803d; font-weight: 600; }
.sb-noti { padding: 9px 0; border-bottom: 1px solid #f1f5f9; }
.sb-noti.unread { background: #fff7ed; margin: 0 -8px; padding: 9px 8px; }
.sb-noti pre { white-space: pre-wrap; font-family: inherit; margin: 4px 0 0; font-size: 13px; color: #334155; }

/* ===== 修复：项目页被标签栏撑宽，右侧内容被裁掉 =====
   外层是 flex 容器，子元素默认 min-width:auto，会被横向很长的标签栏撑开；这里让它们可以收缩，标签栏自己横向滚动。 */
.main-container > .view, #project-detail-view, #project-detail-container { min-width: 0; max-width: 100%; }
#project-detail-container .project-nav { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
#project-detail-container .project-nav .nav-item { flex-shrink: 0; }
#project-subview-container { min-width: 0; max-width: 100%; box-sizing: border-box; }

/* ===== 今日现场安排 ===== */
.td-wrap { max-width: 980px; margin: 0 auto; padding-bottom: 60px; }
.td-th { color: #94a3b8; font-weight: 400; font-size: .72em; margin-left: 6px; }
.td-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.td-title { margin: 0; font-size: 22px; color: #0f172a; }
.td-date { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.td-date input[type=date] { padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; background: #fff; }
.td-sub { color: #64748b; font-size: 13px; }
.td-menu { position: relative; }
.td-menu > summary { list-style: none; cursor: pointer; }
.td-menu > summary::-webkit-details-marker { display: none; }
.td-menu.inline { display: inline-block; }
.td-pop { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); z-index: 50; min-width: 230px; padding: 4px; }
.td-pop a { display: block; padding: 10px 12px; color: #1e293b; text-decoration: none; border-radius: 7px; font-size: 14px; }
.td-pop a:hover { background: #f1f5f9; }
.td-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.td-stat { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; text-align: center; }
.td-stat b { display: block; font-size: 26px; color: #0f172a; line-height: 1.1; }
.td-stat span { font-size: 12px; color: #64748b; }
.td-stat.hot { border-color: #2563eb; background: #eff6ff; }
.td-stat.hot b { color: #1d4ed8; }
.td-tip { color: #64748b; font-size: 13px; margin-bottom: 8px; }
.td-warn { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; padding: 9px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 8px; }
.td-banner { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.td-sec { margin: 22px 0 0; }
.td-sec > h3, .td-sum { margin: 0 0 10px; font-size: 17px; color: #0f172a; display: flex; align-items: center; gap: 8px; cursor: default; }
.td-sum { cursor: pointer; font-weight: 600; }
.td-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: #2563eb; color: #fff; font-size: 13px; flex-shrink: 0; }
.td-count { color: #64748b; font-size: 13px; font-weight: 400; }
.td-empty { text-align: center; padding: 22px 12px; color: #64748b; background: #fff; border: 1px dashed #cbd5e1; border-radius: 12px; font-size: 14px; line-height: 1.7; }
.td-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.td-card.doing { border-left: 5px solid #f59e0b; }
.td-card.paused { border-left-color: #94a3b8; background: #f8fafc; }
.td-card.ready { border-left: 5px solid #2563eb; }
.td-top { display: flex; align-items: flex-start; gap: 10px; }
.td-grow { flex: 1; min-width: 0; }
.td-name { font-size: 16px; color: #0f172a; }
.td-pct { font-size: 20px; font-weight: 700; color: #b45309; }
.td-bar { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin: 8px 0; }
.td-bar i { display: block; height: 100%; background: #f59e0b; border-radius: 4px; }
.td-people { margin: 6px 0; min-height: 26px; }
.td-suggest { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 8px 10px; margin: 8px 0 4px; font-size: 14px; color: #166534; }
.td-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.td-actions .sb-btn { min-height: 40px; padding: 8px 14px; }
.td-chip { display: inline-block; background: #f1f5f9; border-radius: 14px; padding: 3px 11px; font-size: 13px; color: #334155; margin: 2px 4px 2px 0; text-decoration: none; }
.td-chip a { color: #991b1b; text-decoration: none; margin-left: 2px; }
.td-chip.skilled { background: #dbeafe; color: #1e40af; }
.td-chip.free { background: #dcfce7; color: #166534; }
.td-chip.off { background: #fee2e2; color: #991b1b; text-decoration: line-through; }
.td-chip.big { padding: 9px 16px; font-size: 15px; border-radius: 22px; margin: 4px 6px 4px 0; cursor: pointer; border: 1px solid transparent; }
.td-chip.big:hover { border-color: #94a3b8; }
.td-tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 6px; background: #f1f5f9; color: #475569; margin-left: 4px; }
.td-tag.warn { background: #fef3c7; color: #92400e; }
.td-tag.gray { background: #e2e8f0; color: #475569; }
.td-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 6px; }
.td-row.wait { border-left: 4px solid #cbd5e1; }
.td-link { color: #b45309; font-size: 13px; text-decoration: none; white-space: nowrap; }
.td-link:hover { text-decoration: underline; }
.td-grp { margin: 6px 0; }
.td-grp > summary { cursor: pointer; padding: 8px 4px; font-weight: 600; color: #334155; }
.td-pickrow { display: flex; align-items: center; gap: 8px; padding: 10px 4px; border-bottom: 1px solid #f1f5f9; flex-wrap: wrap; }

/* 手机和窄屏 */
@media (max-width: 720px) {
  .td-summary { grid-template-columns: repeat(2, 1fr); }
  .td-title { font-size: 19px; }
  .td-actions .sb-btn { flex: 1 1 auto; justify-content: center; }
  .td-pop { right: auto; left: 0; }
  .td-row { flex-wrap: wrap; }
}

/* 手机：标题行不换行，「更多」按钮保持一行；折叠标题的泰文换到下一行 */
.td-head .td-menu > summary { white-space: nowrap; }
.td-sum { flex-wrap: wrap; }
@media (max-width: 720px) {
  .td-sum .td-th { flex-basis: 100%; margin-left: 32px; }
}

/* 可折叠区块：加上展开箭头，计数不再折行 */
.td-sum { display: block; list-style: none; cursor: pointer; font-size: 17px; font-weight: 600; color: #0f172a; padding: 6px 0; }
.td-sum::-webkit-details-marker { display: none; }
.td-sum::before { content: '▸'; color: #2563eb; margin-right: 8px; display: inline-block; width: 12px; }
details[open] > .td-sum::before { content: '▾'; }
.td-sum .td-count { margin-left: 6px; }
.td-sum .td-th { margin-left: 6px; }
@media (max-width: 720px) { .td-sum .td-th { flex-basis: auto; margin-left: 6px; } }

.sb-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.sb-table th, .sb-table td { border-bottom: 1px solid #e2e8f0; padding: 6px 8px; text-align: left; vertical-align: top; }
.sb-table th { background: #f8fafc; color: #475569; font-weight: 600; }

/* ---------- 项目准备 ---------- */
.pp-wrap { max-width: 860px; margin: 0 auto; padding: 4px 4px 24px; }
.pp-banner { border-radius: 10px; padding: 12px 14px; margin: 10px 0 14px; font-size: 14px; line-height: 1.6; }
.pp-banner.ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.pp-banner.todo { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }
.pp-step { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid #e2e8f0; border-left: 4px solid #cbd5e1; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.pp-step.done { border-left-color: #10b981; }
.pp-step.todo { border-left-color: #f59e0b; }
.pp-num { flex: 0 0 30px; height: 30px; border-radius: 50%; background: #e2e8f0; color: #334155; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.pp-step.done .pp-num { background: #10b981; color: #fff; }
.pp-step.todo .pp-num { background: #f59e0b; color: #fff; }
.pp-main { flex: 1; min-width: 0; }
.pp-title { font-weight: 600; font-size: 15px; color: #0f172a; }
.pp-title small { color: #64748b; font-weight: 400; margin-left: 4px; }
.pp-why { color: #475569; font-size: 13px; margin-top: 4px; }
.pp-detail { color: #0f172a; font-size: 13px; margin-top: 6px; background: #f8fafc; border-radius: 6px; padding: 4px 8px; display: inline-block; }
.pp-chip { font-size: 12px; border-radius: 999px; padding: 1px 8px; margin-left: 6px; font-weight: 500; }
.pp-chip.ok { background: #d1fae5; color: #065f46; }
.pp-chip.todo { background: #fef3c7; color: #92400e; }
.pp-chip.later { background: #e2e8f0; color: #475569; }
.pp-act { flex: 0 0 auto; text-align: right; }
.pp-hint { font-size: 12px; color: #94a3b8; margin-top: 4px; max-width: 150px; }
.pp-step .sb-btn[disabled] { opacity: .45; cursor: not-allowed; }
@media (max-width: 560px) { .pp-step { flex-wrap: wrap; } .pp-act { flex: 1 1 100%; text-align: left; } }

/* 项目页签：5 个页签在窄屏也要放得下 */
.project-nav .nav-item { padding-left: 10px; padding-right: 10px; flex: 1 1 auto; }
.project-nav .nav-label { font-size: 12.5px; white-space: normal; line-height: 1.25; text-align: left; }
.project-nav .nav-icon { font-size: 18px; }

.sb-skill-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 0; border-bottom:1px solid #eef2f7; }
.sb-skill-name { flex:1; min-width:0; font-size:14px; }
.sb-skill-num { white-space:nowrap; font-size:14px; color:#475569; }
.sb-skill-num input { width:64px; padding:6px 8px; border:1.5px solid #cbd5e1; border-radius:8px; text-align:center; font-size:15px; font-weight:600; }
.sb-skill-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
@media (max-width: 640px) { .sb-skill-grid { grid-template-columns: 1fr; } }
.sb-skill-num input { width:54px !important; padding:5px 6px; }
.sb-skill-num { padding-right:4px; }
