:root {
  color-scheme: light;
  --page-bg: #f3f4f6;
  --nav-bg: #f3f4f6;
  --panel: #ffffff;
  --panel-subtle: #f8fafc;
  --panel-muted: #f3f4f6;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --text: #111111;
  --body: #4b5563;
  --muted: #6b7280;
  --faint: #9ca3af;
  --success: #16a34a;
  --danger: #111111;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.04);
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --control-height: 36px;
  --workspace-shell-max-width: 1720px;
  --workspace-sidebar-expanded: 196px;
  --workspace-sidebar-collapsed: 56px;
  --workspace-shell-gap: 12px;
  --workspace-shell-radius: 18px;
  font-family: Inter, 'Noto Sans CJK SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; height: 100%; background: var(--page-bg); color: var(--text); }
body { font: 14px/1.6 Inter, 'Noto Sans CJK SC', 'PingFang SC', 'Microsoft YaHei', sans-serif; min-width: 0; }
body.workspace-module-body.workspace-homepage-body { overflow: hidden; }
button, a, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
:where(button, a, input, textarea, select):focus-visible { outline: 2px solid #111111; outline-offset: 2px; }

.workspace-shell { max-width: 1680px; margin: 0 auto; padding: 24px; }
.workspace-main, .workspace-home-main, .workspace-surface-shell, .page-shell, .intelligence-shell, .quotation-shell, .team-shell { display: grid; gap: 20px; min-width: 0; }
.workspace-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 32px; align-items: start; margin-bottom: 24px; }
.workspace-stage.workspace-pagebar { grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; margin-bottom: 16px; padding: 16px 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel-subtle); }
.workspace-pagebar .stage-copy h1 { font-size: clamp(18px, 2.2vw, 24px); }
.workspace-pagebar .stage-summary { margin-top: 8px; }
.stage-copy h1, .section-head h2, .menu-item h3, .detail-stack h3, .mainseat-dropzone h3, .metric-panel strong, .task-item strong, .tray-card strong { margin: 0; }
.stage-copy { max-width: 760px; }
.stage-copy h1 { margin-top: 8px; font-size: clamp(20px, 3vw, 28px); line-height: 1.3; }
.stage-summary, .detail-stack p, .mainseat-dropzone p, .chat-message p, .reference-grid span, .metric-panel p, .menu-item p, .task-item span, .task-item small, .tray-card p, .tray-card small, .auth-shell small, .auth-field span, .muted { color: var(--body); }
.message-body { margin: 0; white-space: pre-wrap; }
.stage-summary { margin: 14px 0 0; max-width: 680px; }
.stage-side, .workspace-auth-panel { display: grid; gap: 14px; min-width: 0; align-content: start; }
.eyebrow, .workspace-module-eyebrow { margin: 0; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.section-head.compact { margin-bottom: 0; }
.stage-pills, .stage-actions, .auth-status, .auth-form, .focus-chip-row, .mainseat-policy-pills, .composer-actions, .structured-reference-head, .reference-grid, .task-section-head, .metric-caption, .menu-item-actions, .hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stage-actions { min-width: 240px; justify-content: flex-end; }
.stage-pill, .pill, .signal-badge, .focus-chip, .menu-link, .item-tag, .meta-pill, .status-chip, .signal-pill, .tag, .filter-chip, .subtle-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12px; line-height: 1; background: var(--panel-muted); color: var(--muted); }
.signal-badge.success, .signal-pill.hot, .status-chip.is-strong, .signal-badge.is-strong { background: #111111; color: #FFFFFF; border-color: #111111; }
.signal-badge.warning, .signal-badge.danger { color: var(--muted); }
.menu-link, .ghost-link, .secondary-link { background: #FFFFFF; color: var(--body); border: 1px solid var(--line-strong); }
.button, .primary-button, .secondary-button, .primary-action, .secondary-action, .hero-action-button, .google-button { min-height: var(--control-height); padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: 1px solid #111111; background: #111111; color: #FFFFFF; }
.button.secondary, .secondary-button, .secondary-action, .hero-action-button.secondary { background: #FFFFFF; color: #111111; border-color: var(--line-strong); }
textarea, input, select { width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; background: #FFFFFF; color: var(--text); padding: 10px 12px; }
textarea { resize: vertical; }

.workspace-home-toolbar-copy h1 { margin: 0; font-size: clamp(24px, 2vw, 32px); line-height: 1.18; letter-spacing: -0.03em; font-weight: 700; }
.workspace-home-toolbar-summary, .workspace-home-toolbar-hint { display: none; }
.workspace-home-toolbar-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.workspace-home-shell { height: 100vh; min-height: 100vh; }
.workspace-module-content { min-width: 0; min-height: 0; }
.workspace-homepage-content {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  padding: 12px 14px 12px 10px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94) 0%, rgba(250,250,250,0.98) 100%);
  border: 1px solid rgba(17,17,17,0.05);
}
.workspace-home-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}
.workspace-home-grid,
.workspace-home-unified-grid { min-height: 0; }
.workspace-home-unified-grid {
  display: grid;
  grid-template-columns: minmax(280px, 336px) minmax(0, 1fr) minmax(300px, 344px);
  gap: 14px;
  align-items: stretch;
}
.workspace-home-column {
  min-width: 0;
  min-height: 0;
  padding: 18px;
  border: 1px solid rgba(17,17,17,0.06);
  border-radius: 22px;
  background: rgba(255,255,255,0.96);
  box-shadow: var(--shadow-soft);
}
.workspace-home-column-list,
.workspace-home-column-actions {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  background: linear-gradient(180deg, rgba(249,250,251,0.98) 0%, rgba(245,247,250,0.98) 100%);
}
.workspace-home-column-mainseat {
  display: grid;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.995), rgba(252,252,252,0.995));
}
.workspace-column-head { position: relative; z-index: 1; }
.workspace-auth-panel-nav {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid rgba(17,17,17,0.06);
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
}
.auth-shell-compact {
  display: grid;
  gap: 10px;
}
.auth-shell-inline-form {
  align-items: stretch;
}
.auth-identity-block {
  display: grid;
  gap: 4px;
}
.auth-identity-block strong {
  font-size: 14px;
  line-height: 1.35;
  color: var(--text);
}
.auth-form-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}
.auth-field-compact {
  min-width: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.task-rail,
.action-tray {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.workspace-home-toolbar-compact {
  padding: 4px 4px 14px;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(17,17,17,0.05);
}
.workspace-summary-card-subtle { background: rgba(255,255,255,0.8); box-shadow: none; }
.workspace-summary-strip { display: grid; grid-template-columns: 1fr; gap: 10px; }
.workspace-summary-strip-minimal { display: grid; }
.workspace-summary-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(17,17,17,0.06);
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(248,250,252,0.96));
}
.workspace-summary-card strong { display: block; font-size: 18px; line-height: 1.3; margin-top: 2px; }
.workspace-summary-kicker { margin: 0 0 4px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.workspace-summary-note { margin: 6px 0 0; color: var(--body); }

.mainseat-chat-shell { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 12px; min-height: 0; box-shadow: none; }
.mainseat-chat-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mainseat-chat-title { display: grid; gap: 3px; }
.mainseat-chat-title h2, .thread-suggestion-bar h3, .thread-followup-panel h3, .agent-process-head h3 { margin: 0; }
.mainseat-header-actions, .mainseat-head-actions { display: grid; gap: 10px; justify-items: end; }
.mainseat-call-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mainseat-call-button {
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(17,17,17,0.08);
  background: rgba(255,255,255,0.92);
  color: var(--text);
}
.mainseat-call-button small { color: var(--muted); }
.mainseat-call-button:hover { background: #FFFFFF; }
.mainseat-context-rail { display: grid; gap: 8px; }
.mainseat-context-rail-minimal { gap: 8px; }
.mainseat-chat-context-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 0 0 10px;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid rgba(17,17,17,0.05);
  background: transparent;
}
.mainseat-chat-context-copy, .mainseat-chat-context-meta { display: grid; gap: 4px; }
.mainseat-chat-context-copy h3 { margin: 0; }
.mainseat-chat-context-meta { justify-items: end; text-align: right; }
.profile-summary-card-compact, .detail-section-chat-context, .detail-section-chat-context-subtle, .structured-reference-block-chat, .thread-suggestion-bar, .thread-followup-panel, .thread-followup-panel-subtle {
  background: rgba(249,250,251,0.96);
  border: 1px solid rgba(17,17,17,0.05);
  border-radius: 18px;
}
.detail-stack, .detail-section, .structured-reference-block-chat, .thread-suggestion-bar, .thread-followup-panel, .thread-followup-panel-subtle { padding: 14px 16px; }
.mainseat-thread {
  min-height: 0;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 4px 4px 6px;
  background: transparent;
}
.thread-shell { display: grid; gap: 12px; min-height: 100%; }
.thread-stack { display: grid; gap: 12px; }
.thread-suggestion-bar-inline, .thread-followup-panel-subtle {
  padding: 10px 0 0;
  border: 0;
  border-top: 1px solid rgba(17,17,17,0.06);
  border-radius: 0;
  background: transparent;
}
.thread-quick-actions, .thread-followup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.thread-chip-action, .thread-followup-button {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #FFFFFF;
  color: var(--text);
}
.thread-chip-action:hover, .thread-followup-button:hover { background: #F3F4F6; }
.chat-message { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 0; border: 0; background: transparent; }
.chat-message.user { grid-template-columns: minmax(0, 1fr) 36px; }
.message-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px; background: #111111; color: #FFFFFF; font-size: 12px; font-weight: 700; }
.chat-message.user .message-avatar { order: 2; background: #E5E7EB; color: #111111; }
.message-bubble {
  max-width: min(760px, 100%);
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(17,17,17,0.08);
  border-radius: 18px;
  background: #FFFFFF;
}
.chat-message.user .message-bubble { order: 1; justify-self: end; background: #111111; border-color: #111111; }
.chat-message.user .message-role, .chat-message.user .message-body { color: #FFFFFF; }
.agent-process-rail { display: grid; gap: 12px; padding: 14px 16px; border: 1px solid rgba(17,17,17,0.06); border-radius: 18px; background: rgba(249,250,251,0.98); }
.agent-process-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.agent-process-list { display: grid; gap: 8px; }
.agent-process-step { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(17,17,17,0.06); background: #FFFFFF; }
.agent-process-step.is-running { border-color: rgba(17,17,17,0.18); box-shadow: inset 0 0 0 1px rgba(17,17,17,0.03); }
.agent-process-step.is-done { background: rgba(245,245,245,0.92); }
.agent-process-step.is-waiting { background: rgba(250,250,250,0.9); }
.agent-process-icon, .agent-process-state { color: var(--muted); font-size: 12px; }
.agent-process-copy { display: grid; gap: 2px; }
.agent-process-copy strong { font-size: 13px; }
.agent-process-copy p { margin: 0; color: var(--body); }
.mainseat-dropzone { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 12px 14px; background: rgba(248,248,248,0.62); border-style: dashed; border-color: rgba(17,17,17,0.08); }
.mainseat-dropzone.is-dragover { border-color: #111111; background: rgba(255,255,255,0.98); }
.dropzone-hint { display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; min-height: 36px; border-radius: 999px; background: #111111; color: #FFFFFF; white-space: nowrap; }
.mainseat-conversation-shell { display: grid; gap: 12px; min-height: 0; overflow: hidden; grid-template-rows: minmax(0, 1fr) auto; }
.composer-form { display: grid; gap: 8px; background: rgba(255,255,255,0.98); }
.composer-field { display: grid; gap: 10px; }
.composer-dock {
  position: relative;
  display: block;
  border: 1px solid rgba(17,17,17,0.08);
  border-radius: 20px;
  background: #FFFFFF;
  padding: 14px 136px 14px 14px;
  min-height: 136px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.composer-dock.is-dragover { border-color: #111111; box-shadow: inset 0 0 0 1px rgba(17,17,17,0.04); background: rgba(255,255,255,0.98); }
.composer-input-docked { width: 100%; min-height: 88px; border: 0; outline: 0; resize: none; padding: 0; background: transparent; color: var(--text); }
.composer-inline-actions { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: flex-end; gap: 8px; }
.composer-inline-button { width: 38px; min-width: 38px; height: 38px; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; border: 1px solid rgba(17,17,17,0.08); background: #FFFFFF; color: #111111; }
.composer-inline-button:hover { background: #F3F4F6; }
.composer-send-button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 999px; background: #111111; color: #FFFFFF; border-color: #111111; box-shadow: none; }
.composer-send-button:hover { background: #000000; }
.composer-send-button-inline { position: static; }
.composer-send-icon { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; transform: translateY(-1px); font-size: 18px; line-height: 1; }
.composer-attachment-summary { min-height: 22px; display: flex; align-items: center; }
.composer-attachment-empty { margin: 0; color: var(--muted); font-size: 12px; }
.composer-attachment-chip { max-width: 100%; display: inline-grid; grid-template-columns: auto; gap: 2px; align-items: start; padding: 8px 12px; border-radius: 14px; border: 1px solid rgba(17,17,17,0.08); background: rgba(249,250,251,0.98); color: var(--text); text-align: left; position: relative; }
.composer-attachment-chip-label, .composer-attachment-chip small { color: var(--muted); }
.composer-attachment-chip-close { position: absolute; clip: rect(0 0 0 0); clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.mainseat-profile-summary .menu-item-actions, .profile-summary-card .menu-item-actions, .auth-status { justify-content: space-between; align-items: center; }

.task-section { display: grid; gap: 10px; }
.task-list, .tray-cards { display: grid; gap: 10px; }
.task-item, .tray-card {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(17,17,17,0.07);
  border-radius: 18px;
  background: rgba(255,255,255,0.98);
  padding: 14px 14px;
  display: grid;
  gap: 6px;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}
.task-item:hover, .tray-card:hover { border-color: rgba(17,17,17,0.14); background: #FFFFFF; transform: translateY(-1px); }
.task-item.is-current, .task-item.is-active, .tray-card.is-active { border-color: #111111; background: #f8fafc; }
.task-item strong, .tray-card strong { font-size: 15px; line-height: 1.35; }
.task-item span, .tray-card p { margin: 0; }
.tray-section { display: grid; gap: 10px; }
.empty-state {
  padding: 18px 16px;
  border-radius: 18px;
  border: 1px dashed rgba(17,17,17,0.1);
  background: rgba(249,250,251,0.9);
  color: var(--muted);
}
.empty-state.compact { padding: 14px 16px; }

.auth-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: min(100%, 520px);
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(17,17,17,0.06);
  background: rgba(255,255,255,0.92);
}
.auth-shell h2 { margin: 4px 0 4px; font-size: 18px; line-height: 1.25; }
.auth-form { align-items: end; }
.auth-field { display: grid; gap: 6px; min-width: 220px; }
.auth-status { min-height: 24px; color: var(--muted); }

.visual-panel { position: relative; padding: 32px; background: linear-gradient(180deg, #FFFFFF 0%, #F9FAFB 100%); min-height: 640px; display: grid; align-content: space-between; }
.form-panel { padding: 32px; display: grid; align-content: start; gap: 18px; }
.divider { display: grid; place-items: center; position: relative; color: var(--faint); font-size: 12px; }
.login-form { display: grid; gap: 14px; }
.field { display: grid; gap: 8px; }
.password-wrap { display: flex; gap: 8px; align-items: center; }
.ghost-icon { min-height: 40px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: #FFFFFF; color: var(--body); }
.inline-row, .register-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.checkbox, .compliance-row { display: flex; gap: 10px; align-items: flex-start; color: var(--body); }
.compliance-row { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-subtle); }

@media (max-width: 1320px) {
  .workspace-home-unified-grid { grid-template-columns: minmax(264px, 300px) minmax(0, 1fr) minmax(280px, 320px); }
  .auth-shell { min-width: 0; width: 100%; }
}

@media (max-width: 1240px) {
  .workspace-summary-strip, .workspace-stage, .workspace-stage.workspace-pagebar, .communication-grid, .intelligence-layout, .summary-grid, .detail-grid, .team-layout, .workspace-grid, .login-card { grid-template-columns: 1fr; }
  .workspace-home-unified-bar { grid-template-columns: 1fr; align-items: start; }
  .workspace-summary-strip { grid-template-columns: 1fr; }
  .workspace-home-unified-grid { grid-template-columns: minmax(260px, 286px) minmax(0, 1fr) 292px; }
  .workspace-home-column-list, .workspace-home-column-actions { background: rgba(249,250,251,0.94); }
  .workspace-home-grid > .action-tray-card { grid-column: 1 / -1; min-height: auto; }
  .login-card { max-width: 760px; }
  .auth-form-compact { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  body.workspace-module-body.workspace-homepage-body { overflow: hidden; }
  .workspace-home-shell { height: 100vh; min-height: 100vh; }
  .workspace-homepage-content { overflow: hidden; }
  .workspace-home-main { overflow: hidden; }
  .workspace-home-unified-grid { grid-template-columns: minmax(0, 1fr); }
  .workspace-home-column, .workspace-home-column-list, .workspace-home-column-actions { border-left: 0; border-right: 0; border-bottom: 1px solid rgba(17,17,17,0.05); }
  .workspace-home-column:last-child { border-bottom: 0; }
  .task-rail, .action-tray, .mainseat-thread { overflow: auto; }
}

@media (max-width: 760px) {
  .workspace-shell, .workspace-module-shell, .login-page { padding: 16px; }
  .workspace-summary-strip { grid-template-columns: 1fr; }
  .workspace-surface-hero, .workspace-surface-action-bar, .workspace-home-toolbar, .inline-row, .register-row { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
  .workspace-home-toolbar-inline { display: grid; gap: 4px; }
  .workspace-homepage-content { padding: 10px; border-radius: 20px; }
  .workspace-home-column, .workspace-home-column-mainseat { padding: 16px; }
  .auth-shell { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
  .workspace-auth-panel-nav { padding: 10px; }
  .composer-dock { padding-right: 14px; padding-bottom: 70px; }
  .composer-inline-actions { right: 10px; bottom: 10px; }
  .support-metrics, .reference-grid { grid-template-columns: 1fr; }
  .button, .primary-button, .secondary-button, .primary-action, .secondary-action, .hero-action-button, .google-button { width: 100%; }
}
