:root {
    --bg: #ccd5df;
    --panel-bg: #f6f6f6;
    --border: #aeb7c2;
    --header-blue: #144985;
    --header-green: #006b58;
    --header-navy: #0e3562;
    --header-purple: #4b3395;
    --text: #1d2430;
    --muted: #667489;
    --line-h: 26px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif;
    font-size: 12px;
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    background: var(--header-blue);
    height: 25px;
    border-bottom: 1px solid #103a68;
}

.topbar-inner {
    width: 1040px;
    height: 25px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 68px 220px 1fr;
    align-items: center;
    gap: 8px;
}

.brand a {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

.gnb {
    display: flex;
    gap: 14px;
    align-items: center;
}

.gnb a {
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
}

.top-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

.search-wrap {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.search-wrap input {
    width: 180px;
    height: 21px;
    border: 1px solid #7c93ac;
    background: #dce4ed;
    padding: 0 6px;
    font-size: 11px;
}

.search-wrap button,
.admin-link,
.login-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 21px;
    padding: 0 8px;
    border: 1px solid #20364d;
    background: #f7f7f7;
    color: #15283b;
    font-size: 11px;
    font-weight: 700;
}

.admin-link {
    background: #f2c342;
}

.page-wrap {
    width: 1040px;
    margin: 10px auto 16px;
}

.top-banner-slot,
.native-ad-slot {
    width: 1040px;
    height: 74px;
    border: 1px dashed #9fb0c2;
    background: #d8dee6;
    color: #6f7e8f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.native-ad-slot {
    margin-top: 10px;
}

.section-caption {
    margin: 6px 0 2px;
    color: #6c7683;
    font-size: 11px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 515px 307px 198px;
    gap: 10px;
    align-items: stretch;
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border);
}

.panel-header {
    height: 27px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    color: #ffffff;
    font-weight: 700;
}

.panel-header.blue {
    background: var(--header-blue);
}

.panel-header.green {
    background: var(--header-green);
}

.panel-header.navy {
    background: var(--header-navy);
}

.panel-header.purple {
    background: var(--header-purple);
}

.panel-title {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 12px;
}

.mini-text {
    font-size: 10px;
    opacity: 0.85;
}

.more-link {
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
}

.community-panel {
    height: auto;
}

.community-body {
    height: auto;
    display: flex;
    flex-direction: column;
}

.community-strip-ad {
    border-top: 1px dashed #aeb7c2;
    border-bottom: 1px dashed #aeb7c2;
    background: #dfe5eb;
    color: #728094;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.mid-column {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mid-inline-ad {
    height: 26px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #728094;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-top: 0;
    border-bottom: 0;
    background: #dfe5eb;
}

.dc-panel {
    flex: 1;
    min-height: 0;
}

.naver-panel {
    flex: 1;
    min-height: 0;
}

.right-column {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.reddit-panel {
    flex: 1;
    min-height: 0;
}

.sponsor-panel {
    border-top: 0;
    flex-shrink: 0;
    min-height: 60px;
}

.sponsor-box {
    width: 100%;
    height: 100%;
    background: #103d6c;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

.compact-list,
.reddit-list,
.mini-board-list {
    min-height: 0;
}

.community-list-top,
.community-list-bottom,
.compact-list,
.reddit-list,
.mini-board-list {
    overflow: hidden;
}

.row-link {
    display: grid;
    align-items: center;
    width: 100%;
    min-height: var(--line-h);
    border-bottom: 1px solid #cfd5dc;
    background: #f6f6f6;
}

.rank-row {
    grid-template-columns: 26px 1fr 134px;
    padding: 0 6px 0 4px;
}

.rank-row.no-meta {
    grid-template-columns: 26px 1fr;
}

.dc-row {
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 6px;
}

.naver-row {
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 6px;
}

.board-row {
    display: grid;
    grid-template-columns: 1fr 40px 70px;
    padding: 0 8px;
    gap: 4px;
    align-items: center;
}


.reddit-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 3px 8px;
    border-bottom: 1px solid #cfd5dc;
    background: #f6f6f6;
}

.rank-badge {
    width: 20px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    background: #1c4f8c;
}

.rank-badge.top1 {
    background: #d43930;
}

.rank-badge.top2,
.rank-badge.top3,
.rank-badge.top4,
.rank-badge.top5 {
    background: #566f8f;
}

.row-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #111820;
    font-size: 12px;
    flex: 1;
    min-width: 0;
}

.row-right,
.row-view,
.row-meta,
.row-date {
    color: #6c7683;
    font-size: 11px;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}

.row-meta {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

.row-source {
    color: #60708a;
}

.row-count {
    color: #4d5c6e;
}

.reddit-badge {
    width: 20px;
    height: 20px;
    background: #1c4f8c;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.reddit-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.reddit-ticker {
    font-size: 11px;
    font-weight: 700;
    color: #123a68;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reddit-company {
    font-size: 10px;
    color: #67768a;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reddit-score {
    color: #22324a;
    font-size: 11px;
    font-weight: 700;
    text-align: right;
}

.empty-state {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #67768a;
    font-size: 12px;
}

.board-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
}
.daily-cumulative-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.board-panel {
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    box-sizing: border-box;
}
.board-panel .panel-body {
    flex: 1;
}

.novels-panel {
    margin-top: 10px;
}

.novels-panel .panel-body {
    min-height: 116px;
}

.read-link .row-title,
.read-link .reddit-title {
    color: #8a929c !important;
}

@media (max-width: 1100px) {
    .topbar-inner,
    .page-wrap {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding-left: 10px;
        padding-right: 10px;
        box-sizing: border-box;
    }

    .top-banner-slot,
    .native-ad-slot,
    .hero-grid,
    .board-grid,
    .daily-cumulative-grid,
    .panel,
    .community-panel,
    .mid-column,
    .right-column,
    .dc-panel,
    .naver-panel,
    .reddit-panel,
    .sponsor-panel,
    .board-panel,
    .novels-panel {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    .hero-grid,
    .board-grid,
    .daily-cumulative-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .community-panel,
    .mid-column,
    .right-column,
    .dc-panel,
    .naver-panel,
    .reddit-panel,
    .sponsor-panel {
        height: auto;
        flex: none;
    }

    .community-body,
    .mid-column,
    .right-column {
        display: block;
    }

    .panel,
    .top-banner-slot,
    .native-ad-slot {
        overflow: hidden;
    }

    .row-link,
    .reddit-row,
    .board-row,
    .dc-row,
    .naver-row {
        width: 100%;
        min-width: 0;
    }

    .row-title,
    .reddit-main,
    .reddit-company,
    .reddit-ticker {
        min-width: 0;
    }

    .mid-inline-ad {
        height: 26px;
    }
    .sponsor-panel {
        height: 60px;
        min-height: 0;
    }
}
.hero-grid > * { box-sizing: border-box; }
.board-grid > * { box-sizing: border-box; }
