:root {
  --panel: rgba(12, 24, 39, 0.78);
  --line: rgba(255, 255, 255, 0.11);
  --text: #f4f6f8;
  --muted: #b8c2cc;
  --accent: #ffb950;
  --accent-soft: #ffd89a;
  --teal: #54d2c8;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --font-display: "Segoe UI Variable Display", "Bahnschrift", "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", "Trebuchet MS", sans-serif;
  --font-body: "Aptos", "Segoe UI Variable Text", "Segoe UI", sans-serif;
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 185, 80, 0.22), transparent 26%),
    radial-gradient(circle at 85% 10%, rgba(84, 210, 200, 0.18), transparent 22%),
    linear-gradient(180deg, #152034 0%, #0c1422 46%, #0a101a 100%);
  font-family: var(--font-body);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.site-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.04), transparent 22%),
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.05), transparent 18%);
}

.app-shell {
  position: relative;
  min-height: 100vh;
}

.site-container {
  width: min(1180px, calc(100% - 2rem));
}

.topbar {
  padding-top: 1.25rem;
}

.site-main {
  padding: 1.25rem 0 3rem;
}

.site-footer {
  padding: 0 0 2.5rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.2rem;
  justify-content: space-between;
  padding: 1rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 19, 30, 0.66);
  color: var(--muted);
  font-size: 0.92rem;
}

.navbar {
  padding: 1rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 17, 28, 0.68);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand-mark {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-mark__eyebrow {
  color: var(--accent-soft);
  font-size: 0.72rem;
  letter-spacing: 0.18rem;
  text-transform: uppercase;
}

.brand-mark__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04rem;
}

.hero-panel,
.info-card,
.history-panel,
.empty-state,
.message-panel,
.results-header,
.metric-card,
.repository-card,
.search-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: var(--radius-xl);
}

.hero-copy {
  padding: 1rem;
}

.hero-copy h1,
.results-header h2,
.empty-state h2,
.history-panel h2,
.info-card h1 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.14;
}

.hero-copy h1 {
  font-size: clamp(2.35rem, 4vw, 4.6rem);
  max-width: 12ch;
}

.hero-copy__lead {
  max-width: 60ch;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.section-tag {
  display: inline-flex;
  margin-bottom: 0.95rem;
  color: var(--accent-soft);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.17rem;
  text-transform: uppercase;
}

.hero-pills,
.quick-searches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-pills {
  margin-top: 1.35rem;
}

.hero-pills span,
.quick-searches a,
.language-badge,
.owner-chip,
code {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.hero-pills span {
  padding: 0.7rem 1rem;
}

.search-panel {
  padding: 1.25rem;
  border-radius: var(--radius-xl);
}

.search-form {
  display: grid;
  gap: 1rem;
}

.search-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.search-form__field {
  display: grid;
  gap: 0.45rem;
}

.field-hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.form-label {
  margin: 0;
  color: var(--accent-soft);
  font-size: 0.9rem;
  font-weight: 600;
}

.form-control,
.form-select {
  min-height: 3.3rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  background: rgba(5, 14, 24, 0.82);
  color: var(--text);
}

.form-control::placeholder {
  color: #8ea1b3;
}

.form-control:focus,
.form-select:focus,
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus {
  border-color: rgba(255, 185, 80, 0.65);
  box-shadow: 0 0 0 0.25rem rgba(255, 185, 80, 0.18);
  background: rgba(7, 16, 28, 0.96);
  color: var(--text);
}

.quick-searches a {
  padding: 0.65rem 0.95rem;
  color: var(--muted);
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.quick-searches a:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 185, 80, 0.55);
  color: var(--text);
}

.btn-search,
.btn-secondary,
.btn-outline-light {
  min-height: 3.2rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02rem;
}

.btn-search {
  border: none;
  color: #0f1726;
  background: linear-gradient(135deg, var(--accent) 0%, #ffd89a 100%);
}

.btn-search:hover {
  color: #0f1726;
  filter: brightness(1.03);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.metric-card {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
}

.metric-card__label {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.metric-card strong {
  font-family: var(--font-display);
  font-size: 1.65rem;
}

.message-panel {
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-lg);
}

.message-panel--error {
  border-color: rgba(255, 142, 136, 0.4);
  color: #ffe5e3;
}

.message-panel p {
  margin: 0.4rem 0 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.92fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
  align-items: start;
}

.results-column,
.history-column {
  min-width: 0;
}

.empty-state,
.results-header,
.history-panel,
.info-card {
  border-radius: var(--radius-xl);
}

.empty-state,
.history-panel,
.info-card {
  padding: 1.4rem;
}

.empty-state p,
.history-panel__empty,
.info-card p,
.info-list {
  margin: 0.9rem 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.results-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
  padding: 1.25rem 1.35rem;
}

.results-header > div {
  flex: 1 1 18rem;
  min-width: 0;
}

.results-header h2,
.history-panel h2,
.empty-state h2,
.info-card h1 {
  font-size: clamp(1.5rem, 2vw, 2.2rem);
}

.results-header h2 {
  overflow-wrap: anywhere;
}

code {
  flex: 1 1 24rem;
  min-width: min(100%, 24rem);
  padding: 0.75rem 1rem;
  color: var(--teal);
  font-size: 0.92rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.repository-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.repository-card {
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  min-width: 0;
}

.repository-card__head,
.repository-card__actions,
.history-item__top,
.history-item__meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.repository-card__head > *,
.repository-card__actions > * {
  min-width: 0;
}

.owner-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.75rem 0.45rem 0.45rem;
  color: var(--muted);
  min-width: 0;
  max-width: 100%;
}

.owner-chip img {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  object-fit: cover;
}

.language-badge {
  padding: 0.45rem 0.8rem;
  color: var(--accent-soft);
}

.repository-card__body h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.repository-card__body p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.repository-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 0;
}

.repository-meta div {
  padding: 0.8rem 0.85rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
}

.repository-meta dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.repository-meta dd {
  margin: 0.35rem 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.history-panel__head {
  margin-bottom: 0.95rem;
}

.history-list {
  display: grid;
  gap: 0.8rem;
}

.history-item {
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.history-item:hover {
  transform: translateY(-2px);
  border-color: rgba(84, 210, 200, 0.4);
  background: rgba(84, 210, 200, 0.08);
}

.history-item__top strong {
  font-size: 1rem;
}

.history-item__top span,
.history-item__meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.history-item__meta {
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-top: 0.55rem;
}

.info-page {
  max-width: 820px;
  margin: 0 auto;
}

.info-list {
  padding-left: 1.25rem;
}

@media (max-width: 1199.98px) {
  .hero-panel,
  .dashboard-grid,
  .repository-grid,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: none;
  }
}

@media (max-width: 767.98px) {
  .site-container {
    width: min(100% - 1rem, 100%);
  }

  .navbar,
  .site-footer__inner,
  .hero-panel,
  .search-panel,
  .metric-card,
  .message-panel,
  .empty-state,
  .results-header,
  .repository-card,
  .history-panel,
  .info-card {
    border-radius: 1.4rem;
  }

  .hero-panel,
  .search-panel,
  .repository-card,
  .history-panel,
  .info-card,
  .metric-card {
    padding: 1rem;
  }

  .hero-copy {
    padding: 0;
  }

  .hero-copy h1 {
    font-size: 2.35rem;
  }

  .search-form__grid,
  .repository-meta {
    grid-template-columns: 1fr;
  }

  .results-header,
  .repository-card__head,
  .repository-card__actions,
  .history-item__top {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer__inner {
    border-radius: 1.2rem;
  }
}
