@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700;900&display=swap');

:root {
  --bg-primary: #0a0a12;
  --bg-secondary: #12121f;
  --bg-card: #181828;
  --bg-card-hover: #1e1e32;
  --text-primary: #eaeaf2;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a82;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99,102,241,0.15);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: rgba(255,255,255,0.06);
  --radius: 16px;
  --radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans JP', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
.container { max-width: 820px; margin: 0 auto; padding: 0 24px; }
.main-content { margin-left: 260px; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 200;
  padding: 20px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }
.sidebar-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.sidebar-nav {
  list-style: none;
  padding: 0 8px;
}
.sidebar-nav > li { margin-bottom: 2px; }
.sidebar-link {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  line-height: 1.4;
}
.sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}
.sidebar-link.active {
  color: var(--accent-light);
  background: var(--accent-glow);
  border-left: 3px solid var(--accent);
}
.sidebar-link.sub {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px 5px 20px;
  color: var(--text-muted);
}
.sidebar-link.sub.active {
  color: var(--accent-light);
  background: var(--accent-glow);
}
.sidebar-sub {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-sub li { margin-bottom: 1px; }

/* Mobile: hide sidebar */
/* ===== HAMBURGER BUTTON ===== */
.hamburger {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 300;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: all 0.3s;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all 0.3s;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.3s;
}
.sidebar-overlay.active { display: block; opacity: 1; }

/* Mobile: hamburger slide-in */
@media (max-width: 960px) {
  .hamburger { display: flex; }
  .main-content { margin-left: 0; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .sidebar.open { transform: translateX(0); }
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
  background: linear-gradient(180deg, rgba(99,102,241,0.08) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}
.hero-badge {
  display: inline-block;
  background: var(--accent-glow);
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 900;
  background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.3;
  margin-bottom: 16px;
}
.hero-sub {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.hero-stat {
  text-align: center;
}
.hero-stat-num {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent-light);
}
.hero-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== PROGRESS BAR ===== */
.progress-bar-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,18,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}
.progress-bar-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.progress-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

/* ===== PREREQUISITES ===== */
.prereq {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}
.prereq h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.prereq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.prereq-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.prereq-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border-radius: 10px;
}
.prereq-card h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.prereq-card p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== STEPS ===== */
.step-section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}
.step-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.step-number {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}
.step-header h2 {
  font-size: 22px;
  font-weight: 700;
}
.step-time {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 3px 10px;
  border-radius: 12px;
  margin-left: auto;
  white-space: nowrap;
}

/* ===== INSTRUCTIONS ===== */
.instructions {
  counter-reset: instruction;
}
.instruction {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}
.instruction:hover { border-color: rgba(99,102,241,0.3); }
.instruction-num {
  counter-increment: instruction;
  width: 28px;
  height: 28px;
  background: var(--accent-glow);
  color: var(--accent-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.instruction-num::before { content: counter(instruction); }
.instruction-content { flex: 1; }
.instruction-content p { margin-bottom: 8px; }
.instruction-content p:last-child { margin-bottom: 0; }

/* ===== SCREENSHOT ===== */
.screenshot-wrap {
  margin: 24px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.screenshot-wrap img {
  width: 100%;
  display: block;
  cursor: zoom-in;
  transition: transform 0.3s;
}
.screenshot-wrap img:hover { transform: scale(1.02); }
.screenshot-caption {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border);
}

/* ===== CODE BLOCK ===== */
.code-block {
  background: rgba(15,15,28,0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 16px 0;
  overflow: hidden;
}
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.copy-btn {
  background: var(--accent-glow);
  color: var(--accent-light);
  border: 1px solid rgba(99,102,241,0.2);
  padding: 4px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn:hover { background: rgba(99,102,241,0.25); }
.copy-btn.copied { background: rgba(34,197,94,0.15); color: var(--success); border-color: rgba(34,197,94,0.3); }
.code-body {
  padding: 16px 20px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  color: #a5b4fc;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===== ALERT BOXES ===== */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin: 20px 0;
  display: flex;
  gap: 12px;
  font-size: 14px;
  line-height: 1.7;
}
.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.alert-info { background: rgba(99,102,241,0.08); border-left: 3px solid var(--accent); color: var(--text-secondary); }
.alert-warning { background: rgba(245,158,11,0.08); border-left: 3px solid var(--warning); color: #d4a057; }
.alert-danger { background: rgba(239,68,68,0.08); border-left: 3px solid var(--danger); color: #e88; }
.alert-success { background: rgba(34,197,94,0.08); border-left: 3px solid var(--success); color: #6ecf8e; }
.alert strong { color: var(--text-primary); }

/* ===== OS TOGGLE ===== */
.os-toggle {
  display: flex;
  gap: 0;
  margin: 16px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  width: fit-content;
}
.os-tab {
  padding: 8px 20px;
  font-size: 13px;
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text-muted);
  border: none;
  transition: all 0.2s;
  font-family: inherit;
  font-weight: 600;
}
.os-tab.active {
  background: var(--accent);
  color: #fff;
}
.os-content { display: none; }
.os-content.active { display: block; }

/* ===== SUBSTEP ===== */
.substep {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.substep-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.substep-badge {
  font-size: 12px;
  font-weight: 700;
  background: var(--accent-glow);
  color: var(--accent-light);
  padding: 4px 12px;
  border-radius: 6px;
}
.substep-header h3 {
  font-size: 18px;
  font-weight: 700;
}

/* ===== COMPLETION ===== */
.completion {
  padding: 80px 0;
  text-align: center;
}
.completion-card {
  background: linear-gradient(135deg, rgba(34,197,94,0.08), rgba(99,102,241,0.08));
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 24px;
  padding: 48px 32px;
}
.completion-icon { font-size: 56px; margin-bottom: 16px; }
.completion h2 {
  font-size: 28px;
  font-weight: 900;
  color: var(--success);
  margin-bottom: 12px;
}
.completion p { color: var(--text-secondary); max-width: 460px; margin: 0 auto; }

/* ===== SUMMARY TABLE ===== */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}
.summary-table thead th {
  background: var(--bg-card);
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--accent-light);
  border-bottom: 2px solid rgba(99,102,241,0.2);
}
.summary-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.summary-table tbody tr:hover { background: var(--bg-card); }

/* ===== FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== IMAGE LIGHTBOX ===== */
.lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  cursor: zoom-out;
  padding: 40px;
  align-items: center;
  justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 95%;
  max-height: 95vh;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .hero { padding: 48px 16px 40px; }
  .hero-stats { gap: 24px; }
  .step-header { flex-wrap: wrap; }
  .step-time { margin-left: 64px; }
  .instruction { flex-direction: column; gap: 8px; }
  .prereq-grid { grid-template-columns: 1fr; }
}
