:root {
  /* 暗色黑白玻璃 */
  --bg-void: #070708;
  --bg-deep: #0c0c0e;
  --panel: rgba(22, 22, 26, 0.72);
  --panel-solid: #141418;
  --panel-2: rgba(28, 28, 32, 0.55);
  --sidebar-bg: rgba(16, 16, 18, 0.78);
  --input: rgba(8, 8, 10, 0.88);
  --hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.28);
  --glass-blur: 14px;
  --accent: #c4786a;
  --accent-bright: #f0d2c8;
  --accent-dim: rgba(92, 36, 40, 0.45);
  --text: #f2f2f2;
  --text-2: #a0a0a0;
  --text-3: #6e6e6e;
  --mono: #b0b0b0;
  --ok: #d0d0d0;
  --warn: #c4b08a;
  --danger: #d09090;
  --on-accent: #0a0a0a;
  --sidebar: 248px;
  --radius: 14px;
  --font: "PingFang SC", "Hiragino Sans GB", "Segoe UI", "Noto Sans SC", sans-serif;
  --display: "Songti SC", "Noto Serif SC", "Georgia", "Times New Roman", serif;
  --code: ui-monospace, "SF Mono", "Cascadia Mono", "Consolas", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

#app {
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-void);
  -webkit-font-smoothing: antialiased;
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 120, 106, 0.4) #0a0a0c;
}

body::-webkit-scrollbar {
  width: 8px;
}

body::-webkit-scrollbar-track {
  background: #0a0a0c;
}

body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(196, 120, 106, 0.5), rgba(92, 36, 40, 0.4));
  border-radius: 999px;
}

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

button {
  cursor: pointer;
  border: 0;
  background: none;
}

[hidden] {
  display: none !important;
}

.atmosphere {
  height: 100%;
  min-height: 100%;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, 0.07), transparent 50%),
    radial-gradient(ellipse at 85% 100%, rgba(255, 255, 255, 0.04), transparent 45%),
    linear-gradient(165deg, #121214 0%, var(--bg-void) 45%, #050506 100%);
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 40px rgba(0, 0, 0, 0.45);
}

/* —— Login —— */
.login {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 28px 16px 40px;
  position: relative;
}

.status-pill {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-family: var(--code);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--mono);
  white-space: nowrap;
}

.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

.status-pill .sep {
  opacity: 0.35;
}

.login-panel {
  width: min(420px, 100%);
  padding: 32px 28px 24px;
  border-radius: var(--radius);
}

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

.brand-row h1,
.brand-row .name {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-row.compact .name {
  font-size: 17px;
}

.brand-row .tag,
.mono-sub {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--text-2);
}

.mono-sub {
  font-family: var(--code);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--mono);
}

.mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.08) url("/aipmclaw-logo.png") center / cover no-repeat;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  object-fit: cover;
}

.mark::after {
  content: none;
}

.mark.sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.lead {
  margin: 0 0 24px;
  color: var(--text-2);
  line-height: 1.55;
  font-size: 15px;
}

.form {
  display: grid;
  gap: 12px;
}

.form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.form input {
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input);
  outline: none;
}

.form input:focus {
  border-color: var(--border-strong);
}

