/* 企业智能中枢系统 · v6 产品化界面 */

:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef1f3;
  --ink: #1d2421;
  --ink-2: #37413d;
  --muted: #5f6b66;
  --faint: #66726d;
  --line: #e0e4e2;
  --line-strong: #cfd5d2;
  --brand: #20715f;
  --brand-dark: #155749;
  --brand-soft: #e7f1ed;
  --orange: #9a6029;
  --orange-soft: #fbf3e9;
  --red: #a44742;
  --red-soft: #f9eceb;
  --blue: #426a82;
  --blue-soft: #edf3f6;
  --green: #26705a;
  --green-soft: #e9f3ee;
  --r-lg: 10px;
  --r-md: 8px;
  --r-sm: 6px;
  --topbar: 52px;
}

html,
body,
#app {
  background: var(--bg);
}

body {
  line-height: 1.5;
}

.app-shell {
  grid-template-rows: var(--topbar) minmax(0, 1fr);
}

.global-rail {
  padding: 10px 7px;
}

.global-rail .brand-mark {
  width: 32px;
  height: 32px;
  margin-bottom: 16px;
  border-radius: 7px;
}

.rail-btn {
  min-height: 51px;
  border-radius: 6px;
}

.context-nav,
.topbar {
  background: #fff;
}

.context-head {
  padding-inline: 15px;
}

.context-scroll {
  padding: 12px 9px;
}

.nav-group {
  margin-bottom: 15px;
}

.nav-label {
  padding-bottom: 5px;
  font-size: 11px;
}

.nav-item {
  height: 34px;
  border-radius: 5px;
}

.nav-item.active {
  background: #e8f1ed;
  box-shadow: inset 2px 0 0 var(--brand);
}

.topbar {
  padding-inline: 14px;
}

.search-btn {
  height: 31px;
  border-radius: 6px;
  background: #f7f8f9;
}

.env-tag {
  background: #f7f8f9;
}

.workspace {
  padding: 18px 20px 32px;
  background: var(--bg);
}

.page {
  max-width: none;
  animation: none;
}

.v6-page {
  min-width: 0;
}

