/* 生产工作台外壳：按岗位呈现稳定一级入口，首页先任务、后工具。
   桌面与移动共用同一信息架构，并在窄屏自然收敛。 */

.workspace {
  display: grid;
  /* styles.css 仍保留旧侧边栏时代的 grid-template-columns:250px 1fr。
     那条规则与本文件的 rows 定义叠加后，顶栏被塞进 250px 的第一列、
     内容区被推到它右侧的第二列——这正是页面「错位」的根因。
     这里显式收敛为单列，并且 minmax(0,…) 防止长中文把栅格撑破。 */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: #fafafa;
}

.product-boundary {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: #fff;
  color: #4f5865;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.ai-draft-badge {
  display: inline-flex;
  margin: 0 8px 6px 0;
  padding: 2px 7px;
  border: 1px solid #b9cfc7;
  border-radius: 999px;
  background: #eef6f2;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.app-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid var(--border-subtle);
}

.app-bar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  /* 旧侧边栏的 padding:0 8px 24px 会把品牌顶到栏外 */
  padding: 0;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.brand-copy { display: grid; gap: 1px; line-height: 1.1; }
.brand-copy strong { color: var(--text); font-size: 15px; }
.brand-copy small { color: var(--text-secondary); font-size: 10px; font-weight: 500; }

.app-bar .brand-mark { flex: none; }

.header-profile {
  justify-self: end;
  display: grid;
  justify-items: end;
  gap: 1px;
  width: auto;
  min-height: 40px;
  padding: 6px 10px;
  border-color: transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: right;
}
.header-profile:hover { border-color: var(--border); background: var(--surface-subtle); }
.header-profile span { font-size: 13px; font-weight: 700; }
.header-profile small { color: var(--muted); font-size: 11px; font-weight: 500; }

.columns {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 20px;
  background: #eff1f2;
  justify-self: center;
}

