:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --panel: #ffffff;
  --panel-soft: #edf4f1;
  --ink: #17231f;
  --muted: #63716d;
  --line: #d7e1dc;
  --green: #0d765f;
  --blue: #245f9d;
  --amber: #a26513;
  --rose: #a24658;
  --shadow: 0 18px 42px rgba(25, 40, 35, 0.09);
  --shadow-soft: 0 8px 22px rgba(25, 40, 35, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 0 40px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  padding: 22px 0 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

h3 {
  margin-bottom: 8px;
  font-size: 14px;
}

.subtitle {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
}

.meta-panel {
  display: grid;
  gap: 8px;
  min-width: 220px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
  font-size: 13px;
}

.control-band,
.list-panel,
.detail-panel,
.planning-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.control-band {
  display: grid;
  grid-template-columns: minmax(300px, 1.3fr) minmax(150px, 0.55fr) minmax(140px, 0.45fr) minmax(240px, 0.75fr) minmax(190px, 0.6fr);
  gap: 14px;
  align-items: end;
  margin-top: 4px;
  overflow: visible;
  padding: 16px;
}

.search-box,
.select-box,
.multi-select-box {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.multi-select-box {
  position: relative;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.search-box input,
.select-box select,
.multi-select-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 9px 11px;
}

.select-box select,
.multi-select-button {
  cursor: pointer;
}

.multi-select-button {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.dropdown-caret {
  color: var(--muted);
  font-size: 12px;
}

.multi-select-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 48px));
  max-height: 380px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.multi-select-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.ghost-button.compact {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 12px;
}

.multi-select-options {
  display: grid;
  gap: 6px;
}

.multi-select-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.multi-select-option:hover {
  background: #f3f8f6;
}

.multi-select-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.multi-select-option span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-button {
  min-width: 74px;
  min-height: 42px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.search-button:hover,
.search-button:focus-visible {
  border-color: #095f4c;
  background: #095f4c;
  box-shadow: var(--shadow-soft);
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segment-button,
.ghost-button,
.source-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.segment-button {
  min-height: 42px;
  padding: 8px 13px;
}

.segment-button.active {
  border-color: var(--green);
  background: #e8f4ef;
  color: var(--green);
}

.section-title,
.panel-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ghost-button {
  min-height: 34px;
  padding: 6px 10px;
  color: var(--muted);
}

.tag-count {
  margin-left: 6px;
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 16px;
  align-items: stretch;
  margin-top: 16px;
  min-height: 1040px;
}

.list-panel {
  display: flex;
  flex-direction: column;
  height: 1040px;
  min-width: 0;
  min-height: 1040px;
  padding: 16px;
}

.progress-list {
  display: grid;
  flex: 1;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.progress-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  cursor: pointer;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.progress-card:hover,
.progress-card:focus-visible {
  border-color: rgba(13, 118, 95, 0.5);
  background: #f4faf7;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.progress-card.selected {
  border-color: var(--green);
  background: #edf7f2;
  box-shadow: inset 3px 0 0 var(--green), var(--shadow-soft);
}

.card-topline,
.card-bottomline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.card-topline {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.card-topline span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 7px;
  border-radius: 8px;
  background: #eef3f1;
}

.card-topline .card-index {
  background: #e8f1fb;
  color: var(--blue);
}

.progress-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.card-overview {
  display: -webkit-box;
  margin-bottom: 0;
  overflow: hidden;
  color: #3e4f49;
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.muted {
  color: var(--muted);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #eef4f8;
  color: #2a5b78;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.source-count {
  color: var(--green);
  font-weight: 700;
}

.source-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.source-mini a {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--blue);
  background: #eef4fb;
  border: 1px solid #d7e4f2;
  border-radius: 8px;
  min-height: 26px;
  padding: 3px 8px;
  font-weight: 700;
  font-size: 12px;
}

.detail-panel {
  position: sticky;
  top: 16px;
  height: 1040px;
  min-height: 1040px;
  overflow: auto;
  padding: 18px;
  box-shadow: var(--shadow);
}

.detail-kicker {
  margin-bottom: 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.detail-copy,
#detailReliability {
  color: #3f504a;
  font-size: 14px;
}

.detail-rich {
  display: grid;
  gap: 10px;
}

.detail-rich p,
.detail-rich ul {
  margin: 0;
}

.detail-rich ul {
  padding-left: 18px;
}

.detail-rich li + li {
  margin-top: 6px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0;
}

.detail-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-overview-block {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.source-list {
  display: grid;
  gap: 8px;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  background: #f7fbff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.source-chip::after {
  content: "↗";
  color: var(--muted);
}

.planning-panel {
  margin-top: 16px;
  padding: 16px;
}

.planning-list {
  display: grid;
  gap: 10px;
}

.planning-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  color: #34433e;
  font-size: 14px;
}

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

@media (max-width: 1100px) {
  .topbar,
  .content-grid,
  .control-band {
    grid-template-columns: 1fr;
  }

  .content-grid {
    min-height: 0;
  }

  .multi-select-menu {
    left: 0;
    right: auto;
    width: 100%;
  }

  .list-panel {
    height: auto;
    min-height: 0;
  }

  .detail-panel {
    height: auto;
    min-height: 0;
    overflow: visible;
    position: static;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 20px, 1440px);
    padding-top: 12px;
  }

  .list-panel {
    height: auto;
    min-height: 0;
  }

  .progress-list {
    flex: none;
  }

  .topbar {
    padding-top: 12px;
  }

  h1 {
    font-size: 30px;
  }
}
