:root {
  --ink: #0a0a0a;
  --paper: #f4f5f3;
  --muted: #6f736b;
  --line: rgba(10, 10, 10, 0.14);
  --coral: #ff5a4f;
  --cyan: #00b8a9;
  --amber: #f5b83d;
  --green: #7ac74f;
  --violet: #8f63ff;
  --white: #ffffff;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(10, 10, 10, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(10, 10, 10, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

img {
  display: block;
  max-width: 100%;
}

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

p,
h1,
h2,
h3 {
  margin: 0;
}

button,
input {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 20;
  padding: 10px 14px;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  min-height: 92vh;
  padding: 24px clamp(18px, 4vw, 56px) 52px;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.26)),
    url("../images/gallery/8.jpg") center / cover;
  overflow: hidden;
}

.site-header:after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(transparent 0 94%, rgba(255, 255, 255, 0.12) 95%),
    linear-gradient(90deg, transparent 0 94%, rgba(255, 255, 255, 0.1) 95%);
  background-size: 28px 28px;
  mix-blend-mode: screen;
  opacity: 0.24;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(0, 0, 0, 0.22);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
  background: var(--amber);
  border-color: var(--amber);
}

.hero {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: calc(92vh - 90px);
  flex-direction: column;
  justify-content: center;
  gap: 34px;
  max-width: 1180px;
}

.hero-copy {
  max-width: 850px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow:before {
  content: "";
  width: 32px;
  height: 2px;
  background: currentColor;
}

h1 {
  max-width: 960px;
  margin-top: 18px;
  font-size: 86px;
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-text {
  max-width: 720px;
  margin-top: 26px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 20px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

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

.button-primary {
  color: var(--ink);
  background: var(--coral);
  border-color: var(--coral);
}

.button-secondary {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--paper);
}

.button-pay {
  color: var(--ink);
  background: var(--cyan);
  border-color: var(--cyan);
}

.identity-panel {
  display: grid;
  grid-template-columns: minmax(220px, 330px) minmax(260px, 1fr);
  gap: 14px;
  max-width: 660px;
}

.avatar-card,
.callsign-card,
.github-card {
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(10px);
}

.avatar-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.avatar-card img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
}

.avatar-card strong,
.avatar-card span {
  display: block;
}

.avatar-card span {
  color: rgba(255, 255, 255, 0.72);
  margin-top: 4px;
  line-height: 1.5;
}

.github-card {
  display: flex;
  min-height: 126px;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  transition: transform 180ms ease, border-color 180ms ease;
}

.github-card:hover {
  transform: translateY(-3px);
  border-color: var(--amber);
}

.github-card strong {
  display: block;
  color: var(--white);
  margin-top: 8px;
  font-size: 24px;
}

.github-card p {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
}

.callsign-card {
  padding: 18px;
}

.callsign-card .label,
.callsign-card .morse,
.github-card .label {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  text-transform: uppercase;
}

.callsign-card strong {
  display: block;
  color: var(--amber);
  font-family: Consolas, "Courier New", monospace;
  font-size: 76px;
  line-height: 0.95;
  margin: 8px 0;
}

.callsign-card p {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
}

main {
  position: relative;
  z-index: 1;
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--ink);
  color: var(--white);
}

.signal-strip div {
  padding: 22px clamp(18px, 4vw, 44px);
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.signal-strip span {
  display: block;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.signal-strip strong {
  display: block;
  margin-top: 6px;
  line-height: 1.4;
}

.section {
  padding: clamp(54px, 8vw, 110px) clamp(18px, 5vw, 72px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin-top: 10px;
  font-size: 56px;
  line-height: 1.05;
}

.station-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(280px, 1.1fr);
  gap: 18px;
}

.station-display,
.station-note,
.post-card,
.friend-card,
.link-kit,
.contact-grid a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 30px rgba(10, 10, 10, 0.08);
}

.station-display {
  position: relative;
  min-height: 340px;
  padding: 26px;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.92), rgba(0, 184, 169, 0.28)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 8px);
  overflow: hidden;
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 40%;
  height: 2px;
  background: var(--green);
  box-shadow: 0 0 22px var(--green);
  animation: scan 4s linear infinite;
}

