:root {
  color-scheme: dark;
  --bg: #060b16;
  --bg-panel: rgba(12, 22, 43, 0.78);
  --bg-card: rgba(8, 18, 38, 0.92);
  --text: #ebf2ff;
  --muted: #9ab0d8;
  --line: rgba(124, 176, 255, 0.28);
  --primary: #44d3ff;
  --accent: #8b8dff;
  --dna: #6ee7b7;
  --shadow: 0 20px 45px rgba(0, 5, 20, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(0, 127, 255, 0.18), transparent 42%),
    radial-gradient(circle at 85% 8%, rgba(139, 141, 255, 0.22), transparent 36%),
    linear-gradient(160deg, #040913 0%, #09142b 42%, #071222 100%);
  color: var(--text);
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(38px);
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}

.bg-glow-1 {
  background: #5f7dff;
  top: -120px;
  left: -100px;
}

.bg-glow-2 {
  background: #02b7ff;
  bottom: -120px;
  right: -80px;
}

.container {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--primary);
}

.hero {
  margin-bottom: 32px;
}

.tag {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #b9d8ff;
  letter-spacing: 0.08em;
  font-size: 12px;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4.8vw, 44px);
  line-height: 1.15;
  letter-spacing: 0.04em;
  font-family: "Orbitron", "Segoe UI", "PingFang SC", sans-serif;
  font-weight: 600;
  background: linear-gradient(90deg, #77e7ff 0%, #57adff 45%, #8b8dff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(14px, 2vw, 17px);
  line-height: 1.6;
  max-width: 720px;
}

.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.stat-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 128, 255, 0.08);
  font-size: 13px;
  color: #b3c7e8;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.search-bar {
  margin-bottom: 24px;
}

.search-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.search-input-wrap {
  position: relative;
  max-width: 520px;
}

.search-input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text);
  font-size: 15px;
  outline: none;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input::placeholder {
  color: rgba(154, 176, 216, 0.65);
}

.search-input:focus {
  border-color: rgba(94, 213, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(68, 211, 255, 0.15);
}

/* 隐藏浏览器原生 search 清除按钮，避免与自定义 × 重复 */
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-input::-ms-clear,
.search-input::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(124, 176, 255, 0.12);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.search-clear:hover {
  background: rgba(124, 176, 255, 0.22);
  color: var(--text);
}

.search-meta {
  margin: 8px 0 0;
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
}

.search-empty {
  margin: 0 0 20px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px dashed rgba(124, 176, 255, 0.35);
  background: rgba(12, 22, 43, 0.55);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.practice-card.is-hidden {
  display: none;
}

.practice-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.practice-card:hover {
  transform: translateY(-3px);
  border-color: rgba(94, 213, 255, 0.75);
  box-shadow: 0 16px 36px rgba(0, 128, 255, 0.22);
}

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

.card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.card-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
  border: 1px solid rgba(110, 231, 183, 0.35);
  color: var(--dna);
  background: rgba(16, 185, 129, 0.1);
}

.stars {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 14px;
}

.star {
  font-size: 16px;
  line-height: 1;
}

.star-filled {
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.star-empty {
  color: rgba(155, 176, 216, 0.35);
}

.star-label {
  margin-left: 8px;
  font-size: 12px;
  color: var(--muted);
}

.card-section {
  margin-bottom: 14px;
}

.card-section:last-of-type {
  margin-bottom: 0;
}

.section-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
}

.section-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: #b8c9e8;
}

.dna-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.65;
  color: #a8c4e8;
}

.dna-list li {
  margin-bottom: 4px;
}

.dna-list li::marker {
  color: var(--dna);
}

.card-footer {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(124, 176, 255, 0.15);
}

.repo-link {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
}

.repo-arrow {
  color: var(--muted);
  font-size: 18px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.practice-card:hover .repo-arrow {
  transform: translateX(4px);
  color: var(--primary);
}

.site-footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px 24px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.site-footer__line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: #8e9196;
}

.site-footer__sep {
  color: #6d7178;
  user-select: none;
}

.site-footer .site-footer__link,
.site-footer .site-footer__link:link,
.site-footer .site-footer__link:visited,
.site-footer .site-footer__link:active {
  color: #8e9196 !important;
  text-decoration: none;
  border-bottom: 1px solid rgba(142, 145, 150, 0.4);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-footer .site-footer__link:hover {
  color: #a3a6ab !important;
  border-bottom-color: rgba(163, 166, 171, 0.55);
}

@media (max-width: 900px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 32px 16px 48px;
  }

  .practice-card {
    padding: 18px;
  }

  .card-header {
    flex-direction: column;
    gap: 8px;
  }
}
