* {
  box-sizing: border-box;
}

/* Design tokens unified below at "UI polish v1" root (was L5, removed 2026-07-09). */

/* Unified keyboard focus-visible (added 2026-07-09). Covers all interactive elements; mouse click keeps box-shadow focus, keyboard gets outline ring. */
.primary-button:focus-visible,
.ghost-button:focus-visible,
.danger-button:focus-visible,
.icon-button:focus-visible,
.model-config-button:focus-visible,
.mode-button:focus-visible,
.nav-item:focus-visible,
.nav-back-button:focus-visible,
.action-link:focus-visible,
.table-link:focus-visible,
.field-inline-action:focus-visible,
.report-action-btn:focus-visible,
.report-action-link:focus-visible,
.period-button:focus-visible,
.create-button:focus-visible,
.text-input:focus-visible,
.field-input:focus-visible,
.field-select:focus-visible,
.field-textarea:focus-visible,
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

html {
  height: 100%;
}

body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:root {
  --site-icp-footer-height: 30px;
}

.site-icp-footer {
  position: relative;
  left: auto;
  bottom: auto;
  z-index: 0;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: var(--site-icp-footer-height);
  padding: 0 12px;
  border: 0;
  border-top: 1px solid rgba(222, 224, 227, 0.72);
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--muted, #646a73);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

.site-icp-footer a {
  color: inherit;
  text-decoration: none;
}

.site-icp-footer a:hover,
.site-icp-footer a:focus-visible {
  color: var(--brand, #1456f0);
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

#login-guard {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #f4f8ff 0%, #f8fbff 45%, #ffffff 100%);
  overflow: hidden;
  color: var(--text);
}

#login-guard::before {
  content: "";
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 9999px;
  background:
    radial-gradient(circle at 30% 30%, rgba(22, 100, 255, 0.16), rgba(22, 100, 255, 0.01) 70%, rgba(22, 100, 255, 0) 100%);
  top: -200px;
  right: -220px;
  pointer-events: none;
}

#login-guard::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 9999px;
  background:
    radial-gradient(circle at 25% 25%, rgba(22, 119, 255, 0.12), rgba(22, 119, 255, 0.01) 70%, rgba(22, 119, 255, 0) 100%);
  left: -170px;
  bottom: -150px;
  pointer-events: none;
}

#login-guard .login-card {
  position: relative;
  width: min(520px, 100%);
  border-radius: 12px;
  border: 1px solid var(--ui-line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 56px rgba(12, 40, 98, 0.16);
  backdrop-filter: blur(10px);
}

#login-guard .login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  border-top: 3px solid #0f5cff;
  background: linear-gradient(180deg, rgba(244, 252, 255, 0.94) 0%, rgba(255, 255, 255, 0.65) 42%, rgba(255, 255, 255, 0) 100%);
  z-index: -1;
}

#login-guard .login-card::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -36px;
  width: 170px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0), rgba(22, 119, 255, 0.08));
  opacity: 0.5;
  pointer-events: none;
}

.login-card {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-md);
  padding: 22px;
}


.login-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f0f6ff;
  color: var(--brand);
  font-size: 18px;
  margin-bottom: 10px;
}

.login-subtitle,
.login-message,
.login-note,
.login-tip {
  margin: 10px 0;
  color: var(--muted);
  line-height: 1.6;
  word-break: break-all;
}

.login-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
}

.login-actions {
  margin-top: 14px;
}

#login-guard .primary-button {
  min-height: 40px;
}

.login-fields {
  display: grid;
  gap: 6px;
  margin: 12px 0 10px;
}

.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.text-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel);
}

.text-input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 2px rgba(20, 86, 240, 0.12);
}

#login-note,
#login-tip {
  margin: 4px 0 0;
  font-size: 12px;
}

.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 400px;
  height: calc(100dvh - var(--site-icp-footer-height));
  min-height: 0;
}

.app-shell.overview-mode {
  grid-template-columns: 232px minmax(0, 1fr);
}

.app-shell.report-mode,
.app-shell.overview-mode {
  grid-template-columns: 232px minmax(0, 1fr);
}

.app-shell.report-mode .detail-panel,
.app-shell.overview-mode .detail-panel {
  display: none;
}

.app-shell.report-mode .workspace,
.app-shell.overview-mode .workspace {
  overflow: auto;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text);
}

.brand {
  padding: 6px 8px 10px;
}

.brand-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
}

.brand-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.mode-switch {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  padding: 5px;
}

.mode-button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  padding: 0 10px;
}

.mode-button:hover {
  background: var(--hover);
  color: var(--text);
}

.mode-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.mode-button.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.status-card,
.model-card,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  padding: 12px;
}

.status-card {
  border-left: 3px solid var(--muted-soft);
}

.model-card {
  align-items: flex-start;
  border-left: 3px solid var(--brand);
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.model-card.healthy {
  border-left-color: var(--ok);
  background: var(--ui-success-soft);
}

.model-card.danger {
  border-left-color: var(--danger);
  background: var(--ui-danger-soft);
}

.model-config-button {
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 10px;
}

.model-config-button:hover {
  border-color: var(--brand);
}

.status-card.healthy {
  border-left-color: var(--ok);
  background: var(--ui-success-soft);
}

.status-card.danger {
  border-left-color: var(--danger);
  background: var(--ui-danger-soft);
}

.status-label,
.metric-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.status-text {
  margin-top: 7px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.status-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.status-sync {
  margin-top: 4px;
  color: var(--ui-text-secondary);
  font-size: var(--fs-xs);
  line-height: 1.4;
}

.status-sync:empty {
  display: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.metric-item {
  display: block;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--panel-subtle);
  color: inherit;
  padding: 10px;
  text-align: left;
}

.metric-item:hover {
  border-color: var(--ui-line);
  background: #f4f8ff;
}

.metric-item:active {
  transform: translateY(1px);
}

.metric-number {
  color: var(--brand);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.metric-number.warn {
  color: var(--warn);
}

.metric-label {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 4px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.nav-item span + span {
  flex-shrink: 0;
  min-width: 24px;
  border-radius: 999px;
  background: #eef0f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}

.nav-item:hover {
  background: var(--hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.nav-item.active span + span {
  background: #dbeafe;
  color: var(--brand);
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  /* 不能写 100vh：.app-shell 高度是 calc(100dvh - var(--site-icp-footer-height))，
     而 grid item 写死 100vh 会撑出一条比容器高 30px 的隐式行轨道，
     侧栏/工作区一起被拉到整个视口高，溢出到 ICP 备案页脚区域，
     页脚（正常流、DOM 在后）就压住了 .sidebar-footer 里的模型设置卡下半部分
     —— 即「模型设置卡有时候显示不出来」。用 auto 由 grid stretch 拉满轨道。 */
  height: auto;
  overflow: hidden;
  padding: 20px 22px;
}

.top-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  padding: 10px 12px;
}

.top-status-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.top-status strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 14px;
}

.top-status-meta {
  min-width: 0;
  max-height: 36px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
  overflow-wrap: anywhere;
}

.workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
}

.workspace-head > div:first-child {
  min-width: 0;
}

.workspace-head h1 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
}

.workspace-head p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.head-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.head-actions .nav-back-button {
  border-color: var(--ui-line);
  background: #f5f8ff;
  color: var(--brand);
  font-weight: 600;
  white-space: nowrap;
}

.head-actions .nav-back-button:hover {
  border-color: var(--brand);
  background: #edf4ff;
  color: var(--brand);
}

.period-switch {
  display: flex;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  padding: 4px;
}

.period-button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  padding: 0 10px;
}

.period-button:hover {
  background: var(--hover);
  color: var(--text);
}

.period-button.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.primary-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 6px;
  font-weight: 600;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.primary-button {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #ffffff;
  padding: 0 14px;
}

.primary-button:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

.ghost-button,
.icon-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 0 13px;
}

.ghost-button:hover,
.icon-button:hover {
  border-color: var(--ui-line-strong);
  background: var(--hover);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  flex-shrink: 0;
}

.filter-control select,
.field-input,
.field-select,
.field-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.filter-control select:focus,
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(20, 86, 240, 0.12);
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  min-width: 0;
}

.filter-control {
  min-width: 0;
}

.filter-control span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.filter-control select {
  height: 38px;
  padding: 0 9px;
}

.filter-sort-button {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}

.filter-sort-button:hover {
  background: var(--hover);
}

.filter-sort-button:focus-visible {
  border-color: var(--brand);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(20, 86, 240, 0.12);
}

.database-table-control {
  width: min(100%, 240px);
}

.overview-page {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding-bottom: 20px;
}

.overview-section-grid,
.overview-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.overview-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.overview-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 16px;
}

.overview-panel-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.overview-panel-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.overview-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  flex-shrink: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--brand);
  font-weight: 600;
  padding: 0 6px;
}

.overview-link:hover {
  background: var(--brand-soft);
  color: var(--brand-hover);
}

.overview-panel-body {
  padding: 14px 16px 16px;
}

.overview-bar-list,
.overview-list {
  display: grid;
  gap: 12px;
}

.overview-bar-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  position: relative;
}

.overview-bar-row::after {
  content: attr(data-overview-bar-percent);
  position: absolute;
  top: 50%;
  right: 46px;
  z-index: 2;
  padding: 6px 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 6px;
  background: #111827;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(4px, -50%);
  transition: opacity 0.16s ease, transform 0.16s ease;
  white-space: nowrap;
}

.overview-bar-row:hover::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.overview-bar-label {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f5;
}

.overview-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.overview-bar-fill.warn {
  background: var(--warn);
}

.overview-bar-fill.ok {
  background: var(--ok);
}

.overview-bar-value {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.overview-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-subtle);
  color: inherit;
  padding: 10px;
  text-align: left;
}

.overview-list-item:hover {
  border-color: var(--ui-line-strong);
  background: #fafbfc;
}

.overview-list-item.is-static:hover {
  border-color: var(--line-soft);
  background: var(--panel-subtle);
}

.overview-list-item strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.overview-list-item em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.overview-tag {
  display: inline-flex;
  align-items: center;
  align-self: start;
  height: 24px;
  border-radius: 999px;
  background: #f1f3f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 0 8px;
  white-space: nowrap;
}

.overview-tag.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.overview-tag.danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.overview-empty {
  border: 1px dashed var(--ui-line-strong);
  border-radius: 8px;
  background: var(--panel-subtle);
  color: var(--muted);
  line-height: 1.7;
  padding: 24px 16px;
  text-align: center;
}

.report-page {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding-bottom: 20px;
}

.report-grid {
  display: grid;
  grid-template-columns: 318px minmax(520px, 1fr) 360px;
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.report-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.report-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 16px;
}

.report-panel-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.report-panel-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.report-panel-body {
  padding: 14px 16px 16px;
}

.report-base-status {
  margin-bottom: 12px;
  border: 1px solid #d7eadf;
  border-radius: 8px;
  background: #f7fcf9;
  padding: 10px 12px;
}

.report-base-status strong,
.report-base-status span {
  display: block;
}

.report-base-status.danger {
  border-color: #f0c7c7;
  background: #fff8f8;
}

.report-base-status.danger strong {
  color: #a93232;
}

.report-base-status strong {
  color: #176038;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.report-base-status span {
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.report-center {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.report-center-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.report-center-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.report-center-field span {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.35;
}

.report-center-keyword {
  grid-column: span 3;
}

.report-center-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.report-center-btn {
  min-height: 32px;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 12px;
}

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

.report-center-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.report-center-main {
  min-width: 0;
}

.report-center-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.report-center-title-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

.report-center-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 6px;
  color: var(--muted-soft);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.report-center-main p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.report-center-source-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.report-center-source-tags span {
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 22px;
  padding: 0 8px;
}

.report-center-item-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
}

.report-center-item-action {
  flex: 0 0 auto;
  min-height: 32px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: var(--fw-semibold);
  line-height: 1;
  padding: 0 12px;
  white-space: nowrap;
}

.report-center-action-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.report-center-action-secondary {
  border-color: var(--ui-line);
  background: #ffffff;
  color: var(--text);
}

.report-center-action-draft {
  border-color: var(--ui-line);
  background: #f8fbff;
  color: var(--brand);
}

.report-center-action-delete {
  border-color: #f1c6c6;
  background: #fff;
  color: #c0392b;
}

.report-center-action-delete:hover {
  border-color: #e24b4a;
  background: #fdf0f0;
}

.report-control-group + .report-control-group {
  margin-top: 16px;
}

.report-control-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.report-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fa;
  padding: 4px;
}

.report-segmented.report-segmented-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-segment {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease),
    color var(--ui-motion-hover, 120ms) var(--ui-ease, ease);
}

.report-segment:hover {
  background: var(--hover);
  color: var(--text);
}

.report-segment:focus-visible {
  outline: 2px solid var(--ui-focus, var(--brand));
  outline-offset: -2px;
}

.report-segment.active {
  /* 背景改用主题变量：原先硬编码 #ffffff 在深色主题下会形成亮白块 */
  background: var(--ui-surface, #ffffff);
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(31, 35, 41, 0.08);
}

/* .active 优先级高于 :hover 且写在其后，会盖掉 hover；补选中态的 hover 变体 */
.report-segment.active:hover {
  background: var(--ui-surface-muted, var(--hover));
}

.report-date-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.report-date-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-subtle);
  padding: 9px;
}

.report-date-field span {
  color: var(--muted-soft);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.report-date-field input {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  outline: none;
}

.report-source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.report-source-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-subtle);
  color: var(--text);
  font-weight: 600;
  padding: 0 10px;
}

.report-source-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.report-source-note {
  margin-top: 10px;
  border-radius: 8px;
  background: #f7f8fa;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  padding: 10px;
}

.report-control-inline {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.report-control-inline label {
  min-width: 0;
}

.report-control-inline span {
  color: var(--muted-soft);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.report-polish-source-hint {
  margin: 4px 0 0;
  color: var(--muted-soft);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.report-polish-source-card {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px 10px;
}

.report-polish-source-card strong,
.report-polish-source-card span {
  display: block;
}

.report-polish-source-card strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

.report-polish-source-card span {
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.report-polish-source-card span.error {
  color: #c2410c;
}

.report-polish-direction-grid {
  display: grid;
  grid-template-columns: minmax(140px, 1.3fr) minmax(92px, 0.75fr) minmax(92px, 0.75fr);
  gap: 10px;
}

.report-polish-direction-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.report-polish-direction-field span {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.35;
}

.report-polish-direction-field small {
  min-height: 32px;
  color: var(--muted-soft);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.report-polish-direction-summary {
  margin-top: 10px;
}

.report-polish-hint-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.report-polish-helper-title {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.report-polish-helper-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.report-polish-helper {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--ui-line);
  background: #f3f6ff;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  padding: 0 12px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.report-polish-helper:hover {
  border-color: var(--ui-line-strong);
  background: #f1f5ff;
}

.report-polish-helper:active {
  border-color: var(--ui-line-strong);
}

.report-radio-group {
  display: grid;
  gap: 6px;
}

.report-radio-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  min-height: 30px;
}

.report-radio-item input[type="radio"] {
  accent-color: var(--brand);
}

.report-polish-source-option {
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px 10px;
}

.report-polish-source-option:not(.disabled) {
  cursor: pointer;
}

.report-polish-source-option.disabled {
  background: #f8fafc;
  color: var(--muted-soft);
  cursor: not-allowed;
}

.report-polish-source-option input {
  margin-top: 2px;
}

.report-polish-source-option-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.report-polish-source-option-text strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

.report-polish-source-option-text small {
  color: var(--muted-soft);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.report-polish-source-option.disabled .report-polish-source-option-text strong,
.report-polish-source-option.disabled .report-polish-source-option-text small {
  color: var(--muted-soft);
}

.report-polish-source-option-text .report-polish-source-unavailable {
  color: #b54708;
}

.report-polish-select {
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #fcfdff;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.35;
  padding: 9px 10px;
  outline: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(1em - 2px), calc(100% - 9px) calc(1em - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.report-polish-input {
  min-width: 0;
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #fcfdff;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  padding: 9px 10px;
  outline: none;
}

.report-polish-input:focus,
.report-polish-select:focus {
  border-color: var(--ui-line-strong);
  box-shadow: 0 0 0 2px var(--brand-soft);
}

/* 与下拉/输入框同规格的次级按钮：用于和 report-polish-select 同排对齐（如“管理模版库”）。 */
.report-polish-side-btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #fcfdff;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  padding: 9px 16px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.report-polish-side-btn:hover {
  border-color: var(--ui-line-strong);
  background: #f1f5ff;
  color: var(--brand);
}

.report-polish-side-btn:active {
  border-color: var(--ui-line-strong);
}

/* 自定义报告结果区三按钮：强制一排，等分宽度，不换行。 */
.report-custom-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
}

.report-custom-actions > .report-polish-btn {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}

.report-model-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 8px;
}

.report-model-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.report-model-field-wide {
  grid-column: 1 / -1;
}

.report-model-field span {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.35;
}

.report-model-select {
  width: 100%;
}

.report-polish-textarea {
  min-width: 0;
  width: 100%;
  min-height: 86px;
  margin-top: 6px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  padding: 9px 10px;
  resize: vertical;
}

.report-polish-textarea:focus {
  border-color: var(--ui-line-strong);
  outline: none;
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.report-polish-form {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.report-polish-panel {
  border-radius: 10px;
  border: 1px solid var(--ui-line);
  background: #f7f9ff;
  padding: 10px;
}

.report-polish-field-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.report-polish-field-sub {
  margin: 4px 0 8px;
  color: var(--muted-soft);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.report-polish-inline-actions {
  margin-top: 6px;
}

.report-current-source {
  margin-bottom: 10px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px 12px;
}

.report-current-source.base {
  border-color: var(--ui-line);
  background: #f8fafc;
}

.report-current-source.draft {
  border-color: var(--ui-line);
  background: #f5f9ff;
}

.report-current-source.polished {
  border-color: #bfe2cc;
  background: #f3fbf6;
}

.report-current-source.editing {
  border-color: #f2d2a9;
  background: #fff8ec;
}

.report-current-source strong,
.report-current-source span {
  display: block;
}

.report-current-source strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.report-current-source span {
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.report-draft-status {
  display: flex;
  align-items: center;
  margin: 10px 0;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #f7faff;
  padding: 10px 12px;
}

.report-draft-status > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}

.report-draft-status.ready {
  border-color: #bfe2cc;
  background: #f3fbf6;
}

.report-draft-status.warning {
  border-color: #f2d2a9;
  background: #fff8ec;
}

.report-draft-status strong,
.report-draft-status span {
  display: inline-flex;
  align-items: center;
}

.report-draft-status strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.report-draft-status span {
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.report-polish-pending-status {
  margin-top: 0;
  margin-bottom: 10px;
}

.report-version-panel {
  margin-top: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.report-version-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.report-version-list {
  display: grid;
  gap: 8px;
}

.report-version-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.report-version-item.active {
  border-color: var(--ui-line);
  background: #f5f9ff;
}

.report-final-panel {
  border-top-color: #d7eadf;
}

.report-archive-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  border: 1px solid #bfebd1;
  border-radius: 8px;
  background: #f2fbf6;
  color: var(--ok);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.report-archive-entry:hover {
  background: #e9f8f1;
}

.report-archive-entry:active {
  transform: translateY(1px);
}

.report-final-item {
  border-color: #cde5d5;
  background: #f8fcf9;
}

.report-version-main {
  min-width: 0;
}

.report-version-main strong,
.report-version-main span,
.report-version-main p {
  display: block;
}

.report-version-main strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.report-version-main span {
  margin-top: 2px;
  color: var(--muted-soft);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.report-version-main p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.report-version-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.report-version-btn {
  min-height: 32px;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 12px;
}

.report-version-current {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 6px;
  background: #e8f4ed;
  color: #1f7a42;
  font-size: 12px;
  font-weight: 600;
  padding: 0 8px;
}

.report-badge {
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  line-height: 24px;
  padding: 0 9px;
  white-space: nowrap;
}

.report-badge.light {
  background: #f2f3f5;
  color: var(--muted);
}

.report-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.report-summary-strip.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-summary-item {
  min-width: 0;
  min-height: 102px;
  height: 102px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-subtle);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  gap: 6px;
  box-sizing: border-box;
}

button.report-summary-item {
  appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.report-summary-item.clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.report-summary-item.clickable:hover {
  border-color: var(--ui-line-strong);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.06);
}

.report-summary-item.clickable:active {
  transform: translateY(1px);
}

.report-summary-item.active {
  border-color: var(--ui-line-strong);
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(11, 92, 173, 0.08);
}

.report-summary-strip.compact .report-summary-item {
  min-height: 76px;
  height: 76px;
  padding: 8px 10px;
  gap: 2px;
  justify-content: flex-start;
}

.report-summary-strip.compact .report-summary-number {
  min-height: 24px;
  height: 24px;
  font-size: 22px;
}

.report-summary-strip.compact .report-summary-label {
  min-height: 0;
  height: auto;
  font-size: var(--fs-xs);
  line-height: 1.2;
}

.report-summary-strip.compact .report-summary-item.report-summary-risk {
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  min-height: 64px;
  height: auto;
  align-items: center;
}

.report-summary-strip.compact .report-summary-risk .report-summary-number {
  grid-row: 1 / 3;
}

.report-summary-strip.compact .report-summary-risk .report-summary-label,
.report-summary-strip.compact .report-summary-risk .report-summary-meta {
  grid-column: 2;
}

.report-summary-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.report-summary-number {
  color: var(--brand);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  min-height: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  margin: 0;
  overflow: hidden;
  text-wrap: nowrap;
  font-variant-numeric: tabular-nums;
}

.report-summary-number.purple {
  color: var(--purple);
}

.report-summary-number.ok {
  color: var(--ok);
}

.report-summary-number.warn {
  color: var(--warn);
}

.report-summary-label {
  margin: 0;
  min-height: 38px;
  height: 38px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.report-material-section {
  margin-top: 16px;
}

.report-condition-materials {
  margin-top: 16px;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}

.report-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.report-section-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

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

.report-material-list-scroll {
  max-height: min(420px, calc(100vh - 330px));
  min-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.report-material-list-compact {
  align-content: start;
  grid-auto-rows: max-content;
  margin-top: 10px;
  max-height: min(300px, calc(100vh - 520px));
  overflow: auto;
  padding-right: 2px;
}

.report-material-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}

.report-material-filter-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-material-filter-head span {
  flex-shrink: 0;
  border-radius: 999px;
  background: #f2f3f5;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 22px;
  padding: 0 8px;
}

.report-material-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 76px;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.report-material-list-compact .report-material-card {
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
}

.report-material-list-compact .report-material-type {
  justify-self: start;
}

.report-material-list-compact .report-material-date {
  text-align: left;
}

.report-material-list-compact .report-material-tags {
  margin-top: 6px;
}

.report-material-type {
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 6px 8px;
}

.report-material-type.note {
  background: var(--purple-bg);
  color: var(--purple);
}

.report-material-type.partner {
  background: var(--ok-bg);
  color: var(--ok);
}

.report-material-type.risk {
  background: var(--danger-bg);
  color: var(--danger);
}

.report-material-title {
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-material-desc {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.report-material-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.report-material-tags span {
  border-radius: 6px;
  background: #f2f3f5;
  color: var(--muted);
  font-size: 12px;
  line-height: 22px;
  padding: 0 7px;
}

.report-material-date {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.report-tone-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.report-tone-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.report-tone-card.active {
  border-color: var(--ui-line-strong);
  background: #f4f8ff;
}

.report-tone-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.report-tone-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.report-current-card {
  min-width: 0;
}

.report-version-card,
.report-timeline-card {
  position: sticky;
  top: 0;
}

.report-timeline-card {
  display: flex;
  flex-direction: column;
}

.report-timeline-card .report-panel-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding-right: 4px;
}

.report-timeline-empty {
  border: 0.5px dashed var(--line);
  border-radius: 8px;
  padding: 14px 12px;
  text-align: center;
  background: #fbfdff;
}

.report-timeline-empty strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.report-timeline-empty span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.report-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-timeline-item {
  position: relative;
  border: 0.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  overflow: visible;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.report-timeline-item:hover {
  border-color: var(--ui-line);
  box-shadow: 0 2px 8px rgba(11, 92, 173, 0.06);
}

.report-timeline-item.polish {
  border-left: 2px solid var(--ui-line-strong);
}

.report-timeline-item.polish.active {
  border-left-color: #185fa5;
  background: #f5f9ff;
}

.report-timeline-item.archive {
  border-left: 2px solid #97c459;
}

.report-timeline-item.history {
  border-left: 2px solid var(--ui-line-strong);
}

.report-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.report-timeline-kind {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
}

.report-timeline-item.polish .report-timeline-kind {
  color: #185fa5;
}

.report-timeline-item.archive .report-timeline-kind {
  color: #3b6d11;
}

.report-timeline-time {
  font-size: var(--fs-xs);
  color: var(--muted-soft);
}

.report-timeline-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.report-timeline-meta {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-bottom: 4px;
}

.report-timeline-preview {
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.report-timeline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  margin-top: 8px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.15s ease, max-height 0.2s ease, margin-top 0.2s ease;
}

.report-timeline-item:hover .report-timeline-actions,
.report-timeline-item:focus-within .report-timeline-actions {
  opacity: 1;
  max-height: 60px;
  margin-top: 8px;
}

.report-timeline-btn {
  border: 0.5px solid var(--line);
  /* 背景必须跟随主题：原先硬编码 #fff，而 color 用 var(--text)，
     深色主题下变成浅字压死白底（实测 nocturne 1.1:1 / glass 1.05:1，按钮文字完全消失）。 */
  background: var(--ui-surface, #fff);
  color: var(--ui-text, var(--text));
  font-size: var(--fs-xs);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
}

.report-timeline-btn:hover {
  background: var(--ui-surface-muted, #f3f6fb);
  border-color: var(--ui-line-strong);
}

.report-timeline-btn.primary {
  background: #185fa5;
  color: #fff;
  border-color: #185fa5;
}

.report-timeline-btn.primary:hover {
  background: #0f4a82;
}

.report-version-card .report-version-panel:first-child {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.report-version-card .report-version-head {
  align-items: flex-start;
}

.report-version-card .report-version-head > div {
  min-width: 0;
}

.report-version-card .report-polish-version-panel .report-version-list {
  max-height: min(520px, calc(100vh - 310px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.report-version-card .report-polish-version-panel .report-version-list::-webkit-scrollbar {
  width: 8px;
}

.report-version-card .report-polish-version-panel .report-version-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #c9d4e5;
  background-clip: content-box;
}

.report-version-card .report-polish-version-panel .report-version-list::-webkit-scrollbar-track {
  background: transparent;
}

.report-version-card .report-version-item {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px;
}

.report-version-card .report-version-main strong {
  font-size: 14px;
  line-height: 1.35;
}

.report-version-card .report-version-main span {
  margin-top: 4px;
  font-size: 12px;
}

.report-version-card .report-version-main p {
  display: -webkit-box;
  max-height: 7.5em;
  overflow: hidden;
  color: #667085;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.report-version-card .report-version-item > .report-version-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: stretch;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}

.report-version-card .report-version-item > .report-version-actions .report-version-btn,
.report-version-card .report-version-item > .report-version-actions .report-version-current {
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 0 9px;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.report-version-card .report-version-item > .report-version-actions .report-version-btn:last-child:nth-child(odd),
.report-version-card .report-version-item > .report-version-actions .report-version-current:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.report-action-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.report-action-primary-row,
.report-action-pending-row {
  display: grid;
  gap: 8px;
}

.report-action-primary-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-action-secondary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.report-action-secondary-row.editing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.report-action-utility-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 24px;
}

.report-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  min-height: 36px;
}

.report-action-btn {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
  text-overflow: initial;
  border: 1px solid var(--ui-line-strong);
  background: #f5f7fd;
  color: #1f2b3a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.report-action-btn:hover:not(:disabled) {
  border-color: var(--ui-line-strong);
  background: #edf3ff;
  color: #173f97;
}

.report-action-btn.primary-lite {
  border-color: var(--ui-line-strong);
  background: #edf4ff;
  color: #174ea6;
}

.report-action-btn.final {
  border-color: #a9d8ba;
  background: #f0faf4;
  color: #176038;
}

.report-action-btn.pending {
  border-color: #f3c27a;
  background: #fff7ed;
  color: #9a4b00;
  font-weight: 600;
}

.report-action-btn:disabled {
  background: #f6f8fb;
  border-color: var(--ui-line);
  color: #97a3b7;
  cursor: not-allowed;
  opacity: 1;
}

.report-action-btn:focus-visible {
  outline: 2px solid #8faee8;
  outline-offset: 1px;
}

.report-action-btn.compact {
  min-height: 30px;
  border-color: var(--ui-line);
  background: #fafbfe;
  color: #475569;
  font-size: var(--fs-xs);
  padding: 7px 6px;
}

.report-action-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.4;
  padding: 2px 0;
}

.report-action-inline-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  min-height: 30px;
}

.report-action-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

@media (max-width: 1280px) {
  .report-action-secondary-row {
    align-items: stretch;
  }

  .report-action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .report-center-filter-grid {
    grid-template-columns: 1fr;
  }

  .report-center-keyword {
    grid-column: auto;
  }

  .report-center-item {
    grid-template-columns: 1fr;
  }

  .report-center-item-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    min-width: 0;
  }

  .report-model-grid {
    grid-template-columns: 1fr;
  }

  .report-polish-direction-grid {
    grid-template-columns: 1fr;
  }

  .report-action-primary-row,
  .report-action-secondary-row,
  .report-action-secondary-row.editing {
    grid-template-columns: 1fr;
  }

  .report-action-utility-row {
    justify-content: flex-start;
  }

  .report-action-row {
    grid-template-columns: 1fr;
  }
}

.report-paper {
  min-height: 560px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--ui-surface);
  padding: 20px;
  max-height: min(76vh, 760px);
  overflow: auto;
}

.report-paper-scroll {
  height: min(76vh, 760px);
  min-height: 420px;
}

.report-edit-textarea {
  width: 100%;
  height: min(76vh, 760px);
  min-height: min(76vh, 760px);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
  resize: vertical;
  white-space: pre-wrap;
  outline: none;
}

.report-edit-textarea:focus {
  border-color: var(--ui-line-strong);
  box-shadow: 0 0 0 2px var(--brand-soft);
}

@media (max-width: 1100px) {
  .report-material-list-scroll {
    max-height: min(320px, 46vh);
  }

  .report-paper-scroll {
    max-height: min(52vh, 520px);
  }
}

.report-paper h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}

.report-paper h3 {
  margin: 20px 0 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.report-paper p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.report-paper .report-bullet {
  position: relative;
  padding-left: 14px;
}

.report-paper .report-bullet::before {
  position: absolute;
  left: 0;
  color: var(--brand);
  content: "•";
}

.report-style-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  background: rgba(11, 15, 23, 0.48);
  padding: var(--space-6, 24px);
}

.report-style-dialog {
  width: min(1180px, calc(100vw - var(--space-12, 48px)));
  max-height: min(92dvh, 900px);
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  padding: var(--space-4, 16px);
  display: flex;
  flex-direction: column;
}

.report-polish-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 15, 30, 0.36);
  backdrop-filter: blur(3px);
  overflow: auto;
}

.report-polish-dialog {
  width: min(940px, 100%);
  border-radius: 12px;
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  box-shadow: 0 24px 56px rgba(16, 32, 84, 0.18);
  padding: 16px 16px 18px;
  max-height: min(92vh, 900px);
  overflow: auto;
}

.report-polish-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 12px;
}

.report-polish-dialog-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
}

.report-polish-dialog-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.report-polish-close-btn {
  min-width: 30px;
  min-height: 30px;
  border-radius: 6px;
  padding: 0;
  border-color: var(--ui-line);
  background: #f3f6fd;
  color: #2f3f52;
}

.report-polish-close-btn:hover {
  border-color: var(--ui-line-strong);
  background: #e8efff;
  color: #1f3c82;
}

.report-polish-source-hint {
  margin: 0;
  color: var(--muted-soft);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.report-polish-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  justify-content: end;
  gap: 8px;
  margin-top: 4px;
}

.report-polish-btn {
  min-width: 92px;
  min-height: 34px;
  border-radius: 8px;
}

.report-polish-btn-primary {
  background: #1f53d0;
  border-color: #1f53d0;
}

.report-polish-btn-primary:hover {
  background: #1948b8;
  border-color: #1948b8;
}

.report-polish-review-dialog .report-polish-actions {
  grid-template-columns: repeat(3, minmax(0, auto));
}

.report-polish-review-dialog {
  min-height: min(720px, calc(92dvh - 32px));
}

.report-polish-review-dialog .report-polish-editor {
  flex: 1 1 320px;
  min-height: 240px;
  overflow-y: auto;
}

.model-settings-dialog .report-polish-actions {
  grid-template-columns: repeat(3, minmax(0, auto));
}

.report-polish-editor {
  min-height: 420px;
  border-color: var(--line-soft);
  background: #ffffff;
  color: var(--text);
  box-shadow: none;
  resize: vertical;
}

.report-polish-editor[readonly] {
  background: #fafbfc;
}

.report-polish-feedback-textarea {
  width: 100%;
  min-height: 420px;
}

.report-floating-toast {
  display: none;
  position: fixed;
  left: 50%;
  top: 16px;
  z-index: 320;
  transform: translateX(-50%) translateY(-10px);
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--ui-line);
  background: #f5f8ff;
  color: #1f4fb3;
  font-size: 12px;
  line-height: 1.45;
  max-width: min(560px, calc(100vw - 32px));
  min-height: 30px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 10px 22px rgba(31, 35, 41, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.report-floating-toast.visible {
  display: inline-flex;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.report-floating-toast.danger {
  border-color: #ffd2cc;
  background: var(--danger-bg);
  color: var(--danger);
}

.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.report-toolbar-action {
  min-height: 28px;
}

.report-style-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
}

.report-style-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.report-style-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(60vh, 620px);
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
}

@media (max-width: 1280px) {
  .report-style-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.report-style-card {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #ffffff;
  text-align: left;
  min-width: 0;
  padding: 0;
}

.report-style-card:hover {
  border-color: var(--ui-line-strong);
}

.report-style-card.active {
  border-color: var(--brand);
  box-shadow: 0 2px 10px rgba(47, 97, 255, 0.12);
}

.report-style-preview {
  min-height: 122px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  margin: 9px 10px 11px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 10px;
  color: #1f2937;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  isolation: isolate;
}

.report-style-preview::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 8px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.report-style-ribbon {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--ribbon);
  color: var(--ribbonText, #111827);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 4px 9px;
  line-height: 1.15;
  position: relative;
  z-index: 2;
}

.report-style-sample {
  margin-top: 4px;
  width: 100%;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.66);
  padding: 6px 8px;
  backdrop-filter: blur(2px);
  position: relative;
  z-index: 2;
}

.report-style-sample-kicker {
  margin: 0 0 3px;
  color: #111827;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.2;
}

.report-style-sample-title {
  margin: 0 0 3px;
  color: #0f172a;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  opacity: 0.95;
}

.report-style-sample-line {
  margin: 0;
  color: #1f2937;
  font-size: var(--fs-xs);
  line-height: 1.35;
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: break-word;
}

.report-style-name {
  margin: 0 12px 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.report-style-desc {
  margin: 0 12px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.report-style-preview::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ui-brand) 10%, transparent);
  pointer-events: none;
}

.report-style-preview[data-style-key="executive-brief"]::before {
  background: color-mix(in srgb, var(--ui-brand) 10%, transparent);
}

.report-style-preview[data-style-key="premium-saas"]::before {
  background: color-mix(in srgb, var(--ui-brand) 10%, transparent);
}

.report-style-preview[data-style-key="ai-os"]::before {
  background: color-mix(in srgb, var(--ui-brand) 10%, transparent);
  mask-image: none;
}

.report-style-preview[data-style-key="strategy-canvas"]::before {
  background: color-mix(in srgb, var(--ui-brand) 10%, transparent);
}

.report-style-preview[data-style-key="research-journal"]::before {
  background: color-mix(in srgb, var(--ui-danger) 10%, transparent);
}

.report-style-preview[data-style-key="technical-architecture"]::before {
  background: color-mix(in srgb, var(--ui-brand) 10%, transparent);
}

.report-style-preview[data-style-key="data-room"]::before {
  background: color-mix(in srgb, var(--ui-brand) 10%, transparent);
}

.report-style-preview[data-style-key="modern-editorial"]::before {
  background: color-mix(in srgb, var(--ui-text) 8%, transparent);
}

.report-style-preview[data-style-key="launch-dark"]::before {
  background: color-mix(in srgb, var(--ui-brand) 16%, transparent);
}

.report-style-preview[data-style-key="product-manual"]::before {
  background: color-mix(in srgb, var(--ui-brand) 10%, transparent);
}

.report-style-preview[data-style-key="executive-brief"] .report-style-sample-title,
.report-style-preview[data-style-key="premium-saas"] .report-style-sample-title,
.report-style-preview[data-style-key="ai-os"] .report-style-sample-title,
.report-style-preview[data-style-key="technical-architecture"] .report-style-sample-title,
.report-style-preview[data-style-key="launch-dark"] .report-style-sample-title {
  letter-spacing: 0.01em;
}

.report-style-actions {
  margin-top: 12px;
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 10px;
}

.report-style-primary,
.report-style-secondary {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 0 12px;
}

.report-style-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.report-style-primary:hover {
  background: #2b64ff;
}

.report-style-secondary:hover {
  background: #f3f5f7;
}

.report-empty {
  border: 1px dashed var(--ui-line-strong);
  border-radius: 8px;
  background: var(--panel-subtle);
  color: var(--muted);
  line-height: 1.7;
  padding: 24px 16px;
  text-align: center;
}

.report-empty.danger {
  border-color: #f1c9bd;
  background: #fff7ed;
  color: #b54708;
}

.table-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.table-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
}

.panel-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.panel-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.panel-summary {
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--hover);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
}

.project-recovery-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  /* 原先硬编码浅黄底 + 深棕字，深色主题下会变成刺眼浅色条。改用 --warn 变量对；
     文字取 --warn-strong 以保证压在 --warn-bg 上仍 ≥4.5:1。 */
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 32%, var(--ui-line));
  background: var(--warn-bg);
  color: var(--warn-strong, var(--warn));
  font-size: 12px;
  line-height: 20px;
  padding: 8px 16px;
}

.project-recovery-hint[hidden] {
  display: none;
}

.project-recovery-hint button {
  flex-shrink: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--warn-strong, var(--warn));
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 2px 6px;
  text-decoration: underline;
  transition: background-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease),
    color var(--ui-motion-hover, 120ms) var(--ui-ease, ease);
}

.project-recovery-hint button:hover,
.project-recovery-hint button:focus-visible {
  background: color-mix(in srgb, var(--warn) 20%, transparent);
  color: var(--warn);
}

@media (max-width: 720px) {
  .project-recovery-hint {
    align-items: flex-start;
    padding-inline: 11px;
  }
}

.table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.data-table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
  line-height: 1.45;
}

.db-cell-text {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f8fa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.data-table tr {
  cursor: pointer;
}

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

.data-table tr.selected td {
  background: var(--brand-soft);
}

@keyframes saved-row-highlight {
  0%,
  36% {
    background: #dcf7e8;
    box-shadow: inset 3px 0 0 #1d9b5f;
  }

  100% {
    background: transparent;
    box-shadow: inset 3px 0 0 transparent;
  }
}

[data-row-id].is-just-saved > td {
  animation: saved-row-highlight 1.7s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  [data-row-id].is-just-saved > td {
    animation: none;
    background: #dcf7e8;
    box-shadow: inset 3px 0 0 #1d9b5f;
  }
}

.business-change-head { gap: 16px; align-items: flex-start; }
.business-change-periods { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.business-change-chip,
.business-change-count {
  min-height: 44px;
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  background: var(--ui-surface);
  color: var(--ui-text-secondary);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease),
    background-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease),
    color var(--ui-motion-hover, 120ms) var(--ui-ease, ease);
}
.business-change-chip { padding: 0 13px; }
/* 补 :hover / :focus-visible / transition：同区块紧邻的 .business-change-item 已有 :hover（见下方），
   这两个是写漏，表现为周期按钮划过与点击都没有反馈。 */
.business-change-chip:hover:not(.active),
.business-change-count:hover:not(.active) {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-muted);
  color: var(--ui-text);
}
.business-change-chip:focus-visible,
.business-change-count:focus-visible {
  outline: 2px solid var(--ui-focus, var(--ui-brand));
  outline-offset: 2px;
}
.business-change-chip.active,
.business-change-count.active { border-color: var(--ui-brand); color: var(--ui-brand); background: var(--ui-brand-soft); }
.business-change-chip.active:hover,
.business-change-count.active:hover { border-color: var(--ui-brand-hover, var(--ui-brand)); background: color-mix(in srgb, var(--ui-brand-soft) 70%, var(--ui-surface)); }
.business-change-layout { display: grid; grid-template-columns: minmax(150px, 180px) minmax(0, 1fr); gap: 16px; }
.business-change-counts { display: grid; align-content: start; gap: 7px; }
.business-change-count { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px; text-align: left; }
.business-change-list { display: grid; gap: 8px; min-width: 0; }
.business-change-item { width: 100%; min-height: 68px; display: grid; grid-template-columns: 126px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-surface); color: var(--ui-text); text-align: left; cursor: pointer; }
.business-change-item:hover { border-color: var(--ui-brand); }
.business-change-time,
.business-change-evidence,
.business-change-copy span,
.business-change-message { color: var(--ui-text-secondary); font-size: 12px; line-height: 18px; }
.business-change-copy { display: grid; min-width: 0; gap: 3px; }
.business-change-copy strong { font-size: 13px; line-height: 19px; font-weight: 600; }
.business-change-evidence { white-space: nowrap; }
.business-change-state { min-height: 88px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ui-text-secondary); }
.business-change-state.is-error { color: var(--ui-danger); }
.business-change-message { margin: 0 0 8px; }
.business-change-custom { display: flex; gap: 10px; align-items: end; padding: 0 17px 12px; }
.business-change-custom label { display: grid; gap: 4px; color: var(--ui-text-secondary); font-size: 12px; }
.business-change-custom input { min-height: 44px; padding: 0 10px; border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-surface); color: var(--ui-text); }