@keyframes scan {
  0% { transform: translateY(-140px); }
  100% { transform: translateY(180px); }
}

.station-display p {
  color: var(--green);
  font-family: Consolas, "Courier New", monospace;
  font-weight: 800;
}

.station-display h3 {
  position: absolute;
  left: 26px;
  bottom: 54px;
  color: var(--amber);
  font-family: Consolas, "Courier New", monospace;
  font-size: 96px;
  line-height: 0.9;
}

.station-display small {
  position: absolute;
  left: 26px;
  bottom: 22px;
  color: rgba(255, 255, 255, 0.7);
}

.station-note {
  padding: clamp(24px, 4vw, 40px);
}

.station-note h3 {
  font-size: 28px;
  line-height: 1.2;
}

.station-note p {
  margin-top: 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 24px 0 0;
}

.facts div {
  padding: 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
}

.facts dt {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.facts dd {
  margin: 0;
  font-weight: 800;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.post-card {
  overflow: hidden;
}

.post-card.featured {
  grid-column: span 2;
}

.post-image {
  display: block;
  height: 240px;
  overflow: hidden;
  background: var(--ink);
}

.featured .post-image {
  height: 340px;
}

.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 380ms ease;
}

.post-card:hover .post-image img {
  transform: scale(1.05);
}

.post-body {
  padding: 22px;
}

.tag {
  display: inline-flex;
  padding: 6px 9px;
  color: var(--ink);
  background: var(--amber);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.post-body h3 {
  margin-top: 14px;
  font-size: 30px;
  line-height: 1.18;
}

.post-body h3 a:hover {
  color: var(--coral);
}

.post-body p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.85;
}

.gallery-section {
  background: var(--ink);
  color: var(--white);
}

.gallery-section .section-heading h2 {
  color: var(--white);
}

.gallery-rail {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 1fr 0.9fr;
  gap: 12px;
}

.gallery-rail img {
  width: 100%;
  height: clamp(220px, 28vw, 430px);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.gallery-rail img:nth-child(2),
.gallery-rail img:nth-child(4) {
  margin-top: 54px;
}

.friends-section {
  background:
    linear-gradient(135deg, rgba(255, 90, 79, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(0, 184, 169, 0.14), transparent 36%),
    var(--paper);
}

.friend-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.friend-toolbar input {
  width: min(420px, 100%);
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.friend-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.chip {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
  font-weight: 800;
}

.chip.active,
.chip:hover {
  color: var(--white);
  background: var(--ink);
}

.friend-board {
  display: grid;
  gap: 28px;
}

.friend-group-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.friend-group-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.friend-group-heading h3 {
  margin-top: 4px;
  font-size: 28px;
  line-height: 1.18;
}

.friend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.friend-sites-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.friend-card {
  display: block;
  min-height: 180px;
  padding: 20px;
  transition: transform 180ms ease, border-color 180ms ease;
}

.friend-site-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: flex-start;
  min-height: 142px;
  gap: 16px;
}

.friend-card:hover {
  transform: translateY(-4px);
  border-color: var(--coral);
}

.friend-card-body {
  min-width: 0;
}

.friend-avatar {
  position: relative;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--amber);
  font-size: 24px;
  font-weight: 900;
}

.friend-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.friend-card-body > span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.friend-card-body > strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
}

.friend-card-body > p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.75;
}

.invite-card {
  color: var(--white);
  background: var(--ink);
}

.invite-card .friend-avatar {
  color: var(--ink);
  background: var(--coral);
  border-color: rgba(255, 255, 255, 0.24);
}

.invite-card .friend-card-body > span {
  color: var(--amber);
}

.invite-card .friend-card-body > p {
  color: rgba(255, 255, 255, 0.72);
}

.link-kit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 18px;
}

.link-kit span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.link-kit strong,
.link-kit p {
  display: block;
  margin-top: 4px;
}

