:root {
  --bg: #eef3f8;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --line: #dde6ef;
  --line-strong: #c8d6e4;
  --text: #14283c;
  --muted: #637489;
  --blue: #1f68e5;
  --blue-strong: #164fae;
  --blue-soft: #e9f1ff;
  --green: #23835a;
  --green-soft: #e8f7ef;
  --amber: #b56b12;
  --amber-soft: #fff3df;
  --red: #b42318;
  --red-soft: #fdecec;
  --shadow: 0 12px 28px rgba(23, 46, 75, 0.08);
  --shadow-soft: 0 6px 18px rgba(23, 46, 75, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0 34px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 360px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(31, 104, 229, 0.22);
  font-size: 22px;
  font-weight: 700;
}

.brand h1 {
  margin: 0;
  color: #102a43;
  font-size: 26px;
  font-weight: 720;
  line-height: 1.2;
}

.brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.global-search {
  width: min(560px, 40vw);
  height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  background: var(--panel-soft);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.search-icon {
  color: var(--muted);
  font-size: 17px;
}

.global-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.workspace {
  display: grid;
  grid-template-columns: 244px minmax(580px, 1fr) 430px;
  gap: 20px;
  padding: 24px 28px 28px;
}

.side-panel,
.list-panel,
.detail-panel {
  min-height: calc(100vh - 136px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.side-panel {
  padding: 20px 18px;
}

.list-panel,
.detail-panel {
  padding: 20px 22px;
}

.panel-title {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-title span,
.section-head p,
.quick-section h2,
.filters label,
.meta-label {
  color: var(--muted);
  font-size: 12px;
}

.panel-title strong,
.section-head h2,
.quick-section h2 {
  margin: 0;
  color: #102a43;
  font-size: 17px;
  font-weight: 700;
}

.category-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-button {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.category-button:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(31, 104, 229, 0.08);
}

.category-button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.count-badge {
  min-width: 30px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.quick-section,
.source-section {
  margin-top: 24px;
}

.source-section h2 {
  margin: 0 0 14px;
  color: #102a43;
  font-size: 17px;
  font-weight: 700;
}

.source-registry {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.source-summary {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.source-summary strong {
  color: #102a43;
  font-size: 24px;
}

.source-summary span,
.source-line,
.source-empty {
  color: var(--muted);
  font-size: 12px;
}

.source-line {
  margin-top: 8px;
  line-height: 1.55;
}

.quick-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.chip,
.ghost-button {
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  padding: 0 12px;
  cursor: pointer;
  font-size: 12px;
}

.chip:hover,
.ghost-button:hover {
  background: #dbeaff;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin-bottom: 5px;
}

.section-head p {
  margin: 0;
}

.ghost-button {
  height: 34px;
  border-radius: 8px;
  white-space: nowrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}

.stat-card {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong {
  display: block;
  margin-top: 5px;
  color: #102a43;
  font-size: 20px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filters select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: calc(100vh - 350px);
  overflow: auto;
  padding-right: 4px;
}

.item-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(20, 40, 60, 0.02);
}

.item-card:hover {
  border-color: var(--blue);
  box-shadow: 0 6px 16px rgba(31, 104, 229, 0.08);
}

.item-card.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 8px 18px rgba(31, 104, 229, 0.12);
}

.importance {
  width: 32px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 700;
}

.importance.high {
  background: var(--red-soft);
  color: var(--red);
}

.importance.medium {
  background: var(--amber-soft);
  color: var(--amber);
}

.importance.low {
  background: var(--panel-soft);
  color: var(--muted);
}

.item-main h3 {
  margin: 0;
  color: #102a43;
  font-size: 15px;
  line-height: 1.45;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 12px;
}

.empty-state {
  padding: 42px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.detail-panel {
  position: sticky;
  top: 20px;
  align-self: start;
}

.detail-content {
  color: var(--text);
}

.detail-title {
  margin: 0 0 18px;
  color: #102a43;
  font-size: 19px;
  line-height: 1.55;
}

.detail-grid {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px 16px;
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.meta-value {
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.detail-block {
  margin: 18px 0;
}

.detail-block h3 {
  margin: 0 0 9px;
  color: #102a43;
  font-size: 15px;
}

.detail-block p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
}

.link-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  margin-top: 22px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
}

.link-button:hover {
  background: var(--blue-strong);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 28px 24px;
  color: var(--muted);
  font-size: 12px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--blue-strong);
  text-decoration: underline;
}

@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: 230px minmax(520px, 1fr) 390px;
    gap: 18px;
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
