/* ============================================================
   企业内部员工周报系统 — 样式表
   ============================================================ */

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e5e9f0;
  --border-strong: #d3dae6;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #8592a6;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eef4ff;
  --success: #16a34a;
  --success-soft: #e9f9ef;
  --warn: #d97706;
  --warn-soft: #fff7e8;
  --danger: #dc2626;
  --danger-soft: #fef1f1;
  --violet: #7c3aed;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);
  --sidebar-w: 232px;
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

/* 移动端浏览器（Chrome for Android / Safari）会对「窄容器里的小字号」做字体自动放大
   （text autosizing / font boosting），同一页里不同元素的放大比例还不一致 ——
   表现就是手机上文字忽大忽小、下拉框尤其显大。显式声明 100% 关掉它，
   让手机端字号与设计稿一致。（不要小于 100%，否则会触发 iOS 聚焦缩放） */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
button { font-family: inherit; }
code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .92em; }
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }

/* ===================== 通用控件 ===================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: .15s ease; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #b9c4d6; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.94); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(15, 23, 42, .05); }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-lg { padding: 11px 18px; font-size: 15px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer;
  transition: .15s;
}
.icon-btn:hover { background: rgba(15, 23, 42, .06); color: var(--text); }

.input, .select, .textarea {
  width: 100%; padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: #fff; color: var(--text);
  font-size: 13.5px; font-family: inherit; transition: .15s; outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.textarea { resize: vertical; min-height: 68px; line-height: 1.65; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5L10 4.5' stroke='%2364748b' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 12px; padding-right: 28px; cursor: pointer; text-overflow: ellipsis; }
.input-sm, .select-sm { padding: 5px 9px; font-size: 12.5px; }
/* 筛选条件的包装容器：桌面端用 min-width 保证控件够宽，窄屏由媒体查询改成两列等宽 */
.flt { min-width: 130px; }
.flt-md { min-width: 150px; }
.flt-lg { min-width: 190px; }

/* ===================== 下拉选择器 ===================== */
/* 原生 <select> 展开后的列表由操作系统绘制，CSS 根本改不了 —— 手机上会
   弹出系统的大字号列表，跟页面风格完全对不上，这也是「丑」的主因。
   所以外壳自绘：原生 select 只当数据节点（透明、不吃事件、不可聚焦），
   视觉交给 .sel-btn（触发器）与 .sel-menu（列表）。
   桌面＝贴着触发器的小浮层；≤760px＝底部抽屉（触屏上更好点、更耐看）。 */

.sel { position: relative; display: block; width: 100%; max-width: 100%; }

/* 原生 select：仍然承载 value / input / change，但彻底隐形 */
.sel > .sel-native {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; padding: 0; border: 0; background: none; box-shadow: none;
  opacity: 0; pointer-events: none; appearance: none;
}

