/* 风格沿用「技术中心 · 图纸计划周看板」（kanban/build_kanban.py） */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
:root {
  --bg: #b6ddf7; --card: #ffffff; --soft: #f7f9fc; --line: #edf0f5; --line2: #e3e8ef;
  --ink: #1f2329; --ink2: #4e5969; --muted: #86909c;
  --blue: #088ff5; --b-light: #8ccafb; --b-pale: #dff0fb;
  --good: #16c491; --warn: #f0b400; --bad: #f5484d;
  --cjk: "Times New Roman", "SimSun", "宋体", "Songti SC", "STSong", serif;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--cjk); color: var(--ink); font-size: 15px; line-height: 1.5; min-height: 100vh;
  background: radial-gradient(circle at 1px 1px, rgba(255,255,255,.35) 1.4px, transparent 0) 0 0 / 22px 22px,
              linear-gradient(170deg, #b3dbf7 0%, #c3e5f8 50%, #cbecf6 100%);
  background-color: #c3e5f8; background-attachment: fixed;
  padding: 16px 20px 24px; max-width: 1920px; margin: 0 auto;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
.muted { color: var(--muted); } .small { font-size: 13px; } .grow { flex: 1; }
.t-good { color: #0b9e6f; font-weight: 600; } .t-bad { color: #e0262c; font-weight: 600; } .t-warn { color: #d9730d; font-weight: 600; }

/* 横幅 */
.banner { position: relative; overflow: hidden; border-radius: 18px; padding: 14px 28px; min-height: 92px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 20px;
  background: linear-gradient(100deg, #e4effc 0%, #d9e8fb 30%, #c7e2ff 65%, #add2fe 100%); border: 1px solid #fff; }
.banner::after { content: ""; position: absolute; right: -60px; top: -80px; width: 420px; height: 300px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.55), rgba(255,255,255,0)); transform: rotate(-18deg); border-radius: 40px; }
.logo { height: 46px; max-width: 100%; object-fit: contain; object-position: left center; }
.titles { text-align: center; z-index: 1; }
.titles h1 { font-size: 32px; font-weight: 700; letter-spacing: 1px; line-height: 1.2;
  background: linear-gradient(90deg, #1836f3 0%, #483bf3 55%, #703ff5 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 1px #3a3af3; }
.titles p { margin-top: 4px; font-size: 16px; color: var(--ink2); }
.titles p b { color: var(--blue); }
.bmeta { justify-self: end; text-align: right; z-index: 1; color: var(--ink2); line-height: 1.9; }
.bmeta .rules span { margin-left: 12px; }

/* 标签 */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.chip.good { background: #e3f9ef; color: #0b9e6f; } .chip.warn { background: #fff6dc; color: #b07d00; }
.chip.bad { background: #ffe8e8; color: #e0262c; } .chip.info { background: #e6f3fe; color: #0a6cd8; }
.chip.none { background: #eef1f6; color: var(--muted); font-weight: 400; } .chip.violet { background: #f0ebff; color: #6a4de0; }
.chip.orange { background: #fff0e3; color: #d9730d; }
.chip.demo { background: #ffe8e8; color: #e0262c; font-size: 15px; padding: 3px 12px; border: 1px solid #ffc9cb; }

/* 导航条 */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.tabs { display: inline-flex; background: rgba(255,255,255,.65); border: 1px solid #fff; border-radius: 12px; padding: 4px; gap: 4px; }
.tab { border: 0; background: transparent; padding: 7px 20px; border-radius: 9px; font-size: 17px; font-weight: 600; color: var(--ink2); cursor: pointer; }
.tab.on { background: linear-gradient(135deg, #3ca4fa, #0a6cf0); color: #fff; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line2); background: #fff;
  padding: 6px 14px; border-radius: 10px; cursor: pointer; font-size: 15px; white-space: nowrap; color: var(--ink); }
.btn:hover { border-color: #b9d8f7; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #0a7fe0; }
.btn.ghost { background: rgba(255,255,255,.9); }
.btn.danger { background: #ffe8e8; border-color: #ffd2d4; color: #e0262c; }
.btn.sm { padding: 2px 9px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* 预警横幅 */
.alert { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #fff; border: 1px solid #ffd2d4; border-left: 6px solid var(--bad);
  border-radius: 14px; padding: 10px 16px; margin-bottom: 14px; font-size: 16px; }
.alert .grow { flex: 1; }

/* 面板 */
.view { display: block; }
.panel { background: #fff; border-radius: 18px; padding: 16px 18px 18px; border: 1px solid #fff; min-width: 0; }
.phead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ptitle { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; -webkit-text-stroke: .6px currentColor; }
.ptitle .psub { -webkit-text-stroke: 0; font-size: 15px; font-weight: 400; color: var(--muted); }
.pmark { flex: none; width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, #3ca4fa, #0a6cf0); position: relative; }
.pmark::after { content: ""; position: absolute; left: 6px; right: 6px; top: 6px; bottom: 6px;
  background: linear-gradient(#fff, #fff) 0 100% / 3px 45% no-repeat, linear-gradient(#fff, #fff) 50% 100% / 3px 100% no-repeat,
              linear-gradient(#fff, #fff) 100% 100% / 3px 70% no-repeat; }
.sub { background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.sub h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sub h3 small { font-weight: 400; color: var(--muted); font-size: 13px; }

/* 看板布局 */
.board { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
.board .full { grid-column: 1 / -1; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { background: linear-gradient(180deg, #f3f8fe, #e8f2fd); border: 1px solid #fff; border-radius: 14px; padding: 12px; display: flex; gap: 10px; align-items: flex-start; min-width: 0; overflow: hidden; cursor: default; }
.kpi[data-go] { cursor: pointer; } .kpi[data-go]:hover { box-shadow: 0 0 0 2px #b9d8f7 inset; }
.kicon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: #fff; } .kicon img { width: 44px; height: 44px; }
.kicon svg { width: 26px; height: 26px; }
.kicon.c-red { background: linear-gradient(135deg, #ff7a7e, #e0262c); } .kicon.c-violet { background: linear-gradient(135deg, #a07bff, #6a4de0); }
.kbody { min-width: 0; }
.klabel { font-size: 15px; color: var(--ink2); white-space: nowrap; }
.kval { font-size: 40px; line-height: 1.05; font-weight: 700; margin: 2px 0 4px; white-space: nowrap; }
.kval small { font-size: 16px; font-weight: 400; color: var(--ink2); margin-left: 4px; }
.kval.bad { color: #e0262c; } .kval.warn { color: #d9730d; }
.ksub { font-size: 14px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rate { position: relative; height: 34px; border-radius: 10px; background: #eef1f6; overflow: hidden; border: 1px solid var(--line); }
.rate .done { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #3ca4fa, #0a6cf0); }
.rate .over { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, #ffd2d4 0 6px, #ffe8e8 6px 12px); border-left: 2px solid var(--bad); }
.rate .lbl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; color: var(--ink); text-shadow: 0 0 4px #fff; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

.bars { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 2fr) 70px 56px; gap: 8px 10px; align-items: center; font-size: 15px; }
.bars .hd { color: var(--muted); font-size: 13px; }
.bars .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.bars .nm i { flex: none; width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.bars .track { position: relative; height: 10px; border-radius: 6px; background: var(--b-pale); overflow: hidden; }
.bars .track b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--blue); border-radius: 6px; }
.bars .num { text-align: right; white-space: nowrap; } .bars .rem { text-align: right; font-weight: 700; }
.bars .row { display: contents; cursor: pointer; }

.donutbox { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donutbox svg { flex: none; }
.dlist { display: flex; flex-direction: column; gap: 6px; font-size: 15px; min-width: 150px; flex: 1; }
.dlist div { display: flex; align-items: center; gap: 8px; } .dlist i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dlist b { margin-left: auto; font-size: 18px; } .dlist span.p { color: var(--muted); width: 44px; text-align: right; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { background: #f2f5f9; color: var(--ink2); font-weight: 600; padding: 7px 8px; text-align: center; white-space: nowrap; }
table.list td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: center; }
table.list th.l, table.list td.l { text-align: left; }
table.list td.nw { white-space: nowrap; }
table.list tr.click { cursor: pointer; } table.list tr.click:hover td { background: #f5faff; }
.mono { font-family: "Times New Roman", serif; white-space: nowrap; }
.tbl-scroll { overflow-x: auto; }

.aicard .text { font-size: 15px; line-height: 1.75; }
.md h4 { font-size: 16px; margin: 10px 0 4px; color: #1f5fe0; } .md h4:first-child { margin-top: 0; }
.md ul, .md ol { padding-left: 22px; margin: 2px 0 6px; } .md p { margin: 2px 0 6px; }
.md a.code { font-family: "Times New Roman", serif; font-weight: 600; }

/* 意见表 */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inp { border: 1px solid var(--line2); background: #fff; border-radius: 9px; padding: 5px 9px; font-size: 14px; min-width: 0; }
.toolbar input[type=search] { width: 280px; max-width: 100%; }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0; }
.gridwrap { overflow: auto; max-height: calc(100vh - 260px); min-height: 360px; border: 1px solid var(--line2); border-radius: 12px; background: #fff;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-x pan-y; }
.swipe-hint { display: none; }
table.grid { border-collapse: separate; border-spacing: 0; font-size: 14px; }
.grid th, .grid td { border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); padding: 5px 7px; background: #fff; }
.grid thead th { position: sticky; background: #f2f5f9; font-weight: 700; text-align: center; color: var(--ink); z-index: 2; white-space: nowrap; }
.grid thead tr:nth-child(1) th { top: 0; height: 32px; }
.grid thead tr:nth-child(2) th { top: 32px; height: 32px; }
.grid thead tr:nth-child(3) th { top: 64px; height: 30px; }
.grid thead th.g2 { background: #e5f4e3; } /* 图纸认可阶段（同模板绿色） */
.grid thead th.calc { background: #e7e6e6; }
.grid .sl { position: sticky; z-index: 1; } .grid thead .sl { z-index: 3; } .grid thead th[data-k=code] { z-index: 4; }
.grid td { vertical-align: middle; }
.grid td.long { vertical-align: middle; text-align: justify; text-justify: inter-character; word-break: break-word; }
.grid td.ed { cursor: text; } .grid td.ed:hover { background: #f5faff; }
.grid td.sel { cursor: pointer; } .grid td.sel:hover { background: #f5faff; }
.grid td.calc { background: #f7f7f7; }
.grid td.c { text-align: center; }
.grid td[data-k=agreement], .grid td[data-k=maker] { white-space: nowrap; }
.grid td.long .l1 { font-weight: 600; }
.grid td.long .rest { white-space: pre-line; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.grid tr.flash td { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background: #fff3b0; } 100% { background: inherit; } }
.grid td.editing { padding: 0; }
.grid td.editing input, .grid td.editing select { width: 100%; height: 100%; min-height: 32px; border: 2px solid var(--blue); border-radius: 0; padding: 4px 6px; background: #fff; outline: none; }
.grid td.err input { border-color: var(--bad); }
.grid .dw-ok { color: #0b9e6f; font-weight: 700; } .grid .dw-miss { background: #ffe8e8; color: #e0262c; font-weight: 700; padding: 0 6px; border-radius: 6px; }
.grid .dw-na { color: var(--muted); }
.aib { display: inline-flex; gap: 4px; align-items: center; margin-top: 4px; font-size: 12px; }
.aib .btn { padding: 0 6px; font-size: 12px; }
.rowact { white-space: nowrap; display: flex; gap: 4px; justify-content: center; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* AI 页 */
.aigrid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.aigrid .panel { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.outbox { background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-height: 60px; }
.remind { display: flex; flex-direction: column; gap: 10px; }
.remind .item { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.remind .to { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 4px; }
.qa { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow: auto; }
.qa .q { align-self: flex-end; background: #e6f3fe; border-radius: 12px 12px 2px 12px; padding: 7px 12px; max-width: 85%; }
.qa .a { align-self: flex-start; background: var(--soft); border: 1px solid var(--line); border-radius: 12px 12px 12px 2px; padding: 8px 12px; max-width: 95%; }
textarea.inp { width: 100%; resize: vertical; line-height: 1.6; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid #b9d8f7; border-top-color: var(--blue); border-radius: 50%; animation: sp .8s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg); } }

/* 弹窗 / 提示 */
.modal { position: fixed; inset: 0; background: rgba(20, 40, 70, .35); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.mbox { background: #fff; border-radius: 18px; width: min(760px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.mhead { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 18px; }
.mbody { padding: 14px 18px 18px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: #1f2329; color: #fff; padding: 9px 18px; border-radius: 12px; z-index: 60; max-width: calc(100vw - 32px); font-size: 15px; }
.toast.bad { background: #e0262c; }
.foot { margin-top: 16px; text-align: center; color: var(--ink2); font-size: 13px; }

/* 自适应 */
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .board, .aigrid { grid-template-columns: minmax(0, 1fr); }
  .banner { grid-template-columns: minmax(0, 1fr); text-align: center; justify-items: center; gap: 8px; }
  .bmeta { justify-self: center; text-align: center; }
  .logo { object-position: center; }
}
@media (max-width: 900px) {
  .grid .sl:not([data-k=code]) { left: auto !important; }
  .grid tbody .sl:not([data-k=code]) { position: static; }
  .grid tbody td[data-k=code] { box-shadow: 2px 0 4px -2px rgba(31,35,41,.18); }
  .swipe-hint { display: block; font-size: 13px; color: var(--blue); margin: 0 0 6px; }
}
@media (max-width: 640px) {
  body { padding: 10px 16px 18px; font-size: 14px; }
  .banner { padding: 14px 14px; }
  .titles h1 { font-size: min(26px, calc((100vw - 64px) / 15.2)); white-space: nowrap; letter-spacing: 0; -webkit-text-stroke-width: .6px; } .titles p { font-size: 13px; }
  .logo { height: 30px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kval { font-size: 30px; } .kicon, .kicon img { width: 32px; height: 32px; }
  .tab { padding: 6px 12px; font-size: 15px; }
  .panel { padding: 12px; border-radius: 14px; }
  .bars { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 56px 40px; font-size: 14px; }
  .gridwrap { max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); min-height: 300px; }
  .toolbar input[type=search] { width: 100%; }
  .ptitle { font-size: 19px; flex-wrap: wrap; row-gap: 0; white-space: nowrap; }
  .ptitle .psub { flex-basis: 100%; margin-left: 34px; font-size: 13px; white-space: normal; }
}