@media (max-width: 1050px) {
  .business-change-head { display: grid; }
  .business-change-periods { justify-content: flex-start; }
  .business-change-layout { grid-template-columns: minmax(0, 1fr); }
  .business-change-counts { display: flex; overflow-x: auto; padding-bottom: 3px; }
  .business-change-count { flex: 0 0 auto; min-width: 106px; }
  .business-change-item { grid-template-columns: minmax(0, 1fr) auto; }
  .business-change-time { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .business-change-custom { align-items: stretch; flex-direction: column; }
  .business-change-item { grid-template-columns: minmax(0, 1fr); }
  .business-change-evidence { white-space: normal; }
}
.today-schedule-range { display: flex; gap: 6px; }
.today-schedule-range button { min-height: 44px; padding: 0 13px; border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-surface); color: var(--ui-text-secondary); font: inherit; cursor: pointer; }
.today-schedule-range button.active { border-color: var(--ui-brand); background: var(--ui-brand-soft); color: var(--ui-brand); }
.today-week-day { display: grid; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--ui-line); }
.today-week-day > header { display: flex; justify-content: space-between; gap: 12px; color: var(--ui-text-secondary); font-size: 12px; }
.today-week-day > header strong { color: var(--ui-text); font-weight: 600; }


.smart-capture-overlay { position: fixed; inset: 0; z-index: 2200; display: grid; place-items: center; padding: 20px; background: var(--ui-overlay); }
.smart-capture-dialog { width: min(720px, 100%); max-height: min(780px, calc(100vh - 40px)); display: flex; flex-direction: column; overflow: hidden; border-radius: var(--ui-radius-lg); background: var(--ui-surface); box-shadow: var(--ui-shadow-panel); }
.smart-capture-dialog > header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--ui-line); }
.smart-capture-dialog > header div { display: grid; gap: 2px; }
.smart-capture-dialog > header span { color: var(--ui-text-secondary); font-size: 12px; }
.smart-capture-dialog > header h2 { margin: 0; font-size: 18px; line-height: 24px; }
.smart-capture-body { min-height: 0; overflow-y: auto; display: grid; gap: 14px; padding: 18px; }
.smart-capture-tabs { display: flex; gap: 7px; }
.smart-capture-tabs button { min-height: 44px; padding: 0 14px; border: 1px solid var(--ui-line); border-radius: 9px; background: var(--ui-surface); color: var(--ui-text-secondary); font: inherit; cursor: pointer; }
.smart-capture-tabs button.active { border-color: var(--ui-brand); background: var(--ui-brand-soft); color: var(--ui-brand); }
.smart-capture-body textarea { width: 100%; min-height: 210px; resize: vertical; padding: 12px; border: 1px solid var(--ui-line); border-radius: 10px; color: var(--ui-text); font: inherit; line-height: 21px; }
.smart-capture-drop { min-height: 190px; display: grid; place-items: center; padding: 24px; border: 1px dashed var(--ui-line-strong); border-radius: 10px; background: var(--ui-surface-soft); color: var(--ui-text-secondary); text-align: center; cursor: pointer; }
.smart-capture-drop input { width: min(360px, 100%); }
.smart-capture-actions { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.smart-capture-actions span { color: var(--ui-text-secondary); font-size: 12px; line-height: 18px; }
.smart-capture-review { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-surface-soft); }
.smart-capture-review header { display: grid; gap: 3px; }
.smart-capture-review header span,
.smart-capture-review p { color: var(--ui-text-secondary); font-size: 12px; line-height: 18px; }
.smart-capture-review header strong { font-weight: 600; }
.smart-capture-review p { margin: 0; }
.smart-capture-review label { display: grid; gap: 5px; font-size: 12px; }
.smart-capture-review select { min-height: 44px; border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-surface); color: var(--ui-text); }
.smart-capture-review footer { display: flex; justify-content: flex-end; gap: 8px; }
.smart-capture-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.smart-capture-entity-card { display: grid; align-content: start; gap: 9px; padding: 12px; border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-surface); }
.smart-capture-entity-card header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; }
.smart-capture-entity-card header > span,
.smart-capture-entity-card header > strong { grid-column: 1; }
.smart-capture-card-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.smart-capture-card-actions button { min-height: 36px; padding: 0 10px; }
.smart-capture-card-actions code { max-width: 180px; overflow: hidden; color: var(--ui-success); text-overflow: ellipsis; white-space: nowrap; }
.smart-capture-entity-card fieldset { min-width: 0; display: grid; gap: 9px; margin: 0; padding: 0; border: 0; }
.smart-capture-entity-card.is-confirmed { border-color: var(--ui-brand); }
.smart-capture-entity-card.is-success { border-color: var(--ui-success); background: color-mix(in srgb, var(--ui-success) 5%, var(--ui-surface)); }
.smart-capture-entity-card.is-failed { border-color: var(--ui-danger); }
.smart-capture-entity-card.is-deleted { opacity: .72; }
.smart-capture-card-message { color: var(--ui-text-secondary); }
.smart-capture-line-choice { display: flex; gap: 8px; margin: 0; padding: 12px; border: 1px solid var(--ui-line); border-radius: 8px; }
.smart-capture-line-choice legend { padding: 0 5px; color: var(--ui-text-secondary); font-size: 12px; }
.smart-capture-line-choice button { min-height: 44px; padding: 0 14px; border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-surface); color: var(--ui-text); }
.smart-capture-entity-card input,
.smart-capture-entity-card textarea { width: 100%; min-height: 42px; border: 1px solid var(--ui-line); border-radius: 8px; padding: 8px 10px; background: var(--ui-surface); color: var(--ui-text); }
.smart-capture-entity-card textarea { min-height: 74px; resize: vertical; }
.smart-capture-association { display: grid; gap: 4px; color: var(--ui-text-secondary); font-size: 12px; }
.smart-capture-association strong { color: var(--ui-text); font-weight: 500; }
.smart-capture-blocking { color: var(--ui-danger); }
.smart-capture-results { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-surface-soft); }
.smart-capture-results header,
.smart-capture-results > div { display: grid; grid-template-columns: minmax(88px, auto) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.smart-capture-results header { grid-template-columns: 1fr auto; }
.smart-capture-results code { overflow: hidden; color: var(--ui-text-secondary); text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 620px) {
  .smart-capture-overlay { padding: 0; place-items: stretch; }
  .smart-capture-dialog { width: 100%; max-height: 100vh; border-radius: 0; }
  .smart-capture-actions { align-items: stretch; flex-direction: column; }
  .smart-capture-card-grid { grid-template-columns: 1fr; }
}

.data-table.action-table td:last-child,
.data-table.action-table th:last-child {
  width: 64px;
  text-align: right;
}

.row-title {
  max-width: 280px;
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.row-sub {
  margin-top: 3px;
  color: var(--muted-soft);
  font-size: 12px;
}

.empty-cell {
  color: var(--muted);
  text-align: center !important;
  padding: 52px 16px !important;
}

.badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f1f3f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 0 8px;
  white-space: nowrap;
}

.badge.warn {
  border-color: #ffe0a3;
  background: var(--warn-bg);
  color: var(--warn);
}

.badge.risk {
  border-color: #ffd2cc;
  background: var(--danger-bg);
  color: var(--danger);
}

.badge.danger {
  border-color: #ffd2cc;
  background: var(--danger-bg);
  color: var(--danger);
}

.badge.info {
  border-color: var(--ui-line-strong);
  background: #eef6ff;
  color: var(--brand);
}

.badge.key {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.badge.ok {
  border-color: #c9eed2;
  background: var(--ok-bg);
  color: var(--ok);
}

.health-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.insight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.health-reason {
  max-width: 260px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.business-cell {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 190px;
  color: var(--muted);
  font-size: 12px;
}

.business-cell span:not(.badge) {
  border-radius: 6px;
  background: var(--panel-subtle);
  color: var(--muted);
  font-weight: 600;
  line-height: 1;
  padding: 6px 7px;
}

.action-link,
.table-link {
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  padding: 0;
  text-decoration: none;
}

.action-link:hover,
.table-link:hover {
  color: var(--brand-hover);
  text-decoration: underline;
}

.detail-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  max-height: 100vh;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
  padding: 18px 18px 14px;
}

.detail-head > div:first-child {
  min-width: 0;
}

.detail-kicker {
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}

.detail-title {
  margin-top: 5px;
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.detail-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.detail-message {
  flex-shrink: 0;
  margin: 12px 16px 0;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  background: #f2f7ff;
  color: var(--brand);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
}

.detail-message.success {
  border-color: #b9e8c6;
  background: var(--ok-bg);
  color: var(--ok);
}

.detail-message.danger {
  border-color: #ffd2cc;
  background: var(--danger-bg);
  color: var(--danger);
}

.detail-related {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex-shrink: 0;
  gap: 8px;
  margin: 12px 16px 0;
}

.related-item {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-subtle);
  padding: 10px;
}

.related-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.related-item strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.detail-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 16px 16px 20px;
}

.ai-extract-panel {
  grid-column: 1 / -1;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-brand-soft);
  padding: 12px;
}

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

.ai-extract-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.ai-extract-subtitle,
.ai-extract-message {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 3px;
}

.ai-extract-button {
  min-width: 72px;
}

.ai-extract-textarea {
  min-height: 116px;
}

.ai-extract-message {
  border-top: 1px solid var(--ui-line);
  margin-top: 10px;
  padding-top: 8px;
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 3px;
}

.segment-button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
}

.segment-button.active {
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
  color: var(--brand);
}

.blocker-toggle-field .blocker-mode-control {
  margin-bottom: 10px;
}

.blocker-empty-note {
  color: var(--muted);
}

.insight-card {
  grid-column: 1 / -1;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.insight-card.risk {
  border-left-color: var(--danger);
  background: var(--ui-danger-soft);
}

.insight-card.warn {
  border-left-color: var(--warn);
  background: var(--ui-warning-soft);
}

.insight-card.info {
  border-left-color: var(--brand);
  background: var(--ui-brand-soft);
}

.insight-card.ok {
  border-left-color: var(--ok);
  background: var(--ui-success-soft);
}

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

.insight-card-head > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.insight-card-head .insight-tags {
  flex: 0 1 auto;
  justify-content: flex-end;
  margin-left: auto;
  text-align: right;
}

.insight-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.insight-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.insight-reason {
  margin-top: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #475467;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  padding: 9px 10px;
}

.insight-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 10px;
  max-width: 100%;
  min-width: 0;
}

.insight-card-actions .field-inline-action {
  flex: 0 1 auto;
  max-width: 100%;
  white-space: nowrap;
}

.customer-project-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.customer-project-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 9px 10px;
}

.customer-project-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.customer-project-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.customer-project-meta {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
}

.customer-project-next {
  margin-top: 4px;
  color: #475467;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.customer-project-open-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.customer-projects-actions {
  margin-top: 10px;
}

.business-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.business-summary-grid div {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 9px 10px;
}

.business-summary-grid strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.business-summary-grid span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.db-detail-section {
  grid-column: 1 / -1;
  min-width: 0;
}

.db-detail-title {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.db-field-list {
  display: grid;
  gap: 8px;
}

.db-field-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--panel-subtle);
  padding: 8px 10px;
}

.db-field-row span {
  color: var(--muted);
  font-size: 12px;
}

.db-field-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.db-json {
  max-height: 280px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fa;
  color: #283142;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  padding: 12px;
}

.field {
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.field-label em {
  color: var(--warn);
  font-size: var(--fs-xs);
  font-style: normal;
}

.field-input,
.field-select {
  height: 36px;
  padding: 0 10px;
}

.field-textarea {
  min-height: 88px;
  padding: 9px 10px;
  resize: vertical;
}

.field-static {
  min-height: 36px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--panel-subtle);
  color: var(--muted);
  padding: 8px 10px;
  overflow-wrap: anywhere;
}

.outcome-status-field {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.outcome-status-field .field-label {
  width: 100%;
}

.outcome-status-field .field-label > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.outcome-status-field .field-label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.outcome-status-help .field-source-tooltip-icon {
  width: 18px;
  height: 18px;
  background: var(--brand);
  font-size: 11px;
}

.outcome-status-help-bubble {
  left: 0;
  display: grid;
  width: 288px;
  max-width: calc(100vw - 48px);
  gap: 7px;
  box-sizing: border-box;
  transform: none;
  white-space: normal;
}

.outcome-status-help-bubble::after {
  left: 9px;
  transform: none;
}

.outcome-status-help-bubble > strong {
  font-size: 12px;
  line-height: 1.4;
}

.outcome-status-help-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 7px;
  color: rgba(255, 255, 255, .78);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
}

.outcome-status-help-item b {
  color: #fff;
  font-weight: 600;
}

.outcome-status-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.outcome-status-choice {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.outcome-status-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.outcome-status-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-subtle);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.outcome-status-choice:hover .outcome-status-option {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-muted);
}

.outcome-status-input:focus-visible + .outcome-status-option {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* 这三组选中态原先把背景与文字色成对硬编码为浅底深字，深色主题下会整体变成浅色块。
   改用语义变量对（--*-bg 配 --* 前景），由各主题成对给出深浅。 */
.outcome-status-input:checked + .outcome-status-option {
  border-color: var(--ui-brand);
  background: var(--ui-brand-soft);
  box-shadow: inset 3px 0 0 var(--ui-brand);
  color: var(--ui-brand);
}

.outcome-status-choice[data-outcome-status="等待反馈"] .outcome-status-input:checked + .outcome-status-option {
  border-color: var(--warn);
  background: var(--warn-bg);
  box-shadow: inset 3px 0 0 var(--warn);
  color: var(--warn-strong, var(--warn));
}

.outcome-status-choice[data-outcome-status="仅作记录"] .outcome-status-input:checked + .outcome-status-option {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-muted);
  box-shadow: inset 3px 0 0 var(--ui-text-secondary);
  color: var(--ui-text-secondary);
}

.outcome-status-input:disabled + .outcome-status-option {
  cursor: not-allowed;
  opacity: .58;
}

@media (prefers-reduced-motion: reduce) {
  .outcome-status-option {
    transition: none;
  }
}

.project-communication-card {
  display: grid;
  align-items: start;
  gap: 8px;
  min-height: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px 12px 16px;
}

.project-communication-main {
  display: grid;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.project-communication-card .field-label {
  display: block;
  justify-content: flex-start;
  margin: 0 0 6px;
  line-height: 1.4;
}

.project-communication-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.project-communication-copy {
  display: grid;
  gap: 0;
  min-width: 0;
}

.project-communication-title {
  display: -webkit-box;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-communication-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  border-top: 1px solid var(--line-soft);
  margin-top: 0;
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.project-communication-meta span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-communication-source {
  color: var(--muted);
  font-weight: 600;
}

.project-latest-note-button {
  flex: 0 0 auto;
}

.project-communication-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 0;
  max-width: 100%;
  min-width: 0;
}

.project-communication-actions .field-inline-action {
  flex: 0 1 auto;
  max-width: 100%;
  white-space: nowrap;
}

.field-inline-action {
  min-height: 26px;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  background: #f8fbff;
  color: #0b5cad;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 9px;
}

.field-inline-action:hover {
  background: #eaf3ff;
}

.field-inline-action-primary {
  border-color: var(--ui-line-strong);
  background: #edf5ff;
}

.project-note-create-action {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  gap: 12px;
  min-height: 40px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
  padding: 7px 10px;
  margin-top: 4px;
}

.project-note-create-action > div {
  min-width: 0;
}

.project-note-create-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.project-note-create-subtitle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.project-note-create-action .field-inline-action {
  justify-self: end;
  max-width: 100%;
  white-space: nowrap;
}

.project-draft-note-shortcut {
  position: relative;
  z-index: 1;
  margin-top: 12px;
}

.field-input:disabled,
.field-select:disabled,
.field-textarea:disabled {
  background: #f7f8fa;
  color: var(--muted-soft);
}

.empty-detail {
  grid-column: 1 / -1;
  border: 1px dashed var(--ui-line-strong);
  border-radius: 8px;
  background: var(--panel-subtle);
  color: var(--muted);
  line-height: 1.7;
  padding: 32px 18px;
  text-align: center;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  background: var(--panel);
  padding: 12px 16px;
}

.detail-actions .danger-button,
.detail-actions .ghost-button,
.detail-actions .primary-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width: 1360px) {
  .app-shell {
    grid-template-columns: 216px minmax(0, 1fr) 352px;
  }

  .app-shell.overview-mode {
    grid-template-columns: 216px minmax(0, 1fr);
  }

  .app-shell.report-mode {
    grid-template-columns: 216px minmax(0, 1fr);
  }

  .workspace {
    padding: 18px;
  }

  .report-grid {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .report-version-card {
    position: static;
    grid-column: 1 / -1;
  }

  .detail-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  body {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto;
  }

  .sidebar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr);
    align-items: start;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    grid-column: 1 / -1;
    padding-bottom: 2px;
  }

  .metric-card {
    min-width: 0;
  }

  .nav-list {
    grid-column: 1 / -1;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 0 0;
  }

  .nav-item {
    flex: 0 0 auto;
    min-width: 108px;
  }

  .workspace {
    height: auto;
    overflow: visible;
  }

  .workspace-head {
    flex-direction: column;
    gap: 12px;
  }

  .head-actions {
    width: 100%;
  }

  .period-switch {
    width: 100%;
  }

  .period-button {
    flex: 1;
  }

  .head-actions .ghost-button,
  .head-actions .primary-button {
    flex: 1;
  }

  .overview-section-grid,
  .overview-action-grid,
  .report-grid,
  .report-summary-strip,
  .report-tone-compare,
  .report-style-grid {
    grid-template-columns: 1fr;
  }

  .table-panel {
    height: auto;
    min-height: 360px;
  }

  .table-wrap {
    max-height: 520px;
  }

  .detail-panel {
    max-height: none;
    overflow: visible;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .detail-form {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .sidebar {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .sidebar-scroll {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: min(560px, calc(100vh - 150px));
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    scrollbar-gutter: stable;
  }

  .sidebar-scroll > * {
    flex: 0 0 auto;
  }

  .sidebar-scroll > .nav-list {
    overflow: visible;
  }

  .workspace {
    padding: 16px 14px;
  }

  .workspace-head h1 {
    font-size: 22px;
  }

  .toolbar {
    margin-top: 14px;
  }

  .filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-control {
    min-width: 0;
  }

  .table-panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .panel-summary {
    align-self: flex-start;
  }

  .data-table {
    min-width: 720px;
  }

  .report-date-row,
  .report-material-card {
    grid-template-columns: 1fr;
  }

  .report-material-date {
    text-align: left;
  }

  .detail-related,
  .detail-form {
    grid-template-columns: 1fr;
  }

  .detail-actions .ghost-button,
  .detail-actions .primary-button,
  .detail-actions .danger-button {
    flex: 0 0 auto;
  }
}

/* Unified design token root (V3 terminal). Merged 2026-07-09: removed duplicate L5 + L7081 defs, old var names kept as aliases. */
:root {
  /* Brand & surface (single source of truth) */
  --brand: #0b5cad;
  --brand-hover: #084f96;
  --brand-soft: #e8f1ff;
  --bg: #eef3f9;
  --panel: #ffffff;
  --panel-subtle: #f8fafc;
  --line: #d8e3f0;
  --line-soft: #edf2f7;
  --line-strong: #c7d6e8;
  --text: #152033;
  --muted: #667085;
  --muted-soft: #6b7480; /* fixed 2026-07-09: was #8a94a6 (3.0:1), now 4.6:1 AA pass */
  --hover: #f4f8ff;
  --warn: #b35c00;
  --warn-bg: #fff4e0;
  /* --warn 压在 --warn-bg 上只有 4.33:1（未达 4.5）。需要「警示底 + 警示文字」成对使用的
     场景改用 --warn-strong（5.50:1）；深色主题会把它覆盖为自身的浅橙。 */
  --warn-strong: #9c4e00;
  --danger: #c2413a;
  --danger-bg: #fff0ee;
  --ok: #047857;
  --ok-bg: #e9f8f1;
  --purple: #6842c2;
  --purple-bg: #f1edff;
  --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.045);
  --shadow-md: 0 24px 60px rgba(15, 35, 70, 0.12);

  /* V3 aliases (new code prefers --v3-*, resolves to unified values above) */
  --v3-brand: var(--brand);
  --v3-brand-hover: var(--brand-hover);
  --v3-brand-soft: var(--brand-soft);
  --v3-bg: var(--bg);
  --v3-panel: var(--panel);
  --v3-panel-soft: var(--panel-subtle);
  --v3-line: var(--line);
  --v3-line-strong: var(--line-strong);
  --v3-text: var(--text);
  --v3-muted: var(--muted);
  --v3-muted-2: var(--muted-soft);
  --v3-ok: var(--ok);
  --v3-ok-bg: var(--ok-bg);
  --v3-warn: var(--warn);
  --v3-warn-bg: var(--warn-bg);
  --v3-danger: var(--danger);
  --v3-danger-bg: var(--danger-bg);
  --v3-shadow-sm: var(--shadow-sm);
  --v3-shadow-md: var(--shadow-md);
  --v3-radius: 8px;
  --v3-radius-sm: 7px;

  /* Spacing scale (8-point grid, added 2026-07-09) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Font-size scale (12px minimum for AA contrast, added 2026-07-09) */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 20px;
  --fs-3xl: 24px;

  /* Font-weight scale (replaces global 850, added 2026-07-09) */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;

  /* Motion */
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms ease;

  /* Focus ring (unified, added 2026-07-09) */
  --focus-ring: 0 0 0 3px rgba(11, 92, 173, 0.18);
  --focus-outline: 2px solid var(--brand);
}

#login-guard {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(232, 241, 255, 0.94), rgba(255, 255, 255, 0.96) 48%, rgba(238, 247, 244, 0.9)),
    #f7fbff;
}

#login-guard::before,
#login-guard::after {
  display: none;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(0, 1.22fr);
  width: min(1180px, 100%);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-md);
}

#login-guard .login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: 100%;
  border: 0;
  border-right: 1px solid var(--ui-line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
  padding: 46px 52px;
}

#login-guard .login-card::before,
#login-guard .login-card::after {
  display: none;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #102a56;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.login-brand-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.login-brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

#login-title {
  max-width: 360px;
  margin: 0;
  color: #101828;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.22;
}

.login-subtitle,
.login-message,
.login-note,
.login-tip {
  color: var(--muted);
  line-height: 1.6;
}

.login-subtitle {
  margin: 10px 0 0;
}

.login-fields {
  gap: 8px;
  margin: 26px 0 12px;
}

.login-form {
  margin: 0;
}

.field-label {
  color: #344054;
  font-weight: 600;
}

.text-input {
  min-height: 42px;
  border-color: var(--ui-line);
  border-radius: 8px;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.text-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 92, 173, 0.12);
}

.login-actions {
  margin-top: 16px;
}

#login-guard .primary-button {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 12px 26px rgba(11, 92, 173, 0.18);
}

#login-guard .primary-button:hover {
  box-shadow: 0 14px 30px rgba(11, 92, 173, 0.22);
}

.login-message {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 12px;
}

.login-message::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-bg);
}

.login-preview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 42px;
}

.login-preview > * {
  position: relative;
  z-index: 1;
}

.login-preview-head,
.login-priority-panel {
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
}

.login-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
}

.login-preview-kicker {
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}

.login-preview-title {
  margin-top: 5px;
  color: #101828;
  font-size: 24px;
  font-weight: 600;
}

.login-preview-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.login-db-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid #bfebd1;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 12px;
  font-weight: 600;
  padding: 0 12px;
  white-space: nowrap;
}

.login-db-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

