/* =====================================================
   资源分享系统 - 前台样式（顶栏导航 + 轮播 + 侧栏分类 + 资源列表）
   ===================================================== */

/* --- 全局变量 --- */
:root {
    /* 声明本身就是深色主题：微信/系统夜间模式不会再自动反色，原生表单控件也走深色调 */
    color-scheme: dark;
    --bg-primary: #0a0e27;
    --bg-secondary: #0f1535;
    --bg-card: rgba(15, 22, 55, 0.85);
    --accent: #00e5ff;
    --accent-dark: #0091ea;
    --accent-glow: rgba(0, 229, 255, 0.3);
    --text-primary: #e0e6f0;
    --text-secondary: #8892b0;
    --text-muted: #5a6a8a;
    --border-color: rgba(0, 229, 255, 0.15);
    --success: #00e676;
    --danger: #ff5252;
    --warning: #ffd740;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --wrap: 1280px;
}

/* --- 重置 --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* 手机浏览器/微信里点链接不闪灰块 */
a, button, input, label { -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: #fff; text-shadow: 0 0 8px var(--accent-glow); }

/* --- 粒子背景 --- */
#particles-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0; pointer-events: none;
}

/* --- 页面包装 --- */
.page-wrapper {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: flex; flex-direction: column;
}

/* =====================================================
   顶部栏：站名 + 主导航 + 搜索
   ===================================================== */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    padding: 0 24px;
    position: sticky; top: 0; z-index: 100;
}

.header-inner {
    max-width: var(--wrap); margin: 0 auto;
    display: flex; align-items: center; gap: 22px;
    height: 66px;
}

/* 站名可能很长：品牌区允许收缩并截断，导航项禁止换行，否则窄屏下导航会被挤成竖排两行 */
.site-brand { display: flex; align-items: center; gap: 12px; color: inherit; flex: 0 1 auto; min-width: 0; max-width: 40%; }
.site-brand:hover { color: inherit; text-shadow: none; }

.site-logo {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: bold; color: var(--bg-primary);
    box-shadow: 0 0 18px var(--accent-glow);
    overflow: hidden;
}

.site-logo img { width: 100%; height: 100%; object-fit: cover; }

.site-brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }

.site-name {
    font-size: 19px; font-weight: bold;
    background: linear-gradient(135deg, var(--accent), #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.site-tagline {
    font-size: 11px; color: var(--text-muted);
    max-width: 260px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.top-nav { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }

.top-nav a {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    position: relative;
    white-space: nowrap;
}

.top-nav a:hover { color: var(--accent); background: rgba(0, 229, 255, 0.06); text-shadow: none; }

.top-nav a.is-active { color: var(--accent); background: rgba(0, 229, 255, 0.1); }

.top-search {
    margin-left: auto;
    display: flex; align-items: center;
    flex: 0 1 320px;
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
}

.top-search:focus-within { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }

.top-search input {
    flex: 1; min-width: 0;
    background: transparent; border: none; outline: none;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-primary);
}

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

.top-search button {
    flex: none;
    background: transparent; border: none; cursor: pointer;
    padding: 0 14px;
    font-size: 15px;
    color: var(--accent);
}

/* =====================================================
   主内容区
   ===================================================== */
.main-content {
    flex: 1;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 20px 24px 30px;
    width: 100%;
}

/* --- 通用卡片 --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover { border-color: rgba(0, 229, 255, 0.3); box-shadow: 0 8px 40px rgba(0, 229, 255, 0.1); }

.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
}

.card-header h2 {
    font-size: 16px; color: var(--accent);
    display: flex; align-items: center; gap: 10px;
}

.card-header h2::before {
    content: '';
    width: 4px; height: 18px;
    background: linear-gradient(to bottom, var(--accent), var(--accent-dark));
    border-radius: 2px;
}

.card-body { padding: 20px; }

/* =====================================================
   轮播推荐位
   ===================================================== */
.hero {
    position: relative;
    height: 232px;
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background:
        radial-gradient(120% 140% at 85% 20%, rgba(0, 145, 234, 0.22), transparent 60%),
        linear-gradient(120deg, rgba(0, 229, 255, 0.1), rgba(15, 22, 55, 0.9) 45%);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero-slides { position: absolute; inset: 0; }

.hero-slide {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 22px 60px 22px 28px;
    opacity: 0;
    transform: translateX(24px);
    transition: opacity .5s ease, transform .5s ease;
    pointer-events: none;
}

.hero-slide.is-active { opacity: 1; transform: none; pointer-events: auto; }

.hero-text { max-width: 72%; }

.hero-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    color: var(--bg-primary);
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    margin-bottom: 10px;
}

.hero-title {
    font-size: 26px; line-height: 1.3; font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    text-shadow: 0 0 20px var(--accent-glow);
}

.hero-desc {
    font-size: 13px; color: var(--text-secondary);
    margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.hero-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

.hero-cta {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 24px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--bg-primary);
    font-size: 14px; font-weight: 600;
    box-shadow: 0 4px 18px var(--accent-glow);
}

.hero-cta:hover { transform: translateY(-2px); color: var(--bg-primary); text-shadow: none; box-shadow: 0 8px 26px rgba(0, 229, 255, 0.45); }

.hero-art {
    flex: none;
    font-size: 108px; line-height: 1;
    opacity: 0.22;
    filter: drop-shadow(0 0 24px var(--accent-glow));
    user-select: none;
}

/* 桌面端：图放在右侧一块标准 16:9 画框里，整张图完整可见、不裁切不变形；
   左缘用遮罩渐隐融进卡片底色，文字区靠 padding-right 避让，不再压图上。
   出图按 16:9 走，建议 1920×1080 或 1680×945（2 倍图更清晰）。 */
.hero-media {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    height: 100%;
    aspect-ratio: 16 / 9;
    z-index: 0;
    overflow: hidden;
    background: rgba(10, 14, 39, 0.4);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 100%);
}

.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }

.hero-slide.has-media { padding-right: 452px; }
.hero-slide.has-media .hero-text { position: relative; z-index: 2; max-width: 100%; }
.hero-slide.has-media .hero-art { display: none; }

.hero-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 32px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(10, 14, 39, 0.45);
    border: 1px solid var(--border-color);
    color: var(--accent);
    font-size: 22px; line-height: 1;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2;
}

.hero-arrow.prev { left: 0; border-radius: 0 8px 8px 0; }
.hero-arrow.next { right: 0; border-radius: 8px 0 0 8px; }
.hero-arrow:hover { background: rgba(0, 229, 255, 0.18); }

.hero-dots { position: absolute; bottom: 14px; left: 28px; display: flex; gap: 8px; z-index: 2; }

