/* ============================================================
   模组加加 (ModPlus) 官网 - 全局样式
   深色游戏风格 · 绿色主色 #13B056
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --bg: #0a0a0b;
  --bg-soft: #0f0f11;
  --surface: #151518;
  --surface-2: #1c1c20;
  --surface-3: #26262b;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --primary: #13b056;
  --primary-2: #1fd269;
  --primary-dim: rgba(19, 176, 86, 0.14);
  --accent: #38bdf8;

  --text: #e8eaf0;
  --text-2: #a2a8b6;
  --text-3: #6b7280;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --maxw: 1160px;

  --nav-h: 64px;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---------- 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100%;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { color: #4be28b; }
img { max-width: 100%; }
::selection { background: rgba(19, 176, 86, 0.35); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- 顶部导航（链接靠左） ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; height: 100%; }
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; font-size: 18px;
  margin-right: 28px; flex-shrink: 0;
}
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.brand small { color: var(--text-3); font-weight: 400; font-size: 12px; margin-left: 4px; }
.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav-links li { display: flex; }
.nav-links a {
  display: flex; align-items: center;
  padding: 8px 14px;
  color: var(--text-2); font-size: 15px; font-weight: 500;
  transition: color .15s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--primary-2); font-weight: 600; }

/* ---------- Hero（首页） ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 96px 0 72px;
  background:
    radial-gradient(1000px 500px at 80% -10%, rgba(19, 176, 86, 0.16), transparent 60%),
    radial-gradient(800px 400px at 0% 20%, rgba(56, 189, 248, 0.08), transparent 60%),
    linear-gradient(180deg, #0b0c0e 0%, var(--bg) 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(700px 420px at 50% 0%, #000 20%, transparent 75%);
}
.hero .container { position: relative; z-index: 1; text-align: center; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--primary-dim); border: 1px solid rgba(19, 176, 86, 0.35);
  color: var(--primary-2); font-size: 13px; font-weight: 600;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary-2); box-shadow: 0 0 8px var(--primary-2); }

.hero h1 {
  margin: 22px 0 6px;
  font-size: clamp(34px, 5.4vw, 56px);
  font-weight: 800; letter-spacing: -0.5px; line-height: 1.2;
}
.hero h1 .grad {
  background: linear-gradient(100deg, #4be28b, #22c55e 40%, #38bdf8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { color: var(--text-2); font-size: clamp(16px, 2vw, 20px); margin: 14px auto 34px; max-width: 560px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero-preview { margin-top: 56px; }
.hero-preview img {
  width: 100%; max-width: 920px; border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: 999px;
  font-size: 16px; font-weight: 600; line-height: 1.4;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s, box-shadow .15s, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #0e9a48);
  color: #fff; box-shadow: 0 6px 20px rgba(19, 176, 86, 0.35);
  border-radius: 999px;
}
.btn-primary:hover { background: linear-gradient(135deg, #17c862, #11a851); color: #fff; }
.btn-ghost {
  background: var(--surface-2); color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-lg { padding: 16px 36px; font-size: 18px; }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-icon { font-size: 20px; width: 16px; height: 16px; object-fit: contain; }
/* 超链接风格按钮（绿色版） */
.btn-link-style {
  padding: 16px 20px;
  background: transparent;
  color: var(--primary-2);
  border: none;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 500;
  font-size: 15px;
  box-shadow: none;
  border-radius: 8px;
}
.btn-link-style:hover { background: var(--primary-dim); color: var(--primary-3); text-decoration: underline; }
/* 主按钮与链接按钮同行布局 */
.download-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------- 区块 ---------- */
.section { padding: 72px 0; }
.section.alt { background: var(--bg-soft); }
.section-title { text-align: center; font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--text-2); margin-bottom: 44px; }
.subsection-title { font-size: 20px; font-weight: 700; margin: 28px 0 16px; }