.login-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.login-kpi {
  min-width: 0;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.login-kpi.primary {
  border-color: var(--ui-line-strong);
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.login-kpi.warn {
  border-color: #ffe0a3;
  background: linear-gradient(180deg, #fffaf0, #ffffff);
}

.login-kpi.danger {
  border-color: #ffd2cc;
  background: linear-gradient(180deg, #fff7f5, #ffffff);
}

.login-kpi strong {
  display: block;
  color: #101828;
  font-size: 20px;
  line-height: 1;
}

.login-kpi.primary strong {
  color: var(--brand);
}

.login-kpi.warn strong {
  color: var(--warn);
}

.login-kpi.danger strong {
  color: var(--danger);
}

.login-kpi span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.login-priority-panel {
  padding: 16px;
}

.login-panel-head,
.login-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-panel-head {
  margin-bottom: 12px;
}

.login-panel-head span {
  color: #101828;
  font-size: 14px;
  font-weight: 600;
}

.login-panel-head em {
  color: var(--brand);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.login-task-row {
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--panel-subtle);
  padding: 10px;
}

.login-task-row + .login-task-row {
  margin-top: 10px;
}

.login-task-row:hover {
  border-color: var(--ui-line);
  background: #ffffff;
}

.login-task-row > span {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
}

.login-task-row.warn > span {
  background: var(--warn);
}

.login-task-row.danger > span {
  background: var(--danger);
}

.login-task-row div {
  min-width: 0;
  flex: 1;
}

.login-task-row strong {
  display: block;
  color: #101828;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-task-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.login-task-row b {
  flex: 0 0 auto;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  padding: 4px 7px;
}

.app-shell {
  grid-template-columns: 248px minmax(0, 1fr) 360px;
  background: var(--bg);
}

.app-shell.overview-mode,
.app-shell.report-mode {
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  gap: 14px;
  border-right-color: var(--line);
  background: var(--ui-surface-muted);
  padding: 18px 14px;
}

.brand {
  position: relative;
  min-height: 44px;
  padding: 4px 8px 10px 54px;
}

.brand::before {
  content: "Y";
  position: absolute;
  left: 8px;
  top: 2px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #102a56;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
}

.brand-title {
  color: #101828;
  font-size: 16px;
  font-weight: 600;
}

.mode-switch,
.status-card,
.metric-card {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.mode-switch {
  gap: 5px;
  padding: 5px;
}

.mode-button {
  min-height: 34px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 600;
}

.mode-button.active {
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px #c8dcff;
}

.status-card {
  border-left-width: 3px;
  padding: 12px;
}

.status-card.healthy {
  background: var(--ui-success-soft);
}

.status-card.danger {
  background: var(--ui-danger-soft);
}

.status-label,
.metric-title {
  font-weight: 600;
}

.metric-item {
  border-radius: 8px;
  background: #f8fafc;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.metric-item:hover {
  border-color: var(--ui-line);
  background: #f4f8ff;
}

.metric-number {
  color: var(--brand);
  font-weight: 600;
}

.metric-number.warn {
  color: var(--warn);
}

.nav-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
  padding: 10px;
}

.nav-item {
  min-height: 34px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 0 9px;
}

.nav-item span:first-child {
  font-weight: 600;
}

.nav-item span + span {
  background: #edf2f7;
}

.nav-item.active,
.nav-item:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.workspace {
  gap: 14px;
  background: var(--bg);
  padding: 20px;
}

.top-status,
.toolbar,
.table-panel,
.overview-panel,
.report-panel {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.top-status {
  border-radius: 8px;
  padding: 11px 13px;
}

.workspace-head h1 {
  color: #101828;
  font-size: 25px;
  font-weight: 600;
}

.workspace-head p {
  color: var(--muted);
}

.period-switch {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.period-button {
  border-radius: 6px;
  font-weight: 600;
}

.period-button.active {
  background: var(--brand-soft);
}

.primary-button,
.ghost-button,
.icon-button {
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.primary-button {
  box-shadow: 0 10px 20px rgba(11, 92, 173, 0.15);
}

.primary-button:hover {
  box-shadow: 0 12px 24px rgba(11, 92, 173, 0.2);
}

.primary-button:active,
.ghost-button:active,
.icon-button:active,
.mode-button:active,
.nav-item:active {
  transform: translateY(1px);
}

.toolbar {
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.filter-control select,
.field-input,
.field-select,
.field-textarea {
  border-color: var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.overview-panel,
.table-panel,
.report-panel {
  border-radius: 8px;
}

.report-center-results .report-panel-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--ok);
  vertical-align: 1px;
}

.report-center-results .report-badge,
.report-action-btn.final {
  border-color: #bfebd1;
  background: var(--ok-bg);
  color: var(--ok);
}

.report-center-item {
  border-left: 3px solid var(--ok);
}

.report-center-source-tags span {
  background: #f2f7fb;
  color: #475467;
}

.overview-panel-head,
.table-panel-head,
.report-panel-head {
  background: #ffffff;
}

.overview-panel-title,
.panel-title,
.report-panel-title {
  color: #101828;
  font-weight: 600;
}

.panel-summary {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.data-table th {
  background: #fbfdff;
  color: var(--muted);
  font-weight: 600;
}

.data-table td {
  color: #263247;
}

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

.data-table tr.selected td {
  background: #eef6ff;
}

.row-title {
  color: #101828;
  font-weight: 600;
}

.badge {
  border-radius: 6px;
  font-weight: 600;
}

.detail-panel {
  border-left-color: var(--line);
  background: var(--ui-surface);
}

.detail-head {
  background: #ffffff;
  padding: 20px 18px 14px;
}

.detail-kicker {
  font-weight: 600;
}

.detail-title {
  color: #101828;
  font-weight: 600;
}

.detail-related {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.related-item,
.field-static,
.db-field-row {
  border-color: var(--line-soft);
  border-radius: 8px;
  background: #f8fafc;
}

@media (max-width: 720px) {
  .detail-related {
    grid-template-columns: 1fr;
  }
}

.detail-form {
  flex: 1;
  gap: 12px;
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: stretch;
  gap: 10px;
  background: #ffffff;
}

.detail-actions .danger-button,
.detail-actions .ghost-button,
.detail-actions .primary-button {
  flex: 1;
  min-height: 36px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}

.detail-actions .danger-button {
  border-radius: 6px;
}

.detail-actions .ghost-button {
  border-radius: 6px;
}

.detail-actions .primary-button {
  border-radius: 6px;
}

.detail-actions {
  align-items: center;
  background: #ffffff;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: stretch;
  padding: 12px 16px 16px;
}

.detail-actions .danger-button,
.detail-actions .ghost-button,
.detail-actions .primary-button {
  border-radius: 8px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
  min-height: 36px;
  padding: 0 16px;
  white-space: nowrap;
}

.detail-actions .danger-button {
  background: #fff7f7;
  border-color: #f2c7c7;
  color: var(--danger, #d83931);
  flex: 0 0 92px;
  font-size: 12px;
  min-width: 0;
  padding: 0 8px;
}

.detail-actions .ghost-button {
  background: #ffffff;
  border-color: var(--line);
  color: var(--text);
  flex: 1 1 0;
  min-width: 0;
}

.detail-actions .primary-button {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  flex: 1.35 1 0;
  min-width: 0;
}

.detail-actions .danger-button.ghost-button {
  background: #fff7f7;
  border-color: #f2c7c7;
  color: var(--danger, #d83931);
  flex: 0 0 92px;
  font-size: 12px;
  min-width: 0;
  padding: 0 8px;
}

.detail-actions .primary-button:hover:not(:disabled) {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

.detail-actions.source-task-readonly-actions .ghost-button,
.detail-actions.source-task-readonly-actions .primary-button {
  border-color: var(--ui-line);
  background: #f3f5f8;
  color: #667085;
  box-shadow: none;
}

.detail-actions.source-task-readonly-actions .primary-button.source-task-link-button {
  color: #475467;
}

.detail-actions.source-task-readonly-actions .primary-button.source-task-link-button:hover:not(:disabled) {
  border-color: var(--ui-line);
  background: #e9edf3;
  color: #344054;
}

.delete-confirm-overlay {
  align-items: center;
  background: rgba(10, 15, 30, 0.34);
  backdrop-filter: blur(3px);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 160;
}

/* 通用确认弹窗：可能从其他弹窗（自定义报告 130 / 在线报告 topLayer 200）内部唤起，需置于最顶层。 */
#app-confirm-dialog {
  z-index: 360;
}

.app-confirm-dialog {
  max-width: 420px;
}

.app-confirm-kicker {
  color: var(--brand);
}

.app-confirm-message {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-line;
}

.project-next-complete-dialog {
  background: var(--panel);
  border-color: var(--line);
  max-height: min(88vh, 760px);
  max-width: 620px;
  overflow-y: auto;
}

.project-next-complete-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.project-next-complete-current {
  background: var(--ui-surface-muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
}

.project-next-complete-current span,
.project-next-complete-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--fw-semibold);
}

.project-next-complete-current strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

.project-next-complete-field {
  display: grid;
  gap: 8px;
}

.project-next-complete-field em {
  color: var(--ui-danger);
  font-style: normal;
  margin-left: 4px;
}

.project-next-disposition-fieldset {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.project-next-disposition-fieldset legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--fw-semibold);
}

.project-next-disposition-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.project-next-disposition-options button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.project-next-disposition-options button[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-soft, #eef6ff);
  color: var(--brand);
  font-weight: var(--fw-semibold);
  box-shadow: 0 0 0 2px var(--ui-focus);
}

.project-next-disposition-options button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.project-next-complete-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-next-complete-field-full {
  grid-column: 1 / -1;
}

.project-next-action-input {
  min-height: 90px;
}

.project-next-complete-terminal {
  background: var(--ui-surface-muted);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
  padding: 12px 14px;
}

.project-next-complete-error {
  background: #fff1f0;
  border: 1px solid #ffc9c5;
  border-radius: 8px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
}

.project-next-action-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: space-between;
  margin-bottom: 6px;
}

.project-next-action-heading .field-label {
  justify-content: flex-start;
  margin-bottom: 0;
  min-width: 0;
}

.project-next-action-heading .field-inline-action {
  flex: 0 0 auto;
}

.project-next-terminal-status {
  color: var(--ui-success);
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .project-next-disposition-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-next-complete-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.delete-confirm-dialog {
  background: var(--ui-danger-soft);
  border: 1px solid #f0d0d0;
  border-radius: 12px;
  box-shadow: 0 24px 56px rgba(92, 22, 22, 0.18);
  max-width: 480px;
  overflow: hidden;
  width: min(480px, 100%);
}

.delete-confirm-head {
  align-items: flex-start;
  border-bottom: 1px solid #f5dada;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 18px 18px 14px;
}

.delete-confirm-kicker {
  color: var(--danger, #d83931);
  font-size: 12px;
  font-weight: var(--fw-semibold);
  line-height: 1;
  margin-bottom: 8px;
}

.delete-confirm-title {
  color: #111827;
  font-size: 18px;
  font-weight: var(--fw-semibold);
  line-height: 1.25;
}

.delete-confirm-subtitle {
  color: #667085;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 6px;
}

.delete-confirm-close {
  background: #fff7f7;
  border-color: #f2c7c7;
  color: var(--danger, #d83931);
  flex: 0 0 auto;
  min-height: 30px;
  min-width: 30px;
  padding: 0;
}

.delete-confirm-body {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
}

.delete-confirm-target {
  background: #ffffff;
  border: 1px solid #f3dddd;
  border-radius: 10px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.delete-confirm-target span {
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

.delete-confirm-target strong {
  color: #111827;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.delete-confirm-impact {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  padding: 12px;
}

.delete-confirm-impact.danger {
  background: #fff7f7;
  border-color: #f2c7c7;
}

.delete-confirm-impact strong {
  align-items: center;
  background: #ffffff;
  border: 1px solid #f2c7c7;
  border-radius: 999px;
  color: var(--danger, #d83931);
  display: inline-flex;
  font-size: 18px;
  font-weight: 600;
  height: 34px;
  justify-content: center;
  min-width: 34px;
  padding: 0 10px;
}

.delete-confirm-impact span {
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.delete-confirm-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.delete-confirm-breakdown span {
  background: #ffffff;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 8px 10px;
}

.delete-confirm-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  color: #92400e;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  padding: 10px 12px;
}

.delete-confirm-actions {
  align-items: center;
  background: #ffffff;
  border-top: 1px solid #f5dada;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  padding: 14px 18px 18px;
}

.delete-confirm-actions .ghost-button,
.delete-confirm-actions .danger-button {
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  min-height: 38px;
}

.delete-confirm-submit {
  background: var(--danger, #d83931);
  border-color: var(--danger, #d83931);
  color: #ffffff;
}

.delete-confirm-submit:hover:not(:disabled) {
  background: #b42318;
  border-color: #b42318;
  color: #ffffff;
}

.project-next-complete-dialog {
  background: var(--panel);
  border-color: var(--line);
}

.project-next-complete-dialog .delete-confirm-head,
.project-next-complete-dialog .delete-confirm-actions {
  border-color: var(--line);
}

.project-next-complete-dialog .delete-confirm-kicker {
  color: var(--ui-brand-hover);
}

.project-next-complete-dialog .delete-confirm-actions {
  background: var(--panel);
}

.unsaved-confirm-dialog {
  border-color: var(--ui-line);
  background: var(--ui-surface);
  box-shadow: 0 24px 56px rgba(15, 39, 78, 0.18);
}

.unsaved-confirm-head {
  border-bottom-color: var(--ui-line);
}

.unsaved-confirm-kicker {
  color: var(--brand, #1456f0);
}

.unsaved-confirm-close {
  border-color: var(--ui-line);
  background: #f4f8ff;
  color: var(--brand, #1456f0);
}

.unsaved-confirm-body {
  padding-bottom: 16px;
}

.unsaved-confirm-summary {
  display: grid;
  gap: 8px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

.unsaved-confirm-summary strong {
  color: #111827;
  font-size: 14px;
  line-height: 1.45;
}

.unsaved-confirm-summary span {
  color: #667085;
  font-size: 12px;
  line-height: 1.55;
}

.unsaved-confirm-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  border-top-color: var(--ui-line);
}

.unsaved-confirm-submit {
  border-color: var(--brand, #1456f0);
  background: var(--brand, #1456f0);
  color: #ffffff;
}

.unsaved-confirm-submit:hover:not(:disabled) {
  border-color: var(--brand-hover, #0e48d1);
  background: var(--brand-hover, #0e48d1);
  color: #ffffff;
}

@media (max-width: 1360px) {
  .app-shell {
    grid-template-columns: 232px minmax(0, 1fr) 340px;
  }

  .app-shell.overview-mode,
  .app-shell.report-mode {
    grid-template-columns: 232px minmax(0, 1fr);
  }
}

@media (max-width: 1100px) {
  .login-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  #login-guard {
    align-items: flex-start;
    overflow: auto;
  }

  #login-guard .login-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .login-preview {
    padding: 28px;
  }

  .app-shell,
  .app-shell.overview-mode,
  .app-shell.report-mode {
    display: flex;
  }

  .sidebar {
    border-right: 0;
  }

  .nav-list {
    display: flex;
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 2px 0 0;
  }
}

@media (max-width: 720px) {
  #login-guard {
    padding: 16px;
  }

  #login-guard .login-card,
  .login-preview {
    padding: 22px;
  }

  #login-title {
    font-size: 24px;
  }

  .login-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-preview-head {
    flex-direction: column;
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }
}

/* UI polish v2: task-first workbench refinement. */
.app-shell {
  grid-template-columns: 256px minmax(0, 1fr) 380px;
}

.workspace {
  padding: 22px 24px;
}

.workspace-head {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
}

.workspace-head h1 {
  font-size: 24px;
  line-height: 1.25;
}

.head-actions {
  align-items: center;
}

.overview-priority-board {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.6fr);
  gap: 12px;
  margin-bottom: 14px;
}

.overview-priority-hero,
.overview-priority-lane {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.overview-priority-hero {
  padding: 18px;
}

.overview-priority-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  padding: 0 8px;
}

.overview-priority-hero strong {
  display: block;
  margin-top: 12px;
  color: #101828;
  font-size: 24px;
  font-weight: var(--fw-semibold);
  line-height: 1.25;
}

.overview-priority-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.overview-priority-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.overview-priority-action {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-weight: 600;
  padding: 0 12px;
}

.overview-priority-action.danger {
  border-color: #f5b8b1;
  background: var(--danger-bg);
  color: var(--danger);
}

.overview-priority-action.warn {
  border-color: #f4cc8a;
  background: var(--warn-bg);
  color: var(--warn);
}

.overview-priority-lanes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.overview-priority-lane {
  appearance: none;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 8px;
  min-height: 150px;
  border-top: 3px solid var(--brand);
  color: inherit;
  padding: 14px;
  text-align: left;
}

.overview-priority-lane:hover {
  border-color: var(--ui-line-strong);
  background: #fbfdff;
}

.overview-priority-lane.danger {
  border-top-color: var(--danger);
}

.overview-priority-lane.warn {
  border-top-color: var(--warn);
}

.overview-priority-lane.ok {
  border-top-color: var(--ok);
}

.overview-lane-head {
  display: block;
  min-width: 0;
}

.overview-lane-head strong,
.overview-lane-head em,
.overview-lane-detail {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overview-lane-head strong {
  color: #101828;
  font-size: 13px;
  font-weight: var(--fw-semibold);
  line-height: 1.35;
  white-space: nowrap;
}

.overview-lane-head em {
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-style: normal;
  line-height: 1.35;
  white-space: nowrap;
}

.overview-lane-count {
  color: #101828;
  font-size: 28px;
  font-weight: var(--fw-semibold);
  line-height: 1;
}

.overview-lane-detail {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
}

.overview-action-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.overview-list-item {
  min-height: 58px;
}

.report-grid {
  grid-template-columns: 292px minmax(560px, 1fr) 320px;
  gap: 12px;
}

.report-current-card {
  border-top: 3px solid var(--brand);
}

.report-current-card .report-panel-body {
  padding: 10px 12px 12px;
}

.report-current-card .report-current-source,
.report-current-card .report-draft-status {
  margin-bottom: 8px;
  padding: 8px 10px;
}

.report-action-stack {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  margin: 8px 0;
  padding: 8px;
}

.report-action-primary-row,
.report-action-pending-row {
  gap: 6px;
}

.report-action-primary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.report-action-secondary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
}

.report-action-secondary-row.editing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.report-action-btn {
  min-height: 32px;
  border-radius: 7px;
  font-weight: var(--fw-semibold);
  padding: 6px 8px;
  white-space: nowrap;
  word-break: keep-all;
}

.report-action-btn.primary-lite {
  border-color: var(--ui-line-strong);
  background: var(--brand-soft);
  color: var(--brand);
}

.report-action-btn.final {
  border-color: #a9e7c4;
  background: var(--ok-bg);
  color: var(--ok);
}

.report-action-btn.pending {
  width: 100%;
  border-color: #f4cc8a;
  background: var(--warn-bg);
  color: var(--warn);
}

.report-action-btn.compact {
  flex: 1 1 112px;
  min-height: 30px;
  background: #ffffff;
  font-size: var(--fs-xs);
  padding: 5px 6px;
}

.report-action-link {
  min-height: 24px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 0 3px;
}

.report-action-inline-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  min-height: 30px;
}

.report-center {
  gap: 14px;
}

.report-center-filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-center-keyword {
  grid-column: span 2;
}

.report-center-results {
  border-top: 3px solid var(--ok);
}

.report-center-item {
  grid-template-columns: minmax(0, 1fr) 178px;
  align-items: stretch;
}

.report-version-actions {
  align-content: start;
}

.table-panel {
  border-top: 3px solid var(--brand);
}

.detail-panel {
  background: #ffffff;
}

.detail-head {
  border-bottom-color: var(--line);
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus,
.report-polish-input:focus,
.report-polish-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(11, 92, 173, 0.1);
  outline: none;
}

/* UI polish v3: dual-end product language and compact desktop workflow. */
.sidebar {
  gap: 12px;
  padding: 16px 12px;
}

.brand {
  border-bottom: 1px solid var(--line-soft);
  padding: 4px 8px 12px;
}

.brand {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: start;
  min-height: 48px;
  overflow: hidden;
}

.brand::before {
  position: static;
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
}

.brand-title,
.brand-subtitle {
  grid-column: 2;
  min-width: 0;
}

.brand-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-subtitle {
  overflow: visible;
  white-space: normal;
  line-height: 1.3;
}

.mode-switch {
  gap: 4px;
}

.mode-button {
  min-height: 32px;
}

.workspace {
  gap: 12px;
  padding: 18px 20px;
}

.workspace-head {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ui-surface);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}

.workspace-head h1 {
  font-size: 22px;
}

.workspace-head p {
  max-width: 880px;
  margin-top: 4px;
}

.toolbar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  padding: 12px;
}

.filter-row {
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

@media (min-width: 961px) {
  .filter-row.project-filter-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.table-panel-head {
  padding: 12px 14px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
}

.status-card.danger .status-text {
  color: var(--danger);
}

.status-card.danger .status-meta {
  color: #7f1d1d;
}

.detail-head {
  background: var(--ui-surface);
  padding: 16px 16px 12px;
}

.detail-title {
  font-size: 18px;
}

.detail-form {
  padding: 14px 16px;
}

.detail-actions {
  padding: 12px 16px 16px;
}

.report-grid {
  grid-template-columns: 292px minmax(560px, 1fr) 320px;
}

.report-panel-head {
  padding: 12px 14px;
}

.report-panel-body {
  padding: 12px 14px 14px;
}

.report-version-card .report-version-item {
  padding: 10px;
}

.report-paper {
  padding: 18px;
}

@media (max-width: 1360px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr) 348px;
  }

  .app-shell.overview-mode,
  .app-shell.report-mode {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .overview-priority-board,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .report-version-card {
    grid-column: auto;
  }
}

@media (max-width: 1100px) {
  .workspace-head {
    align-items: flex-start;
  }

  .overview-priority-lanes,
  .overview-action-grid,
  .report-center-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-center-keyword {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .workspace-head {
    padding: 14px;
  }

  .overview-priority-lanes,
  .overview-action-grid,
  .report-action-primary-row,
  .report-center-filter-grid {
    grid-template-columns: 1fr;
  }

  .overview-priority-lane {
    min-height: 128px;
  }

  .report-center-keyword {
    grid-column: auto;
  }

  .report-center-item {
    grid-template-columns: 1fr;
  }
}

/* UI unification v4: align existing desktop pages with the compact workbench language. */
.sidebar {
  gap: 12px;
  padding: 16px 12px;
}

.brand {
  min-width: 0;
  border: 1px solid var(--ui-line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  padding: 10px 10px 10px 12px;
}

.brand-title {
  max-width: 100%;
  overflow: hidden;
  color: #101828;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-subtitle {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mode-switch,
.status-card,
.metric-card,
.toolbar,
.table-panel,
.overview-panel,
.report-panel,
.detail-panel {
  border-color: var(--ui-line);
}

.mode-button,
.nav-item {
  min-height: 36px;
}

.workspace {
  gap: 12px;
  padding: 18px 20px;
}

.workspace-head {
  border-left: 4px solid var(--brand);
  padding-left: 14px;
}

.workspace-head h1 {
  color: #101828;
  font-size: 22px;
}

.workspace-head p {
  color: var(--muted);
}

.toolbar {
  background: #ffffff;
}

.filter-control select,
.field-input,
.field-select,
.field-textarea {
  border-color: var(--ui-line);
  border-radius: 7px;
}

.table-panel {
  overflow: hidden;
}

.table-panel-head,
.detail-head,
.report-panel-head,
.overview-panel-head {
  background: var(--ui-surface);
}

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

.overview-empty {
  border-color: var(--ui-line);
  background: #fbfdff;
}

.report-action-stack {
  border-color: var(--ui-line);
  background: #fbfdff;
}

.report-action-utility-row {
  justify-content: flex-end;
}

.report-action-link {
  min-height: 28px;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--muted);
  padding: 0 8px;
}

.report-action-link:hover {
  border-color: var(--ui-line);
  background: #f4f8ff;
  color: var(--brand);
}

.overview-priority-hero,
.overview-priority-lane,
.report-panel,
.overview-panel {
  border-color: var(--ui-line);
}

.overview-priority-lane:hover,
.report-center-item:hover {
  background: #f8fbff;
}

/* Overview layout v5: data cockpit for the desktop data overview. */
.overview-page {
  gap: 18px;
}

.overview-block {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.overview-block-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 0 8px;
}

.overview-priority-board {
  grid-template-columns: 1fr;
  margin-bottom: 0;
}

.overview-priority-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.overview-priority-strip .overview-priority-lane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(34px, 1fr) auto;
  gap: 8px 12px;
  min-height: 112px;
  border-top: 1px solid var(--ui-line);
  border-left: 4px solid var(--brand);
  padding: 12px;
}

.overview-priority-strip .overview-priority-lane.danger {
  border-top-color: var(--ui-line);
  border-left-color: var(--danger);
}

.overview-priority-strip .overview-priority-lane.warn {
  border-top-color: var(--ui-line);
  border-left-color: var(--warn);
}

.overview-priority-strip .overview-priority-lane.ok {
  border-top-color: var(--ui-line);
  border-left-color: var(--ok);
}

.overview-priority-strip .overview-lane-head {
  grid-column: 1;
  grid-row: 1;
}

.overview-priority-strip .overview-lane-count {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  font-size: 28px;
}

.overview-priority-strip .overview-lane-detail {
  display: -webkit-box;
  grid-column: 1 / -1;
  grid-row: 2;
  color: #475467;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.overview-lane-action {
  display: inline-flex;
  align-items: center;
  grid-column: 1 / -1;
  grid-row: 3;
  justify-self: start;
  min-height: 26px;
  border-radius: 6px;
  background: #f4f8ff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  padding: 0 8px;
}

.overview-priority-lane.danger .overview-lane-action {
  background: var(--danger-bg);
  color: var(--danger);
}

.overview-priority-lane.warn .overview-lane-action {
  background: var(--warn-bg);
  color: var(--warn);
}

.overview-priority-lane.ok .overview-lane-action {
  background: var(--ok-bg);
  color: var(--ok);
}


.overview-analysis-block .overview-section-grid,
.overview-queue-block .overview-action-grid {
  gap: 10px;
}

.overview-analysis-block .overview-panel,
.overview-queue-block .overview-panel {
  min-height: 236px;
}

.overview-analysis-block .overview-panel-head,
.overview-queue-block .overview-panel-head {
  padding: 12px 14px;
}

.overview-analysis-block .overview-panel-body,
.overview-queue-block .overview-panel-body {
  padding: 12px 14px 14px;
}

.overview-queue-block .overview-list-item {
  min-height: 54px;
}

@media (max-width: 1280px) {
  .overview-priority-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .overview-priority-strip,
  .overview-section-grid,
  .overview-action-grid {
    grid-template-columns: 1fr;
  }
}

/* Overview A layout: conversion-first hierarchy with restrained color semantics. */
.overview-priority-lane,
.overview-priority-lane.danger,
.overview-priority-lane.warn,
.overview-priority-lane.ok {
  border-left-color: var(--ui-brand);
}

.overview-priority-lane .overview-lane-action,
.overview-priority-lane.ok .overview-lane-action {
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
}

.overview-priority-lane.danger .overview-lane-action {
  background: var(--ui-danger-soft);
  color: var(--ui-danger);
}

.overview-priority-lane.warn .overview-lane-action {
  background: var(--ui-warning-soft);
  color: var(--ui-warning);
}

.overview-analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  align-items: stretch;
  gap: 10px;
}

.overview-analysis-primary {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.overview-analysis-rankings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.overview-analysis-layout .overview-panel {
  min-height: 0;
}

.overview-conversion-panel,
.overview-partner-panel,
.overview-ranking-panel {
  border-color: var(--ui-line);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-card);
}

.overview-stage-pipeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}

.overview-stage-card {
  position: relative;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-brand-soft);
  color: var(--ui-text-secondary);
}

.overview-stage-card::after {
  content: "›";
  position: absolute;
  top: 50%;
  right: -8px;
  z-index: 2;
  color: #7c9bb8;
  font-size: 18px;
  line-height: 1;
  transform: translateY(-50%);
}

.overview-stage-card:last-child::after { content: none; }

.overview-stage-card span,
.overview-stage-card strong,
.overview-stage-card em {
  display: block;
}

.overview-stage-card span {
  overflow: hidden;
  color: #47627e;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-stage-card strong {
  margin-top: 5px;
  color: var(--ui-brand);
  font-size: 24px;
  line-height: 30px;
}

.overview-stage-percent {
  margin-top: 2px;
  color: var(--ui-text-muted);
  font-size: 11px;
  font-style: normal;
}

.overview-ranking-panel .overview-bar-fill,
.overview-partner-panel .overview-bar-fill {
  background: var(--ui-brand);
}

.overview-ranking-panel .overview-bar-row:nth-child(even) .overview-bar-fill,
.overview-partner-panel .overview-bar-row:not(.is-attention):nth-child(even) .overview-bar-fill {
  background: #7fa8ce;
}

.overview-bar-row.is-attention .overview-bar-label,
.overview-bar-row.is-attention .overview-bar-value {
  color: var(--ui-warning);
  font-weight: 600;
}

.overview-bar-row.is-attention .overview-bar-fill {
  background: var(--ui-warning);
}

@media (max-width: 1359px) {
  .overview-analysis-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .overview-analysis-rankings {
    grid-template-columns: minmax(0, 1fr);
  }

  .overview-stage-pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-stage-card:nth-child(even)::after,
  .overview-stage-card:last-child::after {
    content: none;
  }
}

/* 报告与数据库视角：在统一工作台设计中保留业务语义。 */
.database-readonly-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--ui-text-secondary);
}

.database-readonly-context strong {
  color: var(--ui-brand);
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
}

.database-table {
  width: 100%;
  min-width: max-content;
}

.database-table th,
.database-table td {
  min-width: 132px;
}

.database-table th:first-child,
.database-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 172px;
}

.database-table th:first-child { z-index: 2; }
.database-table td:first-child { background: var(--ui-surface); }
.database-table tr:hover td:first-child { background: #f7fafd; }
.database-table tr.selected td:first-child { background: #edf5fd; }

.report-center-results {
  min-width: 0;
}

.report-center-action-primary {
  box-shadow: 0 6px 16px rgba(11, 92, 173, 0.14);
}

@media (min-width: 961px) and (max-width: 1180px) {
  .report-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-current-card {
    order: -1;
  }
}

/* UI finishing v6: release polish for desktop surfaces. */
.login-preview-kicker {
  letter-spacing: 0;
}

.login-db-badge {
  border-radius: 7px;
}

.panel-title,
.detail-title,
.report-panel-title,
.overview-panel-title {
  letter-spacing: 0;
}

.panel-subtitle,
.detail-subtitle,
.report-panel-subtitle,
.overview-panel-subtitle {
  overflow-wrap: anywhere;
}

.data-table th {
  border-bottom-color: var(--ui-line);
  background: #f8fbff;
  color: #52627a;
  font-weight: 600;
}

.data-table td {
  color: #263247;
}

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

.data-table tr.selected td {
  background: #eef6ff;
  box-shadow: inset 0 1px 0 #dbeafe, inset 0 -1px 0 #dbeafe;
}

.action-link,
.table-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 0 9px;
  text-decoration: none;
  white-space: nowrap;
}

.action-link:hover,
.table-link:hover {
  border-color: var(--ui-line-strong);
  background: #f4f8ff;
  color: var(--brand-hover);
  text-decoration: none;
}

.table-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-postpone-menu {
  display: inline-flex;
}

.table-postpone-layer {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.table-postpone-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  overflow: auto;
  border: 1px solid var(--ui-line);
  border-radius: 16px;
  background: var(--ui-surface-raised);
  color: var(--ui-text);
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.26);
}

.table-postpone-dialog > header,
.table-postpone-dialog > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.table-postpone-dialog > header {
  border-bottom: 1px solid var(--line-soft);
}

.table-postpone-dialog > header span,
.table-postpone-body label > span,
.table-postpone-body legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.table-postpone-dialog h3 {
  margin: 3px 0 0;
  font-size: 18px;
}

.table-postpone-dialog > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line-soft);
}

.table-postpone-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.table-postpone-body > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.table-postpone-body label {
  display: grid;
  gap: 7px;
}

.table-postpone-body input,
.table-postpone-body textarea {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  background: var(--ui-surface);
  color: var(--ui-text);
  font: inherit;
  padding: 8px 10px;
}

.table-postpone-body textarea {
  min-height: 84px;
  resize: vertical;
}

.table-postpone-body fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.table-postpone-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.table-postpone-presets button,
.table-postpone-reasons button {
  min-height: 32px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-surface);
  color: var(--ui-text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.table-postpone-presets button:hover,
.table-postpone-reasons button:hover,
.table-postpone-reasons button[aria-pressed="true"] {
  border-color: var(--ui-line-strong);
  background: #eef6ff;
  color: var(--brand);
}

.table-postpone-reasons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 7px;
}

.table-postpone-error {
  margin: 0;
  color: var(--danger, #c43d3d);
  font-size: 13px;
}

@media (max-width: 640px) {
  .table-postpone-layer { padding: 12px; }
  .table-postpone-dialog { width: min(100%, 520px); max-height: calc(100vh - 24px); }
  .table-postpone-reasons { grid-template-columns: 1fr; }
}

.action-link-muted {
  border-color: var(--ui-line);
  color: var(--muted);
}

/* 只改 color 在部分主题下无效（nocturne 的常态色本身已等于 --brand），
   因此同时改边框与底色，保证任意主题都有可见 hover 反馈。 */
.action-link-muted:hover {
  border-color: var(--ui-brand);
  background: var(--ui-brand-soft);
  color: var(--ui-brand-hover, var(--brand));
}

.action-link-danger {
  border-color: #f5c6c6;
  color: var(--danger, #d03e3e);
}

.action-link-danger:hover {
  border-color: #f5a0a0;
  background: #fef2f2;
  color: #c03030;
}

.danger-button {
  background: #fef2f2;
  border-color: #f5c6c6;
  color: var(--danger, #d03e3e);
}

.danger-button:hover:not(:disabled) {
  background: #fde8e8;
  border-color: #f5a0a0;
  color: #c03030;
}

.danger-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.overview-empty,
.report-empty,
.empty-detail {
  border: 1px dashed var(--ui-line);
  border-radius: 8px;
  background: #fbfdff;
  color: #667085;
}

.empty-detail {
  margin: 0;
  padding: 18px;
  font-size: 13px;
  line-height: 1.6;
}

.detail-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: var(--fw-semibold);
  line-height: 1;
  padding: 0 8px;
}

.detail-message {
  font-weight: 600;
}

.report-center-filters .report-panel-body {
  padding-top: 10px;
}

.report-center-actions {
  justify-content: flex-end;
}

.report-center-btn {
  min-height: 34px;
  border-radius: 7px;
}

.report-center-results {
  min-height: 0;
}

.report-center-item {
  border-color: var(--ui-line);
}

.report-empty {
  padding: 20px;
  text-align: center;
}

.report-empty.danger {
  border-color: #ffd2cc;
  background: var(--danger-bg);
  color: var(--danger);
}

.report-version-btn {
  white-space: nowrap;
}

.sidebar-scroll {
  display: contents;
}

/* Keep the desktop sidebar header fixed while the lower workbench area scrolls. */
@media (min-width: 1101px) {
  .sidebar {
    align-self: stretch;
    /* 不能写 100vh/100dvh，也不能写 100%：.app-shell 高度已是
       calc(100dvh - var(--site-icp-footer-height))，而 grid item 上的百分比高度
       会参照 body（整个视口高）而非轨道高度，两种写法都会让侧栏比父容器高出
       页脚的 30px，ICP 备案页脚就会压住 .sidebar-footer 里的模型设置卡下半部分
       （表现为「模型设置卡有时候显示不出来」）。
       用 auto + align-self:stretch，由 grid 把侧栏拉满轨道，高度自然等于父容器。 */
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  .sidebar-scroll {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    scrollbar-gutter: stable;
  }

  .sidebar-scroll > * {
    flex: 0 0 auto;
  }

  .sidebar-scroll > .nav-list {
    overflow: visible;
  }

  .sidebar-scroll::-webkit-scrollbar {
    width: 8px;
  }

  .sidebar-scroll::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #cbd8e8;
    background-clip: content-box;
  }

  .sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
  }
}

@media (min-width: 640px) and (max-width: 1100px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  .brand,
  .mode-switch {
    flex: 0 0 auto;
  }

  .sidebar-scroll {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    scrollbar-gutter: stable;
  }

  .sidebar-scroll > * {
    flex: 0 0 auto;
  }

  .sidebar-scroll > .nav-list {
    overflow: visible;
  }
}

/* 项目表格"预计成交"单元格五档配色——沿用伙伴等级徽标的主题语义，小程序业务判断保持不变 */
.expected-close-cell {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 999px;
  background: var(--ui-surface-muted);
  color: var(--ui-text-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  max-width: 100%;
  padding: 2px 10px;
  white-space: nowrap;
}
.expected-close-cell.tone-risk {
  border-color: color-mix(in srgb, var(--ui-danger) 55%, var(--ui-line));
  background: var(--ui-danger-soft);
  color: var(--ui-danger);
}
.expected-close-cell.tone-warn {
  border-color: color-mix(in srgb, var(--ui-warning) 55%, var(--ui-line));
  background: var(--ui-warning-soft);
  color: var(--ui-warning);
}
.expected-close-cell.tone-info {
  border-color: color-mix(in srgb, var(--ui-brand) 55%, var(--ui-line));
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
}
.expected-close-cell.tone-ok {
  border-color: color-mix(in srgb, var(--ui-success) 55%, var(--ui-line));
  background: var(--ui-success-soft);
  color: var(--ui-success);
}
.expected-close-cell.tone-muted {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-muted);
  color: var(--ui-text-secondary);
}

@media (max-width: 639px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .brand,
  .mode-switch {
    flex: 0 0 auto;
  }

  .sidebar-scroll {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-scroll > * {
    flex: 0 0 auto;
  }

  .sidebar-scroll > .nav-list {
    display: grid;
    gap: 6px;
    overflow: visible;
  }

  .sidebar-scroll .nav-item {
    flex: none;
    min-width: 0;
    width: 100%;
  }
}

.brand {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: 20px 18px;
  column-gap: 10px;
  align-items: center;
  min-height: 70px;
  height: 70px;
  overflow: hidden;
  padding: 12px 10px 12px 16px;
}

.brand::before {
  content: "Y";
  position: static;
  display: grid;
  grid-column: 1;
  grid-row: 1 / 3;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #102a56;
  color: #ffffff;
  font-size: 16px;
  font-weight: var(--fw-semibold);
  line-height: 1;
}

.brand-title,
.brand-subtitle {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-title {
  grid-row: 1;
  color: #101828;
  font-size: 14px;
  font-weight: var(--fw-semibold);
  line-height: 20px;
  white-space: nowrap;
}

.brand-subtitle {
  display: block;
  grid-row: 2;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.report-center-item {
  grid-template-columns: minmax(0, 1fr);
}

.report-center-item-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
}

/* V3 command center UI and motion layer. Token defs merged into unified root above (was here, removed 2026-07-09). */

@keyframes v3-row-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes v3-detail-slide {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes v3-dialog-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes v3-bar-fill {
  from {
    width: 8%;
  }
}

@keyframes v3-soft-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes v3-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body {
  background: var(--v3-bg);
  color: var(--v3-text);
}

.app-shell {
  background: var(--v3-bg);
  color: var(--v3-text);
}

.app-shell.overview-mode,
.app-shell.report-mode {
  background: var(--v3-bg);
}

.sidebar {
  gap: 12px;
  border-right: 1px solid var(--v3-line);
  background: var(--ui-surface-muted);
  color: var(--v3-text);
  padding: 16px 12px;
}

.brand {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: 20px 18px;
  column-gap: 10px;
  align-items: center;
  min-height: 70px;
  height: 70px;
  overflow: hidden;
  border: 1px solid var(--v3-line);
  border-left: 4px solid var(--v3-brand);
  border-radius: var(--v3-radius);
  background: var(--v3-panel);
  box-shadow: var(--v3-shadow-sm);
  padding: 12px 10px 12px 16px;
}

.brand::before {
  content: "Y";
  position: static;
  display: grid;
  grid-column: 1;
  grid-row: 1 / 3;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--v3-radius);
  background: #102a56;
  color: #ffffff;
  font-size: 16px;
  font-weight: var(--fw-semibold);
  line-height: 1;
}

.brand-title,
.brand-subtitle {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-title {
  grid-row: 1;
  color: var(--v3-text);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  line-height: 20px;
  white-space: nowrap;
}

.brand-subtitle {
  display: block;
  grid-row: 2;
  color: var(--v3-muted);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.mode-switch,
.status-card,
.model-card,
.metric-card,
.nav-list,
.top-status,
.workspace-head,
.toolbar,
.table-panel,
.overview-panel,
.report-panel,
.detail-panel,
.report-action-stack,
.report-version-panel,
.report-center-item,
.report-polish-dialog,
.delete-confirm-dialog {
  border-color: var(--v3-line);
  border-radius: var(--v3-radius);
  background-color: var(--v3-panel);
  box-shadow: var(--v3-shadow-sm);
}

.mode-switch {
  gap: 5px;
  padding: 5px;
}

.mode-button,
.nav-item {
  min-height: 36px;
  border-radius: var(--v3-radius-sm);
  color: var(--v3-muted);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.mode-button:hover,
.nav-item:hover {
  background: #f4f8ff;
  color: var(--v3-brand);
}

.mode-button.active,
.nav-item.active {
  background: var(--v3-brand-soft);
  color: var(--v3-brand);
  box-shadow: inset 0 0 0 1px #c8dcff;
}

.mode-button:active,
.nav-item:active {
  transform: translateY(1px);
}

.nav-list {
  gap: 5px;
  padding: 10px;
}

.nav-item span + span {
  background: #edf2f7;
  color: var(--v3-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.nav-item.active span + span {
  background: #ffffff;
  color: var(--v3-brand);
}

.status-card {
  border-left: 4px solid var(--v3-ok);
  background: var(--ui-success-soft);
  padding: 12px;
}

.status-card.danger {
  border-left-color: var(--v3-danger);
  background: var(--ui-danger-soft);
}

.status-card.healthy {
  border-left-color: var(--v3-ok);
  background: var(--ui-success-soft);
}

.model-card {
  border-left: 4px solid var(--v3-brand);
  padding: 12px;
}

.model-card.healthy {
  border-left-color: var(--v3-ok);
  background: var(--ui-success-soft);
}

.model-card.danger {
  border-left-color: var(--v3-danger);
  background: var(--ui-danger-soft);
}

.status-label,
.metric-title {
  color: var(--v3-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.status-text {
  color: var(--v3-text);
  font-weight: var(--fw-semibold);
}

.status-meta,
.status-sync,
.metric-label {
  color: var(--v3-muted);
}

.metric-card {
  padding: 12px;
}

.metric-grid {
  gap: 8px;
}

.metric-item {
  border: 1px solid transparent;
  border-radius: var(--v3-radius);
  background: var(--v3-panel-soft);
  color: var(--v3-text);
  padding: 9px;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.metric-item:hover {
  border-color: var(--ui-line);
  background: #f4f8ff;
  transform: translateY(-1px);
}

.metric-number {
  color: var(--v3-brand);
  font-weight: var(--fw-semibold);
}

.metric-number.warn {
  color: var(--v3-warn);
}

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

.workspace-head {
  align-items: center;
  border-left: 4px solid var(--v3-brand);
  background: var(--ui-surface);
  padding: 14px 16px 14px 14px;
  animation: v3-soft-enter 0.36s ease both;
}

.workspace-head h1 {
  color: var(--v3-text);
  font-size: 22px;
  font-weight: var(--fw-semibold);
}

.workspace-head p {
  color: var(--v3-muted);
  font-size: 12px;
}

.head-actions {
  gap: 8px;
}

.primary-button,
.ghost-button,
.icon-button,
.model-config-button,
.report-action-btn,
.report-action-link,
.action-link,
.table-link,
.field-inline-action {
  border-radius: var(--v3-radius-sm);
  font-weight: var(--fw-semibold);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.primary-button {
  background: var(--v3-brand);
  box-shadow: 0 10px 22px rgba(11, 92, 173, 0.18);
}

.primary-button:hover:not(:disabled) {
  background: var(--v3-brand-hover);
  box-shadow: 0 12px 26px rgba(11, 92, 173, 0.22);
  transform: none;
}

.ghost-button:hover:not(:disabled),
.model-config-button:hover:not(:disabled),
.report-action-link:hover,
.action-link:hover,
.table-link:hover,
.field-inline-action:hover {
  border-color: var(--ui-line-strong);
  background: #f4f8ff;
  color: var(--v3-brand);
  transform: none;
}

.primary-button:active:not(:disabled),
.ghost-button:active:not(:disabled),
.icon-button:active:not(:disabled),
.model-config-button:active:not(:disabled),
.report-action-btn:active:not(:disabled),
.action-link:active:not(:disabled),
.table-link:active:not(:disabled),
.field-inline-action:active:not(:disabled) {
  transform: none;
}

.top-status {
  border-radius: var(--v3-radius);
  animation: v3-soft-enter 0.34s ease both;
}

.toolbar {
  background: var(--v3-panel);
  padding: 12px;
  animation: v3-soft-enter 0.38s ease both;
}

.filter-control select,
.field-input,
.field-select,
.field-textarea,
.report-polish-input,
.report-polish-select,
.report-edit-textarea,
.report-date-field input {
  border-color: var(--v3-line);
  border-radius: var(--v3-radius-sm);
  background: #fbfdff;
  color: #263247;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.filter-control select:focus,
.field-input:focus,
.field-select:focus,
.field-textarea:focus,
.report-polish-input:focus,
.report-polish-select:focus,
.report-edit-textarea:focus,
.report-date-field input:focus {
  border-color: var(--v3-brand);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(11, 92, 173, 0.12);
}

.table-panel {
  overflow: hidden;
  animation: v3-soft-enter 0.4s ease both;
}

.table-panel-head,
.detail-head,
.overview-panel-head,
.report-panel-head,
.report-center-head,
.delete-confirm-head,
.report-polish-dialog-head {
  background: var(--ui-danger-soft);
}

.panel-title,
.detail-title,
.overview-panel-title,
.report-panel-title,
.report-section-title,
.report-polish-dialog-title,
.delete-confirm-title {
  color: var(--v3-text);
  font-weight: var(--fw-semibold);
}

.panel-subtitle,
.detail-subtitle,
.overview-panel-subtitle,
.report-panel-subtitle,
.report-source-note,
.report-polish-dialog-subtitle,
.delete-confirm-subtitle {
  color: var(--v3-muted);
}

.data-table th {
  border-bottom-color: var(--v3-line);
  background: #f8fbff;
  color: #52627a;
  font-size: 12px;
  font-weight: var(--fw-semibold);
}

.data-table td {
  color: #263247;
}

.data-table tbody tr {
  animation: v3-row-in 0.34s ease both;
}

.data-table tbody tr:nth-child(2) {
  animation-delay: 0.02s;
}

.data-table tbody tr:nth-child(3) {
  animation-delay: 0.04s;
}

.data-table tbody tr:nth-child(4) {
  animation-delay: 0.06s;
}

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

.data-table tr.selected td {
  background: #eef6ff;
  box-shadow: inset 0 1px 0 #dbeafe, inset 0 -1px 0 #dbeafe;
}

.table-row-title,
.table-link,
.action-link {
  color: var(--v3-brand);
}

.detail-panel {
  animation: v3-detail-slide 0.42s ease both;
  border-left-color: var(--v3-line);
  background: var(--v3-panel);
}

.detail-kicker {
  color: var(--v3-brand);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.detail-message {
  animation: v3-toast-in 0.26s ease both;
  border-color: var(--v3-line);
  border-radius: var(--v3-radius-sm);
}

.detail-message.success,
.detail-message.ok {
  background: var(--v3-ok-bg);
  color: var(--v3-ok);
}

.detail-message.warn,
.detail-message.warning {
  background: var(--v3-warn-bg);
  color: var(--v3-warn);
}

.detail-message.danger,
.detail-message.error {
  background: var(--v3-danger-bg);
  color: var(--v3-danger);
}

.detail-related {
  gap: 8px;
  border-bottom-color: var(--v3-line);
  padding: 12px 16px;
}

.related-card,
.related-item,
.insight-card,
.ai-extract-panel,
.project-communication-card,
.db-detail-section,
.project-note-section,
.field.full.project-note-create-action {
  border-color: var(--v3-line);
  border-radius: var(--v3-radius);
  background: #fbfdff;
}

.insight-card {
  border-left: 4px solid var(--v3-brand);
  box-shadow: none;
}

.insight-card.warn {
  border-left-color: var(--v3-warn);
  background: #fffaf2;
}

.insight-card.danger {
  border-left-color: var(--v3-danger);
  background: #fff7f5;
}

.insight-card.ok,
.insight-card.healthy {
  border-left-color: var(--v3-ok);
  background: #f6fffa;
}

.detail-form {
  gap: 11px;
}

.field-label,
.report-control-label,
.report-model-field span {
  color: #344054;
  font-size: 12px;
  font-weight: var(--fw-semibold);
}

.detail-actions {
  border-top-color: var(--v3-line);
  background: #ffffff;
}

.overview-page {
  gap: 16px;
}

.overview-block {
  gap: 10px;
  animation: v3-soft-enter 0.38s ease both;
}

.overview-block-kicker {
  border-radius: var(--v3-radius-sm);
  background: var(--v3-brand-soft);
  color: var(--v3-brand);
  font-weight: var(--fw-semibold);
}

.overview-priority-lane {
  appearance: none;
  border-color: var(--v3-line);
  border-left: 4px solid var(--v3-brand);
  border-radius: var(--v3-radius);
  background: #ffffff;
  box-shadow: var(--v3-shadow-sm);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.overview-priority-lane:hover {
  background: #fbfdff;
  border-color: var(--ui-line);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.09);
  transform: translateY(-2px);
}

.overview-priority-lane.danger {
  border-left-color: var(--v3-danger);
}

.overview-priority-lane.warn {
  border-left-color: var(--v3-warn);
}

.overview-priority-lane.ok {
  border-left-color: var(--v3-ok);
}

.overview-panel {
  animation: v3-soft-enter 0.4s ease both;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.overview-panel:hover {
  background: #fbfdff;
  border-color: var(--ui-line);
  transform: translateY(-2px);
}

.overview-bar-fill {
  animation: v3-bar-fill 0.72s ease both;
  background: var(--v3-brand);
}

.overview-bar-fill.warn {
  background: var(--v3-warn);
}

.overview-bar-fill.ok {
  background: var(--v3-ok);
}

.overview-list-item,
.report-material-card,
.report-summary-item,
.report-version-item,
.report-timeline-item,
.report-center-item,
.report-source-item,
.report-base-status,
.report-current-source,
.report-draft-status {
  border-color: var(--v3-line);
  border-radius: var(--v3-radius);
  background: #fbfdff;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.overview-list-item:hover,
.report-material-card:hover,
.report-summary-item:hover,
.report-version-item:hover,
.report-timeline-item:hover,
.report-center-item:hover {
  background: #ffffff;
  border-color: var(--ui-line);
  transform: translateY(-1px);
}

.report-grid {
  grid-template-columns: minmax(252px, 0.82fr) minmax(0, 1.48fr) minmax(264px, 0.82fr);
  gap: 12px;
  max-width: 100%;
}

.report-panel {
  overflow: hidden;
  animation: v3-soft-enter 0.38s ease both;
}

.report-current-card {
  border-left: 4px solid var(--v3-brand);
}

.report-paper {
  border-color: var(--v3-line);
  border-radius: var(--v3-radius);
  background: #ffffff;
  color: #263247;
}

.report-action-stack {
  background: #fbfdff;
}

.report-action-btn.final,
.report-action-btn.primary-lite,
.report-center-action-primary,
.report-action-btn.pending {
  background: var(--v3-brand);
  color: #ffffff;
  border-color: var(--v3-brand);
}

.report-action-btn.final:hover,
.report-action-btn.primary-lite:hover,
.report-center-action-primary:hover,
.report-action-btn.pending:hover {
  background: var(--v3-brand-hover);
  border-color: var(--v3-brand-hover);
}

.report-timeline-card {
  border-left: 4px solid var(--v3-brand);
  min-width: 0;
}

.report-timeline-item.archive,
.report-final-item {
  border-left: 4px solid var(--v3-ok);
}

.report-timeline-item.polish {
  border-left: 4px solid var(--v3-brand);
}

.report-timeline-item.history {
  border-left: 4px solid var(--v3-muted-2);
}

.report-center-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  animation: v3-row-in 0.34s ease both;
}

.report-center-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  max-width: 100%;
  min-width: 0;
}

.report-center-filter-grid {
  gap: 10px;
}

.db-detail-section {
  background: #fbfdff;
}

.overview-empty,
.report-empty,
.empty-detail,
.report-timeline-empty {
  border-color: var(--ui-line);
  border-radius: var(--v3-radius);
  background: #fbfdff;
  color: var(--v3-muted);
}

#login-guard {
  background:
    linear-gradient(135deg, rgba(232, 241, 255, 0.94), rgba(255, 255, 255, 0.96) 48%, rgba(238, 247, 244, 0.9)),
    #f7fbff;
}

#login-guard .login-card {
  border-right: 1px solid var(--v3-line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: none;
}

.login-shell,
.login-preview-head,
.login-kpi,
.login-priority-panel,
.login-task-row {
  border-color: var(--v3-line);
  border-radius: var(--v3-radius);
}

.login-icon {
  border-radius: var(--v3-radius);
  background: #102a56;
}

#login-guard .primary-button {
  background: var(--v3-brand);
}

.login-task-row:hover {
  border-color: var(--ui-line);
  transform: translateY(-1px);
}

.report-polish-overlay,
.delete-confirm-overlay {
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(2px);
}

.report-polish-dialog {
  animation: v3-dialog-pop 0.28s ease both;
  display: flex;
  flex-direction: column;
  max-height: min(92dvh, 900px);
  overflow: hidden;
}

.report-polish-dialog-head {
  flex: 0 0 auto;
}

.report-polish-form {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.report-polish-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-top: 10px;
  padding-bottom: 2px;
  background: var(--ui-surface);
}

.model-settings-dialog {
  border-left: 4px solid var(--v3-brand);
}

.report-polish-panel,
.report-polish-source-card,
.model-settings-status,
.delete-confirm-target,
.delete-confirm-impact,
.delete-confirm-breakdown,
.delete-confirm-warning {
  border-color: var(--v3-line);
  border-radius: var(--v3-radius);
  background: #fbfdff;
}

.delete-confirm-dialog {
  animation: v3-dialog-pop 0.28s ease both;
  overflow: hidden;
}

.delete-confirm-impact.danger {
  border-left: 4px solid var(--v3-danger);
  background: var(--v3-danger-bg);
  color: var(--v3-danger);
}

.danger-button,
.danger-button:hover:not(:disabled),
.delete-confirm-submit {
  border-color: #f5c6c6;
  background: #fef2f2;
  color: var(--v3-danger);
}

.danger-button:hover:not(:disabled),
.delete-confirm-submit:hover:not(:disabled) {
  border-color: #f5a0a0;
  background: #fde8e8;
  transform: translateY(-1px);
}

.report-floating-toast {
  border-radius: var(--v3-radius);
  box-shadow: var(--v3-shadow-md);
  animation: v3-toast-in 0.24s ease both;
}

@media (max-width: 1360px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr) 348px;
  }

  .app-shell.overview-mode,
  .app-shell.report-mode {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .report-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .workspace {
    padding: 16px;
  }

  .overview-priority-strip,
  .overview-section-grid,
  .overview-action-grid,
  .report-center-filter-grid {
    grid-template-columns: 1fr;
  }

  .workspace-head {
    align-items: flex-start;
  }
}

.app-shell {
  background: var(--v3-bg);
}

.workspace-head {
  border-left: 4px solid var(--v3-brand);
}

.primary-button {
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* 润色模板库：左右布局 */
.tpl-lib-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
}
.tpl-lib-list {
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  padding: 8px;
  background: #f7faff;
  max-height: 56vh;
  overflow: auto;
}
/* 列表项：外层 wrap 承载「选中态」+ 右侧查看/编辑按钮，内层 .tpl-lib-item 是主选择按钮 */
.tpl-lib-item-wrap {
  display: flex;
  align-items: stretch;
  gap: 4px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 6px;
  overflow: hidden;
}
.tpl-lib-item-wrap.on {
  background: var(--brand);
  color: #fff;
}
.tpl-lib-item {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  border: none;
  background: transparent;
  color: inherit;
  border-radius: 8px 0 0 8px;
  padding: 9px 11px;
  cursor: pointer;
}
.tpl-lib-item-view {
  flex: 0 0 auto;
  align-self: center;
  margin-right: 8px;
  border: 1px solid rgba(47, 111, 237, 0.35);
  background: #fff;
  color: #2f6fed;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.tpl-lib-item-view:hover {
  background: #eaf1ff;
}
.tpl-lib-item-wrap.on .tpl-lib-item-view {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.tpl-lib-item-wrap.on .tpl-lib-item-view:hover {
  background: rgba(255, 255, 255, 0.28);
}
.tpl-lib-item-name {
  font-size: 13px;
}
.tpl-lib-item-sub {
  font-size: var(--fs-xs);
  opacity: 0.7;
  margin-top: 2px;
}
.tpl-lib-add {
  width: 100%;
  border: 1px dashed var(--ui-line-strong);
  background: #fff;
  color: var(--brand);
  border-radius: 8px;
  padding: 9px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 4px;
}
.tpl-lib-add.on {
  background: var(--brand-soft);
}
.tpl-lib-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tpl-lib-seg {
  display: inline-flex;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}
.tpl-lib-seg button {
  border: none;
  background: #fff;
  padding: 7px 16px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}
.tpl-lib-seg button.on {
  background: var(--brand);
  color: #fff;
}
.tpl-lib-upload {
  border: 1px dashed var(--ui-line-strong);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text);
  background: #f7faff;
  cursor: pointer;
}
.tpl-lib-item-tag {
  display: inline-block;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #eaf1ff;
  color: #2f6fed;
  vertical-align: middle;
}
.tpl-lib-item-wrap.on .tpl-lib-item-tag {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}
/* 内容区标题行：左侧标签 + 右侧「展开大窗」按钮 */
.tpl-lib-content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tpl-lib-expand-btn {
  flex: 0 0 auto;
  font-size: 12px;
  white-space: nowrap;
}
.tpl-lib-content-area {
  max-height: 52vh;
}

/* ===== 报告 V3：模板「查看/编辑」独立全屏大窗 ===== */
.tpl-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(15, 23, 42, 0.48);
}
.tpl-editor-dialog {
  display: flex;
  flex-direction: column;
  width: min(920px, 94vw);
  max-height: 90vh;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}
.tpl-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--ui-line);
}
.tpl-editor-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #1f2937);
}
.tpl-editor-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted, #64748b);
}
.tpl-editor-close {
  flex: 0 0 auto;
}
.tpl-editor-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 22px;
  overflow-y: auto;
}
.tpl-editor-textarea {
  min-height: 44vh;
  resize: vertical;
  line-height: 1.7;
}
.tpl-editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid var(--ui-line);
  background: #fbfcfe;
}

/* ===== 报告 V3：模板选择宫格（选模板生成对话框） ===== */
.report-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.report-template-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  padding: 14px;
  border: 1px solid var(--line, var(--ui-line));
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  min-height: 96px;
}

.report-template-card:hover {
  border-color: #4b7bec;
  box-shadow: 0 4px 14px rgba(75, 123, 236, 0.12);
}

.report-template-card.selected {
  border-color: #2f6fed;
  box-shadow: 0 0 0 2px rgba(47, 111, 237, 0.18);
  background: #f5f9ff;
}

.report-template-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.report-template-card-head strong {
  font-size: 14px;
  color: var(--text, #1f2937);
  font-weight: 600;
}

.report-template-card-scene {
  font-size: 11px;
  color: var(--muted, #64748b);
}

.report-template-card-preview {
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.5;
}

.report-template-card-none {
  border-style: dashed;
  background: #fafbfd;
}

.report-template-card-manage {
  border-style: dashed;
  border-color: var(--ui-line-strong);
  background: #f7faff;
  align-items: flex-start;
}

.report-template-card-manage .report-template-card-head strong {
  color: #2f6fed;
}

.report-template-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #eaf1ff;
  color: #2f6fed;
}

.report-template-badge-reco {
  background: #fff3e6;
  color: #d97706;
}

/* ===== 报告 V3：预览区下方一句话迭代条 ===== */
.report-iterate-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line, var(--ui-line));
  border-radius: 12px;
  background: #f8fafc;
}

.report-iterate-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-iterate-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.report-iterate-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line, var(--ui-line));
  border-radius: 8px;
  font-size: 13px;
  color: var(--text, #1f2937);
  background: #fff;
}

/* 迭代按钮收窄：不再吃满整行(.report-action-btn 默认 width:100%)，把空间让给左侧输入框 */
.report-iterate-input-row .report-action-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 64px;
  padding-left: 16px;
  padding-right: 16px;
  white-space: nowrap;
}

.report-iterate-input:focus {
  outline: none;
  border-color: #2f6fed;
  box-shadow: 0 0 0 2px rgba(47, 111, 237, 0.15);
}

.task-due-datetime-inputs {
  display: grid;
  grid-template-columns: minmax(140px, 1.3fr) minmax(92px, 0.75fr) minmax(92px, 0.75fr);
  gap: 10px;
}

.task-due-datetime-inputs label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.task-due-datetime-inputs span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* ===== P1-3: Loading / Error / Field-error states (added 2026-07-09) ===== */

/* Skeleton shimmer for loading states */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--line-soft);
  border-radius: var(--v3-radius-sm);
  min-height: 14px;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-block { height: 48px; }
.skeleton-circle { width: 32px; height: 32px; border-radius: 50%; }
@keyframes skeleton-shimmer {
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}

/* Table skeleton rows */
.table-skeleton-row td {
  padding: 14px 12px;
}
.table-skeleton-row .skeleton { min-height: 12px; }

/* Field error state */
.field-input[aria-invalid="true"],
.field-select[aria-invalid="true"],
.field-textarea[aria-invalid="true"],
.field-input.is-invalid,
.field-select.is-invalid,
.field-textarea.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(194, 65, 58, 0.12);
}
.field-error-text {
  color: var(--danger);
  font-size: var(--fs-xs);
  margin-top: 4px;
  display: block;
}

/* Form status bar (saving / saved / unsaved / failed) */
.form-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--v3-radius-sm);
  font-size: var(--fs-xs);
  margin-bottom: 12px;
}
.form-status-bar.saving { background: var(--brand-soft); color: var(--brand); }
.form-status-bar.saved { background: var(--ok-bg); color: var(--ok); }
.form-status-bar.unsaved { background: var(--warn-bg); color: var(--warn); }
.form-status-bar.failed { background: var(--danger-bg); color: var(--danger); }
.form-status-bar::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.form-status-bar.saving::before { animation: status-pulse 1s ease-in-out infinite; }
@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@media (prefers-reduced-motion: reduce) {
  .form-status-bar.saving::before { animation: none; }
}

/* Spinner for inline loading */
.inline-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spinner-rotate 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .inline-spinner { animation-duration: 2s; }
}

/* ===== P2-1: Small-screen sidebar drawer (added 2026-07-09) ===== */

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--v3-radius-sm);
  background: var(--panel);
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-toggle span,
.sidebar-toggle span::before,
.sidebar-toggle span::after {
  content: "";
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  position: relative;
}
.sidebar-toggle span::before { position: absolute; top: -5px; left: 0; }
.sidebar-toggle span::after { position: absolute; top: 5px; left: 0; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 40;
  opacity: 0;
  transition: opacity var(--transition-normal);
}
.sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

@media (max-width: 1120px) {
  .sidebar-toggle { display: inline-flex; }
  .app-shell {
    grid-template-columns: 1fr !important;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    max-width: 80vw;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    overflow-y: auto;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-md);
  }
  .detail-panel {
    display: none;
  }
  .detail-panel.mobile-open {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 50;
    width: 100%;
    background: var(--panel);
  }
}

/* ===== P2-2: Universal toast queue (added 2026-07-09) ===== */

.toast-queue {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 360px;
}
.toast-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--v3-radius);
  background: var(--panel);
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--brand);
  font-size: var(--fs-sm);
  color: var(--text);
  pointer-events: auto;
  animation: toast-slide-in 0.25s ease;
}
.toast-item.success { border-left-color: var(--ok); }
.toast-item.warning { border-left-color: var(--warn); }
.toast-item.error { border-left-color: var(--danger); }
.toast-item.info { border-left-color: var(--brand); }
.toast-item.leaving { animation: toast-slide-out 0.2s ease forwards; }
.toast-item strong { font-weight: var(--fw-semibold); }
.toast-item .toast-close {
  margin-left: auto;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 0 0 0 8px;
}
@keyframes toast-slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toast-slide-out {
  to { transform: translateX(20px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .toast-item { animation: none; }
}

/* Project next-action source tooltip: "?" icon in label, bubble on hover/focus (added 2026-07-10) */
.field-source-tooltip {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  position: relative;
  vertical-align: middle;
}
.field-source-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  line-height: 1;
  background: var(--muted);
  color: #fff;
  cursor: help;
  transition: background var(--transition-fast);
}
.field-source-tooltip.note .field-source-tooltip-icon { background: var(--brand); }
.field-source-tooltip.manual .field-source-tooltip-icon { background: var(--warn); }
.field-source-tooltip:hover .field-source-tooltip-icon,
.field-source-tooltip:focus-within .field-source-tooltip-icon { filter: brightness(1.15); }
.field-source-tooltip-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  font-size: var(--fs-xs);
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: var(--v3-radius-sm);
  width: max-content;
  max-width: 260px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
  z-index: 20;
  box-shadow: var(--shadow-md);
}
.field-source-tooltip-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text);
}
.field-source-tooltip:hover .field-source-tooltip-bubble,
.field-source-tooltip:focus-within .field-source-tooltip-bubble {
  opacity: 1;
  visibility: visible;
}

