:root {
  --color-bg: #0b1220;
  --color-surface: #101a2e;
  --color-surface-alt: #141f38;
  --color-primary: #60a5fa;
  --color-primary-soft: rgba(96, 165, 250, 0.14);
  --color-accent: #f97316;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-border: rgba(148, 163, 184, 0.18);
  --shadow-sm: 0 10px 24px rgba(2, 6, 23, 0.45);
  --shadow-md: 0 18px 40px rgba(2, 6, 23, 0.55);
  --shadow-lg: 0 28px 60px rgba(2, 6, 23, 0.6);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --transition-base: 0.2s ease;
}

body[data-theme="light"] {
  --color-bg: #f4f6fb;
  --color-surface: #ffffff;
  --color-surface-alt: #f8f9ff;
  --color-primary: #2563eb;
  --color-primary-soft: rgba(37, 99, 235, 0.1);
  --color-accent: #ef4444;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 14px 32px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 24px 50px rgba(15, 23, 42, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans JP", "Noto Sans TC", "Noto Sans", "Hiragino Sans", "Yu Gothic", sans-serif;
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.2), transparent 55%), var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  transition: opacity 0.2s ease;
}

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

.page-fade-out {
  opacity: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.top-controls {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px 0 0;
}

.theme-toggle {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.theme-toggle .theme-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
}
.language-switcher {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 6px 12px;
  box-shadow: var(--shadow-sm);
}

.language-select {
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--color-text);
  outline: none;
}

.hero {
  padding: 40px 0 32px;
}

.hero-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), #38bdf8, #34d399);
}

.hero-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-text-muted);
  margin: 0 0 8px;
}

.hero-title {
  font-size: clamp(26px, 3vw, 36px);
  margin: 0 0 8px;
}

.hero-subtitle {
  color: var(--color-text-muted);
  font-size: 16px;
  margin: 0;
}

.section {
  padding: 24px 0;
}

.section-title {
  font-size: 20px;
  margin: 0 0 14px;
  color: var(--color-text);
}

.section-lead {
  margin: 0 0 20px;
  color: var(--color-text-muted);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  cursor: pointer;
  color: var(--color-text);
}

.category-card:hover,
.category-card.is-active {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.4);
}

.category-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--color-primary-soft);
  display: grid;
  place-items: center;
  font-size: 20px;
}

.category-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-title {
  font-weight: 600;
}

.category-desc {
  font-size: 12px;
  color: var(--color-text-muted);
}

.faq-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
}

.faq-category-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 14px 0;
  font-size: 15px;
  border: none;
  background: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  color: var(--color-text);
}

.faq-question span {
  flex: 1;
  margin-right: 12px;
}

.faq-icon {
  transition: transform var(--transition-base);
  color: var(--color-primary);
  margin-left: auto;
  width: 20px;
  text-align: center;
}

.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 0 14px;
  color: var(--color-text-muted);
  font-size: 14px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.32s ease, opacity 0.32s ease;
}

.faq-answer.is-open {
  max-height: 280px;
  opacity: 1;
}

.form-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

input,
select,
textarea {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  color: var(--color-text);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: var(--color-surface);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.helper {
  font-size: 12px;
  color: var(--color-text-muted);
}

.field-error {
  font-size: 12px;
  color: #dc2626;
}

.purchase-fields {
  background: rgba(148, 163, 184, 0.08);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(148, 163, 184, 0.35);
  padding: 24px 16px 16px;
  display: none;
}

.purchase-fields .section-title {
  margin-top: 8px;
}

.purchase-fields.is-visible {
  display: block;
  animation: fadeIn 0.3s ease;
}

.radio-group {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.radio-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-ui {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.5);
  display: inline-grid;
  place-items: center;
  transition: transform var(--transition-base), border-color var(--transition-base), background var(--transition-base);
}

.radio-ui::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-primary);
  transform: scale(0);
  transition: transform var(--transition-base);
}

.radio-card input:checked + .radio-ui {
  border-color: var(--color-primary);
  background: rgba(96, 165, 250, 0.18);
}

.radio-card input:checked + .radio-ui::after {
  transform: scale(1);
}

.radio-card input:checked ~ .radio-label {
  color: var(--color-text);
}

.radio-card:has(input:checked) {
  border-color: rgba(96, 165, 250, 0.6);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.radio-label strong {
  font-weight: 700;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.submit-button {
  flex: 0 0 auto;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  display: none;
  animation: spin 0.8s linear infinite;
}

.submit-button.is-loading .button-spinner {
  display: inline-block;
}

.submit-button.is-loading .button-label {
  opacity: 0.8;
}

.status-text {
  font-size: 13px;
  color: var(--color-text-muted);
}

body.is-loading,
body.is-success {
  overflow: hidden;
}

body.is-loading .page,
body.is-success .page {
  filter: blur(6px) brightness(0.85);
  transition: filter 0.2s ease;
}

.loading-overlay,
.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.loading-overlay.is-visible,
.success-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 30, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.loading-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  place-items: center;
  color: #fff;
  text-align: center;
}

.loading-spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  font-size: 15px;
  letter-spacing: 0.04em;
}

.success-card {
  position: relative;
  z-index: 1;
  width: min(520px, 92vw);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  padding: 28px 28px 24px;
  text-align: center;
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.success-overlay.is-visible .success-card {
  transform: scale(1);
  opacity: 1;
}

.success-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  color: #22c55e;
}

.success-title {
  margin: 0 0 6px;
  font-size: 20px;
}

.success-message {
  margin: 0 0 18px;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.success-close {
  border: none;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.success-close:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 720px) {
  .success-card {
    padding: 22px 20px;
  }
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #111827;
  color: #fff;
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--transition-base), transform var(--transition-base);
  pointer-events: none;
  z-index: 50;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.footer {
  margin-top: auto;
  padding: 32px 0 48px;
  color: var(--color-text-muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.footer-links a {
  color: var(--color-text-muted);
}

.version {
  margin-top: 12px;
}

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeIn 0.6s ease forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  .hero-card {
    padding: 24px;
  }

  .form-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

.page-fade-out {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 720px) {
  .hero-card {
    padding: 24px;
  }

  .category-card {
    align-items: flex-start;
  }

  .form-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
