/* ============================================================
   Today's Hotlist - tophub.today clone styles
   ============================================================ */

:root {
    --bg: #f5f6f8;
    --card-bg: #ffffff;
    --header-bg: #ffffff;
    --text: #333333;
    --text-secondary: #888888;
    --text-muted: #aaaaaa;
    --border: #e8e8e8;
    --primary: #f04848;
    --primary-light: #fff0f0;
    --link: #333333;
    --link-hover: #f04848;
    --rank-gold: #f04848;
    --rank-silver: #ff7f50;
    --rank-bronze: #ffa500;
    --shadow: 0 1px 4px rgba(0,0,0,0.06);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.1);
    --radius: 10px;
    --sidebar-width: 220px;
    --header-height: 52px;
    --mobile-tab-height: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--link); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--link-hover); }

/* ─── Custom Scrollbar ────────────────────────────────────── */

/* WebKit */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b0b0b0; }

/* Firefox */
html { scrollbar-width: thin; scrollbar-color: #d0d0d0 transparent; }

/* Hide scrollbar for horizontal nav */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }

/* ─── Header ──────────────────────────────────────────────── */

.header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    height: var(--header-height);
}

.header-inner {
    max-width: 1280px; margin: 0 auto; padding: 0 16px;
    display: flex; align-items: center; height: 100%; gap: 12px;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column; justify-content: center; gap: 4px;
    width: 36px; height: 36px; padding: 8px;
    background: none; border: none; cursor: pointer;
    border-radius: 6px; flex-shrink: 0;
}
.hamburger:hover { background: #f5f5f5; }
.hamburger span {
    display: block; height: 2px; background: var(--text);
    border-radius: 2px; transition: all 0.2s;
}

.logo {
    display: flex; align-items: center; gap: 6px;
    font-size: 17px; font-weight: 700; color: var(--text);
    white-space: nowrap; flex-shrink: 0;
}
.logo-icon { font-size: 20px; }
.logo-text { color: var(--primary); }

.header-nav {
    display: flex; align-items: center; gap: 2px;
    flex: 1; overflow-x: auto;
    scrollbar-width: none; -ms-overflow-style: none;
}
.header-nav::-webkit-scrollbar { display: none; }

.nav-link {
    padding: 5px 12px; border-radius: 6px;
    font-size: 13px; color: var(--text-secondary);
    transition: all 0.2s; white-space: nowrap; flex-shrink: 0;
}
.nav-link:hover { background: #f5f5f5; color: var(--text); }
.nav-link.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }

.nav-more {
    position: relative; padding: 5px 12px; font-size: 13px;
    color: var(--text-secondary); cursor: pointer;
    border-radius: 6px; user-select: none; flex-shrink: 0;
}
.nav-more:hover { background: #f5f5f5; }
.nav-more:hover .nav-dropdown,
.nav-dropdown.show,
.nav-dropdown:hover { display: block; }

.nav-dropdown {
    display: none; position: fixed; z-index: 999;
    background: white; border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    min-width: 120px; padding: 6px 0;
}
.dropdown-item {
    display: block; padding: 8px 16px; font-size: 13px; color: var(--text-secondary);
}
.dropdown-item:hover { background: #f5f5f5; color: var(--text); }

/* ─── Header Search ─────────────────────────────────────── */

.header-search {
    position: relative;
    flex-shrink: 0;
    margin-left: auto;
}

.search-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    background: none; border: none; cursor: pointer;
    font-size: 17px; border-radius: 50%;
    transition: background 0.2s;
    color: var(--text-secondary);
}
.search-toggle:hover { background: #f5f5f5; }

.search-box {
    display: none;
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    width: 400px;
    z-index: 200;
}
.search-box.open { display: block; }

.search-input {
    width: 100%; height: 38px;
    padding: 0 36px 0 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    background: var(--card-bg);
    color: var(--text);
    outline: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 2px 16px rgba(240,72,72,0.12);
}
.search-input::placeholder { color: var(--text-muted); }

.search-close {
    position: absolute; right: 4px; top: 50%;
    transform: translateY(-50%);
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer;
    font-size: 13px; color: var(--text-muted);
    border-radius: 50%;
    transition: all 0.15s;
}
.search-close:hover { background: #f0f0f0; color: var(--text); }

.search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #d0d0d0 transparent;
}
.search-dropdown.show { display: block; }

.search-result-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
    cursor: pointer;
    min-width: 0;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #fafafa; }

.search-result-platform {
    display: flex; align-items: center; gap: 4px;
    flex-shrink: 0; font-size: 11px;
    color: var(--text-muted);
    min-width: 56px;
}

.search-result-title {
    flex: 1; font-size: 13px; line-height: 1.4;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text);
}

.search-result-title .highlight {
    color: var(--primary);
    font-weight: 600;
}

.search-result-heat {
    flex-shrink: 0; font-size: 11px;
    color: var(--text-muted);
}

.search-empty {
    padding: 28px 16px; text-align: center;
    color: var(--text-muted); font-size: 13px;
}
.search-loading {
    padding: 20px 16px; text-align: center;
    color: var(--text-muted); font-size: 13px;
}

/* ─── Page Layout ─────────────────────────────────────────── */

.page-layout {
    max-width: 1280px; margin: 0 auto; width: 100%;
    display: flex; gap: 24px; padding: 20px 16px;
    min-height: calc(100vh - var(--header-height) - var(--mobile-tab-height) - 60px);
    flex: 1;
}

/* ─── Sidebar Overlay ─────────────────────────────────────── */

.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.4); z-index: 149;
}
.sidebar-overlay.show { display: block; }

