:root {
  --bg: #0a0d13;
  --bg-soft: #0f131c;
  --panel: #131824;
  --panel-2: #171d2b;
  --border: #232b3d;
  --border-soft: #1b2231;
  --text: #e7ebf5;
  --muted: #8b94a8;
  --muted-2: #6b7488;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, 0.12);
  --teal: #33c6bd;
  --gold: #f0b429;
  --danger: #ef5f68;
  --green: #35c48a;
  --radius: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font-family: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------------- 侧栏 ---------------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 16px 20px;
  background: linear-gradient(180deg, #0d111a 0%, #0a0d13 100%);
  border-right: 1px solid var(--border-soft);
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #222a3b;
  border-radius: 3px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 8px 20px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #071022;
  background: linear-gradient(135deg, #7aa2ff 0%, #33c6bd 100%);
  box-shadow: 0 6px 18px rgba(91, 140, 255, 0.28);
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 3px;
  letter-spacing: 1px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 18px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  transition: all 0.16s ease;
}

.nav-item:hover {
  background: var(--panel);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  border-color: rgba(91, 140, 255, 0.28);
  color: #c9d8ff;
  font-weight: 600;
}

.nav-count {
  font-size: 11px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  padding: 1px 7px;
  min-width: 24px;
  text-align: center;
}

.nav-item.active .nav-count {
  color: #9db9ff;
  background: rgba(91, 140, 255, 0.14);
}

.side-block {
  padding: 14px 8px 4px;
  border-top: 1px solid var(--border-soft);
}

.side-title {
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 1.2px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.side-hint {
  font-size: 10px;
  letter-spacing: 0;
  color: var(--muted-2);
}

.cat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  text-align: left;
  transition: all 0.15s ease;
}

.cat-item:hover {
  background: var(--panel);
  color: var(--text);
}

.cat-item.active {
  background: var(--panel-2);
  color: var(--text);
  font-weight: 600;
}

.cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.cat-name {
  flex: 1;
}

.cat-count {
  font-size: 11px;
  color: var(--muted-2);
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topic-chip {
  padding: 5px 9px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  transition: all 0.15s ease;
}

.topic-chip:hover {
  border-color: #34405a;
  color: var(--text);
}

.topic-chip.active {
  background: rgba(51, 198, 189, 0.12);
  border-color: rgba(51, 198, 189, 0.38);
  color: #8fe3dc;
}

.source-block {
  padding-bottom: 10px;
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 190px;
  overflow-y: auto;
}

.source-list::-webkit-scrollbar {
  width: 4px;
}

.source-list::-webkit-scrollbar-thumb {
  background: #222a3b;
}

.source-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.source-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted-2);
  flex: 0 0 auto;
}

.source-dot.ok {
  background: var(--green);
  box-shadow: 0 0 6px rgba(53, 196, 138, 0.5);
}

.source-dot.error {
  background: var(--danger);
}

.source-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-count {
  color: var(--muted-2);
  font-size: 10px;
}

.side-status {
  margin: 14px 8px 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-pill {
  font-size: 10.5px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 3px 8px;
}

.status-pill.on {
  color: #86e0c4;
  border-color: rgba(53, 196, 138, 0.3);
}

.status-pill.off {
  color: var(--muted-2);
}

/* ---------------- 主区域 ---------------- */
.main {
  padding: 0 34px 40px;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 13px;
  background: rgba(10, 13, 19, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 38px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted-2);
  transition: border-color 0.15s ease;
}

.search-wrap:focus-within {
  border-color: rgba(91, 140, 255, 0.55);
}

.search-wrap input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
}

.search-wrap input::placeholder {
  color: var(--muted-2);
}

.search-clear {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn:hover {
  border-color: #38435c;
  background: var(--panel-2);
}

.btn.primary {
  background: linear-gradient(135deg, #5b8cff, #4a75e8);
  border-color: #5b8cff;
  color: #fff;
  box-shadow: 0 4px 16px rgba(91, 140, 255, 0.22);
}

.btn.primary:hover {
  filter: brightness(1.07);
}

.btn.ghost {
  background: transparent;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
}

.icon-btn:hover {
  color: var(--text);
}

.only-mobile {
  display: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 0 6px;
}

.stat-card {
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--panel) 0%, #111621 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -22px;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 140, 255, 0.16), transparent 68%);
}

.stat-label {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-bottom: 7px;
}

.stat-value {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.stat-value small {
  font-size: 11px;
  color: var(--muted-2);
  font-weight: 500;
  margin-left: 4px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0 12px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: 5px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  padding: 3px;
  border-radius: 10px;
}

.chip {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 7px;
  transition: all 0.15s ease;
}

.chip:hover {
  color: var(--text);
}

.chip.active {
  background: var(--panel-2);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.result-meta {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted-2);
}

.active-filters {
  display: flex;
  gap: 8px;
  padding-bottom: 10px;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #9db9ff;
  background: var(--accent-soft);
  border: 1px solid rgba(91, 140, 255, 0.25);
  border-radius: 20px;
  padding: 4px 10px;
}

.filter-tag button {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 13px;
  padding: 0;
  line-height: 1;
}

/* ---------------- 资讯卡片 ---------------- */
.feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 2px;
}

.card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.card:hover {
  border-color: #2f3a52;
  background: #141a26;
  transform: translateY(-1px);
}

.card.read {
  opacity: 0.66;
}

.score {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
}

.score-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--teal);
}

