/* 系統ツリー（js/tree.js）。一覧（ta-）・カード（tb-）・系統樹（tc-）の3つの見せ方と、共通の部品（tr-） */
.tr-content { padding: 20px 12px 40px; }
.tr-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.tr-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.tr-title { margin: 0; font-size: 22px; font-weight: 800; color: #06293a; }
.tr-reviewlink { font-size: 13px; }
.tr-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 8px; }
.tr-controls:empty { display: none; }
.tr-dbbtn {
    padding: 6px 14px;
    border: 0;
    border-radius: 8px;
    font-weight: 700;
    color: #fff;
    background: #1aa6b7;
}
.tr-sampling { flex: 1; min-width: 150px; width: auto; }
.tr-openall {
    padding: 6px 14px;
    border: 2px solid #06293a;
    border-radius: 8px;
    font-weight: 700;
    color: #06293a;
    background: #fff;
}
.tr-openall[aria-pressed="true"] { color: #fff; background: #06293a; }
.tr-dbbtn[hidden], .tr-sampling[hidden] { display: none; }
/* クラス（DB）ごとのチェック（js/tree.js の setupDbFilter） */
.tr-dbs { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.tr-dbs[hidden] { display: none; }
.tr-db { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 4px 10px; border: 2px solid #06293a; border-radius: 999px; background: #fff; color: #06293a; font-size: 12px; font-weight: 800; text-transform: none; cursor: pointer; }
.tr-db input { margin: 0; accent-color: #06293a; }
.tr-db.is-off { border-style: dashed; opacity: .6; }
.tr-views { display: flex; gap: 6px; margin: 6px 0 8px; }
.tr-views button {
    flex: 1;
    padding: 6px 4px;
    border: 2px solid #1aa6b7;
    border-radius: 999px;
    font-weight: 700;
    color: #1aa6b7;
    background: #fff;
}
.tr-views button.is-on { color: #fff; background: #1aa6b7; }
.tr-summary { margin-bottom: 10px; font-size: 13px; font-weight: 700; color: #52606b; }
.tr-loading { color: #8a99a3; }

/* 共通の部品 */
.tr-rank {
    display: inline-block;
    flex: none;
    min-width: 1.7em;
    padding: 0 5px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    color: #fff;
}
.tr-bar {
    display: block;
    width: 56px;
    height: 4px;
    margin-top: 2px;
    border-radius: 999px;
    background: #e3eaee;
    overflow: hidden;
}
.tr-bar i { display: block; height: 100%; background: #2c8f5b; }
.tr-owned { flex: none; font-size: 13px; font-weight: 800; color: #2c8f5b; }
.tr-diff { flex: none; font-size: 10px; font-weight: 700; color: #d9333f; }
.tr-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 4px;
    margin-bottom: 8px;
}
.tr-crumb {
    padding: 2px 8px;
    border: 0;
    border-radius: 999px;
    font-size: 13px;
    color: #1aa6b7;
    background: #e8f6f8;
}
.tr-crumb.is-here { color: #fff; background: #06293a; }
.tr-sep { color: #b0b8be; margin: 0 2px; }
.tr-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 4px 10px;
    border-bottom: 1px solid #e3eaee;
    margin-bottom: 10px;
}
.tr-head-name { flex: 1; font-size: 20px; font-weight: 800; color: #06293a; }
.tr-head-count { font-size: 12px; color: #52606b; text-align: right; }
/* 門や綱の説明（tree.js の PhylumDescription） */
.tr-desc { margin: 0 0 12px; }
.tr-desc ul { margin: 0; padding: 0; }
.tr-desc li {
    list-style: none;
    margin-bottom: 3px;
    padding: .4em .6em;
    border-left: 5px solid #2d8fdd;
    font-size: 13px;
    line-height: 1.5;
    color: #1f5f99;
    background: #f1f8ff;
}

/* ── A 一覧 ── */
.ta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 40px;
    padding: 4px 6px;
    border: 0;
    border-radius: 8px;
    text-align: left;
    background: transparent;
    cursor: pointer;
}
.ta-row:hover { background: #f1f7fa; }
.ta-chev { flex: none; width: 14px; color: #8a99a3; }
.ta-name {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    color: #06293a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ta-count { flex: none; font-size: 11px; color: #52606b; text-align: right; }
.ta-kids {
    margin-left: 12px;
    padding-left: 8px;
    border-left: 2px solid #dde5ea;
}
.ta-kids > .tr-desc { margin: 4px 0 6px; }
.ta-row.is-leaf .ta-name { font-weight: 500; }
.ta-thumb {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: #dfe7ec;
}

/* ── B カード ── */
.tb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.tb-card {
    padding: 0;
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    text-align: left;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 20, 35, .18);
}
.tb-pic { position: relative; aspect-ratio: 4 / 3; background: #dfe7ec; }
.tb-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tb-chip { position: absolute; left: 6px; top: 6px; }
.tb-owned {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
    color: #fff;
    background: #2c8f5b;
}
.tb-body { padding: 6px 8px 8px; }
.tb-name { font-size: 14px; font-weight: 800; color: #06293a; line-height: 1.3; }
.tb-count { font-size: 11px; color: #52606b; }
.tb-count .tr-bar { width: 100%; }

/* ── C 系統樹（2段ずつ） ── */
.tc-wrap { position: relative; }
.tc-svg { display: block; }
.tc-layer { position: absolute; inset: 0; }
.tc-child {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 20px;
    padding: 0;
    border: 0;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    background: transparent;
    white-space: nowrap;
    overflow: hidden;
}
.tc-child span:last-child { overflow: hidden; text-overflow: ellipsis; }
.tc-child-count { position: absolute; font-size: 11px; color: #52606b; }
.tc-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; }
.tc-closed,
.tc-leaf {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px 0 6px;
    border: 2px solid var(--c);
    border-radius: 999px;
    font-size: 13px;
    color: #06293a;
    background: #fff;
    white-space: nowrap;
    overflow: hidden;
}
.tc-closed b { overflow: hidden; text-overflow: ellipsis; }
.tc-closed small { flex: none; color: #52606b; font-size: 11px; }
.tc-leaf { padding: 0 10px 0 2px; }
.tc-leaf img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex: none; }
.tc-leaf span { overflow: hidden; text-overflow: ellipsis; }
/* 子がみな種の段では、写真を大きく */
.tc-leaf.is-big { height: 52px; border-radius: 14px; font-size: 15px; font-weight: 700; }
.tc-leaf.is-big img { width: 44px; height: 44px; border-radius: 10px; }

/* ── 種を押したときの拡大表示 ── */
.tr-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 15, 30, .78);
}
.tr-lightbox.is-open { display: flex; }
body.tr-noscroll { overflow: hidden; }
.tr-lb-card {
    position: relative;
    width: min(640px, 100%);
    max-height: 100%;
    overflow: auto;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.tr-lb-close {
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, .55);
}
.tr-lb-close::before { content: "✕"; font-size: 18px; }
.tr-lb-pic { position: relative; background: #0d1b24; }
.tr-lb-pic img { display: block; width: 100%; max-height: 62vh; object-fit: contain; }
.tr-lb-prev,
.tr-lb-next {
    position: absolute;
    top: 50%;
    width: 40px;
    height: 56px;
    margin-top: -28px;
    border: 0;
    font-size: 30px;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, .35);
}
.tr-lb-prev { left: 0; border-radius: 0 8px 8px 0; }
.tr-lb-next { right: 0; border-radius: 8px 0 0 8px; }
.tr-lb-prev[hidden], .tr-lb-next[hidden] { display: none; }
.tr-lb-num {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    padding: 1px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: #fff;
    background: rgba(0, 0, 0, .5);
}
.tr-lb-num:empty { display: none; }
.tr-lb-body { padding: 12px 16px 16px; }
.tr-lb-name { font-size: 22px; font-weight: 800; color: #06293a; }
.tr-lb-path { margin-top: 2px; font-size: 12px; color: #52606b; }
.tr-lb-state { margin-top: 6px; font-size: 13px; font-weight: 700; color: #8a99a3; }
.tr-lb-state.is-owned { color: #2c8f5b; }
.tr-lb-link {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    color: #fff;
    background: #1aa6b7;
}
.tr-lb-link:hover { color: #fff; text-decoration: none; opacity: .9; }
.tr-lb-link[hidden] { display: none; }
/* 詳しく見る（その写真の登録内容） */
.tr-lb-more {
    display: block;
    margin-top: 10px;
    padding: 6px 14px;
    border: 2px solid #1aa6b7;
    border-radius: 8px;
    font-weight: 700;
    color: #1aa6b7;
    background: #fff;
}
.tr-lb-more[hidden] { display: none; }
.tr-lb-info { margin-top: 8px; }
.tr-lb-info[hidden] { display: none; }
.tr-lb-note { margin: 0; font-size: 13px; color: #8a99a3; }
.tr-lb-dl { margin: 0; font-size: 13px; }
.tr-lb-dl dt { margin-top: 6px; font-size: 11px; font-weight: 700; color: #8a99a3; }
.tr-lb-dl dd { margin: 0; color: #06293a; white-space: pre-line; }
.tr-lb-dl dd.is-sci { font-style: italic; }
/* 検索窓 */
.tr-search { margin: 10px 0 0; }
.tr-search-msg { margin-top: 4px; font-size: 12px; font-weight: 700; color: #c0392b; }
.tr-search-msg:empty { display: none; }

@media (max-width: 767px) {
    .tr-content { padding: 12px 6px 30px; }
    .tr-page { padding: 12px; }
}

/* 埋めこみ（tree.php?embed=1。クエストの結果画面の窓 js/quizreview.js から重ねて開く）。サイドバーとナビバーを出さず、画面いっぱいに */
.tr-embed .sidebar, .tr-embed .wrapper > nav.navbar, .tr-embed .tr-reviewlink { display: none !important; }
.tr-embed .main-panel { width: 100% !important; float: none; }
.tr-embed .tr-content { padding-top: 8px; }
/* 系統樹の見せ方の説明（2026-09-29。js/phylo.js で差しこんだ「系統」のまとまり） */
.tc-note { margin: 2px 0 8px; font-size: 12px; line-height: 1.6; color: #52606b; }
