/* ===== DESIGN.md tokens ================================================
   通用型主题：不绑定单一垂直领域，配色取自根目录 DESIGN.md §2.2 通用主题
   调色板，圆角／字阶／间距仍严格遵循 DESIGN.md，勿新增规范外的值。字体按 DESIGN.md 的四大
   角色（display / serif / sans / mono）承担，全部带系统字体兜底栈。
   ===================================================================== */
.theme-countdown {
    /* colors */
    --wd-primary: #111111;
    --wd-on-primary: #ffffff;
    --wd-ink: #111111;
    --wd-ink-soft: #2b2b2b;
    --wd-body: #6b7280;
    --wd-hairline: #d4d4d4;
    --wd-canvas: #fafafa;
    --wd-canvas-soft: #ffffff;
    --wd-link: #0369a1;
    --wd-footer-bg: #111111;
    --wd-footer-ink: #fafafa;
    /* spacing — 4px 基数 */
    --wd-xxs: 2px;
    --wd-xs: 4px;
    --wd-sm: 8px;
    --wd-md: 12px;
    --wd-lg: 16px;
    --wd-xl: 20px;
    --wd-2xl: 24px;
    --wd-3xl: 32px;
    --wd-4xl: 48px;
    --wd-5xl: 64px;
    /* rounded — 领域自适应圆角 */
    --wd-radius: 0px;
    --wd-radius-card: 0px;
    --wd-r-full: 9999px;
    /* type roles */
    --wd-display: "Archivo Black", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --wd-serif: Georgia, "Times New Roman", Times, serif;
    --wd-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
    --wd-mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
}

/* ===== 页面底与基础排版 ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

.theme-countdown {
    margin: 0;
    background: var(--wd-canvas);
    color: var(--wd-ink);
    font-family: var(--wd-sans);
    font-size: 17px;
    line-height: 1.45;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.cr-main {
    min-height: 80vh;
}

/* ===== masthead-band / nav-bar ===== */
.cr-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: color-mix(in srgb, var(--wd-canvas) 92%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--wd-hairline);
}

.cr-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--wd-lg);
    padding: var(--wd-md) var(--wd-xl);
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}

.cr-brand {
    font-family: var(--wd-display);
    font-weight: 700;
    color: var(--wd-ink);
    text-decoration: none;
    font-size: 32px;
    line-height: 35.2px;
    letter-spacing: -0.3px;
    display: inline-flex;
    align-items: center;
    gap: var(--wd-sm);
    min-width: 0;
}

.cr-brand:hover {
    opacity: 0.85;
}

.cr-nav {
    display: flex;
    align-items: center;
    gap: var(--wd-xl);
}

.cr-nav a {
    color: var(--wd-ink);
    text-decoration: none;
    font-family: var(--wd-sans);
    font-size: 14px;
    font-weight: 700;
    line-height: 18px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: var(--wd-xs) 0;
    transition: color 0.15s ease;
}

