:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8faff;
  --line: #e4e9f1;
  --line-strong: #d5dde8;
  --text: #172033;
  --muted: #667085;
  --blue: #3978f6;
  --blue-soft: #edf4ff;
  --violet: #7457e8;
  --green: #17a673;
  --red: #ef5b67;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(180deg, #fbfcff 0, #f5f7fb 42%, #f3f6fa 100%);
  font-family: Inter, "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
.ambient { position: fixed; pointer-events: none; filter: blur(120px); opacity: .13; border-radius: 50%; z-index: 0; }
.ambient-a { width: 430px; height: 430px; background: #79a8ff; left: -190px; top: 80px; }
.ambient-b { width: 390px; height: 390px; background: #b49cff; right: -160px; bottom: 3%; }

.topbar {
  height: 76px;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(28px, calc((100vw - 1400px) / 2));
  border-bottom: 1px solid rgba(213, 221, 232, .8);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(22px);
  box-shadow: 0 4px 22px rgba(37, 56, 88, .035);
}
.brand { display: flex; align-items: center; gap: 12px; letter-spacing: .12em; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(145deg, #3978f6, #7457e8); color: #fff;
  box-shadow: 0 8px 24px rgba(57, 120, 246, .25); font-weight: 900;
}
.brand-mark.large { width: 58px; height: 58px; border-radius: 18px; font-size: 23px; margin-bottom: 18px; }
.brand b { display: block; font-size: 14px; }
.brand small { display: block; color: #8b97a9; font-size: 9px; letter-spacing: .2em; }
.topbar nav { display: flex; gap: 28px; color: var(--muted); font-size: 13px; }
.topbar nav a:hover { color: var(--blue); }
.page { max-width: 1400px; margin: auto; padding: 54px 28px 80px; position: relative; z-index: 1; }
footer { text-align: center; padding: 32px; color: #98a2b3; font-size: 10px; letter-spacing: .25em; border-top: 1px solid var(--line); background: #fff; }

.eyebrow, .kicker { font-size: 10px; font-weight: 800; letter-spacing: .23em; color: var(--blue); }
.hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; margin-bottom: 36px; }
.hero h1, .group-hero h1 { font-size: 42px; line-height: 1.15; margin: 10px 0; letter-spacing: -.04em; }
.hero p, .group-hero p { margin: 0; color: var(--muted); max-width: 740px; }
.status-pill { white-space: nowrap; border: 1px solid var(--line); border-radius: 99px; padding: 8px 13px; color: var(--muted); font-size: 12px; background: #fff; margin-top: 12px; }
.status-pill i, .live-dot:before { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #98a2b3; margin-right: 8px; }
.status-pill.online { color: #087b55; border-color: #bfe9d8; background: #effbf6; }
.status-pill.online i, .live-dot.on:before { background: var(--green); box-shadow: 0 0 9px rgba(23, 166, 115, .35); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stats-grid article, .panel, .group-card, .topic-card {
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  box-shadow: 0 14px 42px rgba(42, 60, 91, .06);
}
.stats-grid article { padding: 22px 24px; border-radius: 16px; position: relative; overflow: hidden; }
.stats-grid article:after { content: ""; position: absolute; width: 80px; height: 80px; border-radius: 50%; right: -31px; top: -38px; background: #eaf1ff; }
.stats-grid span { color: var(--muted); font-size: 12px; }
.stats-grid strong { display: block; font-size: 32px; line-height: 1.3; margin-top: 5px; }
.stats-grid small { color: #a1aaba; font-size: 8px; letter-spacing: .15em; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; margin-top: 18px; }
.panel { border-radius: 18px; padding: 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.panel h2, .section-head h2 { font-size: 19px; margin: 3px 0; }
.chart-panel #overviewChart { height: 310px; margin-top: 10px; }
.pulse-panel { position: relative; overflow: hidden; }
.pulse-orb { width: 110px; height: 110px; border: 1px solid #cfe0ff; border-radius: 50%; margin: 17px auto; display: grid; place-items: center; background: radial-gradient(circle, #e8f1ff, #fff 68%); box-shadow: 0 10px 35px rgba(57, 120, 246, .08); }
.pulse-orb:before, .pulse-orb:after { content: ""; position: absolute; border: 1px solid #dbe7fb; border-radius: 50%; width: 80px; height: 80px; }
.pulse-orb:after { width: 48px; height: 48px; }
.pulse-orb span { width: 15px; height: 15px; border-radius: 50%; background: #5b8ff9; box-shadow: 0 0 20px rgba(57, 120, 246, .45); }
.pulse-panel dl { margin: 0; }
.pulse-panel dl div { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid #edf0f5; font-size: 12px; }
.pulse-panel dt { color: var(--muted); }
.pulse-panel dd { margin: 0; }
.ok { color: #0c9566 !important; }
.warn { color: #d78216 !important; }

.section-head { display: flex; justify-content: space-between; align-items: end; margin: 44px 0 16px; }
.section-head > span { font-size: 12px; color: var(--muted); }
.section-head.compact { margin: 2px 0 16px; }
.group-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.group-card { padding: 22px; border-radius: 18px; transition: .25s; }
.group-card:hover { transform: translateY(-5px); border-color: #aec8fa; box-shadow: 0 20px 50px rgba(42, 60, 91, .12); }
.group-top { display: flex; justify-content: space-between; }
.group-icon { width: 43px; height: 43px; border-radius: 13px; display: grid; place-items: center; font-size: 17px; font-weight: 800; color: #fff; background: linear-gradient(145deg, #3978f6, #7457e8); }
.group-icon.xl { width: 66px; height: 66px; border-radius: 20px; font-size: 26px; flex: 0 0 auto; }
.live-dot { font-size: 10px; color: #8792a2; }
.group-card h3 { margin: 19px 0 0; font-size: 18px; }
.group-card code { color: #8d98a8; font-size: 10px; }
.group-metrics { display: flex; gap: 28px; border-top: 1px solid #edf0f5; margin-top: 18px; padding-top: 15px; color: var(--muted); font-size: 11px; }
.group-metrics b { color: var(--text); font-size: 16px; margin-right: 4px; }
.open-link { color: var(--blue); font-size: 11px; margin-top: 18px; }
.open-link span { float: right; }
.empty-state { grid-column: 1 / -1; padding: 60px; text-align: center; border: 1px dashed #cdd6e4; border-radius: 18px; color: var(--muted); background: rgba(255, 255, 255, .6); }
.empty-state b { color: var(--text); }
.empty-state p { margin: 5px 0; }
.empty-state.slim { padding: 35px; }
.back { font-size: 12px; color: var(--blue); }

.group-hero { display: flex; align-items: center; gap: 20px; margin: 28px 0 38px; }
.group-hero .status-pill { margin-left: auto; }
.knowledge-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 20px; }
.people-panel { align-self: start; position: sticky; top: 98px; padding: 18px; }
.people-panel .panel-head { padding: 3px 8px 15px; }
.person { display: flex; align-items: center; gap: 11px; padding: 11px; border-radius: 13px; margin: 3px 0; position: relative; }
.person:hover, .person.active { background: var(--blue-soft); border: 1px solid #c8dafc; padding: 10px; }
.avatar, .memory-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: #e9f2ff; color: #2865d8; font-weight: 700; flex: 0 0 auto; }
.person div { min-width: 0; }
.person b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person small { display: block; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person i { position: absolute; right: 11px; width: 7px; height: 7px; border-radius: 50%; background: #b2bac5; }
.person i.on { background: var(--green); }
.aside-empty { color: var(--muted); font-size: 11px; padding: 10px; }

.topic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.topic-card { display: block; padding: 19px; border-radius: 16px; transition: .2s; }
.topic-card:hover, .topic-card.selected { border-color: #a9c6fb; transform: translateY(-2px); box-shadow: 0 15px 38px rgba(42, 60, 91, .1); }
.topic-tag { font-size: 9px; color: var(--blue); text-transform: uppercase; }
.topic-card h3 { font-size: 15px; margin: 9px 0 7px; }
.topic-card p { font-size: 11px; color: var(--muted); height: 52px; overflow: hidden; margin: 0; }
.topic-card div { display: flex; justify-content: space-between; border-top: 1px solid #edf0f5; padding-top: 11px; margin-top: 13px; color: #8b96a6; font-size: 9px; }
.records-title { margin-top: 38px !important; }
.timeline { position: relative; }
.timeline:before { content: ""; position: absolute; left: 17px; top: 10px; bottom: 10px; width: 1px; background: #d8e1ed; }
.memory { display: flex; gap: 14px; position: relative; margin-bottom: 12px; }
.memory-avatar { z-index: 1; }
.memory-body { min-width: 0; flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 15px 17px; box-shadow: 0 8px 25px rgba(42, 60, 91, .035); }
.memory-body header { display: flex; gap: 10px; align-items: center; font-size: 11px; }
.memory-body header time { color: #98a2b3; font-size: 9px; }
.memory-body header span { margin-left: auto; background: var(--blue-soft); color: #356ac3; border-radius: 20px; padding: 2px 8px; font-size: 8px; }
.memory-body p { white-space: pre-wrap; font-size: 12px; color: #344054; margin: 10px 0 0; }
.attachment { display: flex; align-items: center; gap: 11px; margin-top: 12px; padding: 10px; border-radius: 11px; background: #f5f9ff; border: 1px solid #dae6f8; }
.attachment i { font-style: normal; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--blue); }
.attachment b, .attachment small { display: block; }
.attachment b { font-size: 11px; }
.attachment small { font-size: 8px; color: var(--muted); }

.login-body { overflow-x: hidden; background: linear-gradient(135deg, #f9fbff, #eef4ff); }
.login-shell { min-height: 100vh; max-width: 1200px; margin: auto; padding: 40px; display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 10%; position: relative; z-index: 1; }
.login-copy h1 { font-size: 54px; line-height: 1.12; letter-spacing: -.05em; margin: 18px 0; }
.login-copy em { font-style: normal; color: var(--blue); }
.login-copy p { max-width: 580px; color: var(--muted); }
.trust-row { display: flex; gap: 26px; margin-top: 35px; color: #778397; font-size: 10px; }
.trust-row span:before { content: "✓"; color: var(--blue); margin-right: 7px; }
.login-card { background: rgba(255, 255, 255, .96); border: 1px solid #dfe6ef; border-radius: 24px; padding: 38px; box-shadow: 0 28px 80px rgba(39, 68, 110, .14); }
.login-card h2 { font-size: 23px; margin: 0; }
.login-card > p { font-size: 11px; color: var(--muted); margin: 5px 0 28px; }
.login-card label { font-size: 11px; color: #526174; }
.login-card input { display: block; width: 100%; margin: 7px 0 20px; background: #f9fbfd; border: 1px solid #d5dde8; color: var(--text); border-radius: 12px; padding: 14px; outline: none; }
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(57, 120, 246, .12); }
.login-card button { width: 100%; border: 0; border-radius: 12px; padding: 14px; background: linear-gradient(90deg, #3978f6, #7457e8); color: #fff; font-weight: 700; cursor: pointer; }
.login-card button span { float: right; }
.login-card > small { display: block; text-align: center; color: #98a2b3; font-size: 8px; margin-top: 17px; }
.alert { color: #b42334; background: #fff1f3; border: 1px solid #ffc9d0; padding: 9px 12px; border-radius: 9px; font-size: 10px; margin-bottom: 15px; }
.error-page { text-align: center; padding: 15vh 20px; }
.error-page strong { font-size: 100px; color: #bfd3f7; }
.error-page a { color: var(--blue); }
.error-page h1 { font-size: 20px; }

@media (max-width: 1000px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .group-grid { grid-template-columns: repeat(2, 1fr); }
  .knowledge-layout { grid-template-columns: 1fr; }
  .people-panel { position: static; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-copy { display: none; }
}
@media (max-width: 650px) {
  .page { padding: 35px 16px 60px; }
  .topbar { padding: 0 18px; }
  .topbar nav a:first-child { display: none; }
  .hero, .group-hero { display: block; }
  .hero h1, .group-hero h1 { font-size: 32px; }
  .stats-grid, .group-grid, .topic-grid { grid-template-columns: 1fr; }
  .group-hero .group-icon { margin-bottom: 15px; }
  .login-shell { padding: 20px; }
  .login-card { padding: 28px; }
  .memory-body header { flex-wrap: wrap; }
  .memory-body header span { margin-left: 0; }
  .stats-grid article { padding: 18px; }
}