.column-button {
  position: relative;
  min-width: 92px;
  padding: 7px 18px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* 六系统蒸馏 V1：对象工作台。列表信息密度来自 Twenty/Frappe CRM，
   详情不离开页面；避免传统 OA/ERP 的模块宫格。 */
.distilled-heading { border-bottom: 1px solid var(--border); padding-bottom: 20px; }
.distilled-heading .eyebrow,
.object-toolbar .eyebrow { margin: 0 0 6px; color: var(--brand); }
.object-workbench { min-width: 0; }
.object-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.object-toolbar h2 { margin: 0 0 6px; }
.object-toolbar p:last-child { margin: 0; }
.object-toolbar > button { width: auto; flex: none; }
.object-filters { display: grid; grid-template-columns: minmax(220px, 1fr) 150px 170px auto; gap: 10px; padding: 14px 0; }
.object-filters input,
.object-filters select { margin: 0; min-height: 42px; }
.object-filters button { width: auto; }
#customers-status { min-height: 20px; margin: 0 0 10px; font-size: 13px; }
.object-split { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(340px, 1.1fr); min-height: 480px; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.object-list { min-width: 0; border-right: 1px solid var(--border); background: #fbfcfc; }
.customer-hospital-group + .customer-hospital-group { border-top: 8px solid #eef1f1; }
.customer-hospital-head { display: grid; gap: 5px; padding: 14px 16px 11px; border-bottom: 1px solid var(--border); background: #f4f7f6; }
.customer-hospital-head .eyebrow { margin: 0 0 3px; color: var(--brand); font-size: 10px; }
.customer-hospital-head h3 { margin: 0; font-size: 16px; }
.customer-hospital-meta { color: var(--muted); font-size: 12px; }
.customer-hospital-targets { display: grid; }
.object-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 16px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; color: var(--text); text-align: left; }
.object-row:hover,
.object-row.selected { background: #fff; box-shadow: inset 3px 0 var(--brand); }
.object-row-main { display: grid; gap: 5px; min-width: 0; }
.object-row-main strong,
.object-row-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.object-row-main span,
.object-row-meta { color: var(--muted); font-size: 12px; }
.object-row-meta { flex: none; }
.object-row-heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
.object-row-kind { flex: none; padding: 2px 6px; border-radius: 999px; background: var(--brand-soft, var(--brand-soft)); color: var(--brand); font-size: 10px; font-weight: 800; }
.object-row[data-target-type="doctor"] .object-row-kind { background: #fff3dc; color: #8a5300; }
.target-hierarchy { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.target-hierarchy span + span::before { content: '›'; margin-right: 6px; color: #a1a8ae; }
.target-people { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.target-person { padding: 5px 8px; border-radius: 999px; background: var(--surface-subtle); color: var(--text-secondary); font-size: 12px; }
.target-create-kind { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.target-create-kind label { display: flex; align-items: center; gap: 7px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.target-create-kind input { width: auto; margin: 0; }
.object-detail { min-width: 0; padding: 22px; background: #fff; }
.detail-empty,
.object-empty { display: grid; place-content: center; gap: 8px; min-height: 180px; padding: 24px; color: var(--muted); text-align: center; }
.detail-empty strong,
.object-empty strong { color: var(--text); }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.detail-head h3 { margin: 7px 0 0; font-size: 22px; }
.detail-head button { width: auto; }
.detail-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0; }
.detail-facts div { min-width: 0; padding: 12px; border-radius: 10px; background: #f5f7f7; }
.detail-facts dt { color: var(--muted); font-size: 12px; }
.detail-facts dd { margin: 5px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.detail-section { padding: 18px 0; border-top: 1px solid var(--border); }
.detail-section h4 { margin: 0 0 12px; }
.customer-next-actions { display: grid; gap: 12px; }
.customer-next-actions h4 { margin-bottom: 4px; }
.customer-next-actions p { margin: 0; }
.customer-action-row { display: flex; flex-wrap: wrap; gap: 10px; }
.customer-action-row button { width: auto; }
.related-row,
.source-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.related-row span,
.source-row span { color: var(--muted); font-size: 13px; text-align: right; }
.timeline-line { margin: 8px 0; padding-left: 14px; border-left: 2px solid var(--brand); }
.quick-create { display: grid; gap: 14px; }
.quick-create label { display: grid; gap: 6px; font-weight: 600; }
.quick-create input { margin: 0; }
.quick-create-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qualification-workbench { display: grid; gap: 18px; }
.qualification-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.qualification-steps li { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-subtle); color: var(--muted); font-size: 13px; font-weight: 700; }
.qualification-workbench textarea,.qualification-workbench select { width: 100%; }
@media (max-width: 700px) { .qualification-steps { grid-template-columns: 1fr 1fr; } .quick-create-grid { grid-template-columns: 1fr; } }
.operations-state { display: grid; gap: 24px; margin-top: 20px; }
.operations-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.operations-metrics > div { display: grid; gap: 7px; padding: 18px; border-right: 1px solid var(--border); }
.operations-metrics > div:last-child { border-right: 0; }
.operations-metrics span,
.operations-metrics small { color: var(--muted); }
.operations-metrics strong { font-size: 28px; }
.knowledge-sources { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.knowledge-sources h3 { margin: 0; }
.section-title { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.section-title span { color: var(--muted); font-size: 13px; }
.sync-warning { margin: 0; padding: 12px 14px; border: 1px solid #d7b775; border-radius: 10px; background: #fff8e8; color: #795100; }

.column-button.active {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.mine-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 9px;
  background: #b26a0a;
  color: #fff;
  font-size: 11px;
}

.app-bar .account {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  /* 归零旧侧边栏遗留的 margin-top:auto / border-top（深绿色，白底上是一条脏线）*/
  margin: 0;
  padding: 0;
  border-top: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.app-bar .account .eyebrow,
.app-bar .account strong,
.app-bar .account span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-bar .account .eyebrow {
  margin: 0;
  /* 旧值 #a9c9bc 是深色侧边栏用色，白底对比度约 1.7:1，不达 AA */
  color: #6b7480;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.app-bar .account strong { color: var(--text); font-weight: 600; }
.app-bar .account span { color: #6b7480; font-size: 12px; }
.app-bar .account #logout { flex: none; padding: 7px 13px; font-size: 12px; font-weight: 600; }

.content {
  display: flex;
  flex-direction: column;
  width: min(1180px, 100%);
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

/* 对象工作台需要横向上下文；今日、对话和个人设置继续保持舒适阅读宽度。 */
#assistant-panel,
#mine-panel,
#me-panel,
#module-panel:not(.object-workbench) {
  width: min(880px, 100%);
  margin-inline: auto;
}

/* 两个一级栏目不再自带卡片外壳：卡片只出现在任务行、建议和明细页，
   避免「卡片套卡片」的层级噪音。 */
#assistant-panel.panel,
#mine-panel.panel,
#capabilities-panel.panel,
#me-panel.panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.capability-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.capability-card {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.capability-card::after {
  content: '›';
  flex: none;
  color: var(--muted);
  font-size: 24px;
  font-weight: 400;
}

.capability-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--brand-soft, var(--brand-soft));
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.capability-copy { display: grid; gap: 5px; min-width: 0; }
.capability-copy strong { font-size: 15px; }
.capability-copy .muted { margin: 0; overflow-wrap: anywhere; }
.capability-state { flex: none; color: var(--brand); font-size: 12px; font-weight: 700; }
.conversation-context { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-subtle, #f6f8fb); font-size: 13px; }
.conversation-context span { color: var(--muted); flex: 1 1 260px; }
.capability-card.mode-conversation,
.capability-card.mode-hybrid,
.capability-card.mode-workspace { border-left: 1px solid var(--border); }

.today-heading { padding-bottom: 18px !important; }
.today-heading .eyebrow { margin: 0 0 7px; letter-spacing: .06em; text-transform: none; }
.today-heading h2 { font-size: clamp(25px, 3vw, 34px) !important; letter-spacing: -.025em; }
.today-heading .muted { max-width: 52em; }

.today-focus-section { margin-top: 18px; }
.today-focus-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 154px;
  padding: 26px 28px;
  border: 1px solid color-mix(in srgb, var(--warning) 24%, var(--border));
  border-radius: 22px;
  background: linear-gradient(135deg, #fffaf1 0%, #fff 68%);
  box-shadow: 0 14px 40px rgba(80, 56, 16, .06);
}
.today-focus-card::before {
  content: none;
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--warning);
}
.today-focus-card.all-clear {
  display: block;
  min-height: 126px;
  border-color: color-mix(in srgb, var(--brand) 22%, var(--border));
  background: linear-gradient(135deg, var(--brand-soft, var(--brand-soft)), #fff 72%);
  box-shadow: none;
}
.today-focus-card.all-clear::before { background: var(--brand); }
.today-focus-copy { display: grid; gap: 7px; min-width: 0; }
.today-focus-kicker { color: #9b5d08; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.today-focus-card.all-clear .today-focus-kicker { color: var(--brand); }
.today-focus-card > strong,
.today-focus-copy > strong { color: var(--text); font-size: clamp(19px, 2.2vw, 24px); line-height: 1.35; }
.today-focus-card p { max-width: 50em; margin: 0; color: var(--text-secondary); font-size: 14px; }
.today-focus-action { width: auto; min-width: 126px; border-color: #9b5d08; background: #9b5d08; color: #fff; font-weight: 750; }

.work-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
.work-summary .summary-card { display: flex; align-items: baseline; gap: 8px; padding: 9px 12px; border: 0; background: transparent; }
.work-summary .summary-card strong { font-size: 18px; }
.work-summary .summary-card span { font-size: 12px; }

.operations-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--brand) 26%, var(--border));
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-soft, var(--brand-soft)), var(--surface));
}
.operations-next .eyebrow { margin: 0 0 5px; }
.operations-next h3 { margin: 0 0 6px; }
.operations-next p { margin: 0; }
.operations-next-action { flex: none; width: auto; }

.qualification-steps li { display: flex; align-items: center; gap: 8px; }
.qualification-steps li span { display: grid; place-items: center; flex: none; width: 23px; height: 23px; border-radius: 50%; background: #e7eaec; color: var(--muted); font-size: 11px; }
.qualification-steps li strong { font-size: 12px; }
.qualification-steps li.done { border-color: color-mix(in srgb, var(--brand) 20%, var(--border)); background: var(--brand-soft, var(--brand-soft)); color: var(--brand); }
.qualification-steps li.done span { background: var(--brand); color: #fff; }
.qualification-steps li.current { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); background: var(--warning-soft, #fff8e8); color: #8a5300; }
.qualification-steps li.current span { background: var(--warning); color: #fff; }
.qualification-steps li.upcoming { color: var(--muted); }

.home-continuations { margin-top: 24px; }
.home-continuations-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-continuations-heading h3 { margin: 0; font-size: 14px; }
.home-continuations-heading .text-button { width: auto; margin: 0; padding: 6px; }
.home-continuation-list { display: grid; gap: 8px; margin-top: 10px; }
.home-continuations-status {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border));
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 13px;
}
.home-continuation {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  font-weight: 600;
}

.me-card {
  display: grid;
  gap: 8px;
  max-width: 560px;
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.me-card .eyebrow { margin: 0; }
.me-card strong { font-size: 20px; }
.me-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
#logout { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); color: var(--danger); }

button:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 34%, transparent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- 「小伍」栏目：纯净首屏 ---- */

/* styles.css 用 calc(100vh - 145px) / calc(100vh - 300px) 这类固定视口算式
   撑聊天区，那是按旧侧边栏（无顶栏）标定的，加上真实顶栏后会溢出并与
   输入区叠压。改为纯弹性：外壳负责高度，内部只管 min-height:0 + 滚动。 */
#assistant-panel {
  flex: 1;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
}

#assistant-panel .conversation {
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px 0 24px;
}

.welcome {
  max-width: 640px;
  margin: 0;
  padding-top: 6vh;
  text-align: left;
}

.welcome h2 { font-size: 30px; margin: 0 0 8px; color: var(--text); }
.welcome p { color: var(--text-secondary); margin: 0; max-width: 46em; }

#assistant-panel .composer {
  flex: none;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  padding: 14px;
}

#assistant-panel .composer textarea {
  border: 0;
  background: transparent;
  padding: 4px 2px;
  resize: none;
}

#assistant-panel .composer textarea:focus { box-shadow: none; }

/* 长中文说明 + 发送按钮在窄屏必须换行，不能互相挤压 */
#assistant-panel .composer > div { flex-wrap: wrap; row-gap: 10px; }
#assistant-panel .composer > div .muted { flex: 1 1 240px; font-size: 12px; }
#assistant-panel .composer > div button { flex: none; }
#assistant-panel .composer .chat-attach-button {
  order: -1;
  padding: 9px 13px;
  background: #f1f5f3;
  color: #285847;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.suggestion {
  padding: 10px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}

/* ---- 「我的」栏目 ---- */

/* 栏目标题不再是卡片头：去掉 24px 内边距和分隔线，避免透明面板上残留一条横线 */
#mine-panel .panel-heading {
  padding: 0;
  border-bottom: 0;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

#mine-panel .panel-heading h2 { margin: 0 0 2px; font-size: 22px; }
#mine-panel #mine-refresh { flex: none; padding: 7px 14px; font-size: 12px; }

.mine-section {
  margin: 26px 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  color: #a8aeb7;
}

.mine-rest-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.mine-filters { display: flex; gap: 8px; flex-wrap: wrap; }

.mine-filter {
  padding: 5px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  background: #fff;
  color: #98a2b3;
  font-size: 12px;
  cursor: pointer;
}

.mine-filter.active { border-color: var(--border); color: var(--text-secondary); }

.mine-list { display: grid; gap: 10px; }

.mine-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: #fff;
}

.mine-row .mine-main { display: grid; gap: 4px; min-width: 0; }
.mine-row strong { font-size: 15px; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.mine-row .mine-meta { font-size: 12px; color: var(--text-secondary); overflow-wrap: anywhere; }

.state-chip {
  justify-self: start;
  padding: 2px 9px;
  border-radius: 11px;
  font-size: 11px;
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.state-chip.awaiting-me { background: #fdf3e6; color: #b26a0a; }
.state-chip.needs-more { background: #fdecea; color: #b4402e; }
.state-chip.in-progress { background: #e9f0f1; color: #0e6e7d; }
.state-chip.done { background: var(--surface-muted); color: var(--text-secondary); }
.state-chip.result { background: #e8f4ef; color: #2e9367; }

/* 对比度：#b4bac3 对白底只有 1.95:1、#98a2b3 只有 2.58:1，均低于 WCAG AA 的 4.5:1。
   收敛到 var(--text-secondary)（5.98:1），视觉层级基本不变但可读。 */
.mine-note { margin: 12px 0 0; font-size: 12px; color: var(--text-secondary); }
.mine-empty { color: var(--text-secondary); font-size: 13px; margin: 0; padding: 8px 2px; }

/* 降级横幅：有接口没取到时说明这一屏不完整，避免把故障渲染成空态。 */
.mine-degraded {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid #f0d9a8;
  border-radius: 13px;
  background: #fdf3e6;
  color: #8a5300;
  font-size: 13px;
}
.mine-degraded strong { font-size: 13px; }
.mine-degraded span { flex: 1 1 200px; }
.mine-degraded .error-retry {
  padding: 6px 14px;
  border: 1px solid #e0c48a;
  border-radius: 999px;
  background: #fff;
  color: #8a5300;
  font-size: 13px;
  cursor: pointer;
}

.open-detail {
  padding: 9px 16px;
  border: 1px solid #dde1e5;
  border-radius: 10px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.open-detail.primary { border-color: #0e6e7d; background: #0e6e7d; color: #fff; }

#module-panel .panel-heading h2 { margin: 8px 0 2px; }

/* ---- 单条任务明细：固定五段式，视觉上只有一条任务 ---- */
.task-title { font-size: 19px; margin: 0 0 6px; color: var(--text); overflow-wrap: anywhere; }

.task-block { padding: 18px 0; border-top: 1px solid #f0f1f2; }
.task-block:first-of-type { border-top: 0; padding-top: 6px; }

.task-block-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  color: #a8aeb7;
}

.task-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 18px;
  margin: 0;
}

.task-facts dt { font-size: 12px; color: var(--text-tertiary); }
.task-facts dd { margin: 0; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }

.task-reason { margin: 0; font-size: 14px; color: var(--text-secondary); line-height: 1.65; }
.task-hint { margin: 10px 0 0; font-size: 14px; color: #596270; line-height: 1.6; }

.task-actions { display: grid; gap: 12px; justify-items: start; }
.task-actions .task-comment, .task-actions .pay-ref { width: 100%; }
.task-action { display: grid; gap: 10px; justify-items: start; }

.task-confirm {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.task-confirm-text { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.task-confirm-row { display: flex; gap: 10px; flex-wrap: wrap; }

.task-chain { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.task-chain li { font-size: 13px; color: var(--text-tertiary); }
.task-chain li.current { color: var(--text); font-weight: 600; }

/* 断点与 styles.css 的 760px 对齐：原先本文件用 720px，721–760px 之间会同时
   命中「旧版移动规则 + 新版桌面规则」，出现只在笔记本窄窗口复现的混合布局。 */
@media (max-width: 760px) {
  .columns { max-width: 100%; overflow-x: auto; justify-self: stretch; }
  .column-button { min-width: 62px; padding-inline: 12px; }
  .object-split { grid-template-columns: 1fr; }
  .object-list { border-right: 0; border-bottom: 1px solid var(--border); max-height: 320px; overflow: auto; }
  .object-filters { grid-template-columns: 1fr; }
  .detail-facts,
  .operations-metrics { grid-template-columns: 1fr; }
  .operations-metrics > div { border-right: 0; border-bottom: 1px solid var(--border); }
  .chain-steps { grid-template-columns: repeat(2, 1fr); }
  .app-bar {
    display: block;
    padding: 10px 16px;
  }
  .app-bar .brand { justify-content: center; }
  .header-profile { display: none; }
  .columns {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-sticky);
    display: flex;
    gap: 0;
    padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-radius: 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
  }
  .column-button { flex: 1; min-width: 0; min-height: 48px; padding: 8px 4px; border-radius: var(--radius-sm); font-size: 12px; }
  .content { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .capability-list { grid-template-columns: minmax(0, 1fr); }
  .capability-card { padding: 14px; }
  .capability-state { display: none; }
  .today-focus-card { grid-template-columns: 1fr; gap: 18px; min-height: 0; padding: 22px 20px; }
  .today-focus-action { width: 100%; }
  .work-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .work-summary .summary-card { display: grid; gap: 1px; padding-inline: 5px; text-align: center; }
  .operations-next { align-items: stretch; flex-direction: column; }
  .operations-next-action { width: 100%; }
  .welcome { padding-top: 2vh; }
  .welcome h2 { font-size: 24px; }
  .mine-row { grid-template-columns: minmax(0, 1fr); }
  .mine-row .open-detail { justify-self: stretch; text-align: center; }
  /* 旧版 calc(100vh - 230px) 同样按无顶栏标定，这里交回弹性外壳 */
  #assistant-panel { min-height: 0; }
}

/* 标书任务：待补充项与附件用途询问 */
.task-unresolved { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 5px; }
.task-unresolved li { font-size: 13px; color: #b4402e; overflow-wrap: anywhere; }
.tender-editor { width: min(100%, 720px); display: grid; gap: 14px; }
.tender-editor .field { width: 100%; display: grid; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.tender-editor textarea { width: 100%; min-height: 88px; resize: vertical; }
.tender-unresolved-editor { width: 100%; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.tender-unresolved-editor legend { padding: 0 6px; font-size: 13px; font-weight: 650; color: var(--text); }
.tender-resolved { min-height: 44px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.tender-resolved input { width: 18px; height: 18px; }
.expense-item-list { width: 100%; display: grid; gap: 10px; }
.expense-item-row { width: 100%; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(120px, .45fr) minmax(150px, .55fr) auto; gap: 8px; align-items: center; }
@media (max-width: 700px) { .expense-item-row { grid-template-columns: 1fr; } }

.purpose-ask { display: grid; gap: 10px; }
.purpose-ask p { margin: 0; }
.purpose-options { display: flex; gap: 8px; flex-wrap: wrap; }

/* 3.1 行动界面：同一外壳承载行动、沟通与账号，业务入口按需展开。 */
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 1200; padding: 12px 20px; background: var(--text); color: white; border-radius: 12px; }
.skip-link:focus { top: 12px; }
.workspace { background: var(--canvas); }
.app-bar { padding: 14px max(24px, calc((100vw - 1280px) / 2)); background: var(--surface); border-color: var(--border); }
.brand-mark { background: var(--text); color: white; border-radius: 12px; }
.columns { gap: 6px; padding: 4px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-muted); }
.columns .column-button { min-width: 88px; min-height: 44px; border-radius: 12px; color: var(--text-secondary); font-size: 15px; }
.columns .column-button.active { background: var(--text); color: white; box-shadow: none; }
.content { width: min(1120px, 100%); margin: 0 auto; padding: 40px 32px 64px; min-width: 0; }
.panel { border: 0; background: transparent; box-shadow: none; }
.panel-heading h2, .object-toolbar h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.35; letter-spacing: -.025em; }
.today-heading { padding: 0 0 24px; border: 0; margin: 0; }
.today-heading .eyebrow { color: var(--text-secondary); font-size: 14px; font-weight: 500; margin: 0 0 10px; }
.today-heading h2 { margin: 0 0 10px; }
.today-focus-card { border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 20px; background: var(--surface); color: var(--text); padding: 28px; box-shadow: var(--shadow-sm); gap: 24px; }
.today-focus-card strong { color: var(--text); font-size: clamp(20px, 2.5vw, 26px); line-height: 1.45; }
.today-focus-card p { color: var(--text-secondary); line-height: 1.75; max-width: 62ch; }
.today-focus-kicker { color: var(--brand); font-size: 12px; letter-spacing: .08em; }
.today-focus-card .today-focus-action { flex-shrink: 0; background: var(--brand); color: white; border-radius: 12px; padding: 12px 24px; min-height: 48px; border: 0; box-shadow: none; }
.today-focus-card.all-clear { border-left-color: var(--border-strong); background: var(--surface); }
.work-summary { margin: 20px 0 28px; gap: 12px; }
.work-summary .summary-card { background: transparent; box-shadow: none; border: 1px solid var(--border); border-radius: 14px; }
.mine-section { font-size: 16px; color: var(--text); }
.mine-list { gap: 10px; }
.mine-row { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; box-shadow: none; }
.mine-main strong { line-height: 1.5; }
.mine-row .open-detail { border: 1px solid var(--border); background: var(--surface); color: var(--text); min-height: 44px; border-radius: 10px; }
.mine-row .open-detail.primary { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.mine-meta { color: var(--text-secondary); line-height: 1.6; }
.mine-rest-head { margin-top: 28px; gap: 12px; flex-wrap: wrap; }
.mine-filters { gap: 6px; flex-wrap: wrap; }
.mine-filter { min-height: 44px; color: var(--text-secondary); }
.mine-filter.active { background: var(--text); color: white; }
.supporting-tools { margin-top: 32px; border-top: 1px solid var(--border); padding-top: 8px; }
.supporting-tools > summary { padding: 16px 0; cursor: pointer; min-height: 52px; }
.tools-hint { margin-left: 14px; color: var(--text-secondary); font-size: 13px; font-weight: 400; }
.secondary-navigation { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 18px; }
.secondary-navigation .column-button { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-height: 48px; }
.capability-list { gap: 12px; }
.capability-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: none; }
.capability-card:hover, .mine-row:hover { border-color: var(--border-strong); box-shadow: none; }
.assistant-panel { max-width: 820px; margin: 0 auto; border: 1px solid var(--border); background: var(--surface); border-radius: 20px; overflow: hidden; }
.conversation-context { background: var(--surface-muted); color: var(--text-secondary); border-color: var(--border); padding: 16px 24px; }
.conversation { background: var(--surface); padding: 24px; }
.welcome { text-align: left; padding: 28px 12px; }
.welcome h2 { font-size: 30px; color: var(--text); }
.welcome > p { color: var(--text-secondary); line-height: 1.8; }
.suggestions { justify-content: flex-start; }
.suggestion { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 12px; min-height: 44px; }
.composer { background: var(--surface); padding: 16px 24px; border-top: 1px solid var(--border); }
.composer textarea { border-radius: 14px; background: var(--surface-muted); min-height: 90px; }
#module-panel .panel-heading { align-items: flex-start; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
#module-panel .panel-heading h2 { margin: 16px 0 6px; }
#module-back, #module-refresh { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.task-block { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 20px; }
.action-overview { padding: 28px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 20px; }
.action-overview .task-title { margin: 10px 0 12px; color: var(--text); line-height: 1.4; }
.action-overview .task-hint { color: var(--text-secondary); line-height: 1.8; white-space: pre-wrap; }
.action-status { display: inline-block; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 600; padding: 5px 10px; }
.action-next { padding: 12px 16px; background: var(--surface-muted); border-radius: 12px; line-height: 1.7; }
.action-materials { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; margin: 14px 0; overflow-wrap: anywhere; }
.action-materials summary { cursor: pointer; min-height: 44px; display: list-item; align-content: center; font-weight: 600; }
.action-materials blockquote { border-left: 3px solid var(--border-strong); padding-left: 16px; margin-left: 0; color: var(--text-secondary); }
.action-feedback { display: grid; justify-items: stretch; gap: 12px; padding: 24px; border: 1px solid var(--border); border-radius: 20px; margin-top: 24px; background: var(--surface); }
.action-feedback h3 { margin: 0 0 4px; }
.action-feedback label { display: grid; gap: 8px; margin: 0; font-size: 14px; color: var(--text-secondary); }
.action-feedback textarea { min-height: 140px; resize: vertical; }
.action-feedback select { min-height: 48px; }
.action-feedback select, .action-feedback textarea { margin: 0; width: 100%; padding: 12px 14px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; }
.action-feedback button { justify-self: end; min-width: 160px; }
.action-feedback [role=status]:empty { display: none; }
.action-feedback [role=status] { margin: 0; padding: 12px; border-radius: 10px; background: var(--surface-muted); }
.me-card { max-width: 660px; border: 1px solid var(--border); border-radius: 20px; padding: 28px; background: var(--surface); box-shadow: none; }
.me-actions { max-width: 660px; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.object-toolbar, .object-filters, .object-split { color: var(--text); }
.object-list, .customer-hospital-head { background: var(--surface-muted); }
.login-shell { background: var(--canvas); }
.login-stage { border-color: var(--border); box-shadow: var(--shadow-floating); }
.login-intro { background: var(--text); }
.login-intro::after { border-color: rgba(255,209,102,.2); }
.login-promise h1 { font-size: clamp(28px, 3.5vw, 42px); line-height: 1.4; }
.login-intro .eyebrow { color: #FFD166; }
.login-card-primary { align-content: center; }
:where(summary):focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; }
@media (max-width: 760px) {
  .app-bar { grid-template-columns: minmax(0,1fr) auto; padding: 12px 16px; gap: 12px; }
  .columns { grid-column: 1 / -1; grid-row: 2; width: 100%; display: flex; }
  .columns .column-button { flex: 1; min-width: 0; padding: 8px; }
  .header-profile { grid-column: 2; grid-row: 1; }
  .content { padding: 24px 16px calc(96px + env(safe-area-inset-bottom)); }
  .today-focus-card { padding: 22px; flex-direction: column; align-items: stretch; }
  .today-focus-card .today-focus-action { width: 100%; }
  .tools-hint { display: block; margin: 6px 0 0 18px; }
  .mine-row { padding: 16px; }
  .action-overview, .action-feedback { padding: 20px; }
  .action-feedback button { width: 100%; }
  .assistant-panel { border-radius: 16px; }
  .conversation, .composer, .conversation-context { padding: 16px; }
  .welcome { padding: 16px 0; }
  .login-stage { min-height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