/* 页面头部（内页） */
.page-head { padding: 56px 0 8px; }
.page-head h1 { font-size: 32px; font-weight: 800; }
.page-head .crumb { color: var(--text-3); font-size: 13px; margin-bottom: 8px; }
.page-head p { color: var(--text-2); margin-top: 8px; }

/* ---------- 功能特色卡片 ---------- */
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
  display: grid; grid-template-columns: 46px 1fr; column-gap: 16px;
  align-items: start;
  transition: transform .15s, border-color .15s, background .15s;
}
.feature-card:hover { transform: translateY(-4px); border-color: rgba(19, 176, 86, 0.4); background: var(--surface-2); }
.feature-card .icon {
  grid-column: 1;
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: var(--primary-dim);
  border: 1px solid rgba(19, 176, 86, 0.25);
  box-shadow: inset 0 0 14px rgba(19, 176, 86, 0.08);
}
.feature-card .icon svg {
  width: 22px; height: 22px; color: var(--primary-2);
}
.feature-card h3 { grid-column: 2; font-size: 17px; margin-bottom: 6px; text-align: left; }
.feature-card p { grid-column: 2; color: var(--text-2); font-size: 14px; text-align: left; }

/* ---------- 游戏网格 ---------- */
.game-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.game-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.game-card:hover { transform: translateY(-3px); border-color: rgba(56, 189, 248, 0.4); }
.game-logo {
  height: 96px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.game-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-logo.no-img::before { content: attr(data-name); color: var(--text-3); font-size: 13px; text-align: center; padding: 8px; }
.game-name { padding: 10px 12px 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-foot { display: flex; justify-content: space-between; align-items: center; padding: 4px 12px 12px; }
.game-type { color: var(--text-3); font-size: 12px; }
.game-heat { color: var(--accent); font-size: 12px; }

/* ---------- 下载卡片 ---------- */
.download-card {
  display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 34px;
  box-shadow: var(--shadow);
}
.download-version { font-size: 44px; font-weight: 800; color: var(--primary-2); line-height: 1.1; }
.download-name { color: var(--text-2); margin: 6px 0 18px; }
.download-main .btn { margin-right: 10px; }
.download-tip { color: var(--text-3); font-size: 13px; margin-top: 12px; }
.download-meta { list-style: none; min-width: 220px; }
.download-meta li {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 10px 0; border-bottom: 1px dashed var(--border);
  color: var(--text-2); font-size: 14px;
}
.download-meta li:last-child { border-bottom: none; }
.download-meta b { color: var(--text); font-weight: 600; }

/* ---------- 更新日志 ---------- */
.notice-banner {
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d; border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 28px; font-size: 14px;
  white-space: pre-line;
}
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 2px; background: linear-gradient(180deg, var(--primary), transparent);
}
.tl-item { position: relative; margin-bottom: 30px; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 10px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--primary);
  box-shadow: 0 0 0 4px var(--primary-dim);
}
.tl-date { color: var(--text-3); font-size: 13px; margin-bottom: 4px; }
.tl-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tl-version {
  background: var(--primary-dim); color: var(--primary-2);
  border: 1px solid rgba(19, 176, 86, 0.3);
  padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: 14px;
}
.tl-title { font-size: 18px; font-weight: 700; }
.tl-content p { color: var(--text-2); font-size: 14.5px; margin-bottom: 6px; white-space: pre-line; }
.more-wrap { text-align: center; margin-top: 32px; }