.score-label {
  font-size: 9px;
  color: var(--muted-2);
  letter-spacing: 0.5px;
}

.score.mid .score-num {
  color: var(--gold);
}

.score.low .score-num {
  color: var(--muted);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted-2);
  margin-bottom: 7px;
}

.cat-tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.cat-research {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
}

.cat-explainer {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.cat-tooling {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.12);
}

.cat-tech {
  color: #7aa2ff;
  background: rgba(122, 162, 255, 0.12);
}

.cat-robotics {
  color: #38d6b0;
  background: rgba(56, 214, 176, 0.12);
}

.cat-policy {
  color: #f0b429;
  background: rgba(240, 180, 41, 0.12);
}

.cat-product {
  color: #f472b6;
  background: rgba(244, 114, 182, 0.12);
}

.cat-funding {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.12);
}

.meta-sep {
  color: #333c50;
}

.pending-tag {
  color: var(--muted-2);
  border: 1px dashed #333c50;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
}

.read-tag {
  color: var(--muted-2);
  font-size: 10px;
}

.card-title {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.55;
  font-weight: 650;
}

.card-title a {
  text-decoration: none;
}

.card-title a:hover {
  color: #a8c2ff;
}

.card-orig {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-summary {
  margin: 9px 0 0;
  font-size: 13px;
  line-height: 1.8;
  color: #aab3c5;
  white-space: pre-line;
}

.point-list {
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.point-list li {
  position: relative;
  padding-left: 14px;
  font-size: 12.5px;
  color: #98a2b6;
  line-height: 1.65;
}

.point-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.card-tag {
  font-size: 10.5px;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 2px 7px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-soft);
}

.link-out {
  font-size: 12px;
  color: #8fb0ff;
  text-decoration: none;
}

.link-out:hover {
  text-decoration: underline;
}

.action-btn {
  border: none;
  background: transparent;
  color: var(--muted-2);
  font-size: 11.5px;
  padding: 2px 0;
}

.action-btn:hover {
  color: var(--text);
}

.action-btn.starred {
  color: var(--gold);
}

.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}

.empty-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--muted-2);
  border: 1px dashed var(--border);
  background: var(--panel);
}

.empty h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
}

.empty p {
  margin: 0;
  font-size: 12.5px;
}

.load-more {
  display: flex;
  justify-content: center;
  padding: 20px 0 8px;
}

.page-foot {
  text-align: center;
  font-size: 11px;
  color: #4e5769;
  padding: 26px 0 0;
}

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal[hidden] {
  display: none;
}

