:root {
  --page-width: 1180px;
  --header-height: 64px;
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

/* 明暗层：负责背景、表面、文字、边框和业务状态。 */
html[data-mode="light"] {
  color-scheme: light;
  --bg-page: #F4F6F3;
  --bg-surface: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-subtle: #EBF0ED;
  --bg-hover: #E6ECE8;
  --bg-active: #DFE8E3;
  --text-primary: #202824;
  --text-secondary: #626D67;
  --text-tertiary: #8D9791;
  --text-disabled: #B4BCB7;
  --text-on-brand: #FFFFFF;
  --border-default: #DEE4E0;
  --border-strong: #C8D1CC;
  --success-text: #356A4A;
  --success-bg: #E5F0E9;
  --success-border: #C9DFD0;
  --warning-text: #845B28;
  --warning-bg: #F5ECDD;
  --warning-border: #E7D4B6;
  --danger-text: #964B43;
  --danger-bg: #F6E6E3;
  --danger-border: #E9C8C3;
  --overlay: rgba(25, 33, 29, .38);
  --shadow-card: 0 1px 2px rgba(28, 40, 34, .04), 0 6px 18px rgba(28, 40, 34, .035);
  --shadow-popover: 0 10px 32px rgba(28, 40, 34, .12);
  --shadow-dialog: 0 20px 60px rgba(28, 40, 34, .16);
}

html[data-mode="dark"] {
  color-scheme: dark;
  --bg-page: #111613;
  --bg-surface: #171E1A;
  --bg-elevated: #1C2520;
  --bg-subtle: #222D27;
  --bg-hover: #29362F;
  --bg-active: #304039;
  --text-primary: #E7ECE9;
  --text-secondary: #A7B1AB;
  --text-tertiary: #77827C;
  --text-disabled: #59635D;
  --text-on-brand: #142019;
  --border-default: #29352E;
  --border-strong: #3B4A41;
  --success-text: #93C9A6;
  --success-bg: #1D3526;
  --success-border: #31543D;
  --warning-text: #D9B078;
  --warning-bg: #3A2D1B;
  --warning-border: #5A4528;
  --danger-text: #E0A39B;
  --danger-bg: #3D2522;
  --danger-border: #623B36;
  --overlay: rgba(0, 0, 0, .6);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .2), 0 8px 24px rgba(0, 0, 0, .14);
  --shadow-popover: 0 14px 38px rgba(0, 0, 0, .36);
  --shadow-dialog: 0 24px 68px rgba(0, 0, 0, .48);
}

/* 风格层：只负责小面积品牌色和聚焦态。 */
html[data-style="mist"][data-mode="light"] {
  --brand-primary: #42675D;
  --brand-hover: #36584F;
  --brand-active: #2D4942;
  --brand-soft: #E2ECE7;
  --brand-soft-hover: #D8E6DF;
  --border-focus: #6F9187;
  --focus-ring: rgba(66, 103, 93, .18);
}

html[data-style="tea"][data-mode="light"] {
  --bg-page: #F6F3EE;
  --bg-surface: #FFFDFC;
  --bg-subtle: #F0E9E0;
  --bg-hover: #EAE1D7;
  --bg-active: #E5D9CD;
  --text-primary: #2D2925;
  --text-secondary: #70665E;
  --text-tertiary: #998F87;
  --border-default: #E5DDD4;
  --border-strong: #D2C6BA;
  --brand-primary: #80634F;
  --brand-hover: #6C5242;
  --brand-active: #594337;
  --brand-soft: #EEE3D9;
  --brand-soft-hover: #E7D8CB;
  --border-focus: #A68A75;
  --focus-ring: rgba(128, 99, 79, .18);
  --overlay: rgba(40, 32, 27, .38);
  --shadow-card: 0 1px 2px rgba(47, 37, 30, .04), 0 6px 18px rgba(47, 37, 30, .035);
  --shadow-popover: 0 10px 32px rgba(47, 37, 30, .12);
  --shadow-dialog: 0 20px 60px rgba(47, 37, 30, .16);
}

html[data-style="mist"][data-mode="dark"] {
  --brand-primary: #A3C8B6;
  --brand-hover: #B5D4C4;
  --brand-active: #C4DECF;
  --brand-soft: #213B30;
  --brand-soft-hover: #29483B;
  --border-focus: #7FA897;
  --focus-ring: rgba(163, 200, 182, .24);
}