.cr-nav a:hover {
    color: var(--wd-link);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.cr-menu-toggle {
    display: none;
    text-decoration: none;
    color: inherit;
}

/* ===== category-eyebrow ===== */
.cr-kicker {
    color: var(--wd-link);
    text-transform: uppercase;
    margin-bottom: var(--wd-sm);
    font-family: var(--wd-mono);
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
    letter-spacing: 0.4px;
}

/* ===== 广告壳 ======================================================
   1. :has(.ad) —— 只有广告组件真的渲染出内容时才预留高度、加边框与标注，
      没有广告时整块塌陷为 0，不会留下空白带。
   2. 创意区按实际投放尺寸（Fluid / 300x250）预留 250px，素材回填前后
      总高一致，CLS 为 0，同时让广告在首屏稳定可见。
   3. 上下各留 48px，与任何可点击元素保持足够距离，避免误点。
   ================================================================= */
.cr-ad:has(.ad) {
    display: block;
    margin: var(--wd-2xl) 0;
    padding: 0;
    border-top: 1px solid var(--wd-hairline);
    border-bottom: 1px solid var(--wd-hairline);
    text-align: center;
    background: var(--wd-canvas);
    contain: layout;
}

/* 实际投放的四个广告位都是 Fluid / 300x250：按 250px 预留「创意区」高度，
   标注与内边距在壳上自然叠加，回填前后总高一致 —— CLS 为 0，也不会像
   按整壳猜 300px 那样在素材偏矮时留下大片空白。 */
.cr-ad:has(.ad) .ad {
    min-height: 250px;
}


/* 组件自身的居中容器：保证素材在窄屏下满宽不被裁切 */
.cr-ad .ad {
    max-width: 100%;
}

.cr-ad .ad-content {
    min-width: 0;
    overflow-x: auto;
}

/* ===== 通用页头 ===== */
.cr-page-head {
    padding-bottom: var(--wd-lg);
    margin-bottom: var(--wd-3xl);
    border-bottom: 1px solid var(--wd-hairline);
}

.cr-page-head h1 {
    font-family: var(--wd-display);
    font-weight: 700;
    margin: var(--wd-sm) 0;
    overflow-wrap: break-word;
    font-size: 48px;
    line-height: 52.8px;
    letter-spacing: -0.4px;
}

.cr-page-head p {
    color: var(--wd-body);
    margin: 0;
    font-family: var(--wd-serif);
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.09px;
}

.cr-page-head a {
    color: var(--wd-link);
    font-weight: 700;
    text-decoration: underline;
}

/* ===== 榜单容器 ======================================================
   本主题的骨架是「巨号序号排行榜」：内容单元只有 .cr-item 一种——
   左侧一个超大 tabular 数字，右侧是标题，文字优先、只有榜首带图。
   从首页贯穿到分类页、频道索引与相关阅读；不设侧栏，不退回卡片网格。
   ===================================================================== */
.cr-wrap {
    max-width: 1080px;
    margin: auto;
    padding: var(--wd-2xl) var(--wd-xl) var(--wd-4xl);
}

.cr-read {
    max-width: 680px;
    margin: 0 auto;
}

.cr-empty {
    text-align: center;
    padding: var(--wd-4xl) 0;
    color: var(--wd-body);
    font-family: var(--wd-serif);
    font-size: 16px;
    line-height: 24px;
}

.cr-pager {
    margin-top: var(--wd-3xl);
    padding-top: var(--wd-2xl);
    border-top: 1px solid var(--wd-hairline);
}

.cr-pager nav {
    display: flex;
    justify-content: center;
    gap: var(--wd-sm);
    flex-wrap: wrap;
}

/* 频道条：桌面端替代侧栏；移动端分类已在汉堡抽屉里，必须隐藏
   （AGENTS.md §3.3 唯一来源铁律） */
.cr-rail {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wd-xs);
    padding-block: var(--wd-md) var(--wd-xl);
}

.cr-rail a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: var(--wd-xs) var(--wd-md);
    border: 1px solid var(--wd-hairline);
    color: var(--wd-ink);
    text-decoration: none;
    font-family: var(--wd-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cr-rail a:hover, .cr-rail a.is-current {
    border-color: var(--wd-ink);
    background: var(--wd-ink);
    color: var(--wd-canvas);
}

/* ===== 长文型页面（about / contact） ===== */
.cr-prose-wrap {
    max-width: 760px;
    margin: auto;
}

.cr-panel {
    background: var(--wd-canvas);
    border-radius: var(--wd-radius);
}

.cr-panel h2 {
    font-family: var(--wd-display);
    font-weight: 700;
    margin: var(--wd-3xl) 0 var(--wd-md);
    font-size: 26px;
    line-height: 30px;
}

.cr-panel h2:first-child {
    margin-top: 0;
}

.cr-panel p {
    color: var(--wd-ink);
    margin: 0 0 var(--wd-lg);
    font-family: var(--wd-serif);
    font-size: 19px;
    line-height: 31.35px;
    letter-spacing: 0.108px;
}

.cr-source-list {
    list-style: none;
    padding: 0;
    margin: var(--wd-lg) 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0;
}

.cr-source-list li {
    padding: var(--wd-md) 0;
    border-bottom: 1px solid var(--wd-hairline);
    color: var(--wd-body);
    font-family: var(--wd-mono);
    font-size: 13px;
    line-height: 18px;
    letter-spacing: 0.4px;
    overflow-wrap: anywhere;
}

.cr-flash {
    padding: var(--wd-md) var(--wd-lg);
    margin-bottom: var(--wd-2xl);
    border: 1px solid var(--wd-primary);
    border-radius: var(--wd-radius);
    color: var(--wd-ink);
    font-family: var(--wd-sans);
    font-size: 14px;
    line-height: 18px;
    letter-spacing: 0.4px;
}

/* ===== 表单：触控高度 >= 44px ===== */
.cr-form {
    display: flex;
    flex-direction: column;
    gap: var(--wd-2xl);
}

.cr-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--wd-2xl);
}

