/* ===========================================
   資格seek 統合CSS（4AI統合版）
   rwdcsstemplate.css + content.css 統合版
   
   4AI統合改善点：
   - テーブル横スクロール：.table-wrapで囲む
   - caption必須：SEO/AI対策
   - 左列sticky固定：モバイル時の比較性維持
   - section横スクロール削除：モバイルフレンドリー準拠
   =========================================== */

/* =====================
   CSS変数定義
   ===================== */
:root {
    --primary-color: #609;
    --primary-light: #7c4dff;
    --primary-dark: #4a0072;
    --secondary-color: #00f;
    --accent-color: #ffc;
    --success-color: #4CAF50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --info-color: #2196f3;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #fff;
    --gray-light: #f5f5f5;
    --gray-medium: #e0e0e0;
    --container-width: 1200px;
    --content-width: calc(100% - 320px);
    --sidebar-width: 300px;
    --transition-speed: 0.3s;
    --border-radius: 8px;
}

/* =====================
   リセット・ベース
   ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
    background: #f8f8f8;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: all var(--transition-speed);
}

a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* =====================
   レイアウト構造
   ===================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    background: var(--bg-color);
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

.main-layout {
    display: flex;
    gap: 20px;
    padding: 20px;
    min-height: 500px;
}

.content {
    flex: 1;
    width: var(--content-width);
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    overflow-x: hidden;
}

/* =====================
   ヘッダー
   ===================== */
.header {
    background: linear-gradient(to bottom, #fff 0%, #f0f0f0 100%);
    border-bottom: 3px solid var(--primary-color);
    padding: 15px 20px;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

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

.header-right {
    flex: 1;
    max-width: 400px;
}

/* 検索フォーム */
#cse-search-box div {
    display: flex;
    gap: 0;
}

#cse-search-box input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    transition: border-color var(--transition-speed);
}

#cse-search-box input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

#cse-search-box input[type="submit"] {
    padding: 8px 20px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: bold;
    transition: background var(--transition-speed);
}

#cse-search-box input[type="submit"]:hover {
    background: #45a049;
}

/* =====================
   ハンバーガーメニュー
   ===================== */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    background: none;
    border: none;
    z-index: 1001;
    position: fixed;
    top: 15px;
    right: 15px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 3px 0;
    transition: 0.3s;
    display: block;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =====================
   パンくずリスト
   ===================== */
.breadcrumb {
    background: var(--gray-light);
    padding: 10px 20px;
    border-bottom: 1px solid var(--gray-medium);
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    font-size: 14px;
}

.breadcrumb li::after {
    content: ">";
    margin: 0 8px;
    color: #999;
}

.breadcrumb li:last-child::after {
    content: "";
}

.breadcrumb a {
    color: var(--primary-color);
}

/* =====================
   広告エリア
   ===================== */
.contentup, .contentdown {
    padding: 20px;
    text-align: center;
    background: #fafafa;
    border-top: 1px solid var(--gray-medium);
    border-bottom: 1px solid var(--gray-medium);
}

/* =====================
   見出し（共通）
   ===================== */
h1, article h1 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-color);
}

h2, article h2 {
    font-size: 22px;
    color: #444;
    margin: 30px 0 15px;
    padding: 8px 0 8px 15px;
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(to right, rgba(102,0,153,0.05) 0%, transparent 100%);
}

h3, article h3 {
    font-size: 18px;
    color: #555;
    margin: 25px 0 10px;
    padding-left: 10px;
    border-left: 3px solid var(--accent-color);
}

h4 {
    font-size: 16px;
    color: #666;
    margin: 20px 0 10px;
    font-weight: bold;
}

/* 段落・リスト */
p {
    margin-bottom: 15px;
    line-height: 1.8;
}

ul, ol {
    margin: 15px 0;
    padding-left: 30px;
}

li {
    margin-bottom: 8px;
}

/* =====================
   アラート・注意書きボックス
   ===================== */
.alert {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    border-left: 4px solid;
}

