:root {
  --bg: #0f1115;
  --surface: #181a20;
  --surface-hover: #1e2129;
  --text: #e5e7eb;
  --text-secondary: #9ca3af;
  --border: #2a2d36;
  --accent: #4ade80;
  --accent-hover: #22c55e;
  --accent-dim: rgba(74, 222, 128, 0.12);
  --code-bg: #11131a;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.3);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: #353945; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .08s;
}
.btn:hover { background: var(--surface-hover); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(74, 222, 128, 0.25);
  font-weight: 600;
}
.btn-primary:hover {
  background: rgba(74, 222, 128, 0.18);
  border-color: rgba(74, 222, 128, 0.4);
}
.btn:disabled { opacity: .35; cursor: not-allowed; }
.textarea-like {
  width: 100%;
  min-height: 120px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d1d5db;
  resize: vertical;
}
.toc {
  position: sticky;
  top: 24px;
  align-self: start;
}
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li + li { margin-top: 8px; }
.toc a { color: var(--text-secondary); font-size: 14px; }
.toc a:hover { color: var(--accent); text-decoration: none; }
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
  transition: color .15s, background .15s, border-color .15s;
}
.back-to-top:hover { color: var(--accent); background: var(--surface-hover); border-color: var(--accent); }
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .container { padding: 16px 12px 80px; }
}