.modal-panel {
  width: min(760px, 100%);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  background: #111623;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  animation: rise 0.18s ease;
}

.modal-panel.narrow {
  width: min(620px, 100%);
}

@keyframes rise {
  from {
    transform: translateY(10px);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.modal-head h3 {
  margin: 0;
  font-size: 16px;
}

.modal-sub {
  margin: 5px 0 0;
  font-size: 11.5px;
  color: var(--muted-2);
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--border-soft);
}

.seg {
  display: flex;
  gap: 4px;
  padding: 14px 22px 4px;
}

.seg button {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.seg button.active {
  background: var(--accent-soft);
  border-color: rgba(91, 140, 255, 0.35);
  color: #bcd0ff;
  font-weight: 600;
}

.digest-body,
.settings-body {
  overflow-y: auto;
  padding: 16px 22px 20px;
}

.digest-body::-webkit-scrollbar,
.settings-body::-webkit-scrollbar {
  width: 6px;
}

.digest-body::-webkit-scrollbar-thumb,
.settings-body::-webkit-scrollbar-thumb {
  background: #222a3b;
  border-radius: 3px;
}

.digest-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}

.digest-item:last-child {
  border-bottom: none;
}

.digest-index {
  font-size: 11px;
  color: var(--muted-2);
  width: 20px;
  flex: 0 0 auto;
  padding-top: 3px;
}

.digest-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 4px;
}

.digest-meta {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-bottom: 5px;
}

.digest-summary {
  font-size: 12px;
  color: #9aa4b8;
  line-height: 1.7;
}

.settings-section {
  margin-bottom: 18px;
}

.settings-section h4 {
  margin: 0 0 9px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.6px;
  font-weight: 600;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  margin-bottom: 6px;
  font-size: 12.5px;
}

.setting-row .label {
  color: var(--text);
}

.setting-row .value {
  color: var(--muted);
  font-size: 11.5px;
  text-align: right;
}

.badge {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 20px;
}

.badge.ok {
  color: #7fe0bd;
  background: rgba(53, 196, 138, 0.12);
}

.badge.no {
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.04);
}

.code-block {
  background: #0b0f18;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  padding: 12px 14px;
  font-family: Consolas, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  color: #93a4c3;
  line-height: 1.85;
  overflow-x: auto;
  white-space: pre;
}

.hint-text {
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.7;
  margin: 8px 0 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  z-index: 200;
  padding: 10px 18px;
  background: #1b2333;
  color: var(--text);
  border: 1px solid #2d3850;
  border-radius: 10px;
  font-size: 12.5px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  max-width: 80vw;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.skeleton {
  height: 112px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #121722 25%, #171e2c 50%, #121722 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------------- 工具能力库 ---------------- */
.main.tools-mode .stats,
.main.tools-mode .toolbar {
  display: none;
}

.tools-view {
  padding: 20px 0 6px;
}

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

.tools-head h2 {
  margin: 0 0 6px;
  font-size: 19px;
  letter-spacing: 0.3px;
}

.tools-head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 640px;
}

.tools-meta {
  font-size: 11.5px;
  color: var(--muted-2);
  white-space: nowrap;
  padding-bottom: 3px;
}

.tools-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 13px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted-2);
  margin-bottom: 12px;
}

.tools-search:focus-within {
  border-color: rgba(192, 132, 252, 0.5);
}

.tools-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
}

.tools-search input::placeholder {
  color: var(--muted-2);
}

.tool-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tool-types .chip {
  border: 1px solid var(--border-soft);
  background: var(--panel);
}

.tool-types .chip.active {
  border-color: rgba(192, 132, 252, 0.42);
  background: rgba(192, 132, 252, 0.12);
  color: #e3ccff;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
  align-items: start;
}

.tool-card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.tool-card:hover {
  border-color: #2f3a52;
  background: #141a26;
}

.tool-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tool-name {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.tool-vendor {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted-2);
}

