:root {
  color-scheme: light;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --navy: #08111f;
  --navy-soft: #101c31;
  --mint: #5ee7b2;
  --cyan: #38d7e7;
  --accent: #0f766e;
  --danger: #b42318;
  --shadow: 0 18px 55px rgba(16, 24, 40, .09);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--surface-soft); }
body { margin: 0; color: var(--ink); background: var(--surface-soft); }
button, input, textarea { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.page-shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }

.hero {
  color: white;
  background:
    radial-gradient(circle at 80% 20%, rgba(56, 215, 231, .18), transparent 28%),
    radial-gradient(circle at 12% 78%, rgba(94, 231, 178, .13), transparent 30%),
    linear-gradient(135deg, #07101e 0%, #0d1b30 58%, #10283b 100%);
  overflow: hidden;
}
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-weight: 750; letter-spacing: -.015em; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(135deg, var(--mint), var(--cyan)); color: #06212a; font-weight: 900; box-shadow: 0 8px 24px rgba(56, 215, 231, .24); }
.quiet-link, .text-button { color: inherit; opacity: .76; text-decoration: none; font-size: 14px; border: 0; background: transparent; padding: 8px; cursor: pointer; }
.quiet-link:hover, .text-button:hover { opacity: 1; }
.hero-content { padding: 82px 0 90px; }
.eyebrow { margin: 0 0 13px; color: var(--mint); font-size: 12px; font-weight: 800; letter-spacing: .18em; }
.eyebrow.dark { color: var(--accent); }
.hero h1, .admin-intro h1, .auth-panel h1 { margin: 0; font-size: clamp(38px, 6vw, 64px); line-height: 1.05; letter-spacing: -.045em; }
.hero-copy { max-width: 690px; margin: 24px 0 38px; color: #bac7d8; font-size: 17px; line-height: 1.75; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats > div { min-width: 148px; padding: 15px 18px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.055); backdrop-filter: blur(8px); }
.hero-stats strong, .hero-stats span { display: block; }
.hero-stats strong { font-size: 18px; }
.hero-stats span { margin-top: 3px; color: #9eafc4; font-size: 12px; }

.main-content { margin-top: -35px; padding-bottom: 72px; position: relative; }
.platform-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 14px; border: 1px solid rgba(228, 231, 236, .9); border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.platform-tab { display: flex; align-items: center; gap: 14px; min-height: 82px; padding: 15px 18px; text-align: left; color: var(--ink); border: 1px solid transparent; border-radius: 16px; background: transparent; cursor: pointer; transition: .18s ease; }
.platform-tab:hover { background: #f4f7fa; }
.platform-tab.is-active { border-color: #b7eadb; background: #ecfdf6; box-shadow: inset 0 0 0 1px rgba(15,118,110,.04); }
.platform-tab > span:last-child, .platform-tab strong, .platform-tab small { display: block; }
.platform-tab strong { font-size: 16px; }
.platform-tab small { margin-top: 3px; color: var(--muted); }
.platform-icon { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border-radius: 14px; color: white; font-weight: 900; }
.android-icon { background: linear-gradient(135deg, #16a34a, #4ade80); }
.windows-icon { background: linear-gradient(135deg, #2563eb, #38bdf8); }

.release-section { padding: 58px 0 20px; }
.section-heading, .panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading h2 { margin: 0; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.035em; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--ink); font-size: 24px; cursor: pointer; }
.icon-button:hover { border-color: #98a2b3; transform: rotate(20deg); }
.status-panel { margin-top: 25px; padding: 30px; text-align: center; color: var(--muted); border: 1px dashed #cfd5df; border-radius: 18px; background: rgba(255,255,255,.7); }
.version-list { display: grid; gap: 14px; margin-top: 25px; }
.version-card { padding: 25px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 8px 28px rgba(16,24,40,.045); }
.version-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.version-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.version-title h3 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.latest-badge, .secure-chip { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: #067647; background: #dcfae6; font-size: 11px; font-weight: 800; }
.download-button, .primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 11px; color: white; background: var(--ink); text-decoration: none; font-weight: 750; cursor: pointer; }
.download-button:hover, .primary-button:hover { background: #26354b; }
.primary-button:disabled { cursor: wait; opacity: .55; }
.release-notes { margin: 18px 0 20px; color: #475467; line-height: 1.75; white-space: pre-wrap; }
.version-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-top: 18px; border-top: 1px solid #edf0f3; }
.version-meta span { min-width: 0; }
.version-meta small, .version-meta strong { display: block; }
.version-meta small { margin-bottom: 4px; color: #98a2b3; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.version-meta strong { overflow: hidden; color: #475467; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.checksum { cursor: copy; }
.install-note { display: flex; gap: 17px; margin-top: 28px; padding: 22px 24px; border: 1px solid #bee3f8; border-radius: 18px; background: #effaff; }
.note-icon { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 50%; color: white; background: #0284c7; font-weight: 800; }
.install-note h2 { margin: 2px 0 6px; font-size: 16px; }
.install-note p { margin: 0; color: #475467; font-size: 14px; line-height: 1.7; }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0 40px; color: #98a2b3; border-top: 1px solid var(--line); font-size: 12px; }

.admin-body { min-height: 100vh; background: #f3f5f8; }
.admin-topbar { color: white; background: var(--navy); }
.admin-actions { display: flex; align-items: center; gap: 4px; }
.admin-main { padding-block: 60px 90px; }
.panel { border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: 0 12px 40px rgba(16,24,40,.06); }
.auth-panel { width: min(460px, 100%); margin: 5vh auto 0; padding: 34px; }
.panel-heading { margin-bottom: 27px; }
.panel-heading h1 { font-size: 36px; }
.panel-heading p:last-child, .admin-intro p:last-child { color: var(--muted); line-height: 1.65; }
.form-stack { display: grid; gap: 18px; }
.form-stack > label { display: grid; gap: 8px; color: #344054; font-size: 13px; font-weight: 700; }
input, textarea { width: 100%; padding: 12px 13px; color: var(--ink); border: 1px solid #d0d5dd; border-radius: 10px; outline: none; background: white; }
input:focus, textarea:focus { border-color: #2e90fa; box-shadow: 0 0 0 3px rgba(46,144,250,.12); }
textarea { resize: vertical; }
.form-message { min-height: 20px; margin: 0; color: #067647; font-size: 13px; }
.form-message.is-error, #login-message { color: var(--danger); }
.admin-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 32px; }
.admin-intro h1 { font-size: clamp(34px, 5vw, 52px); }
.retention-badge { min-width: 140px; padding: 17px; text-align: center; border: 1px solid #b7eadb; border-radius: 17px; background: #ecfdf6; }
.retention-badge strong, .retention-badge span { display: block; }
.retention-badge strong { color: #067647; font-size: 27px; }
.retention-badge span { color: #477267; font-size: 11px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: 20px; align-items: start; }
.upload-panel, .release-summary { padding: 27px; }
.panel-title-row { margin-bottom: 24px; }
.panel-title-row h2 { margin: 0; font-size: 20px; }
.platform-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0; border: 0; }
.platform-choice legend { grid-column: 1 / -1; margin-bottom: 8px; color: #344054; font-size: 13px; font-weight: 700; }
.platform-choice label { position: relative; cursor: pointer; }
.platform-choice input { position: absolute; opacity: 0; pointer-events: none; }
.platform-choice span { display: flex; align-items: center; justify-content: space-between; padding: 13px; border: 1px solid #d0d5dd; border-radius: 11px; }
.platform-choice input:checked + span { color: #067647; border-color: #6ce9a6; background: #ecfdf3; box-shadow: 0 0 0 2px rgba(108,233,166,.14); }
.platform-choice small { color: var(--muted); }
.file-picker input { padding: 9px; background: #f9fafb; }
.file-picker small { color: var(--muted); font-weight: 500; }
.progress-wrap { display: grid; gap: 8px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e4e7ec; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #12b76a, #06b6d4); transition: width .2s ease; }
.progress-wrap span { color: var(--muted); font-size: 12px; }
.dark-button { width: 35px; height: 35px; font-size: 19px; }
.admin-version-list { display: grid; gap: 22px; }
.admin-version-group h3 { margin: 0 0 10px; color: #475467; font-size: 13px; }
.admin-version-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid #edf0f3; }
.admin-version-row .version-info { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.admin-version-row strong { font-size: 14px; }
.admin-version-row small { width: 100%; color: #98a2b3; }
.admin-version-row a { color: #1570ef; font-size: 13px; font-weight: 700; text-decoration: none; }
.admin-version-row .latest-badge { padding: 3px 7px; font-size: 9px; }
.version-actions { display: flex; align-items: center; gap: 10px; }
.delete-version-button { padding: 5px 8px; border: 0; border-radius: 7px; color: var(--danger); background: #fef3f2; font-size: 12px; font-weight: 700; cursor: pointer; }
.delete-version-button:hover { background: #fee4e2; }
.delete-version-button:disabled { cursor: wait; opacity: .55; }
.version-message { margin-top: 18px; }
.muted { color: var(--muted); }

@media (max-width: 780px) {
  .page-shell { width: min(100% - 28px, 1120px); }
  .hero-content { padding: 62px 0 74px; }
  .hero h1 { font-size: 43px; }
  .hero-stats > div { min-width: calc(50% - 6px); }
  .platform-tabs { grid-template-columns: 1fr; }
  .version-top { align-items: flex-start; flex-direction: column; }
  .download-button { width: 100%; }
  .version-meta { grid-template-columns: 1fr 1fr; }
  .version-meta .checksum { grid-column: 1 / -1; }
  .footer, .admin-intro { align-items: stretch; flex-direction: column; }
  .admin-grid { grid-template-columns: 1fr; }
  .retention-badge { width: 145px; }
}

@media (max-width: 480px) {
  .topbar { min-height: 64px; }
  .brand { font-size: 14px; }
  .hero-stats > div { min-width: 100%; }
  .main-content { margin-top: -25px; }
  .platform-tabs { padding: 9px; border-radius: 17px; }
  .version-card, .upload-panel, .release-summary, .auth-panel { padding: 20px; }
  .version-meta { grid-template-columns: 1fr; }
  .version-meta .checksum { grid-column: auto; }
  .platform-choice { grid-template-columns: 1fr; }
}
