/* Vibe Coding Wiki · Reusable Components Library
 * Used by all pages. Named with .vc- prefix to avoid conflict.
 */

/* ============ Card ============ */
.vc-card {
  padding: 20px;
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  transition: all 0.2s var(--ease-out-quart);
}

.vc-card:hover {
  background: var(--c-paper-deep);
}

.vc-card--hl { border-top: 4px solid var(--c-shihqing); }
.vc-card--brand { border-top: 4px solid var(--c-liujin); }
.vc-card--gold { border-top: 4px solid var(--c-liujin); }
.vc-card--good { border-top: 4px solid var(--c-zhuqing); }
.vc-card--crit { border-top: 4px solid var(--c-zhusha); }

.vc-card h3 {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: 8px;
}

.vc-card p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--c-ink-soft);
}

/* ============ Layer Badge ============ */
.vc-layer-badge {
  display: inline-block;
  padding: 3px 10px;
  font-family: var(--font-rounded);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  white-space: nowrap;
}

/* ============ Tag Pill ============ */
.vc-tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--c-panel-soft);
  border: 1px solid var(--c-line);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--c-ink);
  text-decoration: none;
  transition: all 0.15s;
}

.vc-tag:hover {
  background: var(--c-panel);
  border-color: var(--c-shihqing);
}

/* ============ Button ============ */
.vc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s var(--ease-out-quart);
  letter-spacing: 0.02em;
  min-height: 46px;
}

.vc-btn-primary {
  background: var(--c-ink);
  color: var(--c-paper);
  border-color: var(--c-ink);
}

.vc-btn-primary:hover {
  background: var(--c-zhusha);
  border-color: var(--c-zhusha);
}

.vc-btn-ghost {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-line-strong);
}

.vc-btn-ghost:hover {
  background: var(--c-ink);
  color: var(--c-paper);
  border-color: var(--c-ink);
}

/* ============ Layout Helpers ============ */
.vc-grid { display: grid; gap: 16px; }
.vc-grid-2 { grid-template-columns: repeat(2, 1fr); }
.vc-grid-3 { grid-template-columns: repeat(3, 1fr); }
.vc-grid-4 { grid-template-columns: repeat(4, 1fr); }

.vc-flex { display: flex; gap: 16px; }
.vc-flex-col { flex-direction: column; }
.vc-flex-wrap { flex-wrap: wrap; }

.vc-stack > * + * { margin-top: 16px; }

/* ============ Mobile-friendly navbar ============ */
.vc-nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--c-line);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 18px;
  color: var(--c-ink);
}

.vc-nav-toggle:hover {
  background: var(--c-panel-soft);
}

@media (max-width: 768px) {
  .vc-nav-toggle {
    display: inline-flex;
  }

  .topnav__links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--c-panel);
    border-bottom: 1px solid var(--c-line);
    padding: 16px 24px;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  }

  .topnav__links.vc-nav-open {
    display: flex;
  }

  .topnav__links a {
    padding: 12px 0;
    border-bottom: 1px solid var(--c-line-soft);
  }

  .topnav__links a:last-child {
    border-bottom: none;
  }

  .topnav__links a.active::after {
    display: none;
  }
}

/* ============ Hero Metric Card ============ */
.vc-metric {
  flex: 1;
  padding: 24px 28px;
  border-right: 1px solid var(--c-line-soft);
  background: var(--c-panel);
}

.vc-metric:last-child {
  border-right: none;
}

.vc-metric-value {
  font-family: var(--font-rounded);
  font-weight: 700;
  font-size: 36px;
  color: var(--c-ink);
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.vc-metric-label {
  font-size: 12px;
  color: var(--c-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ============ Bar Chart ============ */
.vc-bar-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.vc-bar-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-ink);
  font-weight: 600;
}

.vc-bar-track {
  height: 22px;
  background: var(--c-paper-deep);
  position: relative;
}

.vc-bar-fill {
  height: 100%;
  position: relative;
  transition: width 0.5s var(--ease-out-quart);
}

.vc-bar-fill span {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-rounded);
  font-size: 11px;
  font-weight: 700;
  color: var(--c-paper);
  white-space: nowrap;
}

/* ============ Health Check / Status ============ */
.vc-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-rounded);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.vc-status-ok { background: var(--c-wash-green); color: var(--c-zhuqing); }
.vc-status-warn { background: var(--c-wash-yellow); color: var(--c-ink); }
.vc-status-err { background: var(--c-wash-red); color: var(--c-zhusha); }

/* ============ Citation Block ============ */
.vc-cite {
  padding: 12px 18px;
  background: var(--c-paper-deep);
  border-left: 4px solid var(--c-liujin);
}

.vc-cite-text {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 14px;
  color: var(--c-ink);
}

.vc-cite-author {
  font-size: 12px;
  color: var(--c-muted);
  margin-top: 4px;
}

/* ============ Decorative dividers ============ */
.vc-divider {
  display: block;
  border: none;
  border-top: 1px solid var(--c-line);
  margin: 32px 0;
}

.vc-divider-strong {
  border-top: 2px solid var(--c-ink);
}

/* ============ Section spacing ============ */
.vc-section {
  padding: 56px 0 32px;
  border-top: 1px solid var(--c-line-soft);
}

.vc-section:first-child {
  border-top: none;
  padding-top: 32px;
}

/* ============ Responsive Helpers ============ */
@media (max-width: 1080px) {
  .vc-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .vc-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .vc-grid-2, .vc-grid-3, .vc-grid-4 { grid-template-columns: 1fr; }
  .vc-metric { flex-basis: 50%; border-right: none; border-bottom: 1px solid var(--c-line-soft); }
}

/* ============ SR-only helper (DEFINED HERE for reuse) ============ */
.vc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