.btn-primary {
  margin-top: 6px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(165deg, rgba(92, 36, 40, 0.96), rgba(42, 14, 18, 0.98));
  color: #f6efed;
  font-weight: 600;
  border: 1px solid rgba(180, 120, 112, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 210, 0.14),
    0 8px 24px rgba(40, 10, 14, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(165deg, rgba(110, 44, 50, 0.98), rgba(52, 18, 22, 1));
  filter: none;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: none;
}

.btn-primary.sm {
  margin: 0;
  height: 34px;
  min-width: 72px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 9px;
}

.hint {
  margin: 16px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}

/* —— Shell（全屏，无外边距浮层） —— */
.shell {
  height: 100%;
  width: 100%;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.sidebar {
  border-radius: 0;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  background: var(--sidebar-bg);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.sidebar .brand-row {
  padding: 16px 14px 12px;
  margin: 0;
}

.nav {
  display: grid;
  gap: 2px;
  padding: 0 8px 10px;
}

.nav button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 13.5px;
}

.nav button span {
  position: relative;
  z-index: 0;
  display: inline-block;
}

.nav button em {
  font-style: normal;
  font-family: var(--code);
  font-size: 10px;
  color: var(--text-3);
  opacity: 0;
  z-index: 1;
}

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

.nav button:hover em,
.nav button.is-active em {
  opacity: 0;
}

.nav button:hover em {
  opacity: 0.55;
  color: var(--text-3);
}

.nav button.is-active {
  background: transparent;
  color: var(--text);
}

/* 标题后的酒红过渡条（衬在中文标题字后，对标官网标题光晕） */
.nav button.is-active span::after {
  content: "";
  position: absolute;
  left: -3px;
  right: -8px;
  bottom: 0.05em;
  height: 0.48em;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    rgba(232, 90, 60, 0.62) 0%,
    rgba(196, 120, 106, 0.38) 42%,
    rgba(92, 36, 40, 0.12) 72%,
    transparent 100%
  );
  box-shadow: 0 0 16px rgba(140, 52, 58, 0.22);
  z-index: -1;
  pointer-events: none;
}

.nav button.is-active::before {
  content: none;
}

.nav button.is-active em {
  color: var(--accent);
}

.threads {
  border-top: 1px solid var(--border);
  padding: 8px;
  overflow: auto;
}

.section-label {
  padding: 8px 8px 6px;
  font-family: var(--code);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.thread {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  display: grid;
  gap: 3px;
}

.thread strong {
  position: relative;
  z-index: 0;
  display: inline-block;
  max-width: 100%;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread span {
  font-size: 11px;
  color: var(--text-3);
}

.thread:hover {
  background: rgba(255, 255, 255, 0.04);
}

.thread.is-active {
  background: transparent;
}

.thread.is-active strong::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -6px;
  bottom: 0.05em;
  height: 0.42em;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    rgba(232, 90, 60, 0.55) 0%,
    rgba(196, 120, 106, 0.3) 50%,
    transparent 100%
  );
  z-index: -1;
  pointer-events: none;
}

/* 侧栏滚动条：暗色，避免系统白条 */
.threads,
.sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 120, 106, 0.45) transparent;
}

.threads::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.threads::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.threads::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(196, 120, 106, 0.55), rgba(92, 36, 40, 0.45));
  border-radius: 999px;
}

.threads::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(232, 90, 60, 0.65);
}

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid var(--border-strong);
  font-size: 12px;
  font-weight: 600;
}

.user-name {
  font-size: 13px;
}

.user-role {
  font-size: 11px;
  color: var(--text-3);
}

.ghost {
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-2);
}

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

.main {
  border-radius: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.shell > .panel {
  border-radius: 0;
  box-shadow: none;
}

.shell > .sidebar.panel {
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-right: 1px solid var(--border);
}

.shell > .main.panel {
  border: 0;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 10px;
  border-bottom: 1px solid var(--border);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
}

.tabs button {
  min-width: 72px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-2);
}

.tabs button.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--code);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--mono);
}

.online i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
}

.body {
  overflow: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 120, 106, 0.4) transparent;
}

.body::-webkit-scrollbar {
  width: 8px;
}

.body::-webkit-scrollbar-track {
  background: transparent;
}

.body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(196, 120, 106, 0.5), rgba(92, 36, 40, 0.4));
  border-radius: 999px;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px 28px;
  min-height: 100%;
}

.bubble {
  max-width: min(720px, 92%);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.bubble--user {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
}

.bubble--assistant {
  align-self: flex-start;
}

.bubble.is-streaming .bubble__text::after {
  content: "▍";
  animation: blink 1s steps(1) infinite;
  color: var(--text-3);
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.bubble__role {
  font-family: var(--code);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--mono);
  margin-bottom: 6px;
}

.bubble__text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  font-size: 14px;
  color: var(--text);
}

.login-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(208, 144, 144, 0.45);
  background: rgba(80, 24, 24, 0.35);
  color: #f0c8c8;
  font-size: 13px;
}

.chat-error {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(208, 144, 144, 0.45);
  background: rgba(80, 24, 24, 0.35);
  color: #f0c8c8;
  font-size: 13px;
  line-height: 1.45;
}

.user-role {
  font-variant-numeric: tabular-nums;
}

.mode button.is-muted {
  opacity: 0.45;
}

.online.is-warn {
  color: var(--warn);
}

.online.is-warn i {
  background: var(--warn);
}

.empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 32px;
}

.empty.center {
  align-items: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  font-family: var(--code);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--mono);
}