.hero-dot {
    width: 22px; height: 4px;
    border: none; border-radius: 2px; cursor: pointer;
    background: rgba(224, 230, 240, 0.25);
    transition: var(--transition);
}

.hero-dot:hover { background: rgba(0, 229, 255, 0.5); }
.hero-dot.is-active { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }

.hero-auto {
    position: absolute; right: 16px; bottom: 14px;
    font-size: 11px; color: var(--text-muted); z-index: 2;
}

/* =====================================================
   两栏：侧栏分类 + 内容
   ===================================================== */
.layout {
    display: grid;
    /* minmax(0,1fr)：否则 grid 轨道按内容 min-width 撑开，窄屏会把整页顶出横向滚动条 */
    grid-template-columns: 212px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.sidebar { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.content { min-width: 0; }

.side-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px;
    backdrop-filter: blur(20px);
}

.side-card h3 {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    padding-left: 9px; margin-bottom: 8px;
    border-left: 3px solid var(--accent);
    line-height: 1.2;
}

.side-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 9px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.side-item:hover { color: var(--accent); background: rgba(0, 229, 255, 0.07); text-shadow: none; }
.side-item.is-active { color: var(--accent); background: rgba(0, 229, 255, 0.1); }
.side-item .ico { flex: none; width: 18px; text-align: center; font-size: 14px; }
.side-item .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-item em { flex: none; font-style: normal; font-size: 11px; color: var(--text-muted); }

.side-link {
    display: block;
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.side-link:hover { color: var(--accent); background: rgba(0, 229, 255, 0.07); text-shadow: none; }

.side-weather { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.side-weather .w-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.side-weather .w-row .ico { width: 16px; text-align: center; }
#clock { font-family: 'Consolas', monospace; color: var(--accent); }

/* --- 面包屑 --- */
.breadcrumb {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text-muted); }
.breadcrumb .crumb-count { margin-left: auto; font-size: 12px; color: var(--text-muted); }

/* --- 筛选栏 --- */
.filter-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin-bottom: 14px;
}

.chip {
    padding: 5px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
    background: rgba(0, 229, 255, 0.03);
}

.chip:hover { color: var(--accent); border-color: var(--accent); text-shadow: none; }
.chip.is-active { color: var(--accent); border-color: var(--accent); background: rgba(0, 229, 255, 0.1); }
.chip-clear { border-style: dashed; font-size: 12px; }

.filter-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.sort-toggle {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.sort-toggle a { padding: 4px 12px; font-size: 12px; color: var(--text-secondary); }
.sort-toggle a:hover { color: var(--accent); text-shadow: none; }
.sort-toggle a.is-active { color: var(--accent); background: rgba(0, 229, 255, 0.12); }

/* =====================================================
   资源列表
   ===================================================== */
.res-list { display: flex; flex-direction: column; gap: 10px; }

.res-item {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    backdrop-filter: blur(20px);
    transition: var(--transition);
}

.res-item:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 229, 255, 0.35);
    box-shadow: 0 8px 24px rgba(0, 229, 255, 0.12);
}

.res-icon {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.14), rgba(0, 145, 234, 0.08));
    border: 1px solid var(--border-color);
}

.res-main { min-width: 0; }

/* 图标和标题都是详情页入口 */
a.res-icon:hover { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); text-shadow: none; }
.res-title a { color: inherit; }
.res-title a:hover { color: var(--accent); text-shadow: none; }

.res-title {
    font-size: 15px; font-weight: 600; line-height: 1.4;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.res-desc {
    font-size: 12.5px; color: var(--text-secondary);
    margin: 2px 0 5px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.res-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-muted); }

.res-meta .tag {
    padding: 1px 9px;
    border-radius: 10px;
    font-size: 11px;
    color: var(--accent);
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.res-actions {
    display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
    min-width: 108px;
}

/* 免费 / 付费 徽章 */
.price-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
}

.price-free { background: rgba(0, 230, 118, 0.12); color: var(--success); border: 1px solid rgba(0, 230, 118, 0.25); }
.price-paid { background: rgba(255, 167, 38, 0.12); color: #ffa726; border: 1px solid rgba(255, 167, 38, 0.25); }

.cta {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 6px 16px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--bg-primary) !important;
    font-size: 13px; font-weight: 600;
    white-space: nowrap;
}

.cta:hover { transform: translateY(-1px); box-shadow: 0 4px 15px var(--accent-glow); text-shadow: none; }

.cta-ghost {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary) !important;
    padding: 3px 10px;
    font-size: 11px; font-weight: 500;
}

.cta-ghost:hover { color: var(--accent) !important; border-color: var(--accent); box-shadow: none; }

/* =====================================================
   问题反馈页（feedback.php）
   ===================================================== */
.fb-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 268px;
    gap: 20px;
    margin-top: 4px;
    align-items: start;
}

.fb-main { min-width: 0; }

.fb-intro { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; }

.fb-alert {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 13px;
    margin-bottom: 14px;
}

.fb-alert-ok { background: rgba(0, 230, 118, 0.1); border-color: rgba(0, 230, 118, 0.3); color: var(--success); }
.fb-alert-err { background: rgba(255, 82, 82, 0.1); border-color: rgba(255, 82, 82, 0.3); color: var(--danger); }

.fb-form { display: flex; flex-direction: column; gap: 14px; }

.fb-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.fb-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.fb-field label { font-size: 13px; color: var(--text-secondary); }

.fb-field .req { color: var(--danger); }

.fb-field input,
.fb-field select,
.fb-field textarea {
    width: 100%;
    min-width: 0;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(10, 14, 39, 0.6);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.fb-field input::placeholder,
.fb-field textarea::placeholder { color: var(--text-muted); }

.fb-field input:focus,
.fb-field select:focus,
.fb-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }

.fb-field select option { background: var(--bg-secondary); color: var(--text-primary); }

.fb-field textarea { min-height: 130px; resize: vertical; line-height: 1.7; }

.fb-hint { font-size: 11px; color: var(--text-muted); }

.fb-submit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.fb-submit .cta { padding: 9px 26px; font-size: 14px; border: none; cursor: pointer; font-family: inherit; }

/* 蜜罐：机器人会填这个隐藏框，真人看不到 */
.fb-honeypot {
    position: absolute !important;
    left: -9999px; top: -9999px;
    width: 1px; height: 1px;
    opacity: 0;
}

.fb-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.fb-tips p { font-size: 12px; color: var(--text-secondary); line-height: 1.9; }

.fb-back { width: 100%; }

.fb-list-card { margin-top: 20px; }

.fb-count { font-size: 12px; color: var(--text-muted); }

.fb-item { padding: 14px 0; border-bottom: 1px dashed var(--border-color); }

