/* ===================================================================
   AI-News-Radar 样式表 v2.1
   ───────────────────────────────────────────────────────────────────
   高级感设计系统（Premium UI/UX）：
   · 采用 Tailwind Zinc 质感色系，摒弃生硬纯黑，深沉有呼吸感
   · 毛玻璃面板 (backdrop-filter) 多图层叠加
   · 暗色/亮色双模式（丝滑自适应系统）
   · 独立卡片式新闻布局，搭配悬停微微放大及内发光投影
   · 微交互动画 + 触摸热区精细化优化
   · 双响应式断点 (760 / 480)
   · iOS 安全区域无缝适配
   =================================================================== */

/* ────────────── 设计令牌（亮色模式 - Refined Light） ────────────── */
:root {
    /* 基础结构 */
    --bg: #fafafa;
    /* Zinc 50 */
    --panel: rgba(255, 255, 255, 0.75);
    --panel-solid: #ffffff;

    /* 文本系统 */
    --ink: #18181b;
    /* Zinc 900 */
    --ink-secondary: #3f3f46;
    /* Zinc 700 */
    --muted: #71717a;
    /* Zinc 500 */

    /* 边框与分割线 */
    --line: #e4e4e7;
    /* Zinc 200 */
    --line-strong: #d4d4d8;
    /* Zinc 300 */

    /* 强调色系 */
    --accent: #18181b;
    /* 品牌主张黑 */
    --accent-soft: #f4f4f5;
    /* Zinc 100 */
    --accent-2: #27272a;
    /* Zinc 800 */
    --accent-2-soft: #ffffff;

    /* 组件底色与悬停 */
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-hover: rgba(255, 255, 255, 1);

    /* 几何与投影 */
    --radius: 6px;
    --radius-sm: 4px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.02);
    --shadow-inner-glow: inset 0 1px 0 rgba(255, 255, 255, 0.6);

    /* 动画系统 */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ────────────── 暗色模式令牌（Premium Dark - Zinc Scale） ────────────── */
@media (prefers-color-scheme: dark) {
    :root {
        /* 基础结构 */
        --bg: #09090b;
        /* Zinc 950 - 深邃宇宙黑 */
        --panel: rgba(24, 24, 27, 0.6);
        /* Zinc 900 透明叠层 */
        --panel-solid: #18181b;
        /* Zinc 900 */

        /* 文本系统 */
        --ink: #f4f4f5;
        /* Zinc 100 - 高级白 */
        --ink-secondary: #d4d4d8;
        /* Zinc 300 */
        --muted: #a1a1aa;
        /* Zinc 400 - 不刺眼的柔光灰 */

        /* 边框与分割线 */
        --line: #27272a;
        /* Zinc 800 */
        --line-strong: #3f3f46;
        /* Zinc 700 */

        /* 强调色系 */
        --accent: #f4f4f5;
        /* 品牌主张白 */
        --accent-soft: rgba(39, 39, 42, 0.6);
        /* Zinc 800 强调基底 */
        --accent-2: #e4e4e7;
        /* Zinc 200 */
        --accent-2-soft: rgba(24, 24, 27, 0.8);

        /* 组件底色与悬停 */
        --card-bg: rgba(24, 24, 27, 0.4);
        --card-hover: rgba(39, 39, 42, 0.7);
        /* Zinc 800 Highlight */

        /* 阴影与发光（暗黑模式去实体阴影，增内部反光边缘） */
        --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.5);
        --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.6);
        --shadow-lg: 0 16px 24px rgba(0, 0, 0, 0.8);
        --shadow-inner-glow: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 0 20px rgba(255, 255, 255, 0.015);
    }

    body {
        background: var(--bg);
        color: var(--ink);
    }

    body::before {
        opacity: 0.1;
        /* 恢复暗黑纹理背景但极致微弱 */
        background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.15) 0.5px, transparent 0);
    }

    .orb-a,
    .orb-b {
        /* 保留暗光球但更深邃内敛 */
        opacity: 0.12;
        mix-blend-mode: screen;
        filter: blur(80px);
    }

    .orb-a {
        background: #5a3ca6;
    }

    /* 暗紫微光 */
    .orb-b {
        background: #2f657a;
    }

    /* 蓝绿幽光 */

    .hero {
        background: radial-gradient(120% 120% at 50% 0%, rgba(24, 24, 27, 0.8) 0%, rgba(9, 9, 11, 0.95) 100%);
        box-shadow: var(--shadow-lg), var(--shadow-inner-glow);
        border: 1px solid rgba(255, 255, 255, 0.08);
        /* 极细边线分割 */
    }

    .hero-logo {
        background: rgba(24, 24, 27, 0.9);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    }

    .stat {
        background: var(--card-bg);
        border-color: rgba(255, 255, 255, 0.06);
        box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    }

    input,
    select {
        background: rgba(24, 24, 27, 0.6);
        color: var(--ink);
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    input:focus,
    select:focus {
        background: rgba(39, 39, 42, 0.8);
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05), inset 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .mode-switch,
    .waytoagi-switch {
        background: rgba(24, 24, 27, 0.8);
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .mode-btn.active,
    .waytoagi-btn.active {
        background: rgba(63, 63, 70, 0.6);
        /* Zinc 700 柔光激活 */
        color: #fff;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    .all-dedupe {
        background: rgba(24, 24, 27, 0.8);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .list-wrap,
    .waytoagi-wrap {
        background: var(--panel);
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: var(--shadow-md), var(--shadow-inner-glow);
    }

    .waytoagi-head,
    .list-head,
    .site-group-head,
    .source-group-head {
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }

    .waytoagi-error {
        color: #fca5a5;
        /* Red 300 */
        background: rgba(153, 27, 27, 0.2);
        border-color: rgba(220, 38, 38, 0.3);
    }
}

/* ────────────── 全局重置 ────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Georgia", "Times New Roman", "Noto Serif SC", serif;
    /* 切换到严肃衬线体 */
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.15;
    background-image: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.3) 0.5px, transparent 0);
    background-size: 4px 4px;
    z-index: 0;
}