.empty h2 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.empty h2.display {
  font-family: var(--display);
  font-size: 34px;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.empty p {
  margin: 0;
  max-width: 420px;
  color: var(--text-2);
  line-height: 1.55;
  font-size: 15px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 24px;
}

.chips button,
.card {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 13px;
}

.chips button {
  height: 34px;
  padding: 0 14px;
}

.chips button:hover,
.card:hover {
  border-color: var(--border-strong);
  color: var(--accent-bright);
  background: var(--accent-dim);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 20px;
  max-width: 860px;
}

.card {
  border-radius: 10px;
  padding: 14px;
  text-align: left;
  display: grid;
  gap: 8px;
}

.card strong {
  font-size: 14px;
  color: var(--text);
}

.card span {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.45;
}

.list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  max-width: 520px;
  display: grid;
  gap: 8px;
}

.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.list strong {
  display: block;
  font-size: 14px;
}

.list span {
  font-size: 12px;
  color: var(--text-3);
}

.list em {
  font-style: normal;
  font-family: var(--code);
  font-size: 11px;
  color: var(--accent);
}

.ph {
  margin-top: 20px;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-3);
  font-size: 13px;
  max-width: 420px;
}

.ph a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project {
  padding: 28px 30px;
}

.project-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.project-head h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 28px;
}

.project-head p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

.cta {
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  white-space: nowrap;
}

.cta:hover {
  background: #e8e8e8;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 120px));
  gap: 10px;
  margin-bottom: 22px;
}

.stats div {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.stats em {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 4px;
}

.stats strong {
  font-size: 24px;
}

.stats .warn {
  color: var(--warn);
}

.board h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.board ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-width: 640px;
}

.board li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.board strong {
  display: block;
  font-size: 14px;
  margin-bottom: 3px;
}

.board span {
  font-size: 12px;
  color: var(--text-3);
}

.board i {
  font-style: normal;
  font-family: var(--code);
  font-size: 11px;
  color: var(--danger);
  border: 1px solid rgba(208, 144, 144, 0.35);
  padding: 3px 8px;
  border-radius: 999px;
}

.composer {
  padding: 0 14px 14px;
}

.composer-box {
  border: 1px solid var(--border);
  background: var(--input);
  border-radius: var(--radius);
  padding: 10px 12px 12px;
}

.composer-box:focus-within {
  border-color: var(--border-strong);
}

.composer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.icon-btn,
.agent-btn {
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
}

.icon-btn {
  width: 30px;
  font-size: 18px;
}

.agent-btn {
  padding: 0 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
}

.agent-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  min-width: 240px;
  max-width: 320px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.agent-menu__label {
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 8px;
}

.agent-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  max-height: 240px;
  overflow: auto;
}

.agent-menu__list button {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.agent-menu__list button span {
  font-size: 11px;
  color: var(--text-2);
}

.agent-menu__list button.is-active,
.agent-menu__list button:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
}

.agent-menu__actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.expert-card {
  display: grid;
  gap: 8px;
  text-align: left;
}

.expert-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-pick {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-size: 13px;
  color: var(--text-2);
  max-width: 320px;
}

.agent-pick select {
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
}

.mode {
  margin-left: auto;
  display: flex;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
}

.mode button {
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.mode button.is-active {
  background: var(--accent-dim);
  color: var(--accent-bright);
}

.composer textarea {
  width: 100%;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  min-height: 52px;
  line-height: 1.5;
  font-size: 14.5px;
}

.composer textarea::placeholder {
  color: var(--text-3);
}

.composer-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
}

.composer-foot__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.linkish {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: 6px;
  font-size: 12px;
  padding: 0;
}

.ghost.sm {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-2);
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
}

.modal[hidden] {
  display: none !important;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.report-view {
  margin-top: 16px;
  padding: 14px;
  max-height: 420px;
  overflow: auto;
  text-align: left;
  white-space: pre-wrap;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

#bind-project {
  max-width: 160px;
  height: 32px;
  font-size: 12px;
}

.channel-row .is-active {
  border-color: var(--brand);
  color: var(--text);
}


.modal__panel {
  width: min(480px, 100%);
  max-height: 80vh;
  overflow: auto;
  border-radius: var(--radius);
  padding: 18px;
}

.modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.modal__head h2 {
  margin: 0;
  font-size: 18px;
}

.pack-grid {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
}

.pack {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  text-align: left;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.pack em {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-style: normal;
  align-self: center;
  font-weight: 600;
}

.subhead {
  margin: 0 0 8px;
  font-size: 14px;
}

.passwd-form,
.create-project {
  display: grid;
  gap: 10px;
  max-width: 420px;
  margin-top: 12px;
}

.passwd-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}

.passwd-form input,
.passwd-form select,
.create-project input,
.project-switch,
#tenant-switch {
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
}

