:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #171622;
  background: #fbfbfd;
  font-size: 16px;
  --text: #171622;
  --muted: #68667b;
  --line: #e8e7ef;
  --paper: #fff;
  --accent: #6041c5;
  --hover: #f3efff;
  --radius: 12px;
  --shadow: 0 1px 2px #1b123c0a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #8161e0;
  outline-offset: 2px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 2rem;
  line-height: 1.25;
  letter-spacing: -0.04em;
  font-weight: 720;
}
h2 {
  font-size: 1.12rem;
  letter-spacing: -0.016em;
}
h3 {
  font-size: 1rem;
}
.subtle {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}
.subtle strong {
  color: var(--text);
}
.mono {
  font-family: ui-monospace, Menlo, monospace;
}
.break {
  overflow-wrap: anywhere;
}
.glyph {
  inline-size: 1.05rem;
  block-size: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.big-glyph {
  width: 1.4rem;
  height: 1.4rem;
}
.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}
.sidebar {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--line);
  min-width: 0;
  overflow-y: auto;
}
.identity {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 25px 18px 23px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 9px #603eb744;
  flex: none;
}
.brand-title {
  font-weight: 720;
  font-size: 1.06rem;
  line-height: 1.3;
  white-space: nowrap;
}
.brand-caption {
  font-size: 0.73rem;
  color: var(--muted);
  margin-top: 4px;
}
.side-group {
  padding: 0 11px 19px;
}
.group-label {
  font-size: 0.72rem;
  color: #777588;
  font-weight: 640;
  padding: 0 10px 7px;
  letter-spacing: 0.05em;
}
.navlink {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 9px 10px;
  margin: 1px 0;
  color: #47455b;
  font-size: 0.865rem;
  font-weight: 570;
  line-height: 1.3;
  min-height: 37px;
}
.navlink:hover {
  background: #f7f6fa;
  text-decoration: none;
  color: var(--text);
}
.navlink[aria-current="page"] {
  background: #eee8ff;
  color: #5131ab;
  font-weight: 720;
}
.side-foot {
  margin: auto 11px 11px;
  border-top: 1px solid var(--line);
  padding: 12px 4px 0;
}
.account {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avatar {
  background: #efe9ff;
  color: var(--accent);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 0.83rem;
  font-weight: 720;
  flex: none;
}
.account strong {
  display: block;
  font-size: 0.82rem;
}
.account small {
  color: var(--muted);
  font-size: 0.71rem;
}
.logout {
  margin-left: auto;
}
.workspace {
  height: 100%;
  overflow-y: auto;
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 61px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #ffffffee;
  backdrop-filter: blur(10px);
}
.top-left,
.top-right,
.inline {
  display: flex;
  align-items: center;
  gap: 9px;
}
.context {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.83rem;
  color: var(--muted);
}
.context strong {
  color: var(--text);
  font-weight: 640;
}
.context-sep {
  color: #bbb8c8;
}
.mobile-menu {
  display: none !important;
}
.main {
  max-width: 1440px;
  margin: auto;
  padding: 28px 30px 40px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}
.page-heading p {
  margin-top: 7px;
}
.row-title {
  font-weight: 650;
  font-size: 0.89rem;
}
.meta {
  font-size: 0.77rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 4px;
}
.button {
  border: 1px solid var(--line);
  white-space: nowrap;
  padding: 8px 13px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 8px;
  background: #fff;
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--text);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.button:hover {
  text-decoration: none;
  background: #f6f4fa;
}
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.button.primary:hover {
  background: #5033ad;
}
.button.ghost {
  background: none;
  border: 0;
  box-shadow: none;
  color: #57546b;
}
.button.ghost:hover {
  background: #f2eef9;
}
.button.icon {
  width: 34px;
  min-height: 34px;
  padding: 0;
}
.button.danger {
  color: #9b332f;
}
.button.small {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 0.78rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #e7e2f2;
  background: #f7f5fb;
  color: #5d5672;
  font-size: 0.73rem;
  font-weight: 630;
  border-radius: 6px;
  padding: 3px 7px;
  white-space: nowrap;
}
.pill.purple {
  background: #eee8ff;
  border-color: #e5dcff;
  color: #5835ad;
}
.pill.green {
  background: #ebf8f0;
  color: #266543;
  border-color: #d6ecdf;
}
.pill.orange {
  background: #fff3e3;
  color: #83521b;
  border-color: #f5e5c7;
}
.pill.red {
  background: #fdeeea;
  color: #a34134;
  border-color: #f4dcd7;
}
.dot {
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
}
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 23px 24px;
  border: 1px solid #e5dbfb;
  border-radius: var(--radius);
  background: linear-gradient(110deg, #f7f3ff, #eee7ff);
  margin-bottom: 19px;
}
.hero h2 {
  font-size: 1.24rem;
  margin: 0 0 6px;
}
.hero p {
  font-size: 0.85rem;
  color: #5c5373;
  line-height: 1.6;
}
.hero-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 10px;
  background: #e8dcff;
  color: #6041c5;
  margin-right: 4px;
  flex: none;
}
.hero-main {
  display: flex;
  align-items: center;
  gap: 14px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}
