:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --bg: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #515154;
  --ink-3: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --ok: #16794b;
  --ok-soft: rgba(22, 121, 75, 0.12);

  --glass: rgba(255, 255, 255, 0.68);
  --glass-edge: rgba(255, 255, 255, 0.9);
  --hairline: rgba(15, 23, 42, 0.075);
  --shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 16px 40px rgba(15, 23, 42, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 68px; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(880px 560px at 14% 0%, rgba(168, 208, 255, 0.34), transparent 62%),
    radial-gradient(820px 540px at 88% 10%, rgba(253, 213, 174, 0.32), transparent 60%),
    radial-gradient(760px 600px at 50% 82%, rgba(182, 236, 218, 0.22), transparent 65%);
  min-height: 100vh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, ul, figure { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap { width: min(920px, calc(100% - 3rem)); margin-inline: auto; }
.narrow { max-width: 720px; }

.glass {
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(26px);
  -webkit-backdrop-filter: saturate(180%) blur(26px);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);
}

/* 顶部毛玻璃导航 */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251, 251, 253, 0.72);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 52px;
  gap: 0.75rem;
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-icon {
  border-radius: 6px;
  image-rendering: pixelated;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-links a {
  padding: 0.34rem 0.8rem;
  border-radius: 999px;
  font-size: 0.86rem;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.16s ease, background 0.16s ease;
}

.nav-links a:hover {
  color: var(--ink);
  background: rgba(15, 23, 42, 0.05);
}

.nav-inner > .pill { justify-self: end; }

/* 按钮 */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 980px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.14s ease, box-shadow 0.16s ease;
}

.pill:active { transform: scale(0.985); }

.pill-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.22);
}

.pill-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 18px rgba(0, 113, 227, 0.28);
}

.pill-glass {
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  color: var(--ink);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 4px 14px rgba(15, 23, 42, 0.05);
}

.pill-glass:hover {
  background: rgba(255, 255, 255, 0.96);
}

.pill-sm { min-height: 30px; padding: 0 0.9rem; font-size: 0.82rem; }
.pill-lg { min-height: 44px; padding: 0 1.55rem; font-size: 0.95rem; }

.alt-link {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
}

.alt-link:hover { text-decoration: underline; text-underline-offset: 0.22em; }

/* 首屏 */
.hero {
  padding-top: clamp(2rem, 4.2vw, 3.2rem);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.glass-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.glass-pill:empty { display: none; }

.hero h1 {
  margin-top: 0.85rem;
  font-size: clamp(2.55rem, 6vw, 4.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.subtitle {
  margin-top: 0.65rem;
  font-size: clamp(1rem, 2vw, 1.18rem);
  color: var(--ink-3);
}

.actions {
  margin-top: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.68rem;
}

.hero-inner > .alt-link { margin-top: 0.82rem; }

.hero-frame {
  width: min(860px, 100%);
  margin-top: clamp(1.4rem, 2.8vw, 2.1rem);
  padding: 9px;
  border-radius: 26px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 24px 60px rgba(15, 23, 42, 0.12);
}

.hero-art {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: 50% 60%;
  border-radius: 19px;
}

/* 区块头与分段控制器 */
.section {
  padding-top: clamp(2.8rem, 5.5vw, 4rem);
}

.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.32rem, 2.6vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.muted-ver {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.muted-ver:empty { display: none; }

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 0.34rem 0.95rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.seg-btn:hover { color: var(--ink); }

.seg-btn.is-active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  margin-bottom: 0.9rem;
  border-radius: 16px;
  color: var(--ink-2);
  font-size: 0.9rem;
}

/* 单一毛玻璃下载卡 */
.card {
  border-radius: 22px;
  padding: 0.35rem 1.35rem;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding-block: 0.95rem;
  border-bottom: 1px solid var(--hairline);
}

.file-row:last-child { border-bottom: 0; }

.file-info { min-width: 0; }

.file-info strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}

.file-info span {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.file-ops {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.get-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 32px;
  padding: 0 0.88rem;
  border-radius: 980px;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
  background: var(--accent-soft);
  transition: background 0.16s ease, color 0.16s ease;
}

.get-btn:hover {
  background: var(--accent);
  color: #fff;
}

.sha-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 0.68rem;
  border-radius: 980px;
  border: 0;
  background: rgba(15, 23, 42, 0.055);
  color: var(--ink-2);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}

.sha-btn:hover { background: rgba(15, 23, 42, 0.1); color: var(--ink); }
.sha-btn.is-copied { background: var(--ok-soft); color: var(--ok); }

/* J2ME 精简四行 */
.j2me-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-block: 0.88rem;
  border-bottom: 1px solid var(--hairline);
}

.j2me-row:last-child { border-bottom: 0; }

.j2me-res {
  font-weight: 600;
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
}

.j2me-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.j2me-pair {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.j2me-pair .get-btn {
  min-width: 52px;
  padding: 0 0.72rem;
  font-size: 0.8rem;
}

.j2me-pair .sha-btn {
  padding: 0 0.52rem;
  font-size: 0.72rem;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0 0.65rem;
  border-top: 1px solid var(--hairline);
}

.foot-ver {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.empty-row {
  padding-block: 1.1rem;
  color: var(--ink-3);
  font-size: 0.88rem;
}

/* 更新公告 */
.notes-list {
  list-style: none;
  padding: 0;
}

.notes-list li {
  position: relative;
  padding: 0.92rem 0 0.92rem 1rem;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-2);
  font-size: 0.92rem;
}

.notes-list li:last-child { border-bottom: 0; }

.notes-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.4rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.notes-list li.empty-row { padding-left: 0; }
.notes-list li.empty-row::before { display: none; }

/* 页脚 */
.footer {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid rgba(15, 23, 42, 0.07);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-block: 1.35rem calc(1.35rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.82rem;
  color: var(--ink-3);
}

.footer-links {
  display: flex;
  gap: 1.15rem;
}

.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

/* 毛玻璃轻提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 90;
  padding: 0.58rem 1.15rem;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.84);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

/* 手机端适配 */
@media (max-width: 640px) {
  .wrap { width: calc(100% - 1.5rem); }

  .nav-inner { min-height: 50px; }
  .nav-links { gap: 0.1rem; }
  .nav-links a { padding: 0.3rem 0.55rem; font-size: 0.84rem; }

  .hero { padding-top: 1.6rem; }
  .hero h1 { font-size: 2.35rem; margin-top: 0.68rem; }
  .subtitle { font-size: 0.96rem; margin-top: 0.45rem; }

  .actions {
    width: 100%;
    margin-top: 1.1rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .pill-lg { width: 100%; padding: 0 0.8rem; font-size: 0.9rem; }

  .hero-frame {
    margin-top: 1.25rem;
    padding: 6px;
    border-radius: 20px;
  }

  .hero-art {
    aspect-ratio: 4 / 3;
    object-position: 50% 58%;
    border-radius: 15px;
  }

  .section { padding-top: 2.3rem; }
  .section-bar { gap: 0.65rem; }

  .segmented {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .seg-btn { padding: 0.38rem 0.3rem; text-align: center; }

  .card { padding: 0.2rem 1rem; border-radius: 18px; }

  .file-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding-block: 0.85rem;
  }

  .file-ops {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .get-btn, .sha-btn { min-height: 36px; }

  .j2me-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

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

  .j2me-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .j2me-pair .get-btn,
  .j2me-pair .sha-btn { min-height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
