/* Phase別進捗表示のスタイル */
.phase-progress-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.phase-progress-title {
    color: #1e40af;
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-align: center;
}

.phase-progress-title i {
    margin-right: 0.5rem;
}

.phase-stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.phase-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 0.75rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.phase-item:hover {
    text-decoration: none;
    color: inherit;
}

.phase-item.active {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.3);
}

.phase-item.locked {
    background: #f1f5f9;
    color: #64748b;
    opacity: 0.6;
}

.phase-item.completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.phase-indicator {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.phase-icon {
    position: relative;
    z-index: 2;
    color: inherit;
}

.phase-progress-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    transition: height 0.3s ease;
    border-radius: 0 0 50% 50%;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.phase-item.active .phase-indicator {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.phase-item.locked .phase-indicator {
    background: #e2e8f0;
    border: 2px solid #cbd5e1;
}

.phase-item.completed .phase-indicator {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.phase-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .phase-stepper {
        gap: 1rem;
    }

    .phase-item {
        padding: 0.5rem;
    }

    .phase-indicator {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .phase-name {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .phase-progress-container {
        padding: 1rem;
        margin: 1rem 0;
    }

    .phase-progress-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .phase-stepper {
        gap: 0.5rem;
    }

    .phase-item {
        padding: 0.4rem;
    }

    .phase-indicator {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .phase-name {
        font-size: 0.75rem;
    }
}

/* 基本的なリセットとフォント設定 */
:root {
    --primary-color: #00529B;
    --secondary-color: #e9f5ff;
    --text-color: #333;
    --background-color: #f8f9fa;
    --border-color: #dee2e6;
    --link-color: #007bff;
    --link-hover-color: #0056b3;
    --guest-color: #6c757d;
    --guest-bg: #f8f9fa;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    line-height: 1.7;
    background-color: var(--background-color);
    color: var(--text-color);
    /* フォントサイズの安定化 */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* レイアウトの安定化 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ヘッダー */
.site-header {
    padding: 10px 0;
    min-height: auto;
    background-color: white;
    /* 白い背景を追加 */
    border-bottom: 1px solid #f0f0f0;
    /* Optional: adds a nice separator */
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    /* 左右に配置 */
    align-items: center;
    flex-wrap: nowrap;
    padding: 0 15px;
    position: relative;
    /* 相対位置指定で左右の要素を絶対配置 */
    width: 100%;
}

/* 左側のロゴと商号 */
.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #000000;
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.header-logo img {
    height: 40px;
    margin-right: 8px;
}

.header-logo .brand-with {
    font-weight: 400;
    color: #1e40af;
}

/* 右側のアクションボタンのコンテナ */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#login-btn {
    border: none;
    background: none;
    padding: 8px 16px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #000000;
    text-decoration: none;
}

#login-btn:hover {
    color: #1e40af;
}

.user-greeting {
    margin-right: 10px;
    font-size: 0.9rem;
    color: #666;
}

/* --- レスポンシブ対応 --- */

/* 768px以下の画面サイズ */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        padding: 0 15px !important;
        gap: 0.5rem !important;
    }

    .header-logo {
        font-size: 1.2rem;
        flex: 0 1 auto;
        min-width: 0;
    }

    .header-logo img {
        height: 35px;
    }

    .header-actions {
        flex: 0 0 auto;
        margin-left: auto;
    }

    #login-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
        white-space: nowrap;
    }
}

/* 480px以下の画面サイズ */
@media (max-width: 480px) {
    .header-content {
        padding: 0 10px !important;
        gap: 0.25rem !important;
    }

    .header-logo {
        font-size: 1.0rem;
    }

    .header-logo img {
        height: 28px;
        margin-right: 6px;
    }

    #login-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    /* ログインテキストを非表示にしてアイコンのみ表示 */
    #login-btn span {
        display: none;
    }
}