html[data-style="tea"][data-mode="dark"] {
  --bg-page: #171411;
  --bg-surface: #1E1A17;
  --bg-elevated: #251F1B;
  --bg-subtle: #2C2520;
  --bg-hover: #342B25;
  --bg-active: #3D312A;
  --text-primary: #EEE9E4;
  --text-secondary: #B8ACA2;
  --text-tertiary: #867B72;
  --text-disabled: #655D57;
  --border-default: #39302A;
  --border-strong: #4D4037;
  --brand-primary: #D2AF92;
  --brand-hover: #DFC0A6;
  --brand-active: #E8CDB8;
  --brand-soft: #3A2C23;
  --brand-soft-hover: #48372B;
  --border-focus: #B28D70;
  --focus-ring: rgba(210, 175, 146, .24);
  --success-bg: #253426;
  --warning-bg: #3C2E1D;
  --danger-bg: #402724;
  --overlay: rgba(9, 7, 5, .64);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--text-primary);
  font: 14px/1.6 Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color .16s ease, color .16s ease;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .62; }
input, textarea, select { color: var(--text-primary); }
svg { display: block; flex: 0 0 auto; }
.hidden { display: none !important; }
.link-reset { border: 0; padding: 0; color: inherit; background: transparent; text-align: inherit; }

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  border-bottom: 1px solid var(--border-default);
  background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
  backdrop-filter: blur(12px);
}
.header-inner {
  width: min(var(--page-width), calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  min-width: 166px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-primary);
  color: var(--text-on-brand);
  font-size: 15px;
  font-weight: 700;
}
.brand-copy { display: grid; line-height: 1.25; }
.brand-copy strong { font-size: 15px; }
.brand-copy small { color: var(--text-tertiary); font-size: 11px; font-weight: 400; }
.desktop-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-button {
  height: 38px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
}
.nav-button:hover { background: var(--bg-subtle); color: var(--text-primary); }
.nav-button.active { background: var(--brand-soft); color: var(--brand-primary); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 8px; }

.primary-button, .secondary-button, .ghost-button, .text-button, .small-primary, .icon-text-button, .icon-button, .avatar-button {
  border-radius: var(--radius-md);
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.primary-button, .secondary-button, .ghost-button {
  min-height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
}
.primary-button { border: 1px solid transparent; background: var(--brand-primary); color: var(--text-on-brand); }
.primary-button:hover:not(:disabled) { background: var(--brand-hover); transform: translateY(-1px); }
.primary-button:active:not(:disabled) { background: var(--brand-active); transform: none; }
.secondary-button { border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); }
.secondary-button:hover:not(:disabled) { border-color: var(--border-strong); background: var(--bg-hover); }
.ghost-button { border: 1px solid transparent; background: transparent; color: var(--text-secondary); }
.ghost-button:hover:not(:disabled) { background: var(--bg-subtle); color: var(--text-primary); }
.compact { min-height: 34px; padding: 0 11px; font-size: 13px; }
.full-button { width: 100%; margin-top: 16px; }
.icon-button, .avatar-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
}
.icon-button:hover { border-color: var(--border-strong); color: var(--text-primary); background: var(--bg-hover); }
.avatar-button { border-radius: 50%; background: var(--brand-soft); color: var(--brand-primary); font-weight: 700; }
.avatar-button:hover { border-color: var(--border-strong); background: var(--brand-soft-hover); }
.text-button {
  min-height: 34px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--brand-primary);
  font-weight: 600;
}
.text-button:hover { color: var(--brand-hover); }
.inline-link { margin-top: 8px; align-self: flex-start; }

.page-container {
  width: min(var(--page-width), calc(100% - 40px));
  min-height: calc(100vh - var(--header-height));
  margin: 0 auto;
  padding: 32px 0 64px;
}
.hero-card {
  min-height: 214px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: center;
  gap: 36px;
  padding: 34px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
}
.eyebrow { display: block; margin-bottom: 8px; color: var(--brand-primary); font-size: 13px; font-weight: 700; }
.hero-copy h1, .page-heading h1 { margin: 0; font-size: 30px; line-height: 1.25; letter-spacing: -.02em; font-weight: 650; }
.hero-copy p { max-width: 630px; margin: 11px 0 22px; color: var(--text-secondary); font-size: 15px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-metrics {
  padding: 18px 20px;
  border: 1px solid var(--border-default);
  border-radius: 14px;
  background: var(--bg-subtle);
}
.hero-metrics div { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 0; color: var(--text-secondary); }
.hero-metrics div + div { border-top: 1px solid var(--border-default); }
.hero-metrics strong { color: var(--text-primary); font-size: 19px; }

.section-block { margin-top: 30px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.section-heading h1, .section-heading h2 { margin: 0; line-height: 1.35; }
.section-heading h2 { font-size: 20px; }
.section-heading p { margin: 4px 0 0; color: var(--text-secondary); }
.page-heading { margin-bottom: 20px; }
.page-heading h1 { font-size: 26px; }

.toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 12px; margin-bottom: 12px; }
.search-field {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text-tertiary);
}
.search-field:focus-within { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; }
.search-field input::placeholder { color: var(--text-tertiary); }
.filter-row { display: flex; gap: 8px; margin-bottom: 15px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
}
.filter-chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.filter-chip.active { border-color: transparent; background: var(--brand-soft); color: var(--brand-primary); font-weight: 600; }