.cr-form label {
    display: flex;
    flex-direction: column;
    gap: var(--wd-sm);
}

.cr-form span {
    color: var(--wd-ink);
    text-transform: uppercase;
    font-family: var(--wd-mono);
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
    letter-spacing: 0.4px;
}

.cr-form input, .cr-form textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--wd-canvas-soft);
    color: var(--wd-ink);
    border: 1px solid var(--wd-hairline);
    border-radius: var(--wd-radius);
    padding: var(--wd-md) var(--wd-lg);
    min-height: 44px;
    font-family: var(--wd-sans);
    font-size: 17px;
    line-height: 20px;
}

.cr-form input:focus, .cr-form textarea:focus {
    outline: 2px solid var(--wd-primary);
    outline-offset: 1px;
}

.cr-form button {
    align-self: flex-start;
    background: var(--wd-primary);
    color: var(--wd-on-primary);
    border: none;
    border-radius: var(--wd-radius);
    padding: 10px var(--wd-2xl);
    cursor: pointer;
    font-family: var(--wd-sans);
    font-size: 16px;
    font-weight: 700;
    line-height: 20px;
    letter-spacing: 0.3px;
    min-height: 44px;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.cr-form button:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

/* ===== footer ===== */
.cr-footer {
    background: var(--wd-footer-bg);
    color: var(--wd-footer-ink);
    padding: var(--wd-4xl) var(--wd-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--wd-2xl);
    font-family: var(--wd-sans);
    font-size: 14px;
    line-height: 18px;
    letter-spacing: 0.4px;
}

.cr-footer nav {
    display: flex;
    gap: var(--wd-2xl);
}

.cr-footer a {
    color: var(--wd-footer-ink);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.cr-footer a:hover {
    text-decoration: underline;
}

/* ===== 合规页（privacy / terms） ===== */
.cr-breadcrumb {
    color: var(--wd-body);
    margin-bottom: var(--wd-2xl);
    font-family: var(--wd-sans);
    font-size: 14px;
    line-height: 18px;
    letter-spacing: 0.4px;
}

.cr-breadcrumb a {
    color: var(--wd-body);
    text-decoration: none;
    display: inline-block;
    padding: var(--wd-sm) 0;
}

.cr-breadcrumb a:hover {
    color: var(--wd-link);
    text-decoration: underline;
}

.cr-breadcrumb .is-current {
    color: var(--wd-ink);
}

.cr-legal {
    max-width: 760px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cr-legal h1 {
    font-family: var(--wd-display);
    font-weight: 700;
    margin: 0 0 var(--wd-2xl);
    padding-bottom: var(--wd-lg);
    border-bottom: 2px solid var(--wd-primary);
    font-size: 48px;
    line-height: 52.8px;
    letter-spacing: -0.4px;
}

.cr-legal h2 {
    font-family: var(--wd-display);
    font-weight: 700;
    margin: var(--wd-4xl) 0 var(--wd-lg);
    font-size: 26px;
    line-height: 30px;
}

.cr-legal h3 {
    font-family: var(--wd-sans);
    font-weight: 700;
    margin: var(--wd-3xl) 0 var(--wd-md);
    font-size: 20px;
    line-height: 24px;
    letter-spacing: -0.28px;
}

.cr-legal h4 {
    font-family: var(--wd-sans);
    font-weight: 700;
    margin: var(--wd-2xl) 0 var(--wd-sm);
    font-size: 17px;
    line-height: 22px;
    letter-spacing: -0.144px;
}

.cr-legal p {
    color: var(--wd-ink);
    margin: var(--wd-lg) 0;
    font-family: var(--wd-serif);
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.09px;
}

.cr-legal p.is-strong {
    font-weight: 700;
}

.cr-legal a {
    color: var(--wd-link);
    text-decoration: underline;
}

.cr-legal ul {
    margin: var(--wd-lg) 0;
    padding-left: var(--wd-xl);
    font-family: var(--wd-serif);
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.09px;
}

.cr-legal li {
    margin: var(--wd-sm) 0;
}

.cr-legal-updated {
    margin-top: var(--wd-4xl);
    padding-top: var(--wd-2xl);
    border-top: 1px solid var(--wd-hairline);
}

.cr-legal-updated p {
    color: var(--wd-body);
    font-family: var(--wd-mono);
    font-size: 13px;
    line-height: 18px;
    letter-spacing: 0.4px;
}

/* ===== 通用响应式 ===== */
@media (max-width: 1023px) {
    .cr-page-head h1 {
        font-size: 36px;
        line-height: 40px;
        letter-spacing: -0.3px;
    }
    .cr-legal h1 {
        font-size: 36px;
        line-height: 40px;
        letter-spacing: -0.3px;
    }
}

@media (max-width: 767px) {
    .cr-wrap {
        padding: var(--wd-2xl) var(--wd-lg) var(--wd-3xl);
    }
    .cr-form-row {
        grid-template-columns: 1fr;
    }
    .cr-page-head h1, .cr-legal h1 {
        font-size: 28px;
        line-height: 32px;
        letter-spacing: 0;
    }
    .cr-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        cursor: pointer;
        font-family: var(--wd-sans);
        font-size: 22px;
        line-height: 24px;
        color: var(--wd-ink);
        user-select: none;
    }
    .cr-nav {
        display: none;
        flex-direction: column;
        gap: var(--wd-xs);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--wd-canvas);
        border-bottom: 1px solid var(--wd-primary);
        padding: var(--wd-md) var(--wd-xl);
        z-index: 50;
    }
    .cr-nav a {
        display: flex;
        align-items: center;
        min-height: 44px;
        font-size: 15px;
        border-bottom: 1px solid var(--wd-hairline);
    }
    .cr-nav a:last-child {
        border-bottom: none;
    }
    .cr-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--wd-xl);
    }
    .cr-footer nav {
        flex-wrap: wrap;
        gap: var(--wd-lg);
    }
    .cr-brand {
        font-size: 24px;
        line-height: 28px;
    }
    /* 移动端广告：撑到容器满宽（抵消 16px 侧边距），创意区高度同样按 250px 预留 */
    .cr-ad:has(.ad) {
        margin: var(--wd-3xl) calc(var(--wd-lg) * -1);
        padding: var(--wd-md) var(--wd-xs) var(--wd-xl);
    }
}

