/* 高老头资源站 · 前台样式（深色游戏风，移动端自适应） */
:root {
    --bg: #07111f;
    --bg2: #0c1b2e;
    --panel: #10233a;
    --line: rgba(255, 255, 255, .1);
    --text: #eaf4ff;
    --muted: #8ea6bf;
    --blue: #36a9ff;
    --cyan: #52e7c2;
    --gold: #ffc86b;
    --red: #ff7d93;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: radial-gradient(circle at 80% -10%, #16416d, #07111f 45%) fixed;
    color: var(--text);
    font: 15px/1.65 -apple-system, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 18px; }

/* 顶栏 */
.top {
    position: sticky; top: 0; z-index: 20;
    backdrop-filter: blur(12px);
    background: rgba(7, 17, 31, .88);
    border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; gap: 22px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; white-space: nowrap; }
.logo {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--blue), var(--cyan)); color: #06121f; font-size: 18px;
}
.brand small { display: block; font-size: 9px; letter-spacing: 2px; color: var(--muted); font-weight: 400; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; align-items: center; }  /* overflow 必须可见，否则会裁掉 nav-drop 下拉菜单 */
.nav a { padding: 8px 13px; border-radius: 9px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: #1a3858; color: #fff; }
/* 导航下拉分组（资源库 ▾） */
.nav-drop { position: relative; }
.nav-drop summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 13px; border-radius: 9px; color: var(--muted); font-size: 14px; white-space: nowrap;
}
.nav-drop summary::-webkit-details-marker { display: none; }
.nav-drop summary:hover, .nav-drop[open] summary { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-drop summary.on { background: #1a3858; color: #fff; }
.nav-drop .caret { font-size: 10px; transition: transform .15s; }
.nav-drop[open] .caret { transform: rotate(180deg); }
.nav-menu {
    position: absolute; left: 0; top: calc(100% + 8px); z-index: 80; text-align: left;
    background: #10243b; border: 1px solid var(--line); border-radius: 12px; padding: 7px;
    min-width: 160px; box-shadow: 0 12px 30px rgba(0,0,0,.45); display: flex; flex-direction: column;
}
.nav-menu a { padding: 9px 12px; border-radius: 8px; }
.nav-menu a.on { background: #1a3858; color: #fff; }
.top-act { display: flex; align-items: center; gap: 9px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 15px; border-radius: 9px; border: 1px solid var(--line);
    background: #10243b; color: var(--text); cursor: pointer; font-size: 14px; white-space: nowrap;
}
.btn:hover { border-color: #2d9ce9; }
.btn-primary { border-color: #2d9ce9; background: linear-gradient(135deg, #1c8ddd, #37c0b2); color: #04121f; font-weight: 700; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* 通用块 */
.sec { margin: 42px 0; }
.cdkwrap { margin-top: 34px; }   /* CDK 领取区（游戏页 / 群服资源页共用） */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sec-head h2 { margin: 0; font-size: 20px; }
.sec-head span { color: var(--muted); font-size: 13px; }
.card { background: linear-gradient(160deg, #10233a, #0c1a2c); border: 1px solid var(--line); border-radius: var(--radius); }
.card.res { position: relative; }
/* 置顶帖子角标：卡片右上角 */
.top-flag {
    position: absolute; top: 10px; right: 10px; z-index: 3;
    padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: linear-gradient(135deg, #ffb02e, #ff8a00); color: #2b1600;
    box-shadow: 0 2px 8px rgba(255, 138, 0, .35); pointer-events: none;
}
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tag {
    display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 11px;
    background: rgba(7, 17, 31, .72); border: 1px solid rgba(255, 255, 255, .18); color: #a9eaff;
}
.tag-gold { color: var(--gold); border-color: rgba(255, 200, 107, .4); }
.tag-green { color: var(--cyan); border-color: rgba(82, 231, 194, .4); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* 首屏 */
.hero { padding: 52px 0 12px; }
.eyebrow { color: var(--cyan); font-size: 12px; letter-spacing: 3px; font-weight: 700; }
.hero h1 { font-size: 34px; line-height: 1.25; margin: 12px 0 10px; }
.hero p { color: var(--muted); max-width: 660px; margin: 0; }
.hero .hero-lead { color: var(--text); font-size: 16px; margin-bottom: 6px; }
.hero .hl { color: var(--cyan); font-weight: 600; }
.hero .hl-gold { color: var(--gold); font-weight: 600; }
/* 首页会员特权提示卡：醒目金边卡片，突出三大福利 */
.hero-perks {
    margin: 14px 0 4px;
    padding: 14px 18px;
    border: 1px solid rgba(240, 185, 80, .38);
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(240, 185, 80, .10), rgba(12, 26, 44, .6));
}
.hero-perks .perk-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.hero-perks ul { margin: 0; padding-left: 2px; list-style: none; }
.hero-perks li { position: relative; padding-left: 18px; color: var(--text); font-size: 14px; line-height: 2; }
.hero-perks li::before { content: '▸'; position: absolute; left: 0; color: var(--gold); font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 28px; }
.stat { padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(160deg, #10233a, #0c1a2c); }
.stat label { display: block; color: var(--muted); font-size: 12px; }
.stat b { font-size: 24px; }

/* 资源卡 */
.res { overflow: hidden; display: flex; flex-direction: column; }
.res .cover {
    height: 108px; padding: 14px; display: flex; align-items: flex-end; justify-content: space-between;
    background: linear-gradient(135deg, #214d78, #153d4c);
}
.res .body { padding: 15px; flex: 1; display: flex; flex-direction: column; }
.res h3 { margin: 0 0 6px; font-size: 16px; }
.res .desc { color: var(--muted); font-size: 13px; margin: 0 0 12px; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }  /* 简介最多两行，超出省略 */
.game-card .desc { -webkit-line-clamp: 3; margin-bottom: 0; }  /* 游戏卡无按钮，腾出的空间给简介（3 行） */
.res .meta { display: flex; justify-content: space-between; color: #718ca8; font-size: 12px; margin-bottom: 12px; }
/* 卡片底部信息条（参考样式：左侧分类，右侧相对发布时间） */
.res .card-foot {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px;
    color: #718ca8; font-size: 12px;
}
.res .card-foot .cf-time { color: #8fb3d9; }

/* 工具卡（tools.php 用 .card-bd，不是 .res .body）
   这套类之前没有任何 CSS 定义（CSS 里搜不到 .card-bd），所以工具卡是整个页面里
   唯一没接上 .res 那套 flex 列布局的卡片：内容多高卡片就多高，
   「查看 / 下载」按钮跟着简介行数上下浮动，同一行的相邻卡片按钮对不齐
   （线上现症：#3 虚拟机简介为空 0 行，#4 分屏幕简介「分屏」1 行，高差一行）。

   对齐原理（与 .res .body 一致）：
     .card-bd { flex:1 }        → 吃掉封面以外的全部高度，卡片被 grid 拉到等高
     .desc     { flex:1 }      → 简介吸收剩余余量，按钮被顶到 .card-bd 最底部
     .btn      { flex-shrink:0 } → 按钮自身不被压扁
   同行卡片等高由 .grid（默认 align-items:stretch）保证，所以按钮必然同一水平线。
   min-height 是给「简介为空」的卡兜底，避免它比旁边的卡矮一截。 */
.card.res .card-bd { padding: 15px; flex: 1; display: flex; flex-direction: column; min-height: 0; }
/* 同行等高：.grid 默认 align-items:stretch 就会拉伸，这里用 height:100% 再钉一道。
   （不用 :has()——老浏览器不认会导致整条规则失效，反而打破布局。） */
.grid > .card.res { height: 100%; }
.card.res .card-title { margin: 0 0 6px; font-size: 16px; }
/* 简介吃掉按钮上方的全部余量，按钮因此固定在底部同一水平线 */
.card.res .card-bd > .desc {
    flex: 1;
    min-height: 30px;          /* ≈两行 12px 字；简介为空时也留位，卡片高度不塌 */
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card.res .card-bd > .btn { flex-shrink: 0; }

/* 列表行 */
.list-item { display: flex; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item h3 { margin: 0 0 4px; font-size: 16px; }
.list-item p { margin: 0; color: var(--muted); font-size: 13px; }

/* 表格 */
.tablewrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; }
table.tb th, table.tb td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.tb th { color: #7190aa; font-size: 12px; font-weight: 500; white-space: nowrap; }
table.tb td { font-size: 13px; }
table.tb tr:hover td { background: rgba(255, 255, 255, .02); }

/* 表单 */
.field { margin-bottom: 15px; }
.field label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.7; }
.input, input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
    width: 100%; padding: 11px 13px; border-radius: 9px;
    background: #0a1728; border: 1px solid rgba(255, 255, 255, .14); color: var(--text); outline: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
textarea { min-height: 110px; resize: vertical; }
/* CDK 后台地址：让输入框与「打开」按钮并排，按钮不被 width:100% 挤到下一行 */
.field .cdk-url { flex: 1; width: auto; min-width: 0; }
.form-narrow { max-width: 420px; margin: 40px auto; }
.form-narrow .card { padding: 26px; }

/* 投稿页双通道 Tab（游戏资源投稿 / 视频投稿）：两个独立 form，用 Tab 切换显隐 */
.sub-tabs { display: flex; gap: 8px; margin: 22px 0 0; flex-wrap: wrap; }
.sub-tab {
    flex: 1 1 auto; padding: 11px 14px; cursor: pointer; font-size: 14px; font-weight: 600;
    background: #0a1728; color: var(--muted); border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px; transition: all .15s;
}
.sub-tab:hover { color: var(--text); border-color: rgba(255, 255, 255, .28); }
.sub-tab.on {
    background: linear-gradient(135deg, rgba(255, 199, 89, .18), rgba(84, 201, 255, .14));
    color: var(--text); border-color: rgba(255, 199, 89, .45);
}
.sub-tabs + .card { margin-top: 14px; }

/* 会员档位：宽屏 4 列，排成 4+1，第 5 张（SVIP）单独一行居中。

   为什么从 grid 换成 flex：
   原来的 grid auto-fit 也能排成 4 列，但多出来的那张是**靠左对齐**的，
   孤零零贴在左边很难看。grid 没有「最后一组居中」这个概念
   （justify-content 管不了行，grid-column 又得写死「第 5 张放第 2 列」，
   一旦档位数变化就得重写选择器，很脆）。
   flex + justify-content:center 天然把每一行都居中，多余的卡自动折行后仍然居中。

   为什么 flex 不会在超宽屏排成 5 个：
   外层 .wrap 有 max-width:1180px，容器最宽 1180-36=1144px，
   换行判定按 flex-basis 算：4 张需要 4×240+3×16=1008px（放得下），
   5 张需要 1008+16+240=1264px（放不下）→ 恒定 4 列。
   换成 grid 的 auto-fit 就没这个保证，列数由容器宽和 minmax 下限决定，容易跑偏。 */
.plans {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}
.plans > .plan {
    flex: 1 1 240px;      /* 基准宽 240px：保证 4 列、第 5 张折行 */
    max-width: 400px;     /* 超宽屏下卡片别无限拉长 */
    min-width: 0;
    align-items: stretch; /* 同行卡片等高（原本靠 grid 默认 stretch，flex 要显式写） */
}

/* 降级：≤1100px 两列，≤640px 单列 */
@media (max-width: 1100px) {
    .plans > .plan { flex-basis: calc((100% - 16px) / 2); max-width: none; }
}
@media (max-width: 640px) {
    .plans > .plan { flex-basis: 100%; max-width: none; }
}
.plan { padding: 24px; display: flex; flex-direction: column; position: relative; }
.plan.best { border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(82, 231, 194, .25) inset; }
.plan h3 { margin: 0 0 6px; }
.plan .price { font-size: 30px; font-weight: 700; margin: 8px 0; }
.plan .price small { font-size: 12px; color: var(--muted); font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 6px 0 20px; color: var(--muted); font-size: 13px; flex: 1; }
.plan li { margin: 7px 0; }
.plan li::before { content: "✓"; color: var(--cyan); margin-right: 8px; }
.ribbon { position: absolute; top: 14px; right: 14px; }

/* 提示 */
.alert { padding: 12px 15px; border-radius: 10px; margin: 14px 0; font-size: 14px; border: 1px solid; }
.alert-ok { background: rgba(82, 231, 194, .1); border-color: rgba(82, 231, 194, .35); color: #9ff0dc; }
.alert-err { background: rgba(255, 125, 147, .1); border-color: rgba(255, 125, 147, .35); color: #ffc0cb; }
.alert-info { background: rgba(54, 169, 255, .1); border-color: rgba(54, 169, 255, .35); color: #b6dcff; }
.locked { padding: 22px; text-align: center; border: 1px dashed rgba(255, 200, 107, .45); border-radius: var(--radius); background: rgba(255, 200, 107, .05); }

/* CDK 结果 */
.cdk-code {
    display: inline-block; padding: 9px 14px; border-radius: 9px; font-family: ui-monospace, Consolas, monospace;
    background: #06121f; border: 1px dashed rgba(82, 231, 194, .5); color: var(--cyan); letter-spacing: 1px;
}

/* 分页 */
.pager { display: flex; gap: 6px; justify-content: center; margin: 26px 0; flex-wrap: wrap; }
.pg { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pg.active { background: #1a3858; color: #fff; border-color: #2d9ce9; }
.pg.disabled { opacity: .4; }

/* 页脚 */
.foot { border-top: 1px solid var(--line); margin-top: 50px; padding: 26px 0 40px; color: var(--muted); font-size: 13px; }
.foot .row { justify-content: space-between; }

/* 筛选条 */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filters input[type=text] { flex: 1; min-width: 200px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { padding: 6px 13px; border-radius: 20px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.chip.on { background: #1a3858; color: #fff; border-color: #2d9ce9; }

@media (max-width: 860px) {
    .hero { padding-top: 34px; }
    .hero h1 { font-size: 26px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    /* 手机端：头部不再吸顶（栏目多，吸顶会占掉半屏），导航换行平铺全部可见 */
    .top { position: static; }
    .top-in { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 8px; }
    .nav { order: 3; flex: 1 1 100%; flex-wrap: wrap; overflow-x: visible; gap: 2px 4px; }
    .nav a { padding: 7px 11px; font-size: 13.5px; }
    .sec { margin: 30px 0; }
}

/* ---------- 游戏封面图 ---------- */
.res .cover.has-img { padding: 0; position: relative; height: 168px; background: #0a1728; overflow: hidden; }
/* 底衬：用同一张图放大模糊铺满，主图 contain 后四周留白也不难看 */
.res .cover.has-img::before {
    content: ''; position: absolute; inset: -14px; z-index: 0;
    background-image: var(--cov, none); background-size: cover; background-position: center;
    filter: blur(14px) brightness(.5) saturate(1.1);
}
/* 主图完整显示（contain = 等比缩放到完整可见），不再从中间裁掉 */
.res .cover.has-img img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; display: block; }
.res .cover.has-img .covtags {
    position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 2;
    display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.res .cover.has-img .covtags .tag { background: rgba(7, 17, 31, .75); backdrop-filter: blur(4px); }

/* ---------- 游戏详情：封面 + 截图 ---------- */
.ghero { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; margin-top: 14px; }
.ghero .gcover { flex: 0 0 360px; max-width: 100%; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #0a1728; }
.ghero .gcover img { width: 100%; display: block; }
.ghero .gintro { flex: 1; min-width: 280px; }
.ghero .gintro .gdesc { white-space: pre-wrap; color: var(--text); opacity: .92; margin: 10px 0 0; }

.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.shots a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #0a1728; }
.shots img { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; display: block; transition: transform .25s; }
.shots a:hover img { transform: scale(1.04); }
@media (max-width: 900px) { .shots { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .shots { grid-template-columns: 1fr; } }

/* ---------- 栏目直达（全站吸顶导航） ---------- */
/* ⚠️ 固定 6 列而不是 auto-fit：容器 1180px 时 auto-fit(200px) 只会算出 5 列，
   第 6 张（外链）被挤到第二行独占一行，右侧留一大片空白，很难看。
   固定 6 列让六张卡**一行排开**，窄屏再按断点降列。
   min-width:0 是关键：grid 子项默认 min-width:auto，
   卡片里那段 nowrap 的说明文字会把列撑宽，导致 6 列放不下。 */

/* 吸顶容器：top 偏移 = 顶部导航条高度（.top-in 的 min-height 66px + 1px 边框）。
   偏移不够会被 .top 盖住 —— .top 是 sticky z-index:20，本行 z-index:18 在它下层，
   滚动时必须主动让出66px，否则卡片上半截被导航条遮住。
   负 margin-top / 负 padding 是为了「吸住后不留下空白」：
   .sec 默认 margin:42px 0 会让吸顶态与上方内容之间出现一条空带。 */
.portals-bar {
    position: sticky; top: 66px; z-index: 18;
    margin: 22px 0 0;
    padding: 12px 0;
    background: linear-gradient(180deg, var(--bg) 72%, rgba(7, 17, 31, 0));
    /* 吸住时下方内容会从底下透出来，加一层渐隐让过渡自然（不透明度渐变到 0，不是硬边） */
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
/* 内层负责左右对齐：.portals-bar 在 <main class="wrap"> 里，
   但仍要能撑满内容区而不额外收窄，故用负 margin 抵消 .wrap 的 padding。 */
.portals-bar-in { margin: 0 -2px; }

.portals { display: grid; gap: 10px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.portal {
    display: flex; align-items: center; gap: 10px; padding: 12px 13px; min-width: 0;
    background: linear-gradient(160deg, #10233a, #0c1a2c);
    border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.portal:hover { border-color: rgba(82, 231, 194, .5); transform: translateY(-2px); }
/* 当前所在栏目：青底 + 发光描边 + 标题转白，一眼看出「我正在这个栏目里」 */
.portal.on {
    border-color: rgba(82, 231, 194, .75);
    background: linear-gradient(160deg, #123049, #0d2136);
    box-shadow: 0 0 0 1px rgba(82, 231, 194, .18), 0 6px 18px rgba(0, 0, 0, .35);
}
.portal.on .p-name { color: #fff; }
.portal.on .p-ico  { transform: scale(1.06); }
.portal .p-ico { font-size: 20px; line-height: 1; flex-shrink: 0; transition: transform .2s; }
.portal .p-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.portal .p-name { font-size: 14px; color: var(--text); white-space: nowrap; }
.portal .p-desc {
    font-size: 11px; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.portal .p-cnt {
    flex-shrink: 0; font-size: 12px; color: var(--cyan);
    background: rgba(82, 231, 194, .1); border: 1px solid rgba(82, 231, 194, .28);
    border-radius: 8px; padding: 2px 7px;
}
@media (max-width: 980px) { .portals { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) {
    .portals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* 窄屏上6 张卡占两整屏高，吸顶会把内容全挡住 —— 小屏干脆不吸顶 */
    .portals-bar { position: static; backdrop-filter: none; }
}

/* ---------- 首页：最新更新 ---------- */
/* 比通用 .grid 稍宽（240 vs 260）：这一栏是首页要展示的「新鲜事」，
   卡片小一点显得多，一屏能看到更多条。 */
.grid-latest { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
/* 最新更新的卡没有「查看详情」按钮，标题要吃掉剩余高度把底栏压到卡片底部，
   否则同一行卡片底栏会因标题行数不同而高低不齐。 */
.grid-latest .res h3 {
    -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
}
.grid-latest .res .card-foot { margin-top: auto; }
/* 置顶卡：描一圈金边，和普通卡一眼能分开（top-flag 角标是内容，这圈是容器） */
.grid-latest .res.is-top { border-color: rgba(255, 176, 46, .55); }
.grid-latest .res.is-top .cover.has-img::before { filter: blur(14px) brightness(.42) saturate(1.15); }

/* H5 小游戏标签色：紫，跟其他版块区分开 */
.tag-purple { color: #c9a6ff; border-color: rgba(170, 130, 255, .45); }

/* ---------- QQ 群 / 客服卡片 ---------- */
.qqbox {
    border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
    background: linear-gradient(160deg, #10233a, #0c1a2c); margin-top: 18px;
}
.qq-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.qq-head b { font-size: 15px; }
.qq-list { display: flex; flex-wrap: wrap; gap: 10px; }
.qq-item {
    display: inline-flex; align-items: center; gap: 9px;
    border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px;
    background: rgba(255, 255, 255, .04); font-size: 13.5px;
}
.qq-item .qq-name { color: var(--muted); }
.qq-item .qq-no { font-weight: 700; color: var(--cyan); cursor: pointer; letter-spacing: .3px; }
.qq-item .qq-no:hover { color: #8ff5da; }
.qq-item .copy-tip { color: var(--muted); font-size: 12px; }

.qqbox.compact { margin-top: 0; padding: 14px 16px; }
.qqbox.compact .qq-list { gap: 8px; }

.tag-blue { color: #7cc4ff; border-color: rgba(54, 169, 255, .45); }

@media (max-width: 720px) {
    .ghero .gcover { flex: 1 1 100%; }
    .res .cover.has-img { height: 150px; }
}

/* ---------- 网盘二维码（扫码转存） ---------- */
.qrbox {
    margin-top: 18px; padding: 16px 18px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: linear-gradient(160deg, #10233a, #0c1a2c);
}
.qrbox-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.qrbox-head h3 { margin: 0; font-size: 15px; }
.qr-hint {
    margin: 12px 0 0; padding: 10px 14px;
    border: 1px solid var(--line); border-left: 3px solid var(--gold);
    border-radius: 10px; background: rgba(255, 255, 255, .04);
    font-size: 13px; color: var(--muted);
}
.qr-hint b { color: var(--gold); font-weight: 600; }
.qrs { display: flex; flex-wrap: wrap; gap: 16px; }
.qr-item { text-align: center; }
.qr-img {
    display: block; padding: 8px; border-radius: 12px; background: #fff;
    border: 1px solid var(--line); transition: transform .2s, box-shadow .2s;
}
.qr-img img { display: block; width: 168px; height: 168px; object-fit: contain; }
.qr-img:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .28); }
.qr-cap { margin-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12.5px; }
.qr-cap > span:first-child { color: var(--text); opacity: .9; }
.qr-save { cursor: pointer; }
.qr-save:hover { color: var(--cyan); }

@media (max-width: 720px) {
    .qrs { gap: 12px; justify-content: center; }
    .qr-img img { width: 142px; height: 142px; }
}

/* 开通流程三步说明 */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 26px; }
.flow-i {
    display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px;
    border-radius: var(--radius); border: 1px solid var(--line);
    background: linear-gradient(160deg, #10233a, #0c1a2c);
}
.flow-i > b {
    flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--blue), var(--cyan)); color: #04121f; font-size: 14px;
}
.flow-i h4 { margin: 2px 0 4px; font-size: 15px; }
.flow-i p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }

/* CDK 兑换激活区 */
.activate { padding: 24px; margin-top: 26px; scroll-margin-top: 84px; }
.activate h2 { margin: 0 0 8px; font-size: 19px; }
.activate .qqbox { margin-top: 18px; }
.activate input[type="text"] { text-transform: uppercase; letter-spacing: .5px; }
.btn-quiet { background: transparent; color: var(--muted); border-style: dashed; }
.btn-quiet:hover { color: var(--text); border-color: var(--muted); }

/* ---------- 会员中心：主区 + 右侧黏性侧栏 ---------- */
/* 桌面 1180px 容器：主区 ~772px + 侧栏 ~340px，比原来整页纵向堆叠矮一半 */
.member-hero { padding: 40px 0 4px; }
.member-hero h1 { font-size: 30px; margin: 10px 0 8px; }
.member-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) 340px;
    gap: 26px; align-items: start;
}
.member-main { min-width: 0; }
.member-main .sec:first-child { margin-top: 0; }
/* 侧栏第一块与主区首块顶部对齐（.sec 默认有 42px 上边距） */
.member-side { display: flex; flex-direction: column; gap: 16px; margin-top: 42px; }

@media (max-width: 980px) {
    .member-grid { grid-template-columns: 1fr; gap: 0; }
    .member-side { margin-top: 0; }
}

.member-side { position: sticky; top: 84px; }
@media (max-width: 980px) { .member-side { position: static; } }

.side-card { padding: 16px 18px; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.side-head b { font-size: 15px; }
.side-form { display: flex; flex-direction: column; gap: 8px; }
.side-note {
    margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
    color: var(--muted); font-size: 12.5px; line-height: 1.7;
}
.side-note b { color: var(--text); }
.side-big { display: flex; align-items: baseline; gap: 8px; }
.side-big b { font-size: 30px; line-height: 1.1; }
.side-fold { margin-top: 12px; }

/* 会员身份卡：状态 + 操作 + 关键数字收成一张 */
.idcard { padding: 20px 22px; }
.idcard-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.idcard-who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.idcard-ava {
    flex: 0 0 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
    font-size: 20px; font-weight: 700; color: #04121f;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
}
.idcard-name { display: block; font-size: 18px; line-height: 1.3; }
.idcard-act { display: flex; gap: 8px; flex-wrap: wrap; }
.idcard-meta {
    display: flex; gap: 10px 26px; flex-wrap: wrap;
    margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
    color: var(--muted); font-size: 13px;
}
.idcard-meta b { color: var(--text); }

/* 积分总览：左余额 + 右说明 */
.ptop { padding: 18px 20px; display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.ptop-num { flex: 0 0 auto; }
.ptop-num label { display: block; color: var(--muted); font-size: 12px; }
.ptop-num > b { font-size: 34px; line-height: 1.1; color: var(--gold); }
.ptop-act { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ptop-tip { flex: 1; min-width: 220px; }
.ptop-tip p { margin: 0 0 6px; font-size: 13px; line-height: 1.7; }
.ptop-tip p:last-child { margin-bottom: 0; }

/* 兑换卡：统一栅格，卡片等高对齐 */
.redeem-grid {
    display: grid; gap: 14px; margin-top: 14px;
    grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
}
.redeem-card { padding: 16px 18px; display: flex; flex-direction: column; }
.redeem-card.cdk { grid-column: 1 / -1; }
.redeem-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.redeem-head b { font-size: 15px; }
.redeem-desc { margin: 8px 0 12px; }
.redeem-foot { display: block; margin-top: 8px; font-size: 12.5px; }
.redeem-card form { margin-top: auto; }

/* 记录组：三块表格同一张卡内用细分隔线区分，空态压成一行 */
.rec { border-top: 1px solid var(--line); }
.rec:first-of-type { border-top: 0; padding-top: 0; }
.rec-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; padding: 14px 2px 10px;
}
.rec-head b { font-size: 15px; }
.rec .tablewrap { border: 1px solid var(--line); border-radius: 10px; }
.rec .tb tr:last-child td { border-bottom: 0; }
.empty-cell { padding: 14px 14px !important; }

/* 可折叠明细（积分流水 / 推广口径） */
.fold { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .02); }
.fold > summary {
    cursor: pointer; padding: 11px 14px; font-size: 13px; color: var(--muted);
    list-style: none; user-select: none;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: '▸'; display: inline-block; margin-right: 8px; transition: transform .18s; }
.fold[open] > summary::before { transform: rotate(90deg); }
.fold > summary:hover { color: var(--text); }
.fold .tablewrap { border: 0; border-top: 1px solid var(--line); }
.side-fold > summary { padding: 8px 12px; font-size: 12.5px; }

/* 免责声明（全站统一：首页 / 资源详情 / 群服详情 / 页脚） */
.disclaimer {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 16px 18px; margin: 18px 0;
    border: 1px solid rgba(255, 200, 107, .35);
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(255, 200, 107, .10), rgba(255, 125, 147, .06));
}
.disclaimer .ico { font-size: 22px; line-height: 1.35; flex: 0 0 auto; }
.disclaimer .dis-main { margin: 0 0 4px; font-weight: 600; line-height: 1.6; }
.disclaimer .dis-main b { color: var(--gold); }
.disclaimer .dis-sub { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.disclaimer .dis-sub b { color: var(--red); }
/* 精简版：放在下载卡片里，单行紧凑 */
.disclaimer.compact { padding: 10px 14px; margin: 12px 0 16px; }
.disclaimer.compact .ico { font-size: 18px; }
.disclaimer.compact .dis-main { margin: 0; font-size: 13.5px; font-weight: 600; }
.disclaimer.compact .dis-sub { display: inline; font-size: 12.5px; margin-left: 2px; }

/* ===== H5 小游戏大厅 ===== */
.h5grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:14px}
.h5card{display:flex;flex-direction:column;align-items:center;gap:8px;background:var(--panel,#16203a);border:1px solid var(--line,#26304e);border-radius:12px;padding:14px 8px 12px;text-decoration:none;transition:transform .12s,border-color .12s}
.h5card:hover{transform:translateY(-3px);border-color:var(--cyan,#54c9ff)}
.h5icon{width:64px;height:64px;border-radius:14px;overflow:hidden;background:rgba(255,255,255,.06);display:flex;align-items:center;justify-content:center;font-size:30px}
.h5icon img{width:100%;height:100%;object-fit:cover}
.h5name{font-size:13px;color:var(--text,#e8eefb);text-align:center;word-break:break-all;line-height:1.3}
/* GM 卡片下方的「GM工具：怎么开」小字提示（最多两行，超出省略，悬停看全） */
.h5gmtool{font-size:10px;line-height:1.35;color:#ffb98f;text-align:center;word-break:break-all;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-width:100%}

/* ===== 全站滚动条美化（细条 + 暗色） ===== */
* { scrollbar-width: thin; scrollbar-color: rgba(120,140,180,.45) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(120,140,180,.45); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(120,140,180,.7); }
*::-webkit-scrollbar-corner { background: transparent; }

/* ===== 头部用户下拉（会员信息收进菜单） ===== */
.user-drop { position: relative; }
.user-drop summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 13px; border-radius: 9px; font-size: 14px; color: var(--text); white-space: nowrap;
    border: 1px solid transparent;
}
.user-drop summary::-webkit-details-marker { display: none; }
.user-drop summary:hover, .user-drop[open] summary { background: rgba(255,255,255,.06); border-color: var(--line); }
.user-drop .crown { font-size: 13px; }
.user-drop .caret { font-size: 10px; color: var(--muted); }
.user-drop[open] .caret { transform: rotate(180deg); }
.user-menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 80; text-align: left;
    background: #10243b; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
    min-width: 220px; box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
.um-row { display: flex; justify-content: space-between; gap: 18px; font-size: 13px; color: var(--muted); padding: 4px 0; }
.um-row b { color: var(--text); font-weight: 600; }
.um-link { display: block; margin-top: 8px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 13px; color: var(--cyan, #54c9ff); text-decoration: none; }
.um-link:hover { color: #7fd6ff; }

/* ===== 免责条款页 ===== */
.terms { max-width: 860px; }
.terms .term { background: var(--panel, #10243b); border: 1px solid var(--line, #26304e); border-radius: 12px; padding: 16px 20px; margin-bottom: 14px; }
.terms .term h4 { margin: 0 0 6px; font-size: 15px; color: var(--cyan, #54c9ff); }
.terms .term p { margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--muted, #9db0cc); }
.terms .term p b { color: var(--text, #e8eefb); font-weight: 600; }
.disclaimer .dis-link { color: var(--cyan, #54c9ff); text-decoration: none; font-size: 12.5px; white-space: nowrap; }
.disclaimer .dis-link:hover { color: #7fd6ff; }

/* ===== 会员聊天室 ===== */
.chat-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel, #0d1b2e); overflow: hidden; }
.chat-list { height: 420px; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 82%; }
.chat-msg.is-member .chat-name { color: var(--gold); }
.chat-name { font-size: 13px; font-weight: 600; color: var(--cyan); margin-right: 8px; }
.chat-vip { display: inline-block; margin-left: 5px; padding: 0 5px; font-size: 10px; font-style: normal; font-weight: 700;
            color: #1a1200; background: linear-gradient(160deg, #ffd76e, #f0b950); border-radius: 4px; vertical-align: 1px; }
.chat-time { font-size: 11px; color: var(--muted); }
.chat-text { margin-top: 4px; padding: 8px 12px; font-size: 14px; line-height: 1.7; color: var(--text);
             background: rgba(84, 201, 255, .07); border: 1px solid var(--line); border-radius: 10px; word-break: break-word; }
.chat-form { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, .15); }
.chat-form input[type="text"] { flex: 1; }

/* 全站公告条（可折叠）：默认露 3 行，点「展开」看全文 */
.site-notice {
    display: flex; align-items: flex-start; gap: 10px;
    margin-top: 16px; padding: 13px 16px;
    background: rgba(54, 169, 255, .1);
    border: 1px solid rgba(54, 169, 255, .35);
    border-radius: 10px; font-size: 14px; line-height: 1.75; color: #b6dcff;
}
.site-notice-ico { flex: 0 0 auto; line-height: 1.6; }
.site-notice-body {
    flex: 1; min-width: 0; word-break: break-word;
    max-height: 5.25em; overflow: hidden; position: relative;
    transition: max-height .25s ease;
}
.site-notice-body::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2.2em;
    background: linear-gradient(transparent, rgba(10, 30, 50, .95));
    pointer-events: none; opacity: 1; transition: opacity .2s ease;
}
.site-notice.open .site-notice-body { max-height: 200em; }
.site-notice.open .site-notice-body::after { opacity: 0; }
.site-notice-btn {
    flex: 0 0 auto; align-self: flex-start; margin-top: 1px;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; font-size: 12px; cursor: pointer; white-space: nowrap;
    background: rgba(54, 169, 255, .18); color: #b6dcff;
    border: 1px solid rgba(54, 169, 255, .4); border-radius: 7px;
}
.site-notice-btn:hover { background: rgba(54, 169, 255, .3); }
.site-notice-caret { display: inline-block; transition: transform .25s ease; font-size: 10px; }
.site-notice.open .site-notice-caret { transform: rotate(180deg); }

/* ===== 魔兽世界 · 积分兑换 WOW 福利（群服详情页） ===== */
.wow-bene-grid {
    display: grid; gap: 14px; margin-top: 12px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.wow-bene { padding: 16px; display: flex; flex-direction: column; }
.wow-bene-name { font-size: 15.5px; font-weight: 600; color: #eaf4ff; }
.wow-bene-meta {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; margin-top: 12px;
}
.wow-bene-item { font-size: 13px; color: var(--cyan); }
.wow-bene-price { font-size: 17px; color: #ffc759; white-space: nowrap; }
.wow-bene-price b { font-size: 12px; font-weight: 500; color: #8ea6bf; }
.wow-bene-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.wow-bene-label {
    flex: 1 0 100%;                 /* 独占一行，标签始终在输入框上方 */
    font-size: 12px; color: #8ea6bf; letter-spacing: .3px;
}
.wow-bene-input {
    flex: 1 1 130px; min-width: 0;
    padding: 7px 10px; font-size: 13px;
    background: rgba(255, 255, 255, .05); color: #eaf4ff;
    border: 1px solid rgba(255, 255, 255, .14); border-radius: 8px;
}
.wow-bene-input:focus { outline: none; border-color: var(--cyan); }
/* 空值/超长时浏览器原生校验拦截，样式上给出可见反馈 */
.wow-bene-input:invalid:not(:placeholder-shown) { border-color: #ff6b6b; }
.wow-bene-btn { flex: 0 0 auto; }
@media (max-width: 560px) {
    .wow-bene-form { flex-direction: column; align-items: stretch; }
    .wow-bene-input, .wow-bene-btn { width: 100%; }
}

/* ══════════════ 会员到期提醒（layout常驻条 + 弹层）══════════════
   2026-10-05。判定逻辑在 helpers.php 的 membership_expiry_notice()，
   这里只管三档配色：soon 淡蓝 / urgent 橙 / expired 红。
   用现有 --blue/--gold/--red 变量，跟全站深色底不冲突。 */
.mem-expire {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    max-width: 1180px; margin: 14px auto 0; padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid rgba(54, 169, 255, .28);
    background: rgba(54, 169, 255, .08);
    font-size: 14px;
}
.mem-expire-ico { font-size: 16px; line-height: 1; }
.mem-expire-body { flex: 1 1 260px; min-width: 0; color: var(--text); }
.mem-expire-body b { color: var(--blue); font-weight: 600; }
.mem-expire-act { display: flex; gap: 8px; flex: 0 0 auto; }

/* 临期 1~7 天：橙色，别用蓝了——蓝色太像普通提示，用户会忽略 */
.mem-expire-urgent {
    border-color: rgba(255, 200, 107, .45);
    background: rgba(255, 200, 107, .1);
}
.mem-expire-urgent .mem-expire-body b { color: var(--gold); }

/* 已过期：红色，并且要够显眼——这是唯一能挽回的时刻 */
.mem-expire-expired {
    border-color: rgba(255, 125, 147, .5);
    background: rgba(255, 125, 147, .12);
}
.mem-expire-expired .mem-expire-body b { color: var(--red); }

@media (max-width: 560px) {
    .mem-expire { flex-direction: column; align-items: stretch; gap: 10px; }
    .mem-expire-act .btn { flex: 1; }
}

/* ────────────── 到期弹层 ────────────── */
.mexp-pop-mask {
    position: fixed; inset: 0; z-index: 999;
    display: flex; align-items: center; justify-content: center;
    padding: 18px;
    background: rgba(3, 9, 18, .78);
}
.mexp-pop {
    width: 100%; max-width: 400px;
    background: var(--panel); color: var(--text);
    border: 1px solid rgba(255, 200, 107, .4);
    border-radius: var(--radius);
    overflow: hidden;
}
.mexp-pop-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--line);
    font-size: 15px;
}
.mexp-pop-x {
    background: none; border: none; color: var(--muted);
    font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.mexp-pop-x:hover { color: var(--text); }
.mexp-pop-body { padding: 16px; font-size: 14px; line-height: 1.75; }
.mexp-pop-body b { color: var(--gold); font-weight: 600; }
.mexp-pop-act {
    display: flex; gap: 8px; flex-wrap: wrap;
    padding: 0 16px 14px;
}
.mexp-pop-act .btn { flex: 1 1 auto; }
.mexp-pop-foot {
    padding: 10px 16px; font-size: 12px; color: var(--muted);
    background: rgba(255, 255, 255, .03);
    border-top: 1px solid var(--line);
}

/* 弹层里「别急着付费，继续打卡就行」那段弱化处理：
   用次要色 + 稍小字号，让它读起来像顺带一提，而不是新的推销块。 */
.mexp-pop-dim { color: var(--muted); font-size: 13px; }
.mexp-pop-dim b { color: var(--cyan); }

/* 三个按钮在窄屏排一行会挤，480px 以下改为纵向堆叠 */
@media (max-width: 480px) {
    .mexp-pop-act { flex-direction: column; }
    .mexp-pop-act .btn { width: 100%; }
}

/* 首页 hero 底部：开通会员按钮 + 在线会员数并排
   （2026-10-06。原来是 hero 里一个按钮 + 下面一排 stats，其中四项与
    「栏目直达」重复已删，只把不重复的「在线会员」挪到这里做从众信号。） */
.hero-cta { align-items: center; gap: 14px; margin-top: 20px; }
.hero-cta-members { font-size: 13px; color: var(--muted); }
.hero-cta-members b { color: var(--cyan); font-size: 15px; font-weight: 600; }