/* ---------- 友情链接 ---------- */
.link-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.link-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  transition: transform .15s, border-color .15s;
}
.link-card:hover { transform: translateY(-3px); border-color: rgba(56, 189, 248, 0.4); }
.link-logo { width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.link-card h3 { font-size: 15px; }
.link-card p { color: var(--text-3); font-size: 13px; }

/* ---------- 文档 / 教程页布局 ---------- */
.docs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; padding: 40px 0 72px; max-width: 1440px; }
/* 大屏：三栏（左导航 + 正文 + 右页面导航） */
@media (min-width: 1280px) {
  .docs-layout { grid-template-columns: 240px minmax(0, 1fr) 220px; gap: 28px; }
}
/* 移动端：侧栏默认隐藏，点击「教程导航」展开 */
.docs-nav-toggle { display: none; }
@media (max-width: 1023px) {
  .docs-nav-toggle {
    display: inline-flex; align-items: center; gap: 8px; width: 100%;
    padding: 10px 14px; margin-bottom: 8px;
    background: var(--surface-2); color: var(--text);
    border: 1px solid var(--border-strong); border-radius: 10px;
    font-size: 14px; font-weight: 600; cursor: pointer;
  }
  .md-side { display: none; }
  .md-side.open { display: block; position: static; }
}
.md-side { position: sticky; top: calc(var(--nav-h) + 20px); }
.md-side-title { font-size: 13px; color: var(--text-3); font-weight: 600; letter-spacing: 1px; margin-bottom: 10px; }
.md-nav { list-style: none; }
.md-nav li { border-left: 1px solid var(--border); }
.md-nav a {
  display: block; padding: 6px 12px; color: var(--text-2); font-size: 13px;
  border-left: 1px solid transparent; margin-left: -1px;
}
.md-nav a:hover { color: var(--text); }
.md-nav a.active { color: var(--primary-2); border-color: var(--primary); background: var(--primary-dim); border-radius: 0 8px 8px 0; }

/* 分组手风琴 */
.md-group { margin-bottom: 2px; }
.md-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 8px 10px; margin: 2px 0;
  background: none; border: none; border-radius: 8px;
  color: var(--text); font-size: 15px; font-weight: 700; letter-spacing: 0.5px;
  cursor: pointer; text-align: left;
}
.md-group-head:hover { background: var(--surface-2); color: var(--text); }
.md-chevron { flex-shrink: 0; color: var(--text-3); transition: transform .2s; }
.md-group-head.collapsed .md-chevron { transform: rotate(-90deg); }
.md-nav.closed { display: none; }