.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.team-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background-color .16s ease;
}
.team-card:hover { border-color: var(--border-strong); background: var(--bg-elevated); box-shadow: var(--shadow-card); transform: translateY(-1px); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.category-label { color: var(--brand-primary); font-size: 12px; font-weight: 700; }
.status-badge { display: inline-flex; align-items: center; height: 25px; padding: 0 8px; border: 1px solid; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-badge.recruiting { color: var(--success-text); background: var(--success-bg); border-color: var(--success-border); }
.status-badge.urgent { color: var(--warning-text); background: var(--warning-bg); border-color: var(--warning-border); }
.status-badge.closed { color: var(--text-tertiary); background: var(--bg-subtle); border-color: var(--border-default); }
.card-title { width: 100%; margin: 11px 0 7px; border-radius: 6px; font-size: 17px; line-height: 1.45; font-weight: 650; }
.card-title:hover { color: var(--brand-primary); }
.card-description { min-height: 45px; margin: 0; color: var(--text-secondary); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.meta-row { display: flex; flex-wrap: wrap; gap: 10px 15px; margin-top: 14px; color: var(--text-tertiary); font-size: 12.5px; }
.meta-row span { display: inline-flex; align-items: center; gap: 5px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.plain-tag { display: inline-flex; align-items: center; min-height: 27px; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--bg-subtle); color: var(--text-secondary); font-size: 12px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--border-default); }
.person-line { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 12.5px; }
.mini-avatar, .profile-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-primary);
  font-weight: 700;
}
.mini-avatar { width: 28px; height: 28px; }
.mini-avatar.large { width: 42px; height: 42px; font-size: 15px; }
.card-actions { display: flex; align-items: center; gap: 7px; }
.icon-text-button {
  min-height: 32px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
}
.icon-text-button:hover, .icon-text-button.active { color: var(--brand-primary); background: var(--brand-soft); }
.small-primary { height: 32px; padding: 0 10px; border: 1px solid transparent; background: var(--brand-primary); color: var(--text-on-brand); font-size: 12.5px; font-weight: 600; }
.small-primary:hover { background: var(--brand-hover); }

.panel, .conversation-panel, .chat-panel {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}
.panel { padding: 20px; }
.panel h3 { margin: 0; font-size: 16px; }
.panel-description { margin: 6px 0 16px; color: var(--text-secondary); }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.split-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.sticky-panel { position: sticky; top: calc(var(--header-height) + 20px); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.interest-tag {
  min-height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
}
.interest-tag:hover { border-color: var(--border-strong); color: var(--text-primary); }
.interest-tag.selected { border-color: transparent; background: var(--brand-soft); color: var(--brand-primary); font-weight: 600; }
.interest-tag.static { cursor: default; }
.selected-list { min-height: 42px; }
.interest-group { margin-top: 20px; }
.interest-group h4 { margin: 0 0 9px; color: var(--text-tertiary); font-size: 12px; font-weight: 600; }
.progress-label { display: flex; justify-content: space-between; margin-top: 22px; color: var(--text-secondary); font-size: 12px; }
.progress-label strong { color: var(--text-primary); }
.progress-track { height: 7px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: var(--bg-subtle); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--brand-primary); }
.helper-text, .field small { color: var(--text-tertiary); font-size: 12px; }
.muted-text { color: var(--text-tertiary); }

