/* ===== Material Design 3 - 淡蓝主题 ===== */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
  /* 主色：淡蓝色 */
  --primary: #4F9DFF;
  --primary-hover: #6BABFF;
  --primary-pressed: #3A86E6;
  --on-primary: #FFFFFF;
  --primary-container: #D4E9FF;
  --on-primary-container: #002F6C;
  /* 中性色 */
  --secondary: #5C5F6B;
  --secondary-container: #E1E2EC;
  --on-secondary-container: #44474F;
  /* 表面色（浅色） */
  --surface: #FDFBFF;
  --surface-1: #F2F4FA;
  --surface-2: #E9ECF3;
  --surface-3: #E1E5ED;
  --surface-variant: #E1E2EC;
  --on-surface: #1A1B22;
  --on-surface-variant: #44474F;
  --outline: #74777F;
  --outline-variant: #C4C6D0;
  /* 状态色 */
  --success: #2E7D32;
  --success-container: #C8E6C9;
  --error: #BA1A1A;
  --error-container: #FFDAD6;
  --warning: #C77700;
  --warning-container: #FFE4A8;
  /* 类型颜色 */
  --stable: #2E7D32;
  --stable-container: #C8E6C9;
  --beta: #C62828;
  --beta-container: #FFCDD2;
  /* 阴影 */
  --elev-1: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.08);
  --elev-2: 0 2px 4px rgba(0,0,0,.06), 0 3px 6px rgba(0,0,0,.10);
  --elev-3: 0 4px 8px rgba(0,0,0,.08), 0 6px 12px rgba(0,0,0,.10);
  --elev-4: 0 6px 12px rgba(0,0,0,.10), 0 10px 20px rgba(0,0,0,.12);
  /* 圆角 */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-full: 9999px;
  --sidebar-w: 264px;
  /* MD3 动画缓动 */
  --ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-decel: cubic-bezier(0, 0, 0, 1);
  --ease-emphasized-decelerate: cubic-bezier(0, 0, 0, 1);
}

/* ===== 暗色主题（body.theme-dark 切换） ===== */
body.theme-dark {
  --primary: #8AB4FF;
  --primary-hover: #A1C2FF;
  --primary-pressed: #6FA0F5;
  --on-primary: #002F6C;
  --primary-container: #004A77;
  --on-primary-container: #D4E9FF;
  --secondary: #C4C6D0;
  --secondary-container: #44474F;
  --on-secondary-container: #E1E2EC;
  --surface: #121318;
  --surface-1: #1A1B22;
  --surface-2: #232433;
  --surface-3: #2C2E40;
  --surface-variant: #44474F;
  --on-surface: #E1E2EC;
  --on-surface-variant: #C4C6D0;
  --outline: #8E9099;
  --outline-variant: #44474F;
  --success: #6FCF66;
  --success-container: #1E3A1E;
  --error: #FFB4AB;
  --error-container: #690005;
  --warning: #FFB74D;
  --warning-container: #3E2A00;
  --stable: #6FCF66;
  --stable-container: #1E3A1E;
  --beta: #FF8A80;
  --beta-container: #5C1A1A;
  --elev-1: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.4);
  --elev-2: 0 2px 4px rgba(0,0,0,.3), 0 3px 6px rgba(0,0,0,.5);
  --elev-3: 0 4px 8px rgba(0,0,0,.4), 0 6px 12px rgba(0,0,0,.5);
  --elev-4: 0 6px 12px rgba(0,0,0,.4), 0 10px 20px rgba(0,0,0,.6);
}

/* 一键回顶按钮 */
.back-to-top {
  position: fixed; right: 18px; bottom: 72px; z-index: 44;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff;
  box-shadow: var(--elev-2);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(8px) scale(.85);
  transition: all .25s var(--ease-emphasized);
}
.back-to-top.show {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateY(0) scale(1);
}
.back-to-top:hover { box-shadow: var(--elev-3); transform: translateY(-2px) scale(1.03); }
.back-to-top:active { transform: scale(.94); }
.back-to-top svg { width: 22px; height: 22px; }
body.theme-dark .back-to-top { background: var(--primary); }
@media (max-width: 900px) {
  .back-to-top { right: 14px; bottom: 68px; width: 40px; height: 40px; }
  .back-to-top svg { width: 20px; height: 20px; }
}