/* 320px以下の極小画面 */
@media (max-width: 320px) {
    .header-logo {
        font-size: 0.9rem;
    }

    .header-logo img {
        height: 24px;
        margin-right: 4px;
    }

    #login-btn {
        padding: 4px 6px;
        font-size: 0.75rem;
    }
}

/* メインコンテンツ */
.site-main {
    padding-bottom: 2rem;
}

/* 価格セクション */
.pricing-section {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 2rem;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.pricing-section:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.pricing-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.pricing-left {
    flex: 0 0 auto;
}

.pricing-image {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
}

.pricing-right {
    flex: 1;
}

.pricing-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.pricing-description {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
}

/* 価格セクションのレスポンシブ対応 */
@media (max-width: 768px) {
    .pricing-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .pricing-title {
        font-size: 2rem;
    }

    .pricing-description {
        font-size: 1.1rem;
    }

    .pricing-image {
        max-width: 150px;
    }
}

.chapter {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 2rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.chapter:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.chapter h2 {
    color: var(--primary-color);
    margin-bottom: 0;
    /* Reset margin as it's now in a flex container */
    flex-grow: 1;
    font-weight: 600;
    transition: color 0.3s ease;
}

.chapter-toggle:hover h2 {
    color: var(--primary-color);
    text-shadow: 0 1px 2px rgba(0, 93, 155, 0.1);
}

.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--secondary-color);
    transition: all 0.3s ease;
}

.chapter-title-container {
    display: flex;
    align-items: center;
    flex-grow: 1;
    min-width: 0;
}

.chapter-toggle {
    background: white;
    border: none;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.chapter-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #ffffff 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.chapter-toggle:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 93, 155, 0.15);
}

.chapter-toggle:hover::before {
    opacity: 1;
}

.chapter-toggle:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 93, 155, 0.2);
}

.chapter-content {
    transition: all 0.3s ease-in-out;
    overflow: hidden;
    display: none;
    /* 初期状態では非表示 */
}

.progress-container {
    width: 200px;
    background-color: #e9ecef;
    border-radius: .25rem;
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.progress-bar {
    background-color: #28a745;
    height: 100%;
    border-radius: .25rem;
    position: absolute;
    left: 0;
    top: 0;
    transition: width 0.5s ease-in-out;
}

.progress-text {
    position: relative;
    z-index: 1;
    color: #333;
    font-size: 0.8rem;
    font-weight: bold;
    text-shadow: 0 0 2px white, 0 0 4px white;
}

/* レッスンリスト */
.lesson-list {
    list-style: none;
}

.lesson-list li {
    margin-bottom: 0.75rem;
}

.lesson-list a {
    display: block;
    padding: 0.75rem 1rem;
    background-color: var(--secondary-color);
    color: var(--link-color);
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.lesson-list a>strong {
    flex-grow: 1;
    padding-right: 1rem;
}

.lesson-list a:hover {
    background-color: var(--primary-color);
    color: white;
}

/* フッター */
.site-footer {
    background-color: #343a40;
    color: #f8f9fa;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    font-size: 0.9rem;
}

/* 検索フォーム */
.search-container {
    margin-bottom: 2rem;
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

.search-btn {
    flex-shrink: 0;
}

/* 検索結果ページ */
.search-results-section {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-results-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* 管理者用リンク */
.admin-link-container {
    margin-bottom: 2rem;
    text-align: right;
}

/* 認証フォーム */
.auth-form {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    max-width: 400px;
    margin: 0 auto;
}

.auth-form h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
}

.auth-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: none;
}

.auth-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: flex-end;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    color: white;
    font-weight: 500;
    font-size: 0.95rem;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 93, 155, 0.3);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #003d7a;
    border-color: #003d7a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 93, 155, 0.3);
}

/* ヘッダー用のボタンスタイル */
.header-right .btn-primary {
    background-color: #ffffff;
    color: var(--primary-color);
    border: 2px solid #ffffff;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
}

.header-right .btn-primary:hover {
    background-color: #f8f9fa;
    border-color: #f8f9fa;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.3);
}