.page-head.v6-page-head {
  min-height: 52px;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.v6-title-block {
  min-width: 0;
}

.page-head h1 {
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.page-head p {
  margin-top: 3px;
  max-width: 72ch;
  font-size: 12px;
  color: var(--muted);
}

.page-actions {
  gap: 7px;
}

.scope {
  max-width: 240px;
  height: 30px;
  padding-inline: 8px;
  border-radius: 5px;
  background: #fff;
}

.btn {
  min-height: 34px;
  border-radius: 6px;
  padding: 0 12px;
}

.btn.primary {
  box-shadow: none;
}

.surface,
.tile,
.alert-strip,
.summary,
.error-state {
  border-radius: 8px;
  box-shadow: none;
}

.surface {
  border-color: var(--line);
  background: #fff;
}

.surface-header {
  min-height: 52px;
  padding: 12px 14px;
}

.surface-header h2 {
  font-size: 14px;
}

.surface-header p {
  font-size: 11px;
}

.tabs {
  margin-bottom: 10px;
  border-bottom-color: var(--line);
}

.tab {
  min-height: 34px;
  border-radius: 5px 5px 0 0;
}

.tag,
.status,
.chip {
  border-radius: 5px;
}

.drawer,
.analysis-panel {
  border-radius: 10px 0 0 10px;
}

.popover,
.command-box {
  border-radius: 10px;
}

.v6-panel {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.v6-panel > header,
.v6-section-title {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.v6-panel > header h2,
.v6-section-title h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}

.v6-panel > header p {
  margin: 2px 0 0;
  color: var(--faint);
  font-size: 11px;
}

.v6-panel > header button,
.v6-section-title button {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 5px;
  font-size: 12px;
}

.v6-fact-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.v6-fact {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.v6-fact:last-child {
  border-right: 0;
}

.v6-fact span,
.v6-fact strong,
.v6-fact small {
  display: block;
}

.v6-fact span {
  color: var(--muted);
  font-size: 11px;
}

.v6-fact strong {
  margin-top: 3px;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.v6-fact small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 11px;
}

.v6-work-summary,
.v6-exec-band,
.v6-portal-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.v6-work-summary > div,
.v6-exec-band > div,
.v6-portal-strip > div {
  min-width: 0;
  padding: 11px 14px;
  border-right: 1px solid var(--line);
}

.v6-work-summary > div:last-child,
.v6-exec-band > div:last-child,
.v6-portal-strip > div:last-child {
  border-right: 0;
}

.v6-work-summary span,
.v6-work-summary strong,
.v6-work-summary small,
.v6-exec-band span,
.v6-exec-band strong,
.v6-exec-band small,
.v6-portal-strip span,
.v6-portal-strip strong,
.v6-portal-strip small {
  display: block;
}

.v6-work-summary span,
.v6-exec-band span,
.v6-portal-strip span {
  color: var(--muted);
  font-size: 11px;
}

.v6-work-summary strong,
.v6-exec-band strong,
.v6-portal-strip strong {
  margin-top: 2px;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.v6-work-summary small,
.v6-exec-band small,
.v6-portal-strip small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 11px;
}

.v6-work-summary .v6-summary-alert,
.v6-exec-band .attention {
  background: var(--orange-soft);
}

.v6-workbench {
  height: calc(100svh - var(--topbar) - 158px);
  min-height: 520px;
  display: grid;
  grid-template-columns: 172px minmax(300px, 0.82fr) minmax(410px, 1.18fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.v6-view-rail {
  min-width: 0;
  padding: 10px 8px;
  background: #f7f8f9;
  border-right: 1px solid var(--line);
  overflow: auto;
}

.v6-view-head {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px 6px;
  color: var(--muted);
  font-size: 11px;
}

.v6-view-head button {
  width: 26px;
  height: 26px;
  padding: 5px;
  border: 0;
  background: transparent;
  color: var(--faint);
}

.v6-view-rail > button,
.v6-saved button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-2);
  text-align: left;
  font-size: 12px;
}

.v6-view-rail > button span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.v6-view-rail > button .icon {
  width: 15px;
  height: 15px;
}

.v6-view-rail > button:hover,
.v6-saved button:hover {
  background: #edf0f1;
}

.v6-view-rail > button.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}

.v6-view-rail > button b {
  min-width: 20px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 500;
  text-align: right;
}

.v6-saved {
  margin-top: 15px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.v6-saved > span {
  display: block;
  padding: 0 7px 5px;
  color: var(--faint);
  font-size: 11px;
}

.v6-object-list {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.v6-list-toolbar {
  min-height: 49px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.v6-list-toolbar > button {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  white-space: nowrap;
  font-size: 11px;
}

.v6-list-toolbar > button .icon {
  width: 14px;
  height: 14px;
}

.v6-search {
  min-width: 0;
  flex: 1;
  height: 31px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  background: #f7f8f9;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--faint);
}

.v6-search .icon {
  width: 15px;
  height: 15px;
}

.v6-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.v6-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(22, 121, 89, 0.14);
}

.v6-inline-empty {
  min-height: 180px;
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.v6-inline-empty strong {
  color: var(--ink-2);
  font-size: 13px;
}

.v6-inline-empty span {
  font-size: 11px;
}

.v6-list-caption {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.v6-list-caption small {
  color: var(--faint);
}

.v6-list-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.v6-object-row {
  width: 100%;
  min-height: 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.v6-object-row:hover {
  background: #f8faf9;
}

.v6-object-row.selected {
  background: var(--brand-soft);
  box-shadow: inset 3px 0 0 var(--brand);
}

.v6-object-main,
.v6-object-side {
  min-width: 0;
}

.v6-object-main strong,
.v6-object-main small,
.v6-object-side b {
  display: block;
}

.v6-object-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}

.v6-object-main small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.v6-object-side {
  text-align: right;
}

.v6-object-side b {
  margin-bottom: 3px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.v6-object-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--faint);
  font-size: 11px;
}

.v6-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
}

.v6-state i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--blue);
}

.v6-state.ok i {
  background: var(--green);
}

.v6-state.warn i {
  background: var(--orange);
}

.v6-state.bad {
  color: var(--red);
}

.v6-state.bad i {
  background: var(--red);
}

.v6-inspector {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: #fff;
}

.v6-inspector-head {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.v6-inspector-head > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.v6-inspector-head > div > span:last-child {
  min-width: 0;
}

.v6-inspector-head strong,
.v6-inspector-head small {
  display: block;
}

.v6-inspector-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.v6-inspector-head small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 11px;
}

.v6-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 650;
}

.v6-avatar.rose {
  background: var(--red-soft);
  color: var(--red);
}

.v6-avatar.sand {
  background: var(--orange-soft);
  color: var(--orange);
}

.v6-avatar.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.v6-inspector-section {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.v6-inspector-section h3 {
  margin: 0 0 9px;
  font-size: 12px;
  font-weight: 650;
}

.v6-inspector-section > p {
  margin: 0 0 10px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.65;
}

.v6-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 16px;
}

.v6-meta span,
.v6-meta strong {
  display: block;
}

.v6-meta span {
  color: var(--faint);
  font-size: 10px;
}

.v6-meta strong {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.v6-note {
  display: flex;
  gap: 8px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.v6-note i {
  width: 4px;
  height: 4px;
  flex: 0 0 4px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--brand);
}

.v6-section-title {
  min-height: 24px;
  padding: 0 0 7px;
  border: 0;
}

.v6-section-title h3 {
  font-size: 12px;
}

.v6-section-title button {
  padding: 0;
  font-size: 11px;
}

.v6-activity > div {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  padding: 5px 0;
  font-size: 11px;
}

.v6-activity time {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.v6-activity span {
  color: var(--muted);
}

.v6-activity b {
  margin-right: 6px;
  color: var(--ink-2);
  font-weight: 600;
}

.v6-ai-utility {
  margin: 12px 14px;
  padding: 10px 11px;
  border: 1px solid #d8e7e1;
  border-radius: 7px;
  background: #f5faf8;
}

.v6-ai-utility,
.v6-ai-utility > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.v6-ai-utility > div {
  min-width: 0;
  justify-content: flex-start;
}

.v6-ai-utility .icon {
  width: 17px;
  height: 17px;
  color: var(--brand);
}

.v6-ai-utility strong,
.v6-ai-utility small {
  display: block;
}

.v6-ai-utility strong {
  font-size: 11px;
}

.v6-ai-utility small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.v6-ai-utility button {
  border: 0;
  background: transparent;
  color: var(--brand);
  white-space: nowrap;
  font-size: 11px;
}

.v6-inspector-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: auto;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.v6-exec-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(290px, 0.8fr);
  gap: 10px;
  margin-bottom: 10px;
}

.v6-decision-row {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 32px minmax(260px, 1fr) 110px 95px 78px;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.v6-decision-row:last-child {
  border-bottom: 0;
}

.v6-decision-row:hover,
.v6-pulse-row:hover {
  background: #f8faf9;
}

.v6-decision-main {
  min-width: 0;
}

.v6-decision-main strong,
.v6-decision-main small,
.v6-decision-owner b,
.v6-decision-owner small,
.v6-decision-value b,
.v6-decision-value small {
  display: block;
}

.v6-decision-main strong {
  font-size: 13px;
}

.v6-decision-main small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.v6-decision-owner b,
.v6-decision-value b {
  font-size: 11px;
  font-weight: 600;
}

.v6-decision-owner small,
.v6-decision-value small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
}

.v6-decision-value {
  text-align: right;
}

.v6-exec-side {
  overflow: hidden;
}

.v6-trend-rows {
  padding: 10px 14px;
}

.v6-trend-rows > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  padding: 6px 0;
}

.v6-trend-rows span,
.v6-trend-rows b {
  font-size: 11px;
}

.v6-trend-rows b {
  font-variant-numeric: tabular-nums;
}

.v6-trend-rows i {
  grid-column: 1 / -1;
  width: var(--w);
  height: 3px;
  border-radius: 2px;
  background: var(--brand);
}

.v6-trend-rows i.warn {
  background: var(--orange);
}

.v6-exec-note {
  margin: 0 14px 14px;
  padding: 11px;
  border: 1px solid #eadfcd;
  border-radius: 7px;
  background: var(--orange-soft);
}

.v6-exec-note strong {
  font-size: 12px;
}

.v6-exec-note p {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.v6-exec-note button {
  border: 0;
  background: transparent;
  color: var(--orange);
  padding: 0;
  font-size: 11px;
}

.v6-pulse-head,
.v6-pulse-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 0.75fr 0.85fr 70px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}

.v6-pulse-head {
  min-height: 31px;
  background: #f7f8f9;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}

.v6-pulse-row {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
  font-size: 12px;
}

.v6-pulse-row:last-child {
  border-bottom: 0;
}

.v6-pulse-row span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.v6-portal-grid {
  display: grid;
  grid-template-columns: 176px minmax(380px, 1.35fr) minmax(320px, 0.9fr);
  gap: 10px;
  align-items: start;
}

.v6-portal-nav {
  padding: 9px 8px;
}

.v6-portal-nav > strong {
  display: block;
  padding: 5px 8px 8px;
  color: var(--faint);
  font-size: 11px;
}

.v6-portal-nav button {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
}

.v6-portal-nav button:hover,
.v6-portal-nav button.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.v6-portal-nav button span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.v6-portal-nav button .icon {
  width: 15px;
  height: 15px;
}

.v6-portal-nav button b {
  color: var(--faint);
  font-size: 11px;
}

.v6-portal-nav hr {
  margin: 8px 5px;
  border: 0;
  border-top: 1px solid var(--line);
}

.v6-task-list > button {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 76px 70px;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.v6-task-list > button:hover {
  background: #f8faf9;
}

.v6-check {
  width: 16px;
  height: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.v6-task-list strong,
.v6-task-list small {
  display: block;
}

.v6-task-list strong {
  font-size: 12px;
}

.v6-task-list small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
}

.v6-task-list time {
  color: var(--muted);
  font-size: 11px;
}

.v6-ask {
  margin: 12px;
  padding: 12px;
  border: 1px solid #dce8e3;
  border-radius: 7px;
  background: #f7faf9;
}

.v6-ask > div:first-child {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
}

.v6-ask > div:first-child .icon {
  width: 18px;
  height: 18px;
  color: var(--brand);
}

.v6-ask strong,
.v6-ask small {
  display: block;
}

.v6-ask strong {
  font-size: 12px;
}

.v6-ask small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.v6-ask > div:last-child {
  display: flex;
  gap: 7px;
}

.v6-ask input {
  min-width: 0;
  flex: 1;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  outline: 0;
  font-size: 12px;
}

.v6-ask input:focus-visible {
  border-color: var(--brand);
  outline: 2px solid rgba(22, 121, 89, 0.16);
  outline-offset: 1px;
}

.v6-arrow-action .icon,
.sort-btn .icon,
.v6-analysis-panel section button .icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.v6-analysis-panel .analysis-head > div {
  display: grid;
  gap: 2px;
}

.v6-analysis-panel .analysis-head span {
  color: var(--faint);
  font-size: 10px;
}

.v6-analysis-panel .analysis-body h2 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.4;
}

.v6-analysis-lead {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
}

.v6-analysis-points {
  display: grid;
  gap: 8px;
  margin: 16px 0 20px;
}

.v6-analysis-points > div {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.6;
}

.v6-analysis-points .icon {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: var(--brand);
}

.v6-analysis-panel section h3 {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.v6-analysis-panel section button {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  text-align: left;
  font-size: 11px;
}

.v6-analysis-panel section button b {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #eef1ef;
  color: var(--muted);
  font-size: 10px;
}

.v6-portal-side {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.v6-app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 7px;
}

.v6-app-grid button {
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  gap: 2px 9px;
  padding: 9px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  text-align: left;
}

.v6-app-grid button:hover {
  background: #f4f7f5;
}

.v6-app-grid button > span {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand);
  padding: 7px;
}

.v6-app-grid strong {
  align-self: end;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.v6-app-grid small {
  overflow: hidden;
  color: var(--faint);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.v6-object-row[hidden] {
  display: none;
}

.v6-schedule > div {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}

.v6-schedule > div:last-child {
  border-bottom: 0;
}

.v6-schedule time {
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.v6-schedule strong,
.v6-schedule small {
  display: block;
}

.v6-schedule strong {
  font-size: 11px;
}

.v6-schedule small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
}

.v6-register {
  min-height: 460px;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.v6-register-views {
  padding: 10px 8px;
  background: #f7f8f9;
  border-right: 1px solid var(--line);
}

.v6-register-views > div {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px 5px;
  color: var(--muted);
  font-size: 11px;
}

.v6-register-views > div button {
  width: 24px;
  height: 24px;
  padding: 5px;
  border: 0;
  background: transparent;
}

.v6-register-views > button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
}

.v6-register-views > button span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.v6-register-views > button .icon {
  width: 15px;
  height: 15px;
}

.v6-register-views > button.active,
.v6-register-views > button:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.v6-register-views > button b {
  color: var(--faint);
  font-size: 11px;
}

.v6-register-views hr {
  margin: 10px 5px;
  border: 0;
  border-top: 1px solid var(--line);
}

.v6-register-views > small {
  display: block;
  padding: 0 7px 5px;
  color: var(--faint);
  font-size: 10px;
}

.v6-register-main {
  border: 0;
  border-radius: 0;
}

.v6-register-main .table-toolbar {
  min-height: 50px;
  padding: 8px 10px;
}

.v6-register-main .v6-search {
  max-width: 320px;
}

.data-table-wrap {
  border-radius: 0;
}

.data-table th {
  height: 34px;
  background: #f7f8f9;
}

.data-table td {
  height: 46px;
}

.data-table tbody tr:hover {
  background: #f7faf8;
}

.pagination {
  min-height: 45px;
}

@media (max-width: 1180px) {
  .v6-workbench {
    grid-template-rows: 46px minmax(0, 1fr);
    grid-template-columns: minmax(300px, 0.85fr) minmax(400px, 1.15fr);
  }

  .v6-view-rail {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .v6-view-head,
  .v6-saved {
    display: none;
  }

  .v6-view-rail > button {
    width: auto;
    min-width: max-content;
  }

  .v6-object-list {
    grid-column: 1;
    grid-row: 2;
  }

  .v6-inspector {
    grid-column: 2;
    grid-row: 2;
  }

  .v6-portal-grid {
    grid-template-columns: 160px minmax(360px, 1fr);
  }

  .v6-portal-side {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .v6-decision-row {
    grid-template-columns: 32px minmax(220px, 1fr) 96px 82px 70px;
  }
}

@media (max-width: 900px) {
  .workspace {
    padding: 14px 12px 28px;
  }

  .page-head.v6-page-head {
    display: block;
    min-height: 0;
    margin-bottom: 12px;
  }

  .page-head h1 {
    font-size: 20px;
  }

  .page-actions {
    display: flex;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .page-actions .scope {
    display: none;
  }

  .env-tag {
    display: inline-flex;
    white-space: nowrap;
  }

  .v6-fact-strip,
  .v6-work-summary,
  .v6-exec-band,
  .v6-portal-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v6-fact:nth-child(2),
  .v6-work-summary > div:nth-child(2),
  .v6-exec-band > div:nth-child(2),
  .v6-portal-strip > div:nth-child(2) {
    border-right: 0;
  }

  .v6-fact:nth-child(-n + 2),
  .v6-work-summary > div:nth-child(-n + 2),
  .v6-exec-band > div:nth-child(-n + 2),
  .v6-portal-strip > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .v6-workbench {
    height: auto;
    min-height: 0;
    display: block;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .v6-view-rail {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    padding: 0;
    overflow-x: auto;
    border: 0;
    background: transparent;
  }

  .v6-view-head,
  .v6-saved {
    display: none;
  }

  .v6-view-rail > button {
    width: auto;
    min-width: max-content;
    min-height: 38px;
    border: 1px solid var(--line);
    background: #fff;
  }

  .v6-object-list,
  .v6-inspector {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .v6-object-list {
    margin-bottom: 10px;
  }

  .v6-list-scroll {
    max-height: 390px;
  }

  .v6-inspector {
    max-height: none;
  }

  .v6-list-toolbar > button {
    min-height: 36px;
  }

  .v6-search {
    height: 36px;
  }

  .v6-exec-grid,
  .v6-portal-grid,
  .v6-portal-side {
    grid-template-columns: 1fr;
  }

  .v6-portal-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v6-portal-nav > strong,
  .v6-portal-nav hr {
    grid-column: 1 / -1;
  }

  .v6-portal-side {
    grid-column: auto;
  }

  .v6-decision-row {
    min-height: 86px;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 7px 9px;
  }

  .v6-decision-main {
    grid-column: 2 / 4;
  }

  .v6-decision-owner {
    grid-column: 2;
  }

  .v6-decision-value {
    display: none;
  }

  .v6-pulse-head {
    display: none;
  }

  .v6-pulse-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 5px 10px;
    padding-block: 9px;
  }

  .v6-pulse-row span:nth-of-type(2),
  .v6-pulse-row span:nth-of-type(3) {
    display: none;
  }

  .v6-register {
    display: block;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .v6-register-views {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    padding: 0;
    overflow-x: auto;
    border: 0;
    background: transparent;
  }

  .v6-register-views > div,
  .v6-register-views hr,
  .v6-register-views > small {
    display: none;
  }

  .v6-register-views > button {
    width: auto;
    min-width: max-content;
    min-height: 38px;
    border: 1px solid var(--line);
    background: #fff;
  }

  .v6-register-main {
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .v6-task-list > button {
    min-height: 68px;
    grid-template-columns: 18px minmax(0, 1fr) auto;
  }

  .v6-task-list .v6-state {
    grid-column: 2 / 4;
  }

  .v6-app-grid button {
    min-height: 82px;
  }

  .btn,
  .v6-panel > header button,
  .v6-section-title button,
  .v6-ai-utility button,
  .v6-exec-note button {
    min-height: 38px;
  }
}

@media (max-width: 520px) {
  .v6-fact-strip,
  .v6-work-summary,
  .v6-exec-band,
  .v6-portal-strip {
    grid-template-columns: 1fr 1fr;
  }

  .v6-fact,
  .v6-work-summary > div,
  .v6-exec-band > div,
  .v6-portal-strip > div {
    padding: 10px 11px;
  }

  .v6-fact strong,
  .v6-work-summary strong,
  .v6-exec-band strong,
  .v6-portal-strip strong {
    font-size: 17px;
  }

  .v6-list-toolbar > button:last-child {
    display: none;
  }

  .v6-object-row {
    min-height: 102px;
  }

  .v6-kv-grid {
    grid-template-columns: 1fr 1fr;
  }

  .v6-portal-nav {
    grid-template-columns: 1fr 1fr;
  }

  .v6-app-grid {
    grid-template-columns: 1fr;
  }

  .v6-pulse-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .v6-pulse-row span:nth-of-type(1) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .v6-object-row,
  .v6-panel,
  .v6-inspector,
  .v6-workbench {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   AI 分析工作台
   会话历史 / 主对话 / 引用与口径 / 底部输入。
   页面内容区不加阴影，只保留 1px 描边与主色状态点。
   ========================================================================== */

.ai-page {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ai-workbench {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 288px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.ai-workbench h1,
.ai-workbench h2,
.ai-workbench h3,
.ai-workbench p,
.ai-workbench ol,
.ai-workbench dl,
.ai-workbench dd,
.ai-workbench dl dt {
  margin: 0;
}

.ai-workbench .icon svg {
  stroke-width: 1.6;
}

/* ---------- 左栏：会话历史 ---------- */

.ai-rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.ai-rail-head {
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
}

.ai-rail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ai-rail-title-row strong {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.ai-rail-close {
  display: none;
}

.ai-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.14s;
}

.ai-new:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.ai-new .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.ai-search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  margin-top: 8px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--faint);
}

.ai-search .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.ai-search input {
  width: 100%;
  height: 30px;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 12px;
  color: var(--ink);
}

.ai-search:focus-within {
  border-color: var(--brand);
}

.ai-rail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 8px 12px;
}

.ai-group + .ai-group {
  margin-top: 8px;
}

.ai-group-label {
  display: block;
  padding: 6px 8px 4px;
  font-size: 12px;
  color: var(--faint);
}

.ai-session {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 8px 10px 8px 11px;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  color: var(--ink-2);
  transition:
    background 0.12s,
    border-color 0.12s;
}

.ai-session:hover {
  background: var(--surface-2);
  border-color: var(--line);
  border-left-color: var(--line);
}

.ai-session.is-active {
  background: var(--brand-soft);
  border-color: transparent;
  border-left-color: var(--brand);
}

.ai-session-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ai-session.is-active .ai-session-title {
  color: var(--brand-dark);
  font-weight: 600;
}

.ai-session-meta {
  overflow: hidden;
  font-size: 12px;
  color: var(--faint);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-session-meta span {
  margin: 0 4px;
  opacity: 0.7;
}

.ai-rail-empty {
  padding: 16px 8px;
  font-size: 12px;
  color: var(--faint);
}

.ai-rail-foot {
  padding: 9px 12px 11px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--faint);
}

/* ---------- 中栏：主对话 ---------- */

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

.ai-head {
  border-bottom: 1px solid var(--line);
}

.ai-head-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  max-width: 808px;
  margin: 0 auto;
  padding: 12px 24px 10px;
}

.ai-head-copy {
  min-width: 0;
}

.ai-head-copy h1 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.012em;
}

.ai-head-copy p {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.ai-scene {
  color: var(--ink-2);
}

.ai-sep {
  margin: 0 5px;
  color: var(--line-strong);
}

.ai-sessions-btn {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.ai-sessions-btn .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.ai-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ai-thread-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 24px 10px;
}

.ai-user-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.ai-user-msg {
  max-width: 520px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-3);
}

.ai-user-tag {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  color: var(--faint);
}

.ai-user-msg p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.ai-answer {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.ai-answer:last-of-type {
  border-bottom: 0;
}

.ai-answer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-answer-head h2 {
  min-width: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.012em;
  overflow-wrap: anywhere;
}

.ai-answer-head h2:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}

.ai-answer-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-top: 4px;
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}

.ai-answer-badge .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.ai-answer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.ai-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-2);
}

.ai-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.ai-state-warn i {
  background: var(--orange);
}

.ai-state-bad i {
  background: var(--red);
}

.ai-block {
  margin-top: 12px;
}

.ai-block h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.ai-block h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.ai-block-note {
  margin-top: 5px;
  font-size: 12px;
  color: var(--faint);
}

.ai-lead {
  margin-top: 7px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.ai-findings,
.ai-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 8px;
  padding: 0;
  list-style: none;
}

.ai-findings li,
.ai-actions li {
  display: flex;
  gap: 10px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.ai-actions li {
  color: var(--ink);
}

.ai-find-no {
  flex: 0 0 18px;
  padding-top: 3px;
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.ai-answer-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  margin-top: 12px;
}

.ai-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  font-size: 12px;
  color: var(--muted);
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
}

.ai-act:hover {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

.ai-act[aria-pressed='true'] {
  border-color: #cfe0d8;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.ai-act .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.ai-foot-split {
  width: 1px;
  height: 14px;
  margin: 0 4px;
  background: var(--line);
}

.ai-suggests {
  margin-top: 12px;
}

.ai-composer-wrap .ai-suggests {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto 6px;
}

.ai-composer-wrap .ai-suggests-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.ai-composer-wrap .ai-suggest-list {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

.ai-suggests-label {
  font-size: 12px;
  color: var(--faint);
}

.ai-suggest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.ai-suggest-list::-webkit-scrollbar {
  display: none;
}

.ai-suggest {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 8px;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  color: var(--ink-2);
  transition:
    border-color 0.12s,
    color 0.12s,
    background 0.12s;
}

.ai-suggest:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.ai-suggest.is-current {
  border-color: #cfe0d8;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.ai-empty {
  padding: 26px 0 6px;
}

.ai-empty h2 {
  font-size: 16px;
  font-weight: 600;
}

.ai-empty p {
  max-width: 60ch;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- 提交进度 ---------- */

.ai-progress {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.ai-progress[hidden] {
  display: none;
}

.ai-progress-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.ai-progress-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--brand);
}

.ai-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0;
  list-style: none;
}

.ai-step {
  display: grid;
  grid-template-columns: 14px 62px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--faint);
}

.ai-step i {
  width: 8px;
  height: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
}

.ai-step.done i {
  border-color: var(--brand);
  background: var(--brand);
}

.ai-step.active i {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(32, 113, 95, 0.12);
}

.ai-step-name {
  color: var(--ink-2);
}

.ai-step.active .ai-step-name {
  color: var(--brand-dark);
  font-weight: 600;
}

.ai-step-hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-step-state {
  text-align: right;
}

.ai-step.done .ai-step-state {
  color: var(--green);
}

.ai-step.active .ai-step-state {
  color: var(--brand-dark);
}

/* ---------- 底部输入 ---------- */

.ai-composer-wrap {
  padding: 0 24px 12px;
}

.ai-composer {
  max-width: 760px;
  margin: 0 auto;
  padding: 9px 12px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  transition:
    border-color 0.14s,
    box-shadow 0.14s;
}

.ai-composer:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(32, 113, 95, 0.1);
}

.ai-composer textarea {
  display: block;
  width: 100%;
  min-height: 56px;
  max-height: 132px;
  padding: 1px 2px 6px;
  border: 0;
  background: transparent;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
}

.ai-composer textarea::placeholder {
  color: var(--faint);
}

.ai-error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 6px;
  font-size: 12px;
  color: var(--red);
}

.ai-error[hidden] {
  display: none;
}

.ai-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.ai-composer-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ai-tool {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
}

.ai-tool:hover {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

.ai-tool .icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.ai-context {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 24px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ai-context .icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

.ai-send {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.14s;
}

.ai-send:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.ai-send .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.ai-note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--faint);
}

/* ---------- 右栏：引用与口径 ---------- */

.ai-side {
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 20px;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.ai-side-section + .ai-side-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ai-side-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.ai-side-head h2 {
  font-size: 13px;
  font-weight: 600;
}

.ai-side-head span {
  font-size: 12px;
  color: var(--faint);
}

.ai-side-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--faint);
}

.ai-refs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  padding: 0;
  list-style: none;
}

.ai-ref {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 7px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  text-align: left;
}

.ai-ref:hover {
  border-color: var(--line);
  background: var(--surface-2);
}

.ai-ref-no {
  display: grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 12px;
  color: var(--muted);
}

.ai-ref-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ai-ref-body strong {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.ai-ref-body span {
  font-size: 12px;
  color: var(--faint);
}

.ai-ref > .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-top: 3px;
  color: var(--faint);
}

.ai-limits {
  margin-top: 8px;
  padding: 0;
}

.ai-limits div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.ai-limits div:last-child {
  border-bottom: 0;
}

.ai-limits dt {
  flex: 0 0 auto;
  color: var(--faint);
}

.ai-limits dd {
  text-align: right;
  color: var(--ink-2);
}

.ai-side-empty {
  margin-top: 8px;
  font-size: 12px;
  color: var(--faint);
}

/* ---------- 1180 以下：引用移入主区 ---------- */

.ai-rail-scrim {
  display: none;
}

.ai-cites-inline {
  display: none;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.ai-cites-inline > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
}

.ai-cites-inline > summary::-webkit-details-marker {
  display: none;
}

.ai-cites-inline > summary::after {
  content: '';
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.14s;
}

.ai-cites-inline[open] > summary::after {
  transform: rotate(-135deg);
}

.ai-cites-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
  color: var(--faint);
}

.ai-cites-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 12px 14px;
  border-top: 1px solid var(--line);
}

.ai-cites-group {
  padding-top: 12px;
}

.ai-cites-group h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.ai-cites-group .ai-refs,
.ai-cites-group .ai-limits {
  margin-top: 6px;
}

@media (max-width: 1180px) {
  .ai-workbench {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .ai-composer-wrap .ai-suggest-list {
    flex-wrap: wrap;
    overflow: visible;
  }

  .ai-composer-wrap .ai-suggest {
    flex: 0 1 auto;
    white-space: normal;
  }

  .ai-side {
    display: none;
  }

  .ai-cites-inline {
    display: block;
  }
}

/* ---------- 900 以下：单栏 + 会话抽屉 ---------- */

@media (max-width: 900px) {
  .ai-page {
    height: auto;
    min-height: 0;
  }

  .ai-workbench {
    display: block;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .ai-head {
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .ai-head-inner {
    padding: 10px 12px;
  }

  .ai-sessions-btn {
    display: inline-flex;
  }

  .ai-thread {
    overflow: visible;
  }

  .ai-thread-inner {
    padding: 0 0 8px;
  }

  .ai-cites-body {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .ai-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    width: min(320px, 86vw);
    border-right: 1px solid var(--line);
    box-shadow: 0 10px 30px -12px rgba(18, 26, 22, 0.3);
    transform: translateX(-102%);
    transition: transform 0.18s ease;
  }

  .ai-rail.is-open {
    transform: none;
  }

  .ai-rail-close {
    display: grid;
  }

  .ai-rail-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(18, 26, 22, 0.32);
  }

  .ai-rail-scrim[hidden] {
    display: none;
  }

  .workspace:has(> .ai-page) {
    padding-bottom: 0;
  }

  .ai-composer-wrap {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: 8px 0 10px;
    border-top: 1px solid var(--line);
    background: var(--bg);
  }
}

/* ---------- 520 以下：触控与排布 ---------- */

@media (max-width: 520px) {
  .ai-head-copy h1 {
    font-size: 15px;
  }

  .ai-user-msg {
    max-width: 100%;
  }

  .ai-answer-head {
    display: block;
  }

  .ai-answer-badge {
    margin-top: 4px;
    padding-top: 0;
  }

  .ai-composer-wrap .ai-suggest {
    flex: 0 1 auto;
    width: auto;
    min-height: 44px;
    padding: 8px 10px;
    white-space: normal;
  }

  .ai-new,
  .ai-send {
    min-height: 44px;
  }

  .ai-act {
    min-height: 44px;
    padding: 0 7px;
  }

  .ai-tool {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .ai-composer-bar {
    flex-wrap: wrap;
  }

  .ai-step {
    grid-template-columns: 14px 60px minmax(0, 1fr);
  }

  .ai-step-state {
    display: none;
  }

  .ai-step-hint {
    display: none;
  }
}

@media (max-width: 420px) {
  .ai-context {
    display: none;
  }

  .ai-composer-wrap {
    padding-right: 0;
    padding-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-rail {
    transition: none;
  }

  .ai-cites-inline > summary::after {
    transition: none;
  }

  .ai-step.active i {
    box-shadow: none;
  }
}
