:root {
  color-scheme: light;
  --ink: #18202b;
  --muted: #667085;
  --line: #dfe4ec;
  --soft-line: #edf0f5;
  --surface: #ffffff;
  --surface-soft: #f7f8fb;
  --page: #f2f4f8;
  --brand: #2563eb;
  --brand-dark: #1749b0;
  --brand-soft: #eaf1ff;
  --success: #16855b;
  --warning: #a55b08;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(21, 33, 55, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--page);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; background: var(--page); }
button, input { font: inherit; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

.site-shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.topbar {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark, .login-brand {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #3777f2, #1648ba);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.22);
  font-weight: 800;
  letter-spacing: -0.04em;
}
.brand-mark { width: 42px; height: 42px; border-radius: 13px; font-size: 15px; }
.brand > span:last-child { display: grid; gap: 1px; }
.brand strong { font-size: 17px; letter-spacing: 0.01em; }
.brand small { color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.text-link, .back-link, .link-button {
  color: #456079;
  font-weight: 650;
  text-decoration: none;
}
.text-link:hover, .back-link:hover, .link-button:hover { color: var(--brand); }
.quiet-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #30735c;
  font-size: 13px;
  font-weight: 650;
}
.status-pill span { width: 8px; height: 8px; border-radius: 50%; background: #28a475; box-shadow: 0 0 0 4px #dff5ec; }

main { padding: 32px 0 28px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 42px;
  align-items: end;
  padding: 42px 44px;
  overflow: hidden;
  border: 1px solid #d7e1f2;
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 0%, rgba(65, 117, 237, 0.17), transparent 35%),
    linear-gradient(135deg, #fff 0%, #f7faff 100%);
  box-shadow: var(--shadow);
}
.eyebrow { margin: 0 0 10px; color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.hero h1, .page-heading h1 { margin: 0; letter-spacing: -0.035em; }
.hero h1 { font-size: clamp(36px, 5vw, 54px); }
.hero-copy { max-width: 690px; margin: 17px 0 0; color: #536273; font-size: 17px; line-height: 1.75; }
.mode-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 190px;
  padding: 16px 18px;
  border: 1px solid #cddaf1;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.88);
}
.mode-card > div { display: grid; gap: 2px; }
.mode-card small { color: var(--muted); }
.mode-card strong { font-size: 17px; }
.mode-dot { width: 12px; height: 12px; border: 3px solid #b9d0ff; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px #e6efff; }

.device-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.device-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 132px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(21, 33, 55, 0.035);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.device-card:hover { transform: translateY(-2px); border-color: #adc2ed; box-shadow: 0 16px 34px rgba(21, 33, 55, 0.08); }
.device-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 17px;
  font-size: 24px;
  font-weight: 800;
}
.windows-icon { color: #1769c2; background: #eaf4ff; }
.android-icon { color: #16855b; background: #e7f8f0; }
.macos-icon { color: #273444; background: #eef1f5; }
.ios-icon { color: #7b3bbd; background: #f4eafe; font-family: Georgia, serif; }
.device-copy { display: grid; gap: 8px; }
.device-copy strong { font-size: 21px; }
.device-copy small { color: var(--muted); font-size: 14px; line-height: 1.5; }
.arrow { color: #91a0b1; font-size: 24px; transition: transform 160ms ease; }
.device-card:hover .arrow { transform: translateX(3px); color: var(--brand); }

.notice-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid #eed9ae;
  border-radius: 14px;
  background: #fffaf0;
  color: #694b1e;
}
.notice-card p { margin: 5px 0 0; line-height: 1.65; }
.notice-icon { flex: 0 0 auto; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #f3cc79; color: #69430c; font-weight: 800; }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px 0 36px; border-top: 1px solid #dfe4ec; color: #8490a0; font-size: 12px; }

.page-heading { padding: 12px 4px 28px; }
.back-link { display: inline-flex; margin-bottom: 28px; font-size: 14px; }
.heading-row { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.page-heading h1 { font-size: clamp(31px, 4vw, 44px); }
.page-heading .heading-row p:last-child { margin: 13px 0 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.mode-badge, .tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}
.mode-badge { flex: 0 0 auto; padding: 8px 13px; color: var(--brand-dark); background: var(--brand-soft); }
.tag { padding: 5px 10px; color: #1758c5; background: #eaf2ff; }
.neutral-tag { color: #5d6470; background: #eef0f3; }

.content-card {
  margin-bottom: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(21, 33, 55, 0.04);
}
.featured-card { border-color: #cddbf3; }
.content-card h2 { margin: 0; font-size: 22px; letter-spacing: -0.015em; }
.content-card h3 { margin: 14px 0 8px; font-size: 18px; }
.content-card p { color: var(--muted); line-height: 1.7; }
.section-heading { margin-bottom: 22px; }
.section-heading > div { display: flex; align-items: flex-start; gap: 13px; }
.section-heading p { margin: 5px 0 0; }
.step-number { flex: 0 0 auto; display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; color: var(--brand); background: var(--brand-soft); font-size: 12px; font-weight: 800; }

.download-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.download-option { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.download-option.recommended { border-color: #b8cff6; background: #f5f9ff; }
.download-option .tag { position: absolute; top: 16px; right: 16px; }
.download-option h3 { margin-top: 0; padding-right: 60px; }
.download-option p { flex: 1; margin-top: 0; }
.primary-button, .secondary-button, .copy-button, .password-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.primary-button { padding: 0 17px; border: 1px solid var(--brand); background: var(--brand); color: #fff; box-shadow: 0 7px 18px rgba(37, 99, 235, 0.18); }
.primary-button:hover { border-color: var(--brand-dark); background: var(--brand-dark); }
.primary-button.subdued { border-color: #526173; background: #526173; box-shadow: none; }
.secondary-button { padding: 0 17px; border: 1px solid #cfd7e3; background: #fff; color: #35506d; }
.secondary-button:hover { border-color: #9cb3d3; color: var(--brand-dark); }
.link-button { padding: 10px 0 0; border: 0; background: transparent; font-size: 13px; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.stacked-actions { display: grid; grid-template-columns: 1fr; }

.url-box { display: grid; gap: 7px; margin-top: 16px; }
.url-box label { color: #5e6b79; font-size: 12px; font-weight: 700; }
.url-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.url-input, .password-control input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #cfd7e3;
  border-radius: 9px;
  background: #fafbfc;
  color: #334155;
}
.url-input { padding: 8px 11px; font: 12px Consolas, "SFMono-Regular", Menlo, monospace; }
.copy-button { min-width: 68px; padding: 0 13px; border: 1px solid #c8d4e4; background: #f5f8fc; color: #34516f; }
.copy-button:hover { border-color: #91add3; background: #edf4ff; }
.code-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.code-control code { display: flex; align-items: center; min-height: 46px; overflow-x: auto; padding: 9px 13px; border: 1px solid #d9dfe8; border-radius: 9px; background: #f5f7fa; color: #25374d; white-space: nowrap; }
.muted { font-size: 14px; }

.steps-list { display: grid; gap: 15px; margin: 20px 0 0; padding: 0; list-style: none; }
.steps-list li { display: flex; align-items: flex-start; gap: 13px; }
.steps-list li > span { flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #ecf2fb; color: #355b91; font-size: 12px; font-weight: 800; }
.steps-list p { margin: 4px 0 0; }

.import-layout { display: grid; grid-template-columns: minmax(210px, 280px) minmax(0, 1fr); gap: 30px; align-items: start; }
.qr-card { margin: 0; padding: 16px; border: 1px solid var(--soft-line); border-radius: 15px; background: #fafbfc; text-align: center; }
.qr-card img { display: block; width: 100%; max-width: 250px; height: auto; margin: 0 auto; border-radius: 8px; image-rendering: pixelated; }
.qr-card figcaption { margin-top: 10px; color: var(--muted); font-size: 12px; }
.import-details h3 { font-size: 21px; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.profile-option { margin: 0; }
.profile-option > p { min-height: 54px; }
.profile-option .qr-card { width: min(100%, 285px); margin: 18px auto; }
.recommended-profile { border-color: #b9cff2; box-shadow: 0 12px 34px rgba(37, 99, 235, 0.08); }
.ios-notice { margin: 0 0 18px; }

.qr-dialog { width: min(390px, calc(100% - 30px)); padding: 28px; border: 0; border-radius: 18px; box-shadow: 0 30px 90px rgba(16, 24, 40, 0.3); text-align: center; }
.qr-dialog::backdrop { background: rgba(12, 20, 33, 0.62); backdrop-filter: blur(2px); }
.qr-dialog h2 { margin: 0 0 16px; }
.qr-dialog img { width: min(100%, 270px); height: auto; }
.qr-dialog p:last-child { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #eef1f5; color: #566271; font-size: 22px; cursor: pointer; }

.login-page { background: radial-gradient(circle at 50% 0%, #e2ecff 0%, var(--page) 42%, #eef1f5 100%); }
.login-shell { display: grid; place-items: center; min-height: 100vh; padding: 28px 16px; }
.login-card { width: min(430px, 100%); padding: 40px; border: 1px solid #d9e0ea; border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: 0 24px 70px rgba(23, 39, 66, 0.13); }
.login-brand { width: 54px; height: 54px; margin-bottom: 24px; border-radius: 16px; font-size: 18px; }
.login-card h1 { margin: 0; font-size: 30px; letter-spacing: -0.03em; }
.login-lead { margin: 10px 0 27px; color: var(--muted); line-height: 1.65; }
.login-form label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.password-control { position: relative; }
.password-control input { padding: 9px 69px 9px 12px; background: #fff; font-size: 16px; }
.password-toggle { position: absolute; top: 5px; right: 5px; min-height: 34px; padding: 0 11px; border: 0; background: #eef3fa; color: #48627e; font-size: 12px; }
.login-submit { width: 100%; margin-top: 16px; border-radius: 10px; }
.login-note { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--soft-line); color: #8490a0; font-size: 12px; line-height: 1.6; }
.alert { display: grid; gap: 5px; margin: 18px 0; padding: 13px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.alert-danger { border: 1px solid #f1c4bf; background: #fff3f2; color: var(--danger); }
.alert.compact { margin: 10px 0 0; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; max-width: calc(100vw - 40px); padding: 11px 15px; border-radius: 10px; background: #172033; color: #fff; box-shadow: 0 12px 30px rgba(16,24,40,.25); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .16s ease, transform .16s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 760px) {
  .site-shell { width: min(100% - 28px, 1160px); }
  .topbar { min-height: 76px; }
  .status-pill, .text-link { display: none; }
  main { padding-top: 18px; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding: 30px 24px; }
  .mode-card { width: 100%; }
  .device-grid, .download-grid, .profile-grid { grid-template-columns: 1fr; }
  .device-card { min-height: 112px; padding: 20px; }
  .heading-row { align-items: flex-start; flex-direction: column; }
  .page-heading { padding-bottom: 22px; }
  .back-link { margin-bottom: 22px; }
  .content-card { padding: 22px 18px; }
  .import-layout { grid-template-columns: 1fr; }
  .qr-card { width: min(100%, 300px); margin: 0 auto; }
  .profile-option > p { min-height: 0; }
  .footer { flex-direction: column; gap: 7px; }
}

@media (max-width: 480px) {
  .brand small { display: none; }
  .device-card { grid-template-columns: auto minmax(0, 1fr); gap: 14px; }
  .device-icon { width: 48px; height: 48px; border-radius: 14px; font-size: 20px; }
  .device-card .arrow { display: none; }
  .actions { display: grid; grid-template-columns: 1fr; }
  .primary-button, .secondary-button { width: 100%; text-align: center; }
  .url-control, .code-control { grid-template-columns: 1fr; }
  .copy-button { width: 100%; }
  .login-card { padding: 30px 22px; }
}

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