/* ────────────── 装饰光球 ────────────── */
.bg-orb {
    position: fixed;
    border-radius: 999px;
    filter: blur(60px);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

.orb-a {
    width: 320px;
    height: 320px;
    background: #e06748;
    top: -100px;
    left: -80px;
}

.orb-b {
    width: 360px;
    height: 360px;
    background: #5bb8b0;
    right: -100px;
    top: 100px;
}

/* ────────────── 主容器 ────────────── */
.shell {
    position: relative;
    z-index: 1;
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 20px 56px;
}

@supports(padding: max(0px)) {
    .shell {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(56px, env(safe-area-inset-bottom));
    }
}

/* ────────────── Hero 头部 ────────────── */
.hero {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.75),
            rgba(255, 248, 240, 0.7));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px 30px;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: fade-up 500ms var(--transition-fast);
}

.hero-headline {
    display: flex;
    gap: 16px;
    align-items: center;
}

.hero-logo {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.hero-tag {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.8;
}

.hero h1 {
    margin: 6px 0 0;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: clamp(24px, 3.5vw, 42px);
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--ink) 60%, var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    max-width: 680px;
    line-height: 1.7;
}

/* ────────────── 统计卡片 ────────────── */
.stats {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.stat {
    border: 1px solid var(--line);
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    backdrop-filter: blur(8px);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat .k {
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.stat .v {
    margin-top: 4px;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ink), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ────────────── 控制栏 ────────────── */
.controls {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(150px, 0.5fr) auto auto;
    gap: 10px;
    align-items: center;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.75);
    color: var(--ink);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    backdrop-filter: blur(6px);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px var(--accent-2-soft);
}

.updated {
    justify-self: end;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

/* ────────────── 模式切换按钮 ────────────── */
.mode-switch {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(6px);
}

.mode-btn {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    position: relative;
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--accent-soft), var(--accent-2-soft));
    color: var(--ink);
    font-weight: 700;
}

.mode-btn:active {
    transform: scale(0.96);
}

/* ────────────── 去重开关 ────────────── */
.all-dedupe {
    display: none;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    user-select: none;
    min-height: 44px;
    transition: transform var(--transition-fast);
    backdrop-filter: blur(6px);
}

.all-dedupe:active {
    transform: scale(0.96);
}

.all-dedupe.show {
    display: inline-flex;
}

.all-dedupe input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.all-dedupe-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    background: transparent;
    transition: all var(--transition-fast);
}

.all-dedupe input:checked+.all-dedupe-dot {
    border-color: var(--accent-2);
    background: var(--accent-2);
    box-shadow: 0 0 0 2px var(--accent-2-soft);
}

