/* ============================================================
   萌鸢阁 · game 站 —— 全新样式「深海极光 Aurora」
   设计基调：深蓝黑 + 极光青 × 紫罗兰，玻璃拟态，双主题（亮/暗）
   2026-09-09 重写
   ============================================================ */

/* ========== Reset & Base ========== */
a, body, div, footer, h1, h2, h3, h4, h5, h6,
header, html, i, img, menu, nav, p, ul, li {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    list-style: none;
}

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

a {
    text-decoration: none;
    color: inherit;
    /* 原来这里写了 -webkit-user-select:none + -webkit-touch-callout:none，
       等于全站链接文字都不能选中/长按复制，站名、备注都复制不了，已去掉 */
    outline: none;
    transition: color .15s ease;
}

html {
    font-size: 62.5%; /* 1rem = 10px */
    overflow-x: hidden;
}

body {
    position: relative;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    font-size: 1.5rem;
    color: var(--text-primary);
    background-color: var(--bg);
    background-image:
        radial-gradient(900px 480px at 12% -8%, var(--glow-a), transparent 60%),
        radial-gradient(800px 420px at 108% 12%, var(--glow-b), transparent 55%);
    background-attachment: fixed;
    transition: background-color .3s, color .3s;
}

/* ========== Design Tokens（亮色 · 默认） ========== */
:root {
    /* 背景 */
    --bg: #eef2f9;
    --glow-a: rgba(6, 182, 212, 0.14);
    --glow-b: rgba(139, 92, 246, 0.12);

    /* 卡片 */
    --card-bg: rgba(255, 255, 255, 0.82);
    --card-bg-solid: #ffffff;
    --card-border: rgba(100, 116, 139, 0.20);
    --card-border-strong: rgba(8, 145, 178, 0.45);
    --header-bg: rgba(255, 255, 255, 0.72);

    /* 文字（对比度达标） */
    --text-primary: #0f172a;
    --text-secondary: #5b6b84;
    --text-item: #1e293b;
    --text-muted: #93a3b8;
    --text-on-accent: #ffffff;

    /* 主色 */
    --accent: #0891b2;
    --accent-2: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    --accent-soft: rgba(8, 145, 178, 0.12);
    --accent-ring: rgba(8, 145, 178, 0.35);

    /* 阴影 */
    --shadow-card: 0 6px 24px rgba(15, 23, 42, 0.07);
    --shadow-hover: 0 12px 32px rgba(8, 145, 178, 0.16), 0 0 0 1px rgba(8, 145, 178, 0.25);
    --shadow-icon: 0 2px 8px rgba(15, 23, 42, 0.12);

    /* 圆角 */
    --radius-icon: 10px;
    --radius-badge: 12px;
    --radius-card: 16px;
    --radius-section: 20px;

    /* 搜索框 */
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: rgba(100, 116, 139, 0.28);
    --placeholder: #a7b3c5;

    /* 标签/横幅 */
    --tag-bg: #ffffff;
    --banner-bg: #fff8e1;
    --banner-border: #ffe082;
    --banner-text: #a16207;

    /* 图片占位底：index.php 里 style="background-image:var(--img-placeholder)" 用到，
       之前这个变量一直没定义，那行内联样式等于无效 */
    --img-placeholder: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);

    /* 浮层 */
    --float-bg: rgba(255, 255, 255, 0.9);
    --float-border: rgba(100, 116, 139, 0.18);
    --float-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);
    --float-tip-bg: #0f172a;
    --float-tip-text: #f1f5f9;

    /* 滚动条 */
    --scrollbar: rgba(100, 116, 139, 0.35);
    --scrollbar-hover: rgba(8, 145, 178, 0.5);
}