.stat,
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.stat {
  padding: 15px 16px;
}
.stat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  font-size: 0.84rem;
  font-weight: 630;
  color: #4e4b61;
}
.stat-label .glyph {
  color: #8477a5;
}
.stat-num {
  font-size: 1.82rem;
  letter-spacing: -0.045em;
  font-weight: 740;
  margin: 8px 0 2px;
  font-variant-numeric: tabular-nums;
}
.stat .meta {
  white-space: normal;
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 17px;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 17px 18px 13px;
}
.panel-head p {
  margin-top: 4px;
}
.panel-body {
  padding: 0 18px 16px;
}
.panel + .panel.stacked {
  margin-top: 17px;
}
.small-stack {
  display: grid;
  gap: 11px;
}
.step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #f0edf5;
}
.step .step-link {
  margin-left: auto;
  flex: none;
}
.step-symbol {
  background: #f2edff;
  color: var(--accent);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex: none;
}
.bars {
  display: grid;
  gap: 11px;
  margin-top: 7px;
}
.bar-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 9px;
  font-size: 0.8rem;
  font-weight: 600;
}
.bar-track {
  height: 8px;
  background: #f0edf6;
  border-radius: 6px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #967be9, #6746cc);
  border-radius: 6px;
}
.panel-note {
  border-top: 1px solid var(--line);
  margin-top: 15px;
  padding-top: 11px;
}
.facts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.fact-value {
  font-size: 1.12rem;
  line-height: 1.5;
  font-weight: 650;
  margin: 6px 0 9px;
  overflow-wrap: anywhere;
}
.fact-detail {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.table-wrap {
  overflow: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.835rem;
}
.data-table th {
  color: #686579;
  font-weight: 640;
  font-size: 0.75rem;
  background: #faf9fc;
  white-space: nowrap;
}
.data-table th,
.data-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  line-height: 1.5;
  vertical-align: middle;
}
.data-table td:last-child,
.data-table th:last-child {
  text-align: right;
}
.data-table td.relaxed {
  min-width: 210px;
}
.data-table tr:hover td {
  background: #fdfbff;
}
.list-title {
  font-weight: 640;
}
.link-text {
  color: var(--accent);
  font-size: 0.82rem;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
}
.link-text:hover {
  text-decoration: underline;
}
.tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 13px;
}
.input,
.select,
textarea {
  width: 100%;
  border: 1px solid #dcd9e7;
  border-radius: 8px;
  background: #fff;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.88rem;
  font-weight: 450;
  line-height: 1.5;
}
.input.search {
  width: min(320px, 100%);
}
.select.filter {
  width: auto;
  min-width: 110px;
}
.input::placeholder,
textarea::placeholder {
  color: #9995a9;
}
.empty {
  padding: 30px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
}
.editing {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(230px, 1fr);
  gap: 14px;
}
.editor-text {
  min-height: 420px;
  resize: vertical;
}
.readonly-text {
  font-family: inherit;
  white-space: pre-wrap;
  line-height: 1.75;
  color: #312f43;
  font-size: 0.91rem;
  overflow-wrap: anywhere;
}
.form-grid {
  display: grid;
  gap: 13px;
}
.form-grid label {
  display: grid;
  gap: 5px;
  font-size: 0.84rem;
  font-weight: 630;
}
.form-grid .split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 5px;
}
.notice {
  padding: 11px 12px;
  border-radius: 8px;
  background: #f5f1ff;
  color: #52416f;
  font-size: 0.84rem;
  line-height: 1.65;
}
.notice.error {
  background: #fff0ed;
  color: #8e352d;
}
.feed {
  display: grid;
  gap: 10px;
}
.feed-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.feed-item h3 {
  margin-bottom: 5px;
}
.feed-item p {
  line-height: 1.65;
}
.status-line {
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
dialog {
  width: min(550px, calc(100vw - 26px));
  max-height: 90dvh;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 70px #2418402e;
  padding: 0;
  color: var(--text);
  background: #fff;
}
dialog::backdrop {
  background: #231a3e62;
  backdrop-filter: blur(2px);
}
.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 19px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.dialog-body {
  padding: 17px 19px;
}
.dialog-error[hidden],
.toast[hidden] {
  display: none;
}
.dialog-error {
  margin-bottom: 12px;
}
.toast {
  position: fixed;
  bottom: 17px;
  right: 18px;
  z-index: 20;
  background: #211b34;
  color: white;
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 0.84rem;
  max-width: calc(100% - 36px);
  box-shadow: 0 10px 40px #211b3440;
}
.toast.failed {
  background: #8e3b37;
}
.login-shell {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at top left, #eee6ff, transparent 55%), #f9f8fd;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-wrap {
  width: min(420px, 100%);
}
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
}
.login-card {
  padding: 27px;
}
.login-card h1 {
  font-size: 1.48rem;
  margin-bottom: 5px;
}
.login-card form {
  margin-top: 22px;
}
.login-card .button {
  width: 100%;
}
.loading-screen {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  color: var(--muted);
}
.login-err {
  min-height: 17px;
  color: #97362f;
  font-size: 0.78rem;
}
.aside-overlay {
  display: none;
}
@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 211px minmax(0, 1fr);
  }
  .main {
    padding: 23px;
  }
  .topbar {
    padding-inline: 22px;
  }
  .stats {
    gap: 9px;
  }
  .stat {
    padding: 12px;
  }
  .stat-num {
    font-size: 1.6rem;
  }
}
@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 244px;
    z-index: 10;
    transform: translateX(-101%);
    transition: transform 0.16s ease-out;
  }
  .sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-open .aside-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: #20193457;
    z-index: 9;
    border: none;
  }
  .mobile-menu {
    display: inline-flex !important;
  }
  .main {
    padding: 18px;
  }
  .topbar {
    padding-inline: 14px;
  }
  .editing,
  .columns {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .main {
    padding: 16px 12px;
  }
  .stats,
  .facts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .facts-grid {
    gap: 8px;
  }
  .page-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  h1 {
    font-size: 1.65rem;
  }
  .hero {
    padding: 14px;
    align-items: flex-start;
    flex-direction: column;
  }
  .hero-icon {
    display: none;
  }
  .top-right .pill {
    display: none;
  }
  .data-table th,
  .data-table td {
    padding: 8px 10px;
  }
  .form-grid .split {
    grid-template-columns: 1fr;
  }
  .sidebar {
    width: min(244px, 82vw);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.source-mark {
  display: inline-grid;
  place-items: center;
  inline-size: 2rem;
  block-size: 2rem;
  flex: 0 0 2rem;
  border-radius: 0.5rem;
  background: var(--wash, #eef2ff);
  color: var(--ink, #25315a);
  font-weight: 650;
}
.source-overview { margin-bottom: 1.25rem; }
.source-picker {
  min-width: 0;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: .5rem;
  padding: .75rem;
  margin: 0;
}
.source-picker legend { padding: 0 .25rem; font-weight: 600; }
.source-options { display: flex; flex-wrap: wrap; gap: .7rem 1.1rem; }
.source-options label { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.source-copy { white-space: pre-line; overflow-wrap: anywhere; }
.status-line .meta { margin-inline-start: .4rem; }

.acquisition-filter { display: flex; align-items: end; flex-wrap: wrap; gap: .75rem; }
.acquisition-filter label { flex: 1 0 8rem; }
.acquisition-filter label select { width: 100%; }
.acquisition-stats { margin-top: 1.15rem; }
