/* --- ベース・リセット --- */
body {
    margin: 0;
    padding: 0;
    /* 日本語の可読性に優れたフォントスタック */
    font-family: "Segoe UI", "Meiryo", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDPGothic", sans-serif;
    color: #1e293b;
    background-color: #f8fafc;
    line-height: 1.8;
    letter-spacing: 0.02em;
}

.container {
    width: 100%;
}

/* --- タイトルエリア --- */
.header-main {
    background: #1a2a3a;
    color: #ffffff;
    padding: 20px;
    text-align: center;
    border-bottom: 4px solid #3498db;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-main h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

/* --- 検索・操作エリア --- */
.search-container {
    background: #ffffff;
    padding: 15px 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid #58667e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.controls-upper {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px; /* 余分な表示を消したためマージンを調整 */
}

#search-input {
    padding: 10px 15px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s;
}

#search-input:focus {
    outline: none;
    border-color: #3498db;
}

.swap-btn {
    padding: 8px 16px;
    background: #475569;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
}

.swap-btn:hover { background: #334155; }

.result-count {
    font-weight: bold;
    color: #64748b;
    font-size: 0.9rem;
    margin-left: auto;
}

/* --- フィルタースイッチ --- */
.filter-group {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 12px 20px;
    background: #f1f5f9;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #475569;
    font-size: 0.9rem;
}

.special-opts {
    margin-left: auto;
    display: flex;
    gap: 20px;
    padding-left: 20px;
    border-left: 2px solid #cbd5e1;
}

.opt-highlight { color: #d32f2f; }
.opt-filter { color: #b71c1c; font-weight: 700; }

/* --- テーブルデザイン --- */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    table-layout: fixed; /* 画像で見られた列幅の崩れを防止 */
}

thead th {
    background: #334155;
    color: #ffffff !important;
    padding: 15px 12px;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: left;
    border-bottom: 3px solid #3498db;
    position: sticky;
    top: 125px; 
    z-index: 90;
}

tbody td {
    padding: 18px 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
    font-size: 0.95rem;
}

/* 交互の色付け */
tbody tr:nth-child(even) { background-color: #f8fafc; }
tbody tr:hover { background-color: #f1f7fc; }

.id-col { color: #94a3b8; font-weight: bold; text-align: center; font-size: 0.85rem; }
.cat-chapter { color: #2563eb; font-weight: bold; font-size: 0.85rem; }
.cat-item { color: #059669; font-weight: bold; font-size: 0.85rem; }

/* 本文テキストの設定 */
.text-left, .text-right {
    line-height: 1.8;
    padding: 20px 24px !important;
    text-align: justify;
    font-feature-settings: "palt";
}

/* --- ハイライト --- */
.highlight {
    background-color: #fff9c4;
    color: #bf360c;
    padding: 0 2px;
    font-weight: 600;
    border-radius: 2px;
}

/* 視認性の高い shall強調スタイル */
.shall-highlight {
    color: #d32f2f;
    background-color: #ffebee;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 700;
    border-bottom: 2px solid #d32f2f;
}

/* スクロールバー */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }