:root {
  --bg: #060a10;
  --bg-soft: #0b1220;
  --panel: rgba(8, 16, 30, 0.72);
  --panel-strong: rgba(8, 16, 30, 0.9);
  --text: #edf2ff;
  --text-soft: rgba(237, 242, 255, 0.76);
  --line: rgba(157, 184, 217, 0.28);
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --warn: #fb7185;
  --ok: #34d399;
  --shadow: 0 20px 45px rgba(1, 5, 12, 0.42);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --content-max: 1180px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1400px 780px at 8% -15%, rgba(56, 189, 248, 0.24), transparent 60%),
    radial-gradient(980px 680px at 90% -10%, rgba(45, 212, 191, 0.2), transparent 64%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
  color: var(--text);
  font-family: "Avenir Next", "SF Pro Display", "PingFang SC", "Noto Sans SC", sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

#bg {
  position: fixed;
  inset: 0;
  z-index: -3;
}

.glow-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 18% 15%, rgba(61, 224, 187, 0.09), transparent 35%),
    radial-gradient(circle at 84% 12%, rgba(56, 189, 248, 0.11), transparent 36%);
  pointer-events: none;
}

main {
  width: min(var(--content-max), 92vw);
  margin: 0 auto;
  padding-bottom: 80px;
}

.topbar {
  width: min(var(--content-max), 92vw);
  margin: 22px auto 0;
  position: sticky;
  top: 10px;
  z-index: 30;
}

.topbar-inner {
  background: rgba(5, 10, 16, 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav a {
  color: var(--text-soft);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.92rem;
  transition: background 0.25s ease, color 0.25s ease;
}

.nav a:hover,
.nav a.active {
  background: rgba(56, 189, 248, 0.14);
  color: #eff6ff;
}

.hero {
  margin-top: 64px;
  margin-bottom: 36px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 4.1rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 830;
  max-width: 13ch;
  text-wrap: balance;
}

.hero h1.gradient {
  background: linear-gradient(115deg, #ecfeff, #c4b5fd 38%, #67e8f9 75%, #ecfeff);
  background-size: 180% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 6s linear infinite;
}

.hero p {
  margin-top: 14px;
  max-width: 58ch;
  color: var(--text-soft);
  font-size: clamp(1rem, 2vw, 1.16rem);
}

.hero-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.btn-primary {
  color: #031523;
  background: linear-gradient(125deg, var(--accent), #67e8f9);
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-secondary {
  color: var(--text);
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--line);
}

.page-section {
  margin-top: 30px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.8vw, 1.9rem);
  letter-spacing: 0.01em;
}

.section-head p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.card-grid.tight {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  transform: translateY(0);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(125, 211, 252, 0.55);
}

.card-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.35), rgba(14, 116, 144, 0.35));
}

.card-body {
  padding: 14px 15px 16px;
}

.card-title {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.card-text {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.card-link {
  color: inherit;
  text-decoration: none;
  display: block;
  height: 100%;
}

.badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: rgba(226, 232, 240, 0.88);
}

.badge.accent {
  border-color: rgba(56, 189, 248, 0.35);
  color: rgba(125, 211, 252, 0.95);
}

.controls {
  margin: 16px 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.62);
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.94rem;
}

.search {
  width: min(360px, 100%);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(125, 211, 252, 0.8);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.empty {
  border: 1px dashed rgba(148, 163, 184, 0.38);
  color: var(--text-soft);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
}

.site-footer {
  width: min(var(--content-max), 92vw);
  margin: 0 auto 30px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  color: rgba(226, 232, 240, 0.66);
  font-size: 0.88rem;
}

.post {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.post-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.35), rgba(14, 116, 144, 0.35));
}

.post-head {
  padding: 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.post-head h1 {
  margin: 0;
  font-size: clamp(1.4rem, 3.6vw, 2.35rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.post-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-content {
  padding: 20px;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5 {
  line-height: 1.35;
  margin: 18px 0 10px;
}

.post-content p {
  margin: 10px 0;
  color: rgba(237, 242, 255, 0.9);
}

.post-content ul,
.post-content ol {
  margin: 8px 0 10px;
  padding-left: 20px;
}

.post-content blockquote {
  margin: 12px 0;
  border-left: 3px solid rgba(94, 234, 212, 0.62);
  background: rgba(15, 23, 42, 0.55);
  padding: 8px 12px;
  border-radius: 8px;
}

.post-content a {
  color: #7dd3fc;
}

.post-content code {
  font-family: "SF Mono", "Fira Code", monospace;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.88em;
}

.toast-wrap {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 180px;
  max-width: 260px;
  background: rgba(2, 6, 23, 0.9);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.87rem;
  box-shadow: var(--shadow);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.toast.success {
  border-color: rgba(52, 211, 153, 0.45);
}

.toast.error {
  border-color: rgba(251, 113, 133, 0.45);
}

.toast.out {
  opacity: 0;
  transform: translateY(10px);
}

@keyframes shine {
  to {
    background-position: 180% center;
  }
}

@media (max-width: 900px) {
  .topbar-inner {
    border-radius: 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    width: 100%;
  }

  .hero {
    margin-top: 34px;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  body {
    line-height: 1.58;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }
}