.org-panel {
  text-align: left;
  max-width: 520px;
  margin: 0 auto 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.org-panel h3 {
  margin: 12px 0 6px;
  font-size: 15px;
}

/* —— Settings 页壳（身份 / 模型 API） —— */
.settings-page {
  text-align: left;
  max-width: 840px;
  margin: 0 auto;
  padding: 12px 8px 40px;
  display: grid;
  gap: 14px;
}

.settings-head {
  margin-bottom: 4px;
}

.settings-head h2 {
  margin: 4px 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.settings-head .muted {
  margin: 0;
  max-width: 560px;
  line-height: 1.55;
  font-size: 13.5px;
}

.settings-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  color: var(--text-2);
}

.settings-status strong {
  color: var(--text);
  font-weight: 600;
}

.settings-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: rgba(0, 0, 0, 0.25);
}

.settings-badge--ok {
  border-color: rgba(196, 120, 106, 0.35);
  color: #e8c4bc;
  background: rgba(92, 36, 40, 0.35);
}

.settings-badge--warn {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text-3);
}

.settings-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  padding: 16px 18px 18px;
}

.settings-card__title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.settings-card__desc {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.5;
}

.settings-form {
  display: grid;
  gap: 12px;
  max-width: none;
  margin: 0;
}

.settings-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}

.settings-form input,
.settings-form select,
.settings-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
  font: inherit;
}

.settings-form input,
.settings-form select {
  height: 38px;
  padding: 0 12px;
}

.settings-form textarea {
  min-height: 120px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}

.settings-form input:focus,
.settings-form select:focus,
.settings-form textarea:focus {
  outline: none;
  border-color: rgba(196, 120, 106, 0.45);
}

.settings-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.settings-actions--spread {
  justify-content: space-between;
}

.settings-actions .settings-actions__left {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-actions .settings-actions__right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.settings-table th,
.settings-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.settings-table th {
  color: var(--text-3);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.settings-table tr:last-child td {
  border-bottom: none;
}

.settings-table strong {
  color: var(--text);
  font-weight: 600;
}

.settings-fold {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0;
  overflow: hidden;
}

.settings-fold > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}

.settings-fold > summary::-webkit-details-marker {
  display: none;
}

.settings-fold > summary::after {
  content: "展开";
  float: right;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}

.settings-fold[open] > summary::after {
  content: "收起";
}

.settings-fold__body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 16px;
  padding-top: 14px;
}

.settings-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
}

.settings-toolbar label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  flex: 1 1 140px;
  min-width: 120px;
}

.settings-toolbar label.check-row {
  flex: 0 0 auto;
  align-self: center;
  padding-top: 18px;
}

.settings-toolbar input,
.settings-toolbar select {
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
  font: inherit;
}

.settings-toolbar .btn-primary {
  flex: 0 0 auto;
  margin-bottom: 1px;
}

.id-file-tabs--primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.id-file-more {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.id-file-more .id-file-tab {
  opacity: 0.72;
  font-size: 11px;
}

.identity-panel {
  text-align: left;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 4px 32px;
}

.identity-panel h2 {
  margin: 4px 0 8px;
}

.model-api-panel code,
.settings-page code {
  font-size: 12px;
  color: var(--text-2);
}

.identity-quick {
  margin: 16px 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 640px) {
  .settings-grid-2 {
    grid-template-columns: 1fr;
  }
  .id-file-more {
    margin-left: 0;
    width: 100%;
  }
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  grid-template-columns: none !important;
}

.check-row input {
  width: 16px;
  height: 16px;
}

.id-file-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.id-file-tab {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
}

.id-file-tab.is-active {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.identity-editor {
  display: grid;
  gap: 12px;
}

.identity-editor label.full {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}

.identity-editor textarea {
  width: 100%;
  min-height: 320px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  resize: vertical;
}

.id-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.org-manage .list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.board li.is-done strong {
  text-decoration: line-through;
  color: var(--text-3);
}

.board li label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex: 1;
}

.err {
  color: var(--danger);
  font-size: 13px;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
}
