:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1f2333;
  --muted: #8a8fa3;
  --primary: #3b6ef5;
  --primary-dark: #2f5bd0;
  --primary-soft: #eef1fb;
  --green: #23b26b;
  --red: #e5484d;
  --border: #e6e8f0;
  --shadow: 0 2px 12px rgba(31, 35, 51, 0.06);
  --shadow-lg: 0 12px 40px rgba(31, 35, 51, 0.16);
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }

/* 细滚动条（全局） */
* { scrollbar-width: thin; scrollbar-color: #cdd2e0 transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #cdd2e0; border-radius: 3px; }
*::-webkit-scrollbar-thumb:hover { background: #b3b9cc; }

.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }
header.site {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0 26px; gap: 16px;
}
header.site h1 { font-size: 22px; font-weight: 700; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
header.site h1 .logo { color: var(--primary); }
.site-logo { height: 26px; width: auto; border-radius: 6px; }

/* ---------- 顶部用户区 ---------- */
.user-area { display: flex; align-items: center; gap: 14px; position: relative; }
.user-area .nav-btn { background: var(--primary); color: #fff; border: none; cursor: pointer;
  padding: 7px 18px; border-radius: 999px; font-size: 13px; font-family: inherit; }
.user-area .nav-btn:hover { background: var(--primary-dark); }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 5px 10px 5px 5px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--card); transition: box-shadow .15s; }
.user-chip:hover { box-shadow: var(--shadow); }
.user-chip .u-name { font-size: 13px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .u-caret { color: var(--muted); font-size: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar.lg { width: 64px; height: 64px; }
.avatar-fb { width: 30px; height: 30px; border-radius: 50%; flex: none; display: flex;
  align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, var(--primary), #7c5cf0); }
.avatar-fb.lg { width: 64px; height: 64px; font-size: 26px; }

.user-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 180px;
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
  display: none; z-index: 60; border: 1px solid var(--border); }
.user-menu.show { display: block; animation: pop .15s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px);} to { opacity: 1; } }
.user-menu .um-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.user-menu .um-head .um-nick { font-size: 14px; font-weight: 600; }
.user-menu .um-head .um-role { font-size: 11px; color: var(--muted); margin-top: 2px; }
.user-menu button { display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 9px 12px; font-size: 13px; border-radius: 8px; cursor: pointer; color: var(--text); font-family: inherit; }
.user-menu button:hover { background: var(--primary-soft); color: var(--primary); }
.user-menu button.danger:hover { background: #fdecec; color: var(--red); }

/* ---------- 应用卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(31,35,51,.10); }
.card .app-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card .app-head > div:last-child { min-width: 0; flex: 1; }
.card .icon {
  width: 52px; height: 52px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--primary), #7c5cf0);
  color: #fff; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.card .app-icon { width: 52px; height: 52px; border-radius: 12px; flex: none; object-fit: cover; }
.card .name { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.card .name:hover { color: var(--primary); }
.card .pkg { font-size: 12px; color: var(--muted); word-break: break-all; }
.card .meta { font-size: 13px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.card .desc { font-size: 13px; color: #555b70; line-height: 1.6; min-height: 20px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .actions { display: flex; gap: 10px; margin-top: auto; padding-top: 6px; }
.card .actions .btn { flex: 1; padding-left: 0; padding-right: 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 9px; border: none; cursor: pointer;
  font-size: 13px; font-weight: 500; transition: background .15s; font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: var(--primary-soft); color: var(--primary); }
.btn-ghost:hover { background: #e2e8fb; }
.btn-danger { background: #fdecec; color: var(--red); }
.btn-danger:hover { background: #fbdcdc; }
.btn-green { background: #e5f7ee; color: var(--green); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.empty { text-align: center; color: var(--muted); padding: 80px 0; font-size: 14px; }

/* ---------- 模态框 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,24,40,.45); display: none;
  align-items: center; justify-content: center; z-index: 50; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-mask.show { display: flex; }
.modal-mask.topmost { z-index: 80; }
.modal {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 520px;
  max-height: 86vh; overflow-y: auto; padding: 24px; box-shadow: var(--shadow-lg);
  animation: pop .18s ease;
}
.modal h3 { font-size: 17px; margin-bottom: 16px; }
.modal .qr-box { text-align: center; margin: 10px 0; }
.modal .qr-box img { width: 220px; height: 220px; }
.modal .qr-box p { font-size: 12px; color: var(--muted); margin-top: 8px; word-break: break-all; }
.modal .close { position: absolute; top: 14px; right: 18px; cursor: pointer; color: var(--muted);
  font-size: 22px; line-height: 1; z-index: 2; }
.modal .close:hover { color: var(--text); }
.modal { position: relative; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #555b70; margin-bottom: 6px; }
.field input[type=text], .field input[type=password], .field input[type=number],
.field textarea, .field select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px;
  font-size: 14px; font-family: inherit; background: #fafbfe;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--primary); background: #fff; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.checkbox input { width: auto; }

/* ---------- 登录卡片 ---------- */
.login-wrap { display: flex; justify-content: center; align-items: flex-start; padding-top: 8vh; }
.login-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 34px; width: 100%; max-width: 380px; }
.login-card h2 { font-size: 19px; margin-bottom: 22px; text-align: center; }

