/* ===== フェーズ3：はてブ風コンパクト横並び型（統一版） ===== */

/* 親コンテナの max-width を撤廃。SWELLのレイアウトに従う */
.bookmark-list-container {
    margin: 0 auto;
    padding: 20px 0;
}


/* ====================================================
   1. エントリーリスト（全体一覧・ランキング共通）
   ==================================================== */

.entry-list-compact {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.entry-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.entry-row:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.08);
}

/* === 画像（小サイズ・正方形） === */

.entry-row-image-link {
    flex: 0 0 auto;
    display: block;
    text-decoration: none;
}

.entry-row-image-wrap {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f0f4f8, #e3eaf3);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 72px;
}

.entry-row-image-wrap.has-ogp {
    background: #f5f5f5;
}

.entry-row-image-wrap.has-ogp img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.entry-row-image-wrap.has-favicon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* === 本文 === */

.entry-row-body {
    flex: 1;
    min-width: 0; /* flex子要素のtext-overflow用 */
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.entry-row-domain {
    font-size: 11px;
    color: #888;
    line-height: 1.2;
}

.entry-row-title {
    font-size: 15px;
    font-weight: bold;
    line-height: 1.4;
    margin: 0;
    /* 2行で省略 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.entry-row-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.entry-row-title a:hover {
    color: #007bff;
}

.entry-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.entry-row-cat a {
    color: #1565c0;
    background: #e3f2fd;
    padding: 1px 8px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 11px;
}

.entry-row-cat a:hover {
    background: #bbdefb;
}

.entry-row-likes {
    color: #e0245e;
    font-weight: 600;
}

.entry-row-registrants {
    color: #666;
}

.entry-row-registrants a {
    color: #007bff;
    text-decoration: none;
}

.entry-row-registrants a:hover {
    text-decoration: underline;
}


/* ====================================================
   2. ランキング順位バッジ
   ==================================================== */

.entry-row.ranking-row {
    padding-left: 56px; /* バッジ分のスペース */
}

.ranking-badge {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.ranking-badge-1 {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #1a1a1a;
}

.ranking-badge-2 {
    background: linear-gradient(135deg, #e0e0e0, #b0b0b0);
    color: #1a1a1a;
}

.ranking-badge-3 {
    background: linear-gradient(135deg, #cd7f32, #a0522d);
    color: #fff;
}

.ranking-description {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}


/* ====================================================
   2-b. ユーザーランキング行（アバター付き）
   ==================================================== */

.user-row .user-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a90e2, #007bff);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 72px;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.15);
}

.user-avatar-initial {
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    text-transform: uppercase;
}

.user-row .entry-row-title {
    font-size: 17px;
    -webkit-line-clamp: 1;
}

.user-stat-likes {
    color: #e0245e;
    font-weight: 600;
    font-size: 13px;
}

.user-stat-views {
    color: #1565c0;
    font-weight: 600;
    font-size: 13px;
}

.user-stat-firsts {
    color: #ff9800;
    font-weight: 600;
    font-size: 13px;
}

.user-link {
    color: #007bff;
    text-decoration: none;
    font-size: 12px;
}

.user-link:hover {
    text-decoration: underline;
}

.ranking-note {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin-top: 16px;
}


/* ====================================================
   2-c. ユーザー統計サマリー（マイページ上部）
   ==================================================== */

.user-stats-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 0 0 30px 0;
    padding: 0;
}

.user-stat-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 100px;
}

.user-stat-box-link:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
    transform: translateY(-2px);
}

.user-stat-box-num {
    font-size: 22px;
    font-weight: bold;
    line-height: 1.2;
    color: #1a1a1a;
}

.user-stat-color-likes {
    color: #e0245e;
}

.user-stat-color-views {
    color: #1565c0;
}

.user-stat-color-firsts {
    color: #ff9800;
}

.user-stat-box-label {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.user-stat-box-rank {
    font-size: 11px;
    color: #007bff;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #e0e0e0;
    font-weight: 600;
}


/* ====================================================
   2-d. エントリー検索フォーム
   ==================================================== */

.entry-search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.entry-search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.entry-search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.entry-search-submit {
    padding: 10px 20px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.entry-search-submit:hover {
    background: #0056b3;
}

.entry-search-clear {
    padding: 10px 16px;
    background: #f0f0f0;
    color: #666;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.entry-search-clear:hover {
    background: #e0e0e0;
    color: #333;
}

.entry-search-result-count {
    margin: 0 0 16px 0;
    padding: 10px 14px;
    background: #e3f2fd;
    border-left: 3px solid #007bff;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
    color: #1565c0;
}

.entry-search-no-result {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
}


/* ====================================================
   2-e. ソートタブ
   ==================================================== */

.entry-sort-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px;
    background: #f5f7fa;
    border-radius: 8px;
    width: fit-content;
}

.entry-sort-tab {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-decoration: none;
    transition: all 0.2s ease;
}

.entry-sort-tab:hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.entry-sort-tab.is-active {
    background: #fff;
    color: #007bff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (max-width: 600px) {
    .entry-sort-tabs {
        width: 100%;
        justify-content: space-between;
    }

    .entry-sort-tab {
        flex: 1;
        text-align: center;
        padding: 8px 8px;
        font-size: 12px;
    }
}


/* ====================================================
   3. URLハブページ（ヒーロー＋登録者一覧）
   ==================================================== */

.entry-hub {
    margin: 0 auto;
    padding: 20px 0;
}

.entry-hub-card {
    display: flex;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.entry-hub-image-wrap {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #f0f4f8, #e3eaf3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.entry-hub-image-wrap.has-ogp {
    background: #f5f5f5;
}

.entry-hub-image-wrap.has-ogp img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.entry-hub-image-wrap.has-favicon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.entry-hub-image-wrap a {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.entry-hub-body {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.entry-hub-domain {
    display: inline-block;
    font-size: 11px;
    color: #888;
    background: #f5f5f5;
    padding: 2px 10px;
    border-radius: 10px;
    margin-bottom: 8px;
    width: fit-content;
}

.entry-hub-title {
    font-size: 18px;
    font-weight: bold;
    line-height: 1.4;
    margin: 0 0 8px 0;
    color: #1a1a1a;
    word-break: break-word;
}

.entry-hub-url {
    font-size: 12px;
    margin-bottom: 10px;
}

.entry-hub-url a {
    color: #007bff;
    text-decoration: none;
}

.entry-hub-url a:hover {
    text-decoration: underline;
}

.entry-hub-meta {
    margin-bottom: 10px;
}

.entry-hub-cat-tag {
    display: inline-block;
    padding: 2px 10px;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 10px;
    text-decoration: none;
    font-size: 11px;
    margin-right: 4px;
}

.entry-hub-cat-tag:hover {
    background: #bbdefb;
}

.entry-hub-stats {
    display: flex;
    gap: 20px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

.entry-stat {
    display: flex;
    flex-direction: column;
}

.entry-stat-num {
    font-size: 16px;
    font-weight: bold;
    color: #1a1a1a;
    line-height: 1.2;
}

.entry-stat-label {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}


/* === 登録者一覧 === */

.entry-hub-section-title {
    font-size: 17px;
    font-weight: bold;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #007bff;
    color: #1a1a1a;
}

.registrant-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.registrant-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 14px 18px;
    transition: all 0.2s ease;
}

.registrant-card:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.08);
}

.registrant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.registrant-name {
    font-weight: 600;
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
}

.registrant-name:hover {
    text-decoration: underline;
}

.registrant-date {
    font-size: 11px;
    color: #999;
}

.registrant-comment {
    margin: 6px 0 10px 0;
    padding: 8px 12px;
    background: #f9f9f9;
    border-left: 3px solid #007bff;
    border-radius: 0 4px 4px 0;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
}

.registrant-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}


/* ====================================================
   4. レスポンシブ
   ==================================================== */

@media (max-width: 600px) {
    .entry-row {
        padding: 10px 12px;
        gap: 10px;
    }

    .entry-row-image-wrap {
        width: 56px;
        height: 56px;
        flex: 0 0 56px;
    }

    .entry-row-image-wrap.has-favicon img {
        width: 26px;
        height: 26px;
    }

    .entry-row-title {
        font-size: 14px;
    }

    .entry-row.ranking-row {
        padding-left: 48px;
    }

    .ranking-badge {
        width: 30px;
        height: 30px;
        font-size: 12px;
        left: 8px;
    }

    .user-row .user-avatar {
        width: 56px;
        height: 56px;
        flex: 0 0 56px;
    }

    .user-avatar-initial {
        font-size: 22px;
    }

    .user-row .entry-row-title {
        font-size: 15px;
    }

    .user-stats-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .user-stat-box {
        padding: 12px 8px;
        min-height: 80px;
    }

    .user-stat-box-num {
        font-size: 18px;
    }

    .entry-hub-card {
        flex-direction: column;
    }

    .entry-hub-image-wrap {
        flex: 0 0 auto;
        width: 100%;
        height: 160px;
    }

    .entry-hub-body {
        padding: 14px;
    }

    .entry-hub-title {
        font-size: 16px;
    }

    .registrant-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
