/* ============================================================
   热词榜 · 日榜 / 月榜 / 年榜
   设计令牌全部沿用主题 style.css
   ============================================================ */

/* ---------- 页头 ---------- */
.rk-hero { padding: 42px 0 0; }

.rk-hero-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
}
.rk-hero-inner > div:first-child { flex: 1 1 auto; min-width: 0; }

.rk-eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 2.6px;
    text-transform: uppercase;
    color: var(--ink-faint);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.rk-eyebrow::before {
    content: "";
    width: 22px;
    height: 2px;
    background: var(--seal);
    display: block;
}

.rk-title {
    font-family: var(--font-display);
    font-size: 52px;
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -1.5px;
    color: var(--ink);
}

/* 窄屏专用短句，默认不显示 */
.rk-lead-narrow { display: none; }

.rk-lead {
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--ink-soft);
    max-width: 660px;
    margin-top: 12px;
    text-wrap: balance;
}

.rk-meta {
    display: flex;
    align-items: center;
    gap: 13px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: 12.5px;
    color: var(--ink-faint);
}
.rk-meta b { font-family: var(--font-mono); font-weight: 600; color: var(--ink); font-size: 13px; }
.rk-dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(44, 42, 38, 0.25); }

/* 印章：随周期切换 日 / 月 / 年 */
.rk-seal {
    flex: 0 0 auto;
    width: 88px;
    height: 88px;
    background: var(--seal);
    color: #FBF3E4;
    border-radius: 6px;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 44px;
    font-weight: 900;
    line-height: 1;
    transform: rotate(-6deg);
    box-shadow: 0 8px 22px rgba(197, 61, 46, 0.26);
    position: relative;
    margin-top: 8px;
}
.rk-seal::after {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1.5px solid rgba(251, 243, 228, 0.55);
    border-radius: 3px;
}

/* ---------- 周期控制条 ---------- */
.rk-period {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #FFF;
    border: 1px solid rgba(44, 42, 38, 0.07);
    border-radius: 14px;
    padding: 8px 12px 8px 8px;
    margin-top: 34px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.rk-seg {
    display: flex;
    gap: 2px;
    background: var(--paper-dark);
    padding: 3px;
    border-radius: 10px;
}

.rk-seg a {
    display: block;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-soft);
    padding: 7px 22px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.4;
}
.rk-seg a:hover { color: var(--ink); }
.rk-seg a.active {
    background: #FFF;
    color: var(--seal);
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(44, 42, 38, 0.1);
}

.rk-steps {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rk-step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(44, 42, 38, 0.09);
    background: #FFF;
    color: var(--ink-soft);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 15px;
    line-height: 1;
    transition: all 0.18s;
    font-family: var(--font-body);
    text-decoration: none;
}
.rk-step:hover:not(:disabled):not([aria-disabled="true"]) {
    border-color: rgba(197, 61, 46, 0.3);
    color: var(--seal);
}
.rk-step:disabled,
.rk-step[aria-disabled="true"] { opacity: 0.35; cursor: not-allowed; }

.rk-date {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    min-width: 108px;
    text-align: center;
    letter-spacing: 0.2px;
}

.rk-today {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--seal);
    background: rgba(197, 61, 46, 0.06);
    border: 1px solid rgba(197, 61, 46, 0.22);
    padding: 5px 12px;
    border-radius: 100px;
    margin-left: 4px;
    transition: all 0.18s;
    text-decoration: none;
    white-space: nowrap;
}
.rk-today:hover { background: rgba(197, 61, 46, 0.12); }

/* 本期统计 */
.rk-period-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 4px 22px;
    font-size: 12.5px;
    color: var(--ink-faint);
}
.rk-period-meta b { font-family: var(--font-mono); color: var(--ink); font-weight: 600; }
.rk-up { color: var(--seal); font-family: var(--font-mono); }
.rk-down { color: var(--jade); font-family: var(--font-mono); }

/* ---------- 双栏布局 ---------- */
.rk-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 26px;
    align-items: start;
    margin-bottom: 48px;
}

/* ---------- 榜单主体 ---------- */
.rk-board {
    background: #FFF;
    border: 1px solid rgba(44, 42, 38, 0.07);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.rk-board-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px 14px;
    border-bottom: 1px solid rgba(44, 42, 38, 0.07);
    background: linear-gradient(180deg, #FFFDF8, #FFF);
    flex-wrap: wrap;
}
.rk-board-head h2 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.2px;
}
.rk-board-head span {
    font-size: 11.5px;
    color: var(--ink-faint);
    font-family: var(--font-mono);
}

/* 行 */
.rk-rows { display: block; }

.rk-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 66px 78px 52px;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(44, 42, 38, 0.045);
    position: relative;
    transition: background 0.16s;
}
.rk-row:last-child { border-bottom: 0; }
.rk-row:hover { background: rgba(197, 61, 46, 0.028); }

/* 前三名：左侧竖条 */
.rk-row.is-1::before,
.rk-row.is-2::before,
.rk-row.is-3::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 2px 2px 0;
}
.rk-row.is-1::before { background: var(--seal); }
.rk-row.is-2::before { background: var(--ink); opacity: 0.55; }
.rk-row.is-3::before { background: var(--jade); }

.rk-row.is-1 { background: linear-gradient(90deg, rgba(242, 217, 141, 0.14), rgba(255, 255, 255, 0) 55%); }

.rk-no {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    color: var(--ink-faint);
    text-align: center;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}
.rk-row.is-1 .rk-no { color: var(--seal); font-size: 21px; }
.rk-row.is-2 .rk-no { color: var(--ink); }
.rk-row.is-3 .rk-no { color: var(--jade); }

.rk-info { min-width: 0; }