.header-right .btn-outline {
    background-color: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
}

.header-right .btn-outline:hover {
    background-color: #ffffff;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.3);
}

/* ヘッダーの認証リンクの間隔調整 */
.header-right .auth-links {
    gap: 0.8rem;
}

/* 新規レッスン作成フォーム */
.lesson-form {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: var(--link-hover-color);
}

/* レッスン詳細ページ */
.lesson-content {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.lesson-title {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.lesson-body {
    margin-bottom: 0;
    line-height: 1.8;
    white-space: pre-line;
}

/* 動画セクション（モバイルファースト） */
.video-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 0.5rem;
    /* モバイル用のパディング */
    margin: 1rem -1rem;
    /* 左右を-1remで広げる */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* デスクトップ用の動画セクション調整 */
@media (min-width: 768px) {
    .video-section {
        padding: 1rem;
        /* デスクトップでは少し余裕を持たせる */
        margin: 1.5rem -1.5rem;
        /* 左右を-1.5remでさらに広げる */
    }
}

.video-section h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

/* 4:5アスペクト比の動画用コンテナ */
.responsive-video-container {
    position: relative;
    width: 100%;
    margin: 0 auto 1rem auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 4:5のアスペクト比を維持（125% = 5/4 * 100%） */
.responsive-video-container::before {
    content: '';
    display: block;
    padding-top: 125%;
    /* 4:5の比率 */
}

.responsive-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

.video-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0.5rem 0 0 0;
    /* 上マージンを追加、下マージンを削除 */
    padding: 0.5rem 0.75rem;
    /* パディングを削減 */
    background: rgba(0, 82, 155, 0.05);
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
    display: flex;
    align-items: center;
}

/* モバイル最適化 */
@media (max-width: 768px) {
    .responsive-video-container {
        width: calc(100vw - 1rem);
        /* 画面幅 - 左右0.5remずつの余白 */
        max-width: 100%;
        /* コンテナいっぱいに */
        margin-left: auto;
        margin-right: auto;
    }

    .video-section {
        padding: 0.75rem;
        margin: 1rem -1.5rem;
        /* 左右をさらに広げる */
    }
}

/* 小さなモバイル画面 */
@media (max-width: 480px) {
    .responsive-video-container {
        width: calc(100vw - 0.5rem);
        /* さらに画面いっぱいに */
        max-width: 100%;
        /* コンテナいっぱいに */
    }

    .video-section {
        padding: 0.5rem;
        margin: 1rem -1rem;
        /* 左右をさらに広げる */
    }
}

/* タブレット */
@media (min-width: 769px) and (max-width: 1024px) {
    .responsive-video-container {
        width: 80%;
        max-width: 500px;
    }
}

/* デスクトップ */
@media (min-width: 1025px) {
    .responsive-video-container {
        width: 60%;
        max-width: 600px;
    }
}

.video-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    /* タイトル下のマージンを縮小 */
}


.lesson-body h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin: 1.5rem 0 0.8rem 0;
    font-weight: 600;
}

.lesson-body ul {
    margin: 0.5rem 0 1rem 1.5rem;
    padding-left: 0;
}

.lesson-body li {
    margin-bottom: 0.5rem;
    position: relative;
}

.lesson-body li:before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: -1.2rem;
}

.lesson-body ol {
    margin: 0.5rem 0 1rem 1.5rem;
    padding-left: 0;
    counter-reset: item;
}

.lesson-body ol li {
    margin-bottom: 0.8rem;
    position: relative;
    counter-increment: item;
}

.lesson-body ol li:before {
    content: counter(item) ".";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: -1.5rem;
    min-width: 1.5rem;
}

.lesson-navigation {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 200;
}

.back-link {
    color: var(--link-color);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--link-color);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.back-link:hover {
    background-color: var(--link-color);
    color: white;
}

