:root {
  --bg: #f5efe4;
  --panel: #fffaf1;
  --text: #1f1a14;
  --muted: #72695f;
  --line: #d9ccbc;
  --primary: #d45c2f;
  --primary-dark: #b34820;
  --success: #186a3b;
  --error: #a43232;
  --shadow: 0 16px 40px rgba(87, 57, 28, 0.12);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #111827;
  background:
    radial-gradient(circle at top left, rgba(21, 94, 239, 0.08), transparent 26%),
    linear-gradient(180deg, #f7f9fc 0%, #f4f7fb 100%);
}

.download-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.public-shell {
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  -webkit-tap-highlight-color: rgba(17, 24, 39, 0.08);
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  border-radius: 14px;
  padding: 0.9rem 1.2rem;
  background: #111827;
  color: white;
  transition: background 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  button:hover {
    background: #1f2937;
    transform: translateY(-1px);
  }
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: white;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.shell {
  width: min(1180px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1rem 0 1.5rem;
}

.topbar h1,
.auth-card h1,
.hero-panel h2,
.section-head h2,
.section-head h3 {
  margin: 0.2rem 0 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nav a,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.65);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
}

.flash {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.flash.success {
  background: rgba(24, 106, 59, 0.1);
  color: var(--success);
  border: 1px solid rgba(24, 106, 59, 0.25);
}

.flash.error {
  background: rgba(164, 50, 50, 0.1);
  color: var(--error);
  border: 1px solid rgba(164, 50, 50, 0.25);
}

.auth-card,
.panel {
  background: rgba(255, 250, 241, 0.92);
  border: 1px solid rgba(217, 204, 188, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(760px, 100%);
  margin: 6rem auto 0;
  padding: 2rem;
  display: grid;
  gap: 2rem;
}

.grid {
  display: grid;
  gap: 1.25rem;
}

.two-col {
  grid-template-columns: 1.05fr 1fr;
}

.panel {
  padding: 1.5rem;
}

.hero-panel {
  padding: 2rem;
}

.stack-form {
  display: grid;
  gap: 1rem;
}

.stack-form label {
  display: grid;
  gap: 0.45rem;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
}

.checkbox-row input {
  width: auto;
}

.eyebrow {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
  font-weight: 700;
}

.muted {
  color: #6b7280;
}

.compact-note {
  margin: -0.25rem 0 0;
  font-size: 0.92rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.4rem 0 1.8rem;
}

.stat-card {
  padding: 1rem;
  background: white;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.stat-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.35rem;
}

.primary-button.large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1rem 1.4rem;
  font-size: 1.05rem;
}

.inline-button,
.inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--line);
}

.inline-button {
  background: var(--primary);
  color: white;
}

.inline-button.secondary,
.inline-link {
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
}

.cta-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.hidden {
  display: none;
}

.download-card {
  width: min(720px, 100%);
  max-width: 100%;
  margin: 0;
  background: #fff;
  border-radius: 16px;
  padding: clamp(20px, 5vw, 28px);
  box-shadow: 0 10px 35px rgba(15, 23, 42, 0.08);
}

.download-card h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 5vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

body.download-page {
  color: #c4b8ad;
  background: #060302;
}

.download-page.public-shell {
  position: relative;
  overflow-x: hidden;
}

.download-page__ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 88% 58% at 50% -22%, rgba(234, 88, 12, 0.26), transparent 55%),
    radial-gradient(ellipse 48% 42% at 100% 100%, rgba(234, 88, 12, 0.16), transparent 52%),
    radial-gradient(ellipse 38% 45% at 0% 60%, rgba(194, 65, 12, 0.12), transparent 50%),
    linear-gradient(175deg, #0c0604 0%, #0a0806 38%, #040201 100%);
}

.download-page .download-card {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  padding: clamp(22px, 5vw, 32px);
  border-radius: 26px;
  background: linear-gradient(165deg, rgba(255, 252, 250, 0.9) 0%, rgba(255, 255, 255, 0.82) 100%);
  border: 1px solid rgba(253, 186, 116, 0.42);
  box-shadow:
    0 0 0 1px rgba(234, 88, 12, 0.1),
    0 4px 8px rgba(0, 0, 0, 0.14),
    0 28px 56px -16px rgba(0, 0, 0, 0.32),
    0 72px 96px -28px rgba(234, 88, 12, 0.14);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
}

.download-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.download-hero__mark {
  flex-shrink: 0;
}

.download-hero__mark img {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(234, 88, 12, 0.18),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

.download-hero__text {
  min-width: 0;
}

.download-hero--centered {
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.25rem;
  text-align: center;
}

.download-hero__eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ea580c;
}

