:root {
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #4f46e5;
  --primary-strong: #4338ca;
  --accent: #4f46e5;
  --warn: #f2b544;
  --ok: #4caf7d;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

[data-theme="dark"] {
  --bg: #171717;
  --bg-soft: #1f1f1f;
  --panel: #262626;
  --text: #fafafa;
  --muted: #a3a3a3;
  --line: #3f3f46;
  --primary: #4f46e5;
  --primary-strong: #6366f1;
  --accent: #818cf8;
  --warn: #f2b544;
  --ok: #4ade80;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

img {
  max-width: 100%;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 60px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--primary-strong);
}

[data-theme="dark"] .brand {
  color: var(--primary);
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--line);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-item {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover,
.nav-item.active {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary-strong);
}

[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .nav-item.active {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--primary-strong);
  border-color: var(--primary);
}

.menu-btn {
  display: none;
}

.site-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 84px 20px 60px;
}

.hero {
  border-radius: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 24px;
  padding: 40px;
}

.hero-eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 40px;
  line-height: 1.2;
  letter-spacing: 0;
}

.hero-text {
  margin: 0 0 22px;
  color: var(--muted);
  max-width: 520px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

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

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 35%, transparent);
}

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

[data-theme="dark"] .btn-ghost {
  color: var(--primary);
}

.hero-figure {
  position: relative;
  max-width: 320px;
  margin: 0 auto;
  padding: 12px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 14px;
}

.mascot {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  image-rendering: auto;
}

.pixel-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--accent);
}

.pixel-corner.tl {
  top: -5px;
  left: -5px;
}

.pixel-corner.tr {
  top: -5px;
  right: -5px;
  background: var(--warn);
}

.pixel-corner.bl {
  bottom: -5px;
  left: -5px;
  background: var(--warn);
}

.pixel-corner.br {
  bottom: -5px;
  right: -5px;
  background: var(--primary);
}

.modules {
  margin-top: 36px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.module-card {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(13, 94, 86, 0.14);
}

.module-icon {
  flex: 0 0 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 800;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary-strong);
}

[data-theme="dark"] .module-icon {
  color: var(--primary);
}

.module-body h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.module-body p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.module-status {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.module-card.ready .module-status {
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--ok);
}

.module-card.wip .module-status {
  background: color-mix(in srgb, var(--warn) 20%, transparent);
  color: #b57a12;
}

[data-theme="dark"] .module-card.wip .module-status {
  color: var(--warn);
}

.under-construction {
  display: none;
  margin-top: 36px;
}

.uc-box {
  max-width: 520px;
  margin: 0 auto;
  padding: 34px 24px;
  text-align: center;
  background: var(--panel);
  border: 1px dashed color-mix(in srgb, var(--primary) 45%, var(--line));
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.uc-mascot {
  width: 120px;
  height: 120px;
  margin: 0 auto 14px;
  overflow: hidden;
  border-radius: 50%;
  border: 3px solid var(--primary);
}

.uc-mascot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.uc-box h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.uc-box p {
  margin: 0 0 18px;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.landing-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  text-align: center;
}

.landing-main {
  width: 100%;
}

.landing-icon {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--line), 0 12px 32px rgba(0, 0, 0, 0.18);
}

.landing-title {
  margin: 0 0 30px;
  font-size: 58px;
  line-height: 1.15;
  letter-spacing: 0;
}

.landing-desc {
  margin: 0 auto 48px;
  color: var(--muted);
  font-size: 21px;
  text-align: center;
}

.repo-entry {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 28px;
  border-radius: 18px;
  background: rgba(148, 163, 184, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(14px) saturate(1.5);
  overflow: hidden;
  isolation: isolate;
  transition:
    padding 0.5s ease-out,
    width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.5s ease-out,
    border-color 0.5s ease-out,
    box-shadow 0.5s ease-out;
}

.repo-entry::before,
.repo-entry::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.repo-entry::before {
  inset: 0;
  z-index: 0;
  background: rgba(148, 163, 184, 0.16);
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.repo-entry::after {
  inset: -1rem;
  z-index: 0;
  background: linear-gradient(90deg, rgba(203, 213, 225, 0.8), rgba(148, 163, 184, 0.65));
  opacity: 0;
  filter: blur(48px);
  transition: opacity 1s ease-out;
}

.repo-entry-label {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
}

.repo-entry-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo-thumbs {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0;
  transition: gap 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.repo-thumb {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin-left: -14px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.repo-thumb:first-child {
  margin-left: 0;
}

.repo-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
}

.repo-thumb.has-icon .repo-thumb-fallback {
  display: none;
}

.repo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.repo-thumb.repo-count {
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.4);
  backdrop-filter: blur(10px);
}

.repo-arrow {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.landing-module-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.landing-module-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 10%, transparent);
  text-decoration: none;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

/* 2 个字撑满 3 个字的宽度，和「留言」两端对齐（不支持两端对齐的浏览器居中显示） */
.landing-module-text {
  display: block;
  width: 3em;
  text-align: center;
}

@supports (text-align-last: justify) {
  .landing-module-text {
    text-align: justify;
    text-align-last: justify;
    text-justify: inter-ideograph;
  }
}

.landing-module-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, var(--panel));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 18%, transparent);
}