.next-link {
    color: white;
    background-color: var(--primary-color);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.next-link:hover {
    background-color: #1e40af;
    border-color: #1e40af;
    color: white;
    transform: tr anslateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .lesson-navigation {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .back-link,
    .next-link {
        text-align: center;
        width: 100%;
    }
}

.lesson-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* クイズセクション */
.quiz-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.quiz-section h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.question {
    margin-bottom: 2rem;
}

.question-text {
    font-weight: bold;
    margin-bottom: 1rem;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-color);
    transition: background-color 0.2s, border-color 0.2s;
}

.option-btn:hover {
    background-color: var(--secondary-color);
    border-color: var(--primary-color);
}

.option-btn.correct {
    background-color: #d4edda;
    /* 正解の色 */
    border-color: #c3e6cb;
    color: #155724;
    font-weight: bold;
}

.option-btn.incorrect {
    background-color: #f8d7da;
    /* 不正解の色 */
    border-color: #f5c6cb;
    color: #721c24;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.option-btn:hover:disabled {
    background-color: #fff;
    border-color: var(--border-color);
}

.option-btn.correct:hover:disabled {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.option-btn.incorrect:hover:disabled {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.quiz-feedback {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: .25rem;
}

.quiz-feedback.correct {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.quiz-feedback.incorrect {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.quiz-feedback.cleared {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .site-header h1 {
        font-size: 2rem;
    }

    .chapter h2 {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 15px;
    }
}

/* レッスンリスト */
.lesson-list {
    list-style: none;
}

.lesson-list li {
    margin-bottom: 0.75rem;
}

.lesson-list a {
    display: block;
    padding: 0.75rem 1rem;
    background-color: var(--secondary-color);
    color: var(--link-color);
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.lesson-list a>strong {
    flex-grow: 1;
    padding-right: 1rem;
}

.lesson-list a:hover {
    background-color: var(--primary-color);
    color: white;
}

/* フッター */
.site-footer {
    background-color: #343a40;
    color: #f8f9fa;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    font-size: 0.9rem;
}

/* 検索フォーム */
.search-container {
    margin-bottom: 2rem;
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

.search-btn {
    flex-shrink: 0;
}

/* 検索結果ページ */
.search-results-section {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-results-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* 管理者用リンク */
.admin-link-container {
    margin-bottom: 2rem;
    text-align: right;
}

/* 新規レッスン作成フォーム */
.lesson-form {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: var(--link-hover-color);
}

/* クイズセクション */
.quiz-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.quiz-section h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.question {
    margin-bottom: 2rem;
}

.question-text {
    font-weight: bold;
    margin-bottom: 1rem;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-color);
    transition: background-color 0.2s, border-color 0.2s;
}

.option-btn:hover {
    background-color: var(--secondary-color);
    border-color: var(--primary-color);
}

.option-btn.correct {
    background-color: #d4edda;
    /* 正解の色 */
    border-color: #c3e6cb;
    color: #155724;
    font-weight: bold;
}

.option-btn.incorrect {
    background-color: #f8d7da;
    /* 不正解の色 */
    border-color: #f5c6cb;
    color: #721c24;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.option-btn:hover:disabled {
    background-color: #fff;
    border-color: var(--border-color);
}

.option-btn.correct:hover:disabled {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.option-btn.incorrect:hover:disabled {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.quiz-feedback {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: .25rem;
}

.quiz-feedback.correct {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.quiz-feedback.incorrect {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.quiz-feedback.cleared {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem;
        text-align: left;
    }

    .header-left {
        text-align: left;
        flex: 0 1 auto;
    }

    .header-right {
        justify-content: flex-end;
        margin-left: auto;
        flex: 0 0 auto;
    }
}

/* Chatbot styles */
#chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    /* デフォルトは小さなz座標 */
    transition: z-index 0s;
    /* z-indexの変更をスムーズにする */
}

#chatbot-container.active {
    z-index: 1000;
    /* チャットウィンドウが開いている時は大きなz座標 */
}

#chat-toggle-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
}

#chat-toggle-button:hover {
    background-color: var(--link-hover-color);
}

#chat-window {
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    transform-origin: bottom right;
}

#chat-window.hidden {
    transform: scale(0);
    opacity: 0;
}

.chat-header {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

#close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

#chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    padding: 8px 12px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.4;
}

.user-message {
    background-color: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.bot-message {
    background-color: #f1f1f1;
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* 記事詳細のメタ情報行 */
.article-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* いいねボタン */
.like-button {
    background: white;
    border: 2px solid #ddd;
    /* 枠線のみ */
    border-radius: 30px;
    /* 丸みを強く */
    padding: 10px 20px;
    /* サイズアップ */
    cursor: pointer;
    font-size: 1.2rem;
    /* フォントサイズアップ */
    color: #555;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    /* アイコンとテキストの間隔 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.like-button:hover {
    background-color: #fff0f0;
    border-color: #ff4757;
    color: #ff4757;
    transform: translateY(-2px);
    /* ホバー時に少し浮く */
    box-shadow: 0 4px 8px rgba(255, 71, 87, 0.2);
}

.like-button.active {
    background-color: #ff4757;
    border-color: #ff4757;
    color: white;
}

.like-button i {
    font-size: 1.3em;
    /* アイコンサイズアップ */
}

/* 記事下部のアクションエリア（不要になったため削除または統合） */
/* .article-actions { removed } */

/* 記事フッター（戻るボタンといいねボタンの配置） */
.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
    /* スマホで縦並びになっても崩れないように */
}

/* フッター内のいいねボタン調整 */
.article-footer .like-button {
    padding: 10px 25px;
    font-size: 1.1rem;
    background: white;
}

@media (max-width: 480px) {
    .article-footer {
        flex-direction: row;
        /* 横並びにする */
        gap: 10px;
    }

    .article-footer .btn-outline,
    .article-footer .like-button {
        flex: 1;
        /* 等幅にする */
        justify-content: center;
        padding: 10px;
    }

    /* テキストを隠してアイコンだけにする */
    .article-footer .btn-outline {
        font-size: 0;
    }

    .article-footer .btn-outline i {
        font-size: 1.4rem;
        margin: 0;
    }

    .article-footer .like-button span:not(.like-count) {
        display: none;
    }

    .article-footer .like-button i {
        font-size: 1.4rem;
    }
}
}

/* 記事一覧のいいね数 */
.article-likes {
    margin-left: 15px;
    color: #555;
    font-size: 0.9em;
}

.chat-input-container {
    display: flex;
    padding: 10px;
    border-top: 1px solid var(--border-color);
}

#chat-input {
    flex-grow: 1;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 1rem;
    margin-right: 10px;
}

#chat-send {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#chat-send:hover {
    background-color: var(--link-hover-color);
}

#chat-send:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* --- Segmented Navigation --- */
.segmented-navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.segmented-control {
    display: inline-flex;
    background-color: #f1f5f9;
    padding: 4px;
    border-radius: 100px;
    /* Pill shape */
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.segment-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    min-width: 100px;
    border-radius: 100px;
    /* Pill shape */
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    letter-spacing: 0.02em;
}

.segment-item:hover {
    color: #334155;
    text-decoration: none;
}

.segment-item.active {
    background-color: white;
    color: #1e40af;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
    transform: scale(1.02);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .segmented-navigation {
        margin-bottom: 1.5rem;
    }

    .segment-item {
        padding: 8px 16px;
        min-width: 80px;
        font-size: 0.9rem;
    }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {


    /* Phase別進捗表示のスタイル */
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .header-left {
        text-align: center;
        flex: none;
    }

    .header-right {
        justify-content: center;
        margin-left: 0;
    }

    .auth-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .user-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .site-header h1 {
        font-size: 2rem;
        white-space: normal;
    }

    .container {
        padding: 0 15px;
    }
}

/* デスクトップ表示でのヘッダー配置を確実にする */
@media (min-width: 769px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }

    .header-left {
        flex: 0 1 auto;
        margin-right: 2rem;
        min-width: 0;
    }

    .header-right {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .auth-links {
        display: flex;
        gap: 1rem;
        align-items: center;
    }

    .site-header h1 {
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: 1.5rem 0;
    }

    .site-header h1 {
        font-size: 1.8rem;
    }

    .auth-links a {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* ステッパーコンテナ */
#stepper-container {
    position: relative;
    z-index: 10;
    /* デフォルトは小さなz座標 */
    transition: z-index 0s;
}

#stepper-container.active {
    z-index: 1000;
    /* ステッパーが表示されている時は大きなz座標 */
}

/* 進捗アイコン（初期状態で表示） */
.progress-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 10;
}

/* 検索アイコン（初期状態で表示） */
.search-indicator {
    position: fixed;
    bottom: 20px;
    left: 100px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 10;
}

.search-indicator:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.search-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.search-text {
    font-size: 0.7rem;
    font-weight: bold;
}

.progress-indicator:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.progress-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.progress-text {
    font-size: 0.7rem;
    font-weight: bold;
}

/* ステッパー全体（初期状態では非表示） */
.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    margin: 2rem auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.stepper.hidden {
    display: none;
}

.stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.stepper-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background-color: var(--line-color, var(--border-color));
    z-index: 1;
}

.stepper-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--muted-color, #e9ecef);
    color: var(--muted-foreground, #6c757d);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
}

.stepper-item.active .stepper-indicator {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 93, 155, 0.3);
}