.md-main { min-width: 0; }
.md-body {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px 40px;
}
.md-body h1 { font-size: 28px; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.md-body h2 { font-size: 21px; margin: 30px 0 12px; }
.md-body h3 { font-size: 17px; margin: 22px 0 8px; }
.md-body h4 { font-size: 15px; margin: 16px 0 6px; }
.md-body p { margin-bottom: 12px; color: var(--text-2); }
.md-body ul, .md-body ol { margin: 0 0 12px 22px; color: var(--text-2); }
.md-body li { margin-bottom: 4px; }
.md-body code {
  background: var(--surface-3); color: #7dd3fc;
  padding: 2px 6px; border-radius: 5px; font-size: 13px;
  font-family: Consolas, "Courier New", monospace;
}
.md-body pre {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; overflow-x: auto; margin-bottom: 14px;
}
.md-body pre code { background: none; padding: 0; color: #c9d3e6; }
.md-body blockquote {
  margin: 0 0 14px;
  padding: 0 0 0 16px;
  border-left: 1px solid var(--primary);
  color: var(--text-2);
}
.md-body blockquote > p { margin-bottom: 0; }
.md-body hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 22px 0;
  opacity: 0.6;
}
.md-body table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 14px; }
.md-body th, .md-body td { border: 1px solid var(--border-strong); padding: 8px 12px; text-align: left; }
.md-body th { background: var(--surface-2); }
.md-body img { border-radius: var(--radius-sm); border: 1px solid var(--border); }
.md-body a { color: #3b82f6; text-decoration: none; }
.md-body a:hover { color: #60a5fa; text-decoration: underline; text-underline-offset: 3px; }

/* 右侧页面导航 */
.md-toc-side {
  display: none;
  position: sticky; top: calc(var(--nav-h) + 20px);
  max-height: calc(100vh - var(--nav-h) - 40px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
@media (min-width: 1280px) { .md-toc-side { display: block; } }
.md-toc-side h4 { font-size: 13px; color: var(--text-3); font-weight: 600; letter-spacing: 1px; margin-bottom: 10px; }
.md-page-nav ul { list-style: none; }
.md-page-nav a { display: block; padding: 5px 10px; color: var(--text-2); font-size: 13px; border-radius: 6px; }
.md-page-nav a:hover { color: var(--text); background: var(--surface-2); }
.md-page-nav .toc-l3 { padding-left: 18px; }

.md-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.md-nav-btn {
  flex: 1; max-width: 48%; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; color: var(--text); font-size: 14px;
  display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.md-nav-btn:hover { border-color: var(--primary); }
.md-nav-btn span { color: var(--text-3); font-size: 12px; display: block; }
.md-nav-btn.next { text-align: right; }

/* ---------- 版本信息表格 ---------- */
.table-wrap { overflow-x: auto; }
.version-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.version-table th, .version-table td { border: 1px solid var(--border); padding: 12px 16px; text-align: left; }
.version-table th { background: var(--surface-2); color: var(--text-2); font-weight: 600; }
.version-table tbody tr:nth-child(odd) { background: rgba(255, 255, 255, 0.015); }
.version-table tbody tr:hover { background: var(--surface-2); }
.version-table .v-ver { color: var(--primary-2); font-weight: 700; white-space: nowrap; }
.version-table .v-date { color: var(--text-2); white-space: nowrap; }
.version-table .v-title { color: var(--text-2); }

/* ---------- 状态 ---------- */
.loading, .empty { padding: 40px; text-align: center; color: var(--text-3); font-size: 14px; }
.empty { border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty code { background: var(--surface-3); padding: 2px 6px; border-radius: 4px; }

/* token 验证锁定提示 */
.mp-token-locked {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 24px; text-align: center;
}
.mp-token-icon {
  color: var(--text-3); margin-bottom: 24px;
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.mp-token-title {
  margin: 0 0 8px; font-size: 20px; font-weight: 600; color: var(--text);
}
.mp-token-desc {
  margin: 0; font-size: 14px; color: var(--text-3); line-height: 1.6;
}

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 48px 0 28px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 34px; }
.footer h4 { font-size: 15px; margin-bottom: 12px; }
.footer p, .footer li { color: var(--text-3); font-size: 13.5px; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 8px; }
.footer a { color: var(--text-3); }
.footer a:hover { color: var(--primary-2); }
.footer .desc { margin-top: 8px; }
.footer-links {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px;
  padding: 18px 0 16px;
  margin-bottom: 18px;
}
.footer-links .fl-label { color: var(--text-2); font-size: 13px; font-weight: 600; }
.footer-links a { color: var(--text-3); font-size: 13px; }
.footer-links a:hover { color: var(--primary-2); }

.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 20px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--text-3); font-size: 13px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .nav { overflow-x: auto; overflow-y: hidden; }
  .brand { margin-right: 16px; }
  .brand small { display: none; }
  .nav-links a { padding: 0 12px; font-size: 14px; }
  .docs-layout { grid-template-columns: 1fr; }
  .md-side { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .download-card { padding: 24px; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .md-body { padding: 22px 18px; }
}

/* ---------- 整合包 ---------- */
.mp-search {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-bottom: 28px;
}
.mp-search-input {
  position: relative; flex: 1; min-width: 240px;
}
.mp-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.mp-search-field {
  width: 100%; padding: 11px 16px 11px 40px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .15s, background .15s;
}
.mp-search-field::placeholder { color: var(--text-3); }
.mp-search-field:focus { border-color: rgba(19, 176, 86, 0.5); background: var(--surface); }
.mp-search-select {
  position: relative; display: inline-flex; align-items: center;
}
.mp-search-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 16px; min-width: 160px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 14px; font-family: inherit; cursor: pointer;
  outline: none;
  transition: border-color .15s, background .15s;
}
.mp-search-trigger:hover { border-color: var(--border-strong); }
.mp-search-select[data-open="1"] .mp-search-trigger { border-color: rgba(19, 176, 86, 0.5); background: var(--surface); }
.mp-search-trigger-label { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-search-caret { color: var(--text-3); flex-shrink: 0; transition: transform .2s, color .15s; }
.mp-search-select[data-open="1"] .mp-search-caret { transform: rotate(180deg); color: var(--primary-2); }
.mp-search-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 100%; max-width: 280px;
  list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: var(--shadow);
  max-height: 320px; overflow-y: auto; z-index: 50;
  display: none;
}
.mp-search-select[data-open="1"] .mp-search-menu { display: block; }
.mp-search-menu::-webkit-scrollbar { width: 8px; }
.mp-search-menu::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }
.mp-search-option {
  padding: 9px 12px; border-radius: 8px;
  color: var(--text-2); font-size: 14px; cursor: pointer;
  white-space: nowrap; transition: background .12s, color .12s;
}
.mp-search-option:hover { background: var(--surface-3); color: var(--text); }
.mp-search-option.active { background: var(--primary-dim); color: var(--primary-2); font-weight: 600; }

/* 排序下拉（复用游戏下拉样式） */
.mp-sort-select {
  position: relative; display: inline-flex; align-items: center;
}
.mp-sort-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 16px; min-width: 130px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 14px; font-family: inherit; cursor: pointer; outline: none;
  transition: border-color .15s, background .15s;
}
.mp-sort-trigger:hover { border-color: var(--border-strong); }
.mp-sort-select[data-open="1"] .mp-sort-trigger { border-color: rgba(19, 176, 86, 0.5); background: var(--surface); }
.mp-sort-trigger-label { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-sort-select[data-open="1"] .mp-search-caret { transform: rotate(180deg); color: var(--primary-2); }
.mp-sort-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 100%; max-width: 280px;
  list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: var(--shadow);
  max-height: 320px; overflow-y: auto; z-index: 50; display: none;
}
.mp-sort-select[data-open="1"] .mp-sort-menu { display: block; }
.mp-sort-option {
  padding: 9px 12px; border-radius: 8px;
  color: var(--text-2); font-size: 14px; cursor: pointer;
  white-space: nowrap; transition: background .12s, color .12s;
}
.mp-sort-option:hover { background: var(--surface-3); color: var(--text); }
.mp-sort-option.active { background: var(--primary-dim); color: var(--primary-2); font-weight: 600; }

/* 分类筛选按钮栏（精品模组） */
.mp-cats {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 20px;
}
.mp-cat {
  padding: 7px 14px;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 13px; font-family: inherit; line-height: 1.4;
  cursor: pointer; outline: none; user-select: none;
  transition: border-color .15s, background .15s, color .15s;
}
.mp-cat:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-3); }
.mp-cat.active { background: var(--primary-dim); border-color: var(--primary-2); color: var(--primary-2); font-weight: 600; }

/* 整合包分页器 */
.mp-pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
  margin: 28px 0 8px;
}
.mp-page-btn, .mp-page-num {
  min-width: 36px; height: 36px; padding: 0 12px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .15s, background .15s, color .15s;
}
.mp-page-btn:hover, .mp-page-num:hover { border-color: var(--border-strong); background: var(--surface-3); }
.mp-page-btn.disabled, .mp-page-num.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.mp-page-num.active { background: var(--primary-dim); border-color: var(--primary-2); color: var(--primary-2); font-weight: 600; }
.mp-page-ellipsis { color: var(--text-3); padding: 0 4px; user-select: none; }