.download-page .download-hero h1 {
  margin: 0;
  font-size: clamp(1.65rem, 5.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.15;
}

.download-hero__tagline {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.45;
}

.download-page .download-hero__tagline {
  color: #78716c;
}

.download-meta {
  margin-top: 1.35rem;
}

.download-meta__title {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.download-page .download-meta__title {
  color: #c2410c;
}

.download-page .meta-list {
  margin: 0;
  gap: 0;
}

.download-page .meta-list .meta-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(234, 88, 12, 0.12);
}

.download-page .meta-list .meta-row:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.download-page .meta-list dt {
  font-weight: 600;
  font-size: 0.875rem;
  color: #475569;
}

.download-page .meta-list dd {
  margin: 0;
  text-align: right;
  min-width: 0;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.2rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #1e293b;
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.meta-pill--muted {
  color: #64748b;
  font-weight: 500;
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: none;
}

.download-page .meta-pill {
  border-color: rgba(234, 88, 12, 0.28);
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.download-page .meta-pill--muted {
  border-color: rgba(234, 88, 12, 0.16);
  background: #fffbeb;
}

.inapp-hint {
  margin: 0 0 1rem;
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
}

.download-page .inapp-hint {
  border-radius: 14px;
  color: #fed7aa;
  background: linear-gradient(145deg, rgba(40, 22, 12, 0.97), rgba(18, 10, 6, 0.99));
  border: 1px solid rgba(251, 146, 60, 0.45);
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.38), 0 0 28px rgba(234, 88, 12, 0.12);
}

.download-footnote {
  margin: 14px 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
}

.download-page .download-footnote {
  color: #78716c;
}

.button-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.download-page .button-group {
  margin-top: 2.25rem;
}

.button {
  border: 0;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  padding: 11px 16px;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  touch-action: manipulation;
  min-height: 44px;
}

.button-download {
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  font-size: 1.0625rem;
  font-weight: 600;
  border-radius: 14px;
}

.download-page .button-download {
  gap: 0.75rem;
  min-height: 58px;
  padding: 16px 22px;
  border-radius: 18px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
  background: linear-gradient(175deg, #fb923c 0%, #ea580c 42%, #c2410c 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 -1px 0 rgba(0, 0, 0, 0.12) inset,
    0 0 0 1px rgba(154, 52, 18, 0.35),
    0 10px 28px rgba(234, 88, 12, 0.42),
    0 20px 40px -8px rgba(234, 88, 12, 0.35),
    0 4px 14px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

@media (hover: hover) and (pointer: fine) {
  .download-page .button-download:not(:disabled):hover {
    filter: brightness(1.06) saturate(1.05);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.42) inset,
      0 -1px 0 rgba(0, 0, 0, 0.1) inset,
      0 0 0 1px rgba(251, 146, 60, 0.65),
      0 14px 36px rgba(234, 88, 12, 0.5),
      0 26px 52px -6px rgba(251, 146, 60, 0.4),
      0 6px 18px rgba(0, 0, 0, 0.22);
  }
}

.download-page .button-download:active:not(:disabled) {
  transform: scale(0.985);
  filter: brightness(0.97);
}

.download-page .button-download:disabled {
  opacity: 0.9;
  cursor: wait;
  transform: none;
  filter: brightness(0.96) saturate(0.9);
}

.download-page .button-download--disabled {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.72;
  filter: grayscale(0.15) brightness(0.96);
}

.download-page .button-download[aria-busy="true"]::before {
  content: "";
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: dl-spin 0.65s linear infinite;
}

@keyframes dl-spin {
  to {
    transform: rotate(360deg);
  }
}

.button.secondary {
  background: #155eef;
}

.meta-list {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.meta-list > div:not(.meta-row) {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
}

.meta-list dt {
  font-weight: 700;
}

.meta-list dd {
  text-align: right;
  margin: 0;
  word-break: break-all;
  min-height: 24px;
  min-width: 120px;
}

.stats {
  margin-top: 18px;
}

.alert {
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 16px;
}

.alert.error {
  background: #fef2f2;
  color: #b91c1c;
}

.download-page .alert.error {
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.98), rgba(255, 241, 242, 0.98));
  color: #991b1b;
  border: 1px solid rgba(248, 113, 113, 0.35);
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.08);
}

.download-only {
  width: min(520px, calc(100vw - 2rem));
  display: grid;
  gap: 1.5rem;
  justify-items: stretch;
}

.download-count {
  display: grid;
  gap: 0.6rem;
  padding: 2rem;
  text-align: center;
  background: rgba(255, 250, 241, 0.92);
  border: 1px solid rgba(217, 204, 188, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.download-count span {
  color: var(--muted);
  font-size: 1rem;
}

.download-count strong {
  font-size: clamp(2.8rem, 10vw, 4.6rem);
  line-height: 1;
}

.download-button {
  width: 100%;
  min-height: 72px;
  font-size: 1.15rem;
  border-radius: 24px;
}

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

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.85rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.badge.green {
  background: rgba(24, 106, 59, 0.12);
  color: var(--success);
}

.badge.gray {
  background: rgba(114, 105, 95, 0.12);
  color: var(--muted);
}

@media (max-width: 920px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

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

@media (max-width: 720px) {
  .meta-list > div:not(.meta-row) {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 0;
  }

  .meta-list dd {
    text-align: left;
    min-width: 0;
    width: 100%;
  }

  .download-page .meta-list .meta-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .download-page .meta-list dd {
    text-align: right;
    width: auto;
  }

  .button-group {
    flex-direction: column;
    align-items: stretch;
    margin-top: 4px;
  }

  .meta-list {
    margin: 16px 0;
  }

  .download-page .meta-list {
    margin: 0;
  }

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

@media (prefers-reduced-motion: reduce) {
  button {
    transition: none;
  }

  button:hover {
    transform: none;
  }

  .download-page .button-download[aria-busy="true"]::before {
    animation: none;
    border-color: rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
  }
}