.landing-module-btn:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.75;
}

.landing-module-btn.has-pending {
  border-color: color-mix(in srgb, var(--primary) 60%, var(--line));
  --pending-base-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 10%, transparent);
  animation: repoPendingPulse 3.6s ease-in-out infinite;
}

.landing-module-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 2;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 55%, transparent);
}

.landing-module-badge[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .landing-module-btn.has-pending {
    animation: none;
  }
}

.landing-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 44px;
}

.landing-links a {
  padding: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
}

.landing-links a.is-placeholder {
  cursor: default;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .landing-links a:hover {
    color: var(--accent);
    text-decoration: none;
  }
}

.landing-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 90;
  transform: translateX(-50%);
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

@media (hover: hover) and (pointer: fine) {
  .repo-grid .repo-entry:hover {
    padding-right: 12px;
    padding-left: 12px;
    border-color: rgba(148, 163, 184, 0.62);
    background: rgba(148, 163, 184, 0.26);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  }

  .repo-entry:hover::before {
    opacity: 1;
  }

  .repo-entry:hover::after {
    opacity: 0.2;
  }

  .repo-entry:hover .repo-thumbs {
    gap: 4px;
  }

  .repo-entry:hover .repo-thumb {
    margin-left: -4px;
    transform: scale(1.1);
  }

  .repo-entry:hover .repo-thumb:first-child {
    margin-left: 0;
  }

  .repo-entry:hover .repo-arrow {
    transform: translateX(4px);
  }
}

.landing-note {
  margin: 52px auto 0;
  max-width: 540px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.landing-footer {
  margin: 40px 0 0;
  color: var(--ink-3, var(--muted));
  font-size: 14px;
}

.landing-credit-block {
  margin: 18px 0 0;
}

.landing-font-credit {
  margin: 0;
  color: var(--ink-3, var(--muted));
  font-size: 12px;
  opacity: 0.75;
}

.landing-record {
  margin: 6px 0 0;
  color: var(--ink-3, var(--muted));
  font-size: 11px;
  opacity: 0.58;
}

.landing-record a {
  color: inherit;
  text-decoration: none;
}

.landing-record a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.workbench-coming {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 38px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(14px);
}

.workbench-coming img {
  width: 110px;
  height: 110px;
  margin: 0 auto 18px;
  border: 3px solid var(--primary);
  border-radius: 50%;
  object-fit: cover;
}

.workbench-coming h1 {
  margin: 0 0 10px;
  font-size: 34px;
}

.workbench-coming p {
  margin: 0 auto 24px;
  max-width: 420px;
  color: var(--muted);
}

.theme-float {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.home-controls {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-controls .theme-float {
  position: static;
  inset: auto;
  z-index: auto;
  flex: 0 0 auto;
}

.auth-status-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.auth-status-btn:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}

.auth-status-btn #authStatusText {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted) 15%, transparent);
}

.auth-status-btn.is-authenticated .auth-status-dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent);
}

.auth-menu {
  position: fixed;
  top: 66px;
  right: 66px;
  z-index: 90;
  width: 190px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-menu strong {
  display: block;
  margin-bottom: 8px;
  color: var(--primary-strong);
  font-size: 14px;
}

.auth-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.auth-menu button:hover {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary-strong);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 18, 25, 0.48);
  backdrop-filter: blur(5px);
}

.auth-dialog {
  position: relative;
  width: min(380px, 100%);
  padding: 28px 26px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 22px 60px rgba(17, 24, 39, 0.26);
}

.auth-dialog h2 {
  margin: 0 0 7px;
  font-size: 22px;
}

.auth-dialog > p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}

.auth-close:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.auth-field {
  display: block;
  margin-bottom: 14px;
}

.auth-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.auth-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
}

.auth-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

.auth-remember input {
  accent-color: var(--primary);
}