/* ========== Design Tokens（暗色 · body.dark-mode） ========== */
body.dark-mode {
    --bg: #0b1220;
    --glow-a: rgba(34, 211, 238, 0.13);
    --glow-b: rgba(167, 139, 250, 0.10);

    --card-bg: rgba(17, 25, 42, 0.72);
    --card-bg-solid: #111926;
    --card-border: rgba(148, 163, 184, 0.14);
    --card-border-strong: rgba(34, 211, 238, 0.5);
    --header-bg: rgba(11, 18, 32, 0.78);

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-item: #cbd5e1;
    --text-muted: #7f8ea6;       /* 原来 #475569 在深色底上几乎看不清（对比度不足） */
    --text-on-accent: #06121f;

    --accent: #22d3ee;
    --accent-2: #a78bfa;
    --accent-gradient: linear-gradient(135deg, #22d3ee 0%, #a78bfa 100%);
    --accent-soft: rgba(34, 211, 238, 0.14);
    --accent-ring: rgba(34, 211, 238, 0.4);

    --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 12px 36px rgba(34, 211, 238, 0.14), 0 0 0 1px rgba(34, 211, 238, 0.3);
    --shadow-icon: 0 2px 8px rgba(0, 0, 0, 0.4);

    --input-bg: rgba(17, 25, 42, 0.85);
    --input-border: rgba(148, 163, 184, 0.22);
    --placeholder: #5b6b84;

    --tag-bg: #1a2436;
    --banner-bg: rgba(255, 200, 80, 0.10);
    --banner-border: rgba(255, 200, 80, 0.28);
    --banner-text: #fbbf24;

    --img-placeholder: linear-gradient(135deg, #1a2436 0%, #111926 100%);

    --float-bg: rgba(17, 25, 42, 0.9);
    --float-border: rgba(148, 163, 184, 0.16);
    --float-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    --float-tip-bg: #e2e8f0;
    --float-tip-text: #0f172a;

    --scrollbar: rgba(148, 163, 184, 0.3);
    --scrollbar-hover: rgba(34, 211, 238, 0.6);
}

/* ========== Layout ========== */
header {
    width: 100%;
    height: 64px;
    background: var(--header-bg);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.06);
    transition: background 0.3s;
}

.max {
    max-width: 1100px;
    margin: 0 auto;
}

.flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    justify-content: center !important;
}

.header {
    height: 64px;
    position: relative;
}

.header h1 {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    transition: background 0.3s;
}

.back-home-link {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.5rem;
    transition: background 0.25s, transform 0.25s;
}

.back-home-link:hover {
    background: var(--accent);
    color: var(--text-on-accent);
    transform: translateY(-50%) rotate(-15deg);
}

main.max {
    padding: 8px 14px 40px;
}

/* ========== 搜索框 ========== */
.search-container {
    max-width: 600px;
    margin: 26px auto 28px;
    position: relative;
}

.search-input {
    width: 100%;
    /* 右侧要同时容纳「清除 ✕」和「搜索图标」，原来 padding-right:56px 比按钮占位少了，
       输入到末尾的文字会压在按钮下面（约 2px 重叠） */
    padding: 15px 52px 15px 22px;
    font-size: 16px;
    border: 2px solid var(--input-border);
    border-radius: 30px;
    outline: none;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
    box-shadow: var(--shadow-card);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-card);
}

.search-input::placeholder {
    color: var(--placeholder);
}

.search-icon {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 17px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-muted);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 12px;
    line-height: 22px;
    display: none;
    color: var(--card-bg-solid);
    text-align: center;
    padding: 0;
    transition: background 0.2s;
}

/* 有输入内容时隐藏放大镜、只留 ✕，两个控件不再挤在同一处 */
.search-container.has-value .search-icon {
    display: none;
}

.search-note {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 5px;
}

.empty-hint {
    text-align: center;
    color: var(--text-muted);
}