/* ---------- 后台面板/表格 ---------- */
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.panel .panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.panel .panel-head h2 { font-size: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr:hover td { background: #fafbfe; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.tag-on { background: #e5f7ee; color: var(--green); }
.tag-off { background: #fdecec; color: var(--red); }
.tag-force { background: #fff4e0; color: #d98a00; }

/* ---------- 后台应用卡片列表 ---------- */
.app-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.app-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: box-shadow .15s; }
.app-item:hover { box-shadow: var(--shadow); }
.app-item .ai-head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.app-item .ai-icon { width: 44px; height: 44px; border-radius: 10px; flex: none; object-fit: cover; }
.app-item .ai-fb { width: 44px; height: 44px; border-radius: 10px; flex: none; display: flex;
  align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 18px;
  background: linear-gradient(135deg, var(--primary), #7c5cf0); }
.app-item .ai-title { min-width: 0; flex: 1; }
.app-item .ai-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-item .ai-pkg { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-item .ai-status { flex: none; }
.app-item .ai-info { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: #555b70; }
.app-item .ai-info b { font-weight: 600; }
.app-item .ai-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px dashed var(--border); padding-top: 12px; }

.versions-row td { background: #f7f9ff; }
.vlist { display: flex; flex-direction: column; gap: 6px; }
.vitem { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.vitem .vname { font-weight: 600; }
.vitem .vsize, .vitem .vdate { color: var(--muted); }

/* ---------- toast ---------- */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: #22263a; color: #fff; padding: 10px 20px; border-radius: 10px;
  font-size: 13px; z-index: 300; display: none; max-width: 80vw;
}
.toast.show { display: block; animation: fadein .2s; }
.toast.error { background: var(--red); }
@keyframes fadein { from { opacity: 0; transform: translate(-50%,-6px);} to { opacity: 1; } }

/* ---------- 文件拖拽 ---------- */
.file-drop {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 26px;
  text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s;
  margin-bottom: 14px; font-size: 13px;
}
.file-drop:hover, .file-drop.drag { border-color: var(--primary); color: var(--primary); }
.file-drop.selected { border-style: solid; border-color: var(--green); color: var(--text); }
.file-mini { border: 1.5px dashed var(--border); border-radius: 10px; padding: 12px;
  text-align: center; color: var(--muted); cursor: pointer; font-size: 12px; transition: border-color .15s; }
.file-mini:hover { border-color: var(--primary); color: var(--primary); }
.file-mini.filled { border-style: solid; border-color: var(--green); color: var(--text); }

.progress { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; margin: 10px 0; display: none; }
.progress.show { display: block; }
.progress .bar { height: 100%; width: 0; background: var(--primary); transition: width .2s; }

/* ---------- 门户详情弹窗 ---------- */
.modal-lg { max-width: 680px; padding: 0; overflow: hidden; }
.detail-scroll { max-height: 86vh; overflow-y: auto; padding: 26px 28px; }
.detail-head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.detail-head img, .detail-head .icon { width: 68px; height: 68px; border-radius: 16px; flex: none; object-fit: cover; }
.detail-head .dh-name { font-size: 20px; font-weight: 700; }
.detail-head .dh-pkg { font-size: 12px; color: var(--muted); margin-top: 4px; word-break: break-all; }
.detail-info { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: #555b70; margin-bottom: 12px; }
.detail-info .di-item { display: flex; gap: 6px; align-items: center; }
.detail-info .di-label { color: var(--muted); }
.detail-summary { font-size: 13px; color: #555b70; line-height: 1.7; margin-bottom: 6px; white-space: pre-wrap; }
.detail-section-title { font-size: 13px; font-weight: 600; margin: 18px 0 10px; color: var(--text); }

/* Markdown 渲染 */
.md-body { font-size: 13.5px; color: #464c5f; line-height: 1.75; word-break: break-word; }
.md-body > *:first-child { margin-top: 0; }
.md-body > *:last-child { margin-bottom: 0; }
.md-body p { margin: 8px 0; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4, .md-body h5, .md-body h6 {
  margin: 14px 0 8px; font-weight: 700; color: var(--text); line-height: 1.4; }
.md-body h1 { font-size: 18px; } .md-body h2 { font-size: 16px; } .md-body h3 { font-size: 15px; }
.md-body h4, .md-body h5, .md-body h6 { font-size: 14px; }
.md-body ul, .md-body ol { margin: 8px 0; padding-left: 22px; }
.md-body li { margin: 3px 0; }
.md-body code { background: #f0f2f8; color: #c0392b; padding: 1px 6px; border-radius: 5px;
  font-family: "SF Mono", Consolas, Menlo, monospace; font-size: 12.5px; }
.md-body pre { background: #22263a; color: #e6e8f0; padding: 12px 14px; border-radius: 10px;
  overflow-x: auto; margin: 10px 0; }
.md-body pre code { background: none; color: inherit; padding: 0; font-size: 12.5px; }
.md-body blockquote { border-left: 3px solid var(--primary); background: var(--primary-soft);
  padding: 6px 12px; margin: 10px 0; color: #555b70; border-radius: 0 8px 8px 0; }
.md-body a { color: var(--primary); text-decoration: none; }
.md-body a:hover { text-decoration: underline; }
.md-body img { max-width: 100%; border-radius: 8px; margin: 6px 0; }
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.md-body strong { font-weight: 700; color: var(--text); }
.vd-changelog { border-top: 1px dashed var(--border); padding-top: 10px; }

/* 轮播 */
.carousel { position: relative; border-radius: 12px; overflow: hidden; background: #0f1220; }
.carousel .track { display: flex; transition: transform .35s ease; }
.carousel .track img { width: 100%; flex: none; height: 340px; object-fit: cover; }
.carousel .nav-arrow { position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  background: rgba(15,18,32,.55); color: #fff; font-size: 20px; line-height: 1;
  border: 1.5px solid rgba(255,255,255,.7); backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center; transition: all .15s; z-index: 2; }
.carousel .nav-arrow:hover { background: rgba(15,18,32,.82); border-color: #fff; transform: translateY(-50%) scale(1.06); }
.carousel .nav-arrow.prev { left: 12px; }
.carousel .nav-arrow.next { right: 12px; }
.carousel .nav-arrow.hide { display: none; }
.carousel .dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex;
  justify-content: center; gap: 6px; }
.carousel .dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.6);
  box-shadow: 0 0 3px rgba(0,0,0,.5); transition: all .2s; }
.carousel .dots i.on { width: 16px; background: #fff; }

/* 版本胶囊选择器 */
.ver-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.ver-pill { border: 1.5px solid var(--border); background: #fff; border-radius: 10px;
  padding: 10px 16px; cursor: pointer; text-align: left; font-family: inherit; transition: all .15s; }
.ver-pill:hover { border-color: var(--primary); }
.ver-pill.active { border-color: var(--primary); background: var(--primary-soft); }
.ver-pill .vp-name { font-size: 14px; font-weight: 600; color: var(--text); display: block; }
.ver-pill .vp-meta { font-size: 11px; color: var(--muted); margin-top: 2px; display: block; }
.ver-pill .vp-badge { display: inline-block; font-size: 10px; background: var(--primary); color: #fff;
  border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
.ver-detail { margin-top: 14px; background: #fafbfe; border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; }
.ver-detail .vd-row { display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: #555b70; margin-bottom: 10px; gap: 12px; flex-wrap: wrap; }
.ver-detail .vd-changelog { font-size: 12.5px; color: #555b70; line-height: 1.7;
  border-top: 1px dashed var(--border); padding-top: 10px; }

/* 登录门 */
.login-gate { text-align: center; padding: 70px 20px; }
.login-gate .lg-icon { font-size: 40px; color: var(--primary); margin-bottom: 14px; }
.login-gate p { color: var(--muted); margin-bottom: 20px; font-size: 14px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 14px; }
.auth-switch a { cursor: pointer; }

/* 图片查看器 */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: none;
  align-items: center; justify-content: center; z-index: 200; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }
.lightbox .lb-close { position: absolute; top: 20px; right: 26px; color: #fff; font-size: 30px; cursor: pointer; }

/* ---------- 后台标签页 ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tab { background: none; border: none; padding: 10px 18px; cursor: pointer;
  font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; font-family: inherit; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.badge-count { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px;
  background: var(--red); color: #fff; border-radius: 9px; font-size: 11px; text-align: center;
  margin-left: 4px; vertical-align: 1px; }

.brand-box { display: flex; align-items: center; gap: 12px; }
.brand-box img { width: 44px; height: 44px; border-radius: 8px; object-fit: contain;
  border: 1px solid var(--border); background: #fafbfe; display: none; }
.brand-box img.show { display: block; }
.brand-box span { font-size: 12px; color: var(--muted); }

.shots-admin { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.shot-thumb { position: relative; }
.shot-thumb img { width: 72px; height: 128px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); display: block; }
.shot-thumb .rm { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--red); color: #fff; border: none; cursor: pointer;
  font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center; }

/* 个人中心 */
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.profile-head .ph-avatar-wrap { position: relative; }
.profile-head .ph-edit { position: absolute; bottom: -2px; right: -2px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--primary); color: #fff; border: 2px solid #fff; cursor: pointer;
  font-size: 12px; display: flex; align-items: center; justify-content: center; }
.profile-form .pf-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

/* 用户管理表格 */
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .uc-name { font-weight: 600; }
.user-cell .uc-sub { font-size: 11px; color: var(--muted); }

/* ---------- 页脚 ---------- */
.site-footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border);
  text-align: center; color: var(--muted); font-size: 12px; line-height: 2; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--primary); }

/* ===== v5：推荐轮播 / 工具栏 / 分类 / 分页 / 外链 ===== */

/* 推荐位轮播 */
.featured { margin-bottom: 22px; border-radius: var(--radius); overflow: hidden;
  position: relative; box-shadow: var(--shadow); display: none; }
.featured.show { display: block; }
.featured .f-track { display: flex; transition: transform .45s ease; }
.featured .f-slide { position: relative; flex: none; width: 100%; height: 200px;
  display: flex; align-items: center; gap: 18px; padding: 24px 28px; cursor: pointer;
  background: linear-gradient(120deg, #3b6ef5, #7c5cf0); color: #fff; overflow: hidden; }
/* 有截图时：截图作背景 + 渐变遮罩保证文字可读 */
.featured .f-slide.has-cover::before { content: ""; position: absolute; inset: 0;
  background-image: var(--cover); background-size: cover; background-position: center; z-index: 0; }
.featured .f-slide.has-cover::after { content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(15,18,32,.85) 0%, rgba(15,18,32,.6) 50%, rgba(15,18,32,.2) 100%); }
.featured .f-slide > .fi, .featured .f-slide > .fb, .featured .f-slide > .f-tag { position: relative; z-index: 2; }
.featured .f-slide img.fi { width: 64px; height: 64px; border-radius: 16px; object-fit: cover;
  flex: none; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.featured .f-slide .fb { min-width: 0; }
.featured .f-slide .fb .ft { font-size: 21px; font-weight: 700; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.featured .f-slide .fb .fd { font-size: 13px; opacity: .92; margin-top: 6px;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.featured .f-slide .f-tag { position: absolute; top: 16px; left: 18px; font-size: 11px;
  background: rgba(229,72,77,.9); padding: 3px 11px; border-radius: 999px; font-weight: 600; z-index: 2; }
.featured .f-arrow { position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.7);
  cursor: pointer; background: rgba(15,18,32,.55); color: #fff; font-size: 18px; z-index: 3;
  backdrop-filter: blur(6px); box-shadow: 0 2px 10px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center; transition: all .15s; }
.featured .f-arrow:hover { background: rgba(15,18,32,.82); border-color: #fff; }
.featured .f-arrow.prev { left: 12px; } .featured .f-arrow.next { right: 12px; }
.featured .f-dots { position: absolute; bottom: 14px; right: 22px; display: flex; gap: 6px; z-index: 3; }
.featured .f-dots i { width: 7px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.5); transition: all .2s; }
.featured .f-dots i.on { width: 18px; background: #fff; }

/* 子标签页 */
.subtabs { display: flex; gap: 8px; margin-bottom: 16px; }
.subtab { flex: 1; padding: 10px; border: 1px solid var(--border); background: #fff;
  border-radius: 10px; cursor: pointer; font-size: 14px; color: #555b70; font-family: inherit;
  transition: all .15s; }
.subtab:hover { border-color: var(--primary); color: var(--primary); }
.subtab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* 分类管理卡片 */
.cat-list { display: flex; flex-direction: column; gap: 10px; }
.cat-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: 12px; background: #fff; transition: box-shadow .15s; }
.cat-row:hover { box-shadow: var(--shadow); }
.cat-row .cr-index { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft);
  color: var(--primary); font-size: 12px; font-weight: 600; display: flex; align-items: center;
  justify-content: center; flex: none; }
.cat-row .cr-name { font-size: 15px; font-weight: 600; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-row .cr-count { font-size: 12px; color: var(--muted); flex: none; }
.cat-row .cr-actions { display: flex; gap: 4px; flex: none; }
.cat-row .icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-size: 14px; color: #555b70; display: flex;
  align-items: center; justify-content: center; }
.cat-row .icon-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.cat-row .icon-btn.danger:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.cat-row .icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.cat-row input.cr-edit { flex: 1; padding: 6px 10px; border: 1px solid var(--primary);
  border-radius: 8px; font-size: 14px; font-family: inherit; }
.cat-add { display: flex; gap: 10px; margin-bottom: 16px; }
.cat-add input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px;
  font-size: 14px; font-family: inherit; background: #fafbfe; }
.cat-add input:focus { outline: none; border-color: var(--primary); background: #fff; }

/* 工具栏：搜索 + 分类 */
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.search-box { position: relative; }
.search-box input { width: 100%; padding: 11px 40px 11px 40px; border: 1px solid var(--border);
  border-radius: 999px; font-size: 14px; font-family: inherit; background: #fff; }
.search-box input:focus { outline: none; border-color: var(--primary); }
.search-box .s-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 15px; }
.search-box .s-clear { position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); cursor: pointer; font-size: 16px; display: none; }
.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-tab { background: #fff; border: 1px solid var(--border); color: #555b70; cursor: pointer;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-family: inherit; transition: all .15s; }
.cat-tab:hover { border-color: var(--primary); color: var(--primary); }
.cat-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.cat-tab .ct-count { opacity: .7; font-size: 11px; margin-left: 3px; }

/* 分类标签（卡片） */
.card .cat-tag { position: absolute; }
.cat-badge { display: inline-block; font-size: 11px; color: var(--primary);
  background: var(--primary-soft); border-radius: 6px; padding: 1px 8px; }
.card { position: relative; }
.card .corner { position: absolute; top: 14px; right: 14px; }
.ext-badge { display: inline-block; font-size: 11px; color: #d98a00; background: #fff4e0;
  border-radius: 6px; padding: 1px 8px; }

/* 分页 */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.pager button { min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--border);
  background: #fff; border-radius: 8px; cursor: pointer; font-size: 13px; color: #555b70; font-family: inherit; }
.pager button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pager button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager .pg-ellipsis { color: var(--muted); padding: 0 4px; }

/* 外链提取码 */
.ext-code { margin-top: 10px; background: #fff8ec; border: 1px dashed #f0c98a; border-radius: 10px;
  padding: 10px 14px; font-size: 13px; color: #8a6d3b; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ext-code .ec-label { color: #b08948; }
.ext-code .ec-val { font-weight: 700; letter-spacing: 1px; font-family: Consolas, monospace;
  background: #fff; padding: 2px 10px; border-radius: 6px; border: 1px solid #f0c98a; }
.ext-code .ec-copy { cursor: pointer; color: var(--primary); font-size: 12px; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .app-cards { grid-template-columns: 1fr; }
  .container { padding: 14px 12px 40px; }
  table { font-size: 12px; }
  .carousel .track img { height: 240px; }
  .detail-scroll { padding: 20px 16px; }
  header.site { flex-wrap: wrap; }
  .featured .f-slide { height: 150px; padding: 16px 18px; gap: 12px; }
  .featured .f-slide img.fi { width: 52px; height: 52px; }
  .featured .f-slide .fb .ft { font-size: 17px; }
}