/* 主题切换按钮 */
.theme-toggle {
  position: fixed; right: 18px; bottom: 18px; z-index: 45;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--outline-variant);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--on-surface-variant);
  box-shadow: var(--elev-1); transition: all .25s var(--ease-emphasized);
  overflow: hidden; isolation: isolate;
}
.theme-toggle:hover { background: var(--primary-container); color: var(--on-primary-container); transform: translateY(-2px); box-shadow: var(--elev-2); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle svg { width: 22px; height: 22px; }
.theme-toggle .moon { display: none; }
body.theme-dark .theme-toggle .sun { display: none; }
body.theme-dark .theme-toggle .moon { display: block; }
@media (max-width: 900px) { .theme-toggle { right: 14px; bottom: 14px; } }

/* MD3 涟漪效果：点击交互元素产生扩散圆 */
.nav button, .side-link, .tab, .section-label, .tree-leaf, .tree-head,
.ore-btn, .cta-btn, .btn, .dl-btn, .wiki-link, .beian-link, .nav-home, .nav-about {
  position: relative; overflow: hidden; isolation: isolate;
}
.ripple {
  position: absolute; border-radius: 50%;
  background: currentColor; opacity: .22;
  transform: scale(0); pointer-events: none; z-index: 0;
  animation: ripple .6s var(--ease-emphasized) forwards;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
/* MD3 按压反馈 */
.nav button:active, .side-link:active, .tab:active, .section-label:active,
.tree-leaf:active, .ore-btn:active, .cta-btn:active, .btn:active,
.dl-btn:active, .wiki-link:active, .beian-link:active {
  transform: scale(.96); transition: transform .08s var(--ease-standard);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Roboto', 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: var(--surface-1);
  color: var(--on-surface);
  min-height: 100vh;
  line-height: 1.55;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* 全站统一背景图层 */
.bg-layer { position: fixed; inset: 0; z-index: -1; background-size: cover; background-position: center; background-repeat: no-repeat; }
body.has-bg { background: transparent; }
body.has-bg .sidebar { background: rgba(255,255,255,.48); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
body.has-bg .main { background: transparent; }
body.has-bg .hero { background: linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,.18)); border-bottom-color: rgba(0,0,0,.05); }
body.has-bg .topbar { background: rgba(255,255,255,.4); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
body.has-bg .toolbar { background: rgba(255,255,255,.4); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
body.has-bg .ore-panel { background: rgba(255,255,255,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
body.has-bg .card { background: rgba(255,255,255,.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
body.has-bg .card-head { background: rgba(255,255,255,.32); }
body.has-bg .card.beta .card-head { background: rgba(255,205,210,.45); }
body.has-bg .modal { background: rgba(255,255,255,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }

/* 暗色主题 + 背景图：遮罩改为深色 */
body.theme-dark.has-bg .sidebar { background: rgba(18,18,18,.65); }
body.theme-dark.has-bg .hero { background: linear-gradient(180deg, rgba(18,18,18,.35), rgba(18,18,18,.2)); border-bottom-color: rgba(0,0,0,.25); }
body.theme-dark.has-bg .topbar { background: rgba(18,18,18,.55); }
body.theme-dark.has-bg .toolbar { background: rgba(18,18,18,.55); }
body.theme-dark.has-bg .ore-panel { background: rgba(22,22,22,.62); }
body.theme-dark.has-bg .card { background: rgba(28,28,30,.72); }
body.theme-dark.has-bg .card-head { background: rgba(28,28,30,.4); }
body.theme-dark.has-bg .modal { background: rgba(18,18,18,.94); }
body.theme-dark.has-bg .card.beta .card-head { background: rgba(60,20,20,.5); }
body.theme-dark.has-bg .boot-loading { background: var(--surface); }

/* ===== 应用布局 ===== */
.app {
  display: block;
  min-height: 100vh;
}

/* ===== 侧边栏（固定定位，修复底部缺口 + 可伸缩） ===== */
.sidebar {
  background: var(--surface);
  border-right: none;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: fixed;
  left: 0; top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  box-shadow: var(--elev-1);
  z-index: 30;
  transition: width .25s ease, transform .25s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 16px;
  border-bottom: 1px solid var(--outline-variant);
}
.brand-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--primary-container);
}
.brand-icon .grass-top { height: 100%; background: linear-gradient(135deg, var(--primary), var(--primary-hover)); }
.brand-icon .grass-dirt { display: none; }
.brand-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--on-surface);
  line-height: 1.4;
}
.brand-sub { font-size: 12px; color: var(--on-surface-variant); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label {
  font-size: 12px; color: var(--on-surface-variant);
  text-transform: uppercase; letter-spacing: .8px;
  margin: 8px 12px 4px;
  font-weight: 500;
}

/* MD3 导航按钮 */
.nav-home, .nav-contact, .nav-about {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 0 16px; margin-bottom: 2px; height: 48px;
  background: transparent; color: var(--on-surface-variant);
  border: none; border-radius: var(--r-full);
  font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.nav-home svg, .nav-contact svg, .nav-about svg { width: 22px; height: 22px; flex-shrink: 0; }
.nav-home:hover, .nav-contact:hover, .nav-about:hover { background: var(--surface-2); }
.nav-home:focus, .nav-contact:focus, .nav-about:focus { outline: none; }
.nav-home.active, .nav-contact.active, .nav-about.active {
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-weight: 700;
}

/* ===== 版本树 ===== */
.tree { display: flex; flex-direction: column; gap: 1px; }
.tree-node > .tree-children {
  display: none; flex-direction: column; gap: 1px;
  padding-left: 16px; margin-left: 22px;
  border-left: 2px solid var(--outline-variant);
}
.tree-node.open > .tree-children { display: flex; }
.tree-head { display: flex; align-items: center; gap: 4px; }
.chevron {
  background: transparent; border: none; cursor: pointer;
  color: var(--on-surface-variant); width: 24px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1; border-radius: var(--r-xs);
  transition: background .12s, color .12s;
}
.chevron:hover { color: var(--on-surface); background: var(--surface-2); }
.chevron::before { content: '▶'; transition: transform .2s; }
.tree-node.open > .tree-head .chevron::before { transform: rotate(90deg); }

.tree-label {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  background: transparent; border: none;
  color: var(--on-surface-variant); font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; padding: 8px 12px; text-align: left;
  border-radius: var(--r-full); transition: background-color .15s, color .15s;
}
.tree-label:hover { background: var(--surface-2); color: var(--on-surface); }
.section-label.active { color: var(--on-surface); background: var(--primary-container); }
.tree-label .cnt {
  margin-left: auto; font-size: 11px; color: var(--on-surface-variant);
  background: var(--surface-3); padding: 2px 8px; border-radius: var(--r-full); flex-shrink: 0; font-weight: 500;
}
.major-label .mver { font-weight: 700; color: var(--on-surface); }

.tree-leaf {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: none;
  color: var(--on-surface-variant); font-family: inherit; font-size: 13px;
  cursor: pointer; padding: 8px 12px; text-align: left;
  border-radius: var(--r-full); transition: background-color .12s, color .12s;
}
.tree-leaf:hover { color: var(--primary); background: var(--primary-container); }
.leaf-dot { width: 6px; height: 6px; background: var(--outline); border-radius: 50%; flex-shrink: 0; }
.tree-leaf:hover .leaf-dot { background: var(--primary); }
.leaf-ver { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaf-date { font-size: 11px; color: var(--outline); flex-shrink: 0; }


.side-links { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: var(--on-surface-variant);
  text-decoration: none; padding: 12px 16px;
  border-radius: var(--r-full);
  transition: background .12s, color .12s;
}
.side-link:hover { color: var(--on-surface); background: var(--surface-2); }
.side-link svg, .side-link img { width: 20px; height: 20px; flex-shrink: 0; }

/* 管理后台按钮（sidebar 内底部小图标，低存在感） */
.admin-fab {
  margin-top: auto;
  align-self: center;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid var(--outline-variant);
  border-radius: 50%;
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .12s;
  opacity: .6;
}
.admin-fab svg { width: 20px; height: 20px; transition: transform .45s; }
.admin-fab:hover {
  opacity: 1;
  background: var(--primary); color: var(--on-primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.admin-fab:hover svg { transform: rotate(120deg); }
.admin-fab:active { transform: translateY(0); }
.admin-fab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.menu-toggle {
  display: none;
  position: fixed; top: 14px; left: 14px;
  flex-direction: column; gap: 5px;
  align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-full);
  cursor: pointer;
  box-shadow: var(--elev-2);
  z-index: 40;
  transition: all .16s var(--ease-emphasized);
}
.menu-toggle:hover { background: var(--surface-2); box-shadow: var(--elev-3); }
.menu-toggle:active { transform: scale(.92); box-shadow: var(--elev-1); }
.menu-toggle span { width: 20px; height: 2px; background: var(--on-surface); border-radius: 2px; }
body.has-bg .menu-toggle {
  background: rgba(255,255,255,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
body.theme-dark.has-bg .menu-toggle {
  background: rgba(18,18,18,.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
body.theme-dark .menu-toggle { border-color: rgba(255,255,255,.08); }

/* ===== 主内容 ===== */
.main {
  display: flex; flex-direction: column; min-width: 0;
  margin-left: var(--sidebar-w);
  transition: margin-left .25s ease;
}

/* ===== 侧边栏折叠（可伸缩） ===== */
body.sidebar-collapsed { --sidebar-w: 60px; }
body.sidebar-collapsed .sidebar { padding: 16px 6px; }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .side-links,
body.sidebar-collapsed .tree { display: none; }
body.sidebar-collapsed .nav button,
body.sidebar-collapsed .brand { justify-content: center; padding: 8px 0; }
body.sidebar-collapsed .nav button { font-size: 0; gap: 0; padding: 12px 0; }
body.sidebar-collapsed .collapse-btn svg { transform: rotate(180deg); }
body.sidebar-collapsed .admin-fab { width: 40px; height: 40px; }

/* ===== 折叠按钮（fixed 挂在 sidebar 右边缘外侧） ===== */
.collapse-btn {
  position: fixed;
  left: calc(var(--sidebar-w) - 14px);
  top: 28px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: 50%;
  color: var(--on-surface-variant);
  cursor: pointer;
  box-shadow: var(--elev-2);
  z-index: 35;
  padding: 0;
  transition: left .25s ease, background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.collapse-btn:hover {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  box-shadow: var(--elev-3);
}
.collapse-btn:active { box-shadow: var(--elev-1); }
.collapse-btn svg { width: 16px; height: 16px; transition: transform .25s; }
body.sidebar-collapsed .collapse-btn svg { transform: rotate(180deg); }
@media (max-width: 900px) {
  .collapse-btn { display: none; }
}

/* 顶栏（Top App Bar MD3） */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--outline-variant);
  padding: clamp(16px, 3vw, 24px) clamp(16px, 3vw, 32px);
  position: relative;
}
.page-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  color: var(--on-surface);
  letter-spacing: -.2px;
}
.page-sub { font-size: 14px; color: var(--on-surface-variant); margin-top: 4px; font-weight: 400; }
/* H1 关键词辅助文本：视觉隐藏，仅搜索引擎/屏幕阅读器可见 */
.page-h1-extra {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  margin: -1px; padding: 0; border: 0;
}

.toolbar {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
  padding: clamp(12px, 2vw, 16px) clamp(16px, 3vw, 32px);
  background: var(--surface);
  border-bottom: 1px solid var(--outline-variant);
  position: sticky; top: 0; z-index: 10;
}
.search-wrap {
  flex: 1 1 260px; display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--outline-variant);
  border-radius: var(--r-full);
  height: 44px;
  padding: 0 16px;
  transition: border-color .15s, background .15s;
}
.search-wrap:focus-within { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px var(--primary-container); }
.search-wrap svg { width: 20px; height: 20px; color: var(--on-surface-variant); flex-shrink: 0; }
.search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--on-surface); font-family: inherit; font-size: 14px; padding: 8px 0;
}
.search-input::placeholder { color: var(--outline); }

.tabs { display: flex; background: var(--surface-2); border-radius: var(--r-full); padding: 4px; gap: 4px; }
.tab {
  font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 0 20px; height: 36px; background: transparent; color: var(--on-surface-variant);
  border: none; cursor: pointer; letter-spacing: .2px; border-radius: var(--r-full);
  transition: background-color .15s, color .15s;
}
.tab:hover { color: var(--on-surface); }
.tab.active { background: var(--primary); color: var(--on-primary); box-shadow: var(--elev-1); }

/* ===== 版本列表 ===== */
.version-list {
  display: flex; flex-direction: column; gap: 26px;
  padding: clamp(16px, 3vw, 24px) clamp(16px, 3vw, 32px);
}

/* 大版本分组 */
.ver-group { display: flex; flex-direction: column; }
.ver-group-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.ver-group-bar {
  width: 4px; height: 22px; border-radius: var(--r-full); flex-shrink: 0;
  background: var(--primary);
}
.ver-group[data-type="beta"] .ver-group-bar { background: var(--beta); }
.ver-group-title {
  font-size: 17px; font-weight: 700; color: var(--on-surface);
  flex-shrink: 0;
}
.ver-group[data-type="beta"] .ver-group-title { color: var(--beta); }
.ver-group-count { font-size: 13px; color: var(--on-surface-variant); flex-shrink: 0; }
.ver-group-line { flex: 1; height: 1px; background: var(--outline-variant); }
.ver-group-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}

/* 卡片（MD3 Card） */
.card {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  box-shadow: var(--elev-1);
  border-radius: var(--r-md);
  display: flex; flex-direction: column;
  /* 展开面板（dl-panel）、beta 顶部的顶条都要允许外溢可见，
     故不再用 overflow: clip 硬裁，顶条改用 ::before + border-box mask 精确贴合圆角，
     同时 .card-head 顶部同步做内圆角，彻底消除"直角边"。*/
  overflow: visible;
  transition: box-shadow .18s, transform .18s, border-color .18s;
  animation: cardIn .25s ease;
  position: relative;
  z-index: 0;
}
/* 顶条：绝对定位，顶部左右两侧做椭圆弧裁切贴合父 16px 圆角
   （外圆角 16px - 1px 边框 = 内圆角 15px。高=4，所以用椭圆 border-radius rx=15 / ry=4，
   两条弧线 x²/15² + y²/4² = 1 与父圆角 x² + y² = 15² 在 y=4 处完全共点，顶条不会露出直角，
   同时允许 .card overflow: visible → dl-panel 展开面板不被裁。*/
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--primary);
  border-top-left-radius: calc(var(--r-md) - 1px) 4px;
  border-top-right-radius: calc(var(--r-md) - 1px) 4px;
  pointer-events: none;
  z-index: 3;
}
.card.beta::before { background: var(--beta); }
.card:hover { transform: translateY(-3px); box-shadow: var(--elev-3); border-color: var(--primary); transition: transform .25s var(--ease-emphasized), box-shadow .25s var(--ease-emphasized), border-color .2s var(--ease-standard); }
.card.beta:hover { border-color: var(--beta); }

@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card-head {
  background: var(--surface-2);
  border-bottom: 1px solid var(--outline-variant);
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 2;
  position: relative;
  /* 顶部圆角对齐卡片，避免方块色块卡在 card 圆角里产生直角边 */
  border-top-left-radius: calc(var(--r-md) - 1px);
  border-top-right-radius: calc(var(--r-md) - 1px);
}
.card.beta .card-head { background: var(--beta-container); }
.card-head .ver {
  font-size: 15px; font-weight: 700; color: var(--on-surface); word-break: break-all;
}
.badge {
  font-size: 11px; font-weight: 500;
  padding: 4px 10px; border-radius: var(--r-full); letter-spacing: .2px; flex-shrink: 0; margin-left: 8px;
}
.badge.stable { background: var(--primary); color: var(--on-primary); }
.badge.beta { background: var(--beta); color: #fff; }

.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: visible; min-width: 0; }
.date-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on-surface-variant); font-weight: 500; min-width: 0; }
.date-row svg { width: 18px; height: 18px; color: var(--primary); }
.date-row.unknown { color: var(--outline); opacity: .8; }

.downloads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; min-width: 0; }
.dl-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 12px; height: 40px;
  width: 100%; max-width: 100%; min-width: 0;
  font-family: inherit; font-size: 13px; font-weight: 500;
  text-decoration: none; border: none; letter-spacing: .2px; cursor: pointer;
  border-radius: var(--r-full); transition: box-shadow .12s, filter .12s;
  box-sizing: border-box;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dl-btn:hover { filter: brightness(1.08); box-shadow: var(--elev-1); }
.dl-btn:active { filter: brightness(.92); }
.dl-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.dl-v7a { background: var(--primary); color: var(--on-primary); }
.dl-v8a { background: var(--secondary-container); color: var(--on-secondary-container); border: 1px solid var(--outline); }
.dl-win { background: #6366F1; color: #FFFFFF; }
body.theme-dark .dl-win { background: #818CF8; color: #0F172A; }
.dl-disabled { background: var(--surface-3); color: var(--outline); cursor: not-allowed; opacity: .6; }
.dl-disabled:hover { filter: none; box-shadow: none; }

.wiki-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.wiki-link {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 16px; height: 40px; font-size: 13px; font-weight: 500; text-decoration: none;
  background: transparent; border: 1px solid var(--outline); color: var(--on-surface);
  border-radius: var(--r-full); transition: background .12s, color .12s, border-color .12s;
}
.wiki-link:hover { background: var(--surface-2); color: var(--primary); border-color: var(--primary); }

/* 卡片底部操作栏：wiki / 下载计数 */
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.card-foot .wiki-link { flex: 1; min-width: 120px; }
.dl-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; }
.dl-count { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; height: 32px; font-size: 12px; color: var(--on-surface-variant); background: var(--surface-2); border-radius: var(--r-full); white-space: nowrap; }
.dl-count svg { width: 14px; height: 14px; }

/* ========== 多文件下载：展开面板（v7a/v8a 多包体） ========== */
.dl-col.dl-multi {
  position: relative;
}
.dl-toggle {
  width: 100%;
}
.dl-toggle .chev-down {
  width: 14px; height: 14px;
  margin-left: 4px;
  transition: transform .18s var(--ease-standard);
}
.dl-multi.open .dl-toggle .chev-down {
  transform: rotate(180deg);
}
.dl-multi.open .dl-toggle[aria-expanded="true"] {
  box-shadow: var(--elev-2);
}
.dl-panel {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translateX(-50%) translateY(-4px);
  width: min(320px, calc(100vw - 32px));
  min-width: 230px;
  z-index: 50;
  background: var(--surface, #fff);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-md);
  box-shadow: var(--elev-3);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s var(--ease-standard), transform .18s var(--ease-emphasized-decelerate), visibility 0s linear .16s;
}
.dl-multi.open .dl-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity .16s var(--ease-standard), transform .18s var(--ease-emphasized-decelerate), visibility 0s;
}
.dl-panel-arrow {
  position: absolute;
  left: 50%;
  top: -7px;
  transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px;
  background: var(--surface, #fff);
  border-left: 1px solid var(--outline-variant);
  border-top: 1px solid var(--outline-variant);
}
.dl-panel-title {
  padding: 4px 10px 8px;
  font-size: 12px;
  color: var(--on-surface-variant);
  font-weight: 600;
  border-bottom: 1px dashed var(--outline-variant);
  margin-bottom: 4px;
  letter-spacing: .2px;
}
.dl-sub-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface);
  background: var(--surface-2);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  position: relative;
}
.dl-sub-btn:hover {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border-color: var(--outline-variant);
}
.dl-sub-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.dl-sub-btn .dl-sub-label { flex: 1; min-width: 0; }
/* 让每个架构的按钮继承主题色（v7a/v8a/Windows），面板内按钮 hover 时不失去身份 */
.dl-sub-btn.dl-v7a svg, .dl-sub-btn.dl-v7a:hover svg { color: var(--primary); }
.dl-sub-btn.dl-v8a svg, .dl-sub-btn.dl-v8a:hover svg { color: var(--on-secondary-container); }
.dl-sub-btn.dl-win svg, .dl-sub-btn.dl-win:hover svg { color: #6366F1; }
body.theme-dark .dl-sub-btn.dl-win svg { color: #818CF8; }
/* 小屏下把面板宽度拉满列宽 */
@media (max-width: 480px) {
  .dl-panel { min-width: 0; width: 100%; left: 0; transform: translateY(-4px); }
  .dl-multi.open .dl-panel { transform: translateY(0); }
  .dl-panel-arrow { left: 20%; }
}

/* ===== 后台：版本多文件变体编辑器 ===== */
.variant-editor {
  border: 1px dashed var(--outline-variant);
  border-radius: var(--r-sm);
  padding: 8px 14px 14px;
  background: var(--surface-1);
}
.variant-editor summary {
  cursor: pointer;
  padding: 8px 0;
  font-weight: 600;
  color: var(--on-surface-variant);
  outline: none;
  user-select: none;
}
.variant-editor summary:hover { color: var(--primary); }
.variant-editor[open] summary { color: var(--primary); margin-bottom: 8px; }
.variant-block {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.variant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
  flex-wrap: wrap;
}
.variant-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--on-surface);
}
.variant-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.variant-row {
  display: grid;
  grid-template-columns: minmax(160px, 2fr) minmax(220px, 5fr) auto;
  gap: 8px;
  align-items: center;
}
.variant-row input {
  width: 100%;
  box-sizing: border-box;
}
.var-del {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 20px !important;
  line-height: 1;
  color: var(--error) !important;
  border-radius: var(--r-full) !important;
}
.var-del:hover { background: var(--error-container) !important; color: var(--error) !important; }
.variant-hint {
  margin-top: 8px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--on-surface-variant);
  background: var(--surface-2);
  border-radius: var(--r-xs);
  border-left: 3px solid var(--primary);
}
.btn-sm {
  padding: 4px 12px !important;
  height: 30px !important;
  font-size: 12px !important;
}
@media (max-width: 540px) {
  .variant-row {
    grid-template-columns: 1fr;
  }
  .var-del { width: 100%; }
}

/* 主页公告栏目 */
.announcement {
  max-width: 920px; margin: 0 auto 20px; padding: 16px 20px;
  background: var(--warning-container); border-left: 4px solid var(--warning);
  border-radius: var(--r-sm); display: flex; align-items: flex-start; gap: 12px;
  box-shadow: var(--elev-1);
}
.announcement::before { content: '📢'; font-size: 18px; flex-shrink: 0; line-height: 1.5; }
.announcement .md { flex: 1; }
.announcement .md p { margin: 0; }
.announcement .md p + p { margin-top: 6px; }

/* 版本卡片高亮（从复制链接进入时） */
.card.highlight { animation: cardHighlight 2.6s var(--ease-emphasized); border-color: var(--primary); }
@keyframes cardHighlight {
  0% { box-shadow: 0 0 0 0 var(--primary); transform: scale(1); }
  15% { box-shadow: 0 0 0 4px var(--primary); transform: scale(1.02); }
  40% { box-shadow: 0 0 0 4px var(--primary); transform: scale(1.02); }
  100% { box-shadow: 0 0 0 0 transparent; transform: scale(1); }
}

.empty {
  text-align: center; padding: 60px 20px;
  font-size: 14px; color: var(--on-surface-variant); line-height: 1.8;
}
.empty .creeper { font-size: 48px; margin-bottom: 16px; display: block; }
.empty .hint { font-size: 12px; margin-top: 12px; color: var(--outline); }

/* ===== 页脚 ===== */
.footer { margin-top: auto; text-align: center; padding: 0; }
.grass-line { display: none; }
.footer p { padding: 16px 16px 8px; font-size: 12px; color: var(--on-surface-variant); line-height: 1.7; }
/* 备案号链接 */
.footer-beian { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; padding: 0 16px 16px; }
.beian-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--on-surface-variant);
  text-decoration: none;
  transition: color .15s;
}
.beian-link:hover { color: var(--primary); }
.beian-icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ===== 后台弹窗（MD3 Dialog） ===== */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.overlay.show { display: flex; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border: none;
  box-shadow: var(--elev-4);
  border-radius: var(--r-lg);
  width: 100%; max-width: 720px; max-height: 90vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.modal-head {
  background: transparent; border-bottom: 1px solid var(--outline-variant);
  padding: 20px 24px 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head h2 { font-size: 22px; font-weight: 700; color: var(--on-surface); }
.modal-close {
  background: var(--surface-2); color: var(--on-surface-variant);
  border: none; width: 36px; height: 36px;
  border-radius: var(--r-full); font-size: 20px; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.modal-close:hover { background: var(--surface-3); color: var(--on-surface); }
.modal-body { padding: 16px 24px 24px; }

/* 表单（MD3 Text Field） */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: var(--on-surface-variant); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface-2);
  border: 1px solid var(--outline-variant); color: var(--on-surface);
  font-family: inherit; font-size: 14px; padding: 12px 14px;
  border-radius: var(--r-xs);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-container);
}
.field textarea { resize: vertical; min-height: 80px; font-family: inherit; }
/* MD3 Switch（隐藏原生 checkbox，绘制 track + 圆形 thumb） */
.switch-field { padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--outline-variant); border-radius: var(--r-xs); }
.md-switch-row { display: flex; align-items: center; gap: 14px; width: 100%; }
.md-switch {
  position: relative; flex-shrink: 0; display: inline-block;
  width: 52px; height: 32px;
  -webkit-tap-highlight-color: transparent;
}
.md-switch input[type="checkbox"] {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%;
  margin: 0; padding: 0; cursor: pointer; z-index: 3;
}
.md-switch-track {
  position: absolute; inset: 0;
  width: 52px; height: 32px; border-radius: 9999px;
  background: var(--surface-3);
  border: 2px solid var(--outline);
  box-sizing: border-box;
  transition: background .25s var(--ease-emphasized), border-color .25s var(--ease-emphasized);
  overflow: visible;
}
.md-switch-thumb {
  position: absolute; top: 50%; left: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--outline);
  transform: translateY(-50%);
  transition: transform .3s var(--ease-emphasized), background .25s var(--ease-emphasized),
              width .25s var(--ease-emphasized), height .25s var(--ease-emphasized), left .3s var(--ease-emphasized);
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.md-switch-thumb::after {
  content: ''; position: absolute; inset: 50%;
  width: 40px; height: 40px; border-radius: 50%;
  background: currentColor; opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  transition: opacity .3s, transform .45s var(--ease-emphasized);
  pointer-events: none;
}
/* ON 状态 */
.md-switch input:checked + .md-switch-track {
  background: var(--primary); border-color: var(--primary);
}
.md-switch input:checked + .md-switch-track .md-switch-thumb {
  left: calc(100% - 6px);
  width: 24px; height: 24px;
  background: var(--on-primary);
  transform: translate(-100%, -50%);
  color: var(--primary);
}
/* Hover 状态层 */
.md-switch:hover .md-switch-track::before {
  content: ''; position: absolute; inset: -6px; border-radius: 9999px;
  background: currentColor; opacity: .08; pointer-events: none;
}
.md-switch { color: var(--on-surface); }
.md-switch input:checked + .md-switch-track { color: var(--primary); }
.md-switch:has(input:checked) { color: var(--primary); }
/* Pressed：thumb 放大 + 涟漪 */
.md-switch:active .md-switch-thumb {
  width: 22px !important; height: 22px !important;
}
.md-switch input:checked:active + .md-switch-track .md-switch-thumb {
  width: 30px !important; height: 30px !important;
}
.md-switch:active .md-switch-thumb::after {
  opacity: .18; transform: translate(-50%, -50%) scale(1);
}
/* Focus ring */
.md-switch input:focus-visible + .md-switch-track {
  box-shadow: 0 0 0 3px var(--primary-container), 0 0 0 1px var(--primary);
}
/* Disabled */
.md-switch input:disabled { cursor: not-allowed; }
.md-switch input:disabled + .md-switch-track {
  background: color-mix(in srgb, var(--on-surface) 12%, transparent);
  border-color: color-mix(in srgb, var(--on-surface) 18%, transparent);
}
.md-switch input:disabled + .md-switch-track .md-switch-thumb {
  background: color-mix(in srgb, var(--on-surface) 38%, transparent);
}
.md-switch input:checked:disabled + .md-switch-track {
  background: color-mix(in srgb, var(--on-surface) 12%, transparent);
  border-color: color-mix(in srgb, var(--on-surface) 12%, transparent);
}
.md-switch input:checked:disabled + .md-switch-track .md-switch-thumb {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

/* 开关文字标签 */
.md-switch-label {
  flex: 1 1 auto;
  font-size: 13px; line-height: 1.5; color: var(--on-surface); font-weight: 500;
  cursor: pointer; user-select: none;
}

/* 旧版 checkbox-field/cb-label 保留以防他用 */
.checkbox-field { margin-bottom: 16px; display: flex; align-items: flex-start; }
.cb-label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--on-surface); font-weight: 500; cursor: pointer; user-select: none; }
.cb-label input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 按钮（MD3 Button） */
.btn {
  font-family: inherit; font-size: 13px; font-weight: 500; letter-spacing: .2px;
  padding: 0 22px; height: 42px;
  border: none; cursor: pointer;
  border-radius: var(--r-full); transition: box-shadow .12s, filter .12s, background .12s;
}
.btn:hover { filter: brightness(1.08); box-shadow: var(--elev-1); }
.btn:active { filter: brightness(.92); box-shadow: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-danger { background: var(--error); color: #fff; }
.btn-ghost { background: var(--surface-2); color: var(--on-surface); border: 1px solid var(--outline-variant); }
.btn-block { width: 100%; }

.admin-section {
  border: 1px solid var(--outline-variant);
  padding: 20px; margin-bottom: 16px;
  background: var(--surface);
  border-radius: var(--r-md);
}
.admin-section h3 {
  font-size: 15px; font-weight: 700; color: var(--on-surface);
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--outline-variant);
}
.msg { font-size: 13px; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--r-xs); font-weight: 500; }
.msg.ok { background: var(--success-container); color: var(--success); }
.msg.err { background: var(--error-container); color: var(--error); }
.import-hint {
  font-size: 12px; color: var(--on-surface-variant); line-height: 1.7;
  margin-bottom: 12px; padding: 12px 14px;
  background: var(--surface-2); border-left: 3px solid var(--primary);
  border-radius: var(--r-xs); word-break: break-word;
}
.import-hint code {
  background: var(--surface-3); color: var(--on-surface);
  padding: 1px 6px; border-radius: 6px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px; display: inline-block; max-width: 100%; overflow-wrap: anywhere;
}
.txt-muted { color: var(--on-surface-variant); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

.admin-list {
  max-height: 320px; overflow-y: auto;
  border: 1px solid var(--outline-variant); border-radius: var(--r-sm);
}
.admin-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--outline-variant); font-size: 14px;
}
.admin-row:last-child { border-bottom: none; }
.admin-row .ver { font-size: 14px; font-weight: 500; color: var(--on-surface); }
.admin-row .meta { color: var(--on-surface-variant); font-size: 12px; flex: 1; }
.admin-row button { padding: 0 14px; height: 32px; font-size: 12px; }

