/* 武汉内容运营工作台 · 旗舰设计系统（蒂芙尼蓝 + Apple 纯灰极简风）
   主按钮：蒂芙尼蓝 #81D8D0 配深墨字 #0B2E2C（平涂高雅，不加渐变和高光）
   主点缀：#0ABAB5 / 文本链接 #007C77；中性画布纯灰 #F5F5F7，侧栏 #EFEFF2，纯白卡片以极细描边阴影区分层次。 */

@font-face {
  font-family: "WB Sans";
  src: local("Noto Sans SC"), local("NotoSansSC-VF"), url("/fonts/NotoSansSC-VF.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --c-canvas: #F5F5F7;
  --c-side: #EFEFF2;
  --c-surface: #FFFFFF;
  --c-surface-2: #F5F5F7;
  --c-surface-3: #EBEBEF;
  --c-ink: #1D1D1F;
  --c-ink-2: #48484D;
  --c-muted: #72727A;
  --c-faint: #AEAEB3;
  --c-line: #E6E6EA;
  --c-line-strong: #D2D2D7;

  /* 主色：蒂芙尼蓝 */
  --c-accent: #0ABAB5;
  --c-accent-hover: #08A39E;
  --c-accent-ink: #007C77;
  --c-accent-soft: #EAF8F7;
  --c-accent-soft-2: #D3F1EE;
  --c-accent-line: #81D8D0;
  --c-btn: #81D8D0;
  --c-btn-hover: #6CCFC5;
  --c-on-btn: #0B2E2C;

  /* 语义色 */
  --c-ok: #257D58;
  --c-ok-soft: #E8F6EF;
  --c-warn: #A8610D;
  --c-warn-soft: #FDF3E2;
  --c-danger: #C5372D;
  --c-danger-soft: #FCECEB;
  --c-gray-soft: #EEEEF2;
  --c-gray-ink: #55555D;

  /* 层次阴影：极细 1px 描边 + 轻柔投影 */
  --sh-ring: 0 0 0 1px rgba(24, 32, 42, .065), 0 1px 2px rgba(24, 32, 42, .035);
  --sh-ring-hover: 0 0 0 1px rgba(24, 32, 42, .12), 0 10px 26px rgba(24, 32, 42, .07);
  --sh-dialog: 0 24px 64px rgba(24, 32, 42, .18), 0 0 0 1px rgba(24, 32, 42, .06);
  --sh-toast: 0 12px 32px rgba(24, 32, 42, .22), 0 0 0 1px rgba(255, 255, 255, .08);

  --font-sans: "WB Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 14px;
  --rail-w: 236px;
  --dur-fast: 130ms;
  --dur-mid: 220ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --c-canvas: #0B0C0F;
  --c-side: #0F1115;
  --c-surface: #15181E;
  --c-surface-2: #1B1F27;
  --c-surface-3: #222731;
  --c-ink: #EEF0F4;
  --c-ink-2: #C2C6CE;
  --c-muted: #8B909B;
  --c-faint: #585D68;
  --c-line: #232730;
  --c-line-strong: #313642;

  --c-accent: #5FD3CB;
  --c-accent-hover: #81DED7;
  --c-accent-ink: #7EE0D8;
  --c-accent-soft: #102625;
  --c-accent-soft-2: #143432;
  --c-accent-line: #1F5A56;
  --c-btn: #81D8D0;
  --c-btn-hover: #9BE3DC;
  --c-on-btn: #0B2E2C;

  --c-ok: #54C792;
  --c-ok-soft: #142F22;
  --c-warn: #E8AC5B;
  --c-warn-soft: #332717;
  --c-danger: #F17C72;
  --c-danger-soft: #381E1C;
  --c-gray-soft: #222630;
  --c-gray-ink: #B4B8C2;

  --sh-ring: 0 0 0 1px rgba(255, 255, 255, .065);
  --sh-ring-hover: 0 0 0 1px rgba(255, 255, 255, .13), 0 12px 30px rgba(0, 0, 0, .42);
  --sh-dialog: 0 28px 72px rgba(0, 0, 0, .62), 0 0 0 1px rgba(255, 255, 255, .09);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  color: var(--c-ink);
  background: var(--c-canvas);
  font: 14.5px/1.62 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.icon-lib { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; flex: none; }

a { color: var(--c-accent-ink); text-decoration: none; font-weight: 550; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }

/* 按钮体系：蒂芙尼蓝平涂主按钮 + 极简描边次按钮 */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  background: var(--c-btn);
  border: 1px solid transparent;
  color: var(--c-on-btn);
  padding: 0 15px;
  height: 36px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 620;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), transform 90ms;
}
button:hover:not(:disabled) { background: var(--c-btn-hover); }
button:active:not(:disabled) { transform: translateY(.5px); }
button:disabled { opacity: .48; cursor: not-allowed; }
.light {
  background: var(--c-surface);
  color: var(--c-ink-2);
  border-color: var(--c-line-strong);
  box-shadow: 0 1px 0 rgba(24, 32, 42, .03);
}
.light:hover:not(:disabled) { background: var(--c-surface-2); color: var(--c-ink); border-color: var(--c-faint); }
.danger {
  background: var(--c-danger-soft);
  color: var(--c-danger);
  border-color: transparent;
}
.danger:hover:not(:disabled) { filter: brightness(.95); }
.small-btn { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* 顶栏：玻璃拟态极简顶栏 */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: color-mix(in srgb, var(--c-surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-line);
}
.top-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--c-ink);
  text-decoration: none !important;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
  white-space: nowrap;
  flex: none;
}
.logo {
  display: grid;
  place-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--c-btn);
  color: var(--c-on-btn);
  font-weight: 800;
  font-size: 15px;
  flex: none;
}
.brand-sub { display: none; }
.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--c-muted);
  font-size: 13px;
  padding-left: 14px;
  border-left: 1px solid var(--c-line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumb strong { color: var(--c-ink); font-weight: 620; }
.top-right { display: flex; align-items: center; gap: 8px; }
.conn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-line);
  font-size: 12px;
  color: var(--c-ink-2);
}
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-faint); }
.conn-dot.on { background: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }

