/* ============================================================
   项目管理 pm — 样式
   内部工业系统，信息密度优先。不做好看的动画，只做看得清的层级。
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --bg:        #F5F6F8;
  --card:      #FFFFFF;
  --line:      #E4E7EC;
  --line-2:    #D0D5DD;
  --text:      #1D2939;
  --text-2:    #475467;
  --muted:     #667085;
  --faint:     #98A2B3;
  --brand:     #185FA5;
  --brand-2:   #E6F1FB;
  --brand-6:   #0C447C;
  --ok:        #1D9E75;
  --ok-2:      #E1F5EE;
  --warn:      #B54708;
  --warn-2:    #FEF0E6;
  --danger:    #B42318;
  --danger-2:  #FEE4E2;
  --radius:    10px;
  --radius-sm: 7px;
  --shadow:    0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.14);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------- 应用外壳 */
.shell { display: flex; min-height: 100vh; }

.side {
  width: 208px; flex: 0 0 208px;
  background: #101828;
  color: #CFD6E0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side__brand {
  padding: 18px 18px 14px;
  font-size: 15px; font-weight: 600; color: #fff;
  letter-spacing: .2px;
}
.side__brand span { display: block; font-size: 11px; font-weight: 400;
  color: #7D8899; margin-top: 3px; letter-spacing: .4px; }
.side__nav { flex: 1; overflow-y: auto; padding: 6px 10px 16px; }
.side__grp {
  font-size: 11px; color: #6A7686; padding: 14px 8px 6px;
  letter-spacing: .6px;
}
.side__a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 7px;
  color: #C3CBD6; font-size: 13.5px; cursor: pointer;
  margin-bottom: 2px; text-decoration: none;
}
.side__a:hover { background: #1B2434; color: #fff; text-decoration: none; }
.side__a.on { background: var(--brand); color: #fff; font-weight: 500; }
.side__a i { width: 16px; text-align: center; font-style: normal;
  opacity: .85; font-size: 13px; }
.side__n {
  margin-left: auto; background: #344054; color: #D6DCE5;
  font-size: 11px; padding: 1px 6px; border-radius: 20px; min-width: 20px;
  text-align: center;
}
.side__a.on .side__n { background: rgba(255,255,255,.22); color: #fff; }
.side__foot {
  border-top: 1px solid #1F2937; padding: 12px 14px;
  font-size: 12px; color: #8B95A5;
}
.side__foot b { display: block; color: #E4E7EC; font-size: 13px;
  font-weight: 500; margin-bottom: 1px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.top {
  height: 56px; background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  position: sticky; top: 0; z-index: 20;
}
.top h1 { font-size: 15px; font-weight: 600; margin: 0; white-space: nowrap; }
.top__sub { font-size: 12px; color: var(--faint); }
.top__sp { flex: 1; }

.body { padding: 20px; flex: 1; }
.body--tight { padding: 14px 20px 20px; }

/* ---------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: #fff; color: var(--text);
  font-size: 13.5px; font-family: inherit; cursor: pointer;
  white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: #F9FAFB; border-color: #B4BCC8; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--pri:hover { background: var(--brand-6); border-color: var(--brand-6); }
.btn--danger { color: var(--danger); border-color: #F3B7B2; background: #fff; }
.btn--danger:hover { background: var(--danger-2); }
.btn--ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn--ok:hover { filter: brightness(.94); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: #F2F4F7; }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn--xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn--blk { width: 100%; }

/* ---------------------------------------------------------- 表单 */
.inp, .sel, .ta {
  width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit; color: var(--text);
  background: #fff; outline: none; transition: border-color .12s, box-shadow .12s;
}
.inp:focus, .sel:focus, .ta:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(24,95,165,.12);
}
.ta { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical;
  line-height: 1.6; }
.sel { appearance: none; background-image:
  url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' fill='none' stroke='%23667085' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 28px; }
.inp::placeholder, .ta::placeholder { color: var(--faint); }

.field { margin-bottom: 12px; }
.field > label {
  display: block; font-size: 12px; color: var(--muted);
  margin-bottom: 5px; font-weight: 500;
}
.field__hint { font-size: 11.5px; color: var(--faint); margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ---------------------------------------------------------- 卡片 */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card__hd {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.card__hd h2 { font-size: 13.5px; font-weight: 600; margin: 0; }
.card__hd .sp { flex: 1; }
.card__bd { padding: 16px; }
.card__bd--flush { padding: 0; }

/* ---------------------------------------------------------- KPI */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 16px; }
.kpi {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.kpi b { display: block; font-size: 24px; font-weight: 600;
  letter-spacing: -.5px; line-height: 1.2; }
.kpi span { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------- 徽章 */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 21px; padding: 0 7px; border-radius: 5px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.tag--type { color: #fff; }
.tag--state { border: 1px solid transparent; }
.tag--pri { font-size: 11px; padding: 0 6px; border-radius: 4px; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

/* ---------------------------------------------------------- 表格 */
.tb { width: 100%; border-collapse: collapse; }
.tb th {
  text-align: left; font-size: 11.5px; font-weight: 500; color: var(--muted);
  padding: 9px 12px; border-bottom: 1px solid var(--line);
  background: #FAFBFC; white-space: nowrap;
}
.tb td {
  padding: 11px 12px; border-bottom: 1px solid #F0F2F5;
  font-size: 13px; vertical-align: middle;
}
.tb tbody tr { cursor: pointer; }
.tb tbody tr:hover { background: #FAFBFC; }
.tb tbody tr:last-child td { border-bottom: none; }
.tb .t { font-weight: 500; color: var(--text); }
.tb .muted { color: var(--muted); font-size: 12px; }
.tb .no { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px; color: var(--muted); }

/* 列宽统一写在这里，不要再往 <th style="width:..."> 里塞。
   行内样式的优先级压过整张样式表，手机上想把某列改窄、或者干脆不显示，
   样式表怎么写都盖不住 —— 之前窄屏标题被压成"一字一行"就是栽在这上面
   （行内 4 列宽度 64+90+90+110 把 300px 的表几乎占满，标题只剩 36px）。 */
.tb-list .c1 { width: 64px; }
.tb-list .c3 { width: 110px; }
.tb-list .c4 { width: 90px; }
.tb-list .c5 { width: 90px; }
.tb-list .c6 { width: 126px; }
.tb-list .c7 { width: 82px; }
.tb-ad .a3, .tb-ad .a4, .tb-ad .a6, .tb-ad .a8 { width: 96px; }
.tb-ad .a7 { width: 104px; }
/* 账号管理列多，手机放不下就让它横向滚，别把字挤成一字一行 */
.card--scroll { overflow: hidden; }

/* ---------------------------------------------------------- 页签 */
.tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 0;
  border-bottom: 1px solid var(--line); margin-bottom: 0; }
.tabs button {
  border: none; background: transparent; font-family: inherit;
  font-size: 13px; color: var(--muted); padding: 9px 12px 11px;
  cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand);
  font-weight: 500; }
.tabs button i {
  font-style: normal; font-size: 11px; background: #EEF1F5; color: var(--muted);
  padding: 0 5px; border-radius: 10px; min-width: 18px; text-align: center;
}
.tabs button.on i { background: var(--brand-2); color: var(--brand); }

/* ---------------------------------------------------------- 看板 */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px;
  align-items: flex-start; }
.col { flex: 0 0 254px; width: 254px; background: #EDEFF2;
  border-radius: var(--radius); padding: 8px; }
.col__hd { display: flex; align-items: center; gap: 7px; padding: 4px 6px 9px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.col__hd .n { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.col__body { display: flex; flex-direction: column; gap: 7px;
  min-height: 40px; }
.mcard {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 11px; cursor: pointer; box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.mcard:hover { border-color: #B4BCC8; }
.mcard__top { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.mcard__t { font-size: 12.8px; font-weight: 500; line-height: 1.45;
  margin-bottom: 6px; color: var(--text); }
.mcard__f { display: flex; align-items: center; gap: 8px; font-size: 11px;
  color: var(--faint); }

/* ---------------------------------------------------------- 空状态 */
.empty { text-align: center; padding: 44px 20px; color: var(--faint);
  font-size: 13px; }
.empty b { display: block; color: var(--muted); font-size: 14px;
  font-weight: 500; margin-bottom: 5px; }

/* ---------------------------------------------------------- 弹层 */
.mask {
  position: fixed; inset: 0; background: rgba(16,24,40,.42);
  display: none; z-index: 60;
}
.mask.on { display: block; }
.dlg {
  position: fixed; z-index: 61; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 60px);
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  display: none; flex-direction: column;
}
.dlg.on { display: flex; }
.dlg__hd {
  padding: 16px 20px 12px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.dlg__hd h3 { margin: 0; font-size: 15px; font-weight: 600; }
.dlg__bd { padding: 18px 20px; overflow-y: auto; flex: 1; }
.dlg__ft {
  padding: 12px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end; background: #FCFCFD;
  border-radius: 0 0 14px 14px;
}
.dlg--wide { width: min(960px, calc(100vw - 40px)); }

/* ---------------------------------------------------------- toast */
#toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(16px);
  background: #101828; color: #fff; padding: 9px 18px; border-radius: 8px;
  font-size: 13px; opacity: 0; pointer-events: none; z-index: 99;
  transition: opacity .18s, transform .18s; max-width: 82vw;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }

/* ---------------------------------------------------------- 登录页 */
.login {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 24px;
  background: #101828;
  background-image:
    radial-gradient(900px 520px at 18% -8%, rgba(24,95,165,.34), transparent 62%),
    radial-gradient(760px 460px at 92% 106%, rgba(29,158,117,.22), transparent 60%);
}
.login__box {
  width: min(432px, 100%); background: #fff; border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.34); overflow: hidden;
}
.login__hd { padding: 30px 30px 22px; text-align: center; }
.login__hd h1 { font-size: 19px; margin: 0 0 5px; font-weight: 600;
  letter-spacing: -.2px; }
.login__hd p { margin: 0; font-size: 12.5px; color: var(--muted); }
.login__bd { padding: 0 30px 26px; }

.portals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 20px; }
.portal {
  border: 1.5px solid var(--line-2); border-radius: 11px; padding: 14px 12px;
  cursor: pointer; text-align: center; background: #fff;
  transition: border-color .14s, background .14s;
}
.portal:hover { border-color: #9AA4B2; background: #FAFBFC; }
.portal.on { border-color: var(--brand); background: var(--brand-2); }
.portal b { display: block; font-size: 14px; font-weight: 600;
  margin-bottom: 2px; color: var(--text); }
.portal.on b { color: var(--brand-6); }
.portal span { font-size: 11.5px; color: var(--muted); line-height: 1.4;
  display: block; }
.portal__ic { font-size: 19px; margin-bottom: 6px; opacity: .8; }

.login__err {
  background: var(--danger-2); color: var(--danger); border-radius: 8px;
  padding: 9px 12px; font-size: 12.5px; margin-bottom: 14px; display: none;
}
.login__err.on { display: block; }
.login__tip {
  font-size: 11.5px; color: var(--faint); text-align: center;
  margin-top: 16px; line-height: 1.6;
}

/* ---------------------------------------------------------- 工具 */
.hstack { display: flex; align-items: center; gap: 8px; }
.vstack { display: flex; flex-direction: column; gap: 8px; }
.sp { flex: 1; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.hr { height: 1px; background: var(--line); margin: 14px 0; }
.hide { display: none !important; }

/* ---------------------------------------------------------- 响应式 */
@media (max-width: 900px) {
  .side { width: 60px; flex-basis: 60px; }
  .side__brand { padding: 16px 0; text-align: center; font-size: 12px; }
  .side__brand span, .side__grp, .side__a span, .side__foot b { display: none; }
  .side__a { justify-content: center; padding: 10px 0; }
  .side__a i { width: auto; font-size: 16px; }
  .side__n { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .body { padding: 14px; }
  .row2, .row3 { grid-template-columns: 1fr; }
}

/* ============================================================ 详情页 */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 316px;
  gap: 14px; align-items: start; }
@media (max-width: 1040px) {
  .detail { grid-template-columns: 1fr; }
  .detail__side { order: -1; }
}

.dhead { padding: 17px 20px 15px; }
.dhead__top { display: flex; align-items: center; gap: 8px;
  margin-bottom: 9px; flex-wrap: wrap; }
.dhead__t { font-size: 18.5px; font-weight: 600; line-height: 1.42; margin: 0 0 9px;
  letter-spacing: -.2px; }
.dhead__m { font-size: 11.8px; color: var(--faint); display: flex; gap: 12px;
  flex-wrap: wrap; align-items: center; }

.kvs { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 12px 18px; }
.kv { font-size: 13px; min-width: 0; }
.kv > span { display: block; font-size: 11.5px; color: var(--faint);
  margin-bottom: 1px; }
.kv > b { font-weight: 500; word-break: break-word; }

.prose { font-size: 13.6px; line-height: 1.74; white-space: pre-wrap;
  word-break: break-word; color: var(--text); }
.prose--empty { color: var(--faint); font-size: 13px; }

.cmt { display: flex; gap: 10px; padding: 13px 16px;
  border-top: 1px solid #F0F2F5; }
.cmt:first-child { border-top: none; }
.cmt__av { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
  background: #EEF1F5; color: var(--text-2); display: flex;
  align-items: center; justify-content: center; font-size: 12px;
  font-weight: 500; }
.cmt__b { flex: 1; min-width: 0; }
.cmt__h { font-size: 11.8px; color: var(--muted); margin-bottom: 4px; }
.cmt__h b { color: var(--text); font-weight: 500; }
.cmt__t { font-size: 13.2px; line-height: 1.66; white-space: pre-wrap;
  word-break: break-word; }
.cmt--sys { background: #FAFBFC; }
.cmt--sys .cmt__t { color: var(--text-2); font-size: 12.6px; }

.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px; }
.wall > a, .wall > .fitem { display: block; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; aspect-ratio: 1; position: relative;
  background: #FAFBFC; text-decoration: none; }
.wall img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wall .fitem { display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; padding: 8px; text-align: center; }
.wall .fname { font-size: 10.5px; color: var(--muted); word-break: break-all;
  line-height: 1.3; max-height: 2.7em; overflow: hidden; }
.wall .fext { font-size: 11px; color: var(--faint); font-weight: 500; }
.wall .fdel { position: absolute; right: 3px; top: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: rgba(0,0,0,.52); color: #fff; border: none;
  cursor: pointer; font-size: 11px; line-height: 1; padding: 0; }

.side-act { display: flex; flex-direction: column; gap: 7px; }
.lnk { display: flex; align-items: center; gap: 7px; padding: 8px 0;
  border-top: 1px solid #F0F2F5; cursor: pointer; }
.lnk:first-child { border-top: none; }
.lnk:hover .lnk__t { text-decoration: underline; }
.lnk__t { font-size: 12.6px; flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }

.composer { padding: 12px 16px; border-top: 1px solid var(--line);
  background: #FCFCFD; }
.composer textarea { min-height: 66px; }

/* 窄屏：品牌只留 PM，用户区只留「退出」。
   不这么处理，"项目管理"四个字会在 60px 宽的侧栏里竖排成两行，
   底部「管理员 · 管理员」也会断成三行，看着像坏了。 */
@media (max-width: 900px) {
  .side__brand { font-size: 0; padding: 15px 0; }
  .side__brand::before {
    content: "PM"; font-size: 13px; font-weight: 600; color: #fff;
    letter-spacing: .5px;
  }
  .side__who { display: none; }
  .side__foot { padding: 10px 0; text-align: center; }
  .side__foot a { font-size: 11px !important; }
}

/* 窄屏表格：七列在 390px 里放不下，会挤成"陈/琪""DMT-/16P"这种一字一行。
   手机上只留 类型 / 标题 / 指派 / 状态 四列，机型提出更新先不显示 ——
   点进详情页全都有，列表页首要任务是"能一眼扫过去"。

   注意 `table-layout: fixed` 是必须的，不能只写 display:none 就完事：
   自动布局下浏览器按"最小内容宽度"分配空间，标题允许 break-word ⇒ 最小宽度
   正好是 1 个字，而状态列里两个 tag 是 nowrap ⇒ 最小宽度很大。结果标题被压成
   一字一行、整个表格还横向溢出。改成固定布局并给三列写死宽度，标题拿走剩下的。 */
@media (max-width: 900px) {
  .top__sub { display: none; }
  #fModel { display: none; }
  /* 1 类型 / 2 标题 / 5 指派 / 6 状态 留下；机型(3) 提出(4) 更新(7) 让位 */
  .tb-list th:nth-child(3), .tb-list td:nth-child(3),
  .tb-list th:nth-child(4), .tb-list td:nth-child(4),
  .tb-list th:nth-child(7), .tb-list td:nth-child(7) { display: none; }
  .tb-list { table-layout: fixed; }
  .tb td { padding: 9px 8px; word-break: break-word; }
  .tb th { padding: 8px; }
  /* 剩下的三列把宽度压到最小，标题拿走其余全部空间 */
  .tb-list .c1 { width: 50px; }
  .tb-list .c5 { width: 54px; }
  .tb-list .c6 { width: 68px; }
  /* 固定宽度里放不下的两个标签允许换行，总比横向溢出好 */
  .tb-list td:nth-child(6) .tag { margin: 0 0 3px 0; }
  .tb .no { font-size: 10.5px; }
  /* 账号管理：留 姓名 / 账号 / 部门 / 状态 / 操作，其余让位 */
  .tb-ad th:nth-child(4), .tb-ad td:nth-child(4),
  .tb-ad th:nth-child(5), .tb-ad td:nth-child(5),
  .tb-ad th:nth-child(7), .tb-ad td:nth-child(7) { display: none; }
  .tb-ad { table-layout: fixed; }
  .tb-ad .a3, .tb-ad .a6, .tb-ad .a8 { width: 66px; }
  .card--scroll { overflow-x: auto; }
  .filterbar { padding: 10px 12px; gap: 6px; }
  .filterbar .inp { width: 100%; }
  .agrid { grid-template-columns: 1fr; padding: 12px; }
  .kpis { gap: 9px; }
  .kpi b { font-size: 21px; }
}