/* ===== 侧边栏遮罩 ===== */
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.32);
  z-index: 49; opacity: 0; pointer-events: none; transition: opacity .25s;
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
  :root { --sidebar-w: 220px; }
  .sidebar { padding: 14px 10px; gap: 14px; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    position: fixed; top: 0; left: 0; width: 280px; max-width: 84vw; z-index: 50;
    transform: translateX(-100%); transition: transform .25s;
  }
  .sidebar.open { transform: none; box-shadow: var(--elev-4); }
  .menu-toggle { display: flex; }
  .collapse-btn { display: none; }
  /* 避让左上角固定菜单按钮（44px 圆形 + 间距） */
  .topbar { padding-top: 68px; padding-left: 20px; padding-right: 20px; }
  .topbar { text-align: center; }
  .hero { padding-top: 84px; }
}

@media (max-width: 700px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-wrap { flex: 1 1 auto; }
  .tabs { justify-content: stretch; }
  .tab { flex: 1; text-align: center; }
  .topbar { text-align: center; }
}

@media (max-width: 560px) {
  .downloads { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .card-head .ver { font-size: 13px; }
  .badge { font-size: 10px; padding: 3px 8px; }
  .modal {
    max-width: 100%; max-height: 100vh; height: 100vh;
    border-radius: 0;
  }
  .modal-body { padding: 16px; }
  .page-title { font-size: 18px; }
  .page-sub { font-size: 12px; }
}

@media (max-width: 380px) {
  .brand-sub { display: none; }
  .version-list { padding: 12px; }
  .leaf-date { display: none; }
}

@media (min-width: 1600px) {
  .version-list { max-width: 1500px; margin-left: auto; margin-right: auto; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== 首页 ===== */
.home-view, .about-view { min-height: 100%; }

/* Hero */
.hero {
  position: relative; padding: clamp(40px, 7vw, 72px) clamp(20px, 5vw, 56px);
  background: linear-gradient(135deg, var(--primary-container) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--outline-variant);
}
.hero-inner { position: relative; z-index: 2; max-width: 880px; margin: 0 auto; text-align: center; }
.hero-title {
  font-size: clamp(28px, 6vw, 48px); font-weight: 700; color: var(--on-surface);
  letter-spacing: -.4px; margin-bottom: 8px;
}
.hero-sub { font-size: clamp(15px, 2vw, 18px); color: var(--on-surface-variant); margin-bottom: 24px; font-weight: 400; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* 主页统计按钮（正式版/测试版） */
.cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 500;
  padding: 0 8px 0 20px; height: 44px;
  border: 1px solid transparent; border-radius: var(--r-full);
  cursor: pointer; text-decoration: none;
  transition: box-shadow .15s, filter .12s, background .15s, border-color .15s;
}
.cta-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.cta-btn:hover { filter: brightness(1.06); box-shadow: var(--elev-1); }
.cta-btn:active { filter: brightness(.94); box-shadow: none; }
.cta-label { font-weight: 600; }
.cta-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 8px;
  border-radius: var(--r-full);
  font-size: 13px; font-weight: 700; line-height: 1;
}
/* 正式版：filled primary 蓝色填充 */
.cta-stable { background: var(--primary); color: var(--on-primary); }
.cta-stable:hover { background: var(--primary-hover); }
.cta-stable .cta-count { background: rgba(0,0,0,.22); color: #fff; }
/* 测试版：tonal beta 浅红填充 + 红边 */
.cta-beta {
  background: var(--beta-container);
  color: var(--beta);
  border-color: var(--beta);
}
.cta-beta:hover { background: #FFB0B6; }
.cta-beta .cta-count { background: var(--beta); color: #fff; }

/* 主页搜索框（版本数量按钮下方） */
.home-search {
  position: relative; display: flex; align-items: center;
  width: 100%; max-width: 100%; margin-top: 18px;
}
.home-search-icon {
  position: absolute; left: 14px;
  width: 18px; height: 18px; color: var(--on-surface-variant);
  pointer-events: none;
}
.home-search-input {
  width: 100%; height: 44px;
  padding: 0 16px 0 42px;
  font-family: inherit; font-size: 14px; color: var(--on-surface);
  background: var(--surface); border: 1px solid var(--outline-variant);
  border-radius: var(--r-full); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.home-search-input::placeholder { color: var(--on-surface-variant); }
.home-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-container);
}

/* MD3 按钮（首页） */
.ore-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-size: 14px; font-weight: 500; color: var(--on-primary);
  padding: 0 24px; height: 40px;
  background: var(--primary); border: none; border-radius: var(--r-full);
  cursor: pointer; text-decoration: none; transition: box-shadow .12s, filter .12s, background .12s;
}
.ore-btn:hover { background: var(--primary-hover); box-shadow: var(--elev-1); }
.ore-btn:active { background: var(--primary-pressed); }
.ore-btn.sm { font-size: 13px; padding: 0 16px; height: 32px; }
.ore-btn.ghost {
  background: transparent; color: var(--primary);
  border: 1px solid var(--outline-variant);
}
.ore-btn.ghost:hover { background: var(--surface-3); color: var(--primary); }
.ore-btn.disabled { background: var(--surface-3); color: var(--outline); cursor: not-allowed; pointer-events: none; }

/* ===== Turnstile 下载验证模态 ===== */
.cf-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.cf-modal[hidden] { display: none; }
.cf-modal-mask {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(3px);
  animation: cfFadeIn .18s ease;
}
.cf-modal-box {
  position: relative;
  width: min(440px, 100%);
  background: var(--surface);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-md);
  box-shadow: var(--elev-5);
  padding: 22px 20px 18px;
  animation: cfPopIn .22s var(--ease-emphasized-decelerate);
}
.cf-modal-close {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--on-surface-variant);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.cf-modal-close:hover { background: var(--surface-3); color: var(--on-surface); }
.cf-modal-title {
  margin: 0 0 6px; font-size: 18px; font-weight: 600; color: var(--on-surface);
}
.cf-modal-desc {
  margin: 0 0 14px; font-size: 13px; color: var(--on-surface-variant); line-height: 1.55;
}
.cf-modal-widget {
  min-height: 68px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px dashed var(--outline-variant);
  border-radius: var(--r-sm);
  padding: 10px;
}
.cf-modal-status {
  min-height: 18px; margin-top: 10px;
  font-size: 12.5px; line-height: 1.4; color: var(--on-surface-variant);
  text-align: center;
}
.cf-modal-status.err { color: var(--error, #b3261e); }
.cf-modal-status.loading::before {
  content: ''; display: inline-block;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--outline-variant);
  border-top-color: var(--primary);
  vertical-align: -2px; margin-right: 6px;
  animation: cfSpin .8s linear infinite;
}
.cf-modal-actions {
  margin-top: 14px; display: flex; justify-content: flex-end; gap: 8px;
}
@keyframes cfFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cfPopIn  { from { opacity: 0; transform: translateY(8px) scale(.97);} to { opacity: 1; transform: none; } }
@keyframes cfSpin  { to { transform: rotate(360deg); } }
@media (max-width: 420px) {
  .cf-modal-box { padding: 18px 14px 14px; }
  .cf-modal-title { font-size: 16px; }
  .cf-modal-widget iframe { max-width: 100% !important; }
}

/* 主体面板 */
.page-body { max-width: 880px; margin: 0 auto; padding: clamp(20px, 3vw, 32px) clamp(16px, 4vw, 24px) 48px; position: relative; z-index: 0; }
.ore-panel {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-md);
  padding: 24px; margin-bottom: 16px;
  box-shadow: var(--elev-1);
  position: relative;
  z-index: 0;
  overflow: visible;
}
.ore-h2 {
  font-size: 16px; font-weight: 700; color: var(--on-surface);
  margin-bottom: 16px; padding-left: 12px; border-left: 3px solid var(--primary);
}

/* 列表 */
.link-list, .note-list { list-style: none; padding: 0; margin: 0; }
.link-list li, .note-list li {
  padding: 10px 0; border-bottom: 1px solid var(--outline-variant);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 14px; color: var(--on-surface);
}
.link-list li:last-child, .note-list li:last-child { border-bottom: none; }
.ore-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.ore-link:hover { text-decoration: underline; color: var(--primary-pressed); }
.ore-link.inline { display: inline; }
.tag-mine {
  font-size: 11px; padding: 2px 10px;
  background: var(--primary); color: var(--on-primary);
  border-radius: var(--r-full); font-weight: 500;
}

/* 最新版本 */
.latest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.ver-box {
  background: var(--surface-2);
  border: 1px solid var(--outline-variant); border-radius: var(--r-md);
  padding: 18px;
  position: relative;
  overflow: visible;
  z-index: 0;
  min-width: 0;
}
.vb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.vb-tag { font-size: 11px; padding: 4px 10px; border-radius: var(--r-full); color: #fff; font-weight: 500; }
.vb-tag.green { background: var(--primary); }
.vb-tag.red { background: var(--beta); }
.vb-ver { font-size: 14px; font-weight: 700; color: var(--on-surface); }
.vb-info { list-style: none; padding: 0; margin: 0 0 14px; }
.vb-info li { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; color: var(--on-surface-variant); border-bottom: 1px solid var(--outline-variant); }
.vb-info li:last-child { border-bottom: none; }
.vb-info li b { color: var(--on-surface); font-weight: 500; }
.vb-dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; min-width: 0; position: relative; overflow: visible; }
.vb-dl .dl-btn { font-size: 12px; height: 38px; padding: 0 8px; gap: 4px; }
.vb-dl .dl-btn svg { width: 14px; height: 14px; }

/* 架构说明表 */
.ore-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ore-table th, .ore-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--outline-variant); }
.ore-table th { color: var(--on-surface); font-weight: 700; font-size: 13px; background: var(--surface-2); }
.ore-table td { color: var(--on-surface); }
.ore-table tr:last-child td { border-bottom: none; }