/* 主布局：左侧纯灰导航栏 + 右侧纯灰画布 */
#desk {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
}
aside {
  background: var(--c-side);
  border-right: 1px solid var(--c-line);
  padding: 14px 12px 18px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cmd-trigger {
  width: 100%;
  height: 36px;
  justify-content: space-between;
  background: var(--c-surface);
  color: var(--c-muted);
  border: 1px solid var(--c-line);
  box-shadow: 0 1px 2px rgba(24, 32, 42, .03);
  padding: 0 10px;
  margin-bottom: 12px;
  font-size: 12.5px;
  font-weight: 500;
}
.cmd-trigger:hover:not(:disabled) { background: var(--c-surface); border-color: var(--c-line-strong); color: var(--c-ink); }
.cmd-trigger kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-line);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--c-muted);
}

.nav-group {
  margin: 12px 10px 4px;
  font-size: 11px;
  font-weight: 650;
  color: var(--c-faint);
  letter-spacing: .04em;
  text-transform: uppercase;
}
nav { display: grid; gap: 2px; }
nav button {
  width: 100%;
  justify-content: flex-start;
  height: 36px;
  background: transparent;
  color: var(--c-ink-2);
  border: 0;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 520;
}
nav button:hover:not(:disabled) { background: var(--c-surface-3); color: var(--c-ink); }
nav button.selected {
  background: var(--c-surface);
  color: var(--c-ink);
  font-weight: 650;
  box-shadow: var(--sh-ring);
}
nav button.selected .ico { color: var(--c-accent); }
.nav-count {
  margin-left: auto;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--c-accent-soft-2);
  color: var(--c-accent-ink);
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-content: center;
  font-variant-numeric: tabular-nums;
}
#who {
  margin-top: auto;
  padding: 12px 10px 0;
  border-top: 1px solid var(--c-line);
  font-size: 12px;
  color: var(--c-muted);
  overflow-wrap: anywhere;
  line-height: 1.5;
}

