:root {
  --primary: #7047eb;
  --primary-dark: #4b22b8;
  --secondary: #ff4eb8;
  --accent: #ffbe55;
  --ink: #171126;
  --muted: #625b74;
  --background: #fbf9ff;
  --surface: #ffffff;
  --surface-soft: #f7f2ff;
  --border: #e8dff7;
  --success: #138a57;
  --deep: #14072f;
  --gradient: linear-gradient(135deg, #7047eb 0%, #a849ec 52%, #ff4eb8 100%);
  --shadow-sm: 0 10px 28px rgba(56, 27, 113, 0.08);
  --shadow-md: 0 20px 55px rgba(56, 27, 113, 0.14);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --header-height: 78px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 18px); }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgba(255, 78, 184, 0.08), transparent 25rem),
    radial-gradient(circle at 95% 4%, rgba(112, 71, 235, 0.11), transparent 30rem),
    var(--background);
  font: 400 16px/1.65 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
p { margin-top: 0; }
ul, ol { padding-left: 1.3rem; }
:focus-visible { outline: 3px solid rgba(112, 71, 235, 0.3); outline-offset: 3px; }
.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 1000; top: -80px; left: 16px; padding: 11px 15px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-md); }
.skip-link:focus { top: 14px; }

.site-header { position: sticky; z-index: 100; top: 0; border-bottom: 1px solid rgba(112, 71, 235, 0.12); background: rgba(251, 249, 255, 0.9); backdrop-filter: blur(18px); }
.nav-wrap { position: relative; min-height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand, .footer-logo { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; }
.brand img, .footer-logo img { filter: drop-shadow(0 10px 18px rgba(112, 71, 235, 0.22)); }
.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav a { white-space: nowrap; padding: 10px 10px; border-radius: 12px; font-size: 0.9rem; font-weight: 750; transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease; }
.main-nav a:hover, .main-nav a:focus-visible { color: var(--primary-dark); background: #eee7ff; transform: translateY(-1px); }
.menu-toggle { display: none; width: 46px; height: 46px; flex: 0 0 46px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); cursor: pointer; }
.menu-toggle span { display: block; width: 21px; height: 2px; margin: 5px auto; border-radius: 999px; background: var(--ink); transition: transform 0.2s ease, opacity 0.2s ease; }
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

section { padding: 76px 0; }
.hero { padding: 82px 0 58px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(420px, 0.94fr); align-items: center; gap: clamp(36px, 6vw, 72px); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(112, 71, 235, 0.12); border-radius: 999px; color: #5830bf; background: #eee7ff; font-size: 0.78rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.hero h1, .page-hero h1 { overflow-wrap: anywhere; }
.hero h1 { margin: 20px 0; font-size: clamp(2.8rem, 6vw, 5.5rem); line-height: 0.99; letter-spacing: -0.055em; }
.gradient-text { color: transparent; background: var(--gradient); -webkit-background-clip: text; background-clip: text; }
.lead { max-width: 700px; color: var(--muted); font-size: clamp(1.02rem, 1.8vw, 1.17rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border: 0; border-radius: 14px; font-weight: 820; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: #fff; background: var(--gradient); box-shadow: 0 15px 32px rgba(112, 71, 235, 0.25); }
.btn-primary:hover { box-shadow: 0 19px 38px rgba(112, 71, 235, 0.32); }
.btn-secondary { border: 1px solid var(--border); background: #fff; }
.preview-orbit { position: relative; min-height: 440px; overflow: hidden; border-radius: 38px; background: linear-gradient(155deg, #1b0a3e, #3e1983); box-shadow: 0 34px 85px rgba(41, 15, 89, 0.3); isolation: isolate; }
.preview-orbit::before, .preview-orbit::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; }
.preview-orbit::before { width: 290px; height: 290px; top: -80px; right: -65px; background: rgba(255, 78, 184, 0.24); filter: blur(3px); }
.preview-orbit::after { width: 320px; height: 320px; bottom: -145px; left: -95px; background: rgba(255, 190, 85, 0.16); }
.float-card { position: absolute; max-width: calc(100% - 48px); overflow-wrap: anywhere; padding: 17px 20px; border: 1px solid rgba(255,255,255,.18); border-radius: 20px; color: #fff; background: rgba(255,255,255,.11); box-shadow: 0 18px 45px rgba(0,0,0,.2); backdrop-filter: blur(12px); font-size: clamp(1rem, 2vw, 1.42rem); animation: float 5s ease-in-out infinite; }
.float-card:nth-child(1) { top: 48px; left: 30px; }
.float-card:nth-child(2) { top: 145px; right: 24px; animation-delay: -1.2s; }
.float-card:nth-child(3) { bottom: 94px; left: 64px; animation-delay: -2.2s; }
.float-card:nth-child(4) { right: 50px; bottom: 32px; animation-delay: -3s; }
@keyframes float { 50% { transform: translateY(-10px) rotate(1deg); } }

.section-head { max-width: 790px; margin-bottom: 34px; }
.section-head h2 { margin: 10px 0 14px; font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.08; letter-spacing: -0.035em; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.grid-3, .grid-4, .guide-grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { min-width: 0; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.card:hover { transform: translateY(-5px); border-color: #cdbcee; box-shadow: var(--shadow-md); }
.card h3 { margin: 16px 0 8px; }
.card p { margin-bottom: 0; color: var(--muted); }
.icon-chip { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: linear-gradient(145deg, #eee7ff, #fff0f8); font-size: 1.4rem; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(32px, 5vw, 58px); }
.steps { display: grid; gap: 16px; counter-reset: steps; }
.step { position: relative; padding: 20px 20px 20px 72px; border: 1px solid var(--border); border-radius: 18px; background: #fff; }
.step::before { position: absolute; top: 18px; left: 18px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--gradient); font-weight: 900; content: counter(steps); counter-increment: steps; }
.use-case { min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(145deg, #fff, #f7f2ff); }

.generator-panel { padding: clamp(18px, 3vw, 30px); border: 1px solid var(--border); border-radius: var(--radius-lg); background: linear-gradient(145deg, #fff, #faf7ff); box-shadow: var(--shadow-md); }
.generator-toolbar { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; align-items: end; gap: 14px; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 8px; font-size: 0.92rem; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; min-height: 52px; border: 1px solid #d9cdeb; border-radius: 14px; color: var(--ink); background: #fff; outline: none; }
.field input, .field textarea { padding: 13px 84px 13px 15px; }
.field select { padding: 13px 38px 13px 15px; cursor: pointer; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(112,71,235,.12); }
.input-wrap { position: relative; }
.character-count { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); color: #847a95; font-size: 0.78rem; font-weight: 750; pointer-events: none; }
.generate-button { min-height: 52px; white-space: nowrap; }
.tool-meta { display: flex; justify-content: space-between; gap: 18px; margin-top: 12px; color: var(--muted); font-size: 0.9rem; }
.tool-meta p { margin: 0; }
.text-button { flex: 0 0 auto; padding: 0; border: 0; color: var(--primary-dark); background: transparent; font-weight: 800; cursor: pointer; }
.results-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); }
.results-header strong, .results-header span { display: block; }
.results-header span { margin-top: 2px; color: var(--muted); font-size: 0.86rem; }
.copy-all-button { min-height: 42px; padding: 8px 14px; }
.results { display: grid; gap: 12px; margin-top: 16px; }
.result-card { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 15px 16px; border: 1px solid var(--border); border-radius: 18px; background: #fff; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.result-card:hover { transform: translateY(-1px); border-color: #c7b4ec; box-shadow: 0 10px 28px rgba(56,27,113,.08); }
.result-content { min-width: 0; }
.result-name { display: block; color: #766d87; font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.result-text { max-width: 100%; margin: 4px 0 0; overflow-wrap: anywhere; word-break: break-word; color: #241739; font-size: clamp(1rem, 2.5vw, 1.24rem); line-height: 1.5; }
.copy-btn { min-width: 96px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border: 1px solid #d6c7ed; border-radius: 12px; background: #f8f4ff; font-weight: 800; cursor: pointer; transition: background .2s ease, border-color .2s ease, color .2s ease; }
.copy-btn:hover { border-color: #bca6e4; background: #eee6ff; }
.copy-btn.copied { border-color: rgba(19,138,87,.3); color: var(--success); background: #eefaf4; }

.faq-list { display: grid; gap: 12px; }
.faq-item { overflow: hidden; border: 1px solid var(--border); border-radius: 17px; background: #fff; }
.faq-question { position: relative; width: 100%; padding: 18px 54px 18px 18px; border: 0; text-align: left; background: transparent; font-weight: 850; cursor: pointer; }
.faq-question::after { position: absolute; right: 20px; font-size: 1.3rem; content: "+"; }
.faq-question[aria-expanded="true"]::after { content: "−"; }
.faq-answer { padding: 0 18px 18px; color: var(--muted); }
.faq-answer[hidden] { display: none; }
.faq-answer p:last-child { margin-bottom: 0; }
.cta-band { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 42px; border-radius: 34px; color: #fff; background: linear-gradient(140deg, #19083b, #4e1a91); }
.cta-band p { max-width: 650px; color: #ddd2f7; }
.guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.guide-card { overflow: hidden; padding: 0; }
.guide-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.guide-card-body { padding: 22px; }
.tag { display: inline-block; padding: 5px 9px; border-radius: 999px; color: #5b2bc1; background: #eee7ff; font-size: .75rem; font-weight: 850; }
.page-hero { padding: 70px 0 36px; }
.page-hero h1 { margin: 14px 0; font-size: clamp(2.4rem, 5vw, 4.4rem); line-height: 1.05; letter-spacing: -.045em; }
.article-wrap { display: grid; grid-template-columns: minmax(0, 760px) minmax(220px, 260px); align-items: start; gap: 42px; }
.article { min-width: 0; padding: clamp(22px, 4vw, 44px); border: 1px solid var(--border); border-radius: 28px; background: #fff; box-shadow: var(--shadow-md); }
.article h2 { margin-top: 2.2rem; font-size: clamp(1.55rem, 3vw, 2rem); line-height: 1.2; }
.article h3 { margin-top: 1.6rem; font-size: 1.3rem; }
.article p, .article li { color: #4f485f; }
.article table { width: 100%; margin: 20px 0; border-collapse: collapse; }
.article th, .article td { min-width: 130px; padding: 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.article th { background: #f5f0ff; }
.table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.article img { margin-bottom: 28px; border-radius: 22px; }
.toc { position: sticky; top: 100px; padding: 20px; border: 1px solid var(--border); border-radius: 20px; background: #fff; }
.toc a { display: block; padding: 7px 0; color: #5c5470; }
.legal { max-width: 850px; }
.contact-box { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.notice { padding: 16px; border-left: 4px solid var(--primary); border-radius: 14px; background: #f1ebff; }
.site-footer { margin-top: 70px; padding: 62px 0 0; color: #fff; background: #110625; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 42px; }
.site-footer p { color: #cfc5e4; }
.site-footer h2 { font-size: 1rem; }
.site-footer a { display: block; padding: 5px 0; color: #dcd3ed; }
.site-footer a:hover { color: #fff; }
.footer-bottom { margin-top: 40px; padding: 20px 0; border-top: 1px solid rgba(255,255,255,.12); color: #c8bddb; text-align: center; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.footer-bottom::-webkit-scrollbar { display: none; }
.footer-bottom span { display: inline-block; }
.footer-bottom a { display: inline; padding: 0; color: #fff; font-weight: 700; }
.toast { position: fixed; z-index: 200; right: 20px; bottom: 20px; max-width: calc(100vw - 40px); padding: 12px 16px; border-radius: 12px; color: #fff; background: #171126; opacity: 0; transform: translateY(15px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: none; }
.not-found { padding: 100px 0; text-align: center; }
.not-found strong { display: block; color: transparent; background: var(--gradient); -webkit-background-clip: text; background-clip: text; font-size: clamp(5rem, 15vw, 10rem); line-height: 1; }

@media (max-width: 1080px) {
  .main-nav a { padding-inline: 8px; font-size: .86rem; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(360px, .85fr); }
}

@media (max-width: 1024px) {
  .menu-toggle { display: block; }
  .main-nav { position: absolute; top: calc(100% - 4px); right: 0; left: auto; width: min(360px, calc(100vw - 40px)); max-height: calc(100vh - 98px); overflow-y: auto; display: none; align-items: stretch; flex-direction: column; padding: 12px; border: 1px solid var(--border); border-radius: 20px; background: #fff; box-shadow: var(--shadow-md); }
  .main-nav.open { display: flex; }
  .main-nav a { width: 100%; padding: 11px 12px; font-size: .94rem; }
  .hero-grid, .split, .article-wrap { grid-template-columns: 1fr; }
  .hero-grid { gap: 42px; }
  .preview-orbit { min-height: 370px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-grid, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toc { position: static; order: -1; }
  .generator-toolbar { grid-template-columns: 150px minmax(0, 1fr); }
  .generate-button { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  :root { --header-height: 70px; }
  .container { width: min(100% - 24px, 1180px); }
  section { padding: 58px 0; }
  .hero { padding: 50px 0 42px; }
  .hero h1 { font-size: clamp(2.5rem, 13vw, 4rem); }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .preview-orbit { min-height: 320px; border-radius: 28px; }
  .float-card { max-width: calc(100% - 28px); padding: 13px 14px; font-size: .93rem; }
  .float-card:nth-child(1) { top: 34px; left: 14px; }
  .float-card:nth-child(2) { top: 112px; right: 14px; }
  .float-card:nth-child(3) { bottom: 78px; left: 14px; }
  .float-card:nth-child(4) { right: 14px; bottom: 22px; }
  .grid-4, .grid-3, .guide-grid, .contact-box, .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > div:first-child { grid-column: auto; }
  .generator-panel { padding: 16px; border-radius: 24px; }
  .generator-toolbar { grid-template-columns: 1fr; }
  .generate-button { grid-column: auto; width: 100%; white-space: normal; }
  .tool-meta { align-items: flex-start; flex-direction: column; gap: 8px; }
  .results-header { align-items: stretch; flex-direction: column; }
  .copy-all-button { width: 100%; }
  .result-card { grid-template-columns: 1fr; gap: 12px; }
  .copy-btn { width: 100%; }
  .cta-band { display: block; padding: 28px; }
  .cta-band .btn { width: 100%; }
  .article { padding: 20px; border-radius: 22px; }
  .article table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .page-hero { padding-top: 48px; }
  .site-footer { margin-top: 48px; }
}

@media (max-width: 420px) {
  .footer-bottom { font-size: .82rem; }
  .container { width: min(100% - 18px, 1180px); }
  .brand img { width: 40px; height: 40px; }
  .menu-toggle { width: 44px; height: 44px; flex-basis: 44px; }
  .hero h1 { letter-spacing: -.045em; }
  .section-head h2 { font-size: 1.9rem; }
  .card { padding: 20px; }
  .result-text { font-size: 1rem; }
}

@media (min-width: 1600px) {
  .container { width: min(1320px, calc(100% - 64px)); }
  .hero-grid { grid-template-columns: minmax(0, 1.04fr) minmax(500px, .96fr); }
}

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