/* Trusted login experience: approved calm aurora direction. */
#login-guard {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background-color: #f3f6fa;
  background-image:
    linear-gradient(rgba(111, 131, 160, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 131, 160, 0.045) 1px, transparent 1px),
    linear-gradient(145deg, #f7faff 0%, #eef4fb 50%, #f5f7fb 100%);
  background-size: 44px 44px, 44px 44px, auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

#login-guard::before,
#login-guard::after { display: none; }

.login-aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.aurora-orb {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.62;
  will-change: transform;
}

.aurora-orb-blue {
  top: -16%;
  right: 4%;
  width: min(52vw, 720px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(93, 151, 224, 0.24) 0%, rgba(151, 193, 238, 0.11) 44%, transparent 72%);
  animation: aurora-blue-drift 18s ease-in-out infinite alternate;
}

.aurora-orb-cyan {
  left: -13%;
  bottom: -22%;
  width: min(48vw, 660px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(102, 190, 198, 0.2) 0%, rgba(166, 219, 215, 0.09) 48%, transparent 72%);
  animation: aurora-cyan-drift 20s ease-in-out infinite alternate;
}

.aurora-orb-violet {
  right: 28%;
  bottom: -28%;
  width: min(42vw, 580px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(143, 135, 209, 0.16) 0%, rgba(183, 179, 222, 0.07) 48%, transparent 72%);
  animation: aurora-violet-drift 22s ease-in-out infinite alternate;
}

@keyframes aurora-blue-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-4%, 5%, 0) scale(1.08); }
}

@keyframes aurora-cyan-drift {
  from { transform: translate3d(0, 0, 0) scale(1.02); }
  to { transform: translate3d(7%, -4%, 0) scale(1.1); }
}

@keyframes aurora-violet-drift {
  from { transform: translate3d(0, 0, 0) scale(0.98); }
  to { transform: translate3d(-5%, -6%, 0) scale(1.06); }
}

.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(380px, 0.88fr) minmax(460px, 1.12fr);
  width: min(1120px, 100%);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(190, 205, 223, 0.76);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 30px 80px rgba(45, 69, 99, 0.16);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

#login-guard .login-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: 100%;
  padding: 52px 56px;
  border: 0;
  border-right: 1px solid rgba(202, 214, 229, 0.82);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

.login-brand { margin-bottom: 38px; }

.login-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #0b5cad;
  box-shadow: 0 8px 20px rgba(11, 92, 173, 0.2);
  font-size: 17px;
  font-weight: 600;
}

.login-brand-title {
  color: #152033;
  font-size: 16px;
  font-weight: 600;
}

.login-brand-subtitle {
  color: #687891;
  font-size: 12px;
}

#login-title {
  color: #152033;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.login-subtitle {
  margin-top: 10px;
  color: #607089;
  font-size: 14px;
}

.login-fields { gap: 9px; margin-top: 30px; }

.field-label {
  color: #34435a;
  font-size: 13px;
  font-weight: 600;
}

#login-guard .text-input {
  min-height: 44px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
}

#login-guard .primary-button {
  min-height: 44px;
  border-radius: 10px;
  background: #0b5cad;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(11, 92, 173, 0.18);
}

#login-guard .primary-button:hover:not(:disabled) {
  background: #084f96;
  box-shadow: 0 12px 28px rgba(11, 92, 173, 0.23);
}

#login-guard .primary-button:disabled { cursor: wait; opacity: 0.66; }

.login-message {
  min-height: 20px;
  margin-top: 16px;
  color: #607089;
}

.login-message::before {
  background: #0b5cad;
  box-shadow: 0 0 0 4px rgba(11, 92, 173, 0.1);
}

.login-message--loading { color: #0b5cad; }
.login-message--success { color: #047857; }

.login-message--error {
  color: #c2413a;
  font-weight: 600;
}

.login-message--error::before {
  content: "!";
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  background: #c2413a;
  box-shadow: none;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.login-capabilities {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 54px 60px;
  color: #152033;
}

.login-capabilities-kicker {
  margin: 0 0 14px;
  color: #0b5cad;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.login-capabilities h2 {
  max-width: 500px;
  margin: 0;
  font-size: clamp(26px, 2.4vw, 36px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.login-capabilities-intro {
  max-width: 520px;
  margin: 18px 0 0;
  color: #5d6d84;
  font-size: 14px;
  line-height: 1.75;
}

.login-capability-list {
  display: grid;
  gap: 13px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.login-capability-list li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 15px 16px;
  border: 1px solid rgba(196, 210, 226, 0.72);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.5);
}

.login-capability-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(11, 92, 173, 0.09);
  color: #0b5cad;
  font-size: 11px;
  font-weight: 600;
}

.login-capability-list strong,
.login-capability-list small { display: block; }

.login-capability-list strong {
  color: #233149;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.login-capability-list small {
  margin-top: 4px;
  color: #66768d;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  #login-guard { padding: 24px; }

  .login-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(520px, 100%);
    min-height: 0;
  }

  #login-guard .login-card {
    min-height: min(640px, calc(100dvh - 48px));
    padding: 42px 46px;
    border-right: 0;
    border-bottom: 0;
  }

  .login-capabilities { display: none; }
}

@media (max-width: 560px) {
  #login-guard { padding: 14px; }

  #login-guard .login-card {
    min-height: calc(100dvh - 28px);
    padding: 34px 26px;
  }

  .login-brand { margin-bottom: 30px; }
  #login-title { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora-orb { animation: none; }
}

body.reduce-motion .aurora-orb { animation: none; }

/* Production desktop shell: navigation and utilities stay independent from business state. */
.app-shell {
  grid-template-columns: 224px minmax(0, 1fr) 360px;
  background: #f3f6fa;
}

.app-shell.overview-mode,
.app-shell.report-mode { grid-template-columns: 224px minmax(0, 1fr); }

.sidebar {
  display: flex;
  flex-direction: column;
  /* 这里绝不能用 100dvh / 100vh：.app-shell 的高度已是
     calc(100dvh - var(--site-icp-footer-height))，侧栏若按整个视口高算就会溢出
     页脚那 30px，ICP 备案页脚（正常流、DOM 在后）会压住 .sidebar-footer 里的
     模型设置卡下半部分，表现为「模型设置卡有时候显示不出来」。
     百分比在 grid item 上也不可靠（会参照 body 而非轨道高度），
     因此不设最小高度，交给 .app-shell 的 grid 默认 stretch 拉满轨道。 */
  min-height: 0;
  padding: 22px 14px 14px;
  border-right: 1px solid var(--ui-line);
  background: #f9fbfd;
}

.sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 0;
}