/* 工作区容器 */
.workspace {
  max-width: 1260px;
  width: 100%;
  padding: 26px 32px calc(80px + env(safe-area-inset-bottom));
  margin: 0 auto;
  min-width: 0;
}

/* 首页：R58 极简高级看板顶栏（告别笨重绿横幅！） */
.hm-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.hm-top h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.hm-top p { margin: 3px 0 0; color: var(--c-muted); font-size: 13px; }
.hm-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.hm-quick button {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 560;
  background: var(--c-surface);
  color: var(--c-ink-2);
  border: 0;
  box-shadow: var(--sh-ring);
}
.hm-quick button:hover { box-shadow: var(--sh-ring-hover); color: var(--c-ink); background: var(--c-surface); }
.hm-quick button .ico { width: 14px; height: 14px; color: var(--c-accent-ink); }

/* KPI 卡片：纯白浮层 + 等宽大数字 + 可点击跳转 */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}
.stat {
  position: relative;
  padding: 16px 18px;
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-ring);
  transition: box-shadow var(--dur-mid) var(--ease-out), transform var(--dur-mid) var(--ease-out);
}
.stat[data-go-tab] { cursor: pointer; }
.stat[data-go-tab]:hover { box-shadow: var(--sh-ring-hover); transform: translateY(-1px); }
.stat small { display: block; color: var(--c-muted); font-size: 12.5px; font-weight: 500; }
.stat strong {
  display: block;
  font-size: 29px;
  font-weight: 720;
  color: var(--c-ink);
  line-height: 1.18;
  margin: 6px 0 3px;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.stat strong.accent { color: var(--c-accent-ink); }
.stat span { font-size: 12px; color: var(--c-muted); }

/* 卡片统一风格 */
article, #login, details, #outline:not(:empty), .calendar, .matrix-tools {
  background: var(--c-surface);
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-ring);
  padding: 18px 20px;
}
article { margin: 12px 0; transition: box-shadow var(--dur-fast) var(--ease-out); }
article h3 { margin: 6px 0 4px; font-size: 15.5px; font-weight: 650; color: var(--c-ink); }
.panel { margin: 0 0 16px; }
.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.overview-grid .panel { margin: 0; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--c-line);
}
.row:first-child { border-top: 0; padding-top: 4px; }
.row span { min-width: 0; overflow-wrap: anywhere; }
.row b { font-weight: 600; color: var(--c-ink); }

/* 徽章与状态色 */
.status, .badge {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  background: var(--c-accent-soft);
  color: var(--c-accent-ink);
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.45;
  vertical-align: middle;
}
.st-draft { background: var(--c-gray-soft); color: var(--c-gray-ink); }
.st-pending { background: var(--c-warn-soft); color: var(--c-warn); }
.st-revise, .st-overdue { background: var(--c-danger-soft); color: var(--c-danger); }
.st-approved { background: var(--c-ok-soft); color: var(--c-ok); }