.field { display: grid; gap: 7px; margin-top: 14px; }
.field:first-child { margin-top: 0; }
.field > span { color: var(--text-primary); font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea, .chat-compose input {
  width: 100%;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  outline: 0;
}
.field input, .field select { height: 40px; padding: 0 11px; }
.field textarea { min-height: 100px; padding: 10px 11px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .chat-compose input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.field.full { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.checkbox-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-tags input { position: absolute; opacity: 0; pointer-events: none; }
.checkbox-tags span { display: inline-flex; min-height: 34px; align-items: center; padding: 0 11px; border: 1px solid var(--border-default); border-radius: var(--radius-md); color: var(--text-secondary); cursor: pointer; }
.checkbox-tags input:checked + span { border-color: transparent; background: var(--brand-soft); color: var(--brand-primary); font-weight: 600; }
.checkbox-tags input:focus-visible + span { box-shadow: 0 0 0 3px var(--focus-ring); }

.match-card { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 0; }
.match-card + .match-card { border-top: 1px solid var(--border-default); }
.profile-avatar.small { width: 52px; height: 52px; font-size: 18px; }
.match-copy h4 { margin: 0 0 3px; font-size: 15px; }
.match-copy p { margin: 0; color: var(--text-secondary); font-size: 13px; }
.match-score { margin-left: 5px; color: var(--brand-primary); font-size: 12px; font-weight: 700; }
.match-actions { display: flex; gap: 7px; }

.tabs { display: flex; gap: 5px; margin-bottom: 8px; overflow-x: auto; }
.tab-button { flex: 0 0 auto; height: 36px; padding: 0 12px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-secondary); }
.tab-button:hover { background: var(--bg-subtle); color: var(--text-primary); }
.tab-button.active { background: var(--brand-soft); color: var(--brand-primary); font-weight: 600; }
.list-item { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; }
.list-item + .list-item { border-top: 1px solid var(--border-default); }
.list-item h3 { margin: 0 0 3px; font-size: 15px; }
.list-item p { margin: 0; color: var(--text-secondary); font-size: 13px; }
.list-actions { display: flex; align-items: center; gap: 7px; }

.message-layout { min-height: 580px; display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 16px; }
.conversation-panel { overflow: hidden; align-self: stretch; }
.conversation-item {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}
.conversation-item:hover { background: var(--bg-subtle); }
.conversation-item.active { background: var(--brand-soft); }
.conversation-copy { min-width: 0; display: grid; }
.conversation-copy strong, .conversation-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy small { color: var(--text-tertiary); }
.conversation-meta { align-self: stretch; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.conversation-meta small { color: var(--text-tertiary); font-size: 11px; }
.conversation-meta b { min-width: 19px; height: 19px; display: grid; place-items: center; border-radius: 999px; background: var(--brand-primary); color: var(--text-on-brand); font-size: 10px; }
.chat-panel { min-width: 0; min-height: 580px; display: flex; flex-direction: column; overflow: hidden; }
.chat-header { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border-default); }
.chat-header div { display: grid; }
.chat-header small { color: var(--text-tertiary); }
.online-indicator { color: var(--text-tertiary); font-size: 12px; }
.online-indicator.online { color: var(--success-text); }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; background: color-mix(in srgb, var(--bg-subtle) 38%, var(--bg-surface)); }
.message-row { display: flex; margin: 9px 0; }
.message-row.mine { justify-content: flex-end; }
.message-bubble { max-width: min(72%, 540px); padding: 9px 12px 7px; border: 1px solid var(--border-default); border-radius: 12px 12px 12px 4px; background: var(--bg-surface); box-shadow: 0 1px 2px rgba(0,0,0,.025); }
.message-row.mine .message-bubble { border-color: transparent; border-radius: 12px 12px 4px 12px; background: var(--brand-soft); color: var(--brand-primary); }
.message-bubble small { display: block; margin-top: 3px; color: var(--text-tertiary); font-size: 10px; text-align: right; }
.chat-compose { display: flex; gap: 9px; padding: 13px; border-top: 1px solid var(--border-default); }
.chat-compose input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; }

.profile-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-summary { position: sticky; top: calc(var(--header-height) + 20px); text-align: center; }
.profile-avatar { width: 88px; height: 88px; margin: 2px auto 12px; font-size: 28px; }
.profile-summary h2 { margin: 0; font-size: 20px; }
.profile-summary > p { margin: 4px 0; color: var(--text-secondary); }
.centered { justify-content: center; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 20px; }
.profile-stats div { padding: 10px 5px; border-radius: 10px; background: var(--bg-subtle); }
.profile-stats strong { display: block; font-size: 17px; }
.profile-stats span { display: block; color: var(--text-tertiary); font-size: 11px; }

