/* 工作台原型：共享壳 + 三个方向的布局。
   颜色、字、间距、圆角全部走 tokens.css；不在这里发明新值。 */

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-body)/var(--lh-body) var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }

/* 方向标注条：不属于产品界面，给用户比较用 */
.dirbar {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--island);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--t2);
  position: sticky;
  top: 0;
  z-index: 50;
  white-space: nowrap;
  overflow: hidden;
}
.dirbar b { color: var(--text); font-weight: 600; }
.dirbar .sep { color: var(--t3); }
.dirbar .note { margin-left: auto; color: var(--t3); }

/* 桌面壳：导航岛 60 + 内容 + 辅助岛 360；方向稿扣掉 44px 标注条 */
.shell {
  height: calc(100vh - 44px);
  min-height: calc(100vh - 44px);
}

/* 最终页面：28px 窗口拖拽条 + 100vh 壳 */
.titlebar {
  height: 28px;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0 var(--s-4);
  background: var(--bg);
  color: var(--t3);
  font-size: var(--fs-xs);
  user-select: none;
  -webkit-app-region: drag;
}
.titlebar .name { color: var(--t2); font-weight: 500; }
.titlebar .sep { color: var(--t3); }
.titlebar .right { margin-left: auto; color: var(--t3); }
body.final .shell {
  height: calc(100vh - 28px);
  min-height: calc(100vh - 28px);
}
.content, .aux { overflow: auto; }
.content { scrollbar-gutter: stable; }

/* 导航：button 复位，保留 starter 的 .nav .i 样式 */
.nav .i { border: 0; background: transparent; padding: 0; }
.nav .i:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.nav .mark { font-size: 12px; letter-spacing: -0.02em; }
.nav .i svg { width: 17px; height: 17px; }

/* 页头 */
.head { align-items: center; margin-bottom: var(--s-6); }
.head .title { margin: 0; }
.head .title-row { align-items: center; }
.head .sub { white-space: nowrap; }
.head .actions { align-items: center; }
.search { width: 220px; }
.head .search { flex: none; }

/* 区块 */
.section.tight { margin-top: var(--s-6); }
.section.flush { margin-top: 0; }
.section-h .right { white-space: nowrap; }
.rows .row .tt, .rows .row .ss { white-space: normal; }
.row .rr { justify-content: flex-end; }
.row .progress { margin-top: var(--s-2); max-width: 260px; }
.row .hover { color: var(--t3); }
.row .hover:hover { color: var(--text); }
.island .row:is(:hover, .is-hover) { background: var(--island-2); }

/* 指标块：辅助岛里用升一级的底，别和岛同色 */
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.aux .tile { background: var(--island-2); }
.tile .v { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.content .tile { background: var(--island-2); }

/* 辅助岛内的区块标题小一号 */
.aux .section-h { font-size: var(--fs-h); line-height: var(--lh-h); margin: var(--s-5) 0 var(--s-3); }
.aux .section-h:first-child { margin-top: 0; }
.aux .divider { margin: var(--s-5) 0; }
.aux .foot { color: var(--t3); font-size: var(--fs-xs); margin-top: var(--s-4); }
.aux .approve { margin-top: var(--s-4); }

/* 两栏工作台 */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--s-7);
  align-items: start;
  margin-top: var(--s-6);
}
.dash-grid .section { margin-top: 0; }

