:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #eef4f8;
  --text: #142033;
  --muted: #526274;
  --line: #d9e2ea;
  --primary: #155e75;
  --primary-dark: #0f4457;
  --cta: #2563eb;
  --accent: #b45309;
  --danger: #b42318;
  --card-border: rgba(148, 163, 184, 0.28);
  --card-border-strong: rgba(37, 99, 235, 0.36);
  --card-bg: rgba(255, 255, 255, 0.96);
  --card-bg-soft: rgba(248, 250, 252, 0.92);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 18px 42px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, 0.06), 0 26px 70px rgba(15, 23, 42, 0.13);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #f2f7f8 46%, #f8fafc 100%);
  color: var(--text);
  font-family: Inter, "HarmonyOS Sans SC", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.55rem, 7vw, 5.8rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.72rem, 3vw, 2.72rem);
  line-height: 1.18;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 10px;
  font-size: 1.22rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.skip-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transform: translateY(-140%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.hero {
  min-height: 86vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(90deg, rgba(6, 22, 32, 0.93), rgba(8, 33, 45, 0.68), rgba(11, 46, 62, 0.44)),
    url("assets/hero-bg.webp") center / cover no-repeat;
  color: #ffffff;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  width: min(1180px, calc(100% - 40px));
  margin: 14px auto 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: rgba(5, 20, 28, 0.52);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.topbar .brand {
  margin-right: auto;
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary-dark);
  font-weight: 900;
}

.topbar .brand img {
  width: 26px;
  height: 26px;
  margin-right: 8px;
  border-radius: 5px;
}

.topbar a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.topbar a:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.topbar a:active,
.button:active,
.reader-nav a:active {
  transform: translateY(1px);
}

.topbar a:focus-visible,
.button:focus-visible,
.text-link:focus-visible,
.reader-nav a:focus-visible,
.zoomable-image:focus-visible,
.lightbox-close:focus-visible {
  outline: 3px solid rgba(245, 158, 11, 0.88);
  outline-offset: 3px;
}

.hero-inner {
  width: min(1180px, calc(100% - 40px));
  margin: auto auto 9vh;
  padding-top: 56px;
}

.hero-logo {
  width: 94px;
  height: 110px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0;
}

.hero .eyebrow {
  color: #8ee5d8;
}

.lead {
  max-width: 760px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.12rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-meta span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 800;
}

.source-line {
  margin: 18px 0 0;
  color: #8ee5d8;
  font-weight: 900;
}

.source-line.dark {
  color: var(--primary-dark);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: var(--radius);
  border: 0;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.button.primary {
  background: var(--cta);
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.28);
}

.button.primary:hover {
  background: #1d4ed8;
  box-shadow: 0 20px 42px rgba(37, 99, 235, 0.34);
}

.button.secondary {
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.button.secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 86px 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading p {
  margin: 12px 0 0;
  color: var(--muted);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.info-grid.one-column {
  grid-template-columns: minmax(0, 1fr);
}

.panel,
.service-box,
.step,
.warning,
.reader-nav {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background:
    linear-gradient(180deg, var(--card-bg) 0%, var(--card-bg-soft) 100%),
    #ffffff;
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.panel > *,
.service-box > *,
.step > *,
.warning > *,
.reader-nav > * {
  position: relative;
  z-index: 1;
}

.panel::before,
.service-box::before,
.reader-nav::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cta), #14b8a6);
  opacity: 0.9;
}

.panel:hover,
.service-box:hover,
.step:hover,
.reader-nav:hover {
  border-color: var(--card-border-strong);
  box-shadow: var(--shadow-md);
}

.panel {
  padding: 30px;
  border-radius: var(--radius);
}

.panel h3,
.service-box h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel h3::before,
.service-box h3::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--cta), #14b8a6);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.wide-panel {
  grid-column: 1 / -1;
}

.panel p,
.service-box p,
.step p,
.warning p {
  margin: 0;
  color: var(--muted);
}

.text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  margin-top: 18px;
  color: var(--cta);
  font-weight: 900;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.text-link:hover {
  color: #1d4ed8;
}