.link-kit p {
  color: var(--muted);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.contact-grid a {
  display: flex;
  align-items: center;
  min-height: 76px;
  padding: 18px;
  font-weight: 800;
}

.contact-grid a:hover {
  color: var(--white);
  background: var(--ink);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 28px clamp(18px, 5vw, 72px);
  color: var(--white);
  background: var(--ink);
}

.site-footer p {
  color: rgba(255, 255, 255, 0.76);
}

.site-footer a {
  color: var(--amber);
  font-weight: 800;
}

/* Article pages */
.article-header {
  min-height: 58vh;
}

.article-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(42px, 7vw, 86px) clamp(18px, 4vw, 42px);
}

.article-title {
  color: var(--white);
}

.article-title h1 {
  max-width: 900px;
  font-size: 76px;
}

.article-title p {
  max-width: 720px;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  line-height: 1.85;
}

.article-cover {
  margin-top: -86px;
  padding: 0 clamp(18px, 5vw, 72px);
}

.article-cover img {
  width: min(1100px, 100%);
  height: clamp(260px, 44vw, 520px);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 0 auto;
}

.article-content {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(42px, 7vw, 82px) clamp(18px, 4vw, 32px);
}

.article-content h2 {
  margin: 42px 0 14px;
  font-size: 34px;
  line-height: 1.16;
}

.article-content p,
.article-content li {
  color: #3f443d;
  font-size: 17px;
  line-height: 2;
}

.article-content p + p {
  margin-top: 18px;
}

.article-content ul,
.article-content ol {
  padding-left: 22px;
}

.article-content li {
  margin: 10px 0;
}

.article-content pre {
  overflow: auto;
  padding: 18px;
  color: var(--green);
  background: var(--ink);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.8;
}

.article-content blockquote {
  margin: 26px 0;
  padding: 18px 20px;
  border-left: 6px solid var(--coral);
  border-radius: 0 8px 8px 0;
  color: var(--ink);
  background: rgba(255, 90, 79, 0.12);
  font-size: 18px;
  line-height: 1.8;
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.resource-links a {
  padding: 10px 13px;
  border-radius: 8px;
  color: var(--white);
  background: var(--ink);
  font-weight: 800;
}

.resource-links a:hover {
  background: var(--coral);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.article-tags span {
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--amber);
  font-size: 13px;
  font-weight: 800;
}

.article-nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 860px;
  margin: 0 auto clamp(52px, 8vw, 90px);
  padding: 0 clamp(18px, 4vw, 32px);
}

.article-nav a {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font-weight: 800;
}

.article-nav a:hover {
  color: var(--white);
  background: var(--ink);
}

.hidden {
  display: none !important;
}

@media (max-width: 920px) {
  h1 {
    font-size: 62px;
  }

  .hero-text {
    font-size: 18px;
  }

  .callsign-card strong {
    font-size: 60px;
  }

  .section-heading h2 {
    font-size: 44px;
  }

  .station-display h3 {
    font-size: 70px;
  }

  .post-body h3 {
    font-size: 26px;
  }

  .article-title h1 {
    font-size: 54px;
  }

  .article-content h2 {
    font-size: 30px;
  }

  .topbar,
  .friend-toolbar,
  .link-kit,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .identity-panel,
  .station-grid,
  .post-grid,
  .friend-grid,
  .contact-grid,
  .signal-strip,
  .article-nav {
    grid-template-columns: 1fr;
  }

  .post-card.featured {
    grid-column: auto;
  }

  .featured .post-image,
  .post-image {
    height: 260px;
  }

  .gallery-rail {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-rail img:nth-child(2),
  .gallery-rail img:nth-child(4) {
    margin-top: 0;
  }
}

@media (max-width: 560px) {
  .site-header {
    min-height: auto;
    padding-bottom: 36px;
  }

  .hero {
    min-height: auto;
    padding-top: 48px;
  }

  h1 {
    font-size: 42px;
  }

  .hero-text {
    font-size: 16px;
  }

  .callsign-card strong {
    font-size: 46px;
  }

  .section-heading h2 {
    font-size: 34px;
  }

  .station-display h3 {
    font-size: 54px;
  }

  .post-body h3 {
    font-size: 24px;
  }

  .article-title h1 {
    font-size: 38px;
  }

  .article-content h2 {
    font-size: 26px;
  }

  .hero-actions .button,
  .button {
    width: 100%;
  }

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

  .gallery-rail {
    grid-template-columns: 1fr;
  }
}
