/* =========================================
   Python業務自動化マスター - 全体スタイル
   カラー: 紫 × 白ベース / アクセント: 青
   ========================================= */

:root {
    --primary: #7c3aed;          /* メイン紫 */
    --primary-dark: #5b21b6;     /* 濃い紫 */
    --primary-light: #a78bfa;    /* 薄紫 */
    --primary-bg: #f5f3ff;       /* 紫系背景 */
    --accent: #2563eb;           /* アクセント青 */
    --accent-dark: #1d4ed8;      /* 濃い青 */
    --accent-hover: #3b82f6;     /* ホバー青 */
    --text-main: #1f2937;        /* 本文テキスト */
    --text-sub: #4b5563;         /* サブテキスト */
    --text-light: #6b7280;       /* 薄いテキスト */
    --bg-white: #ffffff;
    --bg-gray: #f9fafb;
    --border: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --code-bg: #1e1e2e;
    --code-text: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px rgba(124, 58, 237, 0.08);
    --shadow-lg: 0 10px 25px rgba(124, 58, 237, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --font-heading: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
    --font-body: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
    --font-code: "SF Mono", "Monaco", "Consolas", "Courier New", monospace;
}

/* ========== SVGアイコン ========== */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: currentColor;
    flex-shrink: 0;
}
.icon-lg { width: 1.5em; height: 1.5em; vertical-align: -0.3em; }
.icon-2x { width: 2em; height: 2em; vertical-align: -0.4em; }

.icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    flex-shrink: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.25);
}
.icon-badge .icon { width: 1.4rem; height: 1.4rem; vertical-align: middle; }

