/* AI探究ラボ 追加テーマ：Linux探検隊と同じ密度の単元ページ用 */
body {
  background-color: #eef2fb;
  background-image:
    radial-gradient(rgba(37, 99, 235, 0.08) 1px, transparent 1px),
    radial-gradient(rgba(124, 58, 237, 0.08) 1px, transparent 1px);
  background-size: 24px 24px, 48px 48px;
  background-position: 0 0, 12px 12px;
}

header { border-bottom-color: #2563eb; }
main { max-width: 880px; }

.lesson {
  background: #fff;
  border: 1px solid #cfdcf3;
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.08), 0 10px 26px rgba(23,32,51,0.10);
  margin: 24px 0;
}

.lesson section {
  margin: 32px 0;
}
.lesson section + section { margin-top: 36px; }
.lesson section > h2 { margin-bottom: 18px; }

.lesson-header {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.10) 0 25%, transparent 25% 50%, rgba(255,255,255,0.10) 50% 75%, transparent 75%),
    linear-gradient(180deg, #2454b8 0%, #16325d 100%);
  background-size: 28px 28px, auto;
  margin: -28px -24px 26px;
  border-radius: 12px 12px 0 0;
  padding: 24px;
  position: relative;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.22);
  color: #fff;
}
.lesson-header::after {
  content: "";
  position: absolute;
  bottom: -6px; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(90deg, #f59e0b 0, #f59e0b 12px, #b45309 12px, #b45309 24px);
}
.lesson-header h1 {
  margin: 12px 0 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.lesson-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.lesson-tags .tag {
  box-shadow: 0 2px 0 rgba(0,0,0,0.28);
  font-size: 0.82rem;
  padding: 4px 10px;
}
.tag-num { background: #f59e0b; color: #1f1706; }
.tag-lv { background: #16325d; color: #fff; }
.tag-time { background: #1f2937; color: #fff; }
.tag-sub { background: #7c3aed; color: #fff; }

.lesson h2 {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px;
  font-size: 1.18rem;
}
.lesson h2::before {
  content: "";
  width: 16px; height: 16px;
  background: #2563eb;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #f59e0b;
  flex: 0 0 auto;
}

/* ===== ミッション ===== */
.mission-card {
  background: #fffdf2;
  border: 4px solid #2563eb;
  box-shadow: 0 6px 0 #16325d, 0 10px 20px rgba(0,0,0,0.12);
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
}
.mission-banner {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  font-family: "DotGothic16", sans-serif;
  letter-spacing: 0.05em;
  padding: 12px 18px;
  text-shadow: 2px 2px 0 #16325d;
  position: relative;
  font-size: 1.05rem;
  font-weight: 700;
}
.mission-banner::before { content: "> "; color: #cfe1ff; }
.mission-banner::after {
  content: "";
  position: absolute; bottom: -6px; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(90deg, #f59e0b 0, #f59e0b 8px, #b45309 8px, #b45309 16px);
}
.mission-content {
  padding: 22px 22px 18px;
  background-image: repeating-linear-gradient(0deg, transparent 0, transparent 27px, rgba(37,99,235,0.06) 27px, rgba(37,99,235,0.06) 28px);
}
.mission-content p { margin: 0 0 8px; color: #172033; }
.mission-content p:last-child { margin-bottom: 0; }

/* ===== プライバシー注意（常駐） ===== */
.privacy-reminder {
  background: #fff7ed;
  border: 2px dashed #ea580c;
  border-radius: 8px;
  padding: 12px 16px;
  color: #7c2d12;
  font-size: 0.94rem;
  margin: 18px 0;
}
.privacy-reminder strong { color: #c2410c; margin-right: 4px; }

/* ===== ゴール ===== */
.goals-grid {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}
.goals-grid li {
  background: #fff;
  border: 3px solid #2563eb;
  border-radius: 8px;
  padding: 12px 16px 12px 56px;
  position: relative;
  box-shadow: 0 3px 0 #16325d;
}
.goals-grid li::before {
  content: "✓";
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #f59e0b;
  color: #1f1706;
  border: 2px solid #b45309;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold;
  box-shadow: 0 2px 0 #92400e;
}

/* ===== ステップ ===== */
.steps-quest {
  list-style: none;
  padding: 0;
  counter-reset: step;
}
.steps-quest li {
  counter-increment: step;
  position: relative;
  padding: 14px 16px 14px 60px;
  background: #eef4ff;
  border-left: 5px solid #2563eb;
  border-radius: 4px;
  margin-bottom: 9px;
}
.steps-quest li::before {
  content: counter(step);
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: "DotGothic16", sans-serif;
  box-shadow: 0 3px 0 #16325d;
}

/* ===== プロンプト＆AI回答 ===== */
.prompt-block,
.response-block,
.code-block {
  background: #0f172a;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 0 rgba(0,0,0,0.24);
  margin: 12px 0;
}
.prompt-header,
.response-header,
.code-header {
  background: #1e293b;
  color: #cbd5e1;
  border-bottom: 1px solid #334155;
  padding: 8px 14px;
  font-size: 0.86rem;
  font-weight: bold;
}
.prompt-block pre,
.response-block pre,
.code-block pre {
  margin: 0;
  padding: 16px 18px;
  color: #cbd5e1;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 0.92rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.prompt-block { border-left: 5px solid #f59e0b; }
.response-block { border-left: 5px solid #10b981; }
.response-block pre { color: #d1fae5; }
.code-lang {
  background: #f59e0b;
  color: #1f1706;
  padding: 2px 8px;
  border-radius: 3px;
}
.code-filename { color: #94a3b8; }

/* ===== ポイント ===== */
.point-box {
  background: #fffbea;
  border: 3px solid #f59e0b;
  padding: 18px 18px 18px 64px;
  position: relative;
  box-shadow: 0 4px 0 #b45309;
  border-radius: 8px;
}
.point-box::before {
  content: "🧭";
  position: absolute;
  left: 14px; top: 16px;
  font-size: 1.6rem;
  background: #fff;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #f59e0b;
}
.point-box p { margin: 0; color: #172033; }

.concept-explain h2::before { background: #7c3aed; }

/* ===== チャレンジ ===== */
.challenge-box {
  background: linear-gradient(135deg, #ddd6fe 0%, #a78bfa 100%);
  border: 3px solid #6d28d9;
  padding: 28px 22px 18px;
  position: relative;
  box-shadow: 0 5px 0 #4c1d95, 0 8px 20px rgba(76,29,149,0.22);
  margin-top: 20px;
  border-radius: 8px;
}
.challenge-box::before {
  content: "追加ミッション";
  position: absolute;
  top: -16px; left: 14px;
  background: #6d28d9;
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-family: "DotGothic16", sans-serif;
  font-size: 0.85rem;
  box-shadow: 0 2px 0 #4c1d95;
}
.challenge-box ul {
  margin: 0;
  padding-left: 1.3em;
  color: #1e1b4b;
}
.challenge-box li { margin: 0 0 6px; }

/* ===== ふりかえり ===== */
.reflect-box {
  background: #fdf8ec;
  border: 2px dashed #b45309;
  border-radius: 8px;
  position: relative;
  padding: 24px 18px 18px;
  margin-top: 18px;
}
.reflect-box::before {
  content: "探究ログ";
  position: absolute;
  top: -16px; right: 16px;
  background: #fff;
  color: #6a4b12;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.86rem;
  font-weight: bold;
}
.reflect-box ul {
  margin: 0;
  padding-left: 1.3em;
  color: #172033;
}
.reflect-box li { margin: 0 0 6px; }

/* ===== トラブル ===== */
.trouble-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 18px;
}
.trouble-box ul {
  margin: 0;
  padding-left: 1.3em;
  color: #7f1d1d;
}
.trouble-box li { margin: 0 0 6px; }

/* ===== 保護者向け ===== */
.parent-note {
  background: #f3f0f7;
  border: 1px solid #d4c4e2;
  border-radius: 8px;
  padding: 18px;
}
.parent-note p { margin: 0; color: #312e81; }

/* ===== 用意するもの ===== */
.lesson section ul:not(.goals-grid):not(.steps-quest) {
  margin: 0;
  padding-left: 1.4em;
  color: #364259;
}
.lesson section ul:not(.goals-grid):not(.steps-quest) li {
  margin: 0 0 6px;
}

/* ===== ナビ ===== */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #cfdcf3;
  flex-wrap: wrap;
}
.lesson-nav a {
  background: #2563eb;
  color: #fff;
  padding: 9px 15px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 3px 0 #16325d;
}
.lesson-nav a:hover { background: #1d4ed8; }
.lesson-nav .nav-disabled {
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.92rem;
}

/* ===== ダッシュボード（lab/index.html） ===== */
body.dojo-index-page main { max-width: 1100px; }
body.dojo-index-page .index-hero {
  background:
    radial-gradient(circle at 82% 18%, rgba(255,255,255,0.20) 0 90px, transparent 91px),
    linear-gradient(180deg, #3b82f6 0%, #16325d 100%);
  color: #fff;
  border-radius: 12px;
  padding: 36px 30px;
  box-shadow: 0 22px 48px rgba(23, 32, 51, 0.18);
}
.index-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-family: "DotGothic16", sans-serif;
  letter-spacing: 0.04em;
}
.index-hero .subtitle {
  margin: 0 0 14px;
  color: #cbd5e1;
  font-size: 1.05rem;
}
.index-hero .terminal-line {
  display: inline-block;
  background: rgba(0,0,0,0.35);
  color: #93c5fd;
  font-family: "JetBrains Mono", monospace;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.92rem;
  margin-bottom: 18px;
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.hero-button {
  background: #fff;
  color: #16325d;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: 0 3px 0 rgba(0,0,0,0.22);
}
.hero-button:hover { background: #eef2fb; }
.hero-button-primary {
  background: #f59e0b;
  color: #1f1706;
  box-shadow: 0 3px 0 #b45309;
}

.dojo-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.dojo-summary div {
  background: #fff;
  border: 1px solid #cfdcf3;
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.05);
}
.dojo-summary span {
  display: block;
  font-size: 0.82rem;
  color: #607086;
  font-weight: 700;
  margin-bottom: 4px;
}
.dojo-summary strong {
  font-size: 1.05rem;
  color: #172033;
}

.dojo-preview-note {
  background: #fff7ed;
  border: 2px dashed #ea580c;
  border-radius: 8px;
  padding: 12px 16px;
  color: #7c2d12;
  margin: 0 0 22px;
  font-size: 0.95rem;
}

.index-intro {
  background: #fff;
  border: 1px solid #cfdcf3;
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.05);
}
.index-intro p {
  margin: 0 0 10px;
  color: #364259;
}
.index-intro .kv {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-right: 8px;
  vertical-align: middle;
}

.course-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}
@media (max-width: 720px) {
  .course-dashboard { grid-template-columns: 1fr; }
}
.progress-panel,
.route-panel {
  background: #fff;
  border: 1px solid #cfdcf3;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.05);
}
.eyebrow {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: #607086;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.progress-count {
  margin: 0;
  font-family: "DotGothic16", sans-serif;
  font-size: 2.4rem;
  color: #2563eb;
}
.progress-count span:nth-child(2) {
  font-size: 1.2rem;
  color: #94a3b8;
}
.progress-meter {
  background: #e5edfa;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 14px;
}
.progress-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);
  transition: width 0.4s ease;
  width: 0;
}
.next-lesson {
  margin: 0 0 14px;
  color: #364259;
  font-size: 0.96rem;
}
.certificate-link {
  display: inline-block;
  background: #f59e0b;
  color: #1f1706;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: 0 3px 0 #b45309;
}
.progress-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.progress-actions button {
  background: #eef2fb;
  color: #16325d;
  border: 1px solid #cfdcf3;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.progress-actions button:hover { background: #cfdcf3; }
.progress-message {
  margin: 8px 0 0;
  color: #16a34a;
  font-size: 0.9rem;
}
.route-list {
  margin: 0;
  padding-left: 1.3em;
  color: #364259;
}
.route-list li { margin: 0 0 6px; }

.lesson-tools {
  background: #fff;
  border: 1px solid #cfdcf3;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 22px;
  display: grid;
  gap: 14px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.05);
}
.lesson-search {
  display: grid;
  gap: 6px;
}
.lesson-search span {
  font-size: 0.85rem;
  font-weight: 700;
  color: #607086;
}
.lesson-search input {
  width: 100%;
  border: 1px solid #cfdcf3;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.96rem;
  font-family: inherit;
}
.level-filter,
.status-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-button,
.status-button {
  background: #eef2fb;
  color: #16325d;
  border: 1px solid #cfdcf3;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}
.filter-button.is-active,
.status-button.is-active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.level-section {
  background: #fff;
  border: 1px solid #cfdcf3;
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.05);
}
.level-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.lv-badge {
  background: #16325d;
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.84rem;
}
.level-section.level-lv0 .lv-badge { background: #16a34a; }
.level-section.level-lv1 .lv-badge { background: #2563eb; }
.level-section.level-lv2 .lv-badge { background: #0891b2; }
.level-section.level-lv3 .lv-badge { background: #7c3aed; }
.level-section.level-lv4 .lv-badge { background: #d83a52; }
.level-section.level-lv5 .lv-badge { background: #ea7a21; }
.level-section.level-lv6 .lv-badge { background: #1f2937; }
.lv-title {
  font-weight: 800;
  color: #172033;
  font-size: 1.05rem;
}
.lv-range {
  color: #607086;
  font-size: 0.86rem;
}
.level-desc {
  margin: 0 0 14px;
  color: #364259;
  font-size: 0.95rem;
}
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.lesson-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  background: #f8fbff;
  border: 1px solid #cfdcf3;
  border-left: 5px solid #2563eb;
  border-radius: 6px;
  padding: 12px;
  text-decoration: none;
  color: #172033;
  position: relative;
  transition: transform 0.1s ease;
}
.lesson-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(23,32,51,0.10);
}
.lesson-card .num {
  font-family: "DotGothic16", sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: #2563eb;
  background: #eef2fb;
  border-radius: 6px;
  padding: 4px 8px;
  text-align: center;
}
.lesson-card .title {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.4;
}
.lesson-card.is-done {
  background: #ecfdf5;
  border-left-color: #16a34a;
}
.lesson-card.is-done::after {
  content: "✓";
  position: absolute;
  top: 6px; right: 8px;
  color: #16a34a;
  font-weight: 900;
  font-size: 1rem;
}
.lesson-card.is-hidden { display: none; }

@media (max-width: 720px) {
  .lesson { padding: 22px 18px; }
  .lesson-header { margin: -22px -18px 24px; padding: 20px; }
  .lesson section { margin: 28px 0; }
  .lesson section + section { margin-top: 32px; }
  .prompt-block pre,
  .response-block pre,
  .code-block pre { font-size: 0.84rem; }
  body.dojo-index-page .index-hero { padding: 26px 20px; }
}