.muted {
  width: 100%;
  max-width: none;
  padding-right: max(20px, calc((100% - 1180px) / 2));
  padding-left: max(20px, calc((100% - 1180px) / 2));
  background: linear-gradient(180deg, #eef6f8 0%, #f7fafc 100%);
}

.service-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px;
  border-radius: var(--radius);
}

.notice-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.notice-list p {
  padding: 12px 14px;
  border: 1px solid #fed7aa;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fffaf2 0%, #fff7ed 100%);
  color: var(--text);
  font-weight: 800;
}

.tutorial-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.reader-nav {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: var(--radius);
}

.reader-nav-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

.reader-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.reader-nav a:hover {
  background: linear-gradient(90deg, #eef6ff, #eefdf8);
  color: var(--cta);
}

.reader-nav span {
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 900;
}

.steps {
  display: grid;
  gap: 20px;
}

.step {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 22px;
  padding: 28px;
  border-radius: var(--radius);
}

.step::before,
.warning::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--cta), #14b8a6);
}

.step-number {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #0f172a;
  color: #ffffff;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 14px 32px rgba(15, 23, 42, 0.2);
}

.step-content > p {
  max-width: 760px;
  margin-bottom: 18px;
}

.step-content img {
  width: 100%;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
}

.zoomable-image {
  cursor: zoom-in;
  transform-origin: center;
  transition: border-color 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.zoomable-image:hover {
  border-color: rgba(37, 99, 235, 0.58);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
  filter: saturate(1.03);
}

.image-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.copy-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 14px 0 18px;
  padding: 16px;
  border: 1px solid rgba(21, 94, 117, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.95), rgba(236, 253, 245, 0.9)),
    #f3f8fb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

code {
  display: block;
  color: #123d4a;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.button.copy-button {
  background: var(--primary);
  color: #ffffff;
}

.button.copy-button:hover {
  background: var(--primary-dark);
}

.warning {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 18px;
  padding: 30px;
  border-color: #f3c1b8;
  background: linear-gradient(180deg, #fff8f5 0%, #fff2ed 100%);
  border-radius: var(--radius);
}

.warning::before {
  background: linear-gradient(180deg, var(--danger), #f97316);
}

.warning .eyebrow {
  color: var(--danger);
}

.warning-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--danger);
  color: #ffffff;
  font-weight: 900;
}

.ai-section {
  padding-top: 20px;
}

.legal {
  padding-top: 0;
}

.legal h2 {
  margin-bottom: 12px;
}

.legal p {
  max-width: 860px;
  margin: 0;
  color: var(--muted);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(6, 13, 22, 0.86);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}

.lightbox-frame {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: 0;
  outline: 0;
}

.lightbox-frame img {
  width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-md);
  cursor: zoom-out;
}

.lightbox-frame figcaption {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 800;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: -18px;
  right: -18px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.lightbox-close:hover {
  background: #eef4ff;
}

@media (max-width: 900px) {
  .tutorial-layout {
    grid-template-columns: 1fr;
  }

  .reader-nav {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .reader-nav-title {
    display: none;
  }

  .reader-nav a {
    flex: 0 0 auto;
  }
}

@media (max-width: 760px) {
  .hero {
    min-height: auto;
  }

  .topbar {
    justify-content: flex-start;
    overflow-x: auto;
    width: min(100% - 24px, 1180px);
    margin-top: 12px;
  }

  .topbar .brand {
    margin-right: 0;
  }

  .topbar a {
    flex: 0 0 auto;
  }

  .hero-inner {
    width: min(100% - 32px, 1180px);
    margin: 44px auto 64px;
  }

  .section {
    width: min(100% - 32px, 1180px);
    padding: 58px 0;
  }

  .muted {
    padding-right: 16px;
    padding-left: 16px;
  }

  .info-grid,
  .service-box,
  .step,
  .image-row,
  .warning,
  .copy-box {
    grid-template-columns: 1fr;
  }

  .service-box {
    align-items: flex-start;
  }

  .step {
    gap: 14px;
    padding: 18px;
  }

  .step-number {
    width: 58px;
    height: 48px;
  }

  .copy-box {
    align-items: stretch;
  }

  .lightbox {
    padding: 18px;
  }

  .lightbox-close {
    top: -12px;
    right: -8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