/* 跳转到指定页 */
.mp-page-jump { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; color: var(--text-2); font-size: 14px; }
.mp-page-jump-input {
  width: 56px; height: 36px; padding: 0 8px; text-align: center;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .15s;
}
.mp-page-jump-input:focus { border-color: rgba(19, 176, 86, 0.5); }
.mp-page-jump-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mp-page-jump-btn {
  height: 36px; padding: 0 14px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.mp-page-jump-btn:hover { border-color: var(--border-strong); background: var(--surface-3); }
@media (max-width: 640px) {
  .mp-page-jump { margin-left: 0; margin-top: 6px; }
}
@media (max-width: 640px) {
  .mp-search-input, .mp-search-select, .mp-sort-select { min-width: 100%; flex-basis: 100%; }
  .mp-search-trigger, .mp-sort-trigger { min-width: 100%; }
}

.mp-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}
.mp-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .15s, border-color .15s, background .15s;
}
.mp-card:hover { transform: translateY(-3px); border-color: rgba(19, 176, 86, 0.4); background: var(--surface-2); }
.mp-cover {
  position: relative; aspect-ratio: 16 / 9;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.mp-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-cover.no-img::before { content: attr(data-name); color: var(--text-3); font-size: 13px; text-align: center; padding: 8px; }
.mp-game {
  position: absolute; top: 12px; left: 12px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: #fff; font-size: 12px; font-weight: 600;
}
.mp-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.mp-name {
  font-size: 16px; font-weight: 700; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.mp-summary {
  color: var(--text-2); font-size: 13px; line-height: 1.5; margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.mp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mp-tag {
  padding: 2px 8px; border-radius: 5px;
  background: var(--surface-3); color: var(--text-2);
  font-size: 11px;
}
.mp-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0;
  color: var(--text-3); font-size: 12px; margin-bottom: 14px;
}
.mp-meta > span { display: inline-flex; align-items: center; }
.mp-meta .mp-dot { margin: 0 6px; }
.mp-author { cursor: pointer; color: var(--primary); transition: opacity 0.15s; }
.mp-author:hover { opacity: 0.7; text-decoration: underline; }

.mp-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.mp-filter-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; font-size: 13px;
  background: rgba(76, 175, 80, 0.12); border: 1px solid rgba(76, 175, 80, 0.3);
  color: var(--primary); border-radius: 999px;
}
.mp-filter-clear {
  background: none; border: none; cursor: pointer;
  color: var(--primary); font-size: 16px; line-height: 1; padding: 0;
  display: inline-flex; align-items: center; opacity: 0.6;
}
.mp-filter-clear:hover { opacity: 1; }
.mp-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: auto;
}
.mp-size { color: var(--text-3); font-size: 13px; }