.menu {
  position: fixed;
  z-index: 70;
  top: 58px;
  right: max(20px, calc((100vw - var(--page-width)) / 2));
  width: 220px;
  padding: 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-popover);
}
.menu-profile { display: grid; grid-template-columns: 42px 1fr; gap: 10px; align-items: center; padding: 8px 9px; }
.menu-profile > span:last-child { min-width: 0; display: grid; }
.menu-profile small { overflow: hidden; color: var(--text-tertiary); text-overflow: ellipsis; white-space: nowrap; }
.menu-divider { height: 1px; margin: 5px 2px; background: var(--border-default); }
.menu-label { padding: 6px 10px 4px; color: var(--text-tertiary); font-size: 11px; }
.menu-item {
  width: 100%;
  height: 39px;
  display: grid;
  grid-template-columns: 19px 1fr 19px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
}
.menu-item:hover { background: var(--bg-subtle); color: var(--text-primary); }
.menu-item.active { background: var(--brand-soft); color: var(--brand-primary); font-weight: 600; }
.theme-swatch { width: 15px; height: 15px; border: 1px solid var(--border-default); border-radius: 50%; }
.theme-swatch.mist { background: #62847A; }
.theme-swatch.tea { background: #9A7861; }
.theme-check { display: grid; place-items: center; }
.muted-menu-item { color: var(--text-tertiary); }

.modal-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: var(--overlay); }
.modal { width: min(680px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border: 1px solid var(--border-default); border-radius: var(--radius-xl); background: var(--bg-elevated); box-shadow: var(--shadow-dialog); }
.modal-header, .modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; }
.modal-header { border-bottom: 1px solid var(--border-default); }
.modal-header > div { min-width: 0; }
.modal-header h2 { margin: 2px 0 0; font-size: 19px; line-height: 1.4; }
.modal-header p { margin: 2px 0 0; color: var(--text-secondary); }
.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid var(--border-default); justify-content: flex-end; }
.detail-status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-description { margin: 16px 0; color: var(--text-secondary); font-size: 15px; }
.detail-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.detail-facts > div { min-width: 0; display: flex; align-items: flex-start; gap: 9px; padding: 12px; border: 1px solid var(--border-default); border-radius: 10px; background: var(--bg-subtle); color: var(--brand-primary); }
.detail-facts span { min-width: 0; display: grid; color: var(--text-primary); }
.detail-facts small { color: var(--text-tertiary); }
.detail-facts strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.detail-section { margin-top: 20px; }
.detail-section h3 { margin: 0 0 7px; font-size: 15px; }
.detail-section p { margin: 0; color: var(--text-secondary); }
.person-card { display: flex; align-items: center; gap: 10px; }
.person-card > span:last-child { display: grid; }
.person-card small { color: var(--text-tertiary); }
.person-profile { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--border-default); border-radius: 12px; background: var(--bg-subtle); }
.person-profile h3 { margin: 0; font-size: 17px; }
.person-profile p { margin: 3px 0 0; color: var(--text-secondary); }
.compact-stats { margin-top: 22px; }

.empty-state { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; color: var(--text-secondary); text-align: center; }
.empty-state.wide { grid-column: 1 / -1; border: 1px dashed var(--border-default); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--bg-surface) 65%, transparent); }
.empty-state strong { margin-top: 8px; color: var(--text-primary); }
.empty-state p { margin: 3px 0 0; }
.empty-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--bg-subtle); color: var(--brand-primary); }
.spinner .icon, .spin { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.app-loading, .fatal-error { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 24px; color: var(--text-secondary); text-align: center; }
.app-loading strong, .fatal-error h1 { color: var(--text-primary); }
.fatal-error h1 { margin: 0; font-size: 24px; }
.fatal-error p { max-width: 560px; margin: 0; }
.fatal-error small { margin-top: 8px; color: var(--text-tertiary); }
.toast { position: fixed; right: 20px; bottom: 78px; z-index: 110; max-width: min(360px, calc(100vw - 40px)); padding: 11px 14px; border: 1px solid var(--border-default); border-radius: 10px; background: var(--bg-elevated); color: var(--text-primary); box-shadow: var(--shadow-popover); }
.toast-error { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger-text); }