.alert a {
    text-decoration: underline;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border-left-color: var(--warning-color);
    color: #856404;
}
.alert-warning a { color: #0056b3; }

.alert-info {
    background: #e3f2fd;
    border-left-color: var(--info-color);
    color: #1565c0;
}
.alert-info a { color: #1976d2; }

.alert-success {
    background: #e8f5e9;
    border-left-color: var(--success-color);
    color: #2e7d32;
}
.alert-success a { color: #388e3c; }

.alert-danger {
    background: #ffebee;
    border-left-color: var(--danger-color);
    color: #c62828;
}
.alert-danger a { color: #d32f2f; }

/* アーカイブ用（太字版） */
.archive-notice {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border-left: 4px solid var(--warning-color);
    padding: 15px 20px;
    margin-bottom: 30px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-weight: bold;
    color: #856404;
}
.archive-notice a {
    color: #0056b3;
    text-decoration: underline;
}

/* =====================
   目次
   ===================== */
.toc {
    background: var(--gray-light);
    padding: 20px;
    margin: 20px 0;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--info-color);
}
.toc p {
    margin: 0 0 10px 0;
    font-weight: bold;
}
.toc ul {
    line-height: 2;
    margin: 0;
    padding-left: 20px;
}
.toc a {
    color: var(--info-color);
    text-decoration: none;
}
.toc a:hover {
    text-decoration: underline;
}

/* =====================
   カード型リンク（grid均等幅）
   .card-links と .related-links 両方対応
   ===================== */
.card-links,
.related-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 30px 0;
}
.card-links a,
.related-links a {
    display: block;
    padding: 20px 16px;
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    text-align: center;
    transition: all var(--transition-speed);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.card-links a:hover,
.related-links a:hover {
    background: #f8f9fa;
    border-color: var(--info-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(33,150,243,0.2);
    text-decoration: none;
    color: #1976d2;
}

/* グリッド版 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 30px 0;
}
.card-grid a,
.card-grid .card {
    display: block;
    padding: 16px;
    background: #fff;
    border: 2px solid var(--gray-medium);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    text-align: center;
    transition: all var(--transition-speed);
}
.card-grid a:hover,
.card-grid .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33,150,243,0.15);
    border-color: var(--info-color);
    text-decoration: none;
}
.card-grid .card-icon {
    font-size: 1.5em;
    margin-bottom: 8px;
}
.card-grid .card-title {
    font-weight: 700;
    margin-bottom: 4px;
    color: #1976d2;
}
.card-grid .card-desc {
    font-size: 0.85em;
    color: var(--text-light);
}

/* カード色バリエーション */
.card-purple { border-color: var(--primary-color) !important; }
.card-purple .card-title { color: var(--primary-color); }
.card-blue { border-color: var(--info-color) !important; }
.card-blue .card-title { color: #1976d2; }
.card-green { border-color: var(--success-color) !important; }
.card-green .card-title { color: #388e3c; }
.card-orange { border-color: var(--warning-color) !important; }
.card-orange .card-title { color: #f57c00; }
.card-pink { border-color: #e91e63 !important; }
.card-pink .card-title { color: #c2185b; }

/* =====================
   データテーブル（4AI統合版）
   ===================== */

/* ★4AI統合：テーブルラッパー（横スクロール対応・ブレ止め版） */
.table-wrap {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    margin: 20px 0;
}

/* 既存クラスも維持（後方互換性） */
.table-wrapper,
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(33,150,243,0.1);
}

.data-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    background: white;
    font-size: 0.9em;
    border: 2px solid var(--info-color);
}

/* ★4AI統合：caption（SEO/AI対策） */
.data-table caption {
    caption-side: top;
    text-align: left;
    font-weight: bold;
    padding: 10px 12px;
    background: #f5f7fa;
    font-size: 15px;
    color: #333;
}

.data-table th,
.data-table thead th {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #1976d2;
    white-space: nowrap;
}

.data-table td,
.data-table tbody td,
.data-table tbody th {
    padding: 12px;
    border: 1px solid var(--gray-medium);
    text-align: center;
    vertical-align: middle;
}

.data-table tbody tr:nth-child(odd) {
    background: #f9f9f9;
}

.data-table tbody tr:nth-child(even) {
    background: #ffffff;
}

.data-table tbody tr:hover {
    background: #e3f2fd;
}

.data-table .total-row {
    background: #ffe8ba !important;
    font-weight: bold;
}

.data-table .highlight-purple {
    color: var(--primary-color);
    font-weight: bold;
}

.data-table .highlight-blue {
    color: #1976d2;
    font-weight: bold;
}

.data-table .highlight-red {
    color: var(--danger-color);
    font-weight: bold;
}

.data-table a {
    color: #1976d2;
}

/* シンプルテーブル */
.simple-table {
    border-collapse: collapse;
    width: 100%;
    margin: 20px 0;
}
.simple-table th,
.simple-table td {
    padding: 10px 12px;
    border: 1px solid #ddd;
    text-align: left;
}
.simple-table th {
    background: var(--gray-light);
    font-weight: bold;
}
.simple-table tbody tr:hover {
    background: #f9f9f9;
}

/* =====================
   ボックス装飾
   ===================== */
.summary-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(102,0,153,0.2);
    line-height: 1.8;
}
.summary-box p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
}
.summary-box p + p {
    margin-top: 1em;
}
.summary-box a {
    color: #fff;
    text-decoration: underline;
}

/* ライト版 */
.summary-box.light {
    background: #f8f9fa;
    color: var(--text-color);
    box-shadow: none;
    border-left: 4px solid var(--primary-color);
}
.summary-box.light a {
    color: var(--primary-color);
}

/* データ解説ボックス（テーブル後用・余白多め） */
.data-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 30px 0 40px;
    line-height: 1.8;
    border-left: 4px solid var(--info-color);
}
.data-summary p {
    margin: 0;
    font-size: 0.95em;
    color: var(--text-light);
}

.info-box {
    background: var(--gray-light);
    border-left: 4px solid var(--info-color);
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.point-box {
    background: #fff9e6;
    border: 2px solid #ffd700;
    padding: 15px;
    margin: 20px 0;
    border-radius: var(--border-radius);
}
.point-box h4 {
    color: #ff6b00;
    margin-top: 0;
}

.highlight-box {
    background: #e3f2fd;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    border-left: 4px solid var(--info-color);
}

.quote-box {
    background: var(--gray-light);
    border-left: 4px solid #9e9e9e;
    padding: 15px 20px;
    margin: 20px 0;
    font-style: italic;
}

/* =====================
   出典セクション
   ===================== */
.source-section,
section.source {
    background: var(--gray-light);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-top: 40px;
}
.source-section h2,
section.source h2 {
    margin-top: 0;
    font-size: 1.2em;
    border-left: none;
    background: none;
    padding-left: 0;
}
.source-section a,
section.source a {
    color: var(--info-color);
}

/* =====================
   CTAセクション（青ベース）
   ===================== */
.cta-section,
section.cta {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 25px;
    border-radius: var(--border-radius);
    border: 2px solid var(--info-color);
    margin: 40px 0;
}
.cta-section h2,
.cta-section h3,
section.cta h2 {
    margin-top: 0;
    color: #1976d2;
    border-left: none;
    background: none;
    padding-left: 0;
}
.cta-section ul,
section.cta ul {
    line-height: 2;
}
.cta-section a,
section.cta a {
    color: #1976d2;
}

/* CTAボタングリッド */
.cta-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.cta-btn {
    display: block;
    padding: 14px 20px;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    transition: all var(--transition-speed);
    color: #fff;
}
.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    text-decoration: none;
    opacity: 1;
}
.cta-btn-purple { background: var(--primary-color); }
.cta-btn-blue { background: var(--info-color); }
.cta-btn-green { background: var(--success-color); }
.cta-btn-orange { background: var(--warning-color); }
.cta-btn-pink { background: #e91e63; }

/* =====================
   関連リンク（リスト形式）
   ===================== */
.related-links-list {
    background: #f9f9f9;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-top: 30px;
}
.related-links-list h3 {
    margin-top: 0;
}
.related-links-list ul {
    list-style: none;
    padding: 0;
}
.related-links-list li {
    padding: 8px 0;
    border-bottom: 1px dotted #ddd;
}
.related-links-list li:last-child {
    border-bottom: none;
}
.related-links-list a {
    display: block;
    padding-left: 20px;
    position: relative;
    color: var(--info-color);
}
.related-links-list a::before {
    content: "▶";
    position: absolute;
    left: 0;
    color: var(--info-color);
}

/* =====================
   FAQ折りたたみ
   ===================== */
.faq-list {
    margin: 20px 0;
}
.faq-item {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    overflow: hidden;
}
.faq-question {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px 20px;
    margin: 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid #ddd;
    transition: background var(--transition-speed);
    user-select: none;
}
.faq-question:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}
.faq-toggle {
    font-size: 20px;
    font-weight: bold;
    color: var(--info-color);
    min-width: 20px;
    text-align: center;
}
.faq-answer {
    display: none;
    padding: 20px;
    background: white;
    line-height: 1.8;
}
.faq-item.active .faq-question,
.faq-item.open .faq-question {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
}
.faq-item.active .faq-toggle,
.faq-item.open .faq-toggle {
    color: white;
}
.faq-item.active .faq-answer,
.faq-item.open .faq-answer {
    display: block;
}

/* =====================
   性別リンク
   ===================== */
.gender-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}
.gender-links a {
    display: block;
    padding: 16px;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    transition: all var(--transition-speed);
}
.gender-links .male {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #2196f3;
    color: #1976d2;
}
.gender-links .female {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
    border: 2px solid #e91e63;
    color: #c2185b;
}
.gender-links a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* =====================
   ステップ・フロー
   ===================== */
.step-list {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 20px 0;
}
.step-list li {
    position: relative;
    padding: 20px 20px 20px 70px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--info-color);
}
.step-list li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: var(--info-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
}

/* =====================
   比較表
   ===================== */
.compare-table {
    border-collapse: collapse;
    width: 100%;
    margin: 20px 0;
}
.compare-table th,
.compare-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: center;
}
.compare-table thead th {
    background: var(--info-color);
    color: #fff;
}
.compare-table tbody th {
    background: var(--gray-light);
    text-align: left;
}
.compare-table .good {
    color: var(--success-color);
    font-weight: bold;
}
.compare-table .bad {
    color: var(--danger-color);
    font-weight: bold;
}

/* =====================
   バッジ・ラベル
   ===================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
}
.badge-purple { background: #f3e5f5; color: var(--primary-color); }
.badge-blue { background: #e3f2fd; color: #1976d2; }
.badge-green { background: #e8f5e9; color: #388e3c; }
.badge-orange { background: #fff3e0; color: #f57c00; }
.badge-red { background: #ffebee; color: #d32f2f; }
.badge-gray { background: var(--gray-light); color: var(--text-light); }

/* =====================
   年度ナビゲーション
   ===================== */
.year-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
    padding: 15px;
    background: var(--gray-light);
    border-radius: var(--border-radius);
}
.year-nav a {
    padding: 8px 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9em;
}
.year-nav a:hover {
    background: #e3f2fd;
    border-color: var(--info-color);
}
.year-nav a.current {
    background: var(--info-color);
    color: #fff;
    border-color: #1976d2;
}