.fb-item:last-child { border-bottom: none; padding-bottom: 0; }

.fb-item-head {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
}

.fb-cat {
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(0, 229, 255, 0.25);
}

.fb-nick { font-size: 13px; color: var(--text-primary); }

.fb-time { margin-left: auto; color: var(--text-muted); }

.fb-content {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

.fb-reply {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(0, 230, 118, 0.07);
    border: 1px solid rgba(0, 230, 118, 0.22);
}

.fb-reply-tag { display: block; font-size: 11px; font-weight: 600; color: var(--success); margin-bottom: 4px; }

.fb-reply-body { font-size: 13px; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }

.fb-reply-time { margin-top: 4px; text-align: right; font-size: 11px; color: var(--text-muted); }

/* =====================================================
   资源详情页（res.php / res/123.html）
   ===================================================== */
.rd-head,
.rd-block,
.rd-ad { margin-top: 16px; }

/* 广告位：只有图片+链接，宽度跟着所在栏走，图片按比例缩放不变形 */
.rd-ad a { display: block; }
.rd-ad img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border-color); }
.rd-ad img:hover { border-color: rgba(0, 229, 255, 0.35); }
.rd-ad-top img { max-height: 150px; object-fit: cover; }
/* 侧栏里那格由 .side-card 控制内边距，广告自己不再撑顶部间距 */
.rd-ad-side { margin-top: 0; }

/* 头部：图标 + 标题 + 徽章 */
.rd-head-main {
    display: flex; align-items: center; gap: 16px;
    padding: 18px 20px;
}

.rd-head-icon {
    flex: none;
    width: 62px; height: 62px;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    border-radius: var(--radius);
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.rd-head-text { flex: 1 1 auto; min-width: 0; }

.rd-title {
    font-size: 21px; font-weight: 700; color: var(--text-primary);
    line-height: 1.35;
    word-break: break-word;
}

.rd-meta { margin-top: 8px; }
.rd-head-price { flex: none; }

.rd-brief {
    padding: 0 20px 18px;
    font-size: 13px; color: var(--text-secondary);
    border-top: 1px dashed var(--border-color);
    padding-top: 14px;
}

/* 侧栏「资源信息」小卡 */
.rd-facts { display: flex; flex-direction: column; gap: 7px; font-size: 12px; }
.rd-facts > div { display: flex; align-items: baseline; gap: 8px; }
.rd-facts span { flex: none; width: 34px; color: var(--text-muted); }
.rd-facts b { flex: 1; min-width: 0; font-weight: 600; color: var(--text-primary); word-break: break-all; }

.rd-detail p { font-size: 14px; line-height: 1.95; color: var(--text-secondary); margin-bottom: 12px; }
.rd-detail p:last-child { margin-bottom: 0; }

.rd-count { font-size: 12px; color: var(--text-muted); }
.rd-empty { font-size: 13px; color: var(--text-muted); }

.rd-crumb-now { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 460px; }

/* 截图：自适应栅格，点开放大 */
.rd-shots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
    gap: 12px;
}

.rd-shot { position: relative; margin: 0; }

.rd-shot a {
    display: block;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    background: rgba(10, 14, 39, 0.4);
}

.rd-shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: var(--transition); }
.rd-shot a:hover { border-color: var(--accent); }
.rd-shot a:hover img { transform: scale(1.04); }
.rd-shot figcaption {
    position: absolute; left: 8px; top: 8px;
    min-width: 20px; padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px; text-align: center;
    color: var(--text-primary);
    background: rgba(10, 14, 39, 0.72);
    border: 1px solid var(--border-color);
    pointer-events: none;
}

/* 下载模块：一排三个网盘按钮。底色和图标由下面 a.nd-* 那组品牌规则通过
   --nd-bg / --nd-i 传进来，和文章正文里的网盘按钮是同一份配色表。 */
.rd-dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.rd-dl .rd-nd {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-width: 0; min-height: 42px; padding: 0 14px;
    border-radius: 9px; border: 1px solid transparent;
    font-size: 14px; font-weight: 600; line-height: 1.2; text-align: center;
    color: #fff !important; text-decoration: none !important;
    background: var(--nd-bg, #158cb0);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.rd-dl .rd-nd::before {
    content: ""; flex: 0 0 auto;
    width: 18px; height: 18px; background-color: currentColor;
    -webkit-mask: var(--nd-i, url(../img/nd/link.svg)) center / contain no-repeat;
    mask: var(--nd-i, url(../img/nd/link.svg)) center / contain no-repeat;
}
.rd-dl a.rd-nd:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.rd-dl a.rd-nd:active { transform: translateY(0); }
.rd-dl .rd-nd.is-disabled { opacity: .55; cursor: not-allowed; }
.rd-dl .rd-nd span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rd-note,
.rd-hint { font-size: 12.5px; color: var(--warning); }
.rd-note { margin-bottom: 12px; }
.rd-hint { margin-top: 12px; color: var(--text-muted); }
.rd-hint a { color: var(--accent); }

/* 同类推荐 */
.rd-related { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 10px; }

.rd-rel-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 13px; color: var(--text-secondary);
    min-width: 0;
}

.rd-rel-item:hover { color: var(--accent); border-color: var(--accent); background: rgba(0, 229, 255, 0.07); text-shadow: none; }
.rd-rel-ico { flex: none; }
.rd-rel-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-rel-num { flex: none; font-size: 11px; color: var(--text-muted); }

/* =====================================================
   友情链接
   ===================================================== */
.friendlinks-card { margin-top: 20px; }

.fl-body {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    padding: 16px 20px;
}

.fl-body .fl-item {
    color: var(--text-secondary);
    padding: 4px 14px;
    border-radius: 6px;
    border: 1px solid rgba(0, 229, 255, 0.15);
    font-size: 13px;
}

.fl-body .fl-item:hover { color: var(--accent); border-color: var(--accent); background: rgba(0, 229, 255, 0.08); }

/* =====================================================
   分页
   ===================================================== */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; margin-top: 22px; flex-wrap: wrap;
}

.page-btn {
    display: inline-flex; align-items: center;
    padding: 7px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    background: transparent;
}

.page-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(0, 229, 255, 0.05); }

.page-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--bg-primary);
    border-color: var(--accent);
    font-weight: bold;
}

.page-dots { color: var(--text-muted); padding: 0 4px; }

/* =====================================================
   底部（版权模块，保留）
   ===================================================== */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    padding: 24px;
    margin-top: auto;
}

.footer-inner { max-width: var(--wrap); margin: 0 auto; }

.footer-copyright { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }

