:root {
  --bg: #0f1117;
  --card: #1a1e2a;
  --card-border: #2a3040;
  --text: #e6e8ee;
  --muted: #9aa3b5;
  --accent: #f59e0b;
  --accent-soft: #fbbf24;
  --green: #34d399;
  --red: #f87171;
  --blue: #60a5fa;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* 左右布局：左侧筛选 + 右侧列表 */
.layout { display: flex; gap: 24px; align-items: flex-start; }

.sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.main-content { flex: 1; min-width: 0; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; position: static; max-height: none; }
}

header.site-header {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 32px;
}

.site-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-header .subtitle { color: var(--muted); margin-top: 8px; font-size: 0.95rem; }

nav.site-nav { margin-top: 16px; display: flex; gap: 20px; }
nav.site-nav a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
nav.site-nav a:hover { color: var(--accent); }

/* 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 18px;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--accent); }

.card .date { color: var(--muted); font-size: 0.85rem; margin-bottom: 4px; }
.card h2 { font-size: 1.25rem; margin-bottom: 8px; }
.card h2 a { color: var(--text); text-decoration: none; }
.card h2 a:hover { color: var(--accent); }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.badge {
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  color: var(--muted);
  background: rgba(255,255,255,0.03);
}
.badge.hot { color: var(--accent); border-color: var(--accent); }
.badge.green { color: var(--green); border-color: var(--green); }
.badge.blue { color: var(--blue); border-color: var(--blue); }

.card .summary { color: var(--muted); font-size: 0.92rem; }

/* 详情页 */
.article-header { margin-bottom: 28px; }
.article-header h1 { font-size: 1.7rem; line-height: 1.4; margin: 10px 0; }
.article-header .meta { color: var(--muted); font-size: 0.9rem; }
.article-header .source-link a { color: var(--blue); text-decoration: none; word-break: break-all; }

table.dim-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 28px;
  font-size: 0.92rem;
}
table.dim-table th, table.dim-table td {
  border: 1px solid var(--card-border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
table.dim-table th { background: rgba(255,255,255,0.04); color: var(--accent); width: 140px; white-space: nowrap; }

.article-body { font-size: 0.98rem; }
.article-body h2 {
  font-size: 1.2rem;
  margin: 28px 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}
.article-body h3 { font-size: 1.05rem; margin: 20px 0 10px; }
.article-body p { margin-bottom: 12px; }
.article-body ul, .article-body ol { margin: 0 0 12px 22px; }
.article-body li { margin-bottom: 6px; }
.article-body code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 4px; font-size: 0.88em; }
.article-body blockquote {
  border-left: 4px solid var(--card-border);
  padding: 8px 16px;
  margin: 12px 0;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  border-radius: 0 8px 8px 0;
}

/* 归档页 */
.archives-year { margin-bottom: 28px; }
.archives-year h2 { color: var(--accent); font-size: 1.15rem; margin-bottom: 12px; }
.archives-year ul { list-style: none; }
.archives-year li { padding: 8px 0; border-bottom: 1px dashed var(--card-border); font-size: 0.92rem; }
.archives-year li a { color: var(--text); text-decoration: none; }
.archives-year li a:hover { color: var(--accent); }
.archives-year li .d { color: var(--muted); margin-right: 12px; }

/* 评分条 */
.score-row { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.score-bar { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.score-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-soft)); border-radius: 4px; }
.score-label { font-size: 0.85rem; color: var(--muted); width: 140px; }

/* 筛选栏（左侧边栏） */
.filter-panel {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 0;
}
.filter-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin: 6px 0 10px;
}
.filter-title:first-child { margin-top: 0; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filter-chips:last-child { margin-bottom: 0; }
.chip {
  font-size: 0.8rem;
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1a1a;
  font-weight: 700;
}
.filter-count { font-size: 0.82rem; color: var(--accent); padding-top: 6px; }

/* 卡片内标签 */
.tags-line { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; }
.tag-mini {
  font-size: 0.72rem;
  padding: 1px 8px;
  border-radius: 4px;
  background: rgba(96, 165, 250, 0.1);
  color: var(--blue);
  border: 1px solid rgba(96, 165, 250, 0.2);
}

/* 详情页信心指数卡片 */
.confidence-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.03));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0 8px;
}
.confidence-card .conf-big { font-size: 2rem; font-weight: 800; color: var(--accent); }
.confidence-card .conf-label { color: var(--muted); font-size: 0.85rem; }
.dim-scores { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; }
.dim-score { flex: 1; min-width: 130px; }
.dim-score .dim-name { font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }
.dim-score .dim-bar { height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.dim-score .dim-fill { height: 100%; background: var(--accent); border-radius: 3px; }

footer.site-footer {
  margin-top: 60px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

@media (max-width: 600px) {
  .container { padding: 0 14px; }
  .site-header h1 { font-size: 1.4rem; }
  .article-header h1 { font-size: 1.35rem; }
  table.dim-table th { width: 96px; font-size: 0.82rem; padding: 8px; }
  table.dim-table td { font-size: 0.85rem; padding: 8px; }
}

/* 卡片可点击 */
.project-card {
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.08);
}
.project-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.project-card .card-hint {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.7;
  text-align: right;
  transition: opacity 0.15s;
}
.project-card:hover .card-hint { opacity: 1; color: var(--accent); }

/* 右侧滑出详情层 */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
  z-index: 1000;
}
.detail-overlay.open { opacity: 1; visibility: visible; }

.detail-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(640px, 92vw);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--card-border);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.detail-overlay.open .detail-panel { transform: translateX(0); }

.detail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--card-border);
  background: var(--card);
  flex-shrink: 0;
}
.detail-close {
  background: none;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 1rem;
  width: 34px;
  height: 34px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.detail-close:hover { color: var(--red); border-color: var(--red); }
.detail-open { color: var(--blue); text-decoration: none; font-size: 0.85rem; }
.detail-open:hover { text-decoration: underline; }

.detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 40px;
  -webkit-overflow-scrolling: touch;
}
.detail-content .article-header h1 { font-size: 1.45rem; }
.detail-content .article-body h2 { font-size: 1.1rem; margin-top: 20px; }
.detail-loading { color: var(--muted); text-align: center; padding: 60px 0; }

body.no-scroll { overflow: hidden; }

/* 信号流存档页 */
.signal-entry {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 10px 0;
}
.signal-entry h3 {
  font-size: 1rem;
  margin: 6px 0 6px;
  color: var(--text);
}
.signal-summary {
  color: var(--text);
  opacity: 0.85;
  font-size: 0.9rem;
  margin: 0 0 6px;
}
.signal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}
.signal-meta a { color: var(--blue); text-decoration: none; }
.signal-meta a:hover { text-decoration: underline; }
.signal-cat {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}
.signal-cat-ai工具趁早 { background: rgba(59, 130, 246, 0.12); color: #60a5fa; }
.signal-cat-开源商机 { background: rgba(34, 197, 94, 0.12); color: #4ade80; }
.signal-cat-国内副业灵感 { background: rgba(236, 72, 153, 0.12); color: #f472b6; }
.signal-cat-独立项目机会 { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.signal-replicable {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
}

@media (max-width: 600px) {
  .detail-panel { width: 100vw; }
  .detail-content { padding: 18px 16px 32px; }
}