@media (max-width: 640px) {
  .mp-grid { grid-template-columns: 1fr; }
}

/* ---------- 整合包详情页 ---------- */
.mp-detail {
  display: grid;
  grid-template-columns: minmax(0, 460px) 1fr;
  gap: 36px;
  align-items: start;
}
.mp-detail-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.mp-detail-cover img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mp-detail-cover.no-img::before {
  content: attr(data-name);
  color: var(--text-3); font-size: 18px; font-weight: 600; text-align: center; padding: 16px;
}
.mp-detail-cover .mp-game {
  top: 14px; left: 14px;
  padding: 5px 12px; font-size: 13px;
}

/* 图片组轮播 */
.mp-carousel { position: relative; }
.mp-carousel-img {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity .3s ease;
  pointer-events: none;
}
.mp-carousel-img.active { opacity: 1; pointer-events: auto; }
.mp-carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 46px;
  background: rgba(0, 0, 0, 0.5); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px; cursor: pointer;
  transition: background .15s, opacity .15s;
  z-index: 2;
}
.mp-carousel-nav:hover { background: rgba(0, 0, 0, 0.75); }
.mp-carousel-prev { left: 12px; }
.mp-carousel-next { right: 12px; }
.mp-carousel-count {
  position: absolute; bottom: 12px; right: 12px;
  padding: 4px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.6); color: #fff;
  font-size: 12px; font-weight: 600;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 2;
}
@media (max-width: 640px) {
  .mp-carousel-nav { width: 32px; height: 40px; }
}