.tool-type {
  flex: 0 0 auto;
  font-size: 10.5px;
  color: #d8b4fe;
  background: rgba(192, 132, 252, 0.12);
  border: 1px solid rgba(192, 132, 252, 0.24);
  border-radius: 20px;
  padding: 3px 8px;
  white-space: nowrap;
}

.tool-summary {
  margin: 9px 0 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: #aab3c5;
}

.tool-section {
  margin-top: 12px;
}

.tool-label {
  font-size: 10.5px;
  color: var(--muted-2);
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.tool-capabilities {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tool-capabilities li {
  position: relative;
  padding-left: 14px;
  font-size: 12px;
  color: #98a2b6;
  line-height: 1.65;
}

.tool-capabilities li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c084fc;
  opacity: 0.8;
}

.tool-boundary {
  margin-top: 11px;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(240, 180, 41, 0.07);
  border: 1px solid rgba(240, 180, 41, 0.18);
  font-size: 11.5px;
  color: #cbb47a;
  line-height: 1.65;
}

.tool-boundary span {
  display: inline-block;
  margin-right: 6px;
  font-size: 10px;
  color: var(--gold);
  border: 1px solid rgba(240, 180, 41, 0.35);
  border-radius: 4px;
  padding: 0 5px;
}

.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tool-tags-bottom {
  margin-top: 12px;
}

.tool-deploy {
  margin-top: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: var(--bg-soft);
  padding: 9px 12px;
}

.tool-deploy summary {
  cursor: pointer;
  font-size: 12px;
  color: #9db9ff;
  outline: none;
}

.tool-deploy summary::marker {
  color: var(--muted-2);
}

.tool-deploy ol {
  margin: 9px 0 2px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tool-deploy li {
  font-size: 11.5px;
  color: #98a2b6;
  line-height: 1.6;
}

.tool-deploy code {
  font-family: Consolas, "SF Mono", Menlo, monospace;
}

.tool-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-soft);
  flex-wrap: wrap;
}

.tool-os {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--muted-2);
}

@media (max-width: 1080px) {
  .app {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .main {
    padding: 0 22px 32px;
  }
}

@media (max-width: 860px) {
  .app {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 60;
    left: 0;
    top: 0;
    width: 272px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: none;
  }

  .only-mobile {
    display: inline-block;
  }

  .main {
    padding: 0 14px 26px;
  }

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

  .top-actions .ghost {
    display: none;
  }

  .topbar {
    gap: 8px;
  }

  .card {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 14px;
  }

  .score {
    width: 42px;
    height: 42px;
  }

  .score-num {
    font-size: 14px;
  }

  .result-meta {
    width: 100%;
    margin-left: 0;
  }

  .tools-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }
}

/* ================= 浅色杂志风主题 ================= */
:root {
  --bg: #e7e4dd;
  --bg-soft: #dedbd3;
  --panel: #f1eee8;
  --panel-2: #ece9e2;
  --border: #d2ccc0;
  --border-soft: #ddd7cb;
  --text: #3b3630;
  --muted: #6c6559;
  --muted-2: #958d80;
  --accent: #9a6250;
  --accent-soft: rgba(154, 98, 80, 0.09);
  --teal: #0f766e;
  --gold: #a16207;
  --danger: #b91c1c;
  --green: #15803d;
  --radius: 4px;
  --shadow: 0 18px 40px rgba(45, 38, 28, 0.12);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, "Times New Roman", serif;
}

html,
body {
  background: var(--bg);
  color: var(--text);
}

.brand-title,
.card-title,
.tools-head h2,
.modal-head h3,
.empty h3,
.tool-name,
.stat-value,
.digest-title {
  font-family: var(--serif);
}

/* 侧栏 */
.sidebar {
  background: #ece9e0;
  border-right: 1px solid var(--border-soft);
}

.sidebar::-webkit-scrollbar-thumb,
.source-list::-webkit-scrollbar-thumb {
  background: #ddd7c9;
}