.sidebar-footer { flex: 0 0 auto; display: grid; gap: 10px; }
.legacy-mode-switch,
.legacy-nav-list { display: none !important; }
.sidebar-nav { display: grid; gap: 22px; }
.sidebar-nav-group { display: grid; gap: 4px; }
.sidebar-nav-group h2 {
  margin: 0 10px 7px;
  color: #7a889e;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: .08em;
}
.sidebar-nav .nav-item {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13px;
}
.sidebar-nav .nav-item.active { background: #e9f2fc; color: #084f96; box-shadow: inset 3px 0 #0b5cad; }

.workspace { position: relative; padding-top: 64px; }
.desktop-topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--ui-line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
}
.desktop-topbar-spacer { flex: 1; }
.global-search-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(390px, 42vw);
  min-height: 40px;
  padding: 0 10px 0 14px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: #f7f9fc;
  color: #66758b;
  cursor: pointer;
}
.global-search-button:hover { border-color: var(--ui-line-strong); background: #fff; }
kbd { padding: 2px 6px; border: 1px solid var(--ui-line); border-radius: 5px; background: #fff; color: #65748a; font: 11px/18px inherit; }
.topbar-sync-status { color: #66758b; font-size: 12px; white-space: nowrap; }
.account-button {
  min-height: 36px;
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  background: #fff;
  color: #31415a;
  cursor: pointer;
}
.account-button { padding: 0 12px; }
.account-menu {
  position: absolute;
  top: 54px;
  right: 24px;
  z-index: 60;
  display: grid;
  width: 170px;
  padding: 6px;
  border: 1px solid var(--ui-line);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(24,39,65,.14);
}
.account-menu.hidden { display: none; }
.account-menu button { padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: #24334a; text-align: left; cursor: pointer; }
.account-menu button:hover,
.account-menu button:focus-visible { background: #f0f5fb; }

.global-search-root { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: start center; padding-top: min(14vh, 132px); }
.global-search-root.hidden { display: none; }
.global-search-backdrop { position: absolute; inset: 0; background: rgba(20,31,49,.34); backdrop-filter: blur(3px); }
.global-search-dialog { position: relative; width: min(680px, calc(100vw - 32px)); overflow: hidden; border: 1px solid rgba(209,219,231,.9); border-radius: 16px; background: #fff; box-shadow: 0 28px 80px rgba(17,32,56,.22); }
.global-search-input-row { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; gap: 10px; align-items: center; min-height: 60px; padding: 0 16px; border-bottom: 1px solid var(--ui-line); }
.global-search-input-row input { width: 100%; border: 0; outline: 0; color: #152033; font: 500 15px/24px inherit; }
.global-search-results { max-height: min(55vh, 480px); overflow-y: auto; padding: 8px; }
.global-search-empty { padding: 34px 20px; color: #718097; text-align: center; font-size: 13px; }
.global-search-result { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; padding: 11px 12px; border: 0; border-radius: 9px; background: transparent; color: #1d2b42; text-align: left; cursor: pointer; }
.global-search-result.active { background: #edf4fc; }
.global-search-result span,
.global-search-result strong,
.global-search-result small { display: block; }
.global-search-result small { margin-top: 2px; color: #718097; font-size: 12px; }
.global-search-result em { color: #53647c; font-size: 12px; font-style: normal; white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

.report-polish-overlay.is-closing,
.tpl-editor-overlay.is-closing,
.report-style-overlay.is-closing,
.delete-confirm-overlay.is-closing,
.today-meeting-detail-overlay.is-closing {
  pointer-events: none;
  animation: transient-overlay-out 170ms var(--ui-ease-exit, cubic-bezier(.4, 0, 1, 1)) both;
}

.is-closing > [role="dialog"],
.is-closing > section {
  animation: transient-dialog-out 170ms var(--ui-ease-exit, cubic-bezier(.4, 0, 1, 1)) both;
}

.report-style-overlay.is-closing > .report-style-dialog {
  animation: transient-dialog-out 170ms var(--ui-ease-exit, cubic-bezier(.4, 0, 1, 1)) both;
}

@keyframes transient-overlay-out {
  to { opacity: 0; }
}

@keyframes transient-dialog-out {
  to { opacity: 0; transform: translateY(6px) scale(.99); }
}

@media (prefers-reduced-motion: reduce) {
  .report-polish-overlay.is-closing,
  .tpl-editor-overlay.is-closing,
  .report-style-overlay.is-closing,
  .delete-confirm-overlay.is-closing,
  .today-meeting-detail-overlay.is-closing,
  .is-closing > [role="dialog"],
  .is-closing > section,
  .report-style-overlay.is-closing > .report-style-dialog {
    animation: none !important;
    transform: none !important;
  }
}

body.reduce-motion .report-polish-overlay.is-closing,
body.reduce-motion .tpl-editor-overlay.is-closing,
body.reduce-motion .report-style-overlay.is-closing,
body.reduce-motion .delete-confirm-overlay.is-closing,
body.reduce-motion .today-meeting-detail-overlay.is-closing,
body.reduce-motion .is-closing > [role="dialog"],
body.reduce-motion .is-closing > section,
body.reduce-motion .report-style-overlay.is-closing > .report-style-dialog {
  animation: none !important;
  transform: none !important;
}

@media (max-width: 1120px) {
  .app-shell,
  .app-shell.overview-mode,
  .app-shell.report-mode { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 250; width: 224px; transform: translateX(-105%); transition: transform 180ms ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: inline-flex; flex: 0 0 auto; }
  .global-search-button { width: min(390px, 50vw); }
}

@media (max-width: 700px) {
  .desktop-topbar { padding-inline: 14px; }
  .global-search-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-sync-status { display: none; }
  .account-button { font-size: 0; }
  .account-button span { font-size: 13px; }
}

/* Production desktop UI layer */
:root {
  --ui-brand: #0b5cad;
  --ui-brand-hover: #084f96;
  --ui-brand-soft: #e9f2fc;
  --ui-bg: #f3f6fa;
  --ui-surface: #ffffff;
  --ui-surface-muted: #f8fafc;
  --ui-surface-raised: #ffffff;
  --ui-surface-soft: #f8fafc;
  --ui-text: #152033;
  --ui-text-secondary: #53627a;
  --ui-text-tertiary: #748198;
  --ui-text-inverse: #ffffff;
  --ui-line: #dce4ee;
  --ui-line-strong: #cbd6e4;
  --ui-success: #047857;
  --ui-success-soft: #ecfdf5;
  --ui-warning: #9a4b00;
  --ui-warning-soft: #fff7e8;
  --ui-danger: #c2413a;
  --ui-danger-soft: #fff1f0;
  --ui-focus: #0b5cad;
  --ui-overlay: rgba(21, 32, 51, 0.42);
  --ui-radius-sm: 8px;
  --ui-radius: 12px;
  --ui-radius-lg: 16px;
  --ui-shadow-card: 0 1px 2px rgba(20, 36, 60, 0.05), 0 8px 24px rgba(20, 36, 60, 0.04);
  --ui-shadow-panel: 0 18px 48px rgba(20, 36, 60, 0.14);
  --ui-motion-fast: 120ms;
  --ui-motion-state: 180ms;
  --ui-motion-panel: 240ms;
  --ui-motion-dialog: 280ms;
  --ui-motion-view: 140ms;
  --ui-motion-hover: 120ms;
  --ui-ease-enter: cubic-bezier(0.2, 0, 0, 1);
  --ui-ease-state: cubic-bezier(0.2, 0, 0, 1);
  --ui-ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --ui-ease-ambient: ease-in-out;
  --ui-ease: var(--ui-ease-state);
}

@keyframes ui-view-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea { color: inherit; }

button { touch-action: manipulation; }

.app-shell {
  width: 100%;
  min-width: 0;
  background: var(--ui-bg);
}

.sidebar {
  gap: 12px;
  border-color: var(--ui-line);
  background: #f8fafc;
  color: var(--ui-text);
}

.brand {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: 20px 18px;
  height: 70px;
  border-color: var(--ui-line);
  border-left-color: var(--ui-brand);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: none;
}

.brand::before {
  position: static;
  width: 38px;
  height: 38px;
  background: var(--ui-brand);
  font-size: 16px;
}

.brand-title {
  color: var(--ui-text);
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
}

.brand-subtitle {
  color: var(--ui-text-secondary);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.sidebar-nav { gap: 22px; }
.sidebar-nav-group { gap: 4px; }
.sidebar-nav-group h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 20px 10px 6px;
  color: var(--ui-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: .08em;
}
.sidebar-nav-group h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ui-line);
}
.sidebar-nav-group:first-child h2 { margin-top: 0; }

.sidebar-nav .nav-item {
  min-height: 40px;
  border-radius: 8px;
  background: transparent;
  color: var(--ui-text-secondary);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  transition: color var(--ui-motion-state) var(--ui-ease), background-color var(--ui-motion-state) var(--ui-ease), box-shadow var(--ui-motion-state) var(--ui-ease);
}

.sidebar-nav .nav-item:hover { background: transparent; color: var(--ui-text); }
.sidebar-nav .nav-item.active {
  background: #eef4fb;
  color: #0b5cad;
  font-weight: 600;
  box-shadow: inset 3px 0 #0b5cad;
}
.desktop-topbar {
  border-color: var(--ui-line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 0 rgba(20, 36, 60, 0.02);
}

.workspace {
  min-width: 0;
  gap: 16px;
  overflow-x: hidden;
  background: var(--ui-bg);
}

.workspace-head,
.toolbar,
.table-panel,
.metric-card,
.status-card,
.model-card,
.overview-panel,
.report-panel {
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-card);
}

.workspace-head {
  min-height: 88px;
  padding: 18px 20px;
  border-left: 0;
  background: var(--ui-surface);
}

.workspace-head h1 {
  margin: 0;
  color: var(--ui-text);
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.workspace-head p {
  margin-top: 4px;
  color: var(--ui-text-secondary);
  font-size: 12px;
  line-height: 18px;
}

.overview-block-title {
  color: var(--ui-text);
  font-size: 18px;
  line-height: 26px;
  font-weight: 600;
}

.panel-title,
.detail-title,
.overview-panel-title,
.report-panel-title,
.report-section-title,
.report-polish-dialog-title,
.delete-confirm-title {
  color: var(--ui-text);
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.panel-subtitle,
.detail-subtitle,
.overview-panel-subtitle,
.report-panel-subtitle,
.report-source-note,
.report-polish-dialog-subtitle,
.delete-confirm-subtitle {
  color: var(--ui-text-secondary);
  font-size: 12px;
  line-height: 18px;
  font-weight: 400;
}

.field-label,
.report-control-label,
.report-model-field span {
  color: var(--ui-text-secondary);
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
}

.primary-button,
.ghost-button,
.icon-button,
.model-config-button,
.period-button,
.report-action-btn,
.report-action-link,
.action-link,
.table-link,
.field-inline-action,
.account-button,
.global-search-button {
  border-radius: var(--ui-radius-sm);
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  transition: color var(--ui-motion-state) var(--ui-ease), background-color var(--ui-motion-state) var(--ui-ease), border-color var(--ui-motion-state) var(--ui-ease), box-shadow var(--ui-motion-state) var(--ui-ease), transform var(--ui-motion-fast) var(--ui-ease), opacity var(--ui-motion-state) var(--ui-ease);
}

.ghost-button,
.icon-button,
.model-config-button,
.period-button,
.account-button,
.global-search-button {
  min-height: 40px;
  border: 1px solid var(--ui-line-strong);
  background: var(--ui-surface);
  color: var(--ui-text-secondary);
  box-shadow: none;
}

.primary-button {
  min-height: 44px;
  padding-inline: 18px;
  border: 1px solid var(--ui-brand);
  background: var(--ui-brand);
  color: var(--ui-text-inverse);
  box-shadow: 0 8px 20px rgba(11, 92, 173, 0.16);
}

.detail-actions .ghost-button { min-height: 40px; }
.detail-actions .primary-button { min-height: 44px; }

.report-action-btn.compact,
.action-link,
.table-link,
.field-inline-action { min-height: 32px; }

.primary-button:hover:not(:disabled) {
  border-color: var(--ui-brand-hover);
  background: var(--ui-brand-hover);
  box-shadow: 0 10px 24px rgba(11, 92, 173, 0.2);
  transform: none;
}

.ghost-button:hover:not(:disabled),
.icon-button:hover:not(:disabled),
.model-config-button:hover:not(:disabled),
.period-button:hover:not(:disabled),
.account-button:hover:not(:disabled),
.global-search-button:hover:not(:disabled) {
  border-color: var(--ui-line-strong);
  background: #f7fafd;
  color: var(--ui-brand);
}

.primary-button:focus-visible,
.ghost-button:focus-visible,
.icon-button:focus-visible,
.model-config-button:focus-visible,
.period-button:focus-visible,
.report-action-btn:focus-visible,
.account-button:focus-visible,
.global-search-button:focus-visible,
.sidebar-nav .nav-item:focus-visible {
  outline: 3px solid var(--ui-focus);
  outline-offset: 2px;
}

.primary-button:disabled,
.ghost-button:disabled,
.icon-button:disabled,
.model-config-button:disabled,
.period-button:disabled,
.report-action-btn:disabled,
.account-button:disabled,
.global-search-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  box-shadow: none;
  transform: none;
}

.primary-button.is-loading,
.ghost-button.is-loading,
.report-action-btn.is-loading,
button[aria-busy="true"] {
  cursor: wait;
  opacity: 0.72;
  pointer-events: none;
}

.danger-button,
.danger-button:hover:not(:disabled),
.delete-confirm-submit {
  border-color: #efbbb7;
  background: var(--ui-danger-soft);
  color: var(--ui-danger);
  box-shadow: none;
}

.project-next-complete-dialog .delete-confirm-submit {
  border-color: var(--ui-brand);
  background: var(--ui-brand);
  color: var(--ui-text-inverse);
}

.project-next-complete-dialog .delete-confirm-submit:hover:not(:disabled) {
  border-color: var(--ui-brand-hover);
  background: var(--ui-brand-hover);
  color: var(--ui-text-inverse);
}

.report-action-btn.final,
.report-center-action-primary,
.report-action-btn.pending {
  border-color: var(--ui-brand);
  background: var(--ui-brand);
  color: var(--ui-text-inverse);
}

.report-action-btn.primary-lite {
  border-color: var(--ui-line-strong);
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
}

.filter-control select,
.field-input,
.field-select,
.field-textarea,
.text-input,
.report-polish-input,
.report-polish-select,
.report-edit-textarea,
.report-date-field input {
  min-height: 40px;
  border: 1px solid var(--ui-line-strong);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
  color: var(--ui-text);
  font-size: 14px;
  line-height: 22px;
  transition: border-color var(--ui-motion-state) var(--ui-ease), box-shadow var(--ui-motion-state) var(--ui-ease), background-color var(--ui-motion-state) var(--ui-ease);
}

.filter-control select:focus,
.field-input:focus,
.field-select:focus,
.field-textarea:focus,
.text-input:focus,
.report-polish-input:focus,
.report-polish-select:focus,
.report-edit-textarea:focus,
.report-date-field input:focus {
  border-color: var(--ui-brand);
  outline: 0;
  background: var(--ui-surface);
  box-shadow: 0 0 0 3px var(--ui-focus);
}

.field-input[aria-invalid="true"],
.field-select[aria-invalid="true"],
.field-textarea[aria-invalid="true"] { border-color: var(--ui-danger); }

.table-panel { overflow: hidden; }
.table-wrap { max-width: 100%; overflow-x: auto; }
.data-table { min-width: 680px; color: var(--ui-text); }

.data-table.business-table {
  table-layout: fixed;
  width: max(100%, var(--business-table-min-width, 680px));
}

.data-table.business-table .business-col-title { width: 220px; }
.data-table.business-table .business-col-health { width: 220px; }
.data-table.business-table .business-col-narrative { width: 280px; }
.data-table.business-table .business-col-followup-target { width: 144px; }
.data-table.business-table .business-col-date { width: 136px; }
.data-table.business-table .business-col-expected-close { width: 210px; }
.data-table.business-table .business-col-status { width: 112px; }
.data-table.business-table .business-col-number { width: 120px; }
.data-table.business-table .business-col-relation { width: 160px; }
.data-table.business-table .business-col-standard { width: 144px; }
.data-table.business-table .business-col-action { width: 188px; }

.data-table.business-table th,
.data-table.business-table td { overflow: hidden; }

.data-table.database-table {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}

.data-table th {
  border-color: var(--ui-line);
  background: var(--ui-surface-muted);
  color: var(--ui-text-secondary);
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
}

.data-table td {
  border-color: var(--ui-line);
  color: var(--ui-text);
  font-size: 13px;
  line-height: 20px;
}

.business-column-title,
.data-table .business-column-title { min-width: 150px; }

.business-column-narrative,
.data-table .business-column-narrative { min-width: 220px; }

.business-column-followup-target,
.data-table .business-column-followup-target {
  min-width: 112px;
  width: 128px;
  max-width: 160px;
}

.business-cell-text-title,
.business-cell-text-narrative {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.business-cell-text[data-overflowing="true"] { cursor: help; }

.business-cell-text[data-overflowing="true"]:focus-visible {
  outline: 2px solid var(--ui-focus);
  outline-offset: 2px;
}

.business-cell-tooltip {
  position: fixed;
  z-index: 120;
  max-width: min(360px, calc(100vw - 24px));
  max-height: min(240px, calc(100vh - 24px));
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--ui-line-strong);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-panel);
  color: var(--ui-text);
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
  pointer-events: auto;
  user-select: text;
  white-space: normal;
  overflow-wrap: anywhere;
}

.business-cell-tooltip[hidden] { display: none; }

.business-cell-tooltip-structured {
  display: grid;
  gap: 7px;
}
.record-timeline-tooltip-content {
  display: grid;
  gap: 7px;
}
.record-timeline-tooltip-title {
  color: var(--ui-text);
  font-size: 13px;
  line-height: 20px;
}
.record-timeline-tooltip-summary {
  color: var(--ui-text-secondary);
  font-size: 12px;
  line-height: 18px;
}
.record-timeline-tooltip-meta {
  display: grid;
  gap: 2px;
  border-top: 1px solid var(--ui-line);
  padding-top: 7px;
  color: var(--ui-text-secondary);
  font-size: 11px;
  line-height: 17px;
}
.record-timeline-tooltip-meta > span { display: block; }

.data-table tbody tr { animation: none; }
.data-table tbody tr:hover td { background: var(--ui-surface-muted); }
.data-table tr.selected td { background: var(--ui-brand-soft); box-shadow: none; }

.badge,
.report-badge,
.status-badge,
.health-badge {
  border-radius: 999px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
}

.badge.ok,
.badge.healthy,
.report-badge.success { background: var(--ui-success-soft); color: var(--ui-success); }
.badge.warn,
.badge.warning,
.report-badge.warning { background: var(--ui-warning-soft); color: var(--ui-warning); }
.badge.danger,
.badge.error,
.report-badge.danger { background: var(--ui-danger-soft); color: var(--ui-danger); }

.detail-panel {
  border-color: var(--ui-line);
  background: var(--ui-surface);
  box-shadow: none;
  animation: none;
}

.detail-head,
.detail-actions,
.table-panel-head,
.overview-panel-head,
.report-panel-head,
.report-center-head,
.report-polish-dialog-head {
  border-color: var(--ui-line);
  background: var(--ui-surface);
}

.report-polish-dialog-head { flex: 0 0 auto; }

.detail-kicker { color: var(--ui-brand); font-size: 12px; line-height: 18px; font-weight: 600; }
.detail-message.success { background: var(--ui-success-soft); color: var(--ui-success); }
.detail-message.warn,
.detail-message.warning { background: var(--ui-warning-soft); color: var(--ui-warning); }
.detail-message.danger,
.detail-message.error { background: var(--ui-danger-soft); color: var(--ui-danger); }

.overview-realtime-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--ui-line);
  border-left: 3px solid var(--ui-danger);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  color: var(--ui-text-secondary);
  font-size: 13px;
  line-height: 20px;
}

.overview-realtime-summary strong { color: var(--ui-text); font-size: 14px; }
.table-panel.is-filtered .panel-summary { color: var(--ui-brand); }
.table-panel.is-error { border-color: var(--ui-danger); }
.table-panel.is-error .table-error-state strong { color: var(--ui-danger); }
.table-panel.is-loading .table-loading-state { opacity: 0.78; }
.detail-panel.is-dirty { box-shadow: inset 3px 0 var(--ui-warning); }
.detail-panel.is-saving { box-shadow: inset 3px 0 var(--ui-brand); }
.detail-panel.is-error { box-shadow: inset 3px 0 var(--ui-danger); }
.detail-panel.is-readonly .detail-kicker { color: var(--ui-text-secondary); }

.overview-priority-lane,
.overview-list-item,
.report-material-card,
.report-summary-item,
.report-version-item,
.report-timeline-item,
.report-center-item,
.report-source-item,
.report-base-status,
.report-current-source,
.report-draft-status {
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: none;
  transition: border-color var(--ui-motion-state) var(--ui-ease), background-color var(--ui-motion-state) var(--ui-ease), box-shadow var(--ui-motion-state) var(--ui-ease), transform var(--ui-motion-fast) var(--ui-ease);
}

.overview-priority-lane:hover,
.overview-list-item:hover,
.report-material-card:hover,
.report-summary-item:hover,
.report-version-item:hover,
.report-timeline-item:hover,
.report-center-item:hover {
  border-color: var(--ui-line-strong);
  background: #fbfdff;
  box-shadow: 0 8px 20px rgba(20, 36, 60, 0.06);
  transform: translateY(-1px);
}

.report-polish-overlay,
.delete-confirm-overlay,
.global-search-backdrop {
  background: var(--ui-overlay);
  backdrop-filter: blur(4px);
}

.report-polish-dialog,
.delete-confirm-dialog,
.global-search-dialog,
.account-menu {
  border-color: var(--ui-line);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface-raised);
  box-shadow: var(--ui-shadow-panel);
}

.report-polish-dialog,
.delete-confirm-dialog { animation: v3-dialog-pop var(--ui-motion-dialog) var(--ui-ease) both; }

.preferences-dialog { width: min(560px, calc(100vw - 32px)); }
.preferences-content { padding: 20px; }
.preferences-section { display: grid; gap: 8px; }
.motion-preference-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.motion-preference-options button {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 10px;
  background: var(--ui-surface);
  color: var(--ui-text);
  font: 600 13px/20px inherit;
  text-align: left;
  cursor: pointer;
}
.motion-preference-options button small { color: var(--ui-text-secondary); font: 400 12px/18px inherit; }
.motion-preference-options button:hover { border-color: var(--ui-line-strong); background: #f7fafd; }
.motion-preference-options button.active { border-color: var(--ui-brand); background: var(--ui-brand-soft); color: var(--ui-brand); box-shadow: inset 0 0 0 1px var(--ui-brand); }
.motion-preference-options button:focus-visible { outline: 3px solid var(--ui-focus); outline-offset: 2px; }
.motion-preference-status { min-height: 20px; margin: 4px 0 0; color: var(--ui-text-secondary); font-size: 13px; line-height: 20px; }

@media (max-width: 620px) {
  .motion-preference-options { grid-template-columns: minmax(0, 1fr); }
}

.toast-queue { max-width: min(380px, calc(100vw - 32px)); }
.toast-item,
.report-floating-toast {
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  color: var(--ui-text);
  box-shadow: var(--ui-shadow-panel);
}

.toast-item.success { border-left-color: var(--ui-success); }
.toast-item.warning { border-left-color: var(--ui-warning); }
.toast-item.error { border-left-color: var(--ui-danger); }

@media (min-width: 1360px) {
  .app-shell { grid-template-columns: 224px minmax(0, 1fr) 420px; }
  .app-shell.overview-mode,
  .app-shell.report-mode { grid-template-columns: 224px minmax(0, 1fr); }
}

@media (min-width: 961px) and (max-width: 1359px) {
  .app-shell,
  .app-shell.overview-mode,
  .app-shell.report-mode { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 250;
    width: 224px;
    max-width: calc(100vw - 48px);
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform var(--ui-motion-panel) var(--ui-ease);
  }

  .sidebar.open { transform: translateX(0); box-shadow: var(--ui-shadow-panel); }
  .sidebar-toggle { display: inline-flex; }

  .detail-panel {
    display: none;
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 220;
    width: min(420px, calc(100vw - 64px));
    max-height: 100dvh;
    box-shadow: var(--ui-shadow-panel);
    animation: v3-detail-slide var(--ui-motion-panel) var(--ui-ease) both;
  }

  .detail-panel:has(#close-detail-button:not(.hidden)) { display: flex; }
  .app-shell.overview-mode .detail-panel,
  .app-shell.report-mode .detail-panel { display: none; }
}

@media (max-width: 960px) {
  body { min-width: 0; }

  .workspace {
    width: 100%;
    min-width: 0;
    padding: 118px 14px 18px;
  }

  .desktop-topbar {
    flex-wrap: wrap;
    min-height: 104px;
    padding: 12px 14px;
  }

  .global-search-button {
    order: 3;
    width: 100%;
    max-width: none;
  }

  .desktop-topbar-spacer { display: none; }
  .topbar-sync-status { margin-left: auto; }
  .workspace-head { align-items: flex-start; padding: 16px; }
  .head-actions,
  .toolbar,
  .filter-row { width: 100%; flex-wrap: wrap; }
  .report-grid,
  .overview-priority-strip,
  .overview-section-grid,
  .overview-action-grid,
  .report-center-filter-grid { grid-template-columns: minmax(0, 1fr); }

  .table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }

  .detail-panel:has(#close-detail-button:not(.hidden)) {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 260;
    width: 100%;
    max-width: none;
    max-height: 100dvh;
    box-shadow: none;
  }
}

/* Production overview A hierarchy and semantic color override. */
body.login-active .desktop-topbar {
  display: none;
}

.overview-priority-strip .overview-priority-lane,
.overview-priority-strip .overview-priority-lane.danger,
.overview-priority-strip .overview-priority-lane.warn,
.overview-priority-strip .overview-priority-lane.ok {
  border-left-color: var(--ui-brand);
}

.overview-analysis-layout {
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
}

.overview-stage-card {
  background: var(--ui-brand-soft);
}

.overview-bar-row.is-attention .overview-bar-fill {
  background: var(--ui-warning);
}

@media (max-width: 1359px) {
  .overview-analysis-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 当前周期归档保持上下文关联，同时降低视觉权重。 */
.report-period-archives-link {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--v3-brand);
  cursor: pointer;
  flex-shrink: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 0 4px;
}

.report-period-archives-link:hover {
  background: transparent;
  color: var(--v3-brand-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.report-period-archives-link:focus-visible {
  outline: 2px solid var(--v3-brand);
  outline-offset: 2px;
}

.report-timeline-card .report-timeline-empty {
  display: grid;
  gap: 2px;
  min-height: 0;
  border: 0;
  background: var(--ui-surface-muted);
  padding: 12px;
  text-align: left;
}

.report-timeline-card .report-timeline-empty span {
  margin-top: 0;
}


/* 今日工作台：聚焦当前行动的统一驾驶舱。 */
.app-shell.today-mode {
  grid-template-columns: 224px minmax(0, 1fr);
}

.app-shell.today-mode .detail-panel {
  display: none;
}

.app-shell.today-mode .workspace {
  overflow: auto;
}

.today-page {
  min-width: 0;
  padding: 0 18px 28px;
}

.today-page button {
  min-height: 44px;
}

.today-cockpit {
  display: grid;
  gap: 14px;
}

.today-cockpit button {
  min-height: 44px;
}

.today-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ui-line);
}

.today-section-head > div {
  min-width: 0;
}

.today-section-head h2,
.today-section-head p {
  margin: 0;
}

.today-section-head h2 {
  color: var(--ui-text);
  font-size: 16px;
}

.today-section-head p {
  margin-top: 3px;
  color: var(--ui-text-secondary);
  font-size: 11px;
}

.today-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--ui-brand);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
}

.today-count {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
}

.today-section-body {
  min-width: 0;
  padding: 14px 16px;
}

.today-row-actions,
.today-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.today-schedule-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ui-line);
}

.today-schedule-row:last-child { border-bottom: 0; }
.today-schedule-row time { color: var(--ui-brand); font-weight: 600; }
.today-schedule-row strong { display: block; }

.today-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--ui-line);
  border-left: 4px solid var(--ui-brand);
  border-radius: 9px;
  background: var(--ui-surface);
  padding: 12px 14px;
}

.today-state strong,
.today-state span { display: block; }
.today-state span { color: var(--ui-text-secondary); font-size: 12px; }
.today-state-error { border-left-color: var(--ui-danger); background: var(--ui-danger-soft); }
.today-state-empty {
  justify-content: center;
  flex-direction: column;
  min-height: 96px;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.today-meeting-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .38);
}

.today-meeting-detail-dialog {
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 16px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-card);
}

.today-meeting-detail-dialog header,
.today-meeting-detail-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.today-meeting-detail-dialog header {
  border-bottom: 1px solid var(--ui-line);
}

.today-meeting-detail-dialog header span {
  color: var(--ui-brand);
  font-size: 11px;
  font-weight: 600;
}

.today-meeting-detail-dialog h2 {
  margin: 3px 0 0;
  color: var(--ui-text);
  font-size: 20px;
}

.today-meeting-detail-body {
  display: grid;
  gap: 0;
  padding: 8px 18px;
}

.today-meeting-detail-body > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ui-line);
}

.today-meeting-detail-body > div:last-child {
  border-bottom: 0;
}

.today-meeting-detail-body span {
  color: var(--ui-text-secondary);
  font-size: 12px;
}

.today-meeting-detail-body strong {
  overflow-wrap: anywhere;
  color: var(--ui-text);
  font-size: 13px;
}

.today-meeting-detail-dialog footer {
  justify-content: flex-end;
  border-top: 1px solid var(--ui-line);
}

@media (max-width: 1359px) {
  .app-shell.today-mode { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1200px) {
  .app-shell.today-mode { grid-template-columns: minmax(0, 1fr); }
  .today-page { padding-inline: 14px; }
}

@media (max-width: 1050px) {
  .app-shell.today-mode { grid-template-columns: minmax(0, 1fr); }
  .today-page { padding-inline: 10px; }
  .today-schedule-row { grid-template-columns: 64px minmax(0, 1fr); }
  .today-schedule-row .today-row-actions { grid-column: 2; }
}

.attention-dialog-overlay { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 18px; background: var(--ui-overlay); }
.attention-dialog { width: min(520px, 100%); overflow: hidden; border: 1px solid var(--ui-line); border-radius: 14px; background: var(--ui-surface-raised); color: var(--ui-text); box-shadow: var(--ui-shadow-panel); }
.attention-dialog header,.attention-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.attention-dialog header { border-bottom: 1px solid var(--ui-line); }.attention-dialog footer { justify-content: flex-end; border-top: 1px solid var(--ui-line); }
.attention-dialog header span { color: var(--ui-brand); font-size: 11px; }.attention-dialog h3 { margin: 2px 0 0; font-size: 17px; }
.attention-dialog-body { display: grid; gap: 14px; padding: 16px; }.attention-dialog fieldset { margin: 0; border: 0; padding: 0; }.attention-dialog legend,.attention-dialog label>span { display: block; margin-bottom: 7px; color: var(--ui-text-secondary); font-size: 12px; font-weight: 600; }
.attention-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.attention-choice-grid button { min-height: 40px; border: 1px solid var(--ui-line-strong); border-radius: 8px; background: var(--ui-surface); color: var(--ui-text-secondary); }
.attention-choice-grid button[aria-pressed="true"] { border-color: var(--ui-brand); background: var(--ui-brand-soft); color: var(--ui-brand); font-weight: 600; }
.attention-dialog input { width: 100%; min-height: 40px; border: 1px solid var(--ui-line-strong); border-radius: 8px; background: var(--ui-surface); color: var(--ui-text); padding: 8px 10px; }

/* 今日工作台：服务端唯一行动队列，左侧连续处理，右侧只承载当前上下文。 */
.today-action-cockpit {
  min-width: 0;
  gap: 16px;
}

.today-status-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(120px, .72fr)) auto;
  align-items: stretch;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: var(--ui-surface);
}

.today-status-date,
.today-status-bar > button {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 68px;
  border: 0;
  border-right: 1px solid var(--ui-line);
  background: transparent;
  padding: 10px 16px;
  color: var(--ui-text-secondary);
  text-align: left;
}

.today-status-bar > button:hover,
.today-status-bar > button:focus-visible {
  background: var(--ui-brand-soft);
}

.today-status-date span,
.today-status-bar > button span {
  font-size: 11px;
}

.today-status-date strong,
.today-status-bar > button strong {
  overflow: hidden;
  color: var(--ui-text);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.today-status-actions button {
  min-height: 42px;
  white-space: nowrap;
}

.today-action-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
  align-items: start;
  gap: 16px;
  min-width: 0;
}

.today-action-queue,
.today-context-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: var(--ui-surface);
}

.today-action-tabs {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--ui-line);
  padding: 0 12px;
}

.today-action-tabs button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: max-content;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--ui-text-secondary);
  padding: 10px 12px 7px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--ui-motion-hover, 120ms) var(--ui-ease, ease),
    border-bottom-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease),
    background-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease);
}

/* 原先只写了基础态与 [aria-selected]，缺 :hover / :focus-visible / transition，
   表现为鼠标划过无反应、点击时颜色瞬变。 */
.today-action-tabs button:hover:not([aria-selected="true"]) {
  color: var(--ui-text);
  border-bottom-color: var(--ui-line-strong);
  background: var(--ui-surface-muted);
}

.today-action-tabs button:focus-visible {
  outline: 2px solid var(--ui-focus, var(--ui-brand));
  outline-offset: -2px;
}

.today-action-tabs button[aria-selected="true"] {
  border-bottom-color: var(--ui-brand);
  color: var(--ui-brand);
}

.today-action-tabs button[aria-selected="true"]:hover {
  background: var(--ui-brand-soft);
}

.today-action-tabs button span {
  min-width: 21px;
  border-radius: 999px;
  background: var(--ui-surface-muted);
  padding: 1px 6px;
  font-size: 11px;
  text-align: center;
  transition: background-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease);
}

.today-action-toolbar,
.today-action-queue-head,
.today-context-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ui-line);
}

.today-action-toolbar > span,
.today-action-queue-head p {
  flex: 0 0 auto;
  margin: 0;
  color: var(--ui-text-secondary);
  font-size: 11px;
}

.today-source-filters {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
}

.today-source-filters button,
.today-schedule-range button {
  min-width: max-content;
  min-height: 44px;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  background: var(--ui-surface);
  color: var(--ui-text-secondary);
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease),
    background-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease),
    color var(--ui-motion-hover, 120ms) var(--ui-ease, ease);
}

/* 补 :hover / :focus-visible：原先只有基础态与 [aria-pressed] 选中态 */
.today-source-filters button:hover:not([aria-pressed="true"]),
.today-schedule-range button:hover:not(.active) {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-muted);
  color: var(--ui-text);
}

.today-source-filters button:focus-visible,
.today-schedule-range button:focus-visible {
  outline: 2px solid var(--ui-focus, var(--ui-brand));
  outline-offset: 2px;
}

.today-source-filters button[aria-pressed="true"],
.today-schedule-range button.active {
  border-color: var(--ui-brand);
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
  font-weight: 600;
}

.today-source-filters button[aria-pressed="true"]:hover,
.today-schedule-range button.active:hover {
  border-color: var(--ui-brand-hover, var(--ui-brand));
  background: color-mix(in srgb, var(--ui-brand-soft) 70%, var(--ui-surface));
}

.today-action-queue-head {
  align-items: flex-start;
  background: var(--ui-surface-muted);
}

.today-action-queue-head span,
.today-context-head span,
.today-action-source {
  color: var(--ui-brand);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
}

.today-action-queue-head h2,
.today-context-head h2 {
  margin: 3px 0 0;
  color: var(--ui-text);
  font-size: 17px;
}

.today-action-items {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
}

.today-action-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto minmax(112px, auto);
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: var(--ui-surface);
  padding: 10px;
  transition: border-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease),
    background-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease),
    box-shadow var(--ui-motion-state, 180ms) var(--ui-ease, ease);
}

.today-action-item:hover {
  border-color: color-mix(in srgb, var(--ui-brand) 34%, var(--ui-line));
  background: color-mix(in srgb, var(--ui-brand-soft) 22%, var(--ui-surface));
}

.today-action-item.is-first {
  border-color: color-mix(in srgb, var(--ui-brand) 52%, var(--ui-line));
  border-left: 4px solid var(--ui-brand);
  background: color-mix(in srgb, var(--ui-brand-soft) 48%, var(--ui-surface));
  box-shadow: 0 7px 20px rgba(11, 92, 173, .08);
}

/* 当前选中项：语义独立于「排序第一」。放在 .is-first 之后以便同时命中时选中态胜出。 */
.today-action-item.is-selected {
  border-color: var(--ui-brand);
  border-left: 4px solid var(--ui-brand);
  background: color-mix(in srgb, var(--ui-brand-soft) 72%, var(--ui-surface));
  box-shadow: 0 0 0 1px var(--ui-brand) inset, 0 8px 22px rgba(11, 92, 173, .14);
}

.today-action-order {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--ui-surface-muted);
  color: var(--ui-text-secondary);
  font-size: 12px;
  font-weight: 600;
  transition: background-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease),
    color var(--ui-motion-hover, 120ms) var(--ui-ease, ease);
}

.today-action-item.is-first .today-action-order,
.today-action-item.is-selected .today-action-order {
  background: var(--ui-brand);
  color: #fff;
}

.today-action-select {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 44px;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-align: left;
}

.today-action-select strong,
.today-action-select small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-action-select strong {
  color: var(--ui-text);
  font-size: 13px;
}

.today-action-select small {
  color: var(--ui-text-secondary);
  font-size: 11px;
}

.today-action-tags,
.today-action-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

.today-action-tags span,
.today-action-detail-tags span {
  border-radius: 999px;
  background: var(--ui-warning-soft);
  color: var(--ui-warning);
  padding: 2px 6px;
  font-size: 11px;
}

.today-action-item time {
  color: var(--ui-text-secondary);
  font-size: 11px;
  white-space: nowrap;
}

.today-action-primary.compact {
  min-width: 112px;
  min-height: 44px;
  border: 1px solid var(--ui-brand);
  border-radius: 8px;
  background: var(--ui-brand);
  color: #fff;
  padding: 7px 10px;
  font-weight: 600;
  white-space: nowrap;
}

.today-context-panel {
  min-width: 0;
  position: sticky;
  top: 12px;
}

.today-context-head > div {
  min-width: 0;
}

.today-context-body {
  min-width: 0;
  max-height: calc(100vh - 270px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px;
}

.today-context-body .today-schedule-row {
  grid-template-columns: 48px minmax(0, 1fr) auto;
}

.today-action-detail-reason {
  margin: 12px 0 16px;
  border-left: 3px solid var(--ui-brand);
  border-radius: 0 8px 8px 0;
  background: var(--ui-brand-soft);
  padding: 10px 12px;
  color: var(--ui-text-secondary);
  font-size: 12px;
  line-height: 1.6;
}

.today-risk-callout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  margin: -4px 0 16px;
  border: 1px solid color-mix(in srgb, var(--ui-warning) 24%, transparent);
  border-radius: 8px;
  background: var(--ui-warning-soft);
  padding: 9px 10px;
  color: var(--ui-text-secondary);
  font-size: 11px;
  line-height: 1.55;
}

