body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 20px;
}
header {
    text-align: center;
    margin-bottom: 30px;
}
h1 {
    color: #1a1a1a;
}
#update-time {
    color: #666;
    font-size: 0.9em;
}
footer {
    text-align: center;
    margin-top: 40px;
    color: #888;
    font-size: 0.8em;
}

.ranking-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}
.ranking-column {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    flex: 1;
    min-width: 300px;
}
.ranking-column h2 {
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
    font-size: 1.2em;
}
.ranking-column ol {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

/* タグランキング用スタイル */
.tag-item { /* liタグに付けるクラス名を想定 */
    padding: 10px 5px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tag-item:last-child {
    border-bottom: none;
}
.tag-item .rank {
    font-weight: bold;
    color: #888;
    margin-right: 10px;
    min-width: 25px;
}
.tag-link {
    text-decoration: none;
    color: #0066cc;
    flex-grow: 1;
}
.tag-link:hover {
    text-decoration: underline;
}
.count {
    color: #999;
    font-size: 0.9em;
    margin-left: 10px;
}

/* 動画ランキング用スタイル */

.video-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.video-item:last-child {
    border-bottom: none;
}
.video-item .rank {
    font-size: 1.1em;
    font-weight: bold;
    color: #888;
    margin-right: 8px;
    align-self: flex-start;
    min-width: 28px;
}
.video-thumbnail {
    width: 130px;
    margin-right: 12px;
}
.video-thumbnail img {
    width: 100%;
    display: block;
    border-radius: 4px;
}
.video-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.video-title {
    font-weight: bold;
    color: #0066cc;
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 8px;
}
.video-title:hover {
    text-decoration: underline;
}
.video-stats {
    font-size: 0.85em;
    color: #555;
    display: flex;
    flex-wrap: wrap;
    gap: 0 12px;
    margin-bottom: 8px;
}
.video-points {
    font-size: 1em;
    color: #e60000;
    font-weight: bold;
    margin-top: auto;
}

/* スマホではタブナビゲーションを非表示 (初期状態) */
.tab-nav {
    display: none;
}

/* 画面幅が768px以下の場合 (タブレットやスマホ) */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    /* PC用の3列レイアウトを解除 */
    .ranking-container {
        display: block;
    }

    /* タブナビゲーションを表示 */
    .tab-nav {
        display: flex;
        width: 100%;
        border-bottom: 1px solid #ccc;
        margin-bottom: 20px;
    }
    
    .tab-button {
        flex: 1;
        padding: 12px 10px;
        border: none;
        background-color: transparent;
        font-size: 1em;
        cursor: pointer;
        color: #666;
        border-bottom: 3px solid transparent;
        transition: all 0.2s ease;
    }
    .tab-button.active {
        color: #0066cc;
        font-weight: bold;
        border-bottom-color: #0066cc;
    }

    /* 全てのランキングパネルを一旦非表示に */
    .ranking-panel {
        display: none;
    }

    /* アクティブなパネルだけを表示 */
    .ranking-panel.active {
        display: block;
    }

    /* --- スマホでの動画レイアウト微調整 --- */
    .video-thumbnail {
        width: 100px;
    }
    .video-title {
        font-size: 0.9em;
    }
    .video-stats {
        font-size: 0.75em;
        gap: 0 8px;
    }
    .video-points {
        font-size: 0.9em;
    }
}

/* --- 共通ヘッダーナビゲーション --- */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    background-color: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 20px auto;
}

.nav-group {
    flex: 1;
    text-align: center;
}

.nav-title {
    margin: 0 0 10px 0;
    font-weight: bold;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.main-nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.main-nav a {
    text-decoration: none;
    color: #0066cc;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.main-nav a:hover {
    background-color: #f0f2f5;
}

/* 現在表示しているページのリンクのスタイル */
.main-nav li.active a {
    color: #1a1a1a;
    font-weight: bold;
    background-color: #e9ecef;
}

/* スマホ用の調整 */
@media (max-width: 768px) {
    .main-nav {
        flex-direction: column; /* 縦並びにする */
    }
}


/* --- トップページ用スタイル --- */
.top-container {
    max-width: 1200px;
    margin: 0 auto;
}

.top-container h2 {
    text-align: center;
    font-size: 1.5em;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.highlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.highlight-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.highlight-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.highlight-content {
    flex-grow: 1; /* 内容部分を伸ばして高さを揃える */
}

.no-data {
    color: #888;
}

.more-link {
    display: block;
    margin-top: 15px;
    text-align: right;
    color: #0066cc;
    text-decoration: none;
    font-weight: bold;
}
.more-link:hover {
    text-decoration: underline;
}


/* トレンドタグハイライト用 */
.tag-highlight {
    text-align: center;
    padding: 20px 0;
}
.highlight-tag-link {
    font-size: 2em;
    font-weight: bold;
    color: #0066cc;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 10px;
}
.highlight-tag-link:hover {
    text-decoration: underline;
}
.highlight-count {
    font-size: 1.2em;
    color: #555;
    margin: 0;
}

/* 動画ハイライト用 */
.video-highlight {
    display: flex;
}