/* ============================================================
   前端导航页样式（暗色 · 科技感 · 扁平化）
   说明：已按你的要求删除顶部栏（品牌名 / 搜索框 / 后台管理）
   手机 / 电脑同一套居中布局，扁平卡片 + 科技背景（网格 + 光晕 + 扫描线）
   ============================================================ */
:root {
    --bg: #070b14;
    --panel: #0f1626;
    --panel-2: #16203a;
    --border: #22304f;
    --text: #e8edf7;
    --muted: #8b97b3;
    --accent: #4f8cff;
    --accent-2: #b794f6;
    --good: #36d399;
    --mid: #fbbd23;
    --bad: #f87272;
    --backup: #b794f6;
}

* { box-sizing: border-box; }

/* 科技感背景：深空底色 + 两层冷/紫光晕 + 细网格（纯 CSS，无需图片） */
body {
    margin: 0;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    color: var(--text);
    min-height: 100vh;
    /* 让内容在整屏里垂直居中（内容超过一屏时自动从顶部排开、可滚动） */
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    background-image:
        radial-gradient(900px 600px at 18% 8%,  rgba(79,140,255,.22), transparent 60%),
        radial-gradient(800px 600px at 88% 96%, rgba(183,148,246,.20), transparent 60%),
        linear-gradient(rgba(120,160,255,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120,160,255,.05) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 42px 42px, 42px 42px;
    background-attachment: fixed;
    overflow-x: hidden;
}

/* 缓慢漂移的柔光，增强“科技”氛围（不影响内容、不吃性能） */
body::before {
    content: "";
    position: fixed;
    inset: -20%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(420px 420px at 30% 30%, rgba(79,140,255,.10), transparent 70%),
        radial-gradient(380px 380px at 70% 70%, rgba(183,148,246,.10), transparent 70%);
    animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
    from { transform: translate3d(-2%, -1%, 0) scale(1); }
    to   { transform: translate3d(2%, 2%, 0)  scale(1.06); }
}

/* 自上而下缓慢扫过的光线，增加“数据流 / 扫描”科技感（极淡，不干扰阅读） */
body::after {
    content: "";
    position: fixed;
    left: 0; right: 0; top: -40%;
    height: 40%;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(to bottom,
        transparent,
        rgba(79,140,255,.06) 45%,
        rgba(183,148,246,.10) 50%,
        transparent);
    animation: scan 7s linear infinite;
}
@keyframes scan {
    from { transform: translateY(0); }
    to   { transform: translateY(350%); }
}

/* 统一居中容器：手机与电脑完全一致（同一最大宽度、同一居中方式、同一扁平风格）
   PC 端收窄到 760px，让 3 列每列更精致不显宽；手机屏本就 <760，自动满屏不受影响 */
main {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 760px;
    margin: auto;            /* 配合 body flex → 整体水平+垂直居中 */
    padding: 28px 18px 64px;
}

/* 分类（手机/电脑标题都居中，保持一致） */
.category { margin-top: 14px; }   /* 上间距收窄，标题整体往上提 */
.category:first-child { margin-top: 0; }
.category h2 {
    font-size: 21px;             /* 分类标题字号加大 */
    margin: 0 0 16px;
    color: var(--text);
    font-weight: 600;
    text-align: center;
    letter-spacing: 2px;
}
/* 标题下方一条居中的渐变短线，扁平但有科技点缀；带呼吸光晕
   （仅主标题带短线，副标题 .cat-sub 不加） */
.category h2:not(.cat-sub)::after {
    content: "";
    display: block;
    width: 46px; height: 3px;
    margin: 8px auto 0;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 12px rgba(79,140,255,.6);
    animation: linePulse 2.4s ease-in-out infinite;
}
@keyframes linePulse {
    0%, 100% { opacity: .65; box-shadow: 0 0 8px rgba(79,140,255,.4); }
    50%      { opacity: 1;   box-shadow: 0 0 16px rgba(79,140,255,.8); }
}

/* 分类副标题：显示在分类名下方的第二行 h2，更大、加粗、红色、居中，
   用于强调这一句说明（主标题=名称+短线，副标题=醒目红字说明） */
.category h2.cat-sub {
    font-size: 18px;            /* 副标题字号加大（比之前 15px 更大） */
    font-weight: 700;           /* 加粗 */
    letter-spacing: 1px;
    color: #ff5c5c;             /* 红色（暗色背景下更醒目） */
    margin: -4px 0 14px;   /* 上移一点，贴近主标题下方的短线；下边距给卡片网格留白 */
    text-align: center;
    animation: catShake 0.5s ease-in-out infinite;  /* 左右轻微抖动，吸引注意 */
}
/* 副标题抖动：左右小幅晃动（幅度 2px），循环播放且不晃眼 */
@keyframes catShake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-2px); }
    50%      { transform: translateX(2px); }
    75%      { transform: translateX(-1px); }
}
/* 手机端副标题：同步放大加粗，但略小于桌面端 */
@media (max-width: 768px) {
    .category h2.cat-sub { font-size: 16px; margin: -2px 0 12px; }
}

