:root {
  color-scheme: light;
  --ink: #172e30;
  --muted: #486264;
  --line: #d2e1df;
  --canvas: #f2f7f6;
  --paper: #ffffff;
  --accent: #126255;
  font-family: system-ui, "Microsoft YaHei UI", "PingFang SC", sans-serif;
  font-size: 100%;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: #0b4038; }
a:focus-visible { outline: 3px solid #357b68; outline-offset: 4px; }

.wrap { width: min(100% - 2rem, 56rem); margin-inline: auto; }
.page-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  justify-content: space-between;
  align-items: center;
  min-height: 3.75rem;
  padding-block: .55rem;
}
.wordmark { color: var(--ink); font-weight: 760; letter-spacing: -.025em; text-decoration: none; }
nav { display: flex; gap: 1.15rem; }
nav a { font-weight: 610; text-decoration: none; }
nav a:hover { text-decoration: underline; }

.intro { margin: 2.8rem 0 2.15rem; }
h1 { font-size: clamp(1.9rem, 5.6vw, 3rem); line-height: 1.15; letter-spacing: -.04em; margin: 0 0 .8rem; }
h2 { font-size: 1.38rem; margin: 0 0 .85rem; }
h3 { font-size: 1.2rem; margin: 0 0 .45rem; }
p, li { line-height: 1.7; }
p { margin: 0; }
.intro p, .download-card p, .route-tip { color: var(--muted); }

.downloads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.download-card, .guide { border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); }
.download-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(1.05rem, 3vw, 1.5rem);
}
.download-card p { margin-bottom: 1.1rem; }
.download-card p + .button { margin-top: auto; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .55rem .9rem;
  border: 1px solid var(--accent);
  border-radius: .6rem;
  color: var(--paper);
  background: var(--accent);
  font-weight: 680;
  line-height: 1.3;
  text-decoration: none;
}
.button:hover { background: #0e5046; color: var(--paper); }
.button.secondary { color: var(--accent); background: var(--paper); margin-top: .6rem; }
.button.secondary:hover { background: #e9f4f0; color: #0b4038; }
.small-link { display: inline-block; margin-top: .85rem; font-size: .95rem; }
.apk-transfer { width: 100%; margin-top: 1rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.apk-transfer p { margin-bottom: .55rem; }
.apk-transfer progress { display: block; width: 100%; margin-bottom: .65rem; accent-color: var(--accent); }
[hidden] { display: none !important; }

.guide { margin-top: 1.3rem; padding: clamp(1.05rem, 3vw, 1.5rem); }
.guide ol { padding-inline-start: 1.5rem; margin: 0 0 1.05rem; max-width: 66ch; }
.guide li + li { margin-top: .48rem; }
.route-tip { margin-top: .75rem; }
.page-footer { display: flex; flex-wrap: wrap; gap: .35rem 1.15rem; padding-block: 1.4rem 2rem; color: var(--muted); }

.auth-panel { width: min(30rem, calc(100% - 2rem)); margin: clamp(2rem, 10vh, 7rem) auto; padding: clamp(1.25rem, 4vw, 2rem); background: var(--paper); border: 1px solid var(--line); border-radius: 1rem; }
.auth-panel h1 { margin: 1.3rem 0 .85rem; font-size: 1.8rem; }
.auth-panel form { display: grid; gap: .8rem; margin: 1.2rem 0; }
.auth-panel label { font-weight: 650; }
.auth-panel select, .auth-panel input:not([type=hidden]) { width: 100%; min-width: 0; min-height: 2.75rem; padding: .6rem; border: 1px solid #77908d; border-radius: .5rem; font: inherit; }
.auth-panel #date-field label { display: block; margin-bottom: .4rem; }
.target { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; margin-top: 1.1rem; }
.target strong { letter-spacing: .025em; font-size: 1.65rem; }
.target button { cursor: pointer; font: inherit; color: var(--accent); border: 1px solid var(--accent); background: white; border-radius: .5rem; padding: .5rem .8rem; }
.target [role=status] { font-size: .92rem; }
.download-card .install-links { margin: .8rem 0 0; font-size: .92rem; }
.auth-panel button { cursor: pointer; font: inherit; font-weight: 650; }
.auth-note { color: var(--muted); font-size: .92rem; }
.auth-panel [role=alert] { color: #9c3026; margin-top: .7rem; }
.text-button { justify-self: start; background: none; border: 0; padding: .3rem 0; color: var(--accent); text-decoration: underline; }

@media (max-width: 42rem) {
  .intro { margin-top: 1.9rem; }
  .downloads { grid-template-columns: 1fr; }
  .download-card .button { width: 100%; }
}