/* ===== 骨架：巨号排行榜（移动优先）===============================
   整页是一张带序号的榜单：左侧是压到出血的巨号序号，右侧是标题，
   只有榜首带图。文字优先、图片极少，移动端加载快、一屏能排 6~8 位，
   读者为了看完整榜会一直往下滚——滚动深度天然高。
   ================================================================= */
.cr-board {
    border-top: 3px solid var(--wd-ink);
}

.cr-item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: var(--wd-lg);
    align-items: start;
    padding: var(--wd-xl) 0;
    border-bottom: 1px solid var(--wd-hairline);
    color: var(--wd-ink);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.cr-item:hover {
    background: var(--wd-canvas-soft);
}

.cr-no {
    font-family: var(--wd-display);
    font-weight: 900;
    color: var(--wd-hairline);
    font-size: 56px;
    line-height: 0.85;
    letter-spacing: -2px;
    font-variant-numeric: tabular-nums;
    transition: color 0.15s ease;
}

.cr-item:hover .cr-no {
    color: var(--wd-primary);
}

.cr-item-body {
    min-width: 0;
}

.cr-item h2 {
    font-family: var(--wd-sans);
    font-weight: 700;
    margin: 0 0 var(--wd-xs);
    font-size: 20px;
    line-height: 26px;
    letter-spacing: -0.28px;
    overflow-wrap: break-word;
}