/* =====================
   サイドバー
   ===================== */
.sidebar1 {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

.menu1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 16px;
    border-radius: 4px 4px 0 0;
    position: relative;
}

.menu1::after {
    content: "▲";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

.menu_box {
    background: white;
    border: 1px solid var(--gray-medium);
    border-top: none;
    margin-bottom: 20px;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* サイドバーナビゲーション */
.subs {
    list-style: none;
    padding: 0;
}

.subs li {
    margin: 0;
}

/* 第1階層 */
.subs > li > a {
    display: block;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f3f4fb 0%, #e8eaf6 100%);
    color: var(--text-color);
    border-bottom: 1px solid #e0e0e0;
    font-weight: 500;
    transition: all var(--transition-speed);
    text-decoration: none;
}

.subs > li > a:hover {
    background: linear-gradient(135deg, #e8eaf6 0%, #d1d9ff 100%);
    color: var(--primary-color);
    padding-left: 20px;
}

/* 第2階層 */
.subs ul {
    list-style: none;
    padding: 0;
    background: #f0f2ff;
}

.subs ul a {
    display: block;
    padding: 10px 15px 10px 30px;
    background: linear-gradient(135deg, #e8eaf6 0%, #d1d9ff 100%);
    color: #555;
    font-size: 16px;
    border-bottom: 1px solid #d0d0d0;
    transition: all var(--transition-speed);
    text-decoration: none;
}

.subs ul a:hover {
    background: linear-gradient(135deg, #d1d9ff 0%, #c5cae9 100%);
    color: var(--primary-color);
    padding-left: 35px;
}

/* 第3階層 */
.subs ul ul {
    background: #e0e3f0;
}

.subs ul ul a {
    padding: 8px 15px 8px 45px;
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
    color: #666;
    font-size: 15px;
    border-bottom: 1px solid #c0c0c0;
}

.subs ul ul a:hover {
    background: linear-gradient(135deg, #c5cae9 0%, #b39ddb 100%);
    color: var(--primary-color);
    padding-left: 50px;
}

/* =====================
   フッター
   ===================== */
.footer {
    background: linear-gradient(to bottom, #f5f5f5 0%, #e0e0e0 100%);
    color: #333;
    padding: 30px 20px 20px;
    margin-top: 40px;
    border-top: 3px solid var(--primary-color);
}

.footer-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0 0 20px;
    border-bottom: 1px solid #ccc;
}

.footer-nav a {
    color: var(--primary-color);
    font-weight: 500;
}

.footer-nav a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.footer-info {
    text-align: center;
    padding: 20px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

.footer-info p {
    margin: 5px 0;
}

.copyright {
    text-align: center;
    padding: 15px;
    background: #ddd;
    font-size: 12px;
    color: #666;
    border-top: 1px solid #bbb;
}

.copyright p {
    margin: 3px 0;
}

.copyright a {
    color: var(--primary-color);
}

/* =====================
   ページトップボタン
   ===================== */
.pagetop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-speed);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
}

.pagetop.show {
    opacity: 0.8;
    pointer-events: auto;
}

.pagetop:hover {
    opacity: 1;
    transform: scale(1.1);
    text-decoration: none;
}

/* =====================
   セクション余白
   ★4AI統合：overflow-x削除
   ===================== */
article section {
    margin-bottom: 50px;
}

/* =====================
   レスポンシブ - タブレット
   ===================== */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .sidebar1 {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100vh;
        background: white;
        transition: left 0.3s ease;
        overflow-y: auto;
        z-index: 1000;
        padding-top: 60px;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }
    
    .sidebar1.active {
        left: 0;
    }

    .container {
        width: 100%;
        max-width: 100%;
    }

    .main-layout {
        flex-direction: column;
        padding: 10px;
    }

    .content {
        width: 100%;
        padding: 15px;
        border-radius: 0;
    }

    h1, article h1 {
        font-size: 22px;
    }

    h2, article h2 {
        font-size: 18px;
        margin: 25px 0 12px;
        padding: 6px 0 6px 12px;
    }

    .header {
        padding: 10px 15px;
    }

    .header-content {
        flex-direction: column;
        align-items: center;
    }

    .header-right {
        width: 100%;
        max-width: none;
    }

    .breadcrumb {
        padding: 8px 10px;
        font-size: 12px;
    }

    .card-links,
    .related-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin: 20px 0;
    }
    .card-links a,
    .related-links a {
        padding: 12px 10px;
        font-size: 14px;
    }

    .card-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .cta-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .cta-section,
    section.cta {
        padding: 20px 15px;
        margin: 30px 0;
        border-radius: 0;
        margin-left: -15px;
        margin-right: -15px;
        width: calc(100% + 30px);
    }

    .faq-question {
        padding: 12px 15px;
        font-size: 14px;
    }

    .faq-answer {
        padding: 15px;
    }

    /* ★4AI統合：テーブルラッパーのモバイル対応（stickyブレ止め版） */
    .table-wrap {
        margin: 15px 0;
        width: 100%;
    }

    /* テーブル横幅いっぱい */
    .table-wrapper,
    .table-scroll {
        margin: 15px -15px;
        border-radius: 0;
        width: calc(100% + 30px);
    }

    /* データテーブル - スマホ対応 */
    .data-table {
        font-size: 13px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    /* ★4AI統合：左列sticky固定（モバイル時・シンプル版） */
    .data-table th:first-child,
    .data-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        background: #fff;
        white-space: nowrap;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }
    
    .data-table thead th:first-child {
        z-index: 3;
        background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    }
    
    .data-table tbody tr:nth-child(odd) td:first-child {
        background: #f9f9f9;
    }
    
    .data-table tbody tr:nth-child(even) td:first-child {
        background: #ffffff;
    }
    
    .data-table tbody tr:hover td:first-child {
        background: #e3f2fd;
    }

    /* total-row左列の背景色維持 */
    .data-table .total-row td:first-child {
        background: #ffe8ba;
    }

    .toc {
        margin: 15px -15px;
        border-radius: 0;
        width: calc(100% + 30px);
        padding: 15px;
    }

    .archive-notice {
        margin: 0 -15px 20px;
        border-radius: 0;
        width: calc(100% + 30px);
        padding: 12px 15px;
    }

    .alert {
        margin: 15px -15px;
        border-radius: 0;
        width: calc(100% + 30px);
    }

    .summary-box {
        margin: 15px -15px;
        border-radius: 0;
        width: calc(100% + 30px);
        padding: 15px;
    }

    .data-summary {
        margin: 25px -15px 35px;
        border-radius: 0;
        width: calc(100% + 30px);
        padding: 15px;
    }

    .source-section,
    section.source {
        margin: 30px -15px 0;
        border-radius: 0;
        width: calc(100% + 30px);
        padding: 15px;
    }

    .step-list li {
        padding-left: 55px;
        padding-right: 12px;
        margin-left: -15px;
        margin-right: -15px;
        width: calc(100% + 30px);
        border-radius: 0;
    }
    .step-list li::before {
        width: 32px;
        height: 32px;
        font-size: 1em;
        left: 12px;
    }

    .year-nav {
        margin: 15px -15px;
        border-radius: 0;
        width: calc(100% + 30px);
        padding: 12px;
    }

    .gender-links {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .contentup, .contentdown {
        padding: 15px 10px;
    }
}

/* =====================
   レスポンシブ - スマートフォン
   ===================== */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .sidebar1 {
        width: 100%;
        padding: 0;
        padding-top: 60px;
    }

    .main-layout {
        padding: 0;
    }

    .content {
        padding: 12px;
    }

    h1, article h1 {
        font-size: 18px;
        padding-bottom: 8px;
    }

    h2, article h2 {
        font-size: 16px;
        margin: 20px 0 10px;
    }

    h3, article h3 {
        font-size: 15px;
    }

    .breadcrumb {
        font-size: 11px;
        padding: 6px 10px;
    }

    .footer-nav ul {
        flex-direction: column;
        gap: 10px;
    }

    /* データテーブル - スマホで文字サイズ維持 */
    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }

    .pagetop {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }

    .menu1 {
        font-size: 14px;
        padding: 12px;
        border-radius: 0;
    }

    .subs > li > a {
        padding: 12px 15px;
        font-size: 14px;
        border-bottom: 1px solid #e0e0e0;
    }

    .subs ul a {
        padding: 12px 15px 12px 25px;
        font-size: 14px;
    }

    .subs ul ul a {
        padding: 10px 15px 10px 35px;
        font-size: 13px;
    }

    /* ★4AI統合：table-wrapのスマホ対応（stickyブレ止め版） */
    .table-wrap {
        margin: 12px 0;
        width: 100%;
    }

    /* スマホで更に横幅調整 */
    .table-wrapper,
    .table-scroll {
        margin: 12px -12px;
        width: calc(100% + 24px);
    }

    .archive-notice {
        margin: 0 -12px 15px;
        width: calc(100% + 24px);
        padding: 10px 12px;
        font-size: 13px;
    }

    .toc {
        margin: 12px -12px;
        width: calc(100% + 24px);
        padding: 12px;
    }
    .toc ul {
        padding-left: 15px;
    }

    .alert {
        margin: 12px -12px;
        width: calc(100% + 24px);
        padding: 12px;
    }

    .summary-box {
        margin: 12px -12px;
        width: calc(100% + 24px);
        padding: 12px;
    }

    .data-summary {
        margin: 20px -12px 30px;
        width: calc(100% + 24px);
        padding: 12px;
    }

    .cta-section,
    section.cta {
        margin: 25px -12px;
        width: calc(100% + 24px);
        padding: 15px 12px;
    }

    .source-section,
    section.source {
        margin: 25px -12px 0;
        width: calc(100% + 24px);
        padding: 12px;
    }

    .card-links,
    .related-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .card-links a,
    .related-links a {
        padding: 10px 8px;
        font-size: 12px;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .card-grid a {
        padding: 12px;
    }

    .gender-links {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .gender-links a {
        padding: 12px;
    }

    .year-nav {
        margin: 12px -12px;
        width: calc(100% + 24px);
        padding: 10px;
        gap: 6px;
    }
    .year-nav a {
        padding: 6px 10px;
        font-size: 12px;
    }

    .step-list li {
        margin-left: -12px;
        margin-right: -12px;
        width: calc(100% + 24px);
        padding: 15px 12px 15px 50px;
    }
    .step-list li::before {
        width: 28px;
        height: 28px;
        font-size: 0.9em;
        left: 10px;
    }

    .cta-btn {
        padding: 12px 15px;
        font-size: 14px;
    }

    .faq-question {
        padding: 10px 12px;
        font-size: 13px;
    }
    .faq-answer {
        padding: 12px;
        font-size: 13px;
    }
}