.cat-name {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.search-clear:hover {
    background: var(--accent);
}

.search-no-result {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
    display: none;
    font-size: 15px;
}

.search-no-result span {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

mark {
    background: rgba(250, 204, 21, 0.35);
    color: var(--text-primary);
    padding: 1px 4px;
    border-radius: 4px;
}

.search-count {
    text-align: center;
    color: var(--accent);
    font-size: 13px;
    margin-bottom: 15px;
    display: none;
    font-weight: 600;
}

/* ========== App 区块卡片 ========== */
.app {
    width: 100%;
    padding: 18px 14px 16px;
    margin: 0 auto 14px;
    background: var(--card-bg);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-radius: var(--radius-section);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-card);
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.app-meta {
    padding: 6px 4px 20px;
}

.app-meta .section-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-primary);
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-meta .section-title i {
    font-size: 1.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.app-meta .section-desc {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-top: 4px;
    transition: color 0.3s;
}

.app ul[data-item-list] {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start !important;
    gap: 14px 12px;
}

/* ========== 条目卡片 ========== */
.app-item {
    position: relative;
    display: flex;            /* 修：原来缺 display:flex，下面的 align-items / gap 全是死代码 */
    width: calc(50% - 6px);
    margin: 0;
    padding: 13px 14px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-card);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.25s, background 0.25s, border-color 0.25s;
    cursor: pointer;
    align-items: center;
    gap: 11px;
}

.app-item:hover {
    transform: translateY(-4px);
    background: var(--card-bg);
    border-color: var(--card-border-strong);
    box-shadow: var(--shadow-hover);
}

/* 条目内的 <a> 占满剩余宽度：
   否则「最近浏览」里的 ✕ 删除按钮会掉到下一行，而不是整行右侧 */
.app-item > a.flex {
    flex: 1 1 auto;
    min-width: 0;
    /* 修：改成网格布局——图标 | 标题/备注 | 箭头。
       标题可以折行，备注固定占第二行并自动折行，箭头始终垂直居中，不会被挤到下一行 */
    display: grid;
    grid-template-columns: auto 1fr 16px;
    grid-template-areas:
        "icon title arrow"
        "icon remark arrow";
    align-items: center;
    align-content: center;
    column-gap: 11px;
    row-gap: 5px;
}

.app-item-img {
    width: 34px;
    height: 34px;
    grid-area: icon;
    align-self: center;
    border-radius: var(--radius-icon);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-icon);
    object-fit: cover;
    background-color: var(--tag-bg);
}

.app-item .app-item-title {
    grid-area: title;
    min-width: 0;             /* 修：flex/grid 子项默认 min-width:auto，会让长标题顶出卡片 */
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-item);
    transition: color 0.3s;
    /* 修：原来 white-space:nowrap 把长标题压成一行省略号，看着像「没换行」；
       现在允许折行，最多两行再省略 */
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.app-item .app-item-title:hover {
    color: var(--accent);
}

.app-item > a.flex > i {
    grid-area: arrow;
    align-self: center;
    justify-self: end;
    font-size: 1.6rem;
    color: var(--text-muted);
    transition: color 0.25s, transform 0.25s;
    flex-shrink: 0;
}

.app-item:hover > a.flex > i {
    color: var(--accent);
    transform: translateX(2px);
}

/* 备注标签组（条目内） */
.app-item .remark-tags {
    grid-area: remark;
    justify-self: start;
    margin-left: 0;
    margin-top: 0;
    /* 修：备注固定占第二行，多个标签在这行里自动折行，不再被标题挤成一条缝或被裁掉 */
    max-width: 100%;
    overflow: visible;
    line-height: 1.5;
}

.app-item .remark-tag {
    max-width: 100%;
    white-space: normal;        /* 单条备注太长时在胶囊内折行，而不是省略号截断 */
    overflow-wrap: anywhere;
}

/* ========== PC ≥768px ========== */
@media screen and (min-width: 768px) {
    .app-item {
        width: calc(25% - 9px);
    }
}

/* ========== 手机（≤480px）：两列太窄会把标题和备注标签一起挤坏，改单列 ========== */
@media screen and (max-width: 480px) {
    .app-item {
        width: 100%;
    }
    .app-item .remark-tags {
        max-width: 100%;
    }
    .app-item .app-item-title {
        -webkit-line-clamp: 3;   /* 手机窄屏允许标题折到三行 */
    }
}