.today-risk-callout strong {
  color: var(--ui-warning);
  white-space: nowrap;
}

.today-action-detail dl {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 9px 12px;
  margin: 0 0 16px;
  font-size: 12px;
}

.today-action-detail dt {
  color: var(--ui-text-tertiary);
}

.today-action-detail dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ui-text);
}

.today-action-detail-actions {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--ui-line);
  padding-top: 14px;
}

.today-action-detail-link {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--ui-text-secondary);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.today-action-detail-link:hover {
  color: var(--ui-brand);
}

@media (max-width: 1179px) {
  .today-action-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .today-context-panel {
    position: static;
  }

  .today-context-body {
    max-height: none;
  }
}

@media (max-width: 900px) {
  .today-status-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .today-status-date {
    grid-column: span 2;
  }

  .today-status-actions {
    grid-column: 1 / -1;
    border-top: 1px solid var(--ui-line);
  }
}

@media (max-width: 720px) {
  .today-action-item {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .today-action-item time,
  .today-action-primary.compact {
    grid-column: 2;
    justify-self: start;
  }

  .today-action-toolbar,
  .today-action-queue-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 总览经营驾驶舱：七段数据仍由 /api/overview 统一下发，仅改变展示层。 */
.app-shell.overview-mode {
  grid-template-columns: 224px minmax(0, 1fr);
}

.app-shell.overview-mode .detail-panel { display: none; }
.app-shell.overview-mode .workspace { overflow: auto; }

.overview-page {
  min-width: 0;
  padding-bottom: 48px;
}

.overview-dashboard {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.overview-summary-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-width: 0;
  min-height: 108px;
  border: 1px solid var(--ui-line);
  border-left: 4px solid var(--ui-brand);
  border-radius: 12px;
  background: var(--ui-surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
  padding: 20px 22px;
}

.overview-summary-band.danger { border-left-color: var(--ui-danger); }
.overview-summary-band.warning { border-left-color: var(--ui-warning); }
.overview-summary-copy { min-width: 0; }
.overview-summary-copy h2,
.overview-summary-copy p { margin: 0; }
.overview-summary-copy h2 {
  color: var(--ui-text);
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.35;
  letter-spacing: -.01em;
}

.overview-summary-copy > p:last-child {
  margin-top: 5px;
  color: var(--ui-text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.overview-summary-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px !important;
  color: var(--ui-brand);
  font-size: 12px;
  font-weight: 600;
}

.overview-summary-band.danger .overview-summary-kicker { color: var(--ui-danger); }
.overview-summary-band.warning .overview-summary-kicker { color: var(--ui-warning); }
.overview-summary-kicker span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  line-height: 1;
}

.overview-summary-action {
  min-width: 108px;
  border: 1px solid var(--ui-brand);
  border-radius: 8px;
  background: var(--ui-brand);
  color: #fff;
  padding: 0 15px;
  font-size: 12px;
  font-weight: 600;
}

.overview-summary-band.danger .overview-summary-action { border-color: var(--ui-danger); background: var(--ui-danger); }
.overview-summary-band.warning .overview-summary-action { border-color: var(--ui-warning); background: var(--ui-warning); }

.overview-dashboard-section { min-width: 0; }

.overview-core-section {
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: var(--ui-surface);
}

.overview-section-message {
  margin: 0;
  border-bottom: 1px solid var(--ui-line);
  background: var(--ui-surface-muted);
  color: var(--ui-text-secondary);
  padding: 9px 16px;
  font-size: 11px;
}

.overview-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.overview-kpi {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 112px;
  border: 0;
  border-right: 1px solid var(--ui-line);
  background: transparent;
  color: inherit;
  padding: 17px 18px;
  text-align: left;
}

.overview-kpi:last-child { border-right: 0; }
.overview-kpi:hover,
.overview-kpi:focus-visible { background: var(--ui-brand-soft); }
.overview-kpi-label { color: var(--ui-text-secondary); font-size: 12px; font-weight: 600; }
.overview-kpi strong {
  overflow-wrap: anywhere;
  color: var(--ui-text);
  font-size: clamp(22px, 2.3vw, 30px);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.overview-kpi > span:last-child { color: var(--ui-text-secondary); font-size: 11px; line-height: 1.45; }

.overview-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 18px;
  min-width: 0;
  align-items: stretch;
}

.overview-structure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
  align-items: stretch;
}

.overview-panel {
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: var(--ui-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03), 0 8px 22px rgba(15, 23, 42, .04);
}

.overview-dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--ui-line);
  padding: 15px 17px 13px;
}

.overview-dashboard-head h2,
.overview-dashboard-head p { margin: 0; }
.overview-dashboard-head h2 { color: var(--ui-text); font-size: 16px; line-height: 1.4; }
.overview-dashboard-head div > p:last-child { margin-top: 3px; color: var(--ui-text-secondary); font-size: 11px; line-height: 1.5; }
.overview-panel-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
}

.overview-panel-body { min-width: 0; flex: 1; padding: 15px 17px 17px; }

.overview-forecast-body,
.overview-forecast-section { display: grid; min-width: 0; gap: 12px; }
.overview-forecast-section + .overview-forecast-section { border-top: 1px solid var(--ui-line); padding-top: 13px; }
.overview-forecast-subhead { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 12px; }
.overview-forecast-subhead h3 { margin: 0; color: var(--ui-text); font-size: 13px; line-height: 1.4; }
.overview-forecast-subhead span { color: var(--ui-text-secondary); font-size: 11px; line-height: 1.4; text-align: right; }
.overview-probability-settings-button {
  flex: 0 0 auto;
  min-height: 44px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 7px;
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.overview-probability-settings-button:hover { border-color: var(--ui-brand); background: var(--ui-brand-soft, #e7f0ff); }
.overview-probability-settings-button:focus-visible { outline: 3px solid var(--ui-focus); outline-offset: 2px; }

.project-probability-settings-dialog { width: min(600px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
.table-panel-head-actions { display: flex; align-items: center; gap: 8px; }
.partner-followup-settings-trigger {
  min-height: 28px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 7px;
  background: var(--ui-surface);
  color: var(--ui-brand);
  padding: 0 10px;
  font: 600 11px/26px inherit;
  cursor: pointer;
}
.partner-followup-settings-trigger:hover { border-color: var(--ui-brand); background: var(--ui-brand-soft); }
.partner-followup-settings-trigger:focus-visible { outline: 3px solid var(--ui-focus); outline-offset: 2px; }
.partner-followup-settings-dialog { width: min(480px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
.project-probability-settings-dialog .report-polish-dialog-head { flex: 0 0 auto; padding: 18px 20px 15px; }
.partner-followup-settings-dialog .report-polish-dialog-head { flex: 0 0 auto; align-items: center; padding: 15px 18px 13px; }
.partner-followup-settings-dialog .report-polish-dialog-title { font-size: 16px; line-height: 22px; }
.partner-followup-settings-dialog .report-polish-dialog-subtitle { margin-top: 2px; max-width: 360px; font-size: 11px; line-height: 17px; }
.partner-followup-settings-dialog .report-polish-close-btn { width: 32px; min-width: 32px; height: 32px; min-height: 32px; }
.project-probability-settings-content { display: grid; gap: 14px; padding: 18px 20px 12px; }
.partner-followup-settings-dialog .project-probability-settings-content { gap: 12px; padding: 14px 18px 10px; }
.project-probability-settings-note { margin: 0; color: var(--ui-text-secondary); font-size: 12px; line-height: 1.6; }
.partner-followup-settings-dialog .project-probability-settings-note { border-radius: 8px; background: var(--ui-surface-muted); padding: 9px 11px; font-size: 11px; line-height: 17px; }
.project-probability-settings-list { display: grid; overflow: hidden; border: 1px solid var(--ui-line); border-radius: 10px; }
.project-probability-settings-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 58px; padding: 10px 14px; background: var(--ui-surface); color: var(--ui-text); font-size: 13px; font-weight: 600; }
.partner-followup-settings-dialog .project-probability-settings-row { min-height: 54px; padding: 8px 12px; }
.project-probability-settings-row + .project-probability-settings-row { border-top: 1px solid var(--ui-line); }
.partner-followup-level-copy { display: grid; gap: 1px; min-width: 0; }
.partner-followup-level-copy strong { color: var(--ui-text); font-size: 13px; line-height: 19px; }
.partner-followup-level-copy small { color: var(--ui-text-secondary); font-size: 11px; font-weight: 500; line-height: 15px; }
.project-probability-settings-input-wrap { display: flex; align-items: center; gap: 8px; color: var(--ui-text-secondary); }
.project-probability-settings-input-wrap input { width: 92px; min-height: 36px; border: 1px solid var(--ui-line-strong); border-radius: 8px; background: var(--ui-surface); color: var(--ui-text); padding: 6px 10px; font: 600 14px/1.4 inherit; text-align: right; }
.partner-followup-settings-dialog .project-probability-settings-input-wrap input { width: 76px; min-height: 34px; appearance: textfield; -moz-appearance: textfield; }
.partner-followup-settings-dialog .project-probability-settings-input-wrap input::-webkit-inner-spin-button,
.partner-followup-settings-dialog .project-probability-settings-input-wrap input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.project-probability-settings-input-wrap input:focus { border-color: var(--ui-brand); outline: 3px solid var(--ui-focus); }
.project-probability-settings-input-wrap input:disabled { border-color: var(--ui-line); background: var(--ui-surface-muted); color: var(--ui-text-secondary); opacity: 1; }
.project-probability-settings-input-wrap em { min-width: 12px; font-style: normal; font-size: 12px; }
.project-probability-settings-status { min-height: 20px; margin: 0; color: var(--ui-text-secondary); font-size: 12px; line-height: 20px; }
.project-probability-settings-status.is-error,
.project-probability-settings-load-error { color: var(--danger); }
.project-probability-settings-actions { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--ui-line); padding: 14px 20px 18px; }
.partner-followup-settings-dialog .project-probability-settings-actions { padding: 12px 18px 14px; }
.project-probability-settings-loading,
.project-probability-settings-load-error { padding: 36px 20px; font-size: 13px; text-align: center; }

@media (max-width: 620px) {
  .project-probability-settings-row { gap: 12px; }
  .project-probability-settings-actions { flex-direction: column-reverse; }
  .project-probability-settings-actions .primary-button,
  .project-probability-settings-actions .ghost-button { width: 100%; }
}

.overview-trend-chart {
  display: grid;
  grid-auto-columns: minmax(76px, 1fr);
  grid-auto-flow: column;
  gap: 10px;
  min-height: 202px;
  overflow-x: auto;
  padding: 2px 2px 0;
}

.overview-trend-item {
  display: grid;
  grid-template-rows: 28px minmax(92px, 1fr) auto;
  gap: 7px;
  min-width: 76px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  padding: 5px 5px 7px;
  text-align: center;
}

.overview-trend-item:hover,
.overview-trend-item:focus-visible { background: var(--ui-brand-soft); }
.overview-trend-value { align-self: end; overflow-wrap: anywhere; color: var(--ui-text); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.overview-trend-column-wrap { display: flex; height: 118px; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--ui-line-strong); }
.overview-trend-column-wrap i { display: block; width: min(46px, 68%); min-height: 6px; border-radius: 5px 5px 2px 2px; background: var(--ui-brand); }
.overview-trend-label strong,
.overview-trend-label small { display: block; }
.overview-trend-label strong { color: var(--ui-text); font-size: 11px; }
.overview-trend-label small { margin-top: 2px; color: var(--ui-text-secondary); font-size: 11px; line-height: 1.4; }

.overview-weighted-forecast { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.overview-weighted-item {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 72px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-surface-muted);
  color: inherit;
  padding: 9px 10px;
  text-align: left;
}
.overview-weighted-item:hover,
.overview-weighted-item:focus-visible { border-color: var(--ui-brand); background: var(--ui-brand-soft); }
.overview-weighted-item span,
.overview-weighted-item small { color: var(--ui-text-secondary); font-size: 11px; line-height: 1.35; }
.overview-weighted-item strong { overflow-wrap: anywhere; color: var(--ui-text); font-size: 13px; font-variant-numeric: tabular-nums; }

.overview-ranking-list { display: grid; gap: 10px; min-width: 0; }

.overview-stage-matrix { display: grid; gap: 8px; min-width: 0; }
.overview-stage-matrix-head,
.overview-stage-matrix-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1.05fr) minmax(44px, .6fr) minmax(60px, .85fr) minmax(88px, 1.3fr);
  align-items: center;
  gap: 8px;
}
.overview-stage-matrix-head { padding: 0 12px 2px; color: var(--ui-text-secondary); font-size: 11px; font-weight: 600; }
.overview-stage-matrix-row { width: 100%; min-height: 64px; clip-path: none; padding: 10px 12px; }
.overview-stage-index { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--ui-line-strong); border-radius: 50%; font-size: 11px; font-weight: 600; }
.overview-stage-name { min-width: 0; }
.overview-stage-name strong { display: block; overflow-wrap: anywhere; color: var(--ui-text); font-size: 12px; line-height: 1.45; white-space: normal; }
.overview-stage-project-count,
.overview-stage-amount { color: var(--ui-text); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.overview-stage-share { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; }
.overview-stage-share-track { display: block; height: 6px; overflow: hidden; border-radius: 999px; background: var(--ui-line); }
.overview-stage-share-track i { display: block; width: var(--overview-stage-share); height: 100%; border-radius: inherit; background: var(--ui-brand); }
.overview-stage-share em { color: var(--ui-text-secondary); font-size: 11px; font-style: normal; font-variant-numeric: tabular-nums; }
.overview-stage-signals { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.overview-stage-matrix-row.is-empty { border-style: dashed; background: color-mix(in srgb, var(--ui-surface-muted) 54%, var(--ui-surface)); }
.overview-stage-matrix-row.is-empty :is(.overview-stage-name strong, .overview-stage-project-count, .overview-stage-amount) { color: var(--ui-text-secondary); }
html[data-ui-style] body:not(.login-active) .overview-stage-matrix-row.is-empty {
  outline: 1px dashed var(--ui-line-strong);
  outline-offset: -1px;
  filter: saturate(.72);
}

.overview-stage,
.overview-ranking-item,
.overview-partner-item {
  min-width: 0;
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  background: var(--ui-surface-muted);
  color: inherit;
  padding: 11px 12px;
  text-align: left;
}

.overview-stage,
.overview-ranking-item { display: grid; gap: 8px; }
.overview-stage:hover,
.overview-stage:focus-visible,
.overview-ranking-item:hover,
.overview-ranking-item:focus-visible { border-color: var(--ui-brand); background: var(--ui-brand-soft); }
.overview-ranking-track { display: block; height: 5px; overflow: hidden; border-radius: 999px; background: var(--ui-line); }
.overview-ranking-track i { display: block; height: 100%; border-radius: inherit; background: var(--ui-brand); }

@media (max-width: 1100px) {
  .overview-stage-matrix-head { display: none; }
  .overview-stage-matrix-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px 10px;
  }
  .overview-stage-index { grid-column: 1; grid-row: 1 / 3; }
  .overview-stage-name { grid-column: 2; grid-row: 1; }
  .overview-stage-project-count { grid-column: 2; grid-row: 2; }
  .overview-stage-amount { grid-column: 3; grid-row: 1; }
  .overview-stage-outlook { grid-column: 3; grid-row: 2; min-width: 0; }
  .overview-stage-share { display: flex; min-width: 0; flex-wrap: wrap; gap: 5px; }
  .overview-stage-share-track { min-width: 48px; flex: 1; }
  .overview-stage-project-count::before,
  .overview-stage-amount::before,
  .overview-stage-share::before { content: attr(data-label) " "; color: var(--ui-text-secondary); font-size: 11px; font-weight: 500; }
}

.overview-ranking-meta { min-width: 0; }
.overview-ranking-meta strong,
.overview-ranking-meta small { display: block; }
.overview-ranking-meta strong { overflow: hidden; color: var(--ui-text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.overview-ranking-meta small { margin-top: 3px; color: var(--ui-text-secondary); font-size: 11px; line-height: 1.5; }

.overview-partner-item { display: grid; gap: 9px; }
.overview-partner-health { display: flex; flex-wrap: wrap; gap: 6px; }
.overview-partner-health span { border-radius: 999px; background: var(--ui-success-soft); color: var(--ui-success); padding: 3px 7px; font-size: 11px; font-weight: 600; }
.overview-partner-health span.warning { background: var(--ui-warning-soft); color: var(--ui-warning); }
.overview-partner-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.overview-partner-actions button {
  min-height: 44px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  background: var(--ui-surface);
  color: var(--ui-brand);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
}
.overview-partner-actions button:hover,
.overview-partner-actions button:focus-visible { border-color: var(--ui-brand); background: var(--ui-brand-soft); }

.overview-risk-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.overview-risk-group {
  min-width: 0;
}

.overview-risk-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--ui-line);
  padding-bottom: 8px;
}

.overview-risk-group-head h3 {
  margin: 0;
  color: var(--ui-text);
  font-size: 13px;
  font-weight: 600;
}

.overview-risk-group-head span {
  min-width: 24px;
  border-radius: 999px;
  background: var(--ui-surface-muted);
  color: var(--ui-text-secondary);
  padding: 2px 7px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.overview-risk-group-empty {
  min-height: 60px;
  margin: 0;
  padding: 16px 4px;
  color: var(--ui-text-secondary);
  font-size: 12px;
  text-align: center;
}

.overview-risk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.overview-risk-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  background: var(--ui-surface-muted);
  color: inherit;
  padding: 10px 11px;
  text-align: left;
}

.overview-risk-item.danger { border-color: rgba(194, 65, 58, .28); background: var(--ui-danger-soft); }
.overview-risk-item.warning { border-color: rgba(154, 75, 0, .25); background: var(--ui-warning-soft); }
.overview-risk-item:hover,
.overview-risk-item:focus-visible { border-color: var(--ui-brand); box-shadow: 0 6px 16px rgba(15, 23, 42, .07); }
.overview-risk-mark { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--ui-surface); color: var(--ui-text-secondary); font-size: 12px; font-weight: 600; }
.overview-risk-item.danger .overview-risk-mark { color: var(--ui-danger); }
.overview-risk-item.warning .overview-risk-mark { color: var(--ui-warning); }
.overview-risk-copy,
.overview-risk-value { min-width: 0; }
.overview-risk-copy strong,
.overview-risk-copy small,
.overview-risk-value strong,
.overview-risk-value small { display: block; }
.overview-risk-copy strong { color: var(--ui-text); font-size: 12px; line-height: 1.4; }
.overview-risk-copy small { margin-top: 2px; color: var(--ui-text-secondary); font-size: 11px; }
.overview-risk-value { text-align: right; }
.overview-risk-value strong { color: var(--ui-text); font-size: 17px; font-variant-numeric: tabular-nums; }
.overview-risk-value small { color: var(--ui-text-secondary); font-size: 11px; }

.overview-drill-target {
  min-height: 44px;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.overview-load-state,
.overview-refresh-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  border: 1px solid var(--ui-line);
  border-left: 4px solid var(--ui-brand);
  border-radius: 10px;
  background: var(--ui-surface);
  padding: 12px 14px;
}

.overview-load-state { min-height: 120px; flex-direction: column; justify-content: center; text-align: center; }
.overview-load-state strong,
.overview-load-state span { display: block; }
.overview-load-state span,
.overview-refresh-notice { color: var(--ui-text-secondary); font-size: 12px; }
.overview-load-state.is-error,
.overview-refresh-notice.is-error { border-left-color: var(--ui-danger); background: var(--ui-danger-soft); }

.overview-dashboard .overview-empty { min-height: 116px; border: 1px dashed var(--ui-line-strong); border-radius: 9px; background: var(--ui-surface-muted); padding: 18px; text-align: center; }
.overview-dashboard .overview-empty strong,
.overview-dashboard .overview-empty span { display: block; }
.overview-dashboard .overview-empty strong { color: var(--ui-text); }
.overview-dashboard .overview-empty span { margin-top: 4px; color: var(--ui-text-secondary); font-size: 11px; }

@media (max-width: 1359px) {
  .app-shell.overview-mode { grid-template-columns: minmax(0, 1fr); }
  .overview-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-kpi:nth-child(2) { border-right: 0; }
  .overview-kpi:nth-child(-n + 2) { border-bottom: 1px solid var(--ui-line); }
  .overview-structure-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-structure-grid > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 1200px) {
  .overview-page { padding-inline: 14px; }
  .overview-analysis-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}

@media (max-width: 960px) {
  .overview-page { padding-inline: 10px; }
  .overview-analysis-grid,
  .overview-structure-grid,
  .overview-risk-groups { grid-template-columns: minmax(0, 1fr); }
  .overview-structure-grid > :last-child { grid-column: auto; }
  .overview-summary-band { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .overview-summary-action { justify-self: start; }
  .overview-trend-chart { min-height: 230px; }
}

@media (max-width: 640px) {
  .overview-kpi-strip { grid-template-columns: minmax(0, 1fr); }
  .overview-kpi { border-right: 0; border-bottom: 1px solid var(--ui-line); }
  .overview-kpi:last-child { border-bottom: 0; }
  .overview-partner-actions { grid-template-columns: minmax(0, 1fr); }
  .overview-risk-item { grid-template-columns: 30px minmax(0, 1fr); }
  .overview-risk-value { grid-column: 2; text-align: left; }
}

/* 网页数据保护 */
.app-shell.data-center-mode {
  grid-template-columns: 232px minmax(0, 1fr);
}

.app-shell.data-center-mode .detail-panel {
  display: none;
}

.app-shell.data-center-mode .workspace {
  overflow: auto;
}

.data-center-page {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding-bottom: 48px;
}

.data-protection-summary {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) repeat(2, minmax(180px, 0.8fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: #dbe5ff;
  box-shadow: var(--shadow-sm);
}

.data-protection-summary-copy,
.data-protection-metric {
  min-width: 0;
  padding: 20px;
  background: var(--ui-surface);
}

.data-protection-summary-copy strong,
.data-protection-metric strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.data-protection-summary-copy strong { font-size: 20px; }
.data-protection-summary-copy p,
.data-protection-panel-heading p { margin: 7px 0 0; color: var(--muted); line-height: 1.6; }
.data-protection-metric strong { font-size: 16px; }
.data-protection-metric span,
.data-protection-metric small,
.data-protection-eyebrow { color: var(--muted); font-size: 12px; }
.data-protection-metric small { display: block; margin-top: 7px; line-height: 1.5; }
.data-protection-eyebrow { color: var(--brand); font-weight: 600; letter-spacing: 0.08em; }

.data-protection-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.data-protection-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.data-protection-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}

.data-protection-panel-heading h2 { margin: 5px 0 0; }
.data-protection-panel-heading p { max-width: 390px; text-align: right; }
.data-protection-record { background: var(--panel-subtle); }
.data-protection-status { flex: none; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.data-protection-status.is-success { background: var(--ok-bg); color: var(--ok); }
.data-protection-status.is-warning { background: var(--danger-bg); color: var(--danger); }
.data-protection-status.is-neutral { background: var(--panel-subtle); color: var(--muted); }

.data-center-filter,
.data-center-restore-dialog {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.data-center-meta { display: block; color: var(--muted); font-size: 12px; }
.data-center-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.data-center-page button { min-height: 44px; }
.data-center-form-field { display: grid; gap: 6px; min-width: 160px; color: var(--muted); font-size: 12px; }
.data-center-form-field input,
.data-center-form-field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0 10px;
}

.data-center-list { display: grid; gap: 10px; margin-top: 14px; }
.data-center-row { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.data-center-row-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.data-center-row pre { max-height: 180px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel-subtle); padding: 10px; border-radius: 8px; }
.data-center-error { padding: 12px; border: 1px solid #fecaca; border-radius: 8px; background: #fff1f2; color: #b42318; overflow-wrap: anywhere; }
.data-center-notice { padding: 12px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
.data-center-muted { color: var(--muted); }
.data-center-filter { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px; padding: 14px; }

.data-center-restore-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--ui-overlay);
}

.data-center-restore-dialog {
  display: flex;
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 32px));
  overflow: hidden;
  flex-direction: column;
  padding: 0;
}

.data-center-restore-header {
  display: flex;
  flex: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--ui-line, var(--line));
}
.data-center-restore-header h2 { margin: var(--space-1, 4px) 0 0; font-size: 22px; line-height: 1.35; letter-spacing: -.02em; }
.data-center-restore-header p { max-width: 480px; margin: var(--space-2, 8px) 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.data-center-restore-eyebrow { color: var(--brand); font-size: 12px; font-weight: 600; letter-spacing: .08em; }
.data-center-restore-close { flex: none; width: 44px; height: 44px; }

.data-center-restore-body { min-height: 0; overflow: auto; padding: 20px 24px 24px; }
.data-center-restore-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--ui-line, var(--line));
  border-radius: 10px;
  background: var(--ui-surface-soft, var(--panel-subtle));
}
.data-center-restore-summary > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.data-center-restore-summary > div + div { border-left: 1px solid var(--ui-line, var(--line)); }
.data-center-restore-summary span { color: var(--muted); font-size: 12px; font-weight: 600; }
.data-center-restore-summary strong { color: var(--text); font-size: 18px; font-variant-numeric: tabular-nums; }
.data-center-restore-summary .is-restore strong { color: var(--brand); }

