:root {
  --primary: #6c3bff;
  --primary-dark: #5428d9;
  --accent: #ff4d6d;
  --bg: #f7f8fc;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 12px 40px rgba(84, 40, 217, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.nav-links a {
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lang-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  min-height: 36px;
  min-width: 36px;
}

.btn-block-mobile {
  width: auto;
}

.desktop-only {
  display: flex;
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.toc-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  background: #fafbff;
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.toc-toggle-icon {
  transition: transform 0.2s ease;
}

.toc-panel.open .toc-toggle-icon,
.toc-toggle[aria-expanded="true"] .toc-toggle-icon {
  transform: rotate(180deg);
}

.content-card ol,
.content-card ul {
  overflow-wrap: anywhere;
}

.content-card ol ol {
  margin-top: 8px;
}

.lang-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 64px 0 48px;
}

.hero-copy h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero-copy p {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 28px;
  max-width: 560px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #f3efff;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 600;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #fff;
  box-shadow: 0 10px 24px rgba(108, 59, 255, 0.25);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-dark {
  background: #111827;
  color: #fff;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.22);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.cancel-page {
  max-width: 640px;
}

.cancel-standalone-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand-static {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
}

.brand-static img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.cancel-standalone-footer .footer-links a:only-child {
  margin-left: auto;
}

.cancel-card {
  padding: 28px 24px;
}

.cancel-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-label {
  font-weight: 600;
  font-size: 15px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  background: #fff;
}

.form-input:focus {
  outline: 2px solid rgba(108, 59, 255, 0.25);
  border-color: var(--primary);
}

.form-tip {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.form-actions {
  margin-top: 8px;
}

.cancel-message {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}

.cancel-message[hidden] {
  display: none;
}

.cancel-message--success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.cancel-message--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.cancel-message--info:empty {
  display: none;
}

.hero-visual img {
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.section {
  padding: 56px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 36px;
}

.section-title h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 10px;
}

.section-title p {
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto;
}

.feature-grid,
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.feature-card img {
  width: 100%;
  max-width: 220px;
  margin: 0 auto 16px;
  border-radius: 12px;
}

.feature-card h3 {
  margin-bottom: 10px;
  color: var(--primary-dark);
}

.feature-card p {
  color: var(--muted);
  font-size: 15px;
}

.download-section {
  background: linear-gradient(180deg, #ffffff 0%, #f3efff 100%);
}

.download-card {
  text-align: center;
}

.download-card .app-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  margin: 0 auto 16px;
  box-shadow: var(--shadow);
}

.download-card h3 {
  margin-bottom: 8px;
}

.download-card p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.qr-box {
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  background: #fff;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
}

.content-page {
  padding: 40px 0 56px;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 8px;
}

.page-header p,
.updated {
  color: var(--muted);
}

.content-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.content-card h2 {
  font-size: 1.2rem;
  margin: 28px 0 12px;
  color: var(--primary-dark);
}

.content-card h2:first-child { margin-top: 0; }

.content-card p,
.content-card li {
  color: #374151;
  margin-bottom: 12px;
}

.content-card ul {
  padding-left: 22px;
  margin-bottom: 16px;
}

.highlight {
  background: #f3efff;
  border-left: 4px solid var(--primary);
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.lang-panel { display: none; }
.lang-panel.active { display: block; }

.legal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 84px;
  padding: 20px;
}

.legal-toc h3 {
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--primary-dark);
}

.legal-toc nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-toc a {
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  line-height: 1.5;
  padding: 4px 0;
  border-bottom: 1px solid #f3f4f6;
}

.legal-toc a:hover {
  color: var(--primary);
}

.legal-section {
  scroll-margin-top: 88px;
  padding-top: 8px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.legal-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.legal-section h2 {
  font-size: 1.15rem;
  margin: 0 0 14px;
  color: var(--primary-dark);
}

.legal-contact {
  margin-top: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 28px 0 max(40px, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 14px;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-toc {
    position: static;
    padding: 16px;
  }

  .toc-toggle {
    display: flex;
  }

  .toc-panel {
    display: none;
    margin-top: 12px;
  }

  .toc-panel.open {
    display: block;
  }

  .legal-toc nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .legal-toc a {
    padding: 8px 0;
  }

  .content-card {
    padding: 20px 16px;
  }

  .content-page {
    padding: 28px 0 40px;
  }

  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-bar {
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: inline-flex;
  }
}

@media (min-width: 861px) {
  .legal-toc .toc-toggle {
    display: none;
  }

  .legal-toc .toc-panel {
    display: block !important;
  }

  .download-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .container {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }

  .nav-bar {
    min-height: 60px;
  }

  .brand span {
    font-size: 1rem;
  }

  .hero {
    padding: 28px 0 32px;
    gap: 24px;
  }

  .hero-copy h1 {
    font-size: 1.85rem;
  }

  .hero-copy p {
    font-size: 0.98rem;
    margin-bottom: 20px;
  }

  .badge {
    font-size: 12px;
    padding: 6px 10px;
  }

  .btn-block-mobile,
  .download-actions .btn {
    width: 100%;
  }

  .desktop-only {
    display: none !important;
  }

  .section {
    padding: 40px 0;
  }

  .card {
    padding: 18px;
  }

  .menu-toggle {
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    gap: 12px;
    padding: 12px 0 16px;
    border-top: 1px solid var(--border);
  }

  .nav-links a {
    width: 100%;
    padding: 6px 0;
    font-size: 16px;
  }

  .lang-switch {
    width: 100%;
    padding-top: 4px;
  }

  .lang-btn {
    flex: 1;
    text-align: center;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }

  .hero {
    padding-top: 72px;
    gap: 48px;
  }
}

.about-back-button {
  display: none;
  width: 36px;
  height: 36px;
  padding: 0 0 3px;
  place-items: center;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font: 400 30px/1 Arial, sans-serif;
}

.about-back-button:focus-visible {
  outline: 3px solid rgba(108, 59, 255, 0.28);
  outline-offset: 2px;
}

.about-page {
  padding-top: 28px;
}

.about-container {
  max-width: 720px;
}

.about-hero {
  text-align: center;
  margin-bottom: 24px;
}

.about-logo {
  width: 120px;
  height: 120px;
  margin: 0 auto 12px;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.about-hero h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2rem);
  line-height: 1.2;
}

.about-divider {
  width: 40px;
  height: 2px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, var(--primary), #3b82f6);
  border-radius: 999px;
}

.about-card p {
  line-height: 1.85;
}

.about-section {
  scroll-margin-top: 88px;
  margin: 8px 0 4px;
}

.about-section h2 {
  font-size: 1.05rem;
  margin: 0 0 10px;
  color: var(--primary-dark);
}

.about-quick-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  margin-top: 22px;
  font-size: 14px;
  font-weight: 600;
}

.about-quick-links a {
  text-decoration: none;
}

.about-back-button--standalone,
.app-embedded .about-back-button {
  display: grid;
  flex: 0 0 36px;
}

.app-embedded .about-page {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.app-embedded .site-header {
  background: rgba(255, 255, 255, 0.96);
}

.app-embedded .nav-bar {
  flex-wrap: nowrap;
}

.app-embedded .brand {
  margin-left: 0;
}