/* 部门摘要：两列，行高 48，最后一行不画线 */
.dept-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-5); }
.dept {
  display: flex; align-items: center; gap: var(--s-2);
  min-height: 48px; border-bottom: 1px solid var(--line); min-width: 0;
}
.dept:nth-last-child(-n+2) { border-bottom: 0; }
.dept .nm { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dept .num { margin-left: auto; color: var(--t3); font-family: var(--mono); font-size: var(--fs-mono); }

/* 新建任务：左输入与澄清，右计划预览 */
.newtask-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--s-7);
  align-items: start;
}
.newtask-grid .section { margin-top: 0; }
.plan-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3); margin-top: var(--s-4); flex-wrap: wrap;
}
.plan-foot .acts { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.plan-total { font-family: var(--mono); font-size: 18px; font-weight: 600; }

/* 命令台 */
.hero { max-width: 760px; margin: 6vh auto 0; }
.hero .mark-lg {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--ink); color: var(--ink-fg);
  display: grid; place-items: center;
  font-weight: 600; font-size: 15px; letter-spacing: -0.02em;
  margin-bottom: var(--s-5);
}
.hero h1 { margin: 0 0 var(--s-2); font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 600; letter-spacing: -0.01em; }
.hero .lede { margin: 0 0 var(--s-6); color: var(--t2); font-size: var(--fs-body); line-height: var(--lh-body); }
.composer.hero-box { padding: var(--s-5); }
.composer.hero-box .ta { min-height: 48px; font-size: var(--fs-h); line-height: var(--lh-h); }
.quick-row { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-4); }
.quick-row .lab { color: var(--t3); font-size: var(--fs-xs); margin-right: var(--s-1); }
.quick-row .chip { height: 28px; }
.recent { max-width: 760px; margin: 0 auto; }

/* 任务房间：四列泳道 */
.task-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.lane {
  background: var(--island-2);
  border-radius: var(--r-panel);
  padding: var(--s-4);
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-width: 0;
}
.lane-h { display: flex; align-items: center; gap: var(--s-2); font-weight: 600; min-width: 0; }
.lane-h .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-h .s { font-weight: 400; }
.lane-sub { color: var(--t3); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.lane .progress { margin: var(--s-1) 0; }
.lane .step { margin: 2px 0; }
.lane .step .sum { color: var(--t3); }
.lane-foot { margin-top: auto; color: var(--t3); font-size: var(--fs-xs); font-family: var(--mono); display: flex; align-items: center; gap: var(--s-2); }
.blackboard {
  display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap;
  padding: var(--s-4);
  border-radius: var(--r-panel);
  background: var(--island-2);
  margin-top: var(--s-4);
}
.blackboard .facts { display: flex; gap: var(--s-4); flex-wrap: wrap; color: var(--t2); font-size: var(--fs-s); }
.blackboard .facts .ok-t { color: var(--ok); }
.blackboard .acts { margin-left: auto; display: flex; gap: var(--s-2); flex-wrap: wrap; }
.task-composer { margin-top: var(--s-4); }
.task-composer .composer { background: var(--island-2); }
.section.process-sec { margin-top: var(--s-4); }
.process-list .row { padding: 7px 12px; }
.process-list .row .tt { font-size: var(--fs-body); line-height: 20px; }
.process-list .row .ss { font-size: var(--fs-xs); line-height: 18px; }

/* 工具条、筛选 */
.toolbar { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); flex-wrap: wrap; }
.toolbar .s { margin-left: auto; }

/* 技能包 */
.pkg-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--ink); color: var(--ink-fg);
  display: grid; place-items: center;
  font-weight: 600; font-size: 12px; flex: none;
}
.package-bar {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-panel);
  background: var(--island-2);
  margin-bottom: var(--s-4);
  flex-wrap: wrap;
}
.package-bar .h { font-size: var(--fs-h); line-height: var(--lh-h); font-weight: 600; }
.package-bar .acts { margin-left: auto; display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* 项目任务板 */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); }
.board-col {
  background: var(--island-2);
  border-radius: var(--r-panel);
  padding: var(--s-3);
  min-height: 260px;
  display: flex; flex-direction: column; gap: var(--s-2);
  min-width: 0;
}
.board-h { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-s); font-weight: 600; }
.board-h .n { color: var(--t3); font-family: var(--mono); font-weight: 400; }
.task-card {
  background: var(--island-3);
  border-radius: var(--r-ctl);
  padding: 10px 12px;
  cursor: pointer;
  transition: box-shadow var(--dur) var(--ease);
  border: 0; text-align: left; font: inherit; color: inherit; width: 100%;
}
.task-card:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.task-card[draggable="true"] { cursor: grab; }
.task-card.dragging { opacity: .45; cursor: grabbing; }
.board-col.drag-over { box-shadow: inset 0 0 0 1px var(--acc); background: color-mix(in srgb, var(--acc) 8%, var(--island-2)); }
.task-card .tt { font-size: var(--fs-body); line-height: 20px; font-weight: 600; }
.task-card .ss { color: var(--t3); font-size: var(--fs-xs); line-height: 18px; margin-top: 2px; }
.task-card .meta { display: flex; gap: var(--s-2); align-items: center; margin-top: var(--s-2); color: var(--t3); font-family: var(--mono); font-size: var(--fs-mono); }