.stepper-item.completed .stepper-indicator {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.stepper-item.completed .stepper-indicator::after {
    content: '✓';
    font-size: 1.2rem;
    font-weight: bold;
}

.stepper-title {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    max-width: 120px;
}

.stepper-item.active .stepper-title {
    color: var(--primary-color);
    font-weight: 700;
}

.stepper-item.completed .stepper-title {
    color: var(--primary-color);
}

.stepper-description {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted-foreground, #6c757d);
    text-align: center;
    max-width: 120px;
    line-height: 1.3;
}

/* ステッパーのレスポンシブ対応 */
@media (max-width: 768px) {
    .stepper {
        flex-direction: column;
        gap: 1.5rem;
        max-width: 300px;
    }

    .stepper-item:not(:last-child)::after {
        display: none;
    }

    .stepper-title,
    .stepper-description {
        max-width: 200px;
    }
}

/* ステッパーのナビゲーション機能 */
.stepper-indicator.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.stepper-indicator.clickable:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 82, 155, 0.3);
}

.stepper-indicator.clickable:active {
    transform: scale(1.05);
}

/* 検索フォームのモーダル表示 */
.search-form-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 400px;
}

.search-form-container.hidden {
    display: none;
}

/* ゲストモード用スタイル */
.guest-badge {
    background-color: var(--guest-bg);
    color: var(--guest-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    margin-right: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.guest-badge::before {
    content: "👤";
    font-size: 0.75rem;
}

.guest-notice {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guest-notice i {
    color: #f39c12;
}

.guest-notice a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.guest-notice a:hover {
    text-decoration: underline;
}



/* --- Introduction Page Styles --- */
.page-wrapper {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.hero-section {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeInDown 0.8s ease-out;
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(to right, #1e40af, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #475569;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.cards-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1000px;
    width: 100%;
    margin-bottom: 4rem;
}

.impact-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 2rem;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.impact-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.95);
}

.card-number {
    font-size: 5rem;
    font-weight: 900;
    color: rgba(37, 99, 235, 0.1);
    line-height: 1;
    margin-bottom: -1rem;
}

.card-title {
    font-size: 2rem;
    font-weight: 900;
    color: #1e40af;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.card-text {
    font-size: 1.1rem;
    color: #475569;
    font-weight: 500;
}

.action-area {
    text-align: center;
    animation: fadeInUp 1s ease-out 0.4s backwards;
}

.cta-button {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    font-size: 1.5rem;
    font-weight: 900;
    padding: 1.5rem 5rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 30px -5px rgba(37, 99, 235, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.cta-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.6);
    color: white;
    text-decoration: none;
}

.cta-button:hover::after {
    opacity: 1;
}

.cta-icon {
    width: 2rem;
    height: 2rem;
    transition: transform 0.3s ease;
}

.cta-button:hover .cta-icon {
    transform: translateX(8px);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .cards-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .impact-card {
        min-height: auto;
        padding: 2.5rem;
    }

    .card-title {
        font-size: 1.5rem;
    }

    .cta-button {
        padding: 1.25rem 3rem;
        font-size: 1.25rem;
        width: 100%;
        justify-content: center;
    }

    .cta-button {
        padding: 1.25rem 3rem;
        font-size: 1.25rem;
        width: 100%;
        justify-content: center;
    }
}

/* --- Article Detail Styles --- */
.article-main-image {
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
}

.article-main-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
}

.article-introduction {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #334155;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #1e293b;
}

.article-body h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    color: #1e40af;
}

.article-body h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #1e293b;
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* --- Article List Styles --- */
.article-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

/* テーマ別セクション */
.theme-section {
    margin-bottom: 3rem;
}

.theme-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 5px;
}

