: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: 650px 220px 150px;
    gap: 10px;
    align-items: start;
}

.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: 596px;
}

.community-body {
    height: 568px;
    display: grid;
    grid-template-rows: 271px 26px 271px;
}

.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: 596px;
    display: grid;
    grid-template-rows: 300px 24px 272px;
    gap: 0;
}

.mid-inline-ad {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-top: 0;
    border-bottom: 0;
    background: #dfe5eb;
}

.dc-panel {
    height: 300px;
}

.naver-panel {
    height: 272px;
}

.right-column {
    height: 596px;
    display: grid;
    grid-template-rows: 341px 255px;
    gap: 0;
}

.reddit-panel {
    height: 341px;
}

.sponsor-panel {
    border-top: 0;
    height: 255px;
}

.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 {
    grid-template-columns: 24px 1fr 22px;
    padding: 0 5px 0 4px;
}

.naver-row {
    grid-template-columns: 24px 1fr 34px;
    padding: 0 5px 0 4px;
}

.board-row {
    grid-template-columns: 1fr 58px;
    padding: 0 8px;
}


.reddit-row {
    display: grid;
    grid-template-columns: 26px 1fr 24px;
    gap: 5px;
    min-height: 30px;
    padding: 3px 5px 3px 4px;
    border-bottom: 1px solid #cfd5dc;
    align-items: center;
    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;
}

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

.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: 515px 515px;
    gap: 10px;
}

.board-panel {
    height: 140px;
}

.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,
    .top-banner-slot,
    .native-ad-slot {
        width: calc(100% - 20px);
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

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

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

    .mid-inline-ad,
    .sponsor-panel {
        height: 60px;
    }

    .board-grid {
        grid-template-columns: 1fr;
    }
}