.footer-disclaimer { text-align: center; font-size: 12px; color: var(--text-muted); opacity: 0.7; margin-bottom: 14px; }

.footer-stats {
    display: flex; align-items: center; justify-content: center;
    gap: 22px; flex-wrap: wrap;
    font-size: 13px; color: var(--text-secondary);
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.footer-stats .stat-item { display: flex; align-items: center; gap: 6px; }
.footer-stats .stat-item .label { color: var(--text-muted); }
.footer-stats .stat-item .value { color: var(--accent); font-weight: 600; }

/* --- 返回顶部 --- */
.back-to-top {
    position: fixed;
    bottom: 30px; right: 30px;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--bg-primary);
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px var(--accent-glow);
    opacity: 0; visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0, 229, 255, 0.5); }

/* --- 空状态 --- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 44px; margin-bottom: 14px; opacity: 0.5; }
.empty-state p { font-size: 15px; }

/* --- 动画 --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeInUp 0.5s ease forwards; }

/* =====================================================
   文章资讯（列表页 + 详情页）
   ===================================================== */

/* 页头：左边标题说明，右边站内搜索 */
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
    margin-bottom: 16px;
}

.page-head-text { min-width: 0; }
.page-head-text h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.page-head-text p { margin-top: 6px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

.page-search { display: flex; gap: 8px; flex: none; }
.page-search input {
    width: 220px;
    padding: 9px 13px;
    font-size: 14px;
    color: var(--text-primary);
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition);
}
.page-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12); }
.page-search button {
    min-width: 68px;
    padding: 9px 16px;
    font-size: 14px;
    color: var(--accent);
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.28);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.page-search button:hover { background: rgba(0, 229, 255, 0.18); }

.filter-note {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px;
    font-size: 12.5px; color: var(--text-secondary);
}
.filter-note a { color: var(--accent); }

/* 列表里带封面的那格：复用 .res-icon 的尺寸，图片裁满不留黑边 */
.art-cover { overflow: hidden; padding: 0; }
.art-cover img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }

/* --- 详情页 --- */
.art-detail {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.art-head { padding: 22px 24px 16px; border-bottom: 1px dashed var(--border-color); }
.art-h1 {
    font-size: 24px; font-weight: 700; line-height: 1.4;
    color: var(--text-primary);
    word-break: break-word;
}
.art-meta {
    display: flex; flex-wrap: wrap; gap: 8px 18px;
    margin-top: 12px;
    font-size: 12.5px; color: var(--text-muted);
}

/* 复制链接：放在 meta 行最右，点一下把本页地址放进剪贴板（脚本 assets/js/article-copy.js） */
.art-copy {
    display: inline-flex; align-items: center; gap: 6px;
    margin-left: auto; padding: 5px 12px; min-height: 30px;
    font: inherit; font-size: 12.5px; color: var(--text-secondary);
    background: rgba(0, 229, 255, 0.06);
    border: 1px solid var(--border-color); border-radius: 999px;
    cursor: pointer; transition: var(--transition);
}
.art-copy:hover { border-color: var(--accent); color: var(--accent); }
.art-copy.is-failed { border-color: var(--danger); color: var(--danger); }
.art-copy-ico { font-size: 12px; line-height: 1; }

.art-cover-img { margin: 0; padding: 18px 24px 0; }
.art-cover-img img {
    display: block; width: 100%; height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.art-lead {
    margin: 16px 24px 0;
    padding: 12px 16px;
    font-size: 13.5px; line-height: 1.8;
    color: var(--text-secondary);
    background: rgba(0, 229, 255, 0.05);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* 正文排版：富文本只会产出这些标签，所以逐个写死，不接受后台传来的样式 */
.art-body { padding: 20px 24px 26px; overflow-wrap: break-word; }
.art-body > :first-child { margin-top: 0; }
.art-body p { font-size: 15.5px; line-height: 1.95; color: var(--text-secondary); margin: 0 0 15px; }
.art-body h2 {
    font-size: 19px; font-weight: 700; color: var(--text-primary);
    margin: 26px 0 12px; padding-left: 11px;
    border-left: 3px solid var(--accent);
    line-height: 1.5;
}
.art-body h3 { font-size: 16.5px; font-weight: 600; color: var(--text-primary); margin: 20px 0 10px; }
.art-body ul, .art-body ol { margin: 0 0 15px; padding-left: 24px; }
.art-body li { font-size: 15.5px; line-height: 1.9; color: var(--text-secondary); margin-bottom: 6px; }
.art-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.art-body a:hover { text-shadow: none; }
.art-body strong { color: var(--text-primary); }
.art-body blockquote {
    margin: 0 0 16px; padding: 12px 16px;
    font-size: 14.5px; line-height: 1.85; color: var(--text-secondary);
    background: rgba(0, 229, 255, 0.05);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.art-body hr { border: 0; border-top: 1px solid var(--border-color); margin: 24px 0; }
/* 编辑器里拖动出来的宽度会写进 img 的 style，这条 !important 保证手机上照样不撑破容器 */
.art-body img { display: block; max-width: 100% !important; height: auto !important; border-radius: var(--radius-sm); margin: 6px 0 16px; }
.art-body table {
    width: 100%; max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 0 0 16px;
    font-size: 14px;
}
.art-body th, .art-body td {
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
    word-break: break-word;
    color: var(--text-secondary);
}
.art-body th { color: var(--text-primary); background: rgba(0, 229, 255, 0.06); font-weight: 600; }

/* Markdown 正文补充：标题层级、代码块、行内代码
   （正文里的 class/style 入库时已被净化掉，所以代码块是等宽单色，不跟高亮主题走） */
.art-body h1 {
    font-size: 20px; font-weight: 700; color: var(--text-primary);
    margin: 26px 0 12px; padding-left: 11px;
    border-left: 4px solid var(--accent);
    line-height: 1.5;
}
.art-body h4 { font-size: 15.5px; font-weight: 600; color: var(--text-primary); margin: 18px 0 8px; }
.art-body h5, .art-body h6 { font-size: 14.5px; font-weight: 600; color: var(--text-primary); margin: 16px 0 8px; }
.art-body code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13.5px; color: var(--text-primary);
    background: rgba(0, 229, 255, 0.08);
    padding: 1px 6px; border-radius: 4px;
}
.art-body pre {
    margin: 0 0 16px; padding: 12px 14px;
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.art-body pre code {
    display: block; background: none; padding: 0; border-radius: 0;
    font-size: 13px; line-height: 1.75; color: var(--text-secondary);
    white-space: pre; overflow-wrap: normal;
}
.art-body del, .art-body s, .art-body strike { color: var(--text-muted); }

/* 编辑器「字号/颜色」按钮插入的受限类名（正文里只放行这些，其它 class 入库就被清掉） */
.art-body .t-xs { font-size: 0.82em; }
.art-body .t-sm { font-size: 0.9em; }
.art-body .t-lg { font-size: 1.2em; }
.art-body .t-xl { font-size: 1.45em; }
.art-body .t-red    { color: #ff6b6b; }
.art-body .t-orange { color: #ffa94d; }
.art-body .t-yellow { color: #ffd43b; }
.art-body .t-green  { color: #51cf66; }
.art-body .t-cyan   { color: #22d3ee; }
.art-body .t-blue   { color: #74a8ff; }
.art-body .t-purple { color: #b197fc; }
.art-body .t-pink   { color: #f783ac; }
.art-body .t-gray   { color: var(--text-muted); }
.art-body h1 .t-lg, .art-body h2 .t-lg, .art-body h3 .t-lg { font-size: inherit; }

/* 网盘按钮：正文里只放行 a.nd-*。品牌底色画在按钮上，图标用同色系的 SVG 蒙版画在 ::before 上，
   形状和颜色都靠 --nd-bg / --nd-i 两个自定义属性传给子伪元素，新增网盘只加一行。
   下面那串 [href*=...] 是按域名兜底：编辑器里插的其实就是一个普通链接（万一 class 被编辑器丢掉，
   或者管理员手工粘了一个网盘地址），前台照样认得出是哪家网盘、照样画成按钮。 */
.art-body a[class*="nd-"], .art-body span[class*="nd-"],
.art-body a[href*="pan.baidu.com"], .art-body a[href*="quark.cn"], .art-body a[href*="115.com"],
.art-body a[href*="xunlei.com"], .art-body a[href*="lanzou"], .art-body a[href*="alipan.com"],
.art-body a[href*="aliyundrive.com"], .art-body a[href*="123pan.com"], .art-body a[href*="caiyun"],
.art-body a[href*="189.cn"], .art-body a[href*="drive.uc.cn"], .art-body a[href*="139yun.com"] {
    display: inline-flex; align-items: center; gap: 7px;
    margin: 4px 8px 4px 0; padding: 8px 14px 8px 10px;
    border-radius: 8px; border: 1px solid transparent;
    font-size: 13.5px; font-weight: 600; line-height: 1.2;
    color: #fff !important; text-decoration: none !important;
    background: var(--nd-bg, #158cb0);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.art-body a[class*="nd-"]::before, .art-body span[class*="nd-"]::before,
.art-body a[href*="pan.baidu.com"]::before, .art-body a[href*="quark.cn"]::before,
.art-body a[href*="115.com"]::before, .art-body a[href*="xunlei.com"]::before,
.art-body a[href*="lanzou"]::before, .art-body a[href*="alipan.com"]::before,
.art-body a[href*="aliyundrive.com"]::before, .art-body a[href*="123pan.com"]::before,
.art-body a[href*="caiyun"]::before, .art-body a[href*="189.cn"]::before,
.art-body a[href*="drive.uc.cn"]::before, .art-body a[href*="139yun.com"]::before {
    content: ""; flex: 0 0 auto;
    width: 18px; height: 18px; background-color: currentColor;
    -webkit-mask: var(--nd-i, url(../img/nd/link.svg)) center / contain no-repeat;
    mask: var(--nd-i, url(../img/nd/link.svg)) center / contain no-repeat;
}
.art-body a[class*="nd-"]:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.art-body a[class*="nd-"]:active { transform: translateY(0); }
/* 品牌底色只挂在类名上（不带 .art-body 前缀）：文章正文的网盘按钮和资源详情页的下载按钮
   都带 nd-* 类，一份表管两处，加网盘不用再抄一遍 */
a.nd-baidu    { --nd-bg: #3178f6; --nd-i: url(../img/nd/paw.svg); }
a.nd-aliyun   { --nd-bg: #4b53c4; --nd-i: url(../img/nd/cloud.svg); }
a.nd-quark    { --nd-bg: #2b3a5c; --nd-i: url(../img/nd/q.svg); }
a.nd-115      { --nd-bg: #1f6fe4; --nd-i: url(../img/nd/n115.svg); }
a.nd-xunlei   { --nd-bg: #2b7bff; --nd-i: url(../img/nd/dl.svg); }
a.nd-lanzou   { --nd-bg: #23a5ff; --nd-i: url(../img/nd/cloud.svg); }
a.nd-uc       { --nd-bg: #f26a21; --nd-i: url(../img/nd/uc.svg); }
a.nd-mobile   { --nd-bg: #d8220b; --nd-i: url(../img/nd/hex.svg); }
a.nd-liandong { --nd-bg: #00b0f0; --nd-i: url(../img/nd/rings.svg); }
a.nd-189      { --nd-bg: #12a0ec; --nd-i: url(../img/nd/cloud.svg); }
a.nd-123      { --nd-bg: #1ec2ee; --nd-i: url(../img/nd/dl.svg); }
a.nd-cdt      { --nd-bg: #e0564f; --nd-i: url(../img/nd/cloud.svg); }
a.nd-generic  { --nd-bg: #158cb0; --nd-i: url(../img/nd/link.svg); }
/* 资源详情页的按钮是 span 时（地址不可用那种），底色同样按类名给 */
span.nd-generic { --nd-bg: #158cb0; --nd-i: url(../img/nd/link.svg); }
/* 只有链接、没有类名时按域名上色（和上面一一对应） */
.art-body a[href*="pan.baidu.com"]   { --nd-bg: #3178f6; --nd-i: url(../img/nd/paw.svg); }
.art-body a[href*="quark.cn"]        { --nd-bg: #2b3a5c; --nd-i: url(../img/nd/q.svg); }
.art-body a[href*="115.com"]         { --nd-bg: #1f6fe4; --nd-i: url(../img/nd/n115.svg); }
.art-body a[href*="xunlei.com"]      { --nd-bg: #2b7bff; --nd-i: url(../img/nd/dl.svg); }
.art-body a[href*="lanzou"]          { --nd-bg: #23a5ff; --nd-i: url(../img/nd/cloud.svg); }
.art-body a[href*="alipan.com"],
.art-body a[href*="aliyundrive.com"] { --nd-bg: #4b53c4; --nd-i: url(../img/nd/cloud.svg); }
.art-body a[href*="123pan.com"]      { --nd-bg: #1ec2ee; --nd-i: url(../img/nd/dl.svg); }
.art-body a[href*="caiyun"],
.art-body a[href*="189.cn"]          { --nd-bg: #12a0ec; --nd-i: url(../img/nd/cloud.svg); }
.art-body a[href*="drive.uc.cn"]     { --nd-bg: #f26a21; --nd-i: url(../img/nd/uc.svg); }
.art-body a[href*="139yun.com"]      { --nd-bg: #d8220b; --nd-i: url(../img/nd/hex.svg); }
/* 提取码小标签：正文里的 123pan 之类链接不该变成胶囊，只让 nd-code 那块例外 */
.art-body span.nd-code {
    --nd-bg: rgba(0, 229, 255, 0.10); --nd-i: url(../img/nd/key.svg);
    color: var(--accent) !important; border-color: var(--border-color); font-weight: 500;
}

/* 文章详情页广告位：样式写死，后台只需要给图片/链接/文案 */
.art-ad {
    display: block; position: relative; overflow: hidden;
    margin: 18px 0; border: 1px solid var(--border-color);
    border-radius: var(--radius); background: var(--bg-card);
    transition: var(--transition);
}
.art-ad:hover { border-color: var(--accent); transform: translateY(-2px); }
.art-ad img { display: block; width: 100%; height: auto; }
.art-ad-text { display: block; padding: 15px 18px; }
.art-ad-text strong { display: block; font-size: 15px; color: var(--text-primary); margin-bottom: 5px; }
.art-ad-text em { display: block; font-size: 13px; color: var(--text-secondary); font-style: normal; line-height: 1.7; }
.art-ad-tag {
    position: absolute; top: 8px; right: 8px; z-index: 1;
    padding: 1px 7px; border-radius: 999px; font-size: 11px; line-height: 1.6;
    background: rgba(0, 0, 0, .45); color: rgba(255, 255, 255, .82);
}
.art-ad-text .art-ad-tag { background: rgba(0, 229, 255, .12); color: var(--accent); }
/* 正文外面（标题下、正文尾）的广告格自己补详情页卡片的左右内缩 */
.art-ad-slot { padding: 0 24px; }
.art-body .art-ad-slot { padding: 0; }
/* 右侧那格在宽屏上浮到正文右上、文字绕着走；手机端整块不显示 */
.art-side-ad { float: right; width: 232px; margin: 0 0 16px 22px; }
.art-side-ad .art-ad { margin: 0; }
.art-side-ad .art-ad img { height: auto; }
/* 正文被中间广告劈成两截时，第一截的开头仍要当作正文开头（否则标题会多出一截上边距） */
.art-body .art-part > :first-child { margin-top: 0; }

/* 上一篇 / 下一篇 */
.art-turn {
    display: flex; justify-content: space-between; gap: 16px;
    padding: 16px 24px 20px;
    border-top: 1px dashed var(--border-color);
    font-size: 13px;
}
.art-turn > span { min-width: 0; max-width: 48%; }
.art-turn a { display: block; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-turn a:hover { text-decoration: underline; }
.art-turn-empty { color: var(--text-muted); }
.art-turn > span:last-child { text-align: right; }

/* 相关推荐 */
.sec-title {
    font-size: 16px; font-weight: 600; color: var(--text-primary);
    margin: 24px 0 12px;
}

.art-relate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }

.art-relate-item {
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
}
.art-relate-item:hover { border-color: var(--accent); transform: translateY(-2px); text-shadow: none; }
.art-relate-item img,
.art-relate-ph {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: rgba(0, 229, 255, 0.06);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.art-relate-title {
    font-size: 13.5px; color: var(--text-primary); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.art-relate-date { font-size: 11.5px; color: var(--text-muted); margin-top: auto; }

/* =====================================================
   响应式
   ===================================================== */
@media (max-width: 1080px) {
    .layout { grid-template-columns: 186px minmax(0, 1fr); }
    .hero-slide { padding-right: 48px; }
    .hero-art { font-size: 84px; }
    .hero-title { font-size: 22px; }
    .top-nav a { padding: 8px 10px; font-size: 13px; }
    .fb-layout { grid-template-columns: minmax(0, 1fr) 226px; }
    .rd-shots { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    .rd-crumb-now { max-width: 300px; }
}

@media (max-width: 860px) {
    /* 顶栏：品牌+搜索同一行，导航压成第二行横滑，整体比原来矮 40px 左右 */
    .header-inner { height: auto; flex-wrap: wrap; gap: 8px 10px; padding: 8px 0; }
    .site-brand { order: 1; max-width: none; flex: 1 1 130px; }
    .top-search { order: 2; flex: 1 1 150px; margin-left: auto; max-width: none; }
    /* iOS/微信里输入框字号小于 16px 会在聚焦时自动放大整页，这里必须给到 16px */
    .top-search input { font-size: 16px; padding: 9px 12px; min-height: 40px; }
    .top-search button { min-height: 40px; padding: 0 16px; }
    .top-nav { order: 3; width: 100%; overflow-x: auto; gap: 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .top-nav::-webkit-scrollbar { display: none; }
    .top-nav a { padding: 8px 12px; font-size: 13px; min-height: 40px; display: inline-flex; align-items: center; }
    .site-tagline { display: none; }

    .layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .fb-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .fb-row { grid-template-columns: minmax(0, 1fr); }
    .fb-side { flex-direction: row; flex-wrap: wrap; gap: 14px; }
    .fb-side .card { flex: 1 1 232px; }
    .fb-field input, .fb-field select, .fb-field textarea { font-size: 16px; }

    /* 侧栏三张卡在手机上会把资源列表推到一屏之外：只留分类导航，压成一行横滑胶囊 */
    .sidebar { gap: 10px; }
    .sidebar .side-card:nth-child(n+2) { display: none; }
    .side-card:first-child {
        display: flex; flex-wrap: nowrap; align-items: center; gap: 8px;
        padding: 9px 10px;
        overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .side-card:first-child::-webkit-scrollbar { display: none; }
    .side-card:first-child h3 { display: none; }
    .side-item { flex: none; padding: 8px 13px; border: 1px solid var(--border-color); border-radius: 18px; background: rgba(10, 14, 39, 0.5); }
    .side-item .ico { flex: none; width: auto; }
    .side-item .name { flex: none; }
    .side-item em { margin-left: 4px; }
    .side-item.is-active { color: var(--accent); }

    /* 手机端屏幕窄，反而适合整条铺满：版面本身就近似 16:9，图不裁切；
       文字压在图上，所以加一层上下压暗遮罩，避免和图糊在一起。 */
    .hero { height: auto; aspect-ratio: 16 / 9; }
    .hero-media {
        top: 0; right: 0; bottom: 0; left: 0;
        width: auto; height: auto;
        aspect-ratio: auto;
        -webkit-mask-image: none; mask-image: none;
    }
    .hero-slide { padding: 18px 44px; align-items: center; }
    .hero-slide.has-media { padding-right: 44px; }
    .hero-slide.has-media::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 1;
        background: linear-gradient(180deg, rgba(6, 10, 26, 0.45) 0%, rgba(6, 10, 26, 0.86) 52%, rgba(6, 10, 26, 0.94) 100%);
    }
    .hero-text { max-width: 100%; }
    .hero-art { display: none; }
    .hero-slide.has-media .hero-text { max-width: 100%; }
    .hero-slide.has-media .hero-title,
    .hero-slide.has-media .hero-desc { text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7); }
    .hero-title { font-size: 19px; }
    .hero-desc { display: none; }
    .hero-cta { min-height: 40px; }

    /* 拇指热区：轮播圆点原本只有 4px 高，手机上基本按不中。
       撑到 40px 高、用 background-clip 只画中间那 4px 的横条，视觉位置不变（bottom 补偿 -4px）。 */
    .hero-dots { bottom: -4px; }
    .hero-dot { height: 40px; padding: 18px 0; background-clip: content-box; -webkit-background-clip: content-box; }

    .site-brand { min-height: 40px; }
    .fl-body .fl-item { min-height: 40px; display: inline-flex; align-items: center; }
    .breadcrumb { min-height: 40px; }
    .breadcrumb a { display: inline-flex; align-items: center; min-height: 40px; }

    .res-item { grid-template-columns: 40px 1fr; gap: 10px; row-gap: 8px; padding: 12px; }
    .res-icon { width: 40px; height: 40px; font-size: 19px; border-radius: 10px; }
    /* 窄屏上一行截断太浪费信息量，标题给到两行 */
    .res-title { font-size: 14.5px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
    .res-meta { gap: 6px 10px; font-size: 11.5px; }
    .res-actions { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; min-width: 0; }
    .res-actions .price-badge { flex: none; }
    /* 拇指热区：详情按钮拉满剩余宽度、至少 40px 高 */
    .res-actions .cta { flex: 1 1 auto; min-height: 40px; padding: 8px 18px; font-size: 14px; }
    /* 标题链接是行内元素，纵向 padding 只放大点击范围、不撑高行盒，也不影响上面的两行截断 */
    .res-title a { padding: 11px 0; }

    /* 筛选条单行横滑，不再换行占三行 */
    .filter-bar { flex-wrap: nowrap; overflow-x: auto; gap: 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .filter-bar::-webkit-scrollbar { display: none; }
    .filter-bar .chip { flex: none; padding: 7px 13px; min-height: 40px; display: inline-flex; align-items: center; }
    .filter-right { margin-left: auto; width: auto; flex: none; }
    .sort-toggle a { padding: 7px 11px; min-height: 40px; display: inline-flex; align-items: center; }

    .pagination { gap: 4px; }
    .page-btn { min-width: 40px; height: 40px; padding: 0 10px; }
    .hero-auto { display: none; }
    /* 底部悬浮按钮栏会挡住最后一行，留出自适应安全区 */
    .main-content { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

    /* 页脚在 </main> 之外，上面那条 padding 管不到它：微信自带底栏 + 全面屏手势条 +
       右侧悬浮按钮三样一起压下来，最后几行统计就"显示不完整"。页脚自己留够底部安全区，
       文字改成左对齐并给悬浮栏让出右侧 52px，最后一行才不会藏在按钮底下。 */
    .site-footer { padding: 18px 14px calc(96px + env(safe-area-inset-bottom)); }
    .footer-inner { padding-right: 52px; }
    .footer-copyright, .footer-disclaimer { text-align: left; }
    .footer-stats {
        flex-direction: column; align-items: flex-start; justify-content: flex-start;
        gap: 6px; font-size: 12px; padding-top: 12px;
    }
    .footer-stats .stat-item { justify-content: flex-start; }

    .rd-head-main { flex-wrap: wrap; gap: 12px; }
    .rd-head-icon { width: 52px; height: 52px; font-size: 26px; }
    .rd-title { font-size: 18px; }
    .rd-head-price { margin-left: 64px; }
    .rd-dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    /* 下载按钮 33px、提示行里的"问题反馈"文字热区 16px，手机上都太小：
       按钮补齐 40px，文字链接用内撑外拉把热区撑开而不改动行高 */
    .rd-dl .rd-nd { min-height: 42px; font-size: 13.5px; padding: 0 10px; }
    .rd-hint a, .rd-note a { display: inline-block; padding: 11px 2px; margin: -11px -2px; }
    .rd-crumb-now { max-width: none; }
    .fb-submit .cta, .fb-back { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

    /* 文章页：标题和搜索框上下排，输入框 16px 防微信自动放大，正文行距收紧一点 */
    .page-head { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 14px; }
    .page-head-text h1 { font-size: 20px; }
    .page-head-text p { font-size: 12.5px; }
    .page-search { flex: 1 1 auto; }
    .page-search input { flex: 1 1 auto; width: auto; min-width: 0; font-size: 16px; }
    .page-search button { min-height: 42px; padding: 9px 18px; }
    .art-head { padding: 16px 14px 12px; }
    .art-h1 { font-size: 20px; line-height: 1.45; }
    .art-meta { gap: 6px 14px; font-size: 12px; }
    /* 复制链接在手机上要能准确点中：热区抬到 40px，不再靠 margin-left:auto 顶到行尾 */
    .art-copy { margin-left: 0; min-height: 40px; padding: 9px 16px; font-size: 13.5px; }
    .art-cover-img { padding: 14px 14px 0; }
    .art-lead { margin: 14px 14px 0; font-size: 13.5px; }
    .art-body { padding: 16px 14px 20px; }
    .art-body p, .art-body li { font-size: 16px; line-height: 1.85; }
    .art-body h2 { font-size: 17.5px; margin: 22px 0 10px; }
    .art-body h1 { font-size: 18.5px; margin: 22px 0 10px; }
    .art-body h3 { font-size: 15.5px; }
    .art-body pre { padding: 10px 12px; }
    .art-body table { font-size: 13.5px; }
    .art-body th, .art-body td { padding: 8px 9px; }
    .art-body a[class*="nd-"] { padding: 9px 13px 9px 11px; font-size: 13px; min-height: 38px; }
    .art-ad { margin: 14px 0; }
    .art-ad-slot { padding: 0 14px; }
    .art-side-ad { display: none; }
    .art-ad-text { padding: 13px 14px; }
    .art-ad-text strong { font-size: 14.5px; }
    .art-turn { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; }
    .art-turn > span, .art-turn > span:last-child { max-width: 100%; text-align: left; }
    .art-turn a { display: flex; align-items: center; min-height: 40px; }
    .art-relate-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
}

@media (max-width: 480px) {
    .main-content { padding: 12px 12px calc(72px + env(safe-area-inset-bottom)); }
    .site-name { font-size: 16px; }
    .site-logo { width: 34px; height: 34px; font-size: 15px; }
    .filter-right { margin-left: auto; width: auto; }
    .fb-time { margin-left: 0; width: 100%; }
    .fb-submit .cta { width: 100%; }
    .breadcrumb { font-size: 12px; }
    .hero-title { font-size: 17px; }
    .res-title { font-size: 14px; }
    .res-meta { font-size: 11px; }
    .rd-shots { grid-template-columns: minmax(0, 1fr); }
    .rd-related { grid-template-columns: minmax(0, 1fr); }
    .rd-head-price { margin-left: 0; }
    .footer-stats { font-size: 11.5px; }
    .art-h1 { font-size: 18.5px; }
    .art-body h2 { font-size: 16.5px; }
    .art-relate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-head-text h1 { font-size: 19px; }
    .back-to-top { bottom: calc(20px + env(safe-area-inset-bottom)); right: 16px; width: 40px; height: 40px; font-size: 16px; }
}

/* =====================================================
   右侧悬浮按钮栏（includes/float_buttons.php）
   ===================================================== */
.fdock {
    position: fixed;
    right: 30px; bottom: 30px;
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 10px;
    z-index: 999;
}

.fd-item { position: relative; }

.fd-btn {
    width: 46px; height: 46px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--accent);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.fd-btn:hover {
    color: var(--accent-dark);
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 26px var(--accent-glow);
}

.fd-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fd-svg { width: 22px; height: 22px; display: block; }
.fd-icon { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; display: block; }

/* 二维码气泡：出现在按钮左侧 */
.fd-pop {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) scale(.94);
    transform-origin: right center;
    width: 200px;
    padding: 14px;
    text-align: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0; visibility: hidden;
    pointer-events: none;
    transition: var(--transition);
}

.fd-item.is-open .fd-pop {
    opacity: 1; visibility: visible; pointer-events: auto;
    transform: translateY(-50%) scale(1);
}

.fd-pop::after {
    content: '';
    position: absolute;
    left: 100%; top: 50%;
    margin-top: -7px;
    border: 7px solid transparent;
    border-left-color: var(--bg-secondary);
}

/* 二维码一律给白底：黑码白纸才扫得出来，深色主题下直接放图会扫不上 */
.fd-qr {
    display: block;
    width: 100%;
    max-width: 168px;
    margin: 0 auto;
    padding: 8px;
    background: #fff;
    border-radius: 8px;
    object-fit: contain;
}

.fd-pop-name { margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.fd-pop-tip { margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--text-muted); word-break: break-all; }

/* 返回顶部进栏后跟着排队，不再自己定位；保留 .visible 的淡入 */
.fdock .back-to-top,
.fdock .back-to-top.visible {
    position: static;
    bottom: auto; right: auto;
    transform: none;
}

.fdock .back-to-top svg { width: 20px; height: 20px; display: block; }

@media (max-width: 768px) {
    .fdock { right: 14px; bottom: calc(16px + env(safe-area-inset-bottom)); gap: 8px; }
    .fd-btn, .fdock .back-to-top { width: 40px; height: 40px; }
    .fd-svg { width: 20px; height: 20px; }
    .fd-icon { width: 26px; height: 26px; }
    .fd-pop { width: 168px; padding: 12px; right: calc(100% + 10px); }
    .fd-qr { max-width: 140px; padding: 6px; }
}

/* =====================================================
   用户留言（article.php / res.php 详情页共用）
   ===================================================== */
.cm-section { margin-top: 16px; }

.cm-count { font-size: 12px; color: var(--text-muted); }

.cm-alert {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 13px;
    margin-bottom: 14px;
}

.cm-alert-ok { background: rgba(0, 230, 118, 0.1); border-color: rgba(0, 230, 118, 0.3); color: var(--success); }
.cm-alert-err { background: rgba(255, 82, 82, 0.1); border-color: rgba(255, 82, 82, 0.3); color: var(--danger); }

.cm-list { display: flex; flex-direction: column; }

.cm-item { padding: 13px 0; border-bottom: 1px dashed var(--border-color); }

.cm-item:first-child { padding-top: 0; }

.cm-item:last-child { border-bottom: none; padding-bottom: 0; }

.cm-item-head { display: flex; align-items: baseline; gap: 10px; font-size: 12px; }

.cm-nick { font-size: 13px; color: var(--accent); }

.cm-time { color: var(--text-muted); }

.cm-content {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.cm-reply {
    margin-top: 9px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(0, 230, 118, 0.07);
    border: 1px solid rgba(0, 230, 118, 0.22);
}

.cm-reply-tag { display: block; font-size: 11px; font-weight: 600; color: var(--success); margin-bottom: 4px; }

.cm-reply-body { font-size: 13px; color: var(--text-primary); word-break: break-word; overflow-wrap: anywhere; }

.cm-reply-time { margin-top: 4px; text-align: right; font-size: 11px; color: var(--text-muted); }

.cm-empty { font-size: 13px; color: var(--text-muted); padding-bottom: 14px; }

.cm-pager {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    margin: 14px 0 2px;
    font-size: 12px;
    color: var(--text-muted);
}

.cm-page-btn {
    padding: 5px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.cm-page-btn:hover { border-color: var(--accent); color: var(--accent); }

.cm-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.cm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.cm-field label { font-size: 13px; color: var(--text-secondary); }

.cm-field .req { color: var(--danger); }

.cm-field input,
.cm-field textarea {
    width: 100%;
    min-width: 0;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(10, 14, 39, 0.6);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.cm-field input::placeholder,
.cm-field textarea::placeholder { color: var(--text-muted); }

.cm-field input:focus,
.cm-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }

.cm-field textarea { min-height: 88px; resize: vertical; line-height: 1.7; }

.cm-hint { font-size: 11px; color: var(--text-muted); }

.cm-submit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.cm-submit .cta { padding: 9px 24px; font-size: 14px; border: none; cursor: pointer; font-family: inherit; }

/* 蜜罐：和反馈页同一招，机器人会填这个真人看不见的框 */
.cm-honeypot {
    position: absolute !important;
    left: -9999px; top: -9999px;
    width: 1px; height: 1px;
    opacity: 0;
}

@media (max-width: 860px) {
    /* 16px 输入：小于 16px iOS 聚焦时会自动放大整页 */
    .cm-field input,
    .cm-field textarea { font-size: 16px; }
    .cm-field textarea { min-height: 96px; }
    .cm-submit .cta { width: 100%; padding: 11px 0; text-align: center; }
    .cm-content, .cm-reply-body { font-size: 14px; }
}