/* 图片灯箱（全屏大图） */
.mp-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  transition: background .2s ease, backdrop-filter .2s ease;
}
.mp-lightbox.show {
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.mp-lightbox-stage {
  position: relative; z-index: 1;
  max-width: 92vw; max-height: 86vh;
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.mp-lightbox-img {
  max-width: 92vw; max-height: 86vh;
  object-fit: contain; display: block;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  opacity: 0; transition: opacity .2s ease;
}
.mp-lightbox.show .mp-lightbox-img { opacity: 1; }
.mp-lightbox-close {
  position: absolute; top: 18px; right: 22px; z-index: 3;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.1); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%; cursor: pointer;
  transition: background .15s, transform .15s;
}
.mp-lightbox-close:hover { background: rgba(255, 255, 255, 0.22); transform: rotate(90deg); }
.mp-lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 50px; height: 60px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.08); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px; cursor: pointer;
  transition: background .15s;
}
.mp-lightbox-nav:hover { background: rgba(255, 255, 255, 0.2); }
.mp-lightbox-prev { left: 24px; }
.mp-lightbox-next { right: 24px; }
.mp-lightbox-count {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 3;
  padding: 5px 16px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  font-size: 13px; font-weight: 600;
}
@media (max-width: 640px) {
  .mp-lightbox-nav { width: 38px; height: 48px; }
  .mp-lightbox-prev { left: 10px; }
  .mp-lightbox-next { right: 10px; }
  .mp-lightbox-close { top: 12px; right: 12px; width: 36px; height: 36px; }
}
.mp-detail-info { min-width: 0; }
.mp-detail-title {
  font-size: clamp(22px, 3vw, 30px); font-weight: 800; line-height: 1.25;
  margin: 0 0 14px; color: var(--text);
}
.mp-detail-intro {
  color: var(--text-2); font-size: 15px; line-height: 1.6;
  padding: 14px 16px; margin: 16px 0 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
}
.mp-detail-desc {
  color: var(--text-2); font-size: 14px; line-height: 1.7;
  margin: 18px 0 22px; white-space: pre-wrap; word-break: break-word;
}
.mp-detail-actions { margin-top: 22px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.mp-detail-dl {
  padding: 12px 30px; font-size: 15px; font-weight: 700;
  border-radius: 10px;
}
.mp-detail-dl:disabled { opacity: 0.7; cursor: not-allowed; }
.mp-detail-dl-tip {
  margin: 0; font-size: 13px; color: var(--text-3);
}
.mp-detail-dl-tip code {
  display: inline-block; padding: 2px 8px; margin: 0 2px;
  background: var(--surface-2); color: var(--primary);
  border-radius: 4px; font-family: Consolas, Monaco, monospace;
  font-size: 12px; cursor: pointer; user-select: all;
}
.mp-detail-dl-tip code:hover { background: var(--surface-3); }

/* 下载地址弹窗 */
.mp-dl-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; }
.mp-dl-modal.show { opacity: 1; }
.mp-dl-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.mp-dl-modal-box {
  position: relative; width: min(420px, 90vw); max-height: 80vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 24px; transform: scale(0.95); transition: transform 0.2s;
}
.mp-dl-modal.show .mp-dl-modal-box { transform: scale(1); }
.mp-dl-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border: none; cursor: pointer;
  background: var(--surface-2); border-radius: 50%; color: var(--text-3);
  font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.mp-dl-modal-close:hover { background: var(--surface-3); color: var(--text); }