h1, h2, h3 { margin: 0 0 6px; line-height: 1.3; letter-spacing: -.015em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 660; }
h3 { font-size: 14.5px; font-weight: 650; }
p { margin: 5px 0; color: var(--c-ink-2); }
small, .hint { color: var(--c-muted); font-size: 12.5px; }
.pagehead { margin: 0 0 14px; }
.pagehead h1, .pagehead h2 { margin: 0; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bar select { width: auto; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.actions.compact { margin: 0; }
.full-span { grid-column: 1 / -1; margin: 4px 0 0; }

/* 表单控件 */
label { display: block; margin: 10px 0; font-size: 13px; font-weight: 600; color: var(--c-ink-2); }
label input, label select, label textarea { margin-top: 5px; font-weight: 400; color: var(--c-ink); }
input, textarea, select {
  width: 100%;
  padding: 8px 11px;
  background: var(--c-surface);
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-sm);
  min-width: 0;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-soft);
  outline: none;
}
textarea { resize: vertical; line-height: 1.65; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.filter-bar { display: grid; grid-template-columns: 180px 180px minmax(0, 1fr); gap: 12px; margin-bottom: 14px; }
.filter-bar label { margin: 0; }

/* 登录页：极简精致卡片 */
#login {
  width: min(420px, calc(100% - 32px));
  margin: 10vh auto 40px;
  padding: 28px;
}
.login-banner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-bottom: 18px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--c-line);
}
.login-banner .logo { width: 42px; height: 42px; font-size: 19px; border-radius: 11px; }
.login-banner h1 { margin: 4px 0 0; font-size: 22px; }
.login-banner p { margin: 0; font-size: 13px; color: var(--c-muted); }
#signin button { width: 100%; height: 42px; margin-top: 10px; font-size: 14.5px; }

/* 卡片网格 */
#cards, #list, #observations, #kbList, #reportList, #materialList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
#cards article, #list article, #observations article, #kbList article, #reportList article, #materialList article { margin: 0; }
#cards article:hover, #list article:hover, #kbList article:hover, #reportList article:hover, #materialList article:hover {
  box-shadow: var(--sh-ring-hover);
}

/* 编辑器两栏专业布局（左创作 + 右粘性元信息与主操作！） */
#editor { max-width: 100%; }
.editor-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(290px, 1fr);
  gap: 16px;
  align-items: start;
}
.editor-main, .editor-side { display: grid; gap: 14px; min-width: 0; }
.editor-side { position: sticky; top: 74px; }
.editor-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-ring);
  padding: 18px 20px;
}
.editor-card h3 { margin-bottom: 10px; }

/* 拖拽上传区 */
.dropzone {
  border: 1.5px dashed var(--c-line-strong);
  border-radius: var(--r-md);
  padding: 14px;
  background: var(--c-surface-2);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.dropzone.dragover {
  border-color: var(--c-accent);
  background: var(--c-accent-soft);
}

/* AI 编导台 */
.ai-studio-box {
  background: var(--c-surface-2);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin: 4px 0 12px;
}

/* 进度条 */
.progress {
  position: relative;
  height: 22px;
  border-radius: 999px;
  background: var(--c-surface-3);
  overflow: hidden;
  margin: 10px 0;
}
#uploadBar { height: 100%; width: 0; background: var(--c-accent); transition: width .15s; }
#uploadText {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--c-ink);
  font-variant-numeric: tabular-nums;
}

/* 附件预览画廊 */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.file-card {
  background: var(--c-surface-2);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 10px;
  display: grid;
  gap: 8px;
}
.file-card img { width: 100%; height: 140px; object-fit: cover; border-radius: 7px; cursor: zoom-in; background: var(--c-surface-3); }
.file-card video { width: 100%; max-height: 190px; border-radius: 7px; background: #111; }
.file-name { font-size: 12.5px; font-weight: 600; color: var(--c-ink); overflow-wrap: anywhere; }
.file-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.side-legacy {
  display: block;
  margin-top: 8px;
  padding: 0 10px;
  font-size: 11.5px;
  color: var(--c-faint);
}
.side-legacy:hover { color: var(--c-ink-2); }

/* Apple 分段切换胶囊 */
.seg-tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--c-surface-3);
  gap: 2px;
}
.seg-tabs button {
  height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 7.5px;
  background: transparent;
  color: var(--c-ink-2);
  font-size: 13px;
  font-weight: 560;
}
.seg-tabs button:hover:not(:disabled) { background: transparent; color: var(--c-ink); }
.seg-tabs button[aria-pressed="true"] {
  background: var(--c-surface);
  color: var(--c-ink);
  font-weight: 660;
  box-shadow: 0 1px 3px rgba(24, 32, 42, .09);
}