.sel > .sel-btn {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; cursor: pointer;
  background-image: none;                       /* 旧版画在背景上的箭头不再需要 */
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.sel > .sel-btn:hover:not(:disabled) { border-color: #b9c4d6; }
.sel > .sel-btn:active:not(:disabled) { background: var(--surface-2); }
.sel > .sel-btn:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); outline: none; }
.sel > .sel-btn:disabled { cursor: not-allowed; color: var(--text-3); background: #f6f8fb; border-color: var(--border); }
.sel.open > .sel-btn { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
/* 筛选类下拉（含「全部…」空选项）选中具体值后给一点提示色：
   否则「全部项目」和「智慧园区管理平台」看上去一模一样 */
.sel.has-val > .sel-btn { border-color: #bcd0f7; background: var(--primary-soft); }
.sel.has-val > .sel-btn .sel-lab { color: var(--primary-dark); font-weight: 600; }

.sel > .sel-btn.select-sm { padding-right: 9px; }   /* 小号下拉保持左右对称 */
.sel-lab { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-lab.ph { color: var(--text-3); }            /* 未选值＝占位文案，弱化 */
.sel-caret { flex: 0 0 auto; color: #94a3b8; transition: transform .18s ease, color .15s; }
.sel.open .sel-caret, .sel > .sel-btn:hover .sel-caret { color: var(--primary); }
.sel.open .sel-caret { transform: rotate(180deg); }

.sel-menu {
  position: fixed; z-index: 180; overflow: auto; overscroll-behavior: contain;
  scrollbar-width: thin; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: 0 18px 44px -14px rgba(15, 23, 42, .3), 0 2px 8px rgba(15, 23, 42, .07);
  animation: selMenuIn .15s ease-out;
}
@keyframes selMenuIn { from { opacity: 0; transform: translateY(-4px) scale(.985); } }
@keyframes selSheetIn { from { transform: translateY(100%); } }
@keyframes selFadeIn { from { opacity: 0; } }

.sel-opt {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer;
  transition: background .1s, color .1s;
}
.sel-opt-txt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-opt:hover, .sel-opt.act { background: #f2f6fd; color: var(--text); }
.sel-opt.on { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.sel-opt.dis { color: #b6c0cf; cursor: not-allowed; }
.sel-opt.dis:hover { background: none; color: #b6c0cf; }
.sel-tick { flex: 0 0 auto; color: var(--primary); opacity: 0; }
.sel-opt.on .sel-tick { opacity: 1; }
.sel-group { padding: 9px 10px 5px; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; color: var(--text-3); }
.sel-grab, .sel-menu-hd { display: none; }       /* 只在抽屉形态出现 */

/* 手机端：底部抽屉（触屏点击区域够大，也不会被软键盘/边缘裁掉） */
.sel-scrim { position: fixed; inset: 0; z-index: 170; background: rgba(15, 23, 42, .38); animation: selFadeIn .18s ease-out; }
body.sel-lock { overflow: hidden; }

@media (max-width: 760px) {
  /* 触发器：触屏最小 40px 高，圆角大一号，字号跟卡片正文对齐。
     左右内边距与箭头间距要克制 —— 三个筛选并排时每个只有 ~105px，
     留多了文案会被截成「全部项…」 */
  .sel > .sel-btn { min-height: 40px; font-size: 13.5px; padding: 9px 10px; border-radius: 10px; gap: 6px; }
  .sel > .sel-btn.select-sm { min-height: 34px; font-size: 13px; padding: 7px 10px; border-radius: 9px; }
  .sel-caret { width: 15px; height: 15px; flex: 0 0 15px; }

  .sel-menu.sheet {
    left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 70vh;
    border: 0; border-radius: 18px 18px 0 0;
    padding: 0 8px calc(10px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -12px 40px rgba(15, 23, 42, .24);
    animation: selSheetIn .24s cubic-bezier(.22, .9, .3, 1);
  }
  .sel-menu.sheet .sel-grab { display: block; width: 40px; height: 4px; border-radius: 2px; background: #dbe2ec; margin: 9px auto 2px; }
  .sel-menu.sheet .sel-menu-hd { display: block; padding: 10px 14px 4px; font-size: 15px; font-weight: 600; color: var(--text); text-align: center; }
  .sel-menu.sheet .sel-opt { padding: 13px 14px; font-size: 15px; border-radius: 10px; margin-bottom: 2px; }
  .sel-menu.sheet .sel-opt:hover, .sel-menu.sheet .sel-opt.act { background: #f2f6fd; }
  .sel-menu.sheet .sel-opt.on { background: var(--primary-soft); }
  .sel-menu.sheet .sel-group { padding: 12px 14px 6px; font-size: 12px; }
  .sel-menu.sheet .sel-tick { width: 17px; height: 17px; }
  /* 更矮的浮层贴不到底时也别把内容裁掉 */
  .sel-menu.sheet { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}
.field { display: block; }
.field > span { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: #eef1f6; color: var(--text-2); white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: #15803d; }
.badge-warn { background: var(--warn-soft); color: #b45309; }
.badge-danger { background: var(--danger-soft); color: #b91c1c; }
.badge-info { background: var(--primary-soft); color: var(--primary-dark); }
.badge-neutral { background: #eef1f6; color: #64748b; }
/* 项目「结项」：比中性灰再淡一档，与「售前支持」区分开 */
.badge-closed { background: #e2e6ee; color: #8592a6; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .02em;
}
.avatar-sm { width: 26px; height: 26px; font-size: 11.5px; }
.avatar-lg { width: 46px; height: 46px; font-size: 17px; }

/* ===================== 登录页 ===================== */

/* 品牌方块（登录页与侧边栏共用） */
.logo {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
  background: linear-gradient(140deg, #3b82f6, #1d4ed8);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; box-shadow: 0 6px 16px rgba(37, 99, 235, .32);
}
.logo-lg { width: 50px; height: 50px; border-radius: 14px; font-size: 23px; }

.login-wrap {
  position: fixed; inset: 0; overflow: auto; background: #eef2f9;
}
.login-panel {
  display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  min-height: 100%;
}

/* ---------- 页面级 ICP 备案号（登录页底部居中） ---------- */
.login-icp {
  position: absolute; left: 0; right: 0; bottom: 8px;
  text-align: center; font-size: 12px; letter-spacing: .04em;
  z-index: 5; pointer-events: none;
}
.login-icp a { pointer-events: auto; color: #94a3b8; text-decoration: none; }
.login-icp a:hover { color: var(--primary); text-decoration: underline; }

/* ---------- 左侧品牌区 ---------- */
.login-aside {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(155deg, #1e3a8a 0%, #2563eb 54%, #4f46e5 100%);
  display: flex; flex-direction: column; padding: 46px 52px 34px;
}
.login-aside-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(125% 95% at 12% 8%, #000 26%, transparent 76%);
  mask-image: radial-gradient(125% 95% at 12% 8%, #000 26%, transparent 76%);
}
.login-aside-glow {
  position: absolute; width: 540px; height: 540px; right: -200px; bottom: -230px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 66%);
}
.login-aside-body {
  position: relative; z-index: 1; flex: 1;
  display: flex; flex-direction: column; justify-content: center; gap: 34px;
  max-width: 470px;
}
.login-aside-brand { display: flex; align-items: center; gap: 14px; }
.login-aside-brand-text strong { display: block; font-size: 16.5px; font-weight: 600; letter-spacing: .01em; }
.login-aside-brand-text small { font-size: 11px; color: rgba(255, 255, 255, .7); letter-spacing: .18em; text-transform: uppercase; }
.login-aside .logo {
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3);
  box-shadow: none; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.login-aside h2 { font-size: 30px; line-height: 1.38; font-weight: 600; letter-spacing: -.01em; }
.login-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 19px; }
.login-features li { display: flex; gap: 13px; align-items: flex-start; }
.login-features .fi {
  width: 35px; height: 35px; border-radius: 11px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .24);
}
.login-features strong { display: block; font-size: 14px; font-weight: 600; }
.login-features span { font-size: 12.5px; color: rgba(255, 255, 255, .76); line-height: 1.55; }
.login-aside-foot {
  position: relative; z-index: 1; font-size: 11.5px;
  color: rgba(255, 255, 255, .58); letter-spacing: .05em;
}

/* ---------- 右侧表单区 ---------- */
.login-main {
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  padding: 46px 40px;
}
.login-main-inner { width: 100%; max-width: 376px; }
.login-mobile-brand { display: none; align-items: center; gap: 11px; margin-bottom: 26px; }
.login-mobile-brand strong { font-size: 15.5px; }
.login-head { margin-bottom: 26px; }
.login-head h1 { font-size: 24px; letter-spacing: -.02em; }
.login-head p { font-size: 13.5px; color: var(--text-3); margin-top: 7px; line-height: 1.6; }

.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-error {
  background: var(--danger-soft); color: #b91c1c; border: 1px solid #fad4d4;
  border-radius: var(--radius-sm); padding: 8px 11px; font-size: 13px;
}

/* 带图标的输入框 */
.input-wrap { position: relative; }
.input-wrap .input-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.input.input-ico-l { padding-left: 37px; }
.input.input-ico-r { padding-right: 40px; }
.input-wrap .input { height: 43px; }
.pwd-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 31px; height: 31px; border: 0; border-radius: 7px; background: transparent;
  color: var(--text-3); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: .15s;
}
.pwd-toggle:hover { background: rgba(15, 23, 42, .05); color: var(--text); }
.login-submit { height: 44px; margin-top: 4px; box-shadow: 0 8px 20px rgba(37, 99, 235, .24); }
.login-submit:hover { box-shadow: 0 10px 24px rgba(37, 99, 235, .3); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: #fff; font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }
.chip em { font-style: normal; font-size: 10.5px; background: var(--primary); color: #fff; padding: 0 5px; border-radius: 999px; }
.chip-leader { border-color: #c7d7fe; background: #f5f8ff; }

/* ===================== 布局 ===================== */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px; border-bottom: 1px solid var(--border);
}
.brand .logo { width: 34px; height: 34px; border-radius: 9px; font-size: 15px; box-shadow: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 14.5px; }
.brand-text small { font-size: 10.5px; color: var(--text-3); letter-spacing: .05em; }

.nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-group { font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: .08em; padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--text-2); font-size: 13.5px; font-weight: 500; cursor: pointer; text-align: left; transition: .15s;
}
.nav-item svg { flex: 0 0 auto; opacity: .8; }
.nav-item:hover { background: #f1f4f9; color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.nav-item.active svg { opacity: 1; }
.nav-item .nav-count {
  margin-left: auto; font-size: 11.5px; background: #eef1f6; color: var(--text-3);
  padding: 0 6px; border-radius: 999px; font-weight: 600;
}
.nav-item.active .nav-count { background: #fff; color: var(--primary-dark); }

.sidebar-foot {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px; border-top: 1px solid var(--border);
}
/* 整块用户区可点击 → 账号设置（本人修改密码） */
.me-btn {
  display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1;
  padding: 6px 7px; border: 0; border-radius: var(--radius-sm); background: transparent;
  font-family: inherit; text-align: left; color: var(--text); cursor: pointer; transition: background .15s;
}
.me-btn:hover { background: #f1f4f9; }
.me-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.me-btn .avatar { flex: 0 0 auto; }
.me-chev { flex: 0 0 auto; color: var(--text-3); opacity: 0; transition: opacity .15s; }
.me-btn:hover .me-chev, .me-btn:focus-visible .me-chev { opacity: .85; }
.me-info { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1; }
.me-info strong { font-size: 13px; }
.me-info small { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 抽屉遮罩：默认不占位、不吃点击；≤860px 生效，点空白处关闭左侧导航 */
.scrim { display: none; pointer-events: none; }
body.drawer-open { overflow: hidden; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 24px; background: rgba(244, 246, 250, .88);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.topbar-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.topbar-title h2 { font-size: 17px; }
.topbar-sub { font-size: 12.5px; color: var(--text-3); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.week-select { min-width: 186px; }

.page { padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 16px; }

/* ===================== 卡片 ===================== */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.card-hd h3 { font-size: 14px; }
.card-hd .sub { font-size: 12px; color: var(--text-3); }
.card-hd .grow { flex: 1; }
.card-bd { padding: 16px; }
.card-bd.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

/* ===================== KPI ===================== */

.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 15px 16px; display: flex; flex-direction: column; gap: 4px;
  position: relative; overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); opacity: .85;
}
.kpi.k-green::after { background: var(--success); }
.kpi.k-amber::after { background: var(--warn); }
.kpi.k-red::after { background: var(--danger); }
.kpi.k-violet::after { background: var(--violet); }
.kpi-label { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 27px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.kpi-foot { font-size: 12px; color: var(--text-3); }
.kpi-foot em { font-style: normal; font-weight: 600; color: var(--text-2); }

.progress-line { height: 6px; border-radius: 999px; background: #eef1f6; overflow: hidden; }
.progress-line > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); transition: width .4s; }

/* ===================== 表格 ===================== */

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.table th {
  text-align: left; font-weight: 600; font-size: 12.5px; color: var(--text-3);
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0;
}
table.table td { padding: 11px 14px; border-bottom: 1px solid #f0f3f8; vertical-align: middle; }
table.table tbody tr:last-child td { border-bottom: 0; }
table.table tbody tr.clickable { cursor: pointer; transition: background .12s; }
table.table tbody tr.clickable:hover { background: #f7f9fd; }
table.table td.num, table.table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.table td.center, table.table th.center { text-align: center; }
table.table td.nowrap, table.table th.nowrap { white-space: nowrap; }
.cell-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cell-stack { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.cell-stack strong { font-size: 13.5px; font-weight: 600; }
.cell-stack small { font-size: 11.5px; color: var(--text-3); }

.proj-tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2);
}
.proj-dot { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 auto; }

.mini-bars { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.mini-bar { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.mini-bar .track { flex: 1; height: 5px; border-radius: 999px; background: #eef1f6; overflow: hidden; min-width: 44px; }
.mini-bar .track > i { display: block; height: 100%; border-radius: 999px; }
.mini-bar .val { font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }

/* ===================== 周报表单 ===================== */

.report-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.report-head h3 { font-size: 15.5px; }
.report-head .meta { font-size: 12.5px; color: var(--text-3); }
.report-head .spacer { flex: 1; }

/* 每条工作项取「所属项目」的主题色做左侧色条 + 同色序号徽章，
   让同一份表单里的多个项目一目了然、便于区分 */
.entry {
  position: relative;
  border: 1px solid var(--border);
  border-left: 4px solid var(--entry-accent, var(--primary));
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.entry:hover { box-shadow: 0 6px 18px var(--entry-tint-strong, rgba(15, 23, 42, .1)); }
/* 风险/阻塞项：其余三边转为琥珀色提示，左侧仍保留项目色以便区分 */
.entry.has-risk {
  border-top-color: #f6d5a8; border-right-color: #f6d5a8; border-bottom-color: #f6d5a8;
  border-left-color: var(--entry-accent, #d97706);
  background: #fffdf8;
}
.entry-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px;
  background: var(--entry-tint, var(--surface-2));
  border-bottom: 1px solid var(--border);
}
.entry-hd .idx {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--entry-accent, var(--primary)); color: #fff;
  font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.entry-hd .grow { flex: 1; }
.entry-bd { padding: 13px; display: grid; gap: 12px; }
.entry-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr 150px 150px; }
.entry-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.field-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; margin-bottom: 5px; display: flex; align-items: center; gap: 6px; }
.field-label .hint { font-size: 11.5px; color: var(--text-3); font-weight: 400; }

.range-wrap { display: flex; align-items: center; gap: 9px; }
.range-wrap input[type=range] { flex: 1; accent-color: var(--primary); height: 4px; }
.range-val { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text-2); min-width: 38px; text-align: right; font-weight: 600; }

.entries-list { display: flex; flex-direction: column; gap: 13px; }

.form-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border-top: 1px solid var(--border); background: var(--surface-2);
  position: sticky; bottom: 0;
}
.hours-total { font-size: 13px; color: var(--text-2); }
.hours-total strong { font-size: 17px; color: var(--text); font-variant-numeric: tabular-nums; }
.form-foot .spacer { flex: 1; }

/* ===================== 列表 / 其它 ===================== */

.risk-list { display: flex; flex-direction: column; gap: 8px; }
.risk-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); border: 1px solid #f6e2bd;
}
.risk-item.danger { background: var(--danger-soft); border-color: #f8d7d7; }
.risk-item .txt { font-size: 13px; flex: 1; min-width: 0; }
.risk-item .txt small { display: block; color: var(--text-3); font-size: 11.5px; }

.list-plain { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px;
  border-bottom: 1px solid #f0f3f8; transition: background .12s;
  /* 换行由 flex 自己判定，不绑固定断点：装不下时 .row-meta 自动落到第二行。
     否则 761~980px 这段「不上不下」的宽度会挤出畸形态 ——
     正文列被压到 ~169px、项目徽章竖着叠三行、右侧一片空白。 */
  flex-wrap: wrap; row-gap: 8px;
}
.list-row:last-child { border-bottom: 0; }
.list-row.clickable { cursor: pointer; }
.list-row.clickable:hover { background: #f7f9fd; }
.list-row .grow { flex: 1; min-width: 0; }

/* —— 列表行的三段式结构：前导列 / 正文 / 尾部指标 ——
   固定宽度一律走 CSS 变量而不是内联 width：内联样式优先于媒体查询，
   窄屏改不动，就会被挤成 0 宽、内容溢出到相邻标签上（「3 项」与「20 h」互相压盖的成因）。
   桌面端宽度由 --lead-w / --hours-w 给出，窄屏在媒体查询里把它们放开即可。 */
.row-lead { flex: 0 0 auto; width: var(--lead-w, auto); }
/* 正文列必须能收缩（min-width:0 关掉 flex item 的 min-content 下限），
   否则窄屏下它保持内容原宽、直接撑破整行（「行内溢出」）。
   basis 给 260px 作「期望宽度」：行宽不足时由 flex 判定把 .row-meta 换到下一行，
   而不是把这一列压成一条缝。 */
.row-body { flex: 1 1 260px; min-width: 0; }
.row-meta { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; row-gap: 6px; margin-left: auto; }
.row-hours { flex: 0 0 auto; width: var(--hours-w, auto); text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.row-caret { color: #8592a6; }
.report-tasks { font-size: 12.5px; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-projs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; min-width: 0; }
/* 单个项目名过长时，先在徽章内部截断一次，避免整枚徽章撑破行宽 */
.report-projs .badge { min-width: 0; max-width: 100%; }
.report-projs .badge > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { padding: 34px 16px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.empty svg { opacity: .35; margin-bottom: 8px; }

.skeleton { background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 37%, #eef1f6 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.tabs { display: inline-flex; gap: 3px; background: #eaeef5; padding: 3px; border-radius: 9px; }
.tab {
  border: 0; background: transparent; padding: 6px 13px; border-radius: 7px;
  font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: #fff; color: var(--primary-dark); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); font-weight: 600; }

.section-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--primary); }

/* ===================== Toast / Modal ===================== */

.toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 9px; font-size: 13.5px;
  box-shadow: var(--shadow-lg); animation: toastIn .22s ease; display: flex; align-items: center; gap: 8px; max-width: 460px;
}
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }
.toast.out { animation: toastOut .22s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .42); z-index: 150;
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 20px 40px; overflow: auto;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 820px; animation: rise .2s ease; overflow: hidden;
}
.modal.wide { max-width: 1000px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.modal-hd { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-hd h3 { font-size: 15.5px; }
.modal-hd .grow { flex: 1; }
.modal-bd { padding: 18px; max-height: 68vh; overflow: auto; }
.modal-ft { display: flex; gap: 10px; justify-content: flex-end; padding: 13px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ===================== 图表 ===================== */

.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; }
.chart-legend .li { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: default; }
.chart-legend .li.clickable { cursor: pointer; }
.chart-legend .li .sw { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.chart-legend .li .nm { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-legend .li .vl { color: var(--text-3); font-variant-numeric: tabular-nums; }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
/* 字号说明：这里是 SVG 用户单位，最终屏幕字号 = 该值 × (容器宽 / viewBox 宽)。
   680 的画布塞进 618px 卡片时缩放 0.91，11.5px 实际只剩 10.5px —— 偏小且发虚，
   故提升到 13.5px（实际约 12.3px）；窄屏由 charts.js 换 432 的小画布兜住。 */
svg.chart .axis-text { font-size: 13.5px; fill: #6b7a90; font-family: var(--font); }
svg.chart .val-text { font-size: 13.5px; font-weight: 600; fill: #415164; font-family: var(--font); font-variant-numeric: tabular-nums; }
svg.chart .grid-line { stroke: #eef1f6; stroke-width: 1; }
svg.chart .bar { transition: opacity .15s; cursor: default; }
svg.chart .bar:hover { opacity: .82; }

.tooltip {
  position: fixed; z-index: 300; pointer-events: none; background: #0f172a; color: #fff;
  padding: 7px 10px; border-radius: 7px; font-size: 12.5px; line-height: 1.5; box-shadow: var(--shadow-lg);
  max-width: 280px; transform: translate(-50%, -100%);
}
.tooltip strong { font-weight: 600; }
.tooltip .r { color: #a7b4c8; }

/* ===================== 详情块 ===================== */

.detail-hd { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.detail-hd .info { display: flex; flex-direction: column; gap: 2px; }
.detail-hd .info h3 { font-size: 16px; }
.detail-hd .info .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }

.stat-inline { display: flex; gap: 22px; flex-wrap: wrap; }
.stat-inline .it { display: flex; flex-direction: column; gap: 1px; }
.stat-inline .it span { font-size: 12px; color: var(--text-3); }
.stat-inline .it strong { font-size: 19px; font-variant-numeric: tabular-nums; }

.task-list { display: flex; flex-direction: column; }
.task-item { padding: 12px 0; border-bottom: 1px solid #f0f3f8; display: flex; gap: 12px; }
.task-item:last-child { border-bottom: 0; }
.task-item .body { flex: 1; min-width: 0; }
.task-item .body .t { font-size: 13.5px; line-height: 1.6; }
.task-item .body .m { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 5px; font-size: 12px; color: var(--text-3); }
.task-item .body .m b { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }

.only-mobile { display: none; }

/* ===================== 项目表单 / 提示条 ===================== */

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); }

.notice {
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 13px; line-height: 1.75;
}
.notice-info { background: var(--primary-soft); border: 1px solid #d3e0ff; color: #1e40af; }
.notice-warn { background: var(--warn-soft); border: 1px solid #f6e2bd; color: #92400e; }

/* 统计口径说明条（如「本年度未提交」的统计窗口）。
   放在 .card-bd.tight（padding:0）里，所以自带外边距。 */
.miss-note {
  font-size: 12.5px; line-height: 1.75; color: var(--text-2);
  background: #f7f9fd; border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm); padding: 9px 12px; margin: 12px 12px 2px;
}
.miss-note b { color: var(--text); font-weight: 600; }

/* 新建账号后的凭据回显 */
.cred-box { margin-top: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.cred-box > div { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.cred-box > div + div { border-top: 1px solid var(--border); }
.cred-box span { flex: 0 0 72px; font-size: 12.5px; color: var(--text-3); }
.cred-box strong {
  font-size: 15px; letter-spacing: .04em; color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.swatches { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 2px; }
.swatch {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .1); transition: .15s; padding: 0;
}
.swatch:hover { transform: scale(1.08); }
.swatch.on { border-color: var(--text); transform: scale(1.08); }

.pick-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.pick-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px 4px 5px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: #fff;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: .15s; user-select: none;
}
.pick-chip:hover { border-color: #b9c4d6; }
.pick-chip.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.pick-chip .avatar { width: 20px; height: 20px; font-size: 10px; }

.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { width: 24px; height: 24px; font-size: 10.5px; margin-left: -7px; box-shadow: 0 0 0 2px #fff; }
.avatar-stack .avatar:first-child { margin-left: 0; }

.form-grid { display: grid; gap: 15px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }

/* ===================== 周报汇总 / 下周安排 ===================== */

.muted { color: var(--text-3); }
.pre { white-space: pre-wrap; font-size: 13px; line-height: 1.62; color: var(--text-2); }

/* ---- 汇总页：文档式版式（对齐线下《工作周报》表格） ---- */
.doc-sheet { display: flex; flex-direction: column; gap: 16px; }
.doc-head {
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  padding: 18px 20px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.doc-head h1 { font-size: 19px; letter-spacing: -.01em; }
.doc-meta { display: flex; gap: 20px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); margin-top: 7px; }
.doc-meta b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.doc-badges { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.doc-kpis { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }

table.table-doc td { vertical-align: top; }
table.table-doc td.proj-cell { background: var(--surface-2); border-right: 1px solid var(--border); }
.proj-cell-in { display: flex; flex-direction: column; gap: 7px; }
.proj-stat { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--text-3); }
.proj-stat b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.risk-txt { color: #b91c1c; font-weight: 600; }

.pcell { display: flex; align-items: center; gap: 7px; }
.pcell .progress-line { flex: 1; min-width: 38px; }
.pcell .pv { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* ---- 问题与建议 ---- */
.issue-list { display: flex; flex-direction: column; gap: 10px; }
.issue-item {
  border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm); padding: 11px 13px; background: var(--surface-2);
}
.issue-item.warn { border-left-color: var(--warn); background: var(--warn-soft); border-color: #f6e2bd; }
.issue-item.danger { border-left-color: var(--danger); background: var(--danger-soft); border-color: #f8d7d7; }
.issue-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
.issue-hd .grow { flex: 1; }
.issue-txt { font-size: 13.5px; line-height: 1.7; color: var(--text); white-space: pre-wrap; }
.issue-sub { font-size: 12px; color: var(--text-3); margin-top: 5px; }

/* ---- 下周计划列表 ---- */
.plan-list { display: flex; flex-direction: column; }
.plan-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 11px 16px; border-bottom: 1px solid #f0f3f8;
}
.plan-item:last-child { border-bottom: 0; }
.plan-who { display: flex; align-items: center; gap: 8px; min-width: 152px; flex: 0 0 auto; }
.plan-what { flex: 1; min-width: 0; }
.plan-txt { font-size: 13.5px; line-height: 1.65; }
.plan-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.plan-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; min-width: 170px; }

.overall-plan {
  background: var(--primary-soft); border: 1px solid #d3e0ff; border-radius: var(--radius-sm);
  padding: 9px 11px; font-size: 13px; line-height: 1.7; color: #1e40af; white-space: pre-wrap;
}
.overall-plan span {
  display: inline-block; font-size: 11px; font-weight: 600; background: #fff;
  border-radius: 999px; padding: 1px 7px; margin-right: 7px; vertical-align: 1px;
}

/* ---- 下周安排「按人看」：每人一张卡片 ---- */
/* 卡片左侧色条用成员头像色（--pc-accent），与「按项目看」的项目色条互为镜像，
   让「这是谁」和「这是哪个项目」在同一页里用同一套视觉语言区分。 */
.pc-summary { font-size: 12.5px; color: var(--text-3); padding: 0 2px 2px; }
.pc-summary b { color: var(--text-2); font-variant-numeric: tabular-nums; }
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 14px; align-items: start; }
.person-card { border-left: 3px solid var(--pc-accent, var(--primary)); }
/* 卡头允许换行：窄卡片（或手机上）时徽章组整体落到第二行，不会被压扁 */
.person-card .card-hd { flex-wrap: wrap; row-gap: 6px; }
.person-card .card-hd h3 { font-size: 15px; flex: 0 0 auto; }
.person-card .card-hd .sub { flex: 0 0 auto; }
.person-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-left: auto; }
.pc-overall { padding: 12px 16px 0; }
.pc-list { display: flex; flex-direction: column; }
.pc-item { padding: 11px 16px; border-bottom: 1px solid #f0f3f8; }
.pc-item:last-child { border-bottom: 0; }
.pc-item-hd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 5px; }
.pc-item-hd .proj-tag { min-width: 0; }
.pc-item-hd .grow { flex: 1 1 12px; }
.pc-item-hd .pcell .progress-line { flex: 0 0 52px; }
.pc-empty { padding: 14px 16px; font-size: 12.5px; color: var(--text-3); }

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-row .chip { cursor: default; }
.chip-row .chip small { color: var(--text-3); font-size: 11.5px; }

/* ---- 下周安排页 ---- */
.nw-arrow { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nw-week { display: flex; flex-direction: column; line-height: 1.35; }
.nw-week small { font-size: 11.5px; color: var(--text-3); }
.nw-week strong { font-size: 14.5px; }
.nw-week span { font-size: 12px; }
.nw-week.next { padding: 7px 13px; border-radius: var(--radius-sm); background: var(--primary-soft); }
.nw-week.next strong { color: var(--primary-dark); }

.nw-mini { display: flex; flex-direction: column; }
.nw-mini-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px dashed var(--border); font-size: 13px;
}
.nw-mini-row:last-child { border-bottom: 0; }
.nw-mini-plans { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }

.clickable-hd { cursor: pointer; transition: background .12s; }
.clickable-hd:hover { background: #f1f4f9; }
.detail-text { font-size: 13.5px; line-height: 1.75; color: #334155; white-space: pre-wrap; }

/* ===================== 响应式 ===================== */

/* 登录页：窄屏收起品牌区，只留表单 */
@media (max-width: 980px) {
  .login-panel { grid-template-columns: minmax(0, 1fr); }
  .login-aside { display: none; }
  .login-main { padding: 40px 24px; }
  .login-mobile-brand { display: flex; }
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-1-2 { grid-template-columns: minmax(0, 1fr); }
  .entry-row { grid-template-columns: 1fr 1fr; }
  .entry-grid { grid-template-columns: minmax(0, 1fr); }
  .doc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .only-mobile { display: inline-flex; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  /* 抽屉展开时，遮罩铺满右侧空白区，点一下即收起 */
  .scrim {
    display: block; position: fixed; inset: 0; z-index: 25;
    background: rgba(15, 23, 42, .44);
    opacity: 0; pointer-events: none; transition: opacity .22s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .brand .icon-btn { margin-left: auto; }
  /* KPI 类网格在手机上保持两列（比单列省一半高度），表单类网格才降到一列 */
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-2-1, .grid-1-2 { grid-template-columns: minmax(0, 1fr); }
  .doc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 16px 14px 40px; }
  /* 顶栏：标题占一行不换行，操作按钮另起一行，避免挤成四行 */
  .topbar { padding: 10px 14px; flex-wrap: wrap; row-gap: 8px; }
  .topbar-title { flex: 1 1 auto; }
  .topbar-title h2 { font-size: 15.5px; white-space: nowrap; }
  .topbar-sub { display: none; }
  .topbar-actions { margin-left: 0; width: 100%; gap: 6px; }
  .topbar-actions .btn { font-size: 12.5px; padding: 6px 10px; }
  .topbar-actions .week-select { flex: 1 1 auto; min-width: 0; }
  .plan-item { flex-direction: column; gap: 8px; }
  .plan-meta { justify-content: flex-start; }
  .plan-who, .plan-meta { min-width: 0; }
  .doc-head { padding: 14px 15px; }
  .card-hd { padding: 12px 14px; flex-wrap: wrap; }
  .card-bd { padding: 13px; }
  .kpi { padding: 12px 13px; }
  .kpi-value { font-size: 20px; }
  .kpi-foot { font-size: 11.5px; }
  .doc-sheet { gap: 12px; }
  /* 下周安排「按人看」：窄屏单列铺开，卡片内边距与页面其它卡片对齐（13px） */
  .person-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pc-overall { padding: 11px 13px 0; }
  .pc-item { padding: 10px 13px; }
  .pc-empty { padding: 12px 13px; }
  /* 列表行（周报明细 / 历史周报）：三段各占一行，杜绝互相压盖 */
  .list-row .row-lead { width: auto; flex: 1 1 100%; }
  .list-row .row-body { flex: 1 1 100%; }
  .list-row .row-meta { flex: 1 1 100%; margin-left: 0; row-gap: 6px; }
  .list-row .row-meta > :last-child { margin-left: auto; }
  .list-row .row-hours { width: auto; text-align: left; }
  .report-projs { margin-top: 5px; }
}

/* ============================================================
   窄屏：把宽表格「卡片化」
   ------------------------------------------------------------
   表格里 6~8 列在手机上必然要横向拖动、文字被压成竖排。
   这里在 ≤760px 时整表改为卡片堆叠：
     · thead 隐藏，每个 <tr> 变成一张卡片
     · 每个 <td> 前用 data-label 显示字段名（由 ui.js decorateTables 自动补齐）
     · rowspan 单元格（项目/成员）作为卡片内的色带标题
   ============================================================ */
@media (max-width: 760px) {
  .table-wrap { overflow-x: visible; }
  .card-bd.tight > .table-wrap { padding: 12px; }
  .card-bd.tight > .table-wrap > table { padding: 0; }

  /* ---- 表单控件：窄屏收紧一号 ---- */
  /* 下拉的外壳已经换成自绘控件（见上方「下拉选择器」一节），触发器尺寸在
     那里统一控制；这几条只兜底「万一没被增强的原生 select」不至于走形 */
  .select { font-size: 13px; padding: 7px 30px 7px 10px; background-position: right 10px center; background-size: 11px; }
  .input, .textarea { font-size: 13px; padding: 7px 10px; }
  /* 与自绘下拉触发器（40px）对齐：同一行里高度不齐会很明显，触屏也更好点 */
  .input, .textarea { min-height: 40px; }
  .input-sm { min-height: 0; }
  /* 筛选条件：等宽铺满一行（3 个筛选正好一行），不再是内联 min-width 撑出来的参差宽度 */
  .flt, .flt-md, .flt-lg { min-width: 92px; flex: 1 1 calc(33.333% - 8px); }
  .flt .select, .flt-md .select, .flt-lg .select { width: 100%; }

  table.table, table.table-doc { display: block; width: 100%; font-size: 13px; }
  table.table thead, table.table-doc thead { display: none; }
  table.table tbody, table.table-doc tbody { display: block; }

  table.table tbody tr, table.table-doc tbody tr {
    display: block; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 11px 12px; margin-bottom: 10px;
  }
  table.table tbody tr:last-child, table.table-doc tbody tr:last-child { margin-bottom: 0; }
  table.table tbody tr.clickable:hover { background: var(--surface); }

  /* 单元格 → 「字段名 + 值」两栏 */
  table.table td, table.table-doc td {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 5px 0; border: 0; text-align: left; vertical-align: top;
  }
  table.table td[data-label]::before, table.table-doc td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 74px; font-size: 11.5px; font-weight: 500; color: var(--text-3);
    line-height: 1.7; padding-top: 1px; text-align: left;
  }
  /* 有更短字段名时优先用它 */
  table.table td[data-short]::before, table.table-doc td[data-short]::before { content: attr(data-short); }
  table.table td > *, table.table-doc td > * { min-width: 0; }
  table.table td > .pcell, table.table-doc td > .pcell { flex: 1 1 auto; }
  /* 数字列在卡片里按「字段名 + 值」左对齐排列（否则 text-align:right 会把字段名推到标签框右边缘） */
  table.table td.num, table.table-doc td.num { justify-content: flex-start; text-align: left; }
  table.table td.nowrap, table.table-doc td.nowrap { white-space: normal; }

  /* 空单元格不占位 */
  table.table td:empty, table.table-doc td:empty { display: none; }

  /* 表头为空、也没有 label 的列（例如行尾的「›」箭头）在卡片里没有意义，整列隐藏 */
  table[data-labels] td:not([data-label]):not([data-blockhead]) { display: none; }

  /* 卡片里的操作按钮组：左对齐、允许换行。
     按钮组带内联的 justify-content:flex-end（桌面端右对齐用），
     内联样式优先级高于选择器，所以这里必须加 !important 才能覆盖。 */
  table[data-labels] td.td-actions > div { flex-wrap: wrap; justify-content: flex-start !important; }

  /* 头像堆叠在窄屏缩小一号字，避免姓名首字被裁掉 */
  .avatar-stack .avatar { font-size: 9px; }

  /* 排序箭头在卡片里徒增高度，窄屏隐藏（顺序仍可在桌面端调整） */
  .order-btns { display: none; }

  /* 「本周 → 下周」在窄屏竖排，箭头转为向下 */
  .nw-arrow { flex-direction: column; align-items: stretch; gap: 10px; }
  .nw-arrow > svg { align-self: center; transform: rotate(90deg); }

  /* Tab 铺满一行，便于点按 */
  .tabs { display: flex; width: 100%; }
  .tabs .tab { flex: 1; }

  /* 表单字段名与说明：允许换行，说明文字另起一行，避免把字段名挤成两行 */
  .field-label { flex-wrap: wrap; }
  .field-label .hint { flex: 1 1 100%; font-size: 11px; }
  /* 工作项表头允许换行，别把项目名压成竖排 */
  .entry-hd { flex-wrap: wrap; row-gap: 6px; }
  .entry-hd .proj-tag { flex: 0 0 auto; }
  .entry-hd .grow { min-width: 0; }

  /* rowspan 单元格（项目 / 成员）→ 卡片内的通栏色带标题，不显示字段名 */
  table.table-doc td.proj-cell,
  table.table-doc td.member-cell,
  table.table-doc td[data-blockhead],
  table.table td[data-blockhead] { display: block; }
  table.table-doc td.proj-cell::before,
  table.table-doc td.member-cell::before,
  table.table-doc td[data-blockhead]::before,
  table.table td[data-blockhead]::before { content: none; }

  table.table-doc td.proj-cell {
    margin: -11px -12px 8px; padding: 10px 12px;
    background: var(--surface-2);
    border: 0; border-bottom: 1px solid var(--border); border-left: 3px solid var(--primary);
    border-radius: 0;
  }
  table.table-doc td.proj-cell:first-child {
    border-radius: calc(var(--radius-sm) - 1px) calc(var(--radius-sm) - 1px) 0 0;
  }
  table.table-doc td.member-cell {
    margin: 0 -12px 8px; padding: 9px 12px;
    background: #f7f9fd; border: 0; border-bottom: 1px solid var(--border);
  }
  table.table-doc td.member-cell:first-child {
    margin-top: -11px;
    border-radius: calc(var(--radius-sm) - 1px) calc(var(--radius-sm) - 1px) 0 0;
  }
  /* 项目单元格里的统计在窄屏改成横向流式，省高度 */
  table.table-doc td.proj-cell .proj-cell-in { gap: 6px; }
  table.table-doc td.proj-cell .proj-stat { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
}


/* ===================== 打印 / 导出 PDF ===================== */
/* 「周报汇总」页支持直接打印或另存为 PDF，用于线下归档与上报 */

@media print {
  @page { size: A4 landscape; margin: 11mm; }
  html, body { background: #fff; font-size: 11.5px; }
  .sidebar, .topbar, .toast-root, .modal-mask, .scrim, .no-print { display: none !important; }
  html, body { overflow: visible !important; }
  .app { display: block; min-height: 0; }
  .main { display: block; }
  .page { padding: 0; gap: 10px; }
  .doc-sheet { gap: 10px; }
  .card, .doc-head, .kpi { box-shadow: none; border-color: #d8dee8; break-inside: avoid; }
  .card { overflow: visible; }
  .card-bd.tight { padding: 0; }
  .table-wrap { overflow: visible; }
  table.table th { position: static; }
  .doc-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-value { font-size: 21px; }
  .toast, .modal-mask { display: none !important; }

  /* 下拉选择器：打印没有交互，回退成原生控件，
     否则打出来的是一个透明的数据节点（视觉上就是空白） */
  .sel > .sel-native { position: static; inset: auto; width: auto; height: auto; opacity: 1; pointer-events: auto; }
  .sel > .sel-btn { display: none !important; }
  .sel-menu, .sel-scrim { display: none !important; }

  /* 打印时必须还原成真表格：手机上打印时视口仍是窄屏，
     上面的「卡片化」规则同样会命中，但归档要的是表格版式。
     这里用 !important 保证打印样式不受源码顺序影响。 */
  table.table, table.table-doc { display: table !important; }
  table.table thead, table.table-doc thead { display: table-header-group !important; }
  table.table tbody, table.table-doc tbody { display: table-row-group !important; }
  table.table tr, table.table-doc tr { display: table-row !important; margin: 0 !important; padding: 0 !important; border: 0 !important; }
  table.table td, table.table-doc td { display: table-cell !important; padding: 10px 12px !important; }
  table.table td::before, table.table-doc td::before { content: none !important; }
  table.table-doc td.proj-cell, table.table-doc td.member-cell {
    margin: 0 !important; padding: 10px 12px !important;
    border: 0 !important; border-radius: 0 !important;
  }
  table.table-doc td.proj-cell { background: var(--surface-2) !important; border-right: 1px solid var(--border) !important; }
  table.table-doc td.member-cell { background: transparent !important; }
  table.table-doc td.proj-cell .proj-stat { flex-direction: column !important; }
}