/* 系统识别卡片 */
.detect-card {
  display: flex; align-items: center; gap: 20px;
  padding: 18px 20px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  border: 1px solid var(--outline-variant);
}
.detect-icon {
  flex-shrink: 0;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-container);
  color: var(--on-primary-container);
  border-radius: var(--r-md);
}
.detect-icon svg { width: 32px; height: 32px; }
.detect-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.detect-row {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 14px;
}
.detect-label {
  flex-shrink: 0; min-width: 72px;
  color: var(--on-surface-variant);
  font-size: 13px;
}
.detect-val {
  color: var(--on-surface);
  font-weight: 600;
}
.detect-jump {
  margin-left: 8px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.detect-jump:hover { text-decoration: underline; }
body.theme-dark .detect-card { background: rgba(28,28,30,.6); }
body.theme-dark .detect-icon { background: var(--primary-container); color: var(--on-primary-container); }
body.has-bg .detect-card { background: rgba(255,255,255,.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
body.theme-dark.has-bg .detect-card { background: rgba(28,28,30,.6); }
@media (max-width: 600px) {
  .detect-card { flex-direction: column; text-align: center; gap: 14px; padding: 14px; }
  .detect-row { justify-content: center; }
  .detect-label { min-width: auto; }
}

/* 联系方式列表 */
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--outline-variant);
}
.contact-list li:last-child { border-bottom: none; }
.ct-key { font-size: 13px; font-weight: 700; color: var(--on-surface-variant); min-width: 72px; display: inline-flex; align-items: center; gap: 6px; }
.ct-val { color: var(--on-surface); flex: 1; word-break: break-all; font-size: 14px; }
.ct-val-link {
  color: var(--primary); flex: 1; word-break: break-all; text-decoration: none; cursor: pointer;
  border-bottom: 1px solid transparent; transition: color .12s, border-color .12s; font-weight: 500;
}
.ct-val-link:hover { color: var(--primary-pressed); border-bottom-color: var(--primary-pressed); }
.ct-icon, .link-icon { width: 18px; height: 18px; vertical-align: middle; display: inline-block; flex-shrink: 0; }
.link-icon { margin-right: 6px; }
.link-desc { color: var(--on-surface-variant); font-size: 12px; margin-left: 6px; }

/* ===== 关于页面 ===== */
.about-view .page-body, .about-page { padding: 24px 20px 30px; }
.about-head { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.ah-row { display: flex; align-items: baseline; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--outline-variant); }
.ah-row:last-child { border-bottom: none; }
.ah-key { font-size: 13px; font-weight: 700; color: var(--on-surface-variant); min-width: 72px; }
.ah-val { color: var(--on-surface); font-size: 15px; }
.statement-list { list-style: none; padding: 0; margin: 0; counter-reset: stmt; }
.statement-list li {
  counter-increment: stmt; padding: 12px 14px; margin: 6px 0;
  background: var(--surface-2); border-left: 3px solid var(--primary);
  color: var(--on-surface); font-size: 14px; line-height: 1.6;
  border-radius: var(--r-xs);
  position: relative;
}
.statement-list li::before {
  content: counter(stmt); display: inline-block; min-width: 24px; height: 24px;
  margin-right: 10px; padding: 0 6px;
  background: var(--primary); color: var(--on-primary);
  font-size: 12px; font-weight: 700;
  text-align: center; line-height: 24px; border-radius: var(--r-full);
  vertical-align: middle;
}

/* ===== Markdown 渲染区统一样式 ===== */
.md { font-size: 14px; line-height: 1.7; color: var(--on-surface); word-break: break-word; }
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { color: var(--on-surface); margin: 14px 0 8px; line-height: 1.3; font-weight: 700; }
.md h1 { font-size: 20px; }
.md h2 { font-size: 17px; }
.md h3 { font-size: 15px; }
.md p { margin: 8px 0; }
.md a { color: var(--primary); text-decoration: underline; font-weight: 500; }
.md a:hover { color: var(--primary-pressed); }
.md ul, .md ol { margin: 8px 0 8px 24px; padding: 0; }
.md li { margin: 4px 0; }
.md blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--primary); background: var(--surface-2); color: var(--on-surface-variant); border-radius: 0 var(--r-xs) var(--r-xs) 0; }
.md code { font-family: 'Consolas', 'Monaco', monospace; background: var(--surface-3); padding: 2px 6px; border-radius: 4px; color: var(--on-surface); font-size: 13px; }
.md pre { background: var(--surface-2); padding: 12px 14px; border: 1px solid var(--outline-variant); border-radius: var(--r-xs); overflow-x: auto; margin: 10px 0; }
.md pre code { background: none; padding: 0; color: var(--on-surface); }
.md img { max-width: 100%; height: auto; border-radius: var(--r-xs); }
.md hr { border: none; border-top: 1px solid var(--outline-variant); margin: 16px 0; }
.md table { border-collapse: collapse; width: 100%; margin: 10px 0; border-radius: var(--r-xs); overflow: hidden; }
.md th, .md td { border: 1px solid var(--outline-variant); padding: 8px 12px; }
.md th { background: var(--surface-2); color: var(--on-surface); font-weight: 700; }