/* 分类胶囊 */
.pill-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.pill-tabs button {
  background: var(--c-surface);
  color: var(--c-ink-2);
  border: 1px solid var(--c-line);
  height: 31px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 560;
  border-radius: 999px;
}
.pill-tabs button[aria-pressed="true"] {
  background: var(--c-btn);
  color: var(--c-on-btn);
  border-color: var(--c-accent-line);
  font-weight: 650;
}

/* 排期周历 */
.matrix-tools { padding: 12px 16px; margin-bottom: 14px; }
.weekbar { justify-content: flex-start; margin: 10px 0 12px; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; padding: 12px; margin-bottom: 18px; }
.day {
  height: auto;
  flex-direction: column;
  background: var(--c-surface-2);
  color: var(--c-ink);
  border: 1px solid var(--c-line);
  padding: 10px 4px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}
.day:hover:not(:disabled) { background: var(--c-surface-3); }
.day[aria-pressed="true"] { background: var(--c-btn); color: var(--c-on-btn); border-color: var(--c-accent); font-weight: 700; }
.day.is-today:not([aria-pressed="true"]) { border-color: var(--c-accent); box-shadow: inset 0 0 0 1px var(--c-accent); }
.day small { font-weight: 450; color: inherit; opacity: .78; font-size: 11.5px; }
.release { display: grid; gap: 4px; }
.release small { overflow-wrap: anywhere; }

/* 复盘漏斗进度条 */
.funnel-bar {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}
.funnel-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}
.funnel-track { height: 8px; border-radius: 999px; background: var(--c-surface-3); overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 999px; background: var(--c-accent); }
.funnel-val { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--c-ink); }

/* 弹窗与 R59.4 双栏知识库选用 */
dialog {
  width: min(620px, calc(100% - 24px));
  max-height: 90vh;
  overflow: auto;
  border: 0;
  border-radius: 16px;
  box-shadow: var(--sh-dialog);
  padding: 20px 22px;
  color: var(--c-ink);
  background: var(--c-surface);
}
dialog::backdrop { background: rgba(15, 20, 26, .48); backdrop-filter: blur(4px); }
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}
.dialog-head h2 {
  margin: 0;
  min-width: 0;
  flex: 1;
  font-size: 15.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dialog-x { flex: none; }
.wide-dialog { width: min(880px, calc(100% - 24px)); }

.kb-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  height: min(440px, 56vh);
  margin: 12px 0;
}
.kb-picker-list, .kb-picker-preview {
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 10px;
  overflow-y: auto;
  height: 100%;
  background: var(--c-surface-2);
}
.kb-pick-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border-radius: 9px;
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color var(--dur-fast);
}
.kb-pick-item.active { border-color: var(--c-accent); box-shadow: 0 0 0 1.5px var(--c-accent); }
.kb-pick-item input[type="checkbox"] { width: 17px; height: 17px; margin-top: 2px; flex: none; accent-color: var(--c-accent); }
.kb-pick-body { min-width: 0; flex: 1; }
.kb-pick-body b { display: block; font-size: 13.5px; color: var(--c-ink); }
.kb-pick-body small { display: block; margin-top: 2px; }

