:root {
  color-scheme: light dark;
  --bg-gradient: radial-gradient(circle at 20% 20%, #2f80ed 0%, rgba(47, 128, 237, 0) 55%),
    radial-gradient(circle at 80% 0%, #bb6bd9 0%, rgba(187, 107, 217, 0) 45%),
    linear-gradient(180deg, #0f172a 0%, #111827 100%);
  --card-bg: rgba(255, 255, 255, 0.18);
  --card-border: rgba(255, 255, 255, 0.3);
  --text-primary: #0f172a;
  --text-secondary: #4b5563;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-soft: 0 24px 60px rgba(15, 23, 42, 0.25);
  --shadow-hard: 0 10px 30px rgba(15, 23, 42, 0.18);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4ecf7 100%);
    --card-bg: #ffffff;
    --card-border: rgba(15, 23, 42, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 32px 18px;
}

main {
  width: 100%;
}

.app-shell {
  width: min(720px, 100%);
  margin: 0 auto;
  background: var(--card-bg);
  backdrop-filter: blur(22px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.8rem, 3vw + 1rem, 3.2rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 2.5vw, 2.2rem);
}

header {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

header h1 {
  margin: 0;
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
  line-height: 1.2;
  font-weight: 700;
}

header p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.95rem;
}

section {
  display: grid;
  gap: 1rem;
}

form {
  display: grid;
  gap: 1rem;
}

label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.input-control {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

input[type="url"] {
  flex: 1 1 220px;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background-color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="url"]:focus {
  border-color: rgba(37, 99, 235, 0.8);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

button[type="submit"] {
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-md);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
}

button[type="submit"]:hover,
button[type="submit"]:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.28);
}

button[type="submit"]:active {
  transform: translateY(0);
}

.status {
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  line-height: 1.4;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.status[data-state="success"] {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.status[data-state="error"] {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

.status[hidden] {
  display: none;
}

.output-panel {
  display: grid;
  gap: 1.2rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.32);
  color: #f8fafc;
  box-shadow: var(--shadow-hard);
}

.output-panel h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.code-block {
  position: relative;
  background: rgba(15, 23, 42, 0.72);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: "Fira Code", "Source Code Pro", Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.5;
  overflow-x: auto;
}

.code-block button {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
  background: rgba(248, 250, 252, 0.92);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.code-block button:hover,
.code-block button:focus-visible {
  background: #e2e8f0;
  transform: translateY(-1px);
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.is-hidden {
  display: none;
}

@media (min-width: 768px) {
  body {
    padding: 48px;
  }

  form {
    gap: 1.2rem;
  }

  .input-control {
    flex-wrap: nowrap;
  }
}

@media (max-width: 480px) {
  .app-shell {
    padding: 1.5rem;
  }

  button[type="submit"] {
    width: 100%;
    justify-content: center;
  }

  input[type="url"] {
    flex-basis: 100%;
  }
}

.doc-intro {
  background: rgba(248, 250, 252, 0.85);
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 1.25rem 1.5rem;
  display: grid;
  gap: 1rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.doc-intro h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.doc-intro ol {
  margin: 0;
  padding-left: 1.4rem;
  display: grid;
  gap: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.doc-intro li {
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.doc-code-block {
  position: relative;
  margin-top: 0.8rem;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  border: 1px solid rgba(37, 99, 235, 0.28);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.doc-code-block button {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
  background: rgba(248, 250, 252, 0.92);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.doc-code-block button:hover,
.doc-code-block button:focus-visible {
  background: #e2e8f0;
  transform: translateY(-1px);
}

.doc-code-block pre {
  margin: 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Fira Code", "Source Code Pro", Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}


.doc-code-block code {
  color: inherit;
}

@media (prefers-color-scheme: dark) {
  .doc-intro {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(148, 163, 184, 0.35);
  }

  .doc-intro li {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(37, 99, 235, 0.2);
  }

  .doc-code-block {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(59, 130, 246, 0.35);
  }

  .doc-code-block button {
    background: rgba(248, 250, 252, 0.88);
    color: #0f172a;
  }
}

.guide-figure {
  margin: 1rem 0 0;
  display: grid;
  gap: 0.5rem;
  justify-items: center;
}

.guide-figure img {
  width: min(100%, 644px);
  height: auto;
}

.guide-figure figcaption {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
}