.mode-hint {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

/* ────────────── 站点标签 (Premium Pills) ────────────── */
.site-pills {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill {
    position: relative;
    border: 1px solid var(--line);
    background: var(--card-bg);
    color: var(--ink-secondary);
    border-radius: 999px;
    padding: 6px 14px 6px 18px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-normal);
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.pill-count {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--muted);
    transition: all var(--transition-fast);
}

@media (prefers-color-scheme: dark) {
    .pill {
        border-color: rgba(255, 255, 255, 0.05);
        background: rgba(39, 39, 42, 0.5);
        /* Zinc 800 */
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }

    .pill-count {
        background: rgba(255, 255, 255, 0.08);
    }
}

.pill:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
    background: var(--card-hover);
    transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
    .pill:hover {
        border-color: rgba(255, 255, 255, 0.12);
        background: rgba(63, 63, 70, 0.65);
        /* Zinc 700 */
    }
}

.pill:active {
    transform: scale(0.97);
}

.pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

@media (prefers-color-scheme: dark) {
    .pill.active {
        background: var(--ink);
        color: var(--bg);
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    }
}

.pill.active .pill-count {
    background: rgba(255, 255, 255, 0.2);
    color: var(--bg);
}

@media (prefers-color-scheme: dark) {
    .pill.active .pill-count {
        background: rgba(0, 0, 0, 0.15);
        color: var(--bg);
    }
}

/* --- 柔化错误状态标志 --- */
.pill.has-error {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.06);
    color: rgba(200, 50, 50, 0.9);
}

@media (prefers-color-scheme: dark) {
    .pill.has-error {
        border-color: rgba(239, 68, 68, 0.2);
        background: rgba(239, 68, 68, 0.1);
        color: rgba(245, 110, 110, 0.9);
    }
}

.pill.has-error .pill-count {
    color: rgba(239, 68, 68, 0.8);
    background: rgba(239, 68, 68, 0.1);
}

.pill.has-error.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #ef4444;
    color: #fff;
}

.pill.has-error.active .pill-count {
    color: #fff;
    background: rgba(255, 255, 255, 0.25);
}

.pill-error-icon {
    font-size: 13px;
    margin-left: 2px;
    filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.3));
    animation: gentle-pulse 2s infinite ease-in-out;
}

@keyframes gentle-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* ────────────── 新闻列表外壳 ────────────── */
.list-wrap {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    backdrop-filter: blur(12px);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.list-head {
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid var(--line);
}

.list-head h2 {
    margin: 0;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 20px;
    font-weight: 700;
}

#resultCount {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.news-list {
    display: grid;
}

/* ────────────── 站点 & 来源分组 ────────────── */
.site-group {
    border-top: 1px solid var(--line);
}

.site-group:first-child {
    border-top: 0;
}

.site-group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--line);
}

.site-group-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    font-family: "Bricolage Grotesque", sans-serif;
}

.site-group-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.site-group-list {
    display: grid;
}

.source-group {
    border-top: 1px solid var(--line);
}

.source-group:first-child {
    border-top: 0;
}

.source-group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 22px;
    background: var(--accent-2-soft);
    border-bottom: 1px solid var(--line);
}

.source-group-head h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.source-group-head span {
    color: var(--muted);
    font-size: 12px;
}

.source-group-list {
    display: grid;
}

/* ────────────── 新闻卡片（核心视觉 -> 传统图文混排） ────────────── */
.news-card {
    padding: 16px 22px;
    border-top: 1px solid var(--line);
    transition: all var(--transition-normal);
    animation: fade-up 280ms ease;
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    align-items: flex-start;
    background: transparent;
}

.news-card-content {
    flex: 1;
    min-width: 0;
}

.news-card:first-child {
    border-top: 0;
}

.news-card:hover {
    background: var(--card-hover);
    transform: translateX(4px);
}

/* 元信息行 */
.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-family: inherit;
    /* 无衬线细节 */
}

.site {
    font-weight: 700;
    color: var(--ink);
}

.source {
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: 2px;
    font-size: 10px;
    background: var(--card-bg);
}