.brand {
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 18px;
}

.brand-mark {
  background: #3f3a34;
  color: #f1eee8;
  border-radius: 3px;
  box-shadow: none;
  font-family: var(--serif);
}

.brand-title {
  font-size: 19px;
  letter-spacing: 1px;
}

.brand-sub {
  letter-spacing: 1.6px;
  color: var(--muted-2);
}

.nav-item {
  border-radius: 2px;
  color: var(--muted);
}

.nav-item:hover {
  background: #e6e2d8;
  color: var(--text);
}

.nav-item.active {
  background: transparent;
  border-color: transparent;
  border-left: 2px solid var(--accent);
  border-radius: 0;
  color: var(--text);
  font-weight: 600;
  padding-left: 10px;
}

.nav-count {
  background: #e6e2d8;
  color: var(--muted-2);
  border-radius: 2px;
}

.nav-item.active .nav-count {
  background: var(--accent);
  color: #fff;
}

.side-title {
  letter-spacing: 1.6px;
  color: var(--muted-2);
}

.cat-item {
  border-radius: 2px;
  color: var(--muted);
}

.cat-item:hover {
  background: #e6e2d8;
  color: var(--text);
}

.cat-item.active {
  background: #e2ded4;
  color: var(--text);
}

.topic-chip {
  border-radius: 2px;
  border-color: var(--border);
  color: var(--muted);
  background: var(--panel);
}

.topic-chip:hover {
  border-color: var(--text);
  color: var(--text);
}

.topic-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.source-dot.ok {
  box-shadow: none;
}

.status-pill {
  background: var(--panel);
  border-color: var(--border-soft);
  border-radius: 2px;
}

.status-pill.on {
  color: var(--green);
  border-color: rgba(21, 128, 61, 0.3);
}

/* 顶栏 */
.topbar {
  background: rgba(232, 229, 221, 0.94);
  border-bottom: 1px solid var(--border);
}

.search-wrap {
  background: var(--panel);
  border-color: var(--border);
  border-radius: 3px;
}

.search-wrap:focus-within {
  border-color: var(--text);
}

.btn {
  background: var(--panel);
  border-color: var(--border);
  border-radius: 3px;
  color: var(--text);
}

.btn:hover {
  background: #e6e2d8;
  border-color: #c6beae;
}

.btn.primary {
  background: #3f3a34;
  border-color: #3f3a34;
  color: #fff;
  box-shadow: none;
}

.btn.primary:hover {
  background: #3a332a;
  border-color: #3a332a;
  filter: none;
}

.icon-btn {
  background: var(--panel);
  border-color: var(--border);
  border-radius: 3px;
}

/* 统计与筛选 */
.stat-card {
  background: var(--panel);
  border-color: var(--border-soft);
  border-radius: var(--radius);
}

.stat-card::after {
  display: none;
}

.stat-label {
  letter-spacing: 0.4px;
}

.stat-value {
  font-size: 26px;
  font-weight: 600;
}

.filter-group {
  background: var(--panel);
  border-color: var(--border);
  border-radius: 3px;
}

.chip {
  border-radius: 2px;
  color: var(--muted);
}

.chip:hover {
  color: var(--text);
}

.chip.active {
  background: #3f3a34;
  color: #fff;
  box-shadow: none;
}

.filter-tag {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(180, 71, 42, 0.24);
  border-radius: 2px;
}

/* 资讯卡片 */
.card {
  background: var(--panel);
  border-color: var(--border-soft);
  border-radius: var(--radius);
}

.card:hover {
  border-color: #c6beae;
  background: var(--panel);
  box-shadow: 0 6px 16px rgba(45, 38, 28, 0.06);
}

.score {
  background: var(--panel-2);
  border-color: var(--border-soft);
  border-radius: 3px;
}

.score-num {
  font-family: var(--serif);
  font-size: 17px;
}

.score-label {
  letter-spacing: 0.8px;
}

.score.low .score-num {
  color: var(--muted-2);
}