/* ===== 品牌图标自定义图片 ===== */
.brand-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== 主内容入场动画 ===== */
@keyframes anim-fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
body.loaded .anim-in { animation: anim-fade-up .4s var(--ease-emphasized) both; }

/* 初始加载占位：JS 渲染前显示，避免空白闪烁 */
.boot-loading {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: var(--surface); color: var(--on-surface-variant);
}
.boot-block {
  width: 32px; height: 32px; background: var(--primary);
  border-radius: 8px; animation: bootPulse 1s var(--ease-emphasized) infinite;
}
@keyframes bootPulse {
  0%, 100% { opacity: .35; transform: scale(.75) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(180deg); }
}
/* loaded 前隐藏 sidebar/main/collapse-btn/menu-toggle，避免闪烁默认值；loaded 后隐藏 boot-loading */
body:not(.loaded) .sidebar,
body:not(.loaded) .main,
body:not(.loaded) .collapse-btn,
body:not(.loaded) .menu-toggle,
body:not(.loaded) .back-to-top { visibility: hidden; }
body:not(.loaded) .home-view,
body:not(.loaded) .about-view,
body:not(.loaded) .list-view { display: none; }
body.loaded .boot-loading { display: none; }
body.loaded .anim-in:nth-child(1) { animation-delay: .04s; }
body.loaded .anim-in:nth-child(2) { animation-delay: .10s; }
body.loaded .anim-in:nth-child(3) { animation-delay: .16s; }
body.loaded .anim-in:nth-child(4) { animation-delay: .22s; }
body.loaded .anim-in:nth-child(5) { animation-delay: .28s; }
body.loaded .hero-inner { animation: anim-fade-up .5s var(--ease-emphasized) both; }

body.loaded .card { animation: cardIn .35s var(--ease-emphasized) both; }
body.loaded .ver-group:nth-child(1) .card { animation-delay: .02s; }
body.loaded .ver-group:nth-child(2) .card { animation-delay: .06s; }
body.loaded .ver-group:nth-child(3) .card { animation-delay: .1s; }

@media (prefers-reduced-motion: reduce) {
  body.loaded .anim-in, body.loaded .card, body.loaded .hero-inner { animation: none !important; opacity: 1; transform: none; }
}
