:root {
  --bg-primary: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-hover: #293548;
  --border-color: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --accent-dim: rgba(56, 189, 248, 0.12);
  --badge-bg: rgba(56, 189, 248, 0.15);
  --badge-text: #7dd3fc;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --radius: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #0284c7;
    --accent-hover: #0369a1;
    --accent-dim: rgba(2, 132, 199, 0.08);
    --badge-bg: #e0f2fe;
    --badge-text: #0369a1;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  }
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header {
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
  padding: 28px 0;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.branding {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.branding h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.branding p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.search-box {
  position: relative;
  min-width: 260px;
  flex-grow: 1;
  max-width: 360px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

/* Main */
main {
  flex: 1;
  padding: 40px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.count-badge {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

/* Project Grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--bg-surface-hover);
}

.card-top {
  margin-bottom: 20px;
}

.card-header-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.project-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.version-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--badge-text);
  background: var(--badge-bg);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.project-path {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.updated-time {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.open-link {
  color: var(--accent);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius);
  max-width: 600px;
  margin: 40px auto;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.empty-state code {
  font-family: var(--font-mono);
  background: var(--bg-primary);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--accent);
  font-size: 0.85rem;
}

/* 404 */
.not-found-container {
  text-align: center;
  padding: 80px 20px;
  max-width: 500px;
  margin: 0 auto;
}

.not-found-code {
  font-size: 5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #0f172a;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 22px;
  border-radius: 8px;
  margin-top: 24px;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}