/* ========== Badge & 计数 ========== */
.special-section .app-meta .section-title .badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 10px;
    margin-left: 2px;
    vertical-align: middle;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge-new {
    background: rgba(46, 125, 50, 0.12);
    color: #2e7d32;
    border: 1px solid rgba(46, 125, 50, 0.25);
}

body.dark-mode .badge-new {
    background: rgba(74, 222, 128, 0.14);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.3);
}

.badge-hot {
    background: rgba(220, 38, 38, 0.10);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.22);
}

body.dark-mode .badge-hot {
    background: rgba(248, 113, 113, 0.14);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}

.click-count {
    display: inline-block;
    font-size: 11px;
    color: #fff;
    background: linear-gradient(135deg, #f43f5e, #fb7185);
    padding: 1px 7px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
    font-weight: 700;
}

/* ========== 备注标签 ========== */
.remark-tags {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
}

.remark-tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
    background: var(--tag-bg);
    border: 1px solid transparent;
}

/* 分类级备注横幅 */
.cat-remark-banner {
    background: var(--banner-bg);
    border: 1px solid var(--banner-border);
    color: var(--banner-text);
    font-size: 12px;
    padding: 7px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

/* ========== 分类密码保护 ========== */
.locked-category {
    position: relative;
    overflow: hidden;
}

.locked-overlay {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 52px 30px;
    text-align: center;
    border-radius: var(--radius-card);
    border: 2px dashed var(--card-border-strong);
}

.locked-overlay .lock-icon {
    font-size: 52px;
    margin-bottom: 15px;
    display: block;
}

.locked-overlay h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.locked-overlay p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 20px 0;
}

.locked-overlay .lock-form {
    max-width: 320px;
    margin: 0 auto;
}

.locked-overlay input[type="password"] {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid var(--input-border);
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: border-color 0.3s, box-shadow 0.3s;
    -webkit-appearance: none;
    text-align: center;
}

.locked-overlay input[type="password"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.locked-overlay button {
    width: 100%;
    margin-top: 12px;
    padding: 13px;
    background: var(--accent-gradient);
    color: var(--text-on-accent);
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    -webkit-appearance: none;
}

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

.locked-overlay .lock-error {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.25);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 12px;
}

.locked-badge {
    display: inline-block;
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-weight: 600;
}

body.dark-mode .locked-badge {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}

/* ========== 失效项目标灰 ========== */
.app-item.dead .app-item-img {
    filter: grayscale(80%);
    opacity: 0.5;
}

.app-item.dead .app-item-title {
    color: var(--text-muted);
    text-decoration: line-through;
}

.app-item.dead {
    opacity: 0.55;
}

