/* ===== 护肤组工作台 - 全局样式（浅色主题） ===== */
:root {
  --primary: #2563eb;        /* 主蓝 */
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --green: #16a34a;   /* 完成/提前 */
  --amber: #d97706;   /* 风险/警告 */
  --red: #dc2626;     /* 延期 */
  --purple: #7c3aed;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

/* ===== 登录页 ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 60%, #06b6d4 100%); }
.login-card { width: 380px; background: #fff; border-radius: 14px; padding: 36px 34px; box-shadow: 0 20px 50px rgba(2, 32, 71, .3); }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .sub { color: var(--text-2); font-size: 13px; margin-bottom: 26px; }
.login-card label { display: block; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; }
.login-card input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.login-card .btn { margin-top: 24px; }
.login-tip { margin-top: 16px; font-size: 12px; color: var(--text-3); line-height: 1.7; }

/* ===== 通用组件 ===== */
.btn { display: inline-block; padding: 9px 18px; border: none; border-radius: 8px; cursor: pointer;
  font-size: 14px; background: var(--primary); color: #fff; text-decoration: none; transition: all .15s; }
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-green { background: var(--green); }
.btn-amber { background: var(--amber); }

.topbar { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1920px; margin: 0 auto; padding: 0 24px; height: 58px; display: flex; align-items: center; gap: 24px; }
.brand { font-size: 16px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.brand small { font-size: 11px; color: var(--text-3); font-weight: 400; margin-left: 4px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { padding: 7px 14px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 14px; white-space: nowrap; }
.nav a:hover { background: var(--primary-light); color: var(--primary); }
.nav a.active { background: var(--primary); color: #fff; }
.topbar-right { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.role-badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--primary-light); color: var(--primary); }
.role-badge.leader { background: #fef3c7; color: #92400e; }

.container { max-width: 1920px; margin: 0 auto; padding: 22px 24px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.page-head h2 { font-size: 20px; }
.page-head .desc { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 14px; color: var(--text); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card-title .more { margin-left: auto; font-size: 12px; color: var(--text-3); font-weight: 400; }
/* 节奏总表四种表头色：内/外=淡蓝、已确版=绿、已暂停=橙 */
.card-title.dash-th-blue  { background: #eaf4ff; border-left: 4px solid #3b82f6; padding: 8px 10px; border-radius: 4px; }
.card-title.dash-th-green { background: #ecfdf5; border-left: 4px solid #10b981; padding: 8px 10px; border-radius: 4px; }
.card-title.dash-th-orange{ background: #fff7ed; border-left: 4px solid #f97316; padding: 8px 10px; border-radius: 4px; }
/* 节奏总表表头行与卡片标题同色（内/外=淡蓝，确版=绿，暂停=橙） */
.tbl thead.dash-thead-blue th   { background: #eaf4ff; color: #1e40af; }
.tbl thead.dash-thead-green th  { background: #ecfdf5; color: #047857; }
.tbl thead.dash-thead-orange th { background: #fff7ed; color: #c2410c; }
/* 轮次由组长在项目管理页更新过的行 → 标黄提醒（7 天内） */
.tbl tr.rhythm-flag-row td { background: #fef9c3 !important; }
.rhythm-flag-mark { cursor: help; }
/* 节奏总表「选中删除」模式：行首勾选列 */
.rhythm-sel-th { width: 34px; text-align: center; }
.rhythm-sel-td { text-align: center; }
.rhythm-sel-td input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.rhythm-sel-td input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .4; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.stat-card .num { font-size: 28px; font-weight: 700; }
.stat-card .num small { font-size: 14px; color: var(--text-2); font-weight: 400; }
.stat-card .lbl { color: var(--text-2); font-size: 13px; }
.stat-card .lbl b { color: var(--text); }
.stat-card.green .num { color: var(--green); }
.stat-card.amber .num { color: var(--amber); }
.stat-card.red .num { color: var(--red); }
.stat-card.blue .num { color: var(--primary); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { background: #f8fafc; color: var(--text-2); font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tr:hover td { background: #f8fafc; }
.tbl .warp-cell { white-space: normal; min-width: 200px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; white-space: nowrap; }
.badge.gray { background: #f1f5f9; color: var(--text-2); }
.badge.blue { background: var(--primary-light); color: var(--primary); }
.badge.green { background: #dcfce7; color: #166534; }
.badge.amber { background: #fef3c7; color: #92400e; }
.badge.red { background: #fee2e2; color: #991b1b; }
.badge.purple { background: #f3e8ff; color: #6b21a8; }

/* 进度条 */
.pbar { height: 8px; background: #e2e8f0; border-radius: 6px; overflow: hidden; min-width: 90px; }
.pbar > i { display: block; height: 100%; border-radius: 6px; background: var(--primary); transition: width .3s; }
.pbar > i.green { background: var(--green); }
.pbar > i.amber { background: var(--amber); }
.pbar > i.red { background: var(--red); }
.pnum { font-size: 12px; color: var(--text-2); margin-top: 3px; }

/* 模块 / O / KR */
.module-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; box-shadow: var(--shadow); }
.module-head { background: linear-gradient(90deg, var(--primary) 0%, #3b82f6 100%); color: #fff; padding: 14px 18px; display: flex; align-items: center; gap: 12px; }
.module-head h3 { font-size: 15px; flex: 1; }
.module-head .mod-progress { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.module-head .mod-progress .pbar { width: 120px; background: rgba(255,255,255,.3); }
.module-head .mod-progress .pbar > i { background: #fff; }
.module-head .btn-newkr { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.45); white-space: nowrap; }
.module-head .btn-newkr:hover { background: rgba(255,255,255,.32); }
.obj-box { padding: 14px 18px 4px; }
.obj-title { font-size: 14px; font-weight: 600; color: var(--primary-dark); padding-left: 10px; border-left: 3px solid var(--primary); margin-bottom: 8px; }
.kr-row { display: flex; gap: 14px; padding: 12px 18px 12px 22px; border-bottom: 1px dashed #f1f5f9; align-items: center; flex-wrap: wrap; }
.kr-row:last-child { border-bottom: none; }
.kr-main { flex: 1; min-width: 280px; }
.kr-title { font-size: 13.5px; line-height: 1.55; }
.kr-meta { font-size: 12px; color: var(--text-2); margin-top: 5px; display: flex; gap: 14px; flex-wrap: wrap; }
.kr-meta b { color: var(--text); font-weight: 600; }
.kr-right { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; min-width: 170px; }
.kr-btns { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.kr-actions { display: flex; gap: 6px; margin-top: 2px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 12px; width: 520px; max-width: 94vw; max-height: 86vh; overflow: auto; padding: 22px 24px; }
.modal h3 { font-size: 16px; margin-bottom: 14px; }
.modal label { display: block; font-size: 13px; color: var(--text-2); margin: 12px 0 6px; }
.modal input, .modal select, .modal textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; font-family: inherit; }
.modal textarea { min-height: 80px; resize: vertical; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.score-options { display: flex; gap: 8px; }
.score-options button { flex: 1; padding: 10px 0; border: 2px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; font-size: 15px; font-weight: 700; color: var(--text-2); transition: all .12s; }
.score-options button.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.score-options button.g1 { color: var(--green); } .score-options button.g1.active { border-color: var(--green); background: #dcfce7; color: #166534; }
.score-options button.g3 { color: var(--amber); } .score-options button.g3.active { border-color: var(--amber); background: #fef3c7; color: #92400e; }
.score-options button.g7 { color: var(--blue, var(--primary)); }
.score-options button.g10 { color: var(--purple); } .score-options button.g10.active { border-color: var(--purple); background: #f3e8ff; color: #6b21a8; }

/* Toast */
#toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast-item { background: #1e293b; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.2); animation: fadeIn .2s; }
.toast-item.err { background: var(--red); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-8px);} to { opacity: 1; transform: translateY(0);} }

/* 标签页 */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { padding: 9px 16px; border: none; background: none; cursor: pointer; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 空状态/加载 */
.loading, .empty { text-align: center; color: var(--text-3); padding: 48px 0; font-size: 14px; }
.spin { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: rot .8s linear infinite; vertical-align: -3px; margin-right: 8px; }
@keyframes rot { to { transform: rotate(360deg); } }

/* 周报风格工作记录 */
.rec-item { padding: 10px 0; border-bottom: 1px dashed #f1f5f9; font-size: 13px; line-height: 1.6; }
.rec-item:last-child { border-bottom: none; }
.rec-item .rec-proj { font-weight: 600; color: var(--primary-dark); margin-right: 8px; }

/* 表单行 */
.form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.form-row > div { flex: 1; }
/* 宽弹窗（项目节奏总表完整填写） */
.modal-wide { width: min(1180px, 95vw); }
.rounds-grid { display: flex; flex-wrap: wrap; gap: 4px 18px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-top: 6px; background: #fafbfc; }
.round-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; width: calc(50% - 9px); min-width: 380px; }
.round-row .r-tag { width: 34px; flex-shrink: 0; font-weight: 700; font-size: 12px; color: var(--text-2); }
.round-row label { margin: 0 !important; font-size: 12px; color: var(--text-3); width: 26px; flex-shrink: 0; }
.round-row input[type="text"], .round-row input[type="date"] { width: 158px; min-width: 0; padding: 6px 10px; font-size: 13px; }

/* ===== 悬浮可拖拽弹窗（编辑项目） ===== */
/* 遮罩透明且不吃鼠标事件，页面内容仍可见可滚动；弹窗本身可拖动 */
.modal-mask.modal-float { background: transparent; pointer-events: none; align-items: flex-start; justify-content: flex-start; }
.modal-mask.modal-float > .modal {
  pointer-events: auto;
  position: fixed;
  left: 50%; top: 56px;
  margin: 0;
  border: 1px solid var(--border);
  box-shadow: 0 20px 55px rgba(15, 23, 42, .26), 0 2px 8px rgba(15, 23, 42, .12);
  max-height: calc(100vh - 24px);
}
/* 紧凑版：整体尺寸约为常规弹窗的 70% */
.modal.modal-compact { width: min(826px, 94vw); padding: 15px 17px; border-radius: 10px; }
.modal.modal-compact h3 { font-size: 13.5px; margin-bottom: 8px; }
.modal.modal-compact .modal-sub { font-size: 10.5px; color: var(--text-3); margin-bottom: 4px; }
.modal.modal-compact label { font-size: 11.5px; margin: 7px 0 3px; }
.modal.modal-compact input, .modal.modal-compact select, .modal.modal-compact textarea { padding: 5px 8px; font-size: 12.5px; border-radius: 6px; }
.modal.modal-compact .form-row { gap: 8px; margin-bottom: 6px; }
.modal.modal-compact .modal-actions { margin-top: 10px; gap: 8px; }
.modal.modal-compact .modal-actions .btn { padding: 5px 14px; font-size: 12.5px; border-radius: 6px; }
.modal.modal-compact .rounds-grid { padding: 7px 9px; gap: 3px 12px; margin-top: 4px; }
.modal.modal-compact .round-row { width: calc(50% - 6px); min-width: 268px; padding: 2px 0; gap: 6px; }
.modal.modal-compact .round-row .r-tag { width: 24px; font-size: 10.5px; }
.modal.modal-compact .round-row label { font-size: 10.5px; width: 20px; }
.modal.modal-compact .round-row input[type="text"],
.modal.modal-compact .round-row input[type="date"] { width: 106px; padding: 4px 7px; font-size: 11.5px; }
.modal.modal-compact .modal-tip { font-size: 10.5px; color: var(--text-3); margin: 4px 0 2px; line-height: 1.5; }
/* 拖拽把手 + 关闭按钮 */
.modal-drag-handle { cursor: move; user-select: none; display: flex; align-items: center; gap: 8px; margin-bottom: 8px !important; }
.modal-drag-handle.dragging { cursor: grabbing; }
.modal-drag-hint { font-size: 10.5px; font-weight: 400; color: var(--text-3); }
.modal-close-x { margin-left: auto; border: none; background: transparent; color: var(--text-3); font-size: 14px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.modal-close-x:hover { background: var(--bg); color: var(--text); }
/* 宽表（23 列节奏总表） */
.tbl-wide th, .tbl-wide td { padding: 8px 6px; font-size: 13px; white-space: nowrap; }
.tbl-wide td.d-cell { text-align: center; color: var(--text-2); font-size: 12px; }
.tbl-wrap { overflow-x: auto; }
.member-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; background: #fff; }
.member-item .info { flex: 1; }
.member-item .info .nm { font-weight: 600; }
.member-item .info .un { color: var(--text-3); font-size: 12px; margin-left: 8px; }

@media (max-width: 860px) {
  .kr-right { align-items: flex-start; }
  .kr-btns { justify-content: flex-start; }
  .topbar-inner { gap: 10px; padding: 0 12px; }
  .nav a { padding: 6px 10px; font-size: 13px; }
}

/* ============== 本周工作 ============== */
.week-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.wk-label { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; }
.wk-list { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.wk-pill { display: inline-block; padding: 3px 10px; border-radius: 14px; font-size: 12px; background: #f1f5f9; color: var(--text-2); text-decoration: none; }
.wk-pill.active { background: var(--primary); color: #fff; }
.wk-row.readonly td { color: var(--text-2); background: #fafbfc; }
/* 本周工作：20 空位占位行 */
.wk-slot td { cursor: pointer; color: var(--text-3); background: #fdfefe; border-bottom: 1px dashed #cbd5e1 !important; transition: background .15s; }
.wk-slot td:hover { background: #f0f7ff; color: var(--primary); }
.wk-slot .slot-plus { display: inline-block; width: 20px; height: 20px; line-height: 17px; text-align: center; border: 1px dashed var(--primary); border-radius: 50%; color: var(--primary); margin-right: 8px; font-size: 13px; }
.wk-tip { margin-top: 10px; font-size: 12px; color: var(--text-2); }
.wk-tip b { color: var(--primary); }
/* 月报·本月项目汇总 · 行高调整 */
.monthly-task-tbl tr.mrow { position: relative; }
.monthly-task-tbl tr.mrow > td { vertical-align: top; }
.monthly-task-tbl .row-resizer { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: ns-resize; opacity: 0; background: transparent; transition: opacity .15s; z-index: 4; pointer-events: auto; }
.monthly-task-tbl .row-resizer:hover { background: rgba(59, 130, 246, .35); }
[data-row-resize-mode="1"] .monthly-task-tbl .row-resizer { opacity: 1; background: rgba(59, 130, 246, .15); }
.monthly-task-tbl tr.mrow.row-active > td { background: #fff7e6; }

/* 本周工作：单元格内联直接填写（无弹窗） */
.cell-in { width: 100%; box-sizing: border-box; border: 1px solid transparent; background: transparent; padding: 3px 6px; border-radius: 5px; font: inherit; color: inherit; min-width: 60px; }
.cell-in:hover:not([readonly]) { border-color: #cbd5e1; background: #fff; }
.cell-in:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 2px rgba(59,130,246,.12); }
.cell-in[readonly] { cursor: default; }
.cell-in::placeholder { color: #b6c2cf; font-size: 12px; }
.cell-ta { width: 100%; box-sizing: border-box; border: 1px solid transparent; background: transparent; padding: 4px 6px; border-radius: 5px; font: inherit; color: inherit; min-width: 60px; min-height: 28px; resize: vertical; line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.cell-ta:hover:not([readonly]) { border-color: #cbd5e1; background: #fff; }
.cell-ta:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 2px rgba(59,130,246,.12); }
.cell-ta::placeholder { color: #b6c2cf; font-size: 12px; }
.wk-row.wk-new td { background: #f0f7ff; }

/* 本周工作：表头可拖拽列宽 */
.weekly-page .tbl { table-layout: fixed; }
.weekly-page .tbl th { position: relative; overflow: hidden; text-overflow: ellipsis; }
.weekly-page .tbl th .col-resizer { position: absolute; right: 0; top: 0; width: 6px; height: 100%; cursor: col-resize; user-select: none; z-index: 2; }
.weekly-page .tbl th .col-resizer:hover { background: var(--primary); opacity: .5; }
.weekly-page.resizing { cursor: col-resize; user-select: none; }
.weekly-page.resizing * { cursor: col-resize !important; user-select: none; }
.weekly-page .tbl th.col-active { background: #eef2ff; }
.weekly-page .col-width-bar { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); margin-right: 6px; }
.weekly-page .col-width-bar input[type="number"] { width: 60px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; font: inherit; }
.tbl tr.grp td { background: #f8fafc; color: var(--text-2); font-weight: 600; font-size: 12px; padding: 6px 12px; }
/* 组长快捷指派：成员 chips */
.owner-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { padding: 3px 12px; border-radius: 14px; border: 1px solid var(--border); background: #fff; font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: all .15s; font-family: inherit; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
/* 被指派工作提醒弹窗 */
.remind-list { max-height: 42vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.remind-item { border: 1px solid var(--border); border-left: 3px solid #d97706; border-radius: 8px; padding: 10px 12px; background: #fafbfc; }
.remind-item .ri-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.remind-item .ri-meta { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.remind-item .ri-meta .badge { margin: 0; }
.remind-tip { margin-top: 12px; font-size: 12.5px; color: var(--text-3); }
.muted { color: var(--text-2); }
.muted small { color: var(--text-3); }

/* ============== 月度产出情况（项目看板 · 手动填报） ============== */
.month-grid { display: grid; grid-template-columns: minmax(430px, 1fr) minmax(560px, 1.35fr); gap: 18px; align-items: start; }
.m-block { min-width: 0; }
.m-title { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: baseline; gap: 8px; }
.m-title small { font-size: 12px; color: var(--text-3); font-weight: 400; }
.m-stats td, .m-stats th { padding: 5px 8px; white-space: nowrap; }
.m-stats .m-rowname { font-weight: 600; min-width: 96px; }
.m-stats input.m-in { width: 64px; padding: 4px 6px; border: 1px solid transparent; border-bottom: 1px dashed #cbd5e1; border-radius: 4px; font-size: 13px; text-align: center; background: transparent; font-family: inherit; }
.m-stats input.m-in:hover { border-color: #cbd5e1; background: #fff; }
.m-stats input.m-in:focus { outline: none; border: 1px solid var(--primary); background: #fff; box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.m-stats .m-total { background: #f8fafc; font-weight: 700; text-align: center; color: var(--primary); min-width: 44px; }
/* 周度指标自动计算行：只读灰底 + ⚙ 标记 */
.m-stats input.m-in.m-auto { background: #eef2f7; border-bottom: 1px solid #dbe2ea; color: #334155; cursor: default; }
.m-stats input.m-in.m-auto:hover { border-color: #cbd5e1; background: #e8edf3; }
.m-stats input.m-in.m-auto:focus { outline: none; box-shadow: none; }
.m-stats .m-rowname .m-auto-tag { font-size: 11px; color: var(--primary); margin-left: 2px; }
/* 我的工作台 · 本周已完成工作卡片网格 */
.done-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.done-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fff; }
.done-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(37, 99, 235, .08); }
.done-card.done-pin { border-left: 3px solid var(--primary); background: #f5f8ff; }
.dc-num { min-width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 2px; flex-shrink: 0; }
.done-card.done-pin .dc-num { background: #7c3aed; }
.dc-body { flex: 1; min-width: 0; }
.dc-title { font-size: 13px; line-height: 1.5; }
.dc-tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.m-prod td, .m-prod th { padding: 4px 6px; white-space: nowrap; }
.m-prod .m-idx { text-align: center; color: var(--text-3); width: 26px; }
.m-prod input.m-pf { width: 100%; min-width: 74px; padding: 5px 7px; border: 1px solid transparent; border-bottom: 1px dashed #cbd5e1; border-radius: 4px; font-size: 13px; background: transparent; font-family: inherit; }
.m-prod input.m-pf:hover { border-color: #cbd5e1; background: #fff; }
.m-prod input.m-pf:focus { outline: none; border: 1px solid var(--primary); background: #fff; box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.m-prod td:nth-child(2) input.m-pf { min-width: 170px; }
.m-prod select.m-pf { width: 100%; min-width: 80px; padding: 4px 6px; border: 1px solid transparent; border-bottom: 1px dashed #cbd5e1; border-radius: 4px; font-size: 13px; background: transparent; font-family: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; }
.m-prod select.m-pf:hover { border-color: #cbd5e1; background: #fff; }
.m-prod select.m-pf:focus { outline: none; border: 1px solid var(--primary); background: #fff; box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.m-prod select.m-pf[data-f="rate"] { color: var(--text-2); }
.m-prod select.m-pf[data-f="rate"][value="确认"] { color: #166534; background: #dcfce7; }
.m-prod select.m-pf[data-f="rate"][value="暂确认"] { color: #92400e; background: #fef3c7; }
.m-addrow { margin-top: 8px; }
.m-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; flex-wrap: wrap; }
.m-dirty { color: #b45309; font-size: 12.5px; font-weight: 600; }
/* 同事已更新提示条（并发填写保护）：保存时自动合并 */
.m-remote { color: #9a3412; font-size: 12.5px; font-weight: 600; background: #fff7ed; border: 1px solid #fdba74; border-radius: 6px; padding: 3px 10px; max-width: 100%; }
@media (max-width: 1280px) { .month-grid { grid-template-columns: 1fr; } }
/* 右上角今日日期 */
.today-date { font-size: 12px; color: var(--text-3); padding-right: 10px; border-right: 1px solid var(--border); white-space: nowrap; }
/* 看板「当前轮次」列内联下拉 */
td .round-sel { padding: 5px 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 12px; color: var(--text); font-family: inherit; cursor: pointer; max-width: 106px; }
.round-sel:disabled { cursor: not-allowed; opacity: .55; background: #f6f8fa; }

/* ===== 月报汇报页 ===== */
.month-picker { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 4px 6px; box-shadow: var(--shadow); }
.month-picker .month-label { font-weight: 700; color: var(--primary); font-size: 15px; padding: 0 10px; min-width: 90px; text-align: center; }
.month-picker button { background: transparent; border: none; padding: 5px 10px; color: var(--text-2); cursor: pointer; border-radius: 999px; font-size: 13px; }
.month-picker button:hover { background: var(--primary-light); color: var(--primary); }
.monthly-banner { background: linear-gradient(90deg, #fef3c7, #fde68a); border: 1px solid #f59e0b; color: #92400e; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; font-weight: 600; }
.stat-card.amber .num { color: var(--amber); }
.stat-card .num small { font-size: 12px; color: var(--text-3); margin-left: 4px; font-weight: 400; }
.monthly-sources { font-size: 12px; color: var(--text-2); font-weight: 400; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.src-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; background: var(--primary-light); color: var(--primary); border-radius: 12px; font-size: 12px; }
.src-pill small { color: var(--text-3); font-size: 11px; }
.src-empty { color: var(--text-3); font-size: 12px; font-style: italic; }
.monthly-tbl-wrap { overflow-x: auto; }
.monthly-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.monthly-table th, .monthly-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
.monthly-table thead th { background: var(--bg); color: var(--text-2); font-weight: 600; font-size: 12px; position: sticky; top: 0; }
.monthly-table tbody tr:hover { background: #f8fafc; }
.monthly-table .row-head { text-align: left; color: var(--text); font-weight: 600; background: #f8fafc; }
.monthly-table .total-col { background: #f8fafc; color: var(--primary); font-weight: 700; }
.monthly-table .group-row td { background: #eff6ff; color: var(--primary); font-weight: 700; text-align: left; padding: 6px 12px; font-size: 13px; }
.monthly-table .empty-cell { color: var(--text-3); font-size: 12px; }
.product-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.product-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; transition: all .15s; box-shadow: var(--shadow); border-left: 4px solid #cbd5e1; }
.product-card.confirmed { border-left-color: var(--green); background: linear-gradient(180deg, #f0fdf4 0%, #fff 30%); }
.product-card.tentative { border-left-color: var(--amber); background: linear-gradient(180deg, #fffbeb 0%, #fff 30%); }
.product-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 23, 42, .08); }
.product-card .pname { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; line-height: 1.4; }
.product-card .pmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 4px; }
.product-card .pmeta-item { background: #f1f5f9; padding: 2px 8px; border-radius: 4px; }
.product-card .prate { font-weight: 700; padding: 2px 10px; border-radius: 12px; font-size: 11px; }
.product-card .prate.rate-yes { background: #dcfce7; color: var(--green); }
.product-card .prate.rate-pending { background: #fef3c7; color: #92400e; }
.product-card { position: relative; }
.product-card .product-del { position: absolute; top: 6px; right: 8px; background: transparent; border: none; color: #94a3b8; font-size: 14px; cursor: pointer; padding: 2px 6px; border-radius: 4px; line-height: 1; }
.product-card .product-del:hover { color: #ef4444; background: #fee2e2; }

/* 月报页内联编辑样式 */
.edit-cell { cursor: pointer; transition: background-color .15s; border-radius: 3px; padding: 2px 4px !important; }
.edit-cell:hover { background: #fef9c3; outline: 1px dashed #fbbf24; }
.edit-cell.editing { background: #fffbe6; outline: 1px solid #3b82f6; padding: 1px !important; }
.kpi-edit { user-select: none; }
.kpi-edit:hover { color: var(--primary); text-shadow: 0 0 1px var(--primary); }
.edit-hint { font-size: 11px; color: var(--text-3); margin-top: 8px; padding: 4px 8px; background: #fffbeb; border-left: 3px solid #fbbf24; border-radius: 3px; }
.monthly-edit { outline: none; }

/* 本月项目汇总表格 */
.monthly-task-tbl td.edit-cell { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.monthly-task-tbl { font-size: 13px; }
.monthly-task-tbl th { background: #f8fafc; }
.monthly-task-tbl .task-del { padding: 2px 8px; color: #94a3b8; }
.monthly-task-tbl .task-del:hover { color: #ef4444; background: #fee2e2; }

/* ===== 项目管理页 ===== */
.pm-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pm-filter select, .pm-filter input { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; background: #fff; color: var(--text); font-family: inherit; }
.pm-filter input { min-width: 240px; }
.pm-tbl { font-size: 13px; }
.pm-tbl th { white-space: nowrap; background: #f8fafc; }
.pm-tbl td { vertical-align: middle; }
/* 粘性底部横滚动条：页面滚动到任何位置都能横向拖动表格 */
.pm-tbl-scroll-wrap { position: relative; }
.pm-tbl-scroll { overflow-x: auto; overflow-y: visible; }
.pm-tbl-stickyscroll {
  position: sticky; bottom: 0; z-index: 5;
  overflow-x: auto; overflow-y: hidden;
  height: 14px; background: #fff;
  border-top: 1px solid #e5e7eb;
}
.pm-tbl-stickyscroll-inner { height: 1px; }
.pm-tbl th.pm-hide, .pm-tbl td.pm-hide { display: none; } /* 隐藏列：客户等级/项目等级/OPEN贴/翻盖/配方类型/开发阶段，点「拉开隐藏列」显示 */
.pm-cust-cell { min-width: 118px; }
.pm-cust-cell .pm-in { width: 92px; }
.pm-cust-cell .pm-td-type { display: block; margin-top: 2px; }
.pm-short { width: 62px !important; }
.pm-license, .pm-ftype { max-width: 88px; }
/* 项目名称列：放宽并允许换行，完整显示项目名（不再省略号截断） */
.pm-tbl .pm-name { font-weight: 600; max-width: 230px; min-width: 150px; white-space: normal; word-break: break-all; line-height: 1.45; }
.pm-in { width: 94px; border: 1px solid transparent; border-radius: 6px; padding: 5px 5px; font-size: 12.5px; background: transparent; color: var(--text); font-family: inherit; }
.pm-in:hover { border-color: var(--border); background: #fff; }
.pm-in:focus { border-color: var(--primary); background: #fff; outline: none; box-shadow: 0 0 0 2px var(--primary-light); }
.pm-sel { max-width: 104px; border: 1px solid var(--border); border-radius: 6px; padding: 5px 5px; font-size: 12px; background: #fff; color: var(--text); font-family: inherit; cursor: pointer; }
/* 必填列：表头红星标记；留空单元格淡红高亮提醒 */
.pm-th-req::after { content: " *"; color: #dc2626; font-weight: 700; }
.pm-in.pm-req-empty { background: #fef2f2; border-color: #fca5a5; }
.pm-in.pm-req-empty::placeholder { color: #dc2626; opacity: .75; }
.pm-in.pm-req-empty:focus { border-color: #dc2626; box-shadow: 0 0 0 2px #fecaca; }
/* 流程列：醒目蓝色按钮 */
.pm-th-wf { white-space: nowrap; }
.pm-wf-btn { background: #3b82f6 !important; color: #fff !important; border: 1px solid #3b82f6 !important; font-weight: 600; white-space: nowrap; }
.pm-wf-btn:hover { background: #2563eb !important; }
.pm-wf-btn .pm-wf-pct { letter-spacing: .2px; }
.pm-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pm-int { color: #166534; background: #dcfce7; }
.pm-ext { color: #9a3412; background: #ffedd5; }
.pm-none { color: var(--text-3); background: #f1f5f9; }
.pm-gA { color: #166534; background: #dcfce7; }
.pm-gB { color: #1d4ed8; background: #dbeafe; }
.pm-gC { color: #4b5563; background: #e5e7eb; }
.pm-gD { color: #92400e; background: #fef3c7; }
.pm-gE { color: #b91c1c; background: #fee2e2; }
.stat-card.indigo .num { color: #1d4ed8; }
.pm-scope-tag { display: inline-block; margin-bottom: 10px; }
/* 项目管理：单页双表 · 上下分区 · 状态列 */
.pm-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.pm-section-count { margin-left: 8px; color: var(--text-3); font-size: 12.5px; font-weight: 500; }
.pm-collapsed-hint { padding: 14px 16px; background: #f8fafc; border: 1px dashed var(--border); border-radius: 10px; color: var(--text-3); font-size: 13px; text-align: center; }
/* 状态列下拉配色：未开始灰、进行中蓝、已确版绿、暂停红 */
.pm-round-none { color: var(--text-3) !important; background: #f1f5f9 !important; }
.pm-round-running { color: #1d4ed8 !important; background: #dbeafe !important; }
.pm-round-done { color: #166534 !important; background: #dcfce7 !important; }
.pm-round-pause { color: #b91c1c !important; background: #fee2e2 !important; }
.pm-tbl .pm-round { font-size: 12.5px; min-width: 100px; }
/* 开发流程展开行 */
.pm-wf-row td { background: #f8fafc; padding: 12px 16px; }
.pm-wf-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pm-wf-stage { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.pm-wf-stage-title { font-size: 13px; font-weight: 700; color: var(--primary); border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 6px; }
.pm-wf-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; padding: 4px 2px; font-size: 12.5px; cursor: pointer; border-radius: 6px; }
.pm-wf-item:hover { background: var(--primary-light); }
.pm-wf-item input { cursor: pointer; }
.pm-wf-item-name { font-weight: 600; }
.pm-wf-item.done .pm-wf-item-name { color: var(--text-3); text-decoration: line-through; }
.pm-wf-item-desc { flex-basis: 100%; color: var(--text-3); font-size: 11.5px; line-height: 1.5; }
/* 内部客户名单弹窗行 */
.pm-cust-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--border); font-size: 13px; }
.pm-cust-row .muted { flex: 1; font-size: 12px; }

/* ===== 手机 / PWA 适配（移动端增强） ===== */
/* iOS 全面屏安全区：PWA 全屏模式下内容不被刘海/小黑条遮挡 */
@supports (padding: env(safe-area-inset-top)) {
  .topbar { padding-top: env(safe-area-inset-top); }
  body { padding-bottom: env(safe-area-inset-bottom); }
}

/* iOS 在输入框字号 <16px 时聚焦会强制放大页面，手机上统一 16px 防缩放 */
@media (max-width: 640px) {
  body { font-size: 15px; }
  input, select, textarea { font-size: 16px !important; }

  /* 顶栏：允许换行，导航横向滚动 */
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 8px 12px; row-gap: 4px; }
  .nav { flex-basis: 100%; gap: 2px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .nav a { padding: 9px 13px; font-size: 14px; }
  .topbar-right { font-size: 13px; }

  /* 弹窗：小屏几乎全屏，内边距收紧 */
  .modal { padding: 18px 16px; max-height: 90dvh; border-radius: 12px; }
  .modal-wide { width: 96vw; }
  .modal .modal-actions .btn { min-height: 42px; }

  /* 触控目标不小于 40px */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }

  /* 登录卡适配窄屏 */
  .login-card { width: min(380px, calc(100vw - 24px)); padding: 28px 22px; }
  .login-card .btn { min-height: 46px; font-size: 16px; }

  /* 卡片间距收紧 */
  .card { border-radius: 10px; }
  th, td { padding-top: 7px; padding-bottom: 7px; }
}

/* 屏幕有效高度紧张时（手机横屏 / 小窗）也限制弹层高度 */
@media (max-height: 560px) {
  .modal { max-height: 92vh; }
}
