/* 日程喵 · 下载页 (/app). No external resources, no web fonts; served under the same strict CSP as /g (style-src 'self'), so nothing
   in the page uses style attributes: states are classes and the hidden attribute. Mobile first; light and dark.
   Old in-app WebViews: rgba(), no inset, a plain padding before each max(…, env()) one, grid (not flex) gaps for the layout. */
:root {
  --bg: #f4f5f8; --surface: #ffffff; --surface-2: #f0f2f6;
  --fg: #1d212b; --muted: #596073; --line: #dfe3ea;
  --brand: #245bdb; --brand-hover: #1d4cc0; --brand-fg: #ffffff; --link: #245bdb;
  --focus: #1a56db;
  --hint-bg: #fff0d6; --hint-fg: #6b3d00;
  --ok: #19653a;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .06);
  color-scheme: light dark;
  font-family: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.55;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161b; --surface: #1e2128; --surface-2: #272b34;
    --fg: #e9ebf1; --muted: #a6adbd; --line: #333843;
    --brand: #2f62e0; --brand-hover: #3a6df0; --brand-fg: #ffffff; --link: #8ab4ff;
    --focus: #8ab4ff;
    --hint-bg: #45330f; --hint-fg: #ffd58f;
    --ok: #94dcad;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html.modal-open { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--fg); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: var(--link); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--surface); color: var(--fg); padding: 8px 12px; border-radius: 6px; z-index: 20; }
.skip:focus { top: 8px; }

/* ---------- in a chat app's browser: where to tap ---------- */
.inapp { display: flex; align-items: flex-start; background: var(--hint-bg); color: var(--hint-fg); font-size: .92rem; font-weight: 600;
         padding: 10px 10px 10px 16px; padding: 10px max(10px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); }
.inapp-text { flex: 1; padding-top: 4px; margin-right: 8px; text-wrap: balance; }
.inapp-arrow { flex: none; width: 32px; height: 32px; }

/* ---------- page ---------- */
.page { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start;
        grid-gap: 16px; gap: 16px;
        padding: 28px 16px 20px; padding: 28px max(16px, env(safe-area-inset-right)) 20px max(16px, env(safe-area-inset-left)); }
.hero { text-align: center; padding: 4px 0 6px; }
.logo { display: block; width: 76px; height: 76px; margin: 0 auto 14px; }
.name { font-size: 1.75rem; line-height: 1.25; font-weight: 800; letter-spacing: .02em; }
.name-en { font-size: 1.05rem; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.tagline { margin-top: 6px; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.downloads:focus { outline: none; }

.btn { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 56px;
       padding: 8px 16px; border-radius: 12px; border: 1px solid transparent; text-align: center; text-decoration: none;
       font-size: 1.06rem; font-weight: 700; line-height: 1.3; -webkit-tap-highlight-color: transparent; }
.btn-primary { background: var(--brand); color: var(--brand-fg); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--surface); color: var(--fg); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-sub { font-size: .8rem; font-weight: 500; opacity: .88; }
.btn-secondary .btn-sub { color: var(--muted); opacity: 1; }
.others .btn { min-height: 52px; font-size: 1rem; }
.note { margin-top: 10px; font-size: .86rem; color: var(--muted); text-align: center; }
.soon { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px 16px; border-radius: 12px;
        border: 1px dashed var(--line); background: var(--surface-2); color: var(--muted); font-weight: 600; text-align: center; }
.primary .soon { min-height: 56px; font-size: 1.06rem; }

.status { margin-top: 12px; font-size: .88rem; color: var(--muted); text-align: center; }
.link { border: 0; background: none; color: var(--link); text-decoration: underline; font-weight: 700; padding: 6px 8px; min-height: 40px; }

.others { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.others-title { font-size: .86rem; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.others-list { display: grid; grid-gap: 10px; gap: 10px; }
.others-list .note { margin-top: 8px; }

.features-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.feature-list { display: grid; grid-gap: 8px; gap: 8px; }
.feature-list li { position: relative; padding-left: 26px; }
.feature-list li::before { content: ""; position: absolute; left: 4px; top: .42em; width: 10px; height: 6px;
                           border-left: 2.5px solid var(--link); border-bottom: 2.5px solid var(--link); transform: rotate(-45deg); }

.foot { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .86rem;
        padding: 8px 16px 22px; padding: 8px 16px max(22px, env(safe-area-inset-bottom)); }
.foot a { color: var(--muted); padding: 8px 2px; margin: 0 9px; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; }
.foot-legal { display: flex; flex-direction: column; align-items: center; color: var(--muted); font-size: .78rem; }
.foot-legal a { padding: 4px 2px; margin: 0; }
.foot-legal span { padding: 4px 0; margin: 0; }

/* ---------- the guide: open in the system browser ---------- */
.guide { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; overflow-y: auto;
         background: rgba(0, 0, 0, .8); color: #fff; padding: 0 16px 24px; overscroll-behavior: contain; }
.guide-arrow { position: absolute; top: 4px; right: 12px; right: max(12px, env(safe-area-inset-right)); width: 92px; height: 92px; color: #fff; }
.guide-card { margin-top: 108px; width: 100%; max-width: 380px; background: var(--surface); color: var(--fg); border-radius: 16px; padding: 22px 20px 18px; }
.guide-title { font-size: 1.2rem; font-weight: 800; }
.guide-text { margin-top: 10px; font-size: 1.06rem; font-weight: 600; line-height: 1.6; text-wrap: balance; }
.guide-why { margin-top: 6px; color: var(--muted); font-size: .9rem; }
.guide-why:empty { display: none; }
.guide-actions { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px; gap: 10px; }
.guide-actions .btn { min-height: 48px; font-size: 1rem; }
.copy-fallback { margin-top: 14px; display: grid; grid-gap: 6px; gap: 6px; font-size: .86rem; color: var(--muted); }
.copy-fallback input { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
                       background: var(--surface-2); color: var(--fg); font: inherit; font-size: .95rem; -webkit-user-select: text; user-select: text; }
.copy-status { margin-top: 10px; font-size: .88rem; color: var(--ok); font-weight: 600; }
.copy-status:empty { display: none; }

@media (min-width: 720px) {
  .page { padding-top: 56px; grid-gap: 20px; gap: 20px; }
  .logo { width: 88px; height: 88px; }
  .name { font-size: 2rem; }
  .card { padding: 24px 28px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .btn, .soon { border: 1px solid CanvasText; } }
@media print { .inapp, .guide, .skip { display: none !important; } }
