    /* Search clear button */
    .search-clear-btn { display: none; }
    .search-clear-btn.visible { display: flex; }
    /* S366: 搜索命中词高亮 — <mark> 由 filterPubs() 用 DOM 操作包裹（textContent 安全，
       不拼接用户输入 HTML），此处只定义样式。浅/深色两套，深色下用琥珀底 + 深字保证对比度。 */
    mark.pub-hit {
        background: #FDE68A;           /* amber-200 */
        color: #1F2937;                /* gray-800 */
        border-radius: 2px;
        padding: 0 1px;
        box-decoration-break: clone;
        -webkit-box-decoration-break: clone;
    }
    html.dark mark.pub-hit {
        background: #F59E0B;           /* amber-500 */
        color: #111827;
    }
    /* Citation badge styles */
    .citation-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.15rem 0.6rem;
        border-radius: 9999px;
        font-size: 0.75rem;
        font-weight: 500;
        line-height: 1.4;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .citation-badge-active {
        /* S463: deepened to blue-700 so white text clears WCAG AA in LIGHT mode
           (blue-500 #3B82F6 → ≈3.7:1 with white; blue-700 #1D4ED8 → ≈6.3:1). */
        background: #1D4ED8;
        color: #fff;
    }
    .citation-badge-zero {
        /* S463: pin an explicit light palette (old rule used --muted/--text-muted
           text tokens as a background → dark-gray bg + gray text ≈2.95:1).
           gray-200 bg + gray-700 text ≈ 9.7:1. */
        background: #E5E7EB;
        color: #374151;
    }
    /* S342: dark-mode contrast fix — the old badge inherited --muted (#B0BEC5,
       a LIGHT gray) as its background in dark mode, so the #94A3B8 gray text
       became unreadable (≈1.9:1). Pin explicit dark palette: slate bg + light
       text; and deepen the active badge's blue so white text clears WCAG AA
       (white on #60A5FA was ≈2.1:1; #2563EB ≈ 4.9:1). */
    html.dark .citation-badge-active {
        background: #2563EB;
        color: #fff;
    }
    html.dark .citation-badge-zero {
        background: rgba(148, 163, 184, 0.22);
        color: #E2E8F0;
    }
    /* S337: tag filter button count badge — style aligned with the awards page
       stat-card/year badges (accent-tinted rounded pill). Lives INSIDE the pill
       tag button; when the button is active (accent bg) the badge inverts to a
       translucent white pill so it stays readable. Zero counts under a filter
       get .is-zero (muted), mirroring the awards stat-zero de-emphasis. */
    .tag-count-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 1.35rem;
        height: 1.25rem;
        padding: 0 0.35rem;
        border-radius: 9999px;
        font-size: 0.6875rem;
        font-weight: 600;
        line-height: 1;
        background: rgba(59, 130, 246, 0.12);
        color: #2563EB;
        border: 1px solid rgba(59, 130, 246, 0.25);
        flex-shrink: 0;
        transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    }
    html.dark .tag-count-badge {
        background: rgba(96, 165, 250, 0.16);
        color: #93C5FD;
        border-color: rgba(96, 165, 250, 0.3);
    }
    /* S547: inside the active pill the count badge was white text on a 22%
       white overlay (≈3.5:1 on the new accent-dark fill). Inverted to a solid
       white pill with accent-dark text → 5.17:1 in both themes. */
    .tag-btn.active .tag-count-badge {
        background: #fff;
        color: #2563EB;
        border-color: #fff;
    }
    html.dark .tag-btn.active .tag-count-badge {
        background: #fff;
        color: #2563EB;
        border-color: #fff;
    }
    /* S547b: after client-side activation, setTagBtnActive(btn,true) only ADDS the
       active classes and leaves the server-rendered inactive hover utilities
       (hover:text-accent / dark:hover:text-blue-400 …) on the button forever.
       Hovering a just-clicked pill then repaints the label in accent-DARK
       #2563EB on top of the accent-dark fill → 1.00:1 light / ~2.02:1 dark,
       i.e. invisible text. Guard mirrors awards.html .year-nav-btn.active
       (S434) — white wins over any hover utility, in both themes.
       Static appearance is unchanged (active pill was already white-on-accent-dark
       = 5.12:1); only the broken hover state is corrected. .tag-label inherits. */
    /* S607 收尾（本单）：.tag-btn.active 的**填充面**。该按钮模板用的是 `bg-accent-dark`
       令牌（不是 `bg-accent`+`text-white`），所以 base.html 的 S607 全局规则
       `[class~="bg-accent"][class~="text-white"]` 整套**不命中** —— 改前浅/深静止都是
       #2563EB + 白字 5.17:1（达标），但**完全没有 hover 反馈**（hover 与静止逐像素同色，
       零变化）。此处补显式 :hover（提高特异性），复用 S554 已批准口径，**不新立颜色**：
         浅色：静止 #2563EB + 白 = 5.17:1 → hover #1D4ED8 + 白 = 6.70:1
         深色：静止 #60A5FA + #0F172A = 7.02:1 → hover #93C5FD + #0F172A = 9.90:1
       深色静止由 #2563EB+白（5.17:1）抬到 #60A5FA+#0F172A（7.02:1）：与同批
       .blog-tag-btn.active / .year-nav-btn.active / 激活语言胶囊 的深色口径一致；且
       #93C5FD 的 hover 必须配深字（配白字只有 1.72:1，会破 AA）。
       ⚠️ 原 S547b 守卫把**双主题**都钉成白字 !important，这里按主题拆分 —— 否则深色新口径
       会被白字反向压回去。 */
    .tag-btn.active,
    .tag-btn.active:hover {
        color: #ffffff !important;
    }
    html.dark .tag-btn.active,
    html.dark .tag-btn.active:hover {
        color: #0F172A !important;
    }
    /* 填充面 + 描边（静止 / hover 各一档，两态可辨且均 ≥4.5:1；浅色静止值与原
       Tailwind bg-accent-dark 完全相同 = 零视觉变化） */
    .tag-btn.active {
        background-color: #2563EB !important;
        border-color: #2563EB !important;
    }
    .tag-btn.active:hover {
        background-color: #1D4ED8 !important;
        border-color: #1D4ED8 !important;
    }
    html.dark .tag-btn.active {
        background-color: #60A5FA !important;
        border-color: #60A5FA !important;
    }
    html.dark .tag-btn.active:hover {
        background-color: #93C5FD !important;
        border-color: #93C5FD !important;
    }
    /* Defensive: if a future Tailwind utility targets the label element directly
       rather than the pill, keep the inherited colour in step with the pill. */
    .tag-btn.active .tag-label,
    .tag-btn.active:hover .tag-label {
        color: #ffffff !important;
    }
    html.dark .tag-btn.active .tag-label,
    html.dark .tag-btn.active:hover .tag-label {
        color: #0F172A !important;
    }
    .tag-count-badge.is-zero {
        opacity: 0.5;
    }
    html.dark .tag-count-badge.is-zero {
        opacity: 0.55;
    }
    /* Copy DOI button — same style as PDF/Abstract/BibTeX links */
    .copy-doi-btn {
        display: inline-flex;
        align-items: center;
        cursor: pointer;
        transition: color 0.2s ease;
        background: transparent;
        border: 0;
        padding: 0;
        font-size: 0.875rem;
        font-weight: 500;
        /* S607：原 var(--text-accent, #3B82F6) —— 该变量全站未定义，实际落回 #3B82F6
           （白底 3.68:1 / 深卡 #1E293B 上 3.99:1，均 < AA 4.5:1）。改用 S554 已批准口径：
           浅色 #2563EB（白底 5.17:1）、深色 #60A5FA（#1E293B 上 5.75:1）；
           hover 各抬一档（#1D4ED8 / #93C5FD），保证与静止态可辨。 */
        color: #2563EB;
    }
    .copy-doi-btn:hover {
        color: #1D4ED8;
    }
    html.dark .copy-doi-btn {
        color: #60A5FA;
    }
    html.dark .copy-doi-btn:hover {
        color: #93C5FD;
    }
    .copy-doi-btn.copied {
        color: #047857; /* S607：原 #059669 白底仅 3.8:1；#047857 = 5.3:1 */
    }
    html.dark .copy-doi-btn.copied {
        color: #6EE7B7; /* 深卡 #1E293B 上 11.4:1 */
    }
    /* Toast: slide-up animation */
    @keyframes toast-slide-up {
        from { opacity: 0; transform: translateY(12px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .animate-slide-up { animation: toast-slide-up 0.3s ease-out; }
    /* S203: hash-target highlight (cross-page navigation landing cue) */
    @keyframes pub-highlight-pulse {
        0% { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.85), 0 0 0 9px rgba(59, 130, 246, 0.28); border-color: #3B82F6; }
        100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); border-color: var(--border); }
    }
    @keyframes pub-highlight-pulse-dark {
        0% { box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.9), 0 0 0 9px rgba(96, 165, 250, 0.32); border-color: #60A5FA; }
        100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0); border-color: var(--border); }
    }
    .pub-card-highlight {
        animation: pub-highlight-pulse 2.5s ease-out forwards;
    }
    html.dark .pub-card-highlight {
        animation-name: pub-highlight-pulse-dark;
    }
    /* Timeline: slim header ribbon */
    .timeline-header {
        display: flex;
        align-items: stretch;
        gap: 0;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 12px;
        overflow: visible;
        height: 56px;
    }
    .timeline-header .timeline-label {
        display: flex;
        align-items: center;
        padding: 0 1rem 0 1.25rem;
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--muted, #B0BEC5);
        border-right: 1px solid var(--border);
        letter-spacing: 0.05em;
        white-space: nowrap;
    }
    #pub-timeline {
        flex: 1;
        min-width: 0;
        position: relative;
    }
    #pub-timeline svg {
        display: block;
        width: 100%;
        height: 56px;
    }
    /* Timeline tooltip */
    .timeline-tooltip {
        position: fixed;
        pointer-events: none;
        background: rgba(30, 41, 59, 0.92);
        color: #F8FAFC;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 11px;
        line-height: 1.5;
        max-width: 280px;
        white-space: normal;
        z-index: 9999;
        transition: opacity 0.15s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }

    /* Year range slider — S261: single-track merge. The two range thumbs ride
       directly on the D3 timeline's thin line (see .timeline-track-wrap /
       .year-range-overlay), so the old separate slider row is gone. */
    .year-range-label {
        display: inline-flex;
        align-items: center;
        align-self: center;
        gap: 0.35rem;
        margin-right: 0.75rem;
        padding: 0.25rem 0.75rem;
        background: rgba(59, 130, 246, 0.12);
        border: 1px solid rgba(59, 130, 246, 0.3);
        border-radius: 8px;
        font-size: 0.8rem;
        font-weight: 600;
        color: #1D4ED8;
        white-space: nowrap;
        letter-spacing: 0.02em;
        flex-shrink: 0;
    }
    /* S629: dark mode keeps the previous #93C5FD accent (light mode now uses
       the S463-approved #1D4ED8 for AA contrast on the translucent accent bg). */
    html.dark .year-range-label {
        color: #93C5FD;
    }
    .year-range-label .range-icon {
        font-size: 0.85rem;
    }
    /* Track wrapper: hosts the D3 SVG and the range-input overlay on one row */
    .timeline-track-wrap {
        position: relative;
        flex: 1;
        min-width: 0;
        display: flex;
    }
    /* Overlay aligned with the D3 dot span (xScale range [8, innerW-8] with
       margin.left=12 / margin.right=16 → dots span from x=20 to x=W-24;
       thumb centers land exactly on the dots: 11+9=20 and (W-15)-9=W-24). */
    .year-range-overlay {
        position: absolute;
        left: 11px;
        right: 15px;
        top: 0;
        bottom: 0;
        pointer-events: none;
        z-index: 5;
    }
    /* Both range inputs overlay on the same single track */
    /* S487 (WCAG 2.5.8 Target Size): the input box overhangs 3px on each side so
       the 24px thumb border-box keeps a pixel-identical center at every value.
       center = trackStart + (trackWidth - thumbSize) * ratio + thumbSize / 2, so
       growing the track by +6px while growing the thumb by +6px cancels exactly
       (measured: both thumb centers stay at 155 / 1091 px, docScrollW unchanged). */
    .year-range-overlay input[type="range"] {
        -webkit-appearance: none;
        appearance: none;
        position: absolute;
        left: -3px;
        right: -3px;
        top: 27px;      /* thumb center = 27 + 9 = 36px = D3 timeline line y */
        height: 18px;
        margin: 0;
        background: transparent;
        outline: none;
        pointer-events: none;
    }
    /* Only thumbs are interactive — this is the standard double-handle pattern */
    .year-range-overlay input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        /* S487 (WCAG 2.5.8): 24px border-box hit target; the 3px transparent
           border + background-clip:padding-box keep the VISIBLE fill at 18px and
           the inset ring reproduces the old 2px #1E293B border in place. */
        width: 24px;
        height: 24px;
        border: 3px solid transparent;
        border-radius: 50%;
        background: #60A5FA;
        background-clip: padding-box;
        cursor: pointer;
        box-shadow: inset 0 0 0 2px #1E293B,
                    0 0 6px -3px rgba(59, 130, 246, 0.4);
        transition: transform 0.15s ease;
        pointer-events: auto;
    }
    .year-range-overlay input[type="range"]::-webkit-slider-thumb:hover {
        transform: scale(1.2);
        background: #93C5FD;
        background-clip: padding-box;
    }
    .year-range-overlay input[type="range"]::-moz-range-thumb {
        /* S487 (WCAG 2.5.8): Firefox parity — same 24px target / 18px fill. */
        width: 24px;
        height: 24px;
        border: 3px solid transparent;
        border-radius: 50%;
        background: #60A5FA;
        background-clip: padding-box;
        cursor: pointer;
        box-shadow: inset 0 0 0 2px #1E293B,
                    0 0 6px -3px rgba(59, 130, 246, 0.4);
        pointer-events: auto;
    }
    /* S532 (WCAG 2.4.7 Focus Visible): the input itself sets outline: none and the
       thumbs only ever had :hover feedback (scale 1.2), so a keyboard user tabbing
       to #year-range-min / #year-range-max got NO visible indication at all — the
       .year-range-bubble is created on input/change only, never on focus.
       Fix: a 3px focus ring painted OUTSIDE the 24px thumb border-box. Pure
       box-shadow ⇒ no layout/reflow/paint-size change, so the S487 24px hit target
       (18px visible fill, 3px transparent border) and the thumb centres (155/1091px
       basis: 27px top + 9px = 36px centre, left/right -3px) stay pixel-identical.
       Ring colour is #3B82F6 in BOTH themes on purpose (S519 lesson — the same ring
       must clear ≥3:1 against each theme's *adjacent* surface):
         light: #3B82F6 on --surface #FFFFFF → 3.68:1  (dark  : #3B82F6 on
                --surface #1E293B → 4.00:1)
       NOTE: the rgba(96,165,250,.9) ring suggested in the S532 ticket only reaches
       2.43:1 on the light surface, i.e. it would still fail the ≥3:1 requirement,
       hence the slightly darker accent blue. */
    .year-range-overlay input[type="range"]:focus-visible::-webkit-slider-thumb {
        box-shadow: inset 0 0 0 2px #1E293B,
                    0 0 0 3px #3B82F6;
    }
    .year-range-overlay input[type="range"]:focus-visible::-moz-range-thumb {
        box-shadow: inset 0 0 0 2px #1E293B,
                    0 0 0 3px #3B82F6;
    }
    /* Firefox would otherwise also paint its own dotted ring around the whole 18px
       input strip on keyboard focus; suppress it in favour of the thumb ring above
       (a replacement indicator, not a removal — WCAG 2.4.7 stays satisfied). */
    .year-range-overlay input[type="range"]:-moz-focusring {
        outline: none;
    }
    /* Selected-range highlight drawn on the D3 line between the two thumbs */
    .year-range-overlay::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: 35px;      /* 2px line centered on the D3 line (y=36) */
        height: 2px;
        border-radius: 1px;
        background: linear-gradient(
            to right,
            transparent var(--year-range-lo-pct, 0%),
            #3B82F6 var(--year-range-lo-pct, 0%),
            #3B82F6 var(--year-range-hi-pct, 100%),
            transparent var(--year-range-hi-pct, 100%)
        );
        pointer-events: none;
    }

    /* S248: Real-time value bubble that follows the dragged thumb */
    .year-range-bubble {
        position: absolute;
        bottom: calc(100% + 4px);
        left: 0;
        transform: translateX(-50%);
        background: rgba(30, 41, 59, 0.95);
        color: #F8FAFC;
        font-size: 11px;
        font-weight: 600;
        line-height: 1;
        padding: 4px 8px;
        border-radius: 6px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        pointer-events: none;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.12s ease;
        z-index: 30;
    }
    .year-range-bubble.visible {
        opacity: 1;
        visibility: visible;
    }
    .year-range-bubble::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: 5px solid transparent;
        border-top-color: rgba(30, 41, 59, 0.95);
    }

    /* S648: ≤480px fix — the two nowrap labels ("📅 时间线" 119px +
       "#year-range-label" 135px) previously ate fixed width in the single-row
       ribbon, squeezing the timeline track to a sliver: at 390px the track was
       only 90px wide, and because getWidth() floors the SVG viewBox at 200 the
       year labels were downscaled to ≈5.9px (320px → ≈1.3px) — unreadable on
       every phone. Fix (方案A, CSS-only): let the track own a FULL row
       (order:3 + flex-basis:100%) so its width is the entire content width
       again (≥ the 200px viewBox floor, so no forced downscaling), and let the
       two labels share the row above (label left, year-range-label right,
       mirroring the desktop ribbon). Colours / radius / borders untouched;
       everything >480px is byte-for-byte unchanged. */
    @media (max-width: 480px) {
        .timeline-header {
            flex-wrap: wrap;
            height: auto;
            justify-content: space-between;
        }
        .timeline-header .timeline-label {
            flex: 0 1 auto;
            min-width: 0;
            border-right: none;
            white-space: normal;
        }
        .timeline-track-wrap {
            flex: 1 1 100%;
            order: 3;
        }
        #year-range-label {
            flex: 0 0 auto;
            margin-top: 0.35rem;
            margin-bottom: 0.35rem;
            margin-right: 0.75rem;
        }
    }

/* ── S666: 无 JS 兜底态 —— 模板默认把 JS 专属控件标 disabled/aria-disabled，
      pub-actions.js 执行后立即移除，正常态零变化。无 JS 时：不再有 pointer /
      hover 暗示可点，也不因 UA 的 disabled 淡化而显得「坏掉」。 ── */
[data-requires-js][aria-disabled="true"] { cursor: default !important; }
[data-requires-js]:disabled { opacity: 1; }
button[data-requires-js]:disabled:hover { color: inherit; }
