:root {
  --primary:#0969cf; --soft:#eaf5ff; --bg:#f5f8fc; --text:#172b43;
  --muted:#52667d; --line:#dce6f0; --surface:#fff;
}
* {box-sizing:border-box}
[hidden] {display:none!important}
body {margin:0;background:var(--bg);color:var(--text);font:15px/1.6 system-ui,-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;min-height:100vh}
a {color:var(--primary);text-underline-offset:.17em}
button,input,select,textarea {font:inherit}
button,summary,select {cursor:pointer}
:focus-visible {outline:2px solid var(--primary);outline-offset:3px}
h1,h2,h3,p {margin:0}

.site-header {background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:40}
.nav {max-width:1160px;margin:auto;padding:10px 24px;display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.logo {font-weight:800;text-decoration:none;color:var(--text);font-size:1.13rem}
.logo i {color:var(--primary);margin-right:8px}
.nav-links {display:flex;gap:4px 10px;align-items:center;flex-wrap:wrap}
.nav-links a {color:var(--muted);text-decoration:none;padding:7px 10px;border-radius:8px;font-size:.88rem}
.nav-links a.active {color:var(--primary);background:var(--soft);font-weight:700}

.team-page {max-width:960px;margin:auto;padding:28px 24px 36px}
.page-heading,.feed-heading,.publish-head,.utility-head {display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.page-heading {margin-bottom:16px}
.page-heading h1 {font-size:clamp(1.5rem,4vw,2rem);line-height:1.25}
.page-sub {color:var(--muted);font-size:.88rem;margin-top:3px}
.page-actions {display:flex;align-items:center;flex-wrap:wrap;gap:8px}

.panel,.team-page .live-card {background:var(--surface);border:1px solid var(--line);border-radius:14px}
.chat-button,.secondary-button,.tag-custom-add {display:inline-flex;justify-content:center;align-items:center;min-height:38px;padding:6px 14px;border:1px solid transparent;border-radius:9px;font-weight:650;font-size:.86rem;white-space:nowrap;transition:background .15s,border-color .15s}
.chat-button {background:var(--primary);color:#fff}
.chat-button:hover {background:#0758b2}
.secondary-button,.tag-custom-add {background:#fff;border-color:var(--line);color:var(--text)}
.secondary-button:hover,.tag-custom-add:hover {border-color:#a8c5e3;background:#f7fbff;color:var(--primary)}
.action-toggle[aria-expanded="true"] {background:var(--soft);border-color:#93c5fd;color:var(--primary)}
.action-toggle.has-unread {border-color:#fca5a5;background:#fef2f2;color:#b91c1c}
.compact-btn {min-height:32px;padding:4px 10px;font-size:.8rem}
button:disabled {opacity:.55;cursor:default}

.utility-panel {margin-bottom:14px;padding:14px 16px}
.utility-head {margin-bottom:10px}
.utility-head h2 {font-size:.98rem}
.text-close {border:0;background:none;color:var(--muted);font-size:.82rem;padding:4px 6px}
.text-close:hover {color:var(--text)}

.contest-bar {padding:14px 16px;margin-bottom:18px}
.contest-pills {display:flex;flex-wrap:wrap;gap:7px}
.contest-pill {display:inline-flex;align-items:center;gap:5px;padding:6px 12px;border-radius:999px;border:1px solid var(--line);background:#fff;color:var(--muted);font-size:.84rem;font-weight:550;transition:background .15s,border-color .15s,color .15s}
.contest-pill:hover {border-color:#93c5fd;color:var(--primary);background:#f7fbff}
.contest-pill[aria-pressed="true"] {background:var(--primary);border-color:var(--primary);color:#fff;font-weight:650}
.pill-count {font-size:.74rem;padding:0 5px;border-radius:999px;background:#eaf2fa;color:var(--muted)}
.contest-pill[aria-pressed="true"] .pill-count {background:#ffffff30;color:#fff}

.filter-bar {display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap;margin-top:10px;padding-top:10px;border-top:1px solid #eef3f8}
.more-filters {flex:1;min-width:200px}
summary {width:fit-content;color:var(--muted);padding:4px 2px;font-weight:600;font-size:.84rem}
summary:hover {color:var(--primary)}
.filter-fields {display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin-top:8px}
.search-field {min-width:140px}
.search-field label {display:block;font-weight:650;font-size:.82rem;margin-bottom:4px;color:var(--muted)}
.search-field input,.search-field select,.team-add input,.tag-custom-input,.chat-compose textarea {width:100%;min-width:0;padding:8px 10px;border:1px solid #c8d6e4;border-radius:8px;background:#fff;color:var(--text);font-size:.88rem}
.skill-match-toggle {display:inline-flex;align-items:center;gap:6px;min-height:38px;font-size:.84rem;color:var(--text);cursor:pointer;user-select:none}
.skill-match-toggle input {width:16px;height:16px;accent-color:var(--primary)}
.lab-link {font-size:.83rem;padding:4px 0;white-space:nowrap;text-decoration:none}
.lab-link:hover {text-decoration:underline}
.filter-bar-links {display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.persona-badge {display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;font-size:.75rem;font-weight:700;border:1px solid transparent;white-space:nowrap}
.fit-banner {display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:7px 11px;border-radius:10px;font-size:.81rem;line-height:1.45}
.fit-banner strong {white-space:nowrap}
.fit-banner.fit-best {background:#fff0f6;color:#be185d;border:1px solid #fbcfe8}
.fit-banner.fit-good {background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe}
.fit-banner.fit-caution {background:#fffbeb;color:#b45309;border:1px solid #fde68a}
.live-card.post-highlight {border-color:#7c3aed;box-shadow:0 0 0 3px rgba(124,58,237,0.16)}

.feed-heading {margin-bottom:10px}
.feed-heading h2 {font-size:1.12rem}
.feed-heading h2 span {font-size:.84rem;color:var(--muted);font-weight:500;margin-left:6px}
#feed-competition {color:var(--muted);font-size:.84rem}
.live-status {margin:0 0 10px;color:#16634b;font-size:.86rem}
.live-status:empty {display:none}
.live-status.error {color:#b91c1c}
.live-login {padding:16px 18px;font-size:.9rem;margin-bottom:12px}

.team-page .live-posts {display:grid;grid-template-columns:minmax(0,1fr);gap:11px}
.team-page .live-card {display:flex;flex-direction:column;gap:10px;padding:15px 18px;overflow-wrap:anywhere}
.live-card-top {display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.card-identity {display:flex;align-items:center;flex-wrap:wrap;gap:6px 8px}
.card-identity strong {font-size:.98rem}
.card-meta {font-size:.83rem;color:var(--muted)}
.contest-tag {display:inline-flex;align-items:center;padding:2px 8px;border-radius:6px;background:var(--soft);color:#0758b2;font-size:.76rem;font-weight:700;white-space:nowrap}
.recruit-badge {flex:none;font-size:.78rem;background:#e8f7ef;color:#176247;border-radius:999px;padding:3px 10px;white-space:nowrap}
.card-note {font-size:.88rem;color:#2c4159;line-height:1.5}
.chips,.tag-choices {display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.live-card .chip {background:#f1f6fb;border:1px solid #e1ebf5;border-radius:999px;color:#324d69;font-size:.79rem;padding:2px 10px}
.live-card .chip-match {background:#e7f7ef;border-color:#a7e2c4;color:#0f5c3e;font-weight:650}
.live-card-bottom {display:flex;justify-content:space-between;align-items:flex-end;gap:12px;padding-top:4px;border-top:1px solid #f0f4f8}
.post-details {flex:1;min-width:0}
.post-details dl {display:grid;grid-template-columns:max-content minmax(0,1fr);gap:6px 12px;margin:8px 0 2px;font-size:.83rem}
.post-details dt {font-weight:650;color:var(--text)}
.post-details dd {margin:0;color:var(--muted);white-space:pre-line}

.team-page .live-empty {background:#fff;padding:28px 16px;font-size:.9rem;border:1px dashed #cbd5e1;border-radius:14px;text-align:center;color:var(--muted)}
.live-empty strong {display:block;color:var(--text);margin-bottom:10px}
.empty-actions {display:flex;justify-content:center;gap:8px;flex-wrap:wrap}

.live-my-post {display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0;border-top:1px solid #eef3f8}
.live-my-post:first-child {border-top:0;padding-top:2px}
.my-post-info {min-width:0;display:grid;gap:3px}
.my-post-title {display:flex;align-items:center;gap:8px;font-size:.88rem}
.my-post-meta {font-size:.8rem;color:var(--muted)}
.my-post-actions {display:flex;align-items:center;gap:8px;flex:none}
.live-delete {border:0;background:none;color:#b91c1c;font-size:.8rem;padding:4px 6px}
.live-delete:hover {text-decoration:underline}

.live-conversation + .live-conversation {margin-top:6px}
.conv-top {display:flex;justify-content:space-between;align-items:center;gap:8px}
.unread-badge {display:inline-flex;flex:none;padding:2px 7px;border-radius:999px;background:#fef2f2;color:#b91c1c;font-size:.68rem;font-weight:700}

footer {margin-top:28px;color:var(--muted);font-size:.82rem;padding:12px 20px 24px;text-align:center}
.muted {color:var(--muted);font-size:.83rem}

#publish-dialog {border:1px solid var(--line);border-radius:16px;width:min(620px,calc(100% - 24px));max-height:calc(100dvh - 32px);padding:20px;color:var(--text)}
#publish-dialog::backdrop {background:#142c4880}
#publish-dialog > *+* {margin-top:13px}
.publish-head h2 {font-size:1.25rem}
.publish-row {display:grid;grid-template-columns:1fr auto;gap:12px}
#recruit-count {min-width:96px}
.tag-picker {background:#f7fbff;border:1px solid var(--line);padding:10px;border-radius:9px;margin-top:6px}
.tag-group+.tag-group {margin-top:7px}
.tag-group-title {display:block;font-size:.8rem;color:var(--muted);margin-bottom:4px;font-weight:650}
summary.tag-group-title {display:list-item}
.tag-choice {border:1px solid #c8d6e4;background:#fff;color:var(--text);border-radius:999px;padding:5px 9px;font-size:.8rem}
.tag-choice[aria-pressed="true"] {background:#dceeff;border-color:#71a9e4;color:#074c94;font-weight:700}
.tag-custom-row {display:flex;gap:8px;margin-top:6px}
.team-add {display:grid;grid-template-columns:1fr 1fr auto;gap:8px;margin-top:8px}
.team-member {display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;font-size:.88rem}

.chat-overlay {position:fixed;inset:0;z-index:200;display:grid;place-items:center;background:#142c4880;padding:12px}
.chat-dialog {width:min(600px,100%);max-height:calc(100dvh - 24px);display:flex;flex-direction:column;background:#fff;border-radius:15px;overflow:hidden}
.chat-header,.chat-compose {padding:12px 15px}
.chat-header {display:flex;justify-content:space-between;gap:12px;background:var(--soft)}
.chat-header h2 {font-size:1.1rem}
.chat-header p,#chat-send-note {font-size:.82rem;color:var(--muted)}
.chat-close {border:0;background:none;color:var(--text);font-size:1.45rem}
.chat-log {min-height:min(220px,34dvh);overflow:auto;padding:12px 15px;display:flex;flex-direction:column;gap:8px}
.bubble {max-width:90%;align-self:flex-start;background:#f0f5fa;border-radius:10px;padding:8px 11px;white-space:pre-wrap;overflow-wrap:anywhere}
.bubble.mine {background:var(--soft);align-self:flex-end}
.chat-compose textarea {resize:vertical;min-height:65px}
.chat-shortcuts,.chat-compose-row {display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:7px}
.chat-shortcuts button {background:#fff;color:var(--primary);border:1px solid var(--line);border-radius:6px;padding:5px 8px;font-size:.8rem}
.chat-compose-row {justify-content:space-between;margin:4px 0 0}

@media(max-width:600px) {
  .nav {padding:8px 14px}
  .nav-links {gap:3px}
  .nav-links a {font-size:.79rem;padding:5px 7px}
  .team-page {padding:20px 12px}
  .publish-row,.team-add {grid-template-columns:1fr}
  .live-card-bottom {flex-direction:column;align-items:stretch}
  .live-card-bottom .chat-button {align-self:flex-end}
  .post-details dl {grid-template-columns:minmax(0,1fr)}
  .live-my-post {flex-direction:column;align-items:flex-start}
}