.icon-badge.accent  { background: linear-gradient(135deg, #60a5fa 0%, var(--accent) 100%); box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25); }
.icon-badge.success { background: linear-gradient(135deg, #6ee7b7 0%, var(--success) 100%); box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25); }
.icon-badge.warning { background: linear-gradient(135deg, #fcd34d 0%, var(--warning) 100%); box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25); }
.icon-badge.pink    { background: linear-gradient(135deg, #f9a8d4 0%, #db2777 100%); box-shadow: 0 4px 10px rgba(219, 39, 119, 0.25); }
.icon-badge.lg { width: 3.5rem; height: 3.5rem; }
.icon-badge.lg .icon { width: 1.75rem; height: 1.75rem; }

/* ========== リセット & 基本 ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background: var(--bg-white);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

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

ul, ol {
    padding-left: 1.5rem;
}

/* ========== ナビゲーション ========== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo .icon {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--primary);
    vertical-align: middle;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    align-items: center;
}

.nav-menu li a {
    font-family: var(--font-heading);
    color: var(--text-sub);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.nav-menu li a:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.nav-menu li a.active {
    background: var(--primary);
    color: white;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--primary);
    padding: 0.5rem;
}

/* ========== ヒーローセクション ========== */
.hero {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #ddd6fe 100%);
    padding: 4rem 1.5rem 5rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(124,58,237,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
}

.hero-text h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    margin-bottom: 1rem;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
}

.hero-text .subtitle {
    font-size: 1.1rem;
    color: var(--text-sub);
    margin-bottom: 2rem;
    line-height: 1.9;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: left;
}

.hero-stat-num {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.hero-stat-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.hero-image {
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* ========== ボタン ========== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-align: center;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ========== コンテナ & セクション ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
}

.section-subtitle {
    text-align: center;
    color: var(--text-sub);
    margin-bottom: 3rem;
    font-size: 1.05rem;
}

/* ========== コースカード ========== */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.course-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.course-card-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.course-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.course-badge {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    background: #dbeafe;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
    align-self: flex-start;
}

.course-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
}

.course-card p {
    color: var(--text-sub);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
    flex: 1;
}

.course-card-meta {
    display: flex;
    gap: 1rem;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 1.25rem;
}

.course-card-meta span::before {
    margin-right: 0.25rem;
}

.course-card-meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.course-card-meta .icon { color: var(--primary); width: 0.95em; height: 0.95em; }

/* ========== 特徴セクション ========== */
.features {
    background: var(--primary-bg);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
}

.feature-item {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s;
}

.feature-item:hover {
    transform: translateY(-4px);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    box-shadow: 0 6px 14px rgba(124, 58, 237, 0.22);
    transition: transform 0.3s ease;
}
.feature-icon .icon { width: 1.75rem; height: 1.75rem; }
.feature-item:hover .feature-icon { transform: translateY(-3px) rotate(-5deg); }
.feature-icon.accent  { background: linear-gradient(135deg, #60a5fa 0%, var(--accent) 100%); box-shadow: 0 6px 14px rgba(37, 99, 235, 0.22); }
.feature-icon.success { background: linear-gradient(135deg, #6ee7b7 0%, var(--success) 100%); box-shadow: 0 6px 14px rgba(16, 185, 129, 0.22); }
.feature-icon.warning { background: linear-gradient(135deg, #fcd34d 0%, var(--warning) 100%); box-shadow: 0 6px 14px rgba(245, 158, 11, 0.22); }
.feature-icon.pink    { background: linear-gradient(135deg, #f9a8d4 0%, #db2777 100%); box-shadow: 0 6px 14px rgba(219, 39, 119, 0.22); }

.feature-item h4 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.feature-item p {
    color: var(--text-sub);
    font-size: 0.9rem;
}

/* ========== コースページレイアウト ========== */
.course-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 3rem 1.5rem;
}

.course-header-container {
    max-width: 1100px;
    margin: 0 auto;
}

.course-header .breadcrumb {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    opacity: 0.85;
    margin-bottom: 0.75rem;
}

.course-header .breadcrumb a {
    color: white;
}

.course-header h1 {
    color: white;
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    margin-bottom: 0.75rem;
}

.course-header p {
    font-size: 1.05rem;
    opacity: 0.95;
    max-width: 700px;
}

.course-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* ========== サイドバー目次 ========== */
.sidebar {
    position: sticky;
    top: 90px;
    align-self: start;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}

.sidebar h3 {
    font-size: 0.95rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-bg);
}

.toc {
    list-style: none;
    padding: 0;
}

.toc li {
    margin-bottom: 0.25rem;
}

.toc a {
    font-family: var(--font-heading);
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-sub);
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.toc a:hover,
.toc a.active {
    background: var(--primary-bg);
    color: var(--primary);
    border-left-color: var(--primary);
}

/* ========== レッスン本文 ========== */
.lesson-content {
    min-width: 0;
}

.lesson {
    background: white;
    border-radius: var(--radius);
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    scroll-margin-top: 90px;
}

.lesson-number {
    font-family: var(--font-heading);
    display: inline-block;
    background: var(--primary-bg);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.lesson h2 {
    color: var(--primary-dark);
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-bg);
}

.lesson h3 {
    color: var(--primary);
    font-size: 1.2rem;
    margin: 2rem 0 1rem;
    padding-left: 0.75rem;
    border-left: 4px solid var(--accent);
}

.lesson h4 {
    color: var(--text-main);
    font-size: 1.05rem;
    margin: 1.5rem 0 0.75rem;
}

.lesson p {
    margin-bottom: 1rem;
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.9;
}

.lesson ul,
.lesson ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.lesson li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

/* ========== コードブロック ========== */
.code-block {
    position: relative;
    background: var(--code-bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 1.25rem 0;
    box-shadow: var(--shadow-sm);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2d2d44;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.code-lang {
    font-family: var(--font-code);
    color: #a78bfa;
    font-size: 0.8rem;
    font-weight: 600;
}

.copy-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.copy-btn:hover {
    background: var(--accent);
}

.copy-btn.copied {
    background: var(--success);
}

.run-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-right: 0.4rem;
}

.run-btn:hover { background: var(--accent); }
.run-btn:disabled { opacity: 0.6; cursor: wait; }

.code-output {
    background: #ffffff;
    border-top: 4px solid var(--primary);
    padding: 1.1rem 1.35rem;
    animation: slideDown 0.3s ease;
}

.code-output.success { border-top-color: var(--success); background: #f0fdf4; }
.code-output.error   { border-top-color: #ef4444; background: #fef2f2; }
.code-output.info    { border-top-color: var(--accent); background: #eff6ff; }

.code-output-label {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.6rem;
    letter-spacing: 0.02em;
}
.code-output.success .code-output-label { color: #047857; }
.code-output.error   .code-output-label { color: #b91c1c; }
.code-output.info    .code-output-label { color: var(--accent-dark); }

.code-output-stdout {
    margin: 0;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    font-family: var(--font-code);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.85;
    white-space: pre-wrap;
    word-break: break-word;
}

.code-output.success .code-output-stdout {
    background: #ffffff;
    border-color: #86efac;
}
.code-output.error .code-output-stdout {
    background: #ffffff;
    border-color: #fca5a5;
}

.code-output-error {
    margin: 0.6rem 0 0;
    color: #991b1b;
    background: #ffffff;
    border: 1px solid #fca5a5;
    border-left: 4px solid #ef4444;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    font-family: var(--font-code);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.85;
    white-space: pre-wrap;
    word-break: break-word;
}

.code-output.info .code-output-label {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--accent-dark);
}

.code-block pre {
    margin: 0;
    padding: 1.25rem;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-code);
    color: var(--code-text);
    font-size: 0.875rem;
    line-height: 1.7;
    white-space: pre;
}

/* シンタックスハイライト風 */
.code-block .kw    { color: #c792ea; }   /* キーワード */
.code-block .str   { color: #a5e844; }   /* 文字列 */
.code-block .num   { color: #f78c6c; }   /* 数字 */
.code-block .com   { color: #676e95; font-style: italic; } /* コメント */
.code-block .fn    { color: #82aaff; }   /* 関数 */
.code-block .var   { color: #ffcb6b; }   /* 変数 */
.code-block .op    { color: #89ddff; }   /* 演算子 */

/* インラインコード */
code:not(pre code) {
    background: var(--primary-bg);
    color: var(--primary-dark);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-code);
    font-size: 0.88em;
}

/* ========== 注意・ポイント枠 ========== */
.callout {
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.callout-title {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.callout-point {
    background: #f0f9ff;
    border-color: var(--accent);
}

.callout-point .callout-title { color: var(--accent-dark); display: inline-flex; align-items: center; gap: 0.4rem; }
.callout-point .callout-title::before {
    content: "";
    display: inline-block;
    width: 1.15em; height: 1.15em;
    background-color: var(--accent);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M9 20h6'/><path d='M10 17h4'/><path d='M12 3a6 6 0 0 1 4 10.5c-.5.5-1 1.2-1 2V14h-6v1.5c0-.8-.5-1.5-1-2A6 6 0 0 1 12 3z'/></svg>") center / contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M9 20h6'/><path d='M10 17h4'/><path d='M12 3a6 6 0 0 1 4 10.5c-.5.5-1 1.2-1 2V14h-6v1.5c0-.8-.5-1.5-1-2A6 6 0 0 1 12 3z'/></svg>") center / contain no-repeat;
}

.callout-warn {
    background: #fffbeb;
    border-color: var(--warning);
}

.callout-warn .callout-title { color: #b45309; display: inline-flex; align-items: center; gap: 0.4rem; }
.callout-warn .callout-title::before {
    content: "";
    display: inline-block;
    width: 1.15em; height: 1.15em;
    background-color: var(--warning);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3l10 17H2z'/><path d='M12 10v4M12 17h.01'/></svg>") center / contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3l10 17H2z'/><path d='M12 10v4M12 17h.01'/></svg>") center / contain no-repeat;
}

.callout-info {
    background: var(--primary-bg);
    border-color: var(--primary);
}

.callout-info .callout-title { color: var(--primary-dark); display: inline-flex; align-items: center; gap: 0.4rem; }
.callout-info .callout-title::before {
    content: "";
    display: inline-block;
    width: 1.15em; height: 1.15em;
    background-color: var(--primary);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 11v6M12 7.5h.01'/></svg>") center / contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 11v6M12 7.5h.01'/></svg>") center / contain no-repeat;
}

.callout-copilot {
    background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
    border-color: var(--primary);
    position: relative;
}

.callout-copilot .callout-title { color: var(--primary-dark); display: inline-flex; align-items: center; gap: 0.4rem; }
.callout-copilot .callout-title::before {
    content: "";
    display: inline-block;
    width: 1.25em; height: 1.25em;
    background-color: var(--primary);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='8' width='16' height='12' rx='2'/><circle cx='9' cy='14' r='1' fill='white'/><circle cx='15' cy='14' r='1' fill='white'/><path d='M12 4v4M10 4h4'/><path d='M2 14h2M20 14h2'/></svg>") center / contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='8' width='16' height='12' rx='2'/><circle cx='9' cy='14' r='1' fill='white'/><circle cx='15' cy='14' r='1' fill='white'/><path d='M12 4v4M10 4h4'/><path d='M2 14h2M20 14h2'/></svg>") center / contain no-repeat;
}

.copilot-prompt {
    background: white;
    border: 1px dashed var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: 0.75rem;
    font-family: var(--font-body);
    color: var(--text-main);
    font-style: italic;
    line-height: 1.7;
}

/* ========== 業務背景ボックス ========== */
.scenario-box {
    background: linear-gradient(135deg, #fdf4ff 0%, #f5f3ff 100%);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.25rem 0;
    border: 1px solid var(--primary-light);
}

.scenario-box h4 {
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scenario-box h4 { display: inline-flex; align-items: center; gap: 0.5rem; }
.scenario-box h4::before {
    content: "";
    display: inline-block;
    width: 1.2em; height: 1.2em;
    background-color: var(--primary);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='5' y='4' width='14' height='17' rx='2'/><rect x='9' y='2' width='6' height='4' rx='1'/><path d='M9 12h6M9 16h4'/></svg>") center / contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='5' y='4' width='14' height='17' rx='2'/><rect x='9' y='2' width='6' height='4' rx='1'/><path d='M9 12h6M9 16h4'/></svg>") center / contain no-repeat;
    flex-shrink: 0;
}

.scenario-box p {
    color: var(--text-sub);
    font-size: 0.95rem;
    margin: 0;
}

/* ========== 実行結果画像 ========== */
.result-figure {
    margin: 1.5rem 0;
    text-align: center;
}

.result-figure img {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin: 0 auto;
}

.result-figure figcaption {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.75rem;
}

/* ========== チェックリスト ========== */
.checklist {
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin: 1.5rem 0;
    list-style: none;
    border: 1px solid var(--border);
}

.checklist-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem;
}

.checklist-title::before {
    content: "";
    display: inline-block;
    width: 1.25em; height: 1.25em;
    background-color: var(--success);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M8 12l3 3 5-6'/></svg>") center / contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M8 12l3 3 5-6'/></svg>") center / contain no-repeat;
    flex-shrink: 0;
}

.checklist li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-main);
}

.checklist li input[type="checkbox"] {
    margin-top: 0.35rem;
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.checklist li.checked {
    color: var(--text-light);
    text-decoration: line-through;
}

/* ========== 演習問題 ========== */
.exercise {
    background: #fffbf5;
    border: 2px solid #fde68a;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.exercise-label {
    display: inline-block;
    background: var(--warning);
    color: white;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

.exercise h4 {
    color: #92400e;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.exercise-answer {
    margin-top: 1rem;
}

.exercise-toggle {
    background: var(--primary-bg);
    color: var(--primary-dark);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.exercise-toggle:hover {
    background: var(--primary-light);
    color: white;
}

.exercise-answer-content {
    margin-top: 1rem;
    display: none;
}

.exercise-answer-content.open {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== コード判定エディタ ========== */
.code-runner {
    background: #1e1e2e;
    border-radius: var(--radius);
    margin: 1.25rem 0;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid #2d2d44;
}

.code-runner-header {
    background: #2d2d44;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.code-runner-label {
    font-family: var(--font-heading);
    color: #a78bfa;
    font-size: 0.85rem;
    font-weight: 600;
}

.code-runner-input {
    width: 100%;
    background: var(--code-bg);
    color: var(--code-text);
    font-family: var(--font-code);
    font-size: 0.875rem;
    line-height: 1.7;
    padding: 1.25rem;
    border: none;
    outline: none;
    resize: vertical;
    min-height: 160px;
    box-sizing: border-box;
    tab-size: 4;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

.code-runner-input::placeholder {
    color: #6b7280;
    font-style: italic;
}

.code-runner-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #2d2d44;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-wrap: wrap;
}

.code-runner-run,
.code-runner-judge {
    color: white;
    border: none;
    padding: 0.55rem 1.4rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.code-runner-run {
    background: var(--accent);
}
.code-runner-run:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.code-runner-judge {
    background: var(--primary);
}
.code-runner-judge:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.code-runner-clear {
    background: transparent;
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.code-runner-clear:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.code-runner-result {
    padding: 1.25rem 1.5rem;
    background: white;
    border-top: 3px solid var(--border);
    animation: slideDown 0.3s ease;
}

.code-runner-result.pass {
    border-top-color: var(--success);
    background: #f0fdf4;
}

.code-runner-result.fail {
    border-top-color: var(--warning);
    background: #fffbeb;
}

.code-runner-result .result-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.code-runner-result.pass .result-title { color: #047857; }
.code-runner-result.fail .result-title { color: #b45309; }

.code-runner-result .result-extra {
    color: var(--text-sub);
    font-size: 0.9rem;
    line-height: 1.8;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.7);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

.code-runner-result .result-stdout-label {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 0.85rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.code-runner-result .result-stdout-label::before {
    content: "▶";
    font-size: 0.7rem;
    color: var(--accent);
}

.code-runner-result .result-stdout {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    font-family: var(--font-code);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.85;
    padding: 0.95rem 1.1rem;
    border-radius: var(--radius-sm);
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}

.code-runner-result.pass .result-stdout {
    border-color: #86efac;
    border-left: 4px solid var(--success);
}

.code-runner-result.fail .result-stdout {
    border-color: #fca5a5;
    border-left: 4px solid var(--warning);
}

.code-runner-result .result-hints {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
}

.code-runner-result .result-hints li {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.35rem;
    background: rgba(255,255,255,0.7);
    border-left: 3px solid #fbbf24;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.7;
}

.code-runner-result .result-hints li::before {
    content: "💡 ";
    margin-right: 0.25rem;
}

.judge-pass-badge {
    display: inline-block;
    margin-left: 0.75rem;
    background: var(--success);
    color: white;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    vertical-align: middle;
}

/* ========== レッスン完了ボタン ========== */
.lesson-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.complete-btn {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.complete-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.complete-btn.completed {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.complete-btn.completed::before {
    content: "";
    display: inline-block;
    width: 1em; height: 1em;
    margin-right: 0.4rem;
    background-color: white;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M5 13l4 4L19 7'/></svg>") center / contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M5 13l4 4L19 7'/></svg>") center / contain no-repeat;
    vertical-align: -0.15em;
}

/* ========== テーブル ========== */
.lesson table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.95rem;
    background: white;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.lesson table th {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1rem;
    text-align: left;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
}

.lesson table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.lesson table tr:last-child td {
    border-bottom: none;
}

.lesson table tr:nth-child(even) td {
    background: var(--bg-gray);
}

/* ========== 進捗管理ページ ========== */
.progress-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.progress-summary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.progress-summary h2 {
    color: white;
    margin-bottom: 0.5rem;
}

.progress-summary .total-progress {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    margin: 1rem 0 0.5rem;
}

.progress-summary p {
    opacity: 0.95;
    font-size: 1rem;
}

.progress-course-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.progress-course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.progress-course-header h3 {
    color: var(--primary-dark);
    font-size: 1.15rem;
}

.progress-percent {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.progress-bar {
    background: var(--bg-gray);
    border-radius: 999px;
    overflow: hidden;
    height: 12px;
    margin-bottom: 0.75rem;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease;
    width: 0%;
}

.progress-course-meta {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-light);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.lessons-completed-list {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.lessons-completed-list h4 {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.lesson-status-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.lesson-status-list li {
    font-size: 0.85rem;
    color: var(--text-sub);
    padding: 0.35rem 0.75rem;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lesson-status-list li.done {
    background: #f0fdf4;
    color: var(--success);
}

.lesson-status-list li.done::before {
    content: "";
    display: inline-block;
    width: 1.1em; height: 1.1em;
    background-color: var(--success);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M8 12l3 3 5-6'/></svg>") center / contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M8 12l3 3 5-6'/></svg>") center / contain no-repeat;
    flex-shrink: 0;
}
.lesson-status-list li:not(.done)::before {
    content: "";
    display: inline-block;
    width: 1.1em; height: 1.1em;
    background-color: var(--text-light);
    opacity: 0.5;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'><circle cx='12' cy='12' r='9'/></svg>") center / contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8'><circle cx='12' cy='12' r='9'/></svg>") center / contain no-repeat;
    flex-shrink: 0;
}

.reset-btn {
    background: white;
    color: var(--text-sub);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    transition: all 0.2s ease;
    margin-top: 1.5rem;
}

.reset-btn:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* ========== フッター ========== */
.footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.85);
    padding: 3rem 1.5rem 1.5rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand h4 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.footer-brand p {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.8;
}

.footer h5 {
    color: white;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    font-family: var(--font-heading);
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 0.4rem;
}

.footer ul li a {
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    font-family: var(--font-heading);
    transition: color 0.2s ease;
}

.footer ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    font-size: 0.85rem;
    opacity: 0.7;
    font-family: var(--font-heading);
}

/* ========== トースト通知 ========== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-dark);
    color: white;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ========== 事例ページ専用 ========== */
.impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.impact-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.3s ease;
}

.impact-card:hover { transform: translateY(-3px); }

.impact-card .impact-value {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-sub);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}
.impact-card .impact-value strong {
    color: var(--primary);
    font-size: 2.5rem;
    font-weight: 800;
}

.impact-card .impact-label {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--primary-dark);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.impact-card p {
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.75;
    margin: 0;
}

/* 事例カード */
.cases-container {
    max-width: 1100px;
    margin: 1rem auto 3rem;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.case-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    scroll-margin-top: 90px;
}

.case-header {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 2rem 2rem 1.5rem;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-bottom: 1px solid var(--border);
}

.case-icon {
    flex-shrink: 0;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(124, 58, 237, 0.25);
}
.case-icon .icon { width: 1.75rem; height: 1.75rem; }
.case-icon.accent  { background: linear-gradient(135deg, #60a5fa 0%, var(--accent) 100%); box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25); }
.case-icon.success { background: linear-gradient(135deg, #6ee7b7 0%, var(--success) 100%); box-shadow: 0 6px 14px rgba(16, 185, 129, 0.25); }
.case-icon.warning { background: linear-gradient(135deg, #fcd34d 0%, var(--warning) 100%); box-shadow: 0 6px 14px rgba(245, 158, 11, 0.25); }
.case-icon.pink    { background: linear-gradient(135deg, #f9a8d4 0%, #db2777 100%); box-shadow: 0 6px 14px rgba(219, 39, 119, 0.25); }

.case-tag {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    background: white;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    margin-bottom: 0.6rem;
    border: 1px solid #ddd6fe;
}
.case-tag.accent  { color: var(--accent);  border-color: #bfdbfe; }
.case-tag.success { color: var(--success); border-color: #a7f3d0; }
.case-tag.warning { color: #b45309;        border-color: #fde68a; }
.case-tag.pink    { color: #be185d;        border-color: #fbcfe8; }

.case-header h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--primary-dark);
    margin: 0 0 0.5rem;
    line-height: 1.4;
}

.case-lead {
    color: var(--text-sub);
    font-size: 1rem;
    line-height: 1.8;
    margin: 0;
}

/* Before / After */
.case-beforeafter {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: stretch;
    padding: 1.75rem 2rem;
    background: #fafaf9;
    border-bottom: 1px solid var(--border);
}

.ba-block {
    background: white;
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.4rem;
    border: 1px solid var(--border);
}

.ba-block.before {
    border-top: 4px solid #fca5a5;
    background: #fef2f2;
}
.ba-block.after {
    border-top: 4px solid var(--success);
    background: #f0fdf4;
}

.ba-label {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}
.ba-block.before .ba-label { color: #b91c1c; }
.ba-block.after  .ba-label { color: #047857; }

.ba-time {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}
.ba-block.before .ba-time { color: #b91c1c; }
.ba-block.after  .ba-time { color: #047857; }

.ba-block ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ba-block ul li {
    font-size: 0.88rem;
    line-height: 1.75;
    padding-left: 1.1rem;
    position: relative;
    color: var(--text-main);
    margin-bottom: 0.3rem;
}
.ba-block ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
}
.ba-block.before ul li::before { background: #ef4444; }
.ba-block.after  ul li::before { background: var(--success); }

.ba-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

/* ケース本文セクション */
.case-section {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}
.case-section:last-child { border-bottom: none; }

.case-section h3 {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    font-size: 1.05rem;
    margin: 0 0 0.85rem;
    padding-left: 0.7rem;
    border-left: 3px solid var(--accent);
}

.case-section .code-block { margin-top: 0.5rem; }
.case-section > p { font-size: 0.9rem; color: var(--text-sub); margin: 0.5rem 0 0; }

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: var(--primary-bg);
    color: var(--primary-dark);
    border: 1px solid #ddd6fe;
}
.skill-tag.accent {
    background: #dbeafe;
    color: var(--accent-dark);
    border-color: #bfdbfe;
}

.case-tips {
    list-style: none;
    padding: 0;
    margin: 0;
}
.case-tips li {
    font-size: 0.92rem;
    line-height: 1.85;
    padding: 0.35rem 0 0.35rem 1.7rem;
    position: relative;
    color: var(--text-main);
}
.case-tips li::before {
    content: "";
    position: absolute;
    left: 0.2rem;
    top: 0.75em;
    width: 0.95em;
    height: 0.95em;
    background: var(--accent);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M5 13l4 4L19 7'/></svg>") center / contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M5 13l4 4L19 7'/></svg>") center / contain no-repeat;
}

/* ロードマップテーブル */
.roadmap-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1.5rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.roadmap-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-heading);
    min-width: 540px;
}

.roadmap-table th,
.roadmap-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
    font-size: 0.9rem;
}

.roadmap-table th {
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.4;
}

.roadmap-table tbody tr:nth-child(odd) td { background: #fafafa; }
.roadmap-table tbody tr:hover td { background: var(--primary-bg); }

.roadmap-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--primary-dark);
}

.roadmap-table td a { color: var(--primary-dark); text-decoration: none; }
.roadmap-table td a:hover { color: var(--accent); text-decoration: underline; }

.cell-main { background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important; color: white !important; font-weight: 700; }
.cell-need { background: #ede9fe !important; color: var(--primary-dark); font-weight: 600; }
.cell-plus { color: var(--text-sub); }

/* 学んだ先に得られるもの */
.outcome-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.outcome-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform 0.3s ease;
}
.outcome-card:hover { transform: translateY(-3px); }

.outcome-card .outcome-icon {
    display: inline-flex;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.25);
}
.outcome-card .outcome-icon .icon { width: 1.5rem; height: 1.5rem; }
.outcome-card .outcome-icon.accent  { background: linear-gradient(135deg, #60a5fa, var(--accent)); box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25); }
.outcome-card .outcome-icon.success { background: linear-gradient(135deg, #6ee7b7, var(--success)); box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25); }
.outcome-card .outcome-icon.warning { background: linear-gradient(135deg, #fcd34d, var(--warning)); box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25); }

.outcome-card h4 {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    font-size: 1.05rem;
    margin: 0 0 0.5rem;
}
.outcome-card p {
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.85;
    margin: 0;
}

/* ========== セットアップページ専用 ========== */
.setup-flow {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 1.25rem 0 0.5rem;
}

.setup-flow-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #f5f3ff;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
    align-items: flex-start;
}

.setup-flow-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
}

.setup-flow-item h4 {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    font-size: 1rem;
    margin: 0 0 0.25rem;
}

.setup-flow-item p {
    color: var(--text-sub);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.7;
}

/* ターミナル風表示 */
.terminal {
    background: #0f172a;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 1.25rem 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid #1e293b;
}

.terminal-header {
    background: #1e293b;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
}

.terminal-header::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 18px 0 0 #f59e0b, 36px 0 0 #10b981;
    margin-right: 1rem;
}

.terminal-title {
    font-family: var(--font-heading);
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 500;
    margin-left: 30px;
}

.terminal-body {
    padding: 1rem 1.25rem;
    font-family: var(--font-code);
    font-size: 0.85rem;
    line-height: 1.7;
    overflow-x: auto;
}

.terminal-line {
    color: #e2e8f0;
    white-space: pre;
}

.terminal-prompt {
    color: #4ade80;
    user-select: none;
}

.terminal-cmd {
    color: #f8fafc;
    font-weight: 500;
}

.terminal-output {
    color: #cbd5e1;
}

/* kbd 表示 */
kbd {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    font-family: var(--font-code);
    font-size: 0.82em;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-bottom-width: 2px;
    border-radius: 4px;
    color: var(--text-main);
    line-height: 1.4;
    vertical-align: middle;
}

/* トラブルシューティンググリッド */
.trouble-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.trouble-card {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 1.15rem 1.25rem;
}

.trouble-card h4 {
    font-family: var(--font-heading);
    color: #92400e;
    font-size: 0.95rem;
    margin: 0 0 0.4rem;
    line-height: 1.5;
}

.trouble-card p {
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.75;
    margin: 0;
}

/* ========== ヒーローCTA / ステップ ========== */
.hero-cta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.steps-list {
    list-style: none;
    padding: 0;
    counter-reset: step;
    margin: 0;
}

.step-item {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    align-items: flex-start;
}

.step-item:last-child { margin-bottom: 0; }

.step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
}

.step-title {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
}

.step-text {
    color: var(--text-sub);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.8;
}

/* ========== レッスン本文内のテーブルスクロールラッパー ========== */
.lesson-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.25rem 0;
    border-radius: var(--radius-sm);
}

/* ========== レスポンシブ ========== */
@media (max-width: 968px) {
    .course-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 2rem 1.25rem;
    }
    .sidebar {
        position: static;
        max-height: none;
    }
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    .hero-cta { justify-content: center; }
    .hero-stats { justify-content: center; }
    .hero-stat { text-align: center; }
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 720px) {
    /* ----- ナビ ----- */
    .nav-menu {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        gap: 0.25rem;
    }
    .nav-menu.open { display: flex; }
    .nav-menu li { width: 100%; }
    .nav-menu li a { display: block; }
    .nav-toggle { display: block; }

    /* ----- レイアウト全般 ----- */
    .section { padding: 2.5rem 0; }
    .container { padding: 0 1.25rem; }
    .hero { padding: 2.5rem 1.25rem 3rem; }
    .hero-text h1 { font-size: 1.6rem; line-height: 1.5; }
    .hero-text .subtitle { font-size: 0.95rem; }

    .hero-stats { gap: 1rem 1.5rem; }
    .hero-stat-num { font-size: 1.5rem; }
    .hero-stat-label { font-size: 0.75rem; }

    .section-title { font-size: 1.35rem; }
    .section-subtitle { font-size: 0.95rem; margin-bottom: 2rem; }

    /* ----- コースカード ----- */
    .course-grid { gap: 1.25rem; }
    .course-card-body { padding: 1.25rem; }
    .course-card h3 { font-size: 1.1rem; }

    /* ----- レッスン ----- */
    .course-header { padding: 2rem 1.25rem; }
    .course-header h1 { font-size: 1.5rem; }
    .course-header p { font-size: 0.95rem; }
    .lesson {
        padding: 1.5rem 1.25rem;
        scroll-margin-top: 80px;
    }
    .lesson h2 { font-size: 1.25rem; }
    .lesson h3 { font-size: 1.05rem; }
    .lesson p { font-size: 0.95rem; }

    /* ----- サイドバー目次 (スマホで最上部にコンパクト表示) ----- */
    .sidebar { padding: 1rem; }
    .sidebar h3 { font-size: 0.85rem; margin-bottom: 0.5rem; }
    .toc { display: flex; flex-direction: column; gap: 0.15rem; }
    .toc a { padding: 0.4rem 0.6rem; font-size: 0.85rem; }

    /* ----- テーブルを横スクロール可能に ----- */
    .lesson table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        font-size: 0.85rem;
    }
    .lesson table th,
    .lesson table td {
        padding: 0.55rem 0.75rem;
    }

    /* ----- コードブロック ----- */
    .code-block pre { padding: 1rem; }
    .code-block code { font-size: 0.8rem; }
    .code-header { padding: 0.4rem 0.75rem; }
    .code-lang { font-size: 0.7rem; }
    .copy-btn { font-size: 0.7rem; padding: 0.25rem 0.6rem; }

    /* ----- コード判定エディタ ----- */
    .code-runner-input {
        font-size: 0.8rem;
        padding: 1rem;
        min-height: 140px;
    }
    .code-runner-header { padding: 0.5rem 0.75rem; }
    .code-runner-label { font-size: 0.75rem; }
    .code-runner-actions { padding: 0.6rem 0.75rem; }
    .code-runner-judge { padding: 0.5rem 1rem; font-size: 0.85rem; }
    .code-runner-clear { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
    .code-runner-result { padding: 1rem 1.25rem; }
    .code-runner-result .result-title { font-size: 0.95rem; }
    .code-runner-result .result-hints li { font-size: 0.85rem; }
    .code-runner-result .result-stdout { font-size: 0.9rem; padding: 0.85rem; }
    .code-output-stdout, .code-output-error { font-size: 0.9rem; padding: 0.75rem 0.85rem; }
    .code-output-label { font-size: 0.85rem; }

    /* ----- 演習・コールアウト ----- */
    .exercise { padding: 1.25rem; }
    .callout { padding: 1rem 1.15rem; }
    .scenario-box { padding: 1.25rem; }
    .checklist { padding: 1.25rem; }

    /* ----- 事例ページ ----- */
    .cases-container { padding: 0 1.25rem; gap: 2rem; }
    .case-header { padding: 1.5rem 1.25rem; gap: 1rem; flex-wrap: wrap; }
    .case-header h2 { font-size: 1.2rem; }
    .case-lead { font-size: 0.92rem; }
    .case-icon { width: 2.75rem; height: 2.75rem; }
    .case-icon .icon { width: 1.4rem; height: 1.4rem; }

    /* Before / After を縦並びに */
    .case-beforeafter {
        grid-template-columns: 1fr;
        padding: 1.25rem;
        gap: 0.85rem;
    }
    .ba-arrow {
        transform: rotate(90deg);
        padding: 0.25rem 0;
    }
    .ba-block { padding: 1rem 1.15rem; }
    .ba-time { font-size: 1.15rem; }
    .ba-block ul li { font-size: 0.85rem; }

    .case-section { padding: 1.25rem; }
    .case-section h3 { font-size: 1rem; }
    .skill-tag { font-size: 0.78rem; padding: 0.3rem 0.7rem; }

    .impact-grid { grid-template-columns: 1fr; gap: 1rem; }
    .impact-card { padding: 1.5rem 1.25rem; }
    .impact-card .impact-value strong { font-size: 2rem; }

    .roadmap-table th,
    .roadmap-table td { padding: 0.65rem 0.7rem; font-size: 0.82rem; }

    .outcome-grid { gap: 1rem; }
    .outcome-card { padding: 1.4rem 1.15rem; }

    /* ----- セットアップページ ----- */
    .setup-flow-item { padding: 0.85rem 1rem; gap: 0.85rem; }
    .setup-flow-num { width: 28px; height: 28px; font-size: 0.85rem; }
    .setup-flow-item h4 { font-size: 0.95rem; }
    .setup-flow-item p { font-size: 0.85rem; }
    .terminal-body { padding: 0.85rem 1rem; font-size: 0.78rem; }
    .terminal-title { font-size: 0.7rem; margin-left: 24px; }
    .terminal-header::before {
        width: 10px; height: 10px;
        box-shadow: 15px 0 0 #f59e0b, 30px 0 0 #10b981;
    }
    .trouble-card { padding: 1rem; }
    kbd { font-size: 0.78em; padding: 0.08rem 0.35rem; }

    /* ----- レッスン下部 ----- */
    .lesson-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .lesson-footer .btn,
    .lesson-footer button {
        width: 100%;
        text-align: center;
    }

    /* ----- ステップリスト ----- */
    .step-item { padding: 1.25rem; gap: 1rem; }
    .step-number { width: 40px; height: 40px; font-size: 1.1rem; }
    .step-title { font-size: 1rem; }
    .step-text { font-size: 0.9rem; }

    /* ----- 進捗 ----- */
    .progress-page { padding: 2rem 1.25rem; }
    .progress-summary { padding: 1.75rem 1.25rem; }
    .progress-summary .total-progress { font-size: 2.25rem; }
    .progress-course-card { padding: 1.25rem; }
    .progress-course-header h3 { font-size: 1rem; }

    /* ----- フッター ----- */
    .footer { padding: 2.5rem 1.25rem 1.25rem; }
    .footer-container { grid-template-columns: 1fr; gap: 1.75rem; }

    /* ----- トースト ----- */
    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        text-align: center;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    html { font-size: 15px; }
    .nav-logo { font-size: 1rem; }
    .nav-container { padding: 0 1rem; height: 60px; }
    .nav-menu { top: 60px; }

    .hero-text h1 { font-size: 1.4rem; }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .hero-cta .btn { width: 100%; text-align: center; }

    .hero-stats { gap: 0.75rem 1.25rem; }
    .hero-stat-num { font-size: 1.35rem; }
    .hero-stat-label { font-size: 0.7rem; }

    .course-card-body { padding: 1rem; }
    .lesson { padding: 1.25rem 1rem; }
    .lesson h2 { font-size: 1.15rem; }

    .code-block pre { padding: 0.85rem; }
    .code-block code { font-size: 0.75rem; }

    .code-runner-actions { flex-direction: column; }
    .code-runner-actions .code-runner-judge,
    .code-runner-actions .code-runner-clear {
        width: 100%;
        text-align: center;
    }

    .btn { padding: 0.65rem 1.25rem; font-size: 0.9rem; }
    .section { padding: 2rem 0; }
}