.report-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.report-sections { display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.report-sec { background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 14px 16px; }
.report-sec h3 { margin: 0; font-size: 14.5px; }
.report-sec pre { margin: 8px 0 0; font-size: 13.5px; line-height: 1.75; color: var(--c-ink); }

.cmd-results { margin-top: 10px; max-height: 54vh; overflow-y: auto; display: grid; gap: 5px; }
.cmd-item {
  justify-content: space-between;
  width: 100%;
  height: auto;
  padding: 10px 12px;
  background: var(--c-surface-2);
  color: var(--c-ink);
  border: 1px solid transparent;
  font-weight: 520;
}
.cmd-item:hover:not(:disabled) { background: var(--c-accent-soft); border-color: var(--c-accent-line); color: var(--c-ink); }

.mono, .code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: var(--c-surface-2);
  padding: 11px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-line);
  color: var(--c-ink);
  word-break: break-all;
}
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
details { margin: 10px 0; padding: 12px 16px; }
summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.product-card { background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 12px 14px; margin: 8px 0; }
.task-meta { display: block; margin-top: 2px; color: var(--c-muted); font-size: 12px; }
.obs-mini { border-top: 1px solid var(--c-line); padding: 9px 0; font-size: 13px; }
#mediaBody img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 8px; }
#mediaBody video { width: 100%; max-height: 66vh; border-radius: 10px; background: #0B0C0F; display: block; }
#mediaBody iframe { width: 100%; height: 64vh; border: 0; border-radius: 10px; background: #0B0C0F; display: block; }
#mediaBody pre { max-height: 65vh; overflow: auto; background: var(--c-surface-2); padding: 14px; border-radius: 8px; }
.mat-head { display: flex; gap: 12px; align-items: flex-start; margin-top: 8px; }
.mat-thumb {
  position: relative;
  width: 72px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--c-surface-3);
  flex: none;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.mat-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mat-thumb span {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  background: rgba(0, 0, 0, .28);
  color: #fff;
  font-size: 20px;
}
.mat-meta { min-width: 0; flex: 1; }

/* 底部悬浮 Toast */
#notice:not(:empty) {
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 92%;
  background: #1D1D1F;
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--sh-toast);
  z-index: 40;
  font-size: 13.5px;
  font-weight: 520;
}
html[data-theme="dark"] #notice:not(:empty) { background: #EEF0F4; color: #0B0C0F; }

@keyframes riseIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.workspace > section:not([hidden]) { animation: riseIn 200ms var(--ease-out); }

/* 响应式适配：平板与 390px 微信手机端 */
@media (max-width: 1020px) {
  .editor-shell { grid-template-columns: 1fr; }
  .editor-side { position: static; }
}
@media (max-width: 860px) {
  #desk { grid-template-columns: 186px minmax(0, 1fr); }
  .workspace { padding: 20px 18px calc(70px + env(safe-area-inset-bottom)); }
  .overview-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .kb-picker-grid { grid-template-columns: 1fr; height: auto; max-height: 60vh; }
  .kb-picker-list, .kb-picker-preview { max-height: 220px; }
}
@media (max-width: 640px) {
  .top { height: 54px; padding: 0 12px; gap: 8px; }
  .brand { font-size: 14px; gap: 7px; }
  .logo { width: 28px; height: 28px; font-size: 13px; border-radius: 8px; }
  .crumb, .conn-pill { display: none; }
  .top-right { gap: 5px; font-size: 12px; flex: none; }
  .top-right .small-btn { padding: 0 9px; height: 28px; font-size: 12px; }
  #desk { display: block; }
  aside { padding: 8px 10px 6px; border-right: 0; border-bottom: 1px solid var(--c-line); }
  .nav-group { display: none; }
  .cmd-trigger { margin-bottom: 6px; height: 34px; }
  nav { display: flex; overflow-x: auto; gap: 4px; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  nav button { width: auto; flex: none; padding: 0 10px; height: 34px; font-size: 12.5px; }
  #who { margin-top: 6px; padding: 6px 4px 0; font-size: 11px; }
  .workspace { padding: 14px 12px calc(76px + env(safe-area-inset-bottom)); }
  .hm-top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat strong { font-size: 24px; }
  #cards, #list, #observations, #kbList, #reportList, #materialList, .filter-bar, .cols { grid-template-columns: 1fr; }
  .calendar { gap: 4px; padding: 8px; }
  .day { font-size: 11px; padding: 7px 2px; }
  .row { flex-direction: column; align-items: flex-start; }
  .row .actions, .row button { align-self: flex-end; }
}