.theme-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-title i {
    font-size: 0.8em;
    color: #64748b;
}

/* 横スクロールコンテナ */
.articles-horizontal-scroller {
    display: flex;
    gap: 1rem;
    /* カード間の隙間 */
    overflow-x: auto;
    padding-bottom: 1.5rem;
    /* スクロールバーと影のスペース */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    margin: 0 -10px;
    /* 親コンテナのpaddingを少し相殺 */
    padding-left: 10px;
    padding-right: 10px;
}

.articles-horizontal-scroller::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* コンパクトな記事カード */
.article-card.compact {
    min-width: 280px;
    width: 280px;
    flex-shrink: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* 高さを揃える */
}

.article-card.compact .article-thumbnail-wrapper {
    height: 160px;
    /* 固定高さ */
}

.article-card.compact .article-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-card.compact .article-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    /* 2行で省略 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
    /* 2行分の高さ確保 */
}

.article-card.compact .article-introduction {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
    /* 2行で省略 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.article-card.compact .article-footer {
    margin-top: auto;
    /* 下揃え */
    font-size: 0.9rem;
}

.article-card.compact .article-meta {
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.article-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.article-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-thumbnail-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.article-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-thumbnail {
    transform: scale(1.05);
}

/* Stamp Overlay Styles */
.stamp-overlay {
    position: absolute;
    top: 5px;
    /* Moved down to avoid top clipping */
    right: 5px;
    /* Moved left to avoid right clipping */
    width: 65px;
    /* Slightly smaller to fit better */
    height: 65px;
    z-index: 10;
    pointer-events: none;
    transform: rotate(15deg);
    opacity: 0.9;
    /* Shadow removed as requested */
}

.article-thumbnail-wrapper {
    position: relative;
    overflow: hidden;
    /* Changed to hidden to clip nicely at rounded corners, but stamp is moved inside */
    padding-top: 65%;
    /* Taller aspect ratio */
    background: #ffffff;
    /* White background */
}

.article-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.article-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.article-date {
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-paid {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-free {
    background-color: #dcfce7;
    color: #166534;
}

.article-introduction {
    color: #475569;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.article-card .article-introduction {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
    padding-bottom: 0;
    border-bottom: none;
}

.article-footer {
    margin-top: auto;
    text-align: right;
}

.read-more {
    color: #2563eb;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.no-articles {
    text-align: center;
    color: #64748b;
    font-size: 1.1rem;
    grid-column: 1 / -1;
    padding: 3rem;
}

@media (max-width: 768px) {
    .article-list {
        grid-template-columns: 1fr;
    }
}

/* --- Article View Styles --- */