.auth-submit {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.auth-submit:hover {
  background: var(--primary-strong);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.auth-error {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, #d64545 12%, transparent);
  color: #d64545;
  font-size: 13px;
}

.auth-register-link {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.auth-register-link:hover {
  color: var(--primary-strong);
}

@media (max-width: 640px) {
  .home-controls {
    top: 12px;
    right: 12px;
  }

  .auth-status-btn {
    height: 36px;
    padding: 0 11px;
  }

  .auth-status-btn #authStatusText {
    max-width: 78px;
  }

  .home-controls .theme-float {
    width: 36px;
    height: 36px;
  }

  .auth-menu {
    top: 56px;
    right: 12px;
  }

  .landing-title {
    font-size: 36px;
    margin-bottom: 24px;
  }

  .landing-desc {
    font-size: 18px;
    margin-bottom: 36px;
  }

  .repo-entry {
    padding: 20px 16px;
    gap: 8px;
  }

  .repo-entry-label {
    font-size: 17px;
  }

  .repo-thumb {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    margin-left: -10px;
    font-size: 11px;
  }

  .landing-note {
    font-size: 14px;
    margin-top: 40px;
  }
}

body[data-page] .hero,
body[data-page] .modules {
  display: none;
}

body[data-page] .under-construction {
  display: block;
}

@media (max-width: 860px) {
  .menu-btn {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 14px 14px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    display: none;
  }

  .site-nav.open {
    display: flex;
  }

  .nav-item {
    padding: 12px 14px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    padding: 26px 22px;
  }

  .hero h1 {
    font-size: 30px;
  }

  .hero-figure {
    max-width: 240px;
  }

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

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

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

  .header-inner {
    padding: 0 12px;
    gap: 10px;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
  }
}

/* Three compact entries keep the original landing card design. */
.landing-three {
  --dock-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  padding: 30px 20px;
}

.landing-three .landing-inner {
  max-width: 1320px;
}

.landing-three .landing-title {
  margin-bottom: 14px;
  font-size: 44px;
}

.landing-three .landing-desc {
  margin-bottom: 28px;
  font-size: 18px;
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.repo-grid .repo-entry {
  max-width: none;
  min-width: 0;
  padding: 22px 16px;
  gap: 9px;
  border-radius: 16px;
}

.repo-grid .repo-entry-label {
  min-width: 0;
  font-size: 19px;
  line-height: 1.25;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo-grid .repo-thumb {
  flex-basis: 40px;
  width: 40px;
  height: 40px;
  margin-left: -12px;
  font-size: 11px;
}

.landing-three .landing-note {
  margin-top: 34px;
  font-size: 14px;
}

.landing-three .landing-footer {
  margin-top: 28px;
}

@media (max-width: 980px) {
  .landing-three {
    padding-top: 72px;
  }

  .repo-grid {
    grid-template-columns: 1fr;
    max-width: 620px;
  }

  .repo-grid .repo-entry-label {
    font-size: 18px;
  }
}

@media (max-width: 1019px) {
  .landing-three {
    padding-top: 72px;
  }
}

@media (max-width: 640px) {
  .landing-three {
    padding: 72px 14px 24px;
  }

  .landing-three .landing-title {
    font-size: 34px;
  }

  .landing-three .landing-desc {
    margin-bottom: 24px;
    font-size: 16px;
  }

  .workbench-coming {
    padding: 30px 20px;
  }

  .workbench-coming h1 {
    font-size: 27px;
  }

  .repo-grid .repo-thumb {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
    margin-left: -11px;
  }
}

@media (min-width: 1020px) {
  .landing-three {
    align-items: flex-start;
    padding-top: 64px;
    padding-bottom: var(--dock-bottom);
  }

  .landing-three .landing-inner {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 64px - var(--dock-bottom));
  }

  .landing-three .landing-title {
    margin-bottom: 28px;
  }

  .landing-three .landing-desc {
    margin-bottom: 40px;
  }

  .landing-three .landing-links {
    margin-top: auto;
    padding-top: 44px;
  }

  .landing-three .landing-footer {
    margin-top: 40px;
  }

  .landing-three .landing-credit-block {
    margin-top: 40px;
  }

  .repo-grid {
    display: grid;
    grid-template-columns: repeat(2, 448px);
    justify-content: center;
    gap: 34px;
    max-width: none;
  }

  .repo-grid .repo-entry {
    justify-self: center;
    justify-content: center;
    width: 448px;
    max-width: none;
    margin: 0;
    gap: 26px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .repo-grid .repo-entry-label {
    flex: 0 1 auto;
    justify-content: flex-start;
  }

  .repo-grid .repo-thumbs {
    flex: 0 0 auto;
  }

  .repo-grid .repo-entry:hover {
    width: 492px;
    padding-right: 12px;
    padding-left: 12px;
  }
}

@media (max-width: 420px) {
  .repo-grid .repo-entry-label {
    font-size: 15px;
  }
}

/* 大屏自适应：2K 及以上放大落地页内容，并让整块内容垂直居中，减少大片空白。 */
@media (min-width: 1600px) {
  .landing-three {
    --dock-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
    padding-top: 0;
    padding-bottom: 0;
  }

  .landing-three .landing-inner {
    max-width: 1560px;
    min-height: 100vh;
  }

  .landing-three .landing-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    transform: translateY(-20px);
  }

  .landing-three .landing-title {
    margin-top: 0;
    margin-bottom: 22px;
    font-size: 50px;
  }

  .landing-three .landing-desc {
    margin-bottom: 46px;
    font-size: 20px;
  }

  .repo-grid {
    grid-template-columns: repeat(2, 560px);
    gap: 38px;
  }

  .repo-grid .repo-entry {
    width: 560px;
    padding: 24px 22px;
    gap: 18px;
  }

  .repo-grid .repo-entry-label {
    font-size: 21px;
  }

  .repo-grid .repo-thumb {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    margin-left: -14px;
  }

  .landing-module-btn {
    min-width: 118px;
    height: 48px;
    font-size: 15px;
  }

  .landing-three .landing-main .landing-links {
    margin-top: 42px;
    padding-top: 0;
  }

  .landing-module-actions {
    gap: 14px;
    margin-top: 40px;
  }

  .landing-three .landing-footer {
    position: fixed;
    left: 50%;
    bottom: calc(var(--dock-bottom) + 44px);
    width: max-content;
    margin: 0;
    transform: translateX(-50%);
  }

  .landing-three .landing-credit-block {
    position: fixed;
    left: 50%;
    bottom: var(--dock-bottom);
    width: max-content;
    margin: 0;
    transform: translateX(-50%);
  }

}

@media (hover: hover) and (min-width: 1600px) {
  .repo-grid .repo-entry:hover {
    width: 604px;
  }
}

@media (min-width: 2100px) {
  .landing-three {
    --dock-bottom: calc(44px + env(safe-area-inset-bottom, 0px));
  }

  .landing-three .landing-inner {
    max-width: 1880px;
  }

  .landing-three .landing-title {
    font-size: 58px;
  }

  .landing-three .landing-desc {
    margin-bottom: 56px;
    font-size: 22px;
  }

  .repo-grid {
    grid-template-columns: repeat(2, 680px);
    gap: 48px;
  }

  .repo-grid .repo-entry {
    width: 680px;
    padding: 32px 28px;
    gap: 22px;
  }

  .repo-grid .repo-entry-label {
    font-size: 24px;
  }

  .repo-grid .repo-thumb {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
    margin-left: -16px;
  }

  .landing-module-btn {
    min-width: 132px;
    height: 52px;
  }

  .landing-three .landing-links {
    padding-top: 64px;
  }
}

@media (hover: hover) and (min-width: 2100px) {
  .repo-grid .repo-entry:hover {
    width: 724px;
  }
}

@media (min-width: 3000px) {
  .landing-three {
    --dock-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }

  .landing-three .landing-inner {
    max-width: 2200px;
  }

  .landing-three .landing-title {
    font-size: 62px;
  }

  .landing-three .landing-desc {
    margin-bottom: 60px;
    font-size: 23px;
  }

  .repo-grid {
    grid-template-columns: repeat(2, 800px);
    gap: 56px;
  }

  .repo-grid .repo-entry {
    width: 800px;
    padding: 38px 34px;
    gap: 26px;
  }

  .repo-grid .repo-entry-label {
    font-size: 26px;
  }

  .repo-grid .repo-thumb {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
    margin-left: -18px;
  }

  .landing-module-btn {
    min-width: 144px;
    height: 56px;
  }

  .landing-three .landing-links {
    padding-top: 72px;
  }
}

@media (hover: hover) and (min-width: 3000px) {
  .repo-grid .repo-entry:hover {
    width: 844px;
  }
}

/* 有待审核注册申请时，工作台入口呼吸高亮 */
.repo-entry.has-pending {
  border-color: color-mix(in srgb, var(--primary) 60%, var(--line));
  --pending-base-shadow: 0 10px 34px rgba(0, 0, 0, 0.12);
  animation: repoPendingPulse 3.6s ease-in-out infinite;
}

@keyframes repoPendingPulse {
  0%,
  100% {
    box-shadow: var(--pending-base-shadow, 0 10px 34px rgba(0, 0, 0, 0.12));
  }
  50% {
    box-shadow:
      var(--pending-base-shadow, 0 10px 34px rgba(0, 0, 0, 0.12)),
      0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent),
      0 0 18px color-mix(in srgb, var(--primary) 34%, transparent);
  }
}

.repo-pending {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 55%, transparent);
}

.repo-pending[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .repo-entry.has-pending {
    animation: none;
  }
}