.data-center-restore-content { margin-top: 20px; }
.data-center-restore-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.data-center-restore-section-head h3 { margin: 0; font-size: 14px; }
.data-center-restore-section-head span { color: var(--muted); font-size: 12px; }
.data-center-diff-list { display: grid; max-height: 260px; gap: 8px; overflow: auto; margin: 10px 0 0; }
.data-center-diff { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--ui-line, var(--line)); border-radius: 9px; background: var(--ui-surface, var(--panel)); }
.data-center-diff-copy { display: grid; gap: 3px; min-width: 0; }
.data-center-diff-copy strong { color: var(--text); font-size: 14px; }
.data-center-diff-copy span { color: var(--muted); font-size: 12px; }
.data-center-diff-action { padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.data-center-diff.is-restore .data-center-diff-action { background: var(--brand-soft); color: var(--brand); }
.data-center-diff.is-keep .data-center-diff-action { background: var(--ui-surface-soft, var(--panel-subtle)); color: var(--muted); }

.data-center-restore-confirmation {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding: 16px;
  border-radius: 10px;
  background: var(--brand-soft);
}
.data-center-restore-confirmation h3 { margin: 0; color: var(--text); font-size: 14px; }
.data-center-restore-confirmation p { margin: var(--space-1, 4px) 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.data-center-restore-field { display: grid; width: min(220px, 100%); flex: none; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.data-center-restore-field input { width: 100%; min-height: 44px; border: 1px solid var(--ui-line-strong, var(--line)); border-radius: 9px; background: var(--ui-surface, var(--panel)); padding: 0 11px; color: var(--text); }
.data-center-restore-field input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; box-shadow: var(--focus-ring); }
.data-center-restore-empty,
.data-center-restore-stale { display: grid; gap: 4px; margin-top: 16px; padding: 14px 16px; border-radius: 9px; }
.data-center-restore-empty { background: var(--ui-surface-soft, var(--panel-subtle)); }
.data-center-restore-stale { border: 1px solid var(--danger); background: var(--danger-bg); color: var(--danger); }
.data-center-restore-empty strong,
.data-center-restore-stale strong { font-size: 13px; }
.data-center-restore-empty span,
.data-center-restore-stale span { color: var(--muted); font-size: 12px; }

.data-center-restore-footer { display: flex; flex: none; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--ui-line, var(--line)); background: var(--ui-surface, var(--panel)); }
.data-center-restore-footer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

@media (max-width: 1199px) {
  .app-shell.data-center-mode { grid-template-columns: minmax(0, 1fr); }
  .data-center-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1200px) and (max-width: 1359px) {
  .app-shell.data-center-mode { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1050px) {
  .data-protection-summary,
  .data-protection-layout { grid-template-columns: minmax(0, 1fr); }
  .data-protection-panel-heading { display: block; }
  .data-protection-panel-heading p { max-width: none; text-align: left; }
  .data-center-filter { grid-template-columns: minmax(0, 1fr); }
  .data-center-diff { grid-template-columns: minmax(0, 1fr); }
}

/* 数据保护确认版视觉覆盖 */
.app-shell.data-center-mode .workspace-head {
  min-height: 0;
  align-items: end;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 18px 0 8px;
  animation: none;
}

.app-shell.data-center-mode ~ .site-icp-footer {
  display: none;
}

.app-shell.data-center-mode .workspace-head h1 {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.app-shell.data-center-mode .workspace-head p {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.app-shell.data-center-mode .head-actions { align-self: center; }
#manual-backup-button { min-height: 44px; padding-inline: 18px; white-space: nowrap; }

@media (min-width: 1200px) {
  .app-shell.data-center-mode .workspace-head { margin-top: 64px; }
}

.data-protection-summary {
  grid-template-columns: minmax(300px, 1.35fr) minmax(0, 2fr);
  gap: 0;
  border-color: var(--ui-line, var(--line));
  background: var(--ui-surface, var(--panel));
  box-shadow: var(--ui-shadow-card, var(--shadow-sm));
}

.data-protection-status-primary {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 144px;
  padding: 24px;
  border-right: 1px solid var(--ui-line, var(--line));
}

.data-protection-summary.is-alert .data-protection-status-primary { background: var(--danger-bg, #fff1f0); }
.data-protection-summary.is-healthy .data-protection-status-primary { background: var(--ok-bg, #ecfdf3); }
.data-protection-summary.is-neutral .data-protection-status-primary { background: var(--ui-surface-soft, var(--panel-subtle)); }

.data-protection-status-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--ui-surface, #fff);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--ui-line, var(--line));
}

.data-protection-summary.is-alert .data-protection-status-icon { background: #ffe0dc; color: var(--danger); box-shadow: none; }
.data-protection-summary.is-healthy .data-protection-status-icon { background: #d1fadf; color: var(--ok); box-shadow: none; }
.data-protection-status-icon svg { width: 22px; height: 22px; }

.data-protection-status-primary strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.data-protection-summary.is-alert .data-protection-status-primary strong { color: var(--danger); }
.data-protection-summary.is-healthy .data-protection-status-primary strong { color: var(--ok); }
.data-protection-status-primary p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.data-protection-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.data-protection-metric {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 22px;
  border-right: 1px solid var(--ui-line, var(--line));
  background: var(--ui-surface, var(--panel));
}
.data-protection-metric:last-child { border-right: 0; }
.data-protection-metric span,
.data-protection-metric small,
.data-protection-eyebrow { color: var(--muted); font-size: 12px; }
.data-protection-metric span { font-weight: 600; }
.data-protection-metric strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.data-protection-metric small { display: block; margin-top: 5px; line-height: 1.5; }
.data-protection-eyebrow { color: var(--brand); font-weight: 600; letter-spacing: .08em; }

.data-protection-layout {
  grid-template-columns: minmax(0, 7fr) minmax(320px, 5fr);
  gap: 18px;
}

.data-protection-panel {
  overflow: hidden;
  padding: 0;
  border-color: var(--ui-line, var(--line));
  background: var(--ui-surface, var(--panel));
  box-shadow: var(--ui-shadow-card, var(--shadow-sm));
}

.data-protection-panel-heading {
  display: flex;
  align-items: start;
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--ui-line, var(--line));
}
.data-protection-panel-heading h2 { margin: 5px 0 0; font-size: 20px; letter-spacing: -0.02em; }
.data-protection-panel-heading p { max-width: none; margin: 5px 0 0; text-align: left; font-size: 13px; line-height: 1.5; }
.data-protection-readonly-badge {
  flex: none;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--ui-surface-soft, var(--panel-subtle));
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.data-center-filter {
  grid-template-columns: minmax(0, .75fr) minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  padding: 16px 24px;
  border: 0;
  border-bottom: 1px solid var(--ui-line, var(--line));
  border-radius: 0;
  background: var(--ui-surface-soft, var(--panel-subtle));
  box-shadow: none;
}
.data-center-filter .data-center-form-field { min-width: 0; color: var(--muted); font-weight: 600; }
.data-center-filter .primary-button { align-self: end; min-width: 88px; padding-inline: 18px; }
.data-center-form-field input,
.data-center-form-field select { border-color: var(--ui-line-strong, var(--line)); border-radius: 9px; background: var(--ui-surface, var(--panel)); }

.data-protection-trash-list { padding: 0 24px; }
.data-protection-trash-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px 0;
  border: 0;
  border-bottom: 1px solid var(--ui-line, var(--line));
  border-radius: 0;
}
.data-protection-trash-row:last-child { border-bottom: 0; }
.data-protection-trash-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.data-protection-trash-title strong { font-size: 15px; }
.data-protection-trash-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.data-protection-trash-row p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

.data-protection-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.data-protection-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.data-protection-status.is-success { background: var(--ok-bg); color: var(--ok); }
.data-protection-status.is-warning { background: var(--danger-bg); color: var(--danger); }
.data-protection-status.is-neutral { background: var(--ui-surface-soft, var(--panel-subtle)); color: var(--muted); }

.data-protection-empty {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 36px 20px;
  text-align: center;
}
.data-protection-empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
}
.data-protection-empty-icon svg { width: 24px; height: 24px; }
.data-protection-empty strong { margin-top: 14px; }
.data-protection-empty p { max-width: 320px; margin: 6px 0 16px; color: var(--muted); font-size: 13px; }

.data-protection-timeline { padding: 8px 24px 10px; }
.data-protection-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 0;
  color: var(--muted);
}
.data-protection-timeline-item:not(:last-child)::after { content: ""; position: absolute; top: 33px; bottom: -4px; left: 7px; width: 1px; background: var(--ui-line, var(--line)); }
.data-protection-timeline-dot { position: relative; z-index: 1; width: 15px; height: 15px; margin-top: 3px; border: 4px solid var(--ui-surface, var(--panel)); border-radius: 50%; color: inherit; box-shadow: 0 0 0 1px currentColor; }
.data-protection-timeline-item.is-success { color: var(--ok); }
.data-protection-timeline-item.is-warning { color: var(--danger); }
.data-protection-timeline-item.is-neutral { color: var(--muted); }
.data-protection-timeline-head { display: flex; justify-content: space-between; gap: 12px; color: var(--text); }
.data-protection-timeline-head strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.data-protection-timeline-label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.data-protection-backup-type {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--ui-surface-soft, var(--panel-subtle));
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.data-protection-backup-type.is-manual { background: var(--brand-soft); color: var(--brand); }
.data-protection-timeline-item p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.data-protection-readonly-note { margin: 0 24px 22px; padding: 12px; border-radius: 9px; background: var(--ui-surface-soft, var(--panel-subtle)); color: var(--muted); font-size: 12px; }

.data-protection-legal {
  justify-self: center;
  padding: 2px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.data-protection-legal a { color: inherit; text-decoration: none; }
.data-protection-legal a:hover,
.data-protection-legal a:focus-visible { color: var(--brand); text-decoration: underline; }

.data-center-error { border-color: #fecaca; background: var(--danger-bg, #fff1f2); color: var(--danger); }
.data-center-restore-dialog { border-color: var(--ui-line, var(--line)); border-radius: 16px; background: var(--ui-surface-raised, var(--panel)); box-shadow: var(--ui-shadow-panel, 0 24px 70px rgba(15, 23, 42, .24)); }
.data-center-restore-dialog .data-center-diff { grid-template-columns: minmax(0, 1fr) auto; }

@media (max-width: 1199px) {
  .data-center-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-center-filter .primary-button { justify-self: start; }
}

@media (max-width: 767px) {
  .app-shell.data-center-mode .workspace-head { align-items: flex-start; padding-inline: 0; }
  .app-shell.data-center-mode .head-actions { width: auto; }
  .app-shell.data-center-mode .workspace-head h1 { font-size: 26px; }
  .data-protection-summary,
  .data-protection-layout { grid-template-columns: minmax(0, 1fr); }
  .data-protection-status-primary { min-height: 0; padding: 20px; border-right: 0; border-bottom: 1px solid var(--ui-line, var(--line)); }
  .data-protection-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .data-protection-metric { padding: 16px 12px; }
  .data-protection-metric strong { font-size: 15px; }
  .data-protection-panel-heading { display: flex; padding: 20px; }
  .data-center-filter { padding: 14px 20px; }
  .data-protection-trash-list,
  .data-protection-timeline { padding-inline: 20px; }
  .data-protection-readonly-note { margin-inline: 20px; }
  .data-center-diff,
  .data-center-restore-dialog .data-center-diff { grid-template-columns: minmax(0, 1fr); }
  .data-center-restore-layer { align-items: end; padding: 10px; }
  .data-center-restore-dialog { width: 100%; max-height: calc(100vh - 20px); }
  .data-center-restore-header { padding: 20px; }
  .data-center-restore-header h2 { font-size: 20px; }
  .data-center-restore-body { padding: 18px 20px 20px; }
  .data-center-restore-confirmation { align-items: stretch; flex-direction: column; gap: 14px; }
  .data-center-restore-field { width: 100%; }
  .data-center-restore-footer { padding: 14px 20px; }
}

@media (max-width: 479px) {
  .data-protection-status-primary { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
  .data-protection-status-icon { width: 40px; height: 40px; }
  .data-protection-metrics { grid-template-columns: minmax(0, 1fr); }
  .data-protection-metric { padding: 14px 18px; border-right: 0; border-bottom: 1px solid var(--ui-line, var(--line)); }
  .data-protection-metric:last-child { border-bottom: 0; }
  .data-protection-metric strong { margin-top: 4px; }
  .data-center-filter { grid-template-columns: minmax(0, 1fr); }
  .data-center-filter .primary-button { width: 100%; }
  .data-protection-trash-row { grid-template-columns: minmax(0, 1fr); }
  .data-protection-trash-row .primary-button { width: 100%; }
  .data-center-restore-summary { grid-template-columns: minmax(0, 1fr); }
  .data-center-restore-summary > div + div { border-top: 1px solid var(--ui-line, var(--line)); border-left: 0; }
  .data-center-restore-footer-actions { width: 100%; }
  .data-center-restore-footer-actions > button { flex: 1 1 auto; }
}

/* Desktop compact UI v1: approved full-page prototype translated to the production shell. */
:root {
  --desktop-sidebar-width: 196px;
  --desktop-topbar-height: 56px;
  --desktop-content-gap: 10px;
}

.app-shell,
.app-shell.today-mode,
.app-shell.overview-mode,
.app-shell.report-mode,
.app-shell.data-center-mode {
  grid-template-columns: var(--desktop-sidebar-width) minmax(0, 1fr);
}

.sidebar {
  gap: 0;
  padding: 0;
  border-right: 1px solid var(--ui-line);
  background: var(--ui-surface);
}

.brand {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: 19px 17px;
  column-gap: 9px;
  align-content: center;
  height: var(--desktop-topbar-height);
  min-height: var(--desktop-topbar-height);
  border: 0;
  border-bottom: 1px solid var(--ui-line);
  border-radius: 0;
  background: var(--ui-surface);
  box-shadow: none;
  padding: 0 13px;
}

.brand::before {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 15px;
}

.brand-title { font-size: 15px; line-height: 19px; }
.brand-subtitle { font-size: 12px; line-height: 17px; }

.sidebar-scroll {
  padding: 8px;
}

.sidebar-nav { gap: 7px; }
.sidebar-nav-group { gap: 1px; }
.sidebar-nav-group h2 {
  margin: 7px 8px 3px;
  color: var(--ui-text-tertiary);
  font-size: 12px;
  line-height: 18px;
  letter-spacing: .06em;
}
.sidebar-nav-group h2::after { display: none; }
.sidebar-nav .nav-item {
  justify-content: flex-start;
  gap: 9px;
  min-height: 33px;
  border-radius: 7px;
  padding: 0 9px;
  font-size: 15px;
  line-height: 20px;
}
.sidebar-nav .nav-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: currentColor;
}
.sidebar-nav .nav-label-text {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-weight: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-nav .nav-item.active,
.sidebar-nav .nav-item.active:hover {
  border-radius: 8px;
  background: #eef4fb;
  color: #0b5cad;
  font-weight: 600;
  box-shadow: none;
}
.sidebar-nav .nav-item.active .nav-icon { color: currentColor; }
.sidebar-nav .nav-item .nav-count {
  min-width: 16px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--ui-surface-muted);
  color: var(--ui-text-tertiary);
  padding-inline: 4px;
  font-size: 12px;
  text-align: right;
}
.sidebar-nav .nav-item.active .nav-count { color: var(--ui-brand); }
.sidebar-nav .nav-item .nav-count-zero { opacity: 1; }

.sidebar .metric-card { display: none; }
.sidebar-footer {
  gap: 5px;
  border-top: 1px solid var(--ui-line);
  padding: 8px 10px 9px;
}
.sidebar-footer .status-card,
.sidebar-footer .model-card {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}
.sidebar-footer .status-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 1px;
}
.sidebar-footer .status-label,
.sidebar-footer .status-meta,
.sidebar-footer .model-card .status-label,
.sidebar-footer .model-card .status-meta { display: none; }
.sidebar-footer .status-text,
.sidebar-footer .model-card .status-text {
  min-width: 0;
  overflow: hidden;
  color: var(--ui-text-secondary);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-footer .status-sync {
  min-width: 0;
  overflow: hidden;
  margin: 0 0 0 12px;
  color: var(--ui-text-tertiary);
  font-size: 11px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-footer .status-card.healthy .status-text::before,
.sidebar-footer .model-card.healthy .status-text::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ui-success);
  vertical-align: 1px;
}
.sidebar-footer .model-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--ui-line);
  padding-top: 5px;
}
.sidebar-footer .model-card > div {
  min-width: 0;
}
.sidebar-footer .model-config-button {
  flex: 0 0 auto;
  min-height: 26px;
  border: 0;
  background: transparent;
  color: var(--ui-brand);
  padding: 0 4px;
  font-size: 12px;
}

.workspace {
  gap: var(--desktop-content-gap);
  padding: calc(var(--desktop-topbar-height) + 13px) 16px 22px;
}

.desktop-topbar {
  min-height: var(--desktop-topbar-height);
  height: var(--desktop-topbar-height);
  padding: 8px 16px;
}
.global-search-button {
  width: min(280px, 34vw);
  min-height: 34px;
  border-radius: 8px;
  background: var(--ui-surface);
  font-size: 12px;
}
.account-button { min-height: 34px; }
.account-menu { top: 46px; right: 16px; }

.workspace-head,
.app-shell.data-center-mode .workspace-head {
  flex: 0 0 auto;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 0 1px;
}
.app-shell.data-center-mode .workspace-head { margin-top: 0; }
.workspace-head h1,
.app-shell.data-center-mode .workspace-head h1 {
  font-size: 21px;
  line-height: 28px;
  letter-spacing: -.02em;
}
.workspace-head p,
.app-shell.data-center-mode .workspace-head p {
  max-width: 780px;
  margin-top: 1px;
  font-size: 11px;
  line-height: 17px;
}
.head-actions { gap: 7px; }
.head-actions .primary-button,
.head-actions .ghost-button,
#manual-backup-button {
  min-height: 34px;
  padding-inline: 12px;
}
.period-switch { min-height: 34px; }
.period-button { min-height: 29px; }

.toolbar {
  border-radius: 9px;
  padding: 8px 9px;
}
.filter-row,
.filter-row.project-filter-row {
  display: flex;
  grid-template-columns: none;
  flex-wrap: wrap;
  gap: 7px;
  align-items: end;
}
.filter-control {
  min-width: 118px;
  flex: 1 1 132px;
}
.filter-control span { margin-bottom: 3px; font-size: 13px; line-height: 18px; }
.filter-control select,
.filter-sort-button {
  min-height: 34px;
  height: 34px;
  font-size: 13px;
}
.database-table-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 260px;
  width: min(100%, 260px);
  min-width: 0;
  min-height: 34px;
  height: auto;
}
.database-table-control span {
  flex: 0 0 auto;
  margin: 0;
  line-height: 34px;
  white-space: nowrap;
}
.database-table-control select {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.table-panel {
  align-self: start;
  width: 100%;
  border-top: 1px solid var(--ui-line);
  border-radius: 9px;
}
.table-panel-head {
  min-height: 43px;
  align-items: center;
  padding: 7px 11px;
}
.panel-title { font-size: 14px; line-height: 20px; }
.panel-subtitle { margin-top: 0; font-size: 11px; line-height: 16px; }
.panel-summary {
  border-radius: 999px;
  background: var(--ui-surface-muted);
  color: var(--ui-text-secondary);
  padding: 2px 8px;
  font-size: 11px;
}
.table-wrap {
  max-height: calc(100dvh - 220px);
  overflow: auto;
}
.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 19px;
  white-space: nowrap;
}
.data-table td {
  padding: 8px 10px;
  font-size: 13px;
  line-height: 19px;
}
.data-table tbody td {
  transition: background-color var(--ui-motion-hover) var(--ui-ease-state);
}
.row-title { font-size: 13px; }
.row-meta,
.cell-secondary { font-size: 11px; line-height: 16px; }
.table-row-actions { gap: 5px; }
.table-row-actions button,
.table-link,
.action-link { min-height: 29px; }

.detail-overlay {
  position: fixed;
  inset: var(--desktop-topbar-height) 0 0 var(--desktop-sidebar-width);
  z-index: 90;
  background: rgba(19, 31, 49, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ui-motion-state) var(--ui-ease);
}
.detail-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.detail-panel {
  position: fixed;
  top: var(--desktop-topbar-height);
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  width: min(440px, 94vw);
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  border: 0;
  border-left: 1px solid var(--ui-line);
  box-shadow: -18px 0 48px rgba(20, 36, 60, .16);
  transform: translateX(102%);
  visibility: hidden;
  pointer-events: none;
  transition: transform var(--ui-motion-panel) var(--ui-ease-exit), visibility 0s linear var(--ui-motion-panel);
}
.detail-scroll {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex-direction: column;
  scrollbar-gutter: stable;
}
.detail-scroll .detail-related,
.detail-scroll .detail-form { flex: 0 0 auto; }
.detail-scroll .detail-form {
  min-height: auto;
  overflow: visible;
}
.detail-panel.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition: transform var(--ui-motion-panel) var(--ui-ease-enter), visibility 0s linear 0s;
}
.detail-head { padding: 14px 16px 11px; }
.detail-title { font-size: 16px; line-height: 22px; }
.detail-subtitle { margin-top: 2px; }
.detail-form { padding: 12px 16px; }
.detail-related { padding: 10px 16px; }
.detail-actions { padding: 10px 16px; }

/* Dashboard, report and tools keep their current business sections but use the compact rhythm. */
.overview-page,
.today-page,
.report-page,
.data-center-page { gap: 10px; }
.overview-dashboard,
.today-cockpit,
.report-center { gap: 10px; }

body:not(.login-active) .app-shell.today-mode .today-page:not(.hidden),
body:not(.login-active) .app-shell.overview-mode .overview-page:not(.hidden),
body:not(.login-active) .app-shell.report-mode .report-page:not(.hidden),
body:not(.login-active) .app-shell.data-center-mode .data-center-page:not(.hidden),
body:not(.login-active) .app-shell:not(.today-mode):not(.overview-mode):not(.report-mode):not(.data-center-mode) .table-panel:not(.hidden) {
  animation: ui-view-fade-in var(--ui-motion-view) var(--ui-ease-enter) both;
}
.overview-kpi { min-height: 88px; padding: 12px 14px; }
.overview-dashboard-head { padding: 10px 12px 9px; }
.overview-panel-body { padding: 11px 12px 12px; }
.overview-analysis-grid,
.overview-structure-grid { gap: 10px; }
.overview-trend-chart { min-height: 158px; }
.overview-trend-column-wrap { height: 102px; }
.overview-summary-band { padding: 13px 15px; }

.report-grid {
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 10px;
}
.report-timeline-card { grid-column: 1 / -1; }
.report-panel-head { padding: 9px 11px; }
.report-panel-body { padding: 10px 11px; }
.report-paper { padding: 15px 17px; }
.report-current-card .report-action-stack {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 7px;
}
.report-current-card .report-action-primary-row {
  display: contents;
}
.report-current-card .report-action-secondary-row {
  display: contents;
}
.report-current-card .report-action-btn {
  min-width: 0;
  min-height: 30px;
  padding: 4px 6px;
  font-size: 11px;
}
.report-center-filter-grid { gap: 8px; }
.report-center-item {
  grid-template-columns: minmax(0, 1fr);
  padding: 10px 11px;
}

.database-readonly-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 11px;
}

.database-table { min-width: max-content; }
.database-table .db-field-name,
.db-json,
.db-field-row strong { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.data-protection-summary { margin-bottom: 0; }
.data-protection-status-primary { min-height: 102px; padding: 16px; }
.data-protection-status-primary strong { font-size: 17px; }
.data-protection-metric { padding: 14px 16px; }
.data-protection-metric strong { margin-top: 4px; font-size: 16px; }
.data-protection-layout { gap: 10px; }
.data-protection-panel-heading { padding: 13px 16px 11px; }
.data-protection-panel-heading h2 { margin-top: 2px; font-size: 16px; }
.data-protection-panel-heading p { margin-top: 2px; font-size: 11px; }
.data-center-filter { gap: 7px; padding: 10px 16px; }
.data-center-form-field { gap: 3px; font-size: 11px; }
.data-center-form-field input,
.data-center-form-field select,
.data-center-filter .primary-button { min-height: 34px; }
.data-protection-trash-list { padding: 0 16px; }
.data-protection-trash-row { padding: 13px 0; }
.data-protection-timeline { padding: 4px 16px 7px; }
.data-protection-timeline-item { padding: 10px 0; }

#login-guard { padding: 24px; }
.login-shell { width: min(820px, 100%); }
#login-guard .login-card { padding: 36px 38px; }
.login-capabilities { padding: 34px 36px; }
.login-capability-list { gap: 9px; margin-top: 22px; }
.login-capability-list li { padding: 10px 0; }

/* Login technology console: restrained enterprise data-link surface. */
#login-guard {
  padding: 24px;
  background-color: var(--login-bg);
  background-image:
    linear-gradient(var(--login-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--login-grid) 1px, transparent 1px),
    radial-gradient(circle at 14% 16%, var(--login-glow-primary), transparent 32%),
    radial-gradient(circle at 86% 82%, var(--login-glow-secondary), transparent 32%);
  background-size: 42px 42px, 42px 42px, auto, auto;
  color: var(--login-panel-text);
}

#login-guard::before {
  display: block;
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0 38%, var(--login-grid) 48%, transparent 58% 100%);
  content: "";
  pointer-events: none;
}

#login-guard::after {
  display: block;
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(89, 174, 231, 0.12);
  border-radius: 24px;
  content: "";
  pointer-events: none;
}

#login-guard .aurora-orb { filter: blur(34px); opacity: 0.72; }
#login-guard .aurora-orb-blue {
  top: -28%;
  right: -8%;
  background: radial-gradient(circle, var(--login-glow-primary) 0%, transparent 72%);
  animation: aurora-blue-drift 18s ease-in-out infinite alternate;
}
#login-guard .aurora-orb-cyan {
  left: -20%;
  bottom: -34%;
  background: radial-gradient(circle, var(--login-glow-secondary) 0%, transparent 72%);
  animation: aurora-cyan-drift 20s ease-in-out infinite alternate;
}
#login-guard .aurora-orb-violet {
  right: 26%;
  bottom: -38%;
  background: radial-gradient(circle, color-mix(in srgb, var(--login-glow-primary) 62%, transparent) 0%, transparent 74%);
  animation: aurora-violet-drift 22s ease-in-out infinite alternate;
}

#login-guard .login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.72fr);
  width: min(1160px, 100%);
  min-height: min(680px, calc(100dvh - 48px));
  overflow: hidden;
  border: 1px solid var(--login-shell-line);
  border-radius: 26px;
  background: var(--login-shell);
  box-shadow: 0 40px 100px rgba(0, 5, 15, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

#login-guard .login-capabilities {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 34px 42px 38px;
  overflow: hidden;
  color: var(--login-panel-text);
  background:
    linear-gradient(135deg, var(--login-panel-soft), transparent 44%),
    var(--login-panel);
}

#login-guard .login-capabilities::after {
  position: absolute;
  right: -120px;
  bottom: 88px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(73, 179, 240, 0.11);
  border-radius: 50%;
  box-shadow: 0 0 0 46px rgba(73, 179, 240, 0.035), 0 0 0 92px rgba(73, 179, 240, 0.02);
  content: "";
  pointer-events: none;
}

.login-tech-eyebrow,
.login-card-topline,
.login-field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.login-tech-eyebrow {
  position: relative;
  z-index: 1;
  padding-bottom: 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--login-accent) 34%, transparent);
  color: var(--login-panel-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.login-tech-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--login-accent) 42%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--login-accent) 14%, transparent);
  color: var(--login-accent);
  letter-spacing: 0.08em;
}

.login-hero-brand { position: relative; z-index: 1; }
.login-brand--hero { margin: 30px 0 24px; }
.login-brand--compact { display: none; }

#login-guard .login-icon {
  position: relative;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.35);
  border-radius: 12px;
  background: linear-gradient(145deg, var(--login-accent), var(--login-accent-hover));
  box-shadow: 0 12px 30px rgba(2, 132, 199, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: var(--login-button-text);
}

#login-guard .login-icon::after {
  position: absolute;
  right: -9px;
  bottom: -10px;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  content: "";
}

#login-guard .login-brand-title { color: var(--login-panel-text); font-size: 15px; }
#login-guard .login-brand-subtitle { color: var(--login-panel-muted); font-size: 11px; letter-spacing: 0.04em; }

#login-guard .login-capabilities-kicker {
  margin: 0 0 12px;
  color: var(--login-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

#login-guard .login-capabilities h2 {
  max-width: 610px;
  color: var(--login-panel-text);
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.035em;
}

#login-guard .login-capabilities-intro {
  max-width: 590px;
  margin-top: 16px;
  color: var(--login-panel-muted);
  font-size: 13px;
  line-height: 1.8;
}

.login-system-map {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 26px 0 0;
  padding-top: 19px;
}

.login-system-track {
  position: absolute;
  top: 6px;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--login-accent) 54%, transparent) 18% 82%, transparent);
}

.login-system-node {
  position: relative;
  min-width: 0;
  padding: 12px 12px 13px;
  border: 1px solid color-mix(in srgb, var(--login-accent) 24%, transparent);
  border-radius: 12px;
  background: var(--login-panel-soft);
}

.login-system-node::before {
  position: absolute;
  top: -17px;
  left: 50%;
  width: 7px;
  height: 7px;
  border: 2px solid var(--ui-line-strong);
  border-radius: 50%;
  background: var(--login-accent);
  box-shadow: 0 0 0 3px rgba(92, 200, 234, 0.14), 0 0 14px rgba(92, 200, 234, 0.55);
  content: "";
  transform: translateX(-50%);
}

.login-system-node.is-primary {
  border-color: color-mix(in srgb, var(--login-accent) 48%, transparent);
  background: color-mix(in srgb, var(--login-accent) 18%, var(--login-panel));
}

.login-system-index {
  float: right;
  color: rgba(117, 183, 223, 0.52);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.login-system-node small,
.login-system-node strong { display: block; min-width: 0; }
.login-system-node small { color: var(--login-panel-muted); font-size: 11px; letter-spacing: 0.08em; }
.login-system-node strong { margin-top: 7px; overflow-wrap: anywhere; color: var(--login-panel-text); font-size: 11px; font-weight: 600; }

#login-guard .login-capability-list {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 0;
}

#login-guard .login-capability-list li {
  display: block;
  min-width: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--login-accent) 20%, transparent);
  border-radius: 12px;
  background: var(--login-panel-soft);
}

#login-guard .login-capability-icon {
  display: block;
  width: auto;
  height: auto;
  margin-bottom: 8px;
  background: none;
  color: var(--login-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  text-align: left;
}

#login-guard .login-capability-list strong { color: var(--login-panel-text); font-size: 11px; }
#login-guard .login-capability-list small { margin-top: 4px; color: var(--login-panel-muted); font-size: 11px; line-height: 1.55; }

#login-guard .login-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  padding: 50px 54px;
  border: 0;
  border-left: 1px solid var(--login-line);
  border-radius: 0;
  background-color: var(--login-card);
  background-image:
    linear-gradient(color-mix(in srgb, var(--login-line) 18%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--login-line) 18%, transparent) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px;
  box-shadow: -24px 0 64px rgba(0, 8, 20, 0.2);
  color: var(--login-text);
}

.login-card-topline {
  position: absolute;
  top: 28px;
  left: 36px;
  right: 36px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--ui-line);
  color: var(--login-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.11em;
}

.login-access-state { display: inline-flex; align-items: center; gap: 7px; color: var(--login-muted); letter-spacing: 0.04em; }
.login-access-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0ea5a8;
  box-shadow: 0 0 0 4px rgba(14, 165, 168, 0.1);
}

.login-auth-code {
  margin: 0 0 13px;
  color: var(--login-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
}

#login-guard #login-title {
  margin: 0;
  color: var(--login-text);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

#login-guard .login-subtitle { margin-top: 10px; color: var(--login-muted); font-size: 13px; }
#login-guard .login-form { margin-top: 30px; }
#login-guard .login-fields { display: grid; gap: 18px; margin-top: 0; }
.login-field { display: grid; gap: 8px; }
.login-field-heading .field-label { color: var(--login-text); font-size: 12px; font-weight: 600; }
.login-field-heading span {
  color: var(--login-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.09em;
}

.login-input-frame {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--ui-line);
  border-radius: 11px;
  background: var(--login-input);
  box-shadow: inset 0 1px 2px rgba(22, 45, 68, 0.035);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.login-input-frame:focus-within {
  border-color: var(--login-accent);
  background: var(--login-input);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--login-accent) 16%, transparent), inset 0 1px 2px rgba(22, 45, 68, 0.03);
}

.login-input-glyph {
  position: relative;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-left: 15px;
  border: 1.5px solid var(--ui-line-strong);
  border-radius: 50%;
}

.login-input-glyph::after {
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 11px;
  height: 6px;
  border: 1.5px solid var(--ui-line-strong);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  content: "";
  transform: translateX(-50%);
}

.login-input-frame--password .login-input-glyph {
  height: 12px;
  margin-top: 4px;
  border-radius: 3px;
}
.login-input-frame--password .login-input-glyph::before {
  position: absolute;
  left: 2px;
  top: -8px;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--ui-line-strong);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  content: "";
}
.login-input-frame--password .login-input-glyph::after { display: none; }

#login-guard .login-input-frame .text-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px 0 12px;
  border: 0;
  border-radius: 10px;
  outline: 0;
  background: transparent;
  color: var(--login-text);
  font-size: 14px;
  box-shadow: none;
}

#login-guard .login-input-frame .text-input::placeholder { color: var(--login-placeholder); }
#login-guard .login-actions { margin-top: 22px; }
#login-guard .primary-button {
  position: relative;
  min-height: 48px;
  overflow: hidden;
  border: 1px solid var(--login-accent);
  border-radius: 11px;
  background: linear-gradient(135deg, var(--login-accent), var(--login-accent-hover));
  color: var(--login-button-text);
  box-shadow: 0 14px 28px rgba(6, 89, 146, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

#login-guard .primary-button::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -34%;
  width: 26%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  content: "";
  transform: skewX(-18deg);
  transition: left 260ms ease;
}

#login-guard .primary-button:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--login-accent-hover), var(--login-accent));
  box-shadow: 0 16px 32px rgba(6, 89, 146, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}
#login-guard .primary-button:hover:not(:disabled)::after { left: 112%; }
#login-guard .primary-button:active:not(:disabled) { transform: translateY(0); }
#login-guard .primary-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--login-accent) 32%, transparent); outline-offset: 3px; }
#login-guard .primary-button:disabled { cursor: wait; opacity: 0.62; transform: none; }

#login-guard .login-message { min-height: 20px; margin-top: 15px; color: var(--login-muted); font-size: 12px; }
#login-guard .login-message--loading { color: var(--login-accent); }
#login-guard .login-message--success { color: #047857; }
#login-guard .login-message--error { color: #c2413a; }

.login-security-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid var(--ui-line);
  color: var(--login-muted);
  font-size: 11px;
  line-height: 1.6;
}

.login-security-icon {
  position: relative;
  flex: 0 0 auto;
  width: 13px;
  height: 11px;
  margin-top: 3px;
  border: 1.5px solid var(--ui-line-strong);
  border-radius: 3px;
}
.login-security-icon::before {
  position: absolute;
  left: 2px;
  top: -7px;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--ui-line-strong);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  content: "";
}

@media (max-width: 900px) {
  #login-guard { padding: 18px; }
  #login-guard::after { inset: 10px; border-radius: 20px; }
  #login-guard .login-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(520px, 100%);
    min-height: min(680px, calc(100dvh - 36px));
    border-radius: 22px;
    background: var(--login-shell);
  }
  #login-guard .login-capabilities { display: none; }
  #login-guard .login-card {
    min-height: min(680px, calc(100dvh - 36px));
    padding: 62px 46px 38px;
    border-left: 0;
    box-shadow: none;
  }
  #login-guard .login-brand--compact { display: flex; margin: 0 0 34px; }
  #login-guard .login-brand--compact .login-brand-title { color: var(--login-text); }
  #login-guard .login-brand--compact .login-brand-subtitle { color: var(--login-muted); }
}

@media (max-width: 560px) {
  #login-guard { padding: 10px; }
  #login-guard::after { display: none; }
  #login-guard .login-shell { min-height: calc(100dvh - 20px); border-radius: 18px; }
  #login-guard .login-card {
    min-height: calc(100dvh - 20px);
    padding: 54px 22px 28px;
    background-size: 28px 28px, 28px 28px, auto;
  }
  .login-card-topline { top: 22px; left: 22px; right: 22px; }
  #login-guard .login-brand--compact { margin-bottom: 26px; }
  #login-guard #login-title { font-size: 28px; }
  #login-guard .login-form { margin-top: 26px; }
  #login-guard .login-fields { gap: 16px; }
  .login-security-note { margin-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  #login-guard .primary-button,
  #login-guard .primary-button::after,
  #login-guard .login-input-frame { transition: none; }
}

body.reduce-motion #login-guard .primary-button,
body.reduce-motion #login-guard .primary-button::after,
body.reduce-motion #login-guard .login-input-frame { transition: none; }

@media (min-width: 1121px) {
  .sidebar {
    position: relative;
    inset: auto;
    width: auto;
    max-width: none;
    overflow: hidden;
    transform: none;
    transition: none;
  }
  .sidebar-toggle { display: none; }
}

@media (max-width: 1120px) {
  .app-shell,
  .app-shell.today-mode,
  .app-shell.overview-mode,
  .app-shell.report-mode,
  .app-shell.data-center-mode { grid-template-columns: minmax(0, 1fr); }
  .sidebar { width: var(--desktop-sidebar-width); }
  .detail-overlay { left: 0; }
  .workspace { padding-inline: 13px; }
  .report-grid { grid-template-columns: 238px minmax(0, 1fr); }
}

@media (max-width: 800px) {
  .workspace { padding: calc(var(--desktop-topbar-height) + 10px) 10px 18px; }
  .desktop-topbar { padding-inline: 10px; }
  .workspace-head { align-items: flex-start; }
  .workspace-head p { display: none; }
  .report-grid,
  .overview-analysis-grid,
  .overview-structure-grid,
  .data-protection-layout { grid-template-columns: minmax(0, 1fr); }
  .report-version-card { grid-column: auto; }
  .filter-control { flex-basis: 160px; }
}

@media (max-width: 560px) {
  .global-search-button { width: 36px; padding: 0; justify-content: center; }
  .global-search-button span,
  .global-search-button kbd { display: none; }
  .filter-control { min-width: 100%; flex-basis: 100%; }
  .detail-panel { width: 100vw; }
}

@media (prefers-reduced-motion: reduce) {
  .detail-panel,
  .detail-overlay { transition-duration: .01ms; }

  body:not(.login-active) :is(.today-page, .overview-page, .report-page, .data-center-page, .table-panel) {
    animation-name: none !important;
  }

  .data-table tbody td { transition-duration: .01ms !important; }
}

body.reduce-motion:not(.login-active) :is(.today-page, .overview-page, .report-page, .data-center-page, .table-panel) {
  animation-name: none !important;
}

body.reduce-motion .data-table tbody td {
  transition-duration: .01ms !important;
}

/* Theme state contract: one authoritative rule set shared by every desktop theme. */
.table-empty-state {
  display: grid;
  justify-items: center;
  gap: 6px;
  max-width: 520px;
  margin: 0 auto;
  padding: 18px;
  border: 1px dashed var(--ui-line-strong);
  border-color: var(--ui-line-strong);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface-soft);
  color: var(--ui-text-secondary);
  text-align: center;
}

.table-empty-state strong {
  color: var(--ui-text);
  font-size: 14px;
  font-weight: var(--fw-semibold);
}

.table-empty-state span {
  max-width: 460px;
  color: var(--ui-text-secondary);
  line-height: 1.55;
}

.table-loading-state {
  border-color: var(--ui-brand);
  background: var(--ui-brand-soft);
}

.table-loading-state strong { color: var(--ui-brand); }

.table-error-state {
  border-color: var(--ui-danger);
  background: var(--ui-danger-soft);
}

.table-error-state strong { color: var(--ui-danger); }

@media print {
  .detail-overlay,
  .detail-panel { display: none !important; }
}

.notes-view-control { flex: 0 0 auto; }
.notes-view-switch {
  display: inline-flex;
  min-height: 34px;
  padding: 3px;
  border-radius: 7px;
  background: var(--ui-surface-muted);
}
.notes-view-switch button {
  min-width: 72px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ui-text-secondary);
  cursor: pointer;
  transition: background-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease),
    color var(--ui-motion-hover, 120ms) var(--ui-ease, ease);
}
.notes-view-switch button:hover:not(.active) {
  background: var(--ui-surface-muted);
  color: var(--ui-text);
}
.notes-view-switch button:focus-visible {
  outline: 2px solid var(--ui-focus, var(--ui-brand));
  outline-offset: -2px;
}
.notes-view-switch button.active {
  background: var(--ui-surface);
  color: var(--ui-brand);
  box-shadow: var(--ui-shadow-card);
}

.grouped-record-view {
  display: grid;
  min-width: 0;
  max-height: calc(100dvh - 220px);
  overflow: auto;
}
.notes-project-columns,
.partner-followup-columns {
  display: grid;
  grid-template-columns: minmax(284px, 1.4fr) 96px 64px 110px minmax(220px, 1fr) 64px;
  gap: 14px;
  padding: 8px 18px 8px 54px;
  border-bottom: 1px solid var(--ui-line);
  background: var(--ui-surface-muted);
  color: var(--ui-text-tertiary);
  font-size: 12px;
  font-weight: 600;
}
.notes-project-group + .notes-project-group,
.partner-followup-group + .partner-followup-group { border-top: 1px solid var(--ui-line); }
.notes-project-group-head,
.partner-followup-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: stretch;
}
.notes-project-group-toggle,
.partner-followup-group-toggle {
  display: grid;
  grid-template-columns: 24px minmax(260px, 1.4fr) 96px 64px 110px minmax(220px, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 68px;
  padding: 10px 14px 10px 18px;
  border: 0;
  border-left: 3px solid transparent;
  background: var(--ui-surface);
  color: var(--ui-text);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease),
    border-left-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease);
}
.notes-project-group-toggle:hover,
.notes-project-group-toggle:focus-visible,
.partner-followup-group-toggle:hover,
.partner-followup-group-toggle:focus-visible {
  background: var(--ui-surface-muted);
}
.notes-project-group-toggle[aria-expanded="true"],
.partner-followup-group-toggle[aria-expanded="true"] {
  border-left-color: var(--ui-brand);
  background: var(--ui-brand-soft);
}
/* 展开态选择器优先级与 :hover 相同且写在其后，会完全盖掉 hover。
   分组默认展开，因此必须补展开态的 hover 变体，否则划过永远无反馈。 */
.notes-project-group-toggle[aria-expanded="true"]:hover,
.notes-project-group-toggle[aria-expanded="true"]:focus-visible,
.partner-followup-group-toggle[aria-expanded="true"]:hover,
.partner-followup-group-toggle[aria-expanded="true"]:focus-visible {
  background: color-mix(in srgb, var(--ui-brand-soft) 62%, var(--ui-surface-muted));
}
.notes-project-chevron {
  color: var(--ui-text-tertiary);
  font-size: 22px;
  line-height: 1;
  transition: transform var(--ui-motion-state) var(--ui-ease);
}
.notes-project-group-toggle[aria-expanded="true"] .notes-project-chevron,
.partner-followup-group-toggle[aria-expanded="true"] .notes-project-chevron { transform: rotate(90deg); }
.notes-project-identity,
.partner-followup-identity {
  display: grid;
  min-width: 0;
}
.notes-project-identity strong,
.notes-project-identity small,
.partner-followup-identity strong,
.partner-followup-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notes-project-identity strong,
.partner-followup-identity strong { font-size: 14px; }
.notes-project-identity small,
.partner-followup-identity small {
  margin-top: 3px;
  color: var(--ui-text-secondary);
  font-size: 11px;
}
.notes-project-stage,
.notes-project-count,
.notes-project-group-toggle time,
.partner-followup-level,
.partner-followup-count,
.partner-followup-group-toggle time {
  color: var(--ui-text-secondary);
  font-size: 12px;
}
.notes-project-count,
.partner-followup-count {
  color: var(--ui-brand);
  font-weight: 600;
}
.notes-project-group-toggle .business-cell-text,
.partner-followup-group-toggle .business-cell-text {
  min-width: 0;
  max-height: 38px;
}
.notes-project-manage,
.partner-followup-manage {
  border: 0;
  background: transparent;
  color: var(--ui-brand);
  font-weight: 600;
}
.notes-project-manage:hover,
.notes-project-manage:focus-visible,
.partner-followup-manage:hover,
.partner-followup-manage:focus-visible { background: var(--ui-brand-soft); }
.notes-project-group-body,
.partner-followup-group-body {
  padding: 0 20px 14px 50px;
  background: var(--ui-surface-muted);
}
.notes-project-group-body[hidden],
.partner-followup-group-body[hidden] { display: none; }
.notes-project-table-wrap,
.partner-followup-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
}
.notes-project-table { min-width: 720px; }
.partner-followup-table { min-width: 880px; }
.notes-project-table tbody tr,
.partner-followup-table tbody tr { cursor: pointer; }
.notes-project-empty,
.partner-followup-empty { padding: 34px 20px; }