/* ========== 暗黑模式切换按钮 ========== */
.dark-mode-toggle {
    position: fixed;
    top: 14px;
    right: 62px;              /* 修：原来 right:16px 会和右侧「返回首页」按钮（38px @ right:16px）完全重叠 */
    z-index: 200;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    font-size: 1.6rem;
    color: var(--text-primary);
    transition: background 0.3s, color 0.3s, transform 0.25s, border-color 0.3s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.dark-mode-toggle:hover {
    border-color: var(--accent);
    transform: rotate(20deg) scale(1.05);
    color: var(--accent);
}

/* ========== 右侧悬浮导航浮层（收藏/首页/返回顶部） ========== */
.fk_service {
    position: fixed;
    right: 14px;
    bottom: 120px;
    z-index: 150;
    font-size: 14px;
    color: var(--text-primary);
}

.fk_service ul {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.fk_service li {
    list-style-type: none;
    position: relative;
}

.fk_service_box {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--float-bg);
    border: 1px solid var(--float-border);
    box-shadow: var(--float-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: border-color 0.25s, color 0.25s, transform 0.25s, background 0.25s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.fk_service_box:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* 悬浮按钮图标（通用字符，不依赖 Font Awesome，任何字体均可显示） */
.fk_service_box::before {
    font-size: 1.7rem;
    line-height: 1;
}

.fk_service_ax::before  { content: '\2605'; }  /* ★ 收藏 */
.fk_service_dz::before  { content: '\2302'; }  /* ⌂ 首页 */
.fk_service_upward::before { content: '\2191'; } /* ↑ 返回顶部 */

/* a 标签版返回顶部（旧模板遗留，隐藏，避免重复按钮） */
a.fk_service_upward {
    display: none;
}

/* 悬浮文字提示气泡 */
.fk_service_box > div {
    position: absolute;
    right: 52px;
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    padding: 6px 14px;
    border-radius: 10px;
    background: var(--float-tip-bg);
    color: var(--float-tip-text);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    pointer-events: none;
    box-shadow: var(--float-shadow);
}

.fk_service_box:hover > div {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.fk_service_box > div .fk_service_triangle {
    display: none;
}

/* 窄屏隐藏浮层 */
@media screen and (max-width: 900px) {
    .wapnone {
        display: none;
    }
}

/* ========== 键盘焦点可见性 ========== */
a:focus-visible,
.app-item:focus-visible,
.dark-mode-toggle:focus-visible,
.search-clear:focus-visible,
.fk_service_box:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-hover);
}

/* ========== 减少动效偏好 ========== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .app-item:hover,
    .back-home-link:hover,
    .dark-mode-toggle:hover,
    .fk_service_box:hover {
        transform: none;
    }
}

/* ========== P1：浏览历史 ========== */
.history-section .app-meta .history-clear {
    margin-left: auto;
    font-size: 1.2rem;
    padding: 4px 10px;
    border-radius: var(--radius-icon);
    border: 1px solid var(--card-border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.history-section .app-meta .history-clear:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--tag-bg);
}

.history-time {
    font-size: 1.1rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
    padding-right: 4px;
}

.history-section .app-item {
    cursor: default;
}

.history-section .app-item > a {
    flex: 1;
    min-width: 0;
}

.history-del {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    line-height: 1;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s, background 0.2s;
}

.history-del:hover {
    color: #f44336;
    background: var(--tag-bg);
}

/* ========== P1：标签筛选 ========== */
.tagcloud-section .tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 2px 0;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 1.25rem;
    padding: 5px 13px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-item);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
}

.tag-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.tag-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-on-accent);
}

.tag-chip .tag-count {
    font-size: 1.05rem;
    color: var(--text-muted);
    background: var(--tag-bg);
    border-radius: 999px;
    padding: 0 7px;
    line-height: 1.5;
}

.tag-chip.active .tag-count {
    color: var(--text-on-accent);
    background: rgba(255, 255, 255, 0.25);
}

.tag-chip-reset {
    border-style: dashed;
    color: var(--text-muted);
}

/* ========== P1：失效反馈按钮 ========== */
.report-dead-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    line-height: 1;
    font-size: 1.1rem;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s, border-color 0.2s, background 0.2s;
    -webkit-appearance: none;
}

.app-item:hover .report-dead-btn,
.report-dead-btn:focus-visible {
    opacity: 1;
}

.report-dead-btn:hover {
    color: #f44336;
    border-color: rgba(244, 67, 54, 0.5);
    background: rgba(244, 67, 54, 0.08);
}

.report-dead-btn.reported {
    opacity: 1;
    color: #4caf50;
    border-color: rgba(76, 175, 80, 0.5);
    cursor: default;
}

@media (hover: none) {
    .report-dead-btn {
        opacity: 1;
    }
}

/* ========== P1：暗黑模式适配 ========== */
body.dark-mode .history-del:hover {
    background: rgba(244, 67, 54, 0.15);
}

body.dark-mode .tag-chip.active {
    background: var(--accent);
    color: var(--text-on-accent);   /* 原来是写死的 #fff，暗色下是白字压在亮青色上，糊成一片 */
}

body.dark-mode .tag-chip.active .tag-count {
    color: var(--text-on-accent);
    background: rgba(6, 18, 31, 0.25);
}

/* 备注标签的颜色是深色主题调出来的（如 #a16207 棕、#666 灰），
   直接放到暗底上几乎看不清，用 brightness 提亮而不改色相 */
body.dark-mode .remark-tag {
    filter: brightness(1.55) saturate(1.1);
}