.rk-words {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.rk-word {
    font-family: var(--font-display);
    font-size: 16.5px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.35;
}
.rk-py {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--ink-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 210px;
}
.rk-cat {
    font-size: 10.5px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 3px;
    line-height: 1.6;
    white-space: nowrap;
}

/* 细条 */
.rk-spark {
    height: 5px;
    border-radius: 3px;
    background: rgba(44, 42, 38, 0.05);
    overflow: hidden;
}
.rk-spark i {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(197, 61, 46, 0.35), rgba(197, 61, 46, 0.75));
}
.rk-row.is-1 .rk-spark i { background: linear-gradient(90deg, var(--highlight), var(--seal)); }

/* 本期访问量 */
.rk-pv {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.rk-pv em {
    font-style: normal;
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 400;
    color: var(--ink-faint);
    margin-left: 2px;
}

/* 环比 */
.rk-delta {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}
.rk-delta.up { color: var(--seal); }
.rk-delta.down { color: var(--jade); }
.rk-delta.same { color: rgba(44, 42, 38, 0.34); font-weight: 400; }

/* ---------- 侧栏 ---------- */
.rk-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 84px;
}

.rk-side-card {
    background: #FFF;
    border: 1px solid rgba(44, 42, 38, 0.07);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}
.rk-side-card h3 {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.rk-side-card h3::before {
    content: "";
    width: 3px;
    height: 12px;
    background: var(--seal);
    border-radius: 2px;
    display: block;
}

.rk-kv { display: flex; flex-direction: column; gap: 9px; }
.rk-kv div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-size: 12.5px;
    color: var(--ink-faint);
}
.rk-kv b {
    font-family: var(--font-mono);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
}

/* 往期归档 */
.rk-archive { display: flex; flex-direction: column; gap: 2px; }

.rk-archive a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 7px;
    text-decoration: none;
    font-size: 12.5px;
    color: var(--ink-soft);
    transition: background 0.16s;
}
.rk-archive a:hover { background: var(--paper-dark); }
.rk-archive a.current {
    background: rgba(197, 61, 46, 0.06);
    color: var(--seal);
    font-weight: 600;
}
.rk-archive .d { font-family: var(--font-mono); font-size: 12px; }
.rk-archive .p {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-faint);
}
.rk-archive a.current .p { color: rgba(197, 61, 46, 0.65); }

.rk-side-note {
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--ink-faint);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(44, 42, 38, 0.1);
}

/* ---------- 规则说明 ---------- */
.rk-note {
    margin: 0 0 56px;
    padding: 22px 24px;
    background: var(--paper-dark);
    border-radius: var(--radius-lg);
    border-left: 3px solid var(--seal);
}
.rk-note h3 {
    font-family: var(--font-display);
    font-size: 15.5px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--ink);
}
.rk-note ol {
    margin: 0;
    padding-left: 18px;
    color: var(--ink-soft);
    font-size: 12.5px;
    line-height: 1.95;
}
.rk-note li::marker { color: var(--seal); }

/* ---------- 空态 ---------- */
.rk-empty {
    background: #FFF;
    border: 1px solid rgba(44, 42, 38, 0.07);
    border-radius: var(--radius-lg);
    padding: 56px 24px;
    text-align: center;
    margin-bottom: 56px;
    box-shadow: var(--shadow-sm);
}
.rk-empty h2 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 10px;
}
.rk-empty p {
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--ink-soft);
}
.rk-empty-back { margin-top: 18px; }
.rk-empty-back a { color: var(--seal); text-decoration: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .rk-layout { grid-template-columns: 1fr; }
    /* 榜单优先：侧栏下移，别挡在榜单前面 */
    .rk-side { position: static; flex-direction: row; flex-wrap: wrap; }
    .rk-side-card { flex: 1 1 240px; }
    /* 概览数据已在上方统计行，不重复占位 */
    .rk-side-card:first-child { display: none; }
}

@media (max-width: 860px) {
    .rk-title { font-size: 40px; }
    .rk-seal { width: 72px; height: 72px; font-size: 36px; }
    .rk-seg a { padding: 7px 14px; font-size: 13px; }
    .rk-row { grid-template-columns: 30px minmax(0, 1fr) 64px 46px; gap: 9px; padding: 11px 14px; }
    .rk-spark { display: none; }
    .rk-py { display: none; }
    /* 窄屏换一句短的，一行到底，不出现「没到边就换行」和末行孤字 */
    .rk-lead-wide { display: none; }
    .rk-lead-narrow { display: block; }
}

@media (max-width: 640px) {
    .rk-hero { padding-top: 26px; }
    .rk-title { font-size: 34px; }
    .rk-seal { display: none; }
    .rk-period { padding: 8px; }
    /* 窄屏三个 tab 均分整行，别挤在左边留一大截空白 */
    .rk-seg { width: 100%; }
    .rk-seg a { flex: 1; text-align: center; padding: 8px 0; }
    /* 日期步进聚在左边，「回到本期」推到右边，别让 ‹ 孤零零贴在屏边 */
    .rk-steps { width: 100%; justify-content: flex-start; }
    .rk-date { flex: 0 0 auto; min-width: 100px; }
    .rk-today { margin-left: auto; }
    .rk-word { font-size: 15.5px; }
    .rk-row { grid-template-columns: 26px minmax(0, 1fr) 62px; }
    .rk-delta { display: none; }
    .rk-cat { display: none; }
    /* 统计行：窄屏收紧字号与间距，别让「较上期 ↓18%」被挤到第二行 */
    .rk-period-meta {
        gap: 7px;
        margin: 10px 4px 16px;
        font-size: 11.5px;
        flex-wrap: nowrap;
        white-space: nowrap;
    }
}

@media (max-width: 400px) {
    .rk-period-meta {
        gap: 5px;
        font-size: 10.5px;
    }
}
