body {
    margin: 0;
    padding: 10px 1ch;
    background-color: #f0f0f0;
    /* CJK 統合漢字を日本語グリフで描画させるため、日本語フォントを優先指定。
       canvas (ECharts) も body の font を継承して使う。 */
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", "MS PGothic", "Noto Sans CJK JP", sans-serif;
    font-size: 16px;
}
#chart {
    width: 100%;
    height: 640px;
    background-color: #f5f5f5;
}
.chart-wrapper { position: relative; }
.status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #888;
    font-size: 18px;
    pointer-events: none;
}
.status.hidden { display: none; }
.nav-row {
    text-align: left;
    font-size: 14px;
    margin-bottom: 4px;
}
.nav-row a { color: #06c; text-decoration: none; }
.nav-row a:hover { text-decoration: underline; }
.title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    flex-wrap: wrap;
    gap: 8px;
}
.title { text-align: center; font-size: 18px; font-weight: normal; flex-grow: 1; }
.controls { display: flex; gap: 12px; align-items: center; }
.controls input[type="checkbox"] { transform: scale(0.9); }
.update-info { text-align: right; font-size: 14px; margin: 0; }
.update-info select { font-size: 14px; margin-right: 8px; }

.table-wrapper {
    max-height: 440px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 20px;
}
.table-wrapper table { margin-top: 0; }
.table-wrapper thead th {
    position: sticky;
    top: 0;
    background-color: #f2f2f2;
    z-index: 2;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: fixed;
    overflow: hidden;
}
th, td {
    padding: 0 2px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
    font-size: 16px;
    font-weight: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
th:last-child, td:last-child { border-right: none; }
th { background-color: #f2f2f2; cursor: pointer; user-select: none; }
th.sort-asc::before { content: '▲'; font-size: 10px; margin-right: 2px; }
th.sort-desc::before { content: '▼'; font-size: 10px; margin-right: 2px; }
th:nth-child(1), td:nth-child(1) { width: 7%;  min-width: 50px; text-align: right; padding: 0 2px 0 0; }
th:nth-child(2), td:nth-child(2) { width: 11%; min-width: 80px; }
th:nth-child(3), td:nth-child(3) { width: 7%;  min-width: 60px; text-align: right; }
th:nth-child(4), td:nth-child(4) { width: 22%; min-width: 120px; }
th:nth-child(5), td:nth-child(5) { width: 7%;  min-width: 70px; text-align: right; overflow: visible; text-overflow: clip; }
th:nth-child(6), td:nth-child(6) { width: 16%; text-align: right; }
th:nth-child(7), td:nth-child(7) { width: 16%; text-align: right; }
th:nth-child(8), td:nth-child(8) { width: 14%; min-width: 80px; text-align: right; }
.live-row { background-color: pink; }
tr:nth-child(even).live-row { background-color: #ffc0cb; }
tr:nth-child(even) { background-color: #f9f9f9; }
tbody tr { cursor: pointer; }
tbody tr.selected { outline: 2px solid red; outline-offset: -2px; }
a.name-link, a.title-link { color: inherit; text-decoration: none; }
a.name-link:hover, a.title-link:hover { text-decoration: underline; }
@media (max-width: 600px) {
    th, td { font-size: 16px; padding: 0 1px; }
    th:nth-child(5), td:nth-child(5) { display: none; }
    th:nth-child(7), td:nth-child(7) { display: none; }
    th:nth-child(8), td:nth-child(8) { display: none; }
}
.credit { text-align: right; font-size: 10px; }

/* Max-info overlay (チャート左上) */
.max-info-overlay {
    position: absolute;
    top: 96px;
    left: 60px;
    font-size: 14px;
    line-height: 1.5;
    pointer-events: none;
    z-index: 5;
    background: rgba(255, 255, 255, 0.7);
    padding: 2px 8px;
    border-radius: 4px;
}

/* タイムライン目盛り (dataZoom スライダー下) */
.timeline-scale {
    position: relative;
    margin: 2px 100px 0 50px;
    height: 22px;
    border-top: 1px solid #aaa;
    font-size: 11px;
    color: #666;
    user-select: none;
}
.timeline-scale .tick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    line-height: 1.4;
    white-space: nowrap;
}
.timeline-scale .tick::before {
    content: '';
    display: block;
    width: 1px;
    height: 5px;
    background: #999;
    margin: 0 auto 1px;
}
.timeline-visible-range {
    position: absolute;
    top: -2px;
    height: 5px;
    background: rgba(80, 130, 200, 0.5);
    border-radius: 1px;
    pointer-events: none;
}

/* 行クリックで表示する詳細オーバーレイ */
#row-overlay {
    position: absolute;
    background: rgba(255, 255, 230, 0.97);
    border: 1px solid red;
    padding: 6px 10px;
    font-size: 14px;
    color: #000;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    line-height: 1.4;
    display: none;
    white-space: normal;
    word-break: break-word;
}