/* 卡片网格：统一 2 列 + 1fr（占容器百分比）→ PC/手机都按屏幕百分比自适应缩放。
   每列 ≈ 容器宽的 1/2（50%），minmax(0,1fr) 防止内容把列撑破；
   justify-content:center 让整组居中 */
.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: center;
    gap: 10px;
}

/* 扁平化卡片：纯色面板 + 细边框，无重阴影；图标在左，文字在右（尺寸调小） */
.card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 12px;
    text-align: left;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    position: relative;
    overflow: hidden;
    transition: border-color .18s, background-color .18s, box-shadow .18s;
    animation: cardIn .5s ease both;
}
/* 入场动画：淡入 + 轻微上移，营造“逐块点亮”的科技感 */
@keyframes cardIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
/* 扁平 hover：边框发光 + 淡蓝辉光（不 3D 抬升，保持扁平） */
.card:hover {
    border-color: var(--accent);
    background: var(--panel-2);
    box-shadow: 0 0 18px rgba(79,140,255,.28);
}
.card.checking { border-color: var(--accent); }
@keyframes pulse { 0%, 100% { border-color: var(--accent); } 50% { border-color: var(--border); } }
.card.checking { animation: cardIn .5s ease both, pulse 1s infinite; }

.fav { width: 28px; height: 28px; border-radius: 7px; flex: 0 0 28px; }
.fav-letter {
    width: 28px; height: 28px; border-radius: 7px; flex: 0 0 28px;
    background: var(--panel-2); color: var(--accent);
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 0 1 auto; max-width: 100%; align-items: center; }
.title { font-size: 13px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 探测状态：统一用「小圆点」表示，不显示任何文字，低调不抢眼 */
.speed {
    position: absolute; top: 6px; right: 6px;
    width: 5px; height: 5px; padding: 0; margin: 0;
    border: none; border-radius: 50%;
    background: transparent;
    font-size: 0;            /* 彻底隐藏“OK / 正常 / 不通”等文字 */
    line-height: 1;
}
.speed::before {
    content: ""; display: block;
    width: 5px; height: 5px; border-radius: 50%;
    box-sizing: border-box;
}
/* 主站正常 → 绿色小点（5px，半透明，不抢眼） */
.speed.good::before  { background: rgba(54,211,153,.55); box-shadow: 0 0 4px rgba(54,211,153,.28); }
/* 主站不通、副站正常 → 红色小点（5px，半透明，不抢眼） */
.speed.backup::before { background: rgba(248,114,114,.55); box-shadow: 0 0 4px rgba(248,114,114,.28); }
/* 主备都不通 → 什么都不显示 */
.speed.bad { display: none; }
/* 探测中：一个很淡的灰点轻轻呼吸，仅作“正在检测”提示 */
.speed.probing::before { background: var(--muted); animation: dotPulse 1.2s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { opacity: .22; } 50% { opacity: .6; } }

/* 手机 / 平板：与电脑保持同一套居中扁平风格，仅微调列数与间距 */
@media (max-width: 768px) {
    main { padding: 22px 14px 52px; }
    .category { margin-top: 12px; }
    .category h2 { font-size: 19px; }   /* 手机端标题字号加大 */
    /* 手机端固定每行 2 个，每列占屏 1/2（百分比自适应），整体更小巧 */
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .card { padding: 10px 8px; gap: 7px; }
    .fav, .fav-letter { width: 26px; height: 26px; flex: 0 0 26px; }
    .title { font-size: 12px; }
}

/* 尊重“减少动效”系统偏好：关掉扫描线与入场动画，避免晕眩 */
@media (prefers-reduced-motion: reduce) {
    body::before, body::after { animation: none; }
    .card { animation: none; }
    .category h2::after { animation: none; }
    .category h2.cat-sub { animation: none; }  /* 关闭副标题抖动，避免晕眩 */
}