.task-source-section { min-width: 0; }
.task-source-section + .task-source-section { border-top: 1px solid var(--ui-line); }
.task-source-section-toggle,
.task-object-group-toggle {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  border: 0;
  color: var(--ui-text);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease),
    border-left-color var(--ui-motion-hover, 120ms) var(--ui-ease, ease);
}
.task-source-section-toggle {
  min-height: 52px;
  padding: 10px 18px;
  border-left: 3px solid transparent;
  background: var(--ui-surface-muted);
}
/* 原先 :hover 与 [aria-expanded="true"] 合写同一背景值，导致展开态（默认）下划过零变化。
   拆开并给展开态单独的 hover 变体。 */
.task-source-section-toggle:hover:not([aria-expanded="true"]),
.task-source-section-toggle:focus-visible {
  background: var(--ui-brand-soft);
}
.task-source-section-toggle[aria-expanded="true"] {
  border-left-color: var(--ui-brand);
  background: var(--ui-brand-soft);
}
.task-source-section-toggle[aria-expanded="true"]:hover,
.task-source-section-toggle[aria-expanded="true"]:focus-visible {
  background: color-mix(in srgb, var(--ui-brand-soft) 62%, var(--ui-surface-muted));
}
.task-object-group-toggle {
  min-height: 58px;
  padding: 10px 18px 10px 38px;
  background: var(--ui-surface);
}
.task-object-group-toggle:hover:not([aria-expanded="true"]),
.task-object-group-toggle:focus-visible { background: var(--ui-surface-muted); }
.task-object-group-toggle[aria-expanded="true"] { background: var(--ui-brand-soft); }
.task-object-group-toggle[aria-expanded="true"]:hover,
.task-object-group-toggle[aria-expanded="true"]:focus-visible {
  background: color-mix(in srgb, var(--ui-brand-soft) 62%, var(--ui-surface-muted));
}
.task-group-chevron {
  color: var(--ui-text-tertiary);
  font-size: 22px;
  line-height: 1;
  transition: transform var(--ui-motion-state) var(--ui-ease);
}
.task-source-section-toggle[aria-expanded="true"] .task-group-chevron,
.task-object-group-toggle[aria-expanded="true"] .task-group-chevron { transform: rotate(90deg); }
.task-source-identity,
.task-object-identity,
.task-group-count,
.task-group-urgency {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-source-identity,
.task-object-identity { font-size: 14px; }
.task-group-count { color: var(--ui-brand); font-size: 12px; font-weight: 600; }
.task-group-urgency { color: var(--ui-text-secondary); font-size: 12px; }
/* 逾期文字会落在分组头的浅蓝底上（非纯白），基础 --ui-danger #c2413a 在该底色下只有 4.43:1。
   这里加深一档到 5.25:1，仅作用于本元素，不动全局 danger 语义色。 */
.task-group-urgency-overdue { color: var(--ui-danger-strong, #b3352e); }
.task-group-urgency-today { color: var(--ui-warning); }
.task-group-urgency-future,
.task-group-urgency-none,
.task-group-urgency-completed { color: var(--ui-text-secondary); }
.task-source-section-body,
.task-object-group-body {
  padding: 0 18px 14px;
  background: var(--ui-surface-muted);
}
.task-object-group { min-width: 0; }
.task-object-group + .task-object-group { border-top: 1px solid var(--ui-line); }
.task-source-section[data-task-source-section="manual"] .task-source-section-body { background: var(--ui-surface-muted); }
.task-source-section-body[hidden],
.task-object-group-body[hidden] { display: none; }
.task-source-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
}
.task-source-table { min-width: 860px; }
.task-source-table tbody tr { cursor: pointer; }

@media (max-width: 1180px) {
  .notes-project-columns,
  .partner-followup-columns {
    grid-template-columns: minmax(244px, 1.3fr) 64px 110px minmax(200px, 1fr) 64px;
  }
  .notes-project-columns > :nth-child(2),
  .partner-followup-columns > :nth-child(2),
  .notes-project-stage,
  .partner-followup-level { display: none; }
  .notes-project-group-toggle,
  .partner-followup-group-toggle {
    grid-template-columns: 24px minmax(220px, 1.3fr) 64px 110px minmax(200px, 1fr);
  }
  .task-source-section-toggle,
  .task-object-group-toggle { gap: 8px; }
  .task-object-group-toggle { padding-left: 28px; }
  .task-source-table { min-width: 960px; }
}

/* Phase 1/2: weighted forecast and real related-record timeline. */

.detail-related {
  display: block;
}

.related-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.record-timeline {
  margin-top: 10px;
  border: 1px solid var(--ui-line, var(--ui-line));
  border-radius: 10px;
  background: var(--ui-surface, #fff);
  color: var(--ui-text, #172033);
  padding: 11px;
}

.record-timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 8px;
}

.record-timeline-head h3 { margin: 0; color: var(--ui-text, #172033); font-size: 13px; }
.record-timeline-head > span { color: var(--ui-text-secondary, #526276); font-size: 11px; }
.record-timeline-section + .record-timeline-section {
  margin-top: 12px;
  border-top: 1px solid var(--ui-line, var(--ui-line));
  padding-top: 10px;
}
.record-timeline-section h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 2px 7px;
  color: var(--ui-text-secondary, #526276);
  font-size: 11px;
  font-weight: 600;
}
.record-timeline-section h4 > span {
  color: var(--ui-text-secondary, #526276);
  font-size: 11px;
  font-weight: 600;
}
.record-timeline-section-pending h4::before,
.record-timeline-section-completed h4::before,
.record-timeline-section-notes h4::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
}
.record-timeline-section-pending h4::before { background: var(--ui-brand, #175cd3); }
.record-timeline-section-completed h4::before { background: var(--ui-success, #198754); }
.record-timeline-section-notes h4::before { background: var(--purple); }
.record-timeline-empty {
  margin: 0;
  border: 1px dashed var(--ui-line, var(--ui-line));
  border-radius: 8px;
  color: var(--ui-text-secondary, #526276);
  font-size: 11px;
  padding: 10px;
}
.record-timeline-list { display: grid; gap: 6px; }
.record-timeline-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--ui-line, var(--ui-line));
  border-radius: 8px;
  background: var(--ui-surface-muted, #f7f9fc);
  color: var(--ui-text, #172033);
  padding: 8px 9px;
  text-align: left;
}

.record-timeline-item:hover,
.record-timeline-item:focus-visible { border-color: var(--ui-brand, #175cd3); background: var(--ui-brand-soft, #eaf2ff); }
.record-timeline-item[data-overflowing="true"] { cursor: help; }
.record-timeline-marker { width: 8px; height: 8px; border-radius: 50%; background: var(--ui-brand, #175cd3); }
.record-timeline-copy,
.record-timeline-meta { min-width: 0; }
.record-timeline-copy strong,
.record-timeline-copy small,
.record-timeline-meta em,
.record-timeline-meta time { display: block; }
.record-timeline-copy strong { overflow: hidden; color: var(--ui-text, #172033); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.record-timeline-copy small { margin-top: 2px; overflow: hidden; color: var(--ui-text-secondary, #526276); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.record-timeline-meta { color: var(--ui-text-secondary, #526276); font-size: 11px; text-align: right; }
.record-timeline-meta em { color: var(--ui-brand, #175cd3); font-style: normal; font-weight: 600; }
.record-timeline-labels {
  display: grid;
  justify-items: end;
  gap: 2px;
}
.record-timeline-labels small {
  color: var(--ui-text-secondary, #526276);
  font-size: 11px;
}
.record-timeline-item-completed .record-timeline-marker { background: var(--ui-success, #198754); }
.record-timeline-item-completed .record-timeline-meta em { color: var(--ui-success, #198754); }
.record-timeline-item-note .record-timeline-marker { background: var(--purple); }
.record-timeline-item-note .record-timeline-meta em { color: var(--purple); }
.record-timeline-plan { color: var(--ui-text-secondary, #526276); }
.record-timeline-time-missing .record-timeline-marker { background: var(--ui-warning, #8a4b00); }
.record-timeline-section-pending .record-timeline-time-missing .record-timeline-marker { background: var(--ui-brand, #175cd3); }
.record-timeline-section-completed .record-timeline-time-missing .record-timeline-marker { background: var(--ui-success, #198754); }
.record-timeline-section-notes .record-timeline-time-missing .record-timeline-marker { background: var(--purple); }

.overview-stage-name strong { color: var(--ui-text, #172033); }
.overview-stage-track { background: var(--ui-line, #d9e2ee); }
.data-health-risk { box-shadow: inset 3px 0 0 var(--ui-warning, #8a4b00); }

@media (max-width: 720px) {
  .related-summary-grid { grid-template-columns: minmax(0, 1fr); }
  .record-timeline-item {
    grid-template-columns: 10px minmax(0, 1fr);
    align-items: start;
  }
  .record-timeline-meta {
    grid-column: 2;
    justify-items: start;
    text-align: left;
    white-space: normal;
  }
  .record-timeline-labels { justify-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  .record-timeline-item { scroll-behavior: auto; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Report generation workspace layout. */
.report-layout {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.report-generator-bar .report-panel-body {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
}

.report-generator-controls {
  display: grid;
  grid-template-columns: 160px 260px minmax(320px, 1fr) minmax(250px, .78fr);
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.report-generator-controls .report-control-group {
  min-width: 0;
  margin-top: 0;
}

.report-generator-controls .report-segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
}

.report-generator-controls .report-control-label {
  margin-bottom: 6px;
}

.report-generator-controls .report-segment {
  min-height: 34px;
}

.report-generator-controls .report-date-row,
.report-generator-controls .report-source-list {
  gap: 6px;
}

.report-generator-controls .report-date-field {
  gap: 3px;
  padding: 6px 8px;
}

.report-generator-controls .report-date-field input {
  min-height: 22px;
  font-size: 13px;
}

.report-generator-controls .report-source-item {
  min-height: 32px;
  padding-inline: 9px;
}

.report-generator-controls .report-base-status {
  display: flex;
  min-height: 70px;
  min-width: 0;
  margin-bottom: 0;
  flex-direction: column;
  justify-content: center;
  padding: 9px 11px;
}

.report-workspace-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.report-materials-card,
.report-current-card,
.report-archives-strip {
  min-width: 0;
}

.report-materials-card,
.report-timeline-card {
  border-color: var(--ui-line);
  background: #f8fafc;
  box-shadow: none;
}

.report-materials-card .report-panel-body,
.report-timeline-card .report-panel-head,
.report-timeline-card .report-panel-body {
  background: transparent;
}

.report-materials-card .report-summary-strip.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-materials-card .report-condition-materials {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.report-materials-card .report-summary-strip.compact .report-summary-item {
  min-height: 66px;
  height: 66px;
  padding: 8px 10px;
}

.report-materials-card .report-summary-strip.compact .report-summary-number {
  min-height: 21px;
  height: 21px;
  font-size: 20px;
}

.report-materials-card .report-summary-strip.compact .report-summary-item.report-summary-risk {
  min-height: 52px;
  height: 52px;
  grid-template-columns: auto minmax(0, 1fr);
  padding-block: 6px;
}

.report-materials-card .report-summary-strip.compact .report-summary-risk .report-summary-number {
  font-size: 19px;
}

.report-materials-card .report-material-filter-head {
  margin-top: 10px;
  padding-top: 9px;
}

.report-current-card {
  border: 1px solid var(--ui-line-strong);
  background: #fbfdff;
  box-shadow: 0 12px 30px rgba(31, 74, 125, .08);
}

.report-current-card > .report-panel-head {
  background: #f5f9fd;
}

.report-current-card > .report-panel-body {
  background: #fbfdff;
}

.report-workspace-grid > .report-current-card {
  order: 0;
}

.report-archives-strip .report-panel-body {
  min-width: 0;
}

.report-archives-strip .report-timeline-empty {
  display: grid;
  gap: 2px;
  min-height: 0;
  border: 0;
  background: var(--ui-surface-muted);
  padding: 12px;
  text-align: left;
}

.report-archives-strip .report-timeline-empty span {
  margin-top: 0;
}

.report-current-card .report-action-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 8px 0 10px;
  border: 0;
  background: transparent;
  padding: 0;
}

.report-current-card .report-action-primary-row,
.report-current-card .report-action-secondary-row {
  display: contents;
}

.report-current-card .report-action-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 108px;
  min-height: 36px;
  margin: 0;
  border-color: var(--ui-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0 16px;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.report-current-card .report-action-btn[data-report-action="edit-current"],
.report-current-card .report-action-btn[data-report-action="save-edit"] {
  order: 1;
  border-color: var(--ui-line-strong);
  background: #f8fbff;
  color: var(--brand);
}

.report-current-card .report-action-btn[data-report-action="polish"],
.report-current-card .report-action-btn[data-report-action="copy"] {
  order: 2;
}

.report-current-card .report-action-btn[data-report-action="generate"],
.report-current-card .report-action-btn[data-report-action="cancel-edit"],
.report-current-card .report-action-btn[data-report-action="revert-base"] {
  order: 3;
}

.report-current-card .report-action-btn[data-report-action="archive-final"] {
  order: 4;
  margin-left: auto;
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.report-current-card .report-action-btn[data-report-action="archive-final"]:hover:not(:disabled) {
  border-color: var(--ui-line-strong);
  background: #0f4a82;
  color: #ffffff;
}

@media (min-width: 1360px) {
  .report-layout {
    grid-template-columns: minmax(260px, .8fr) minmax(520px, 1.8fr) minmax(250px, .75fr);
    align-items: start;
  }

  .report-materials-card,
  .report-current-card {
    align-self: stretch;
  }

  .report-materials-card {
    display: flex;
    flex-direction: column;
  }

  .report-materials-card > .report-panel-body,
  .report-materials-card .report-condition-materials {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
  }

  .report-materials-card .report-material-list-compact {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
  }

  .report-generator-bar {
    grid-column: 1 / -1;
  }

  .report-workspace-grid {
    display: contents;
  }

  .report-timeline-card {
    grid-column: auto;
  }
}

@media (max-width: 1359px) {
  .report-generator-controls {
    grid-template-columns: minmax(180px, .7fr) minmax(260px, 1fr);
  }

  .report-workspace-grid {
    grid-template-columns: 250px minmax(0, 1fr);
  }
}

@media (max-width: 1023px) {
  .report-generator-controls,
  .report-workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .report-current-card .report-action-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .report-current-card .report-action-btn[data-report-action="archive-final"] {
    margin-left: 0;
  }
}

/* Login coordinate canvas: approved premium Tencent-blue access surface. */
#login-guard {
  inset: 0 0 var(--site-icp-footer-height);
  align-items: stretch;
  justify-content: center;
  padding: 0;
  overflow: auto;
  color: var(--login-text);
  background-color: var(--login-bg);
  background-image: linear-gradient(135deg, var(--login-bg) 0%, color-mix(in srgb, var(--login-accent) 8%, var(--login-bg)) 58%, var(--login-bg) 100%);
}

#login-guard::before,
#login-guard::after,
#login-guard .login-shell::before,
#login-guard .login-shell::after,
#login-guard .login-card::after {
  display: none;
}

#login-guard .login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(390px, 2fr);
  grid-template-rows: 96px minmax(0, 1fr);
  width: min(1440px, 100%);
  height: auto;
  min-height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--login-shell);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#login-guard .login-coordinate-header {
  position: static;
  z-index: 8;
  grid-column: 1 / -1;
  grid-row: 1;
  height: 58px;
  margin: 20px 62px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--login-line);
}

#login-guard .login-coordinate-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--login-text);
  font-size: 16px;
  font-weight: 600;
}

#login-guard .login-brand-logo {
  display: block;
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 7px 14px rgba(8, 120, 249, 0.14));
}

#login-guard .login-coordinate-meta {
  color: var(--login-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
}

#login-guard .login-capabilities {
  position: relative;
  inset: auto;
  grid-column: 1;
  grid-row: 2;
  display: block;
  width: auto;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: var(--login-panel-text);
  background:
    linear-gradient(90deg, transparent 61px, var(--login-grid) 62px, transparent 63px),
    linear-gradient(var(--login-grid) 1px, transparent 1px),
    var(--login-panel);
  background-size: 100% 100%, 100% 96px;
  pointer-events: none;
  text-shadow: none;
}

#login-guard .login-capabilities::before {
  position: absolute;
  inset: 0;
  display: block;
  background: radial-gradient(circle at 68% 42%, var(--login-glow-primary), transparent 56%);
  content: "";
}

#login-guard .login-capabilities::after {
  display: none;
}

#login-guard .login-coordinate-copy {
  position: absolute;
  z-index: 4;
  top: 168px;
  left: 78px;
  width: 600px;
}

#login-guard .login-capabilities-kicker,
#login-guard .login-card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--login-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
}

#login-guard .login-capabilities-kicker::before,
#login-guard .login-card-kicker::before {
  width: 24px;
  height: 1px;
  background: currentColor;
  content: "";
}

#login-guard .login-coordinate-copy h2 {
  max-width: 610px;
  margin: 24px 0 22px;
  color: var(--login-panel-text);
  font-size: clamp(42px, 3.82vw, 55px);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.05em;
}

#login-guard .login-coordinate-copy > p:last-child {
  width: 430px;
  margin: 0;
  color: var(--login-panel-muted);
  font-size: 15px;
  line-height: 1.9;
}

#login-guard .login-coordinate-map {
  position: absolute;
  z-index: 2;
  top: 80px;
  left: 52%;
  display: block;
  width: min(520px, 58vw);
  height: 620px;
  opacity: 0.62;
}

#login-guard .login-coordinate-orbit {
  fill: none;
  stroke: color-mix(in srgb, var(--login-accent) 62%, var(--login-panel-muted));
  stroke-width: 1;
  opacity: 0.44;
}

#login-guard .login-coordinate-route {
  fill: none;
  stroke: var(--login-accent);
  stroke-width: 1.25;
  opacity: 0.56;
}

#login-guard .login-coordinate-node {
  fill: var(--login-panel-soft);
  stroke: var(--login-accent);
  stroke-width: 2;
}

#login-guard .login-coordinate-center {
  fill: var(--login-accent);
  stroke: color-mix(in srgb, var(--login-accent) 18%, var(--login-panel));
  stroke-width: 8;
}

#login-guard .login-coordinate-label {
  position: absolute;
  z-index: 4;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--login-accent) 30%, transparent);
  background: color-mix(in srgb, var(--login-panel-soft) 86%, transparent);
  color: var(--login-panel-text);
  font-size: 11px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#login-guard .login-coordinate-label.is-client {
  top: 184px;
  left: 790px;
}

#login-guard .login-coordinate-label.is-project {
  top: 415px;
  left: 770px;
}

#login-guard .login-coordinate-label.is-partner {
  top: 595px;
  left: 680px;
}

#login-guard .login-coordinate-index {
  position: absolute;
  z-index: 4;
  bottom: 78px;
  left: 78px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--login-panel-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

#login-guard .login-coordinate-index::before {
  width: 32px;
  height: 1px;
  background: var(--login-accent);
  content: "";
}

#login-guard .login-card {
  position: relative;
  z-index: 6;
  top: auto;
  right: auto;
  left: auto;
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  justify-self: center;
  display: block;
  width: min(445px, calc(100% - 72px));
  min-width: 0;
  max-width: none;
  min-height: 570px;
  padding: 48px 48px 36px;
  border: 1px solid var(--login-line);
  border-radius: 0;
  background-color: var(--login-card);
  box-shadow: 0 28px 64px rgba(61, 103, 160, 0.13);
  color: var(--login-text);
  text-align: left;
  transform: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

#login-guard .login-card::before {
  position: absolute;
  top: 48px;
  left: -1px;
  display: block;
  width: 3px;
  height: 70px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(var(--login-accent), var(--login-accent-hover));
  content: "";
  opacity: 1;
  filter: none;
  pointer-events: none;
  transform: none;
  transition: none;
  animation: none;
}

#login-guard .login-card-topline {
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 28px;
  color: var(--login-muted);
}

#login-guard .login-access-state {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--login-muted);
  font-size: 11px;
}

#login-guard .login-access-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--login-accent);
  box-shadow: 0 0 0 4px rgba(52, 167, 255, 0.12);
}

#login-guard #login-title {
  margin: 0;
  color: var(--login-text);
  font-size: 38px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

#login-guard .login-subtitle {
  margin: 10px 0 0;
  color: var(--login-muted);
  font-size: 14px;
  line-height: 22px;
}

#login-guard .login-form {
  margin-top: 30px;
  text-align: left;
}

#login-guard .login-fields {
  display: grid;
  gap: 18px;
  margin: 0;
}

#login-guard .login-field {
  display: grid;
  gap: 8px;
}

#login-guard .login-field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#login-guard .login-field-heading .field-label {
  color: var(--login-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: 0.04em;
}

#login-guard .login-field-heading span {
  display: block;
  color: var(--login-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.11em;
}

#login-guard .login-input-glyph {
  display: none;
}

#login-guard .login-input-frame {
  min-height: 51px;
  border: 1px solid var(--login-line);
  border-radius: 8px;
  background: var(--login-input);
  box-shadow: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

#login-guard .login-input-frame:focus-within {
  border-color: var(--login-accent);
  background: var(--login-input);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--login-accent) 18%, transparent);
}

#login-guard .login-input-frame .text-input {
  min-height: 49px;
  padding: 0 16px;
  border-radius: 7px;
  color: var(--login-text);
  font-size: 14px;
}

#login-guard .login-input-frame .text-input::placeholder {
  color: var(--login-placeholder);
}

#login-guard .login-actions {
  margin-top: 22px;
}

#login-guard .primary-button {
  min-height: 51px;
  border: 0;
  border-radius: 8px;
  color: var(--login-button-text);
  background: linear-gradient(90deg, var(--login-accent), var(--login-accent-hover));
  box-shadow: 0 12px 28px rgba(8, 120, 249, 0.22);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

#login-guard .primary-button::after {
  position: absolute;
  right: 18px;
  left: auto;
  display: block;
  width: auto;
  height: auto;
  background: none;
  color: currentColor;
  content: "→";
  font-size: 18px;
  font-weight: 400;
  transform: none;
}

#login-guard .primary-button:hover:not(:disabled) {
  background: linear-gradient(90deg, var(--login-accent), var(--login-accent-hover));
  box-shadow: 0 14px 30px rgba(8, 120, 249, 0.28);
  filter: brightness(1.03);
  transform: none;
}

#login-guard .primary-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--login-accent) 30%, transparent);
  outline-offset: 3px;
}

#login-guard .primary-button:disabled {
  cursor: wait;
  opacity: 0.66;
  transform: none;
}

#login-guard .login-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--login-muted);
  font-size: 12px;
  line-height: 20px;
  text-align: left;
}

#login-guard .login-message--loading { color: var(--login-accent); }
#login-guard .login-message--success { color: var(--ui-success); }
#login-guard .login-message--error { color: var(--ui-danger); }

#login-guard .login-message::before {
  display: none;
}

#login-guard .login-message--error::before {
  display: inline-flex;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ui-danger);
  color: var(--ui-text-inverse);
  content: "!";
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
}

#login-guard .login-note:empty,
#login-guard .login-tip:empty {
  display: none;
}

#login-guard .login-note,
#login-guard .login-tip {
  margin: 8px 0 0;
  color: var(--login-muted);
  font-size: 11px;
  line-height: 18px;
  overflow-wrap: anywhere;
}

#login-guard .login-security-note {
  display: block;
  margin-top: 18px;
  padding-top: 16px;
  border: 0;
  border-top: 1px solid var(--login-line);
  background: transparent;
  color: var(--login-muted);
  font-size: 11px;
  line-height: 18px;
  letter-spacing: 0.04em;
  text-align: left;
}

@media (max-width: 1199px) and (min-width: 901px) {
  #login-guard .login-shell {
    grid-template-columns: minmax(0, 1fr) 390px;
    min-height: 100%;
  }

  #login-guard .login-coordinate-header {
    margin-right: 36px;
    margin-left: 36px;
  }

  #login-guard .login-capabilities {
    inset: auto;
  }

  #login-guard .login-coordinate-copy {
    top: 130px;
    left: 44px;
    width: 420px;
  }

  #login-guard .login-coordinate-copy h2 {
    max-width: 420px;
    font-size: 38px;
  }

  #login-guard .login-coordinate-copy > p:last-child {
    width: 360px;
  }

  #login-guard .login-coordinate-map {
    left: 360px;
    transform: scale(0.76);
    transform-origin: left center;
  }

  #login-guard .login-coordinate-label.is-client {
    top: 162px;
    left: 478px;
  }

  #login-guard .login-coordinate-label.is-project {
    top: 344px;
    left: 468px;
  }

  #login-guard .login-coordinate-label.is-partner {
    top: 490px;
    left: 392px;
  }

  #login-guard .login-coordinate-index {
    bottom: 42px;
    left: 44px;
  }

  #login-guard .login-card {
    top: auto;
    right: auto;
    width: calc(100% - 36px);
    min-height: 570px;
    padding: 40px;
  }

  #login-guard .login-card::before {
    top: 40px;
  }

  #login-guard .login-card-topline {
    margin-bottom: 22px;
  }

  #login-guard #login-title {
    font-size: 34px;
  }

  #login-guard .login-form {
    margin-top: 24px;
  }

  #login-guard .login-fields {
    gap: 15px;
  }

  #login-guard .login-security-note {
    margin-top: 14px;
    padding-top: 12px;
  }
}

@media (max-width: 900px) {
  #login-guard {
    padding: 0 20px;
  }

  #login-guard .login-shell {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 92px auto;
    width: min(560px, 100%);
    min-height: 100%;
    overflow: visible;
  }

  #login-guard .login-coordinate-header {
    position: static;
    grid-column: 1;
    grid-row: 1;
    margin: 18px 0 16px;
  }

  #login-guard .login-coordinate-meta,
  #login-guard .login-coordinate-map,
  #login-guard .login-capabilities {
    display: none;
  }

  #login-guard .login-card {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    max-width: none;
    min-height: 0;
    padding: 40px;
  }
}

@media (max-width: 560px) {
  #login-guard {
    padding: 0 12px;
  }

  #login-guard .login-coordinate-header {
    margin-top: 12px;
  }

  #login-guard .login-coordinate-brand {
    gap: 10px;
    font-size: 15px;
  }

  #login-guard .login-brand-logo {
    width: 38px;
    height: 38px;
  }

  #login-guard .login-card {
    top: auto;
    padding: 34px 24px 28px;
  }

  #login-guard .login-card::before {
    top: 34px;
    height: 64px;
  }

  #login-guard .login-card-topline {
    margin-bottom: 24px;
  }

  #login-guard #login-title {
    font-size: 32px;
  }

  #login-guard .login-form {
    margin-top: 26px;
  }

  #login-guard .login-input-frame,
  #login-guard .login-input-frame .text-input,
  #login-guard .primary-button {
    min-height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #login-guard .primary-button,
  #login-guard .login-input-frame {
    transition: none;
  }
}

body.reduce-motion #login-guard .primary-button,
body.reduce-motion #login-guard .login-input-frame {
  transition: none;
}
.report-classification-panel {
  align-self: start;
  width: 100%;
  height: max-content;
  min-width: 0;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #f0c98a;
  border-radius: 12px;
  background: #fffaf0;
}

.report-classification-head {
  display: block;
}

.report-classification-head > div {
  min-width: 0;
}

.report-classification-head span,
.report-classification-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.report-classification-list {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 8px;
  height: max-content;
  min-width: 0;
  margin-top: 10px;
}

.report-classification-row {
  display: grid;
  align-content: start;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-items: start;
  gap: 10px;
  height: max-content;
  padding-top: 8px;
  border-top: 1px solid rgba(180, 120, 32, 0.16);
}

.report-classification-row > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.report-classification-row strong {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.report-classification-row small {
  margin-top: 0;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
}

.report-classification-row select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  color: var(--text);
  font: inherit;
}

.report-classification-actions {
  display: flex;
  width: 100%;
  margin-top: 12px;
}

.report-classification-actions [data-report-save-classifications] {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  white-space: nowrap;
}

/* Business detail recommended layout v1: approved 560px precision drawer. */
.detail-panel {
  background: #f6f8fb;
  border-left-color: var(--ui-line);
  box-shadow: -20px 0 52px rgba(20, 36, 60, .16);
}

.detail-head {
  min-height: 92px;
  padding: 16px 18px 14px;
  background: var(--ui-surface);
}

.detail-head > div:first-child { min-width: 0; }
.detail-kicker {
  color: var(--ui-brand);
  font-size: 11px;
  line-height: 17px;
  font-weight: 600;
  letter-spacing: .02em;
}
.detail-title {
  margin-top: 3px;
  color: var(--ui-text);
  font-size: 18px;
  line-height: 25px;
  font-weight: 600;
  letter-spacing: -.015em;
}
.detail-subtitle {
  margin-top: 2px;
  color: var(--ui-text-secondary);
  font-size: 12px;
  line-height: 18px;
}
.detail-head .icon-button {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: 44px;
  padding: 0 12px;
}

.detail-scroll { background: #f6f8fb; }
.detail-message { margin: 12px 16px 0; }
.detail-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  overflow: visible;
  padding: 14px 16px 6px;
}

.detail-highlight-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: var(--space-3, 12px);
  margin-bottom: var(--space-4, 16px);
  padding: var(--space-3, 12px);
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  /* 这里是「中性信息摘要」（阶段/金额/成交时间），不是需要强调的操作区。
     原先用 --ui-brand-soft（品牌强调底），在 precision 下渲染成 #e8effe 蓝紫块，
     压在纯白卡片上饱和度高出 0.087，明显突兀。改用中性分区底，
     强调改由左侧品牌色条承担。
     色条必须用 inset box-shadow 而不是 border-left：后者会额外吃掉 2px 内容宽度，
     使「跟进提醒」这类需要独占整行的条目差 2px 达不到整行宽度
     （desktop-business-long-text-browser-smoke 有对应门禁）。 */
  background: var(--ui-surface-muted);
  box-shadow: inset 3px 0 0 var(--ui-brand);
}
.detail-highlight-item {
  display: grid;
  gap: var(--space-1, 4px);
  min-width: 0;
}
.detail-highlight-item span {
  color: var(--ui-text-secondary);
  font-size: 11px;
  line-height: 16px;
}
.detail-highlight-item strong {
  overflow: hidden;
  color: var(--ui-text);
  font-size: 13px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-highlight-item-wide {
  grid-column: 1 / -1;
}

.detail-highlight-item-wide strong {
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.detail-field-section {
  min-width: 0;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: var(--ui-surface);
  padding: 13px 14px 14px;
}
.detail-field-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.detail-field-section-head > div { min-width: 0; }
.detail-field-section-head h3 {
  margin: 0;
  color: var(--ui-text);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}
.detail-field-section-head p {
  margin: 2px 0 0;
  color: var(--ui-text-tertiary);
  font-size: 11px;
  line-height: 16px;
}
.detail-field-section-head > span {
  flex: 0 0 auto;
  color: var(--ui-text-tertiary);
  font-size: 11px;
  line-height: 17px;
  white-space: nowrap;
}
.detail-field-section-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 12px;
}
.detail-field-section .field-label {
  margin-bottom: var(--space-1, 4px);
  color: var(--ui-text-secondary);
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
}
.detail-field-section .field-input,
.detail-field-section .field-select,
.detail-field-section .field-static {
  min-height: 40px;
  font-size: 13px;
}
.detail-field-section .field-textarea {
  min-height: 84px;
  font-size: 13px;
  line-height: 20px;
}

.detail-form > .insight-card,
.detail-form > .ai-extract-panel,
.detail-form > .project-communication-card,
.detail-form > .project-note-create-action {
  margin: 0;
}
.detail-related {
  margin: 0;
  padding: 6px 16px 16px;
  /* 这里的意图是「比卡片略暗的分区底」，内部卡片再用 --ui-surface 提亮。
     原先硬编码 #f6f8fb，在深色主题下会变成近白块压浅色文字（nocturne 实测 1.03:1）。
     改用语义变量后由各主题自行给出对应深浅。 */
  background: var(--ui-surface-muted);
}
.detail-related .related-summary-grid,
.detail-related .record-timeline { background: var(--ui-surface); }

.detail-actions {
  justify-content: flex-end;
  gap: 8px;
  min-height: 64px;
  padding: 10px 16px;
  background: var(--ui-surface);
  box-shadow: 0 -8px 24px rgba(20, 36, 60, .04);
}
.detail-actions .danger-button,
.detail-actions .danger-button.ghost-button,
.detail-actions .ghost-button,
.detail-actions .primary-button {
  flex: 0 0 auto;
  height: 44px;
  min-height: 44px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
.detail-actions #delete-button {
  min-width: 68px;
  margin-right: auto;
}
.detail-actions #cancel-button { min-width: 92px; }
.detail-actions #save-button { min-width: 116px; }
.detail-actions.source-task-readonly-actions #cancel-button { margin-left: auto; }
.detail-actions.source-task-readonly-actions #save-button { min-width: 128px; }

@media (min-width: 961px) {
  .detail-panel { width: min(560px, calc(100vw - 48px)); }
}

@media (max-width: 560px) {
  .detail-head { min-height: 88px; padding: 14px 14px 12px; }
  .detail-title { font-size: 17px; line-height: 23px; }
  .detail-form { padding: 12px 12px 6px; }
  .detail-field-section { padding: 12px; }
  .detail-field-section-fields { grid-template-columns: minmax(0, 1fr); }
  .detail-field-section-head > span { display: none; }
  .detail-related { padding: 6px 12px 14px; }
  .detail-actions { min-height: 64px; padding: 10px 12px; }
  .detail-actions #delete-button { min-width: 52px; }
  .detail-actions #cancel-button { min-width: 76px; }
  .detail-actions #save-button { min-width: 116px; }
}

@media (prefers-reduced-motion: reduce) {
  .detail-panel,
  .detail-overlay { transition-duration: .01ms; }
}

/* Layout occlusion safety: reserve footer space and contain wide business tables. */
body.login-active .app-shell { visibility: hidden; }

.app-shell,
.app-shell.today-mode,
.app-shell.overview-mode,
.app-shell.report-mode {
  height: calc(100dvh - var(--site-icp-footer-height));
}

/* 侧栏不要再设最小高度：.app-shell 已用 calc(100dvh - 页脚高) 扣掉 ICP 页脚，
   grid 默认 stretch 会把侧栏拉满轨道。若写 min-height:100%，在 grid item 上
   百分比会参照 body（整个视口高）而非轨道高度，侧栏就会溢出 30px，
   使 ICP 页脚压住 .sidebar-footer 里的模型设置卡。 */
.app-shell > .sidebar { min-height: 0; }

.app-shell.data-center-mode {
  /* 与其他 mode 一致扣除页脚高度，否则数据保护页同样会出现页脚压住侧栏底部卡片。 */
  height: calc(100dvh - var(--site-icp-footer-height));
}

@media (min-width: 901px) and (max-width: 1199px) {
  .data-table.business-table th:first-child,
  .data-table.business-table td:first-child {
    position: sticky;
    left: 0;
  }

  .data-table.business-table th:first-child {
    z-index: 3;
    box-shadow: 1px 0 0 var(--ui-line);
  }

  .data-table.business-table td:first-child {
    z-index: 1;
    background: var(--ui-surface);
    box-shadow: 1px 0 0 var(--ui-line);
  }

  .data-table.business-table tbody tr:hover td:first-child {
    background: var(--ui-surface-muted);
  }
}

@media (max-width: 1100px) {
  .app-shell,
  .app-shell.today-mode,
  .app-shell.overview-mode,
  .app-shell.report-mode {
    min-height: calc(100dvh - var(--site-icp-footer-height));
    height: auto;
  }

  .app-shell.data-center-mode {
    /* 与同区间其他 mode 保持一致扣除页脚高度，否则数据保护页底部会被 ICP 页脚压住。 */
    min-height: calc(100dvh - var(--site-icp-footer-height));
    height: auto;
  }
}