.mode-toggle {
  position: fixed;
  z-index: 65;
  right: 20px;
  bottom: 20px;
  min-width: 46px;
  height: 42px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border-default);
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
  color: var(--text-secondary);
  box-shadow: var(--shadow-popover);
  backdrop-filter: blur(10px);
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.mode-toggle:hover { color: var(--text-primary); border-color: var(--border-strong); transform: translateY(-1px); }
.mode-toggle span { font-size: 12px; font-weight: 600; }

.mobile-nav { display: none; }

@media (max-width: 1000px) {
  .desktop-nav { display: none; }
  .brand { flex: 1; }
  .team-grid { grid-template-columns: 1fr; }
  .message-layout { grid-template-columns: 280px minmax(0, 1fr); }
}

@media (max-width: 760px) {
  :root { --header-height: 60px; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .header-inner, .page-container { width: min(100% - 24px, var(--page-width)); }
  .page-container { padding: 22px 0 36px; }
  .desktop-only { display: none; }
  .brand-copy small { display: none; }
  .brand { min-width: 0; }
  .hero-card { grid-template-columns: 1fr; gap: 22px; padding: 24px; }
  .hero-copy h1 { font-size: 26px; }
  .hero-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 12px; }
  .hero-metrics div { flex-direction: column; align-items: center; justify-content: center; padding: 8px 3px; text-align: center; }
  .hero-metrics div + div { border-top: 0; border-left: 1px solid var(--border-default); }
  .hero-metrics span { font-size: 11px; }
  .hero-metrics strong { font-size: 18px; }
  .section-heading { align-items: flex-start; }
  .section-heading p { font-size: 13px; }
  .toolbar { grid-template-columns: 1fr auto; }
  .split-layout, .profile-layout, .message-layout { grid-template-columns: 1fr; }
  .sticky-panel, .profile-summary { position: static; }
  .message-layout { gap: 12px; }
  .conversation-panel { max-height: 280px; overflow-y: auto; }
  .chat-panel { min-height: 500px; }
  .match-card { grid-template-columns: 48px minmax(0, 1fr); }
  .match-actions { grid-column: 2; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .detail-facts { grid-template-columns: 1fr; }
  .menu { top: 55px; right: 12px; }
  .mode-toggle { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 42px; min-width: 42px; padding: 0; }
  .mode-toggle span { display: none; }
  .toast { right: 12px; bottom: calc(128px + env(safe-area-inset-bottom)); }
  .mobile-nav {
    position: fixed;
    z-index: 60;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 5px max(8px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--border-default);
    background: color-mix(in srgb, var(--bg-surface) 95%, transparent);
    backdrop-filter: blur(12px);
  }
  .mobile-nav-item { min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 9px; background: transparent; color: var(--text-tertiary); font-size: 11px; }
  .mobile-nav-item.active { background: var(--brand-soft); color: var(--brand-primary); }
  .mobile-primary { color: var(--brand-primary); }
}

@media (max-width: 520px) {
  .page-container { width: calc(100% - 24px); }
  .header-inner { width: calc(100% - 20px); gap: 10px; }
  .hero-card { padding: 21px; }
  .hero-actions > * { flex: 1; }
  .section-heading { gap: 10px; }
  .section-heading > button { flex: 0 0 auto; }
  .page-heading { flex-direction: column; }
  .page-heading > button { width: 100%; }
  .toolbar { grid-template-columns: 1fr; }
  .toolbar .secondary-button { width: 100%; }
  .card-footer { align-items: flex-start; flex-direction: column; }
  .card-actions { width: 100%; justify-content: flex-end; }
  .person-line { width: 100%; }
  .list-item { align-items: flex-start; flex-direction: column; }
  .list-actions { width: 100%; justify-content: flex-end; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: calc(100vh - 16px); border-radius: 16px 16px 0 0; }
  .modal-footer > * { flex: 1; }
  .message-bubble { max-width: 86%; }
  .chat-compose { padding: 10px; }
  .chat-compose .primary-button span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ───── 音乐播放条 ───── */
.music-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 44px;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
  z-index: 100;
}
.music-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  max-width: 300px;
}
.music-icon { color: var(--c-brand); flex-shrink: 0; display: flex; }
.music-title { font-size: 13px; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-controls { display: flex; align-items: center; gap: 4px; }
.music-controls .icon-button { opacity: .7; transition: opacity .15s; }
.music-controls .icon-button:hover { opacity: 1; }
.play-btn { opacity: 1 !important; }
@media (min-width: 640px) {
  .music-bar { justify-content: center; gap: 16px; }
  .music-info { flex: none; }
}