/* ─── Sidebar ─────────────────────────────────────────────── */

.sidebar {
    width: var(--sidebar-width); flex-shrink: 0;
    position: sticky; top: calc(var(--header-height) + 20px);
    align-self: flex-start;
    max-height: calc(100vh - var(--header-height) - 40px);
    overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: #d0d0d0 transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 2px; }

.sidebar-header {
    display: none; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.sidebar-header-title { font-size: 15px; font-weight: 600; }
.sidebar-close {
    width: 32px; height: 32px; border: none; background: #f5f5f5;
    border-radius: 50%; font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; color: #666;
}

.sidebar-section-title {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    padding: 8px 12px 4px; margin-top: 4px;
}
.sidebar-section-title:first-of-type { margin-top: 0; }

.sidebar-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 8px;
    font-size: 14px; color: var(--text-secondary);
    transition: all 0.15s;
}
.sidebar-item:hover { background: #f5f5f5; color: var(--text); }
.sidebar-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.sidebar-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
    margin-top: 20px; padding: 12px;
    border-top: 1px solid var(--border);
}
.sidebar-footer-text { font-size: 12px; color: var(--text-muted); }
.sidebar-footer-text a { color: var(--primary); }

/* ─── Main Content ────────────────────────────────────────── */

.main-content { flex: 1; min-width: 0; }

.category-header {
    display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px;
}
.category-title { font-size: 20px; font-weight: 700; color: var(--text); }
.category-count { font-size: 13px; color: var(--text-muted); }
.category-page-info { font-size: 12px; color: var(--text-muted); margin-left: 4px; }

/* ─── Pagination ──────────────────────────────────────────── */

.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; padding: 28px 0 12px; flex-wrap: wrap;
}
.page-btn {
    padding: 7px 16px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 13px; color: var(--text-secondary);
    transition: all 0.2s; background: var(--card-bg); white-space: nowrap;
}
.page-btn:hover { background: #f5f5f5; color: var(--text); }
.page-btn.disabled { color: #ddd; cursor: default; pointer-events: none; background: #fafafa; }
.page-num {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 13px; color: var(--text-secondary);
    transition: all 0.2s; background: var(--card-bg);
}
.page-num:hover { background: #f5f5f5; color: var(--text); }
.page-num.active {
    background: var(--primary); color: white; border-color: var(--primary); font-weight: 600;
}
.page-ellipsis {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: var(--text-muted); letter-spacing: 2px;
}
.page-info { display: none; }

/* ─── Cards Grid ──────────────────────────────────────────── */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

/* ─── Hotlist Card ────────────────────────────────────────── */

.hotlist-card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
    transition: box-shadow 0.2s;
}
.hotlist-card:hover { box-shadow: var(--shadow-hover); }

.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-bottom: 1px solid var(--border);
    background: #fafafa;
    overflow: visible;
}
.card-platform { display: flex; align-items: center; gap: 6px; }
.card-icon { font-size: 17px; }
.card-icon-img {
    width: 17px; height: 17px;
    border-radius: 3px;
    object-fit: contain;
    flex-shrink: 0;
}
.card-name { font-size: 13px; font-weight: 600; color: var(--text); }
.card-name-link {
    font-size: 13px; font-weight: 600; color: var(--text);
    transition: color 0.2s;
}
.card-name-link:hover { color: var(--primary); }
.card-header-right {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.card-update { font-size: 11px; color: var(--text-muted); }
.subscribe-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    background: transparent; border: none; cursor: pointer;
    font-size: 17px; color: #c0c0c0;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
}
.subscribe-btn:hover {
    color: #f5a623;
    background: rgba(245, 166, 35, 0.08);
    transform: scale(1.15);
}
.subscribe-btn.subscribed {
    color: #f5a623;
}
.subscribe-btn.subscribed:hover {
    color: #e09510;
    background: rgba(245, 166, 35, 0.12);
}
.subscribe-btn:active {
    transform: scale(0.9);
}

/* ─── Card Items ──────────────────────────────────────────── */

.card-items { list-style: none; padding: 0; }
.card-item { border-bottom: 1px solid #f5f5f5; }
.card-item:last-child { border-bottom: none; }

.item-link {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 14px; transition: background 0.15s; color: var(--text);
}
.item-link:hover { background: #fafafa; }
.item-link:active { background: #f0f0f0; }

.item-rank {
    flex-shrink: 0; width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    background: #f0f0f0; border-radius: 4px;
}
.item-rank.rank-1 { background: var(--rank-gold); color: white; }
.item-rank.rank-2 { background: var(--rank-silver); color: white; }
.item-rank.rank-3 { background: var(--rank-bronze); color: white; }

.item-title {
    flex: 1; font-size: 13px; line-height: 1.5;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item-heat { flex-shrink: 0; font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ─── Empty States ────────────────────────────────────────── */

.card-empty { padding: 36px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.empty-state { text-align: center; padding: 80px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 14px; color: var(--text-muted); }

/* ─── Footer ──────────────────────────────────────────────── */

.footer {
    border-top: 1px solid var(--border); background: var(--card-bg);
    padding: 14px 0;
}
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 0 16px; text-align: center; }
.footer-inner p { font-size: 12px; color: var(--text-muted); }
.footer-stats { margin-top: 6px; }
.footer-stats a { color: var(--primary); font-size: 12px; }

/* ─── Mobile Bottom Tab Bar ───────────────────────────────── */

.mobile-tabs {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: var(--header-bg); border-top: 1px solid var(--border);
    height: var(--mobile-tab-height);
    box-shadow: 0 -1px 4px rgba(0,0,0,0.04);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-tab {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
    color: var(--text-muted); font-size: 10px; transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.mobile-tab.active { color: var(--primary); }
.mobile-tab-icon { font-size: 20px; }
.mobile-tab-label { font-size: 10px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ─── Tablet: < 1024px ──────────────────────────────────── */

@media (max-width: 1024px) {
    .page-layout { flex-direction: column; padding: 14px 12px; }

    /* Sidebar becomes slide-in overlay */
    .sidebar {
        display: flex; flex-direction: column; position: fixed;
        top: 0; left: 0; bottom: 0; width: 280px; z-index: 150;
        background: var(--card-bg); box-shadow: 4px 0 20px rgba(0,0,0,0.15);
        transform: translateX(-100%); transition: transform 0.25s ease;
        max-height: 100vh; padding: 0; border-radius: 0 12px 12px 0;
        overflow-y: auto;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-header { display: flex; }
    body.sidebar-open { overflow: hidden; }

    .sidebar-section-title { margin-top: 8px; }
    .sidebar-section-title:first-of-type { margin-top: 0; }

    /* Show hamburger */
    .hamburger { display: flex; }

    /* Header nav: scrollable pill row */
    .header-nav {
        gap: 0; overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 2px 0;
    }

    /* Bottom tab bar */
    .mobile-tabs { display: flex; }

    /* Search on tablet */
    .search-box { width: 260px; }

    /* Adjust footer bottom padding for tab bar */
    .footer { padding-bottom: calc(var(--mobile-tab-height) + 20px); }
    .page-layout { padding-bottom: 24px; }

    .cards-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

    /* Stats page tablet adjustments */
    .stats-page { padding: 18px 12px; padding-bottom: calc(var(--mobile-tab-height) + 28px); }
    .stats-summary { grid-template-columns: repeat(3, 1fr); }
}

/* ─── Mobile: < 640px ───────────────────────────────────── */

@media (max-width: 640px) {
    :root { --radius: 8px; }

    .header-inner { padding: 0 10px; gap: 8px; }
    .header { height: 48px; }
    .logo { font-size: 16px; }
    .logo-icon { font-size: 18px; }

    .nav-link { font-size: 12px; padding: 4px 10px; border-radius: 16px; }
    .nav-more { font-size: 12px; padding: 4px 10px; }

    .page-layout { padding: 10px 8px; gap: 14px; }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .card-header { padding: 10px 12px; }
    .item-link { padding: 8px 12px; gap: 6px; }
    .item-title { font-size: 12px; }
    .item-rank { width: 20px; height: 20px; font-size: 10px; }

    .category-header { margin-bottom: 12px; }
    .category-title { font-size: 18px; }

    .sidebar { width: 260px; }

    /* Search on mobile */
    .search-box { width: 220px; }
    .search-result-platform { display: none; }
}

/* ─── Tiny: < 380px ──────────────────────────────────────── */

@media (max-width: 380px) {
    .logo-text { display: none; }
    .nav-link { font-size: 11px; padding: 3px 8px; }
    .header-inner { gap: 4px; }

    /* Stats page tiny screen */
    .stats-summary { grid-template-columns: 1fr; gap: 6px; }
    .stat-card { padding: 12px 8px; }
    .stat-number { font-size: 20px; }
    .chart-wrapper { height: 180px; }
    .bar-cell { width: 60px; }
}

/* ─── Stats Page ──────────────────────────────────────────── */

.stats-page {
    max-width: 1040px; margin: 0 auto; padding: 24px 20px;
    flex: 1; width: 100%;
}

.stats-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-bottom: 24px;
}
.stats-title { font-size: 22px; font-weight: 700; }
.stats-period { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.stats-select {
    padding: 6px 12px; border: 1px solid var(--border);
    border-radius: 6px; font-size: 13px; background: white; cursor: pointer;
}

/* Summary Cards */
.stats-summary {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px; margin-bottom: 28px;
}
.stat-card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px; text-align: center;
}
.stat-number { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Chart */
.stats-chart-container {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px; margin-bottom: 28px;
}
.chart-wrapper { height: 320px; position: relative; }
.stats-section-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

/* Table */
.stats-table-container {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px; margin-bottom: 28px;
}
.table-wrapper { overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stats-table th {
    text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--border);
    color: var(--text-secondary); font-weight: 600; white-space: nowrap;
}
.stats-table td {
    padding: 9px 12px; border-bottom: 1px solid #f5f5f5;
}
.stats-table tbody tr:hover { background: #fafafa; }
.count-cell { font-weight: 600; color: var(--primary); }

/* Bar in table */
.bar-cell { width: 120px; }
.bar {
    height: 8px; background: var(--primary); border-radius: 4px;
    min-width: 2px; transition: width 0.3s;
}
.page-link { color: var(--primary); font-size: 13px; }

@media (max-width: 640px) {
    .stats-page { padding: 14px 8px; padding-bottom: calc(var(--mobile-tab-height) + 24px); }
    .stats-header { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
    .stats-title { font-size: 18px; }
    .stats-summary { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .stat-card { padding: 14px 8px; }
    .stat-number { font-size: 22px; }
    .stat-label { font-size: 11px; }
    .chart-wrapper { height: 200px; }
    .stats-chart-container { padding: 14px 10px; margin-bottom: 16px; }
    .stats-section-title { font-size: 14px; margin-bottom: 12px; }
    .stats-table-container { padding: 14px 10px; margin-bottom: 16px; }
    .stats-table { font-size: 12px; }
    .stats-table th, .stats-table td { padding: 7px 8px; }
    .bar-cell { width: 80px; }
}

/* ─── Scroll to Top ──────────────────────────────────────── */

.scroll-top {
    position: fixed; bottom: 80px; right: 20px; z-index: 99;
    width: 42px; height: 42px; border: 1px solid #ddd; border-radius: 50%;
    background: #fff; color: #999; font-size: 20px;
    cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    opacity: 0; transform: translateY(10px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none; display: flex; align-items: center; justify-content: center;
}
.scroll-top.visible {
    opacity: 1; transform: translateY(0); pointer-events: auto;
}
.scroll-top:hover { background: #f5f5f5; color: #666; transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,0.1); }
.scroll-top:active { transform: translateY(0); }

@media (max-width: 640px) {
    .scroll-top { bottom: calc(var(--mobile-tab-height) + 20px); right: 12px; width: 38px; height: 38px; font-size: 18px; }
}

/* ============================================================
   Platform Detail Page
   ============================================================ */

.detail-page {
    max-width: 800px; margin: 0 auto; padding: 20px 16px;
    flex: 1; width: 100%;
}

.detail-container {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}

/* Header */
.detail-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #fafafa 0%, #f0f5ff 100%);
}

.detail-back {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 13px; color: var(--text-secondary);
    margin-bottom: 16px;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}
.detail-back:hover { background: rgba(0,0,0,0.05); color: var(--primary); }

.detail-platform-top {
    display: flex; align-items: center; gap: 12px;
    flex-wrap: wrap;
}

.detail-icon {
    font-size: 36px; width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: var(--card-bg); border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    flex-shrink: 0;
}

.detail-icon-img {
    width: 48px; height: 48px;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    flex-shrink: 0;
}

.detail-name {
    font-size: 24px; font-weight: 700; color: var(--text);
    line-height: 1.3;
}

.detail-category-tag {
    display: inline-flex; align-items: center;
    padding: 3px 10px; font-size: 12px;
    background: var(--primary-light); color: var(--primary);
    border-radius: 12px; font-weight: 500;
    transition: opacity 0.2s;
}
.detail-category-tag:hover { opacity: 0.8; }

.detail-meta {
    display: flex; align-items: center; gap: 16px;
    margin-top: 12px; flex-wrap: wrap;
}

.detail-update {
    font-size: 13px; color: var(--text-secondary);
}

.detail-count {
    font-size: 13px; color: var(--text-muted);
}

/* Rank List */
.detail-list {
    padding: 0;
}

.rank-list {
    list-style: none; padding: 0; margin: 0;
}

.rank-item {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 24px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}
.rank-item:last-child { border-bottom: none; }
.rank-item:hover { background: #fafafa; }

/* Top 3 highlighted */
.rank-item.rank-top {
    background: #fffdf5;
}
.rank-item.rank-top:hover {
    background: #fff9e6;
}

.rank-num {
    flex-shrink: 0; width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; color: var(--text-muted);
    background: #f0f0f0; border-radius: 6px;
}

.rank-num-1 { background: var(--rank-gold); color: white; font-size: 15px; }
.rank-num-2 { background: var(--rank-silver); color: white; font-size: 14px; }
.rank-num-3 { background: var(--rank-bronze); color: white; font-size: 14px; }

.rank-title {
    flex: 1; font-size: 15px; color: var(--text);
    line-height: 1.5; word-break: break-all;
    transition: color 0.2s;
    min-width: 0;
}
.rank-title:hover { color: var(--primary); }

.rank-heat {
    flex-shrink: 0; font-size: 13px;
    color: var(--text-muted); white-space: nowrap;
}

.rank-go {
    flex-shrink: 0; font-size: 15px; color: #ccc;
    transition: color 0.2s; padding: 4px;
}
.rank-go:hover { color: var(--primary); }

/* Empty state */
.detail-empty {
    text-align: center; padding: 80px 20px;
}
.detail-empty-icon { font-size: 48px; margin-bottom: 16px; }
.detail-empty p { font-size: 14px; color: var(--text-muted); }

/* Responsive */
@media (max-width: 640px) {
    .detail-page { padding: 10px 8px; }
    .detail-header { padding: 16px; }
    .detail-name { font-size: 20px; }
    .detail-icon { font-size: 28px; width: 40px; height: 40px; }
    .detail-icon-img { width: 40px; height: 40px; }
    .rank-item { padding: 12px 16px; gap: 10px; }
    .rank-title { font-size: 14px; }
    .rank-num { width: 24px; height: 24px; font-size: 12px; }
    .rank-num-1 { font-size: 13px; }
    .rank-num-2, .rank-num-3 { font-size: 13px; }
}

@media (max-width: 1024px) {
    .detail-page { padding-bottom: calc(var(--mobile-tab-height) + 28px); }
}