.cat-tag {
  border-radius: 2px;
  font-weight: 700;
}

.cat-research {
  color: #77699a;
  background: #e8e5ee;
}

.cat-explainer {
  color: #57798c;
  background: #e3eaed;
}

.cat-tech {
  color: #5d7297;
  background: #e6e9f0;
}

.cat-tooling {
  color: #7d6da1;
  background: #eae6ef;
}

.cat-robotics {
  color: #4f7b74;
  background: #e4ebe8;
}

.cat-policy {
  color: #8a7449;
  background: #efe9db;
}

.cat-product {
  color: #96677a;
  background: #f0e6e9;
}

.cat-funding {
  color: #9a6d55;
  background: #efe6df;
}

.meta-sep {
  color: #c9c1b2;
}

.pending-tag {
  border-color: var(--border);
  color: var(--muted-2);
}

.card-title {
  font-size: 19px;
  line-height: 1.5;
  font-weight: 600;
}

.card-title a:hover {
  color: var(--accent);
}

.card-orig {
  color: var(--muted-2);
}

.card-summary {
  color: #4a443a;
}

.point-list li {
  color: #4a443a;
}

.point-list li::before {
  background: var(--accent);
}

.card-tag {
  background: #e9e5db;
  border-color: var(--border-soft);
  color: var(--muted);
  border-radius: 2px;
}

.card-actions {
  border-top-color: var(--border-soft);
}

.link-out {
  color: var(--accent);
}

.action-btn {
  color: var(--muted-2);
}

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

.empty-mark {
  background: var(--panel);
  border-color: var(--border);
  color: var(--muted-2);
}

.page-foot {
  color: #a89f8f;
}

/* 弹窗 */
.modal {
  background: rgba(59, 54, 48, 0.32);
  backdrop-filter: blur(3px);
}

.modal-panel {
  background: #f6f3ec;
  border-color: var(--border);
  border-radius: 8px;
}

.modal-head {
  border-bottom-color: var(--border-soft);
}

.modal-foot {
  border-top-color: var(--border-soft);
}

.seg button {
  background: var(--panel);
  border-color: var(--border);
  color: var(--muted);
  border-radius: 2px;
}

.seg button.active {
  background: #3f3a34;
  border-color: #3f3a34;
  color: #fff;
}

.digest-body::-webkit-scrollbar-thumb,
.settings-body::-webkit-scrollbar-thumb {
  background: #ddd7c9;
}

.digest-item {
  border-bottom-color: var(--border-soft);
}

.digest-index {
  font-family: var(--serif);
}

.digest-summary {
  color: #4a443a;
}

.setting-row {
  background: var(--panel-2);
  border-color: var(--border-soft);
  border-radius: 3px;
}

.badge.ok {
  color: var(--green);
  background: rgba(21, 128, 61, 0.09);
}

.badge.no {
  color: var(--muted-2);
  background: #f1ede4;
}

.code-block {
  background: #e9e5db;
  border-color: var(--border-soft);
  color: #4a443a;
}

.hint-text {
  color: var(--muted-2);
}

/* 提示与骨架 */
.toast {
  background: #3f3a34;
  color: #f6f4ef;
  border-color: #3f3a34;
  border-radius: 3px;
}