.time {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

/* 标题 */
.title {
    margin-top: 8px;
    display: block;
    color: var(--ink);
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    transition: color var(--transition-fast);
}

.title-sub {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
    font-weight: 400;
    font-family: "Helvetica Neue", "Noto Sans SC", sans-serif;
    display: block;
    margin-top: 4px;
}

.title:hover {
    color: var(--muted);
    text-decoration: underline;
}

/* ────────────── 摘要 & 封面图 ────────────── */
.card-summary {
    margin: 8px 0 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-thumb {
    width: 140px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    border: 1px solid var(--line);
    margin-top: 4px;
    opacity: 0;
    animation: thumb-in 400ms ease forwards;
}

@keyframes thumb-in {
    from {
        opacity: 0;
        transform: scale(0.97);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pop-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ────────────── Image Lightbox (Elegant & Mobile-friendly) ────────────── */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content-wrapper {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.95);
    transition: transform var(--transition-normal) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-overlay.active .lightbox-content-wrapper {
    transform: scale(1);
}

.lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: all var(--transition-fast);
    backdrop-filter: blur(4px);
    padding: 0;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.lightbox-close:active {
    transform: scale(0.95);
}

@media (max-width: 760px) {
    .lightbox-content-wrapper {
        max-width: 100vw;
        max-height: 100vh;
        width: 100%;
        height: 100%;
        justify-content: center;
        border-radius: 0;
    }
    .lightbox-img {
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }
    .lightbox-close {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 24px;
        background: rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
}

.empty {
    padding: 32px 22px;
    color: var(--muted);
    text-align: center;
    font-size: 14px;
}

/* ────────────── WaytoAGI 区域 ────────────── */
.waytoagi-wrap {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    backdrop-filter: blur(12px);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.waytoagi-head {
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.waytoagi-head h2 {
    margin: 0;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 20px;
    font-weight: 700;
}

#waytoagiUpdatedAt {
    color: var(--muted);
    font-size: 12px;
}

.waytoagi-tools {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.waytoagi-switch {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(6px);
}

.waytoagi-btn {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.waytoagi-btn:active {
    transform: scale(0.96);
}

.waytoagi-btn.active {
    background: linear-gradient(135deg, var(--accent-soft), var(--accent-2-soft));
    color: var(--ink);
    font-weight: 700;
}

.waytoagi-meta {
    padding: 14px 22px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

.waytoagi-meta a {
    color: var(--accent-2);
    text-decoration: none;
    font-weight: 500;
}

.waytoagi-meta a:hover {
    text-decoration: underline;
}

.waytoagi-list {
    padding: 14px 22px 22px;
    display: grid;
    gap: 8px;
}

.waytoagi-item {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px;
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--ink);
    background: var(--card-bg);
    transition: all var(--transition-normal);
}

.waytoagi-item:hover {
    background: var(--card-hover);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.waytoagi-item:active {
    transform: scale(0.99);
}

.waytoagi-item .d {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.waytoagi-item .t {
    font-size: 13px;
    line-height: 1.45;
    font-weight: 500;
}

.waytoagi-empty {
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--muted);
    font-size: 13px;
}

.waytoagi-error {
    border: 1px solid rgba(183, 28, 28, 0.25);
    background: rgba(183, 28, 28, 0.06);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: #7b1717;
    font-size: 13px;
}

/* ────────────── 响应式：平板 (≤760px) ────────────── */
@media (max-width: 760px) {
    .shell {
        padding: 16px 14px 40px;
    }

    .hero {
        padding: 20px;
        border-radius: 20px;
    }

    .hero-logo {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

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

    .updated {
        justify-self: start;
    }

    .time {
        margin-left: 0;
    }

    .waytoagi-head {
        align-items: flex-start;
        gap: 10px;
        flex-direction: column;
    }

    /* 触摸热区 */
    input,
    select {
        min-height: 48px;
        font-size: 16px;
    }

    .mode-btn {
        padding: 12px 18px;
    }

    .pill {
        padding: 10px 18px;
        min-height: 44px;
    }

    .news-card {
        padding: 14px 16px;
    }

    /* 站点标签横向滚动 */
    .site-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 6px;
        margin-left: -14px;
        margin-right: -14px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .site-pills::-webkit-scrollbar {
        display: none;
    }

    .pill {
        flex-shrink: 0;
    }
}

/* ────────────── 响应式：手机 (≤480px) ────────────── */
@media (max-width: 480px) {
    .shell {
        padding: 12px 10px 36px;
    }

    .hero {
        padding: 16px;
        border-radius: 16px;
    }

    .hero h1 {
        font-size: 22px;
    }

    .hero-logo {
        width: 42px;
        height: 42px;
    }

    .stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .stat {
        padding: 10px 10px;
    }

    .stat .v {
        font-size: 20px;
    }

    .stat .k {
        font-size: 10px;
    }

    .list-head h2,
    .waytoagi-head h2 {
        font-size: 17px;
    }

    .news-card {
        padding: 12px 14px;
    }

    .waytoagi-item {
        grid-template-columns: 56px 1fr;
    }

    .card-thumb {
        max-width: 100%;
    }
}

/* ────────────── 动画 ────────────── */
@keyframes fade-up {
    from {
        transform: translateY(6px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}