/* 资产库 */
.asset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
.asset {
  background: var(--island-2);
  border-radius: var(--r-panel);
  padding: var(--s-2);
  cursor: pointer;
  min-width: 0;
  transition: box-shadow var(--dur) var(--ease);
  border: 0; text-align: left; font: inherit; color: inherit; width: 100%;
}
.asset:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.asset.sel { outline: 1.5px solid var(--acc); outline-offset: -1.5px; }
.asset .thumb {
  aspect-ratio: 16 / 9;
  background: var(--island-3);
  border-radius: var(--r-xs);
  display: grid; place-items: center;
  color: var(--t3); font-size: var(--fs-xs);
  text-align: center; padding: 0 8px;
}
.asset .tt { margin-top: var(--s-2); font-size: var(--fs-s); line-height: 18px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset .ss { color: var(--t3); font-family: var(--mono); font-size: var(--fs-mono); margin-top: 2px; }
.asset-preview {
  aspect-ratio: 16 / 9;
  background: var(--island-3);
  border-radius: var(--r-panel);
  display: grid; place-items: center;
  color: var(--t3); font-size: var(--fs-xs);
  margin-bottom: var(--s-4);
}
.table .progress { width: 64px; display: inline-block; vertical-align: middle; margin-right: var(--s-2); }

/* 任务房间 */
.room-stream { display: flex; flex-direction: column; gap: var(--s-3); max-height: calc(100vh - 300px); overflow: auto; padding-right: var(--s-2); }
.room-item { display: flex; gap: var(--s-2); max-width: 88%; }
.room-item.agent { align-self: flex-start; }
.room-item.user { align-self: flex-end; }
.room-item .avatar { width: 24px; height: 24px; font-size: 10px; }
.room-item .name { color: var(--t3); font-size: var(--fs-xs); margin-bottom: 2px; }
.room-item .reply { padding-top: 2px; }
.room-item .msg { margin-bottom: 0; }

/* 总览 */
.overview-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr) 280px; gap: var(--s-5); align-items: start; }
.overview-grid .section { margin-top: 0; }

/* 安全中心 */
.secure-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--s-5); align-items: start; }
.secure-grid .section { margin-top: 0; }

/* 设置 */
.settings-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav button { height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--t2); text-align: left; cursor: pointer; font: inherit; }
.settings-nav button:hover { background: var(--island-2); color: var(--text); }
.settings-nav button.on { background: var(--island-2); color: var(--text); }
.settings-section { margin-bottom: var(--s-6); }
.settings-section .field { border-bottom: 1px solid var(--line); }
.settings-section .field:last-child { border-bottom: 0; }

/* 状态行 */
.status-list { display: flex; flex-direction: column; gap: var(--s-3); }
.status-line { display: flex; align-items: center; gap: var(--s-2); color: var(--t2); font-size: var(--fs-s); min-width: 0; }
.status-line .nm { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-line .meta { color: var(--t3); font-family: var(--mono); font-size: var(--fs-mono); white-space: nowrap; }
.status-line .num { margin-left: auto; color: var(--t3); font-family: var(--mono); font-size: var(--fs-mono); }
.status-line .bar { flex: 1; min-width: 40px; }
.status-line .bar .progress { height: 4px; }

/* 小徽标行 */
.badges { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }

/* 小屏让路 */
@media (max-width: 1200px) {
  .dash-grid { grid-template-columns: 1fr; gap: var(--s-5); }
  .task-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .newtask-grid { grid-template-columns: 1fr; gap: var(--s-5); }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { margin-top: 4vh; }
}
@media (max-width: 960px) {
  .task-board { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; gap: var(--s-4); }
  .secure-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; }
  .head .search { display: none; }
}
@media (max-width: 720px) {
  .asset-grid { grid-template-columns: 1fr; }
}