.mp-dl-modal-title { font-size: 18px; font-weight: 700; margin: 0 0 6px; color: var(--text); }
.mp-dl-modal-sub { font-size: 13px; color: var(--text-3); margin: 0 0 18px; }
.mp-dl-modal-list { display: flex; flex-direction: column; gap: 10px; }
.mp-dl-modal-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; text-decoration: none; color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.mp-dl-modal-item:hover { border-color: var(--primary); background: rgba(76,175,80,0.08); }
.mp-dl-modal-item-name { font-size: 14px; font-weight: 600; flex: 1; }
.mp-dl-modal-pass { font-size: 12px; color: var(--text-3); }
.mp-dl-modal-pass .mp-dl-copy { color: var(--primary); font-weight: 600; cursor: pointer; user-select: none; transition: opacity 0.15s; }
.mp-dl-modal-pass .mp-dl-copy:hover { opacity: 0.7; }
.mp-dl-modal-pass .mp-dl-copy.copied { color: #4CAF50; }
.mp-dl-modal-item-go { font-size: 13px; color: var(--primary); font-weight: 500; }

.mp-detail-files { margin-top: 36px; }
.mp-detail-files h3 {
  font-size: 18px; font-weight: 700; margin: 0 0 14px; color: var(--text);
}
.mp-file-list {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.mp-file-list:has(+ .mp-file-more) {
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none;
}
.mp-file-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.mp-file-item:last-child { border-bottom: none; }
.mp-file-item:hover { background: var(--surface-2); }
.mp-file-main {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px; align-items: center;
}
.mp-file-name { color: var(--text); font-size: 14px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.mp-file-tag {
  font-size: 11px; font-weight: 400; color: var(--primary);
  padding: 1px 8px; border-radius: 4px; background: rgba(76,175,80,0.12);
}
.mp-file-desc {
  margin: 0; font-size: 12px; color: var(--text-3);
  line-height: 1.6; padding-left: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mp-file-cat {
  color: var(--text-2); font-size: 12px;
  padding: 3px 10px; border-radius: 5px;
  background: var(--surface-3);
}
.mp-file-size { color: var(--text-3); font-size: 12px; min-width: 70px; text-align: right; }
.mp-file-more {
  display: block; width: 100%;
  margin: 0; padding: 12px 18px;
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s;
}
.mp-file-more:hover { background: var(--surface-2); color: var(--primary); }

/* 详细介绍（Markdown 文档） */
.mp-detail-md { margin-top: 36px; }
.mp-detail-md h3 { font-size: 18px; font-weight: 700; margin: 0 0 14px; color: var(--text); }
.mp-detail-md .md-body { padding: 22px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

.mp-detail-disclaimer {
  margin-top: 40px; padding: 18px 22px;
  background: rgba(255, 180, 0, 0.06);
  border: 1px solid rgba(255, 180, 0, 0.2);
  border-radius: var(--radius);
}
.mp-detail-disclaimer h3 {
  font-size: 15px; font-weight: 700; margin: 0 0 8px;
  color: rgba(255, 180, 0, 0.9);
}
.mp-detail-disclaimer p {
  margin: 0; font-size: 13px; line-height: 1.6;
  color: var(--text-2);
}

@media (max-width: 900px) {
  .mp-detail { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 640px) {
  .mp-detail-cover { aspect-ratio: 16 / 9; }
  .mp-file-main { grid-template-columns: 1fr auto; }
  .mp-file-cat { grid-column: 1 / -1; justify-self: start; }
  .mp-file-size { min-width: 0; }
}

/* ========== 视频嵌入（16:9 响应式） ========== */
.video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  margin: 0 0 24px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- 导航下拉「资源」（整合/模组/工具） ---------- */
.nav-item-drop { position: relative; }
.nav-drop-toggle {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  color: var(--text-2); font-size: 15px; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: color .15s;
}
.nav-drop-toggle:hover { color: var(--text); }
.nav-caret { color: var(--text-3); flex-shrink: 0; transition: transform .2s; }
.nav-item-drop:hover .nav-caret, .nav-item-drop:focus-within .nav-caret { transform: rotate(180deg); }
.nav-drop-menu {
  position: absolute; top: 100%; left: 0; min-width: 132px;
  padding: 6px; margin: 0;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: var(--shadow);
  list-style: none; z-index: 120;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.nav-item-drop:hover .nav-drop-menu, .nav-item-drop:focus-within .nav-drop-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-drop-menu a {
  display: block; padding: 9px 12px; border-radius: 8px;
  color: var(--text-2); font-size: 14px; white-space: nowrap;
}
.nav-drop-menu a:hover { background: var(--surface-3); color: var(--text); }
.nav-drop-menu a.active { background: var(--primary-dim); color: var(--primary-2); font-weight: 600; }