:root {
  color-scheme: light;
  --blue: #0078d4;
  --blue-dark: #005fae;
  --ink: #17212b;
  --muted: #647180;
  --line: #dce4eb;
  --page: #f4f7fa;
  --panel: #ffffff;
  --soft-blue: #eaf5ff;
  --warning: #936000;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--page);
}

body[data-page="invite"] {
  color: #17212b;
  background: #303b47;
}

body[data-page="invite"]::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  background: #303b47;
  box-shadow: inset 0 0 160px rgba(10, 18, 28, .48);
}

button, a { font: inherit; }

.site-bar {
  min-height: 64px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, .12);
  background: #0878c9;
  color: #fff;
}

.site-bar-inner {
  width: min(100% - 32px, 1060px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .2px; }
.brand-logo { display: block; width: 24px; height: 29px; object-fit: contain; }
.brand-name { font-size: 16px; }
.site-label { color: rgba(255,255,255,.78); font-size: 12px; }

.page-shell { width: min(100% - 32px, 760px); margin: 0 auto; padding: 36px 0 56px; }
.page-shell.narrow { max-width: 680px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 8px 24px rgba(24, 51, 73, .06); }
.invite-panel { overflow: hidden; }
.panel-body { padding: 28px; }

body[data-page="invite"] .site-bar { display: none; }
body[data-page="invite"] .page-shell { width: min(calc(100% - 32px), 620px); max-width: 620px; margin: 0 auto; padding: 32px 0 26px; }
body[data-page="invite"] .invite-stage { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
body[data-page="invite"] .panel { border: 0; border-radius: 12px; box-shadow: 0 22px 60px rgba(8, 17, 27, .38); }
body[data-page="invite"] .panel-body { padding: 30px 44px 28px; }

.invite-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 26px; white-space: nowrap; }
.invite-brand-mark { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: #116cff; }
.invite-brand-mark img { width: 25px; height: 28px; object-fit: contain; }
.invite-brand-name { color: #1265dc; font-size: 23px; font-weight: 500; letter-spacing: 0; }
.invite-device-mark { width: 68px; height: 68px; display: flex; align-items: center; justify-content: center; margin: 0 auto 4px; border-radius: 50%; background: #116cff; box-shadow: 0 0 0 8px #f1f6ff; }
.invite-device-mark img { width: 42px; height: 46px; object-fit: contain; }
.invite-device-label { margin: 12px 0 0; color: #142231; font-size: 17px; font-weight: 600; text-align: center; }

.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(24px, 5vw, 32px); line-height: 1.25; letter-spacing: 0; }
h2 { margin: 0; font-size: 20px; line-height: 1.35; }
p { line-height: 1.65; }
.lead { margin: 12px 0 0; color: var(--muted); }

body[data-page="invite"] h1 { margin-top: 10px; font-size: 22px; font-weight: 600; text-align: center; }
body[data-page="invite"] .lead { margin-top: 8px; font-size: 14px; text-align: center; }

.invite-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 24px 0; border: 1px solid var(--line); background: var(--line); }
.summary-item { min-width: 0; padding: 14px 16px; background: #fbfcfd; }
.summary-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.summary-value { display: block; overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

body[data-page="invite"] .invite-summary { grid-template-columns: 1fr; gap: 0; margin: 24px 0 16px; border: 0; border-radius: 6px; background: #f6f8fb; }
body[data-page="invite"] .summary-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 15px; background: transparent; }
body[data-page="invite"] .summary-item + .summary-item { border-top: 1px dashed #d6dee8; }
body[data-page="invite"] .summary-label { margin: 0; color: #48596b; font-size: 13px; }
body[data-page="invite"] .summary-value { font-size: 13px; text-align: right; }

.notice { display: flex; gap: 10px; align-items: flex-start; margin: 20px 0; padding: 12px 14px; border-left: 3px solid #d79827; background: #fff8e9; color: var(--warning); font-size: 13px; }
.notice strong { display: block; margin-bottom: 2px; color: #704900; }
.notice p { margin: 0; }

body[data-page="invite"] .notice { gap: 10px; margin: 16px 0 0; padding: 12px 13px; border: 0; border-radius: 6px; background: #edf5ff; color: #24496f; }
body[data-page="invite"] .notice strong { color: #1b3d64; }
.notice-icon { width: 17px; height: 17px; flex: 0 0 17px; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; border-radius: 50%; background: #1677ff; color: #fff; font-size: 12px; font-weight: 700; font-family: Georgia, serif; }

.action-stack { display: grid; gap: 10px; margin-top: 24px; }
.primary-action, .secondary-action { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; text-decoration: none; font-weight: 600; }
.primary-action { background: var(--blue); color: #fff; }
.primary-action:hover { background: var(--blue-dark); }
.secondary-action { border-color: #b8c8d6; background: #fff; color: #24506e; }
.secondary-action:hover { border-color: var(--blue); color: var(--blue-dark); }

body[data-page="invite"] .action-stack { gap: 10px; margin-top: 24px; }
body[data-page="invite"] .primary-action, body[data-page="invite"] .secondary-action { min-height: 46px; border-radius: 7px; font-size: 14px; }
body[data-page="invite"] .primary-action { background: #1677ff; box-shadow: 0 5px 12px rgba(22, 119, 255, .2); }
body[data-page="invite"] .primary-action:hover { background: #0b68eb; }
body[data-page="invite"] .secondary-action { border-color: #1677ff; color: #1677ff; }
body[data-page="invite"] .secondary-action:hover { border-color: #0b68eb; color: #0b68eb; background: #f7fbff; }
.primary-action:focus-visible, .secondary-action:focus-visible, .text-button:focus-visible { outline: 3px solid rgba(0, 120, 212, .28); outline-offset: 2px; }

.status { min-height: 22px; margin: 12px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.status.error { color: #b42318; }
.status.success { color: #18794e; }

body[data-page="invite"] .status { margin-top: 14px; font-size: 12px; }

.manual { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.manual summary { cursor: pointer; color: #476275; font-size: 13px; }
.manual textarea { width: 100%; min-height: 88px; margin-top: 12px; resize: vertical; border: 1px solid var(--line); border-radius: 3px; padding: 10px; color: var(--ink); background: #f8fafc; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }

.download-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.download-copy { margin: 0; color: var(--muted); font-size: 13px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--blue-dark); cursor: pointer; font-weight: 600; }

.footer { width: min(100% - 32px, 760px); margin: 20px auto 0; color: #7b8792; font-size: 12px; text-align: center; }
.footer a { color: inherit; }
.hidden { display: none !important; }

body[data-page="invite"] .footer { width: min(calc(100% - 32px), 620px); margin-top: 0; color: rgba(255, 255, 255, .68); }
body[data-page="invite"] .manual { margin-top: 20px; }

.download-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.download-option { display: flex; min-width: 0; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); background: #fbfcfd; }
.download-option h3 { margin: 0; font-size: 15px; }
.download-option p { min-height: 42px; margin: 0; color: var(--muted); font-size: 13px; }
.download-option .secondary-action { margin-top: auto; }
.checksum { margin-top: 20px; color: var(--muted); font-size: 12px; }
.checksum code { word-break: break-all; }

@media (max-width: 600px) {
  .site-bar-inner, .page-shell, .footer { width: min(100% - 24px, 760px); }
  .page-shell { padding-top: 20px; }
  .panel-body { padding: 20px 16px; }
  .invite-summary, .download-options { grid-template-columns: 1fr; }
  .download-row { align-items: flex-start; flex-direction: column; }
  .site-label { display: none; }
  body[data-page="invite"] .page-shell { width: min(calc(100% - 24px), 620px); padding-top: 18px; padding-bottom: 18px; }
  body[data-page="invite"] .invite-stage { align-items: flex-start; }
  body[data-page="invite"] .panel-body { padding: 26px 20px 24px; }
  .invite-brand { margin-bottom: 22px; }
  .invite-brand-name { font-size: 21px; }
}

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