.cr-item:hover h2 {
    text-decoration: underline;
}

.cr-item p {
    color: var(--wd-body);
    margin: 0;
    font-family: var(--wd-serif);
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.09px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 榜首：唯一带图的条目 */
.cr-item-top {
    padding-top: var(--wd-2xl);
}

.cr-item-top .cr-no {
    color: var(--wd-primary);
    font-size: 72px;
}

.cr-item-top h2 {
    font-family: var(--wd-display);
    font-size: 32px;
    line-height: 38px;
    letter-spacing: -0.3px;
}

.cr-item-top img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    margin-bottom: var(--wd-lg);
    background: var(--wd-hairline);
}

.cr-item-top p {
    -webkit-line-clamp: 4;
    font-size: 19px;
    line-height: 31.35px;
    letter-spacing: 0.108px;
}

.cr-standfirst {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wd-lg);
    padding: var(--wd-md) 0;
    color: var(--wd-body);
    text-transform: uppercase;
    font-family: var(--wd-mono);
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    letter-spacing: 0.5px;
}

.cr-standfirst b {
    color: var(--wd-ink);
}

@media (min-width: 768px) {
    .cr-item {
        grid-template-columns: 120px minmax(0, 1fr);
        gap: var(--wd-3xl);
    }
    .cr-no {
        font-size: 88px;
    }
    .cr-item-top .cr-no {
        font-size: 120px;
    }
    .cr-item h2 {
        font-size: 24px;
        line-height: 30px;
    }
    .cr-item-top h2 {
        font-size: 48px;
        line-height: 52.8px;
        letter-spacing: -0.4px;
    }
}

@media (max-width: 767px) {
    .cr-item {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: var(--wd-md);
        padding: var(--wd-lg) 0;
    }
    .cr-no {
        font-size: 40px;
        letter-spacing: -1px;
    }
    .cr-item-top .cr-no {
        font-size: 48px;
    }
    .cr-item h2 {
        font-size: 17px;
        line-height: 24px;
    }
    .cr-item-top h2 {
        font-size: 24px;
        line-height: 30px;
    }
    .cr-item-top p {
        font-size: 16px;
        line-height: 24px;
    }
}


/* 分类页 category_banner2 插在文章列表内部：grid 布局下必须跨满整行，
   否则广告会被当成一张卡片挤进某一列（AGENTS.md §4.2）。 */
.cat-ad-row {
    grid-column: 1 / -1;
    width: 100%;
}

/* ===== 榜首画幅收窄 ==================================================
   排行榜的卖点是一屏能扫很多条编号，榜首若占掉大半屏就没有榜的感觉了。
   ===================================================================== */
.cr-item-top img {
    aspect-ratio: 21/9;
    max-height: 300px;
    object-fit: cover;
}

.cr-item-top h2 {
    font-size: 28px;
    line-height: 34px;
    letter-spacing: -0.3px;
}

/* 无图榜单条：频道索引与关于页用 */
.cr-item-plain .cr-item-body p {
    margin-top: var(--wd-xs);
}

.cr-related h2 {
    font-family: var(--wd-display);
    font-weight: 700;
    margin: var(--wd-4xl) 0 var(--wd-lg);
    font-size: 24px;
    line-height: 30px;
    letter-spacing: -0.2px;
}

@media (max-width: 767px) {
    /* 分类已在汉堡抽屉内，页面上不再重复展示 */
    .cr-rail {
        display: none;
    }
    .cr-item-top h2 {
        font-size: 24px;
        line-height: 30px;
    }
}

/* 静态榜单条（关于页 / 联系页的说明段，不是链接） */
.cr-item-static {
    cursor: default;
}

.cr-board-inline {
    margin-bottom: var(--wd-2xl);
}

.cr-source-list {
    margin: var(--wd-sm) 0 0;
    padding-left: var(--wd-xl);
}