.skeleton {
  background: linear-gradient(90deg, #e3dfd5 25%, #efebe2 50%, #e3dfd5 75%);
  background-size: 200% 100%;
}

/* 工具能力库 */
.tools-head h2 {
  font-size: 24px;
  font-weight: 600;
}

.tools-search {
  background: var(--panel);
  border-color: var(--border);
  border-radius: 3px;
}

.tools-search:focus-within {
  border-color: var(--text);
}

.tool-types .chip {
  background: var(--panel);
  border-color: var(--border);
}

.tool-types .chip.active {
  background: #3f3a34;
  border-color: #3f3a34;
  color: #fff;
}

.tool-card {
  background: var(--panel);
  border-color: var(--border-soft);
  border-radius: var(--radius);
}

.tool-card:hover {
  border-color: #c6beae;
  background: var(--panel);
}

.tool-name {
  font-size: 18px;
  font-weight: 600;
}

.tool-type {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(154, 98, 80, 0.25);
  border-radius: 2px;
}

.tool-summary {
  color: #4a443a;
}

.tool-label {
  letter-spacing: 1.4px;
}

.tool-capabilities li {
  color: #4a443a;
}

.tool-capabilities li::before {
  background: var(--accent);
}

.tool-boundary {
  background: #f4edda;
  border-color: #e6d8b6;
  color: #715a1e;
}

.tool-boundary span {
  color: var(--gold);
  border-color: rgba(161, 98, 7, 0.35);
}

.tool-deploy {
  background: var(--panel-2);
  border-color: var(--border-soft);
}

.tool-deploy summary {
  color: var(--accent);
}

.tool-deploy li {
  color: #4a443a;
}

.tool-foot {
  border-top-color: var(--border-soft);
}

/* ================= 护眼模式（暖绿纸感） ================= */
html.eye-care {
  --bg: #d9dfd2;
  --bg-soft: #d0d7c9;
  --panel: #e1e6d9;
  --panel-2: #dae1d2;
  --border: #c2cab8;
  --border-soft: #ccd4c3;
  --text: #3a4238;
  --muted: #646d61;
  --muted-2: #899285;
  --accent: #8c6150;
  --accent-soft: rgba(140, 97, 80, 0.1);
  --green: #4f7156;
  --shadow: 0 16px 36px rgba(47, 56, 46, 0.1);
}

html.eye-care body {
  background: var(--bg);
  color: var(--text);
}

html.eye-care .topbar {
  background: rgba(217, 223, 210, 0.94);
}

html.eye-care .sidebar {
  background: #d5ddd0;
}

html.eye-care .nav-item:hover,
html.eye-care .cat-item:hover,
html.eye-care .btn:hover {
  background: #cad3c3;
  border-color: #b7c1ad;
}

html.eye-care .nav-count {
  background: #d0d9c8;
}

html.eye-care .cat-item.active {
  background: #c8d1c0;
}

html.eye-care .card-tag,
html.eye-care .code-block {
  background: #d1dac8;
}

html.eye-care .badge.no {
  background: #d4ddcc;
}

html.eye-care .modal-panel {
  background: #e4e9de;
}

html.eye-care .skeleton {
  background: linear-gradient(90deg, #cbd4c2 25%, #d9dfd2 50%, #cbd4c2 75%);
  background-size: 200% 100%;
}

html.eye-care .tool-boundary {
  background: #e1dfcb;
  border-color: #d0cfb4;
  color: #66613f;
}

html.eye-care .toast {
  background: #3a4238;
  border-color: #3a4238;
  color: #e1e6d9;
}

html.eye-care .cat-research {
  color: #6e6485;
  background: #dde0e4;
}

html.eye-care .cat-explainer {
  color: #5a7681;
  background: #d9e2e3;
}

html.eye-care .cat-tech {
  color: #5f7088;
  background: #dce2e6;
}

html.eye-care .cat-tooling {
  color: #746a8c;
  background: #e0dfe5;
}

html.eye-care .cat-robotics {
  color: #55766f;
  background: #d9e3df;
}

html.eye-care .cat-policy {
  color: #7e704d;
  background: #e4e1d2;
}

html.eye-care .cat-product {
  color: #8a6a76;
  background: #e6dee0;
}

html.eye-care .cat-funding {
  color: #8c6d5a;
  background: #e5dfd7;
}

html.eye-care .card-summary,
html.eye-care .point-list li,
html.eye-care .digest-summary,
html.eye-care .tool-summary,
html.eye-care .tool-capabilities li,
html.eye-care .tool-deploy li {
  color: #48503f;
}

.eye-btn.on {
  color: var(--accent);
  border-color: rgba(154, 98, 80, 0.35);
  background: var(--accent-soft);
}