/* ============ HarnessHub 全局样式 ============ */
:root {
  --bg: #f4f5fa;
  --bg-soft: #eef0f6;
  --panel: #ffffff;
  --panel-2: #f8f9fd;
  --border: #e4e7f0;
  --border-strong: #d3d8e6;
  --text: #1d2333;
  --text-2: #4b5568;
  --muted: #8a93a8;
  --primary: #4f6ef7;
  --primary-strong: #3d5af1;
  --primary-soft: rgba(79, 110, 247, .12);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, .12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, .12);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, .14);
  --shadow: 0 2px 12px rgba(23, 30, 60, .07);
  --shadow-lg: 0 12px 40px rgba(23, 30, 60, .16);
  --radius: 12px;
  --radius-sm: 8px;
  --topbar-h: 60px;
  --sidebar-w: 232px;
}
[data-theme="dark"] {
  /* 深灰系暗色主题：层次对比清晰，避免纯黑 */
  --bg: #16181d;
  --bg-soft: #1d2027;
  --panel: #232731;
  --panel-2: #2b303c;
  --border: #343b4a;
  --border-strong: #474f63;
  --text: #f1f3f8;
  --text-2: #c7cdda;
  --muted: #9aa2b4;
  --primary: #7d95ff;
  --primary-strong: #99acff;
  --primary-soft: rgba(125, 149, 255, .18);
  --success: #3ddc84;
  --success-soft: rgba(61, 220, 132, .15);
  --danger: #ff7373;
  --danger-soft: rgba(255, 115, 115, .15);
  --warning: #ffb648;
  --warning-soft: rgba(255, 182, 72, .15);
  --shadow: 0 2px 14px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 44px rgba(0, 0, 0, .65);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-strong); }
img { max-width: 100%; display: block; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: var(--primary-soft); }

/* ============ 布局 ============ */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 0 18px; gap: 12px;
  position: relative; z-index: 60;
}
.topbar-inner { display: flex; align-items: center; gap: 12px; width: 100%; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; color: var(--text); flex: none; }
.logo img { width: 28px; height: 28px; border-radius: 7px; }
.logo span { background: linear-gradient(120deg, var(--primary), #8b5cf6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.topnav { display: flex; gap: 4px; margin-left: 12px; }
.topnav a {
  padding: 6px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 14px;
}
.topnav a:hover, .topnav a.active { color: var(--primary); background: var(--primary-soft); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.app-body { flex: 1; display: flex; min-height: 0; }

/* 侧边栏 / 抽屉 */
.sidebar {
  width: var(--sidebar-w); flex: none;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto; transition: margin-left .25s ease;
}
.sidebar.collapsed { margin-left: calc(-1 * var(--sidebar-w)); }
.sidebar-head { padding: 14px 16px 10px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.sidebar-nav { padding: 4px 10px 16px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px; color: var(--text-2);
  cursor: pointer; font-weight: 500; user-select: none;
  border: none; background: none; font-size: 14px; text-align: left; width: 100%;
}
.nav-item:hover { background: var(--bg-soft); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item .cnt { margin-left: auto; font-size: 12px; color: var(--muted); background: var(--bg-soft); padding: 1px 8px; border-radius: 10px; }
.nav-item.active .cnt { color: var(--primary); background: var(--primary-soft); }
.nav-sep { height: 1px; background: var(--border); margin: 8px 12px; }

/* 侧边栏底部用户区 */
.sidebar-user {
  margin-top: auto; padding: 12px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.sidebar-user .user-box { position: relative; width: 100%; }
.sidebar-user .user-trigger { width: 100%; justify-content: flex-start; }
.sidebar-user .dropdown {
  top: auto; bottom: calc(100% + 8px); left: 0; right: auto; min-width: 210px;
}
.sidebar-user .auth-btns { display: flex; gap: 8px; }
.sidebar-user .auth-btns .btn { flex: 1; }
.sidebar-user .su-hint { font-size: 11.5px; color: var(--muted); text-align: center; }

.main {
  flex: 1; min-width: 0; overflow-y: auto;
  display: flex; flex-direction: column;
}
.content { padding: 20px 24px; flex: 1; }
.content-wide { max-width: 1400px; margin: 0 auto; width: 100%; }

/* 抽屉遮罩 */
.drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .25s; }
.drawer-mask.show { opacity: 1; pointer-events: auto; }

/* ============ 顶栏控件 ============ */
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--panel);
  color: var(--text-2); font-size: 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.hamburger { display: none; }
.user-box { position: relative; }
.user-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 5px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel); cursor: pointer;
  color: var(--text); /* 用户名颜色跟随主题（暗色为白色） */
}
.user-trigger:hover { border-color: var(--primary); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 190px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; z-index: 80; display: none;
}
.dropdown.show { display: block; }
.dropdown .dd-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown .dd-head b { display: block; font-size: 14px; }
.dropdown .dd-head span { font-size: 12px; color: var(--muted); }
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 12px; border-radius: 8px; font-size: 13.5px;
  color: var(--text-2); border: none; background: none; cursor: pointer; text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: var(--bg-soft); color: var(--text); }
.dropdown .danger { color: var(--danger); }
.dropdown .danger:hover { background: var(--danger-soft); }
.dropdown .dd-sep { height: 1px; background: var(--border); margin: 4px 8px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: 14px;
  cursor: pointer; font-weight: 500; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { opacity: .9; color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); border-color: transparent; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { padding: 11px 26px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline-primary:hover { background: var(--primary-soft); color: var(--primary); }

/* ============ 表单 ============ */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13.5px; }
.field label .req { color: var(--danger); font-weight: 700; margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--panel);
  color: var(--text); font-size: 14px; font-family: inherit;
  outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.7; }
.input-sm { padding: 6px 10px; font-size: 13px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .field { flex: 1 1 150px; min-width: 150px; }
.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* ============ 卡片 / 徽章 ============ */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--bg-soft); color: var(--text-2);
}
.badge-free { background: var(--success-soft); color: var(--success); }
.badge-paid { background: var(--warning-soft); color: var(--warning); }
.badge-hot { background: var(--danger-soft); color: var(--danger); }
.badge-license { background: var(--primary-soft); color: var(--primary); }
.badge-pending { background: var(--warning-soft); color: var(--warning); }
.badge-rejected { background: var(--danger-soft); color: var(--danger); }
.badge-published { background: var(--success-soft); color: var(--success); }
.badge-draft { background: var(--bg-soft); color: var(--muted); }
.badge-paid-order { background: var(--success-soft); color: var(--success); }
.badge-pending-order { background: var(--warning-soft); color: var(--warning); }

/* ============ 工具条 ============ */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.toolbar .search input { padding-left: 36px; }
.toolbar .search::before { content: "🔍"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .7; }
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--panel); }
.view-toggle button { border: none; background: none; padding: 7px 14px; cursor: pointer; color: var(--muted); font-size: 15px; }
.view-toggle button.active { background: var(--primary-soft); color: var(--primary); }
.toolbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ============ 插件卡片 ============ */
.plugin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px; }
.plugin-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s;
  display: flex; flex-direction: column;
}
.plugin-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.pc-cover { position: relative; aspect-ratio: 16/9; background: var(--bg-soft); overflow: hidden; }
.pc-cover img { width: 100%; height: 100%; object-fit: cover; }
.pc-cover .pc-cover-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 46px; background: linear-gradient(135deg, var(--primary-soft), transparent); }
.pc-badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; }
/* 卡片收藏星标 */
.pc-fav {
  position: absolute; top: 6px; right: 8px; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.45); color: #fff; font-size: 17px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  transition: transform .15s, background .15s;
}
.pc-fav:hover { transform: scale(1.15); background: rgba(0,0,0,.65); }
.pc-fav.on { color: #ffd54a; }
.pc-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 700; backdrop-filter: blur(4px); }
.pc-badge.free { background: rgba(22,163,74,.9); color: #fff; }
.pc-badge.paid { background: rgba(245,158,11,.92); color: #fff; }
.pc-badge.hot { background: rgba(220,38,38,.88); color: #fff; }
.pc-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pc-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.pc-title .pc-icon { font-size: 17px; }
.pc-summary {
  font-size: 12.5px; color: var(--muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 38px;
}
.pc-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--border); }
.pc-meta .author { display: flex; align-items: center; gap: 5px; min-width: 0; }
.pc-meta .author span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-meta .dl { margin-left: auto; }
.pc-price { font-weight: 800; font-size: 15px; }
.pc-price.free { color: var(--success); }
.pc-price.paid { color: var(--warning); }

/* ============ 表格 ============ */
.table-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
table.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.table th { background: var(--panel-2); font-weight: 600; color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-soft); }
.table tbody tr[data-open] { cursor: pointer; }
.td-plugin .td-name { cursor: pointer; }
.td-plugin .td-name:hover { color: var(--primary); }
.td-plugin { display: flex; align-items: center; gap: 10px; }
.td-plugin img { width: 44px; height: 30px; object-fit: cover; border-radius: 6px; background: var(--bg-soft); flex: none; }
.td-plugin .ph { width: 44px; height: 30px; border-radius: 6px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.td-plugin b { display: block; font-size: 13.5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-plugin small { color: var(--muted); font-size: 12px; }
.td-user { display: flex; align-items: center; gap: 8px; }
.td-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .big { font-size: 44px; margin-bottom: 10px; }

/* ============ 分页 ============ */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.pagination .pg-btn {
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text-2);
  cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; justify-content: center;
}
.pagination .pg-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination .pg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pagination .pg-btn:disabled { opacity: .4; cursor: not-allowed; }
.pagination .pg-info { font-size: 12.5px; color: var(--muted); margin-left: 8px; }

/* ============ 模态 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(10, 14, 26, .55); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .22s; backdrop-filter: blur(2px);
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 60px);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(14px) scale(.98); transition: transform .22s;
}
.modal-mask.show .modal { transform: none; }
.modal-lg { width: min(980px, calc(100vw - 32px)); }
.modal-xl { width: min(1200px, calc(100vw - 24px)); height: min(92vh, 900px); }

/* 插件详情动态模：窄标题栏、2px 圆角、明显的 2px 边框 */
#detailModal .modal {
  border-radius: 2px;
  border: 2px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
}
[data-theme="light"] #detailModal .modal { border-color: #b7c0d9; }
[data-theme="dark"] #detailModal .modal { border-color: #56617e; }
#detailModal .modal-head {
  padding: 6px 14px; min-height: 40px;
  border-bottom: 1px solid var(--border);
  /* 渐变色标题栏，明显区别于主面板 */
  background: linear-gradient(120deg, var(--primary), #8b5cf6);
}
#detailModal .modal-head h3 { font-size: 14px; color: #fff; }
#detailModal .modal-close { width: 26px; height: 26px; font-size: 16px; color: rgba(255,255,255,.9); }
#detailModal .modal-close:hover { background: rgba(255,255,255,.22); color: #fff; }

.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); gap: 10px; flex: none; }
.modal-head h3 { font-size: 16px; flex: 1; }
.modal-close {
  width: 30px; height: 30px; border-radius: 8px; border: none; background: none;
  color: var(--muted); font-size: 18px; cursor: pointer; flex: none;
}
.modal-close:hover { background: var(--danger-soft); color: var(--danger); }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; flex: none; }

/* 登录/注册 */
.auth-tabs { display: flex; background: var(--bg-soft); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; padding: 8px; border: none; background: none; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.auth-tabs button.active { background: var(--panel); color: var(--primary); box-shadow: var(--shadow); }
.auth-tip { font-size: 12.5px; color: var(--muted); margin-top: 10px; text-align: center; }
.auth-tip a { color: var(--primary); }

/* 详情模态 */
.detail-modal-body { padding: 0; display: flex; flex-direction: column; }
#detailModal .modal-body { padding: 0; overflow: hidden; }
#detailModal .modal-body iframe, #detailModal .detail-inner { width: 100%; height: 100%; border: none; }

/* ============ 详情页 ============ */
.detail-page { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.detail-head { display: flex; gap: 22px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); flex-wrap: wrap; }
.detail-cover { width: 300px; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; background: var(--bg-soft); flex: none; }
.placeholder-cover { width: 300px; aspect-ratio: 16/9; border-radius: 12px; background: linear-gradient(135deg, var(--primary-soft), var(--bg-soft)); display: flex; align-items: center; justify-content: center; font-size: 64px; flex: none; }
.detail-head-info { flex: 1; min-width: 260px; }
.detail-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.detail-title { font-size: 24px; font-weight: 800; margin-bottom: 6px; line-height: 1.3; }
.detail-summary { color: var(--text-2); font-size: 14px; margin-bottom: 10px; }
.detail-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.detail-actions { display: flex; flex-direction: column; gap: 10px; justify-content: center; flex: none; }
.detail-buy-tip { font-size: 12px; color: var(--muted); text-align: center; }
.detail-body { display: flex; gap: 18px; margin-top: 18px; align-items: flex-start; }
.detail-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.detail-side { width: 270px; flex: none; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 18px; }
.detail-sec { padding: 18px 20px; }
.detail-sec-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.rich-text { line-height: 1.85; font-size: 14.5px; }
.rich-text h3 { font-size: 16px; margin: 14px 0 6px; }
.rich-text ul, .rich-text ol { padding-left: 22px; margin: 8px 0; }
.rich-text li { margin: 3px 0; }
.rich-text img { border-radius: 10px; margin: 10px 0; }
.rich-text code { background: var(--bg-soft); padding: 2px 6px; border-radius: 5px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.rich-text pre { background: var(--bg-soft); padding: 12px; border-radius: 10px; overflow: auto; }
.detail-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.detail-gallery img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 10px; cursor: zoom-in; transition: transform .18s; }
.detail-gallery img:hover { transform: scale(1.03); }
.install-tip { background: var(--primary-soft); border-left: 4px solid var(--primary); padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; }
/* 付费权益提醒框 */
.install-remind {
  background: var(--warning-soft); border-left: 4px solid var(--warning);
  padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13.5px;
}
.install-block { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.install-steps { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.install-step { display: flex; gap: 12px; }
.install-step-no {
  flex: none; width: 26px; height: 26px; border-radius: 50%; margin-top: 2px;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.install-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.install-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* 标签独占一行，命令与复制按钮在下一行 */
.install-label { flex-basis: 100%; font-size: 13px; color: var(--text-2); }
.install-cmd {
  flex: 1; min-width: 200px; font-family: ui-monospace, Consolas, monospace;
  background: var(--bg-soft); border: 1px dashed var(--border-strong); color: var(--primary);
  padding: 8px 12px; border-radius: 8px; font-size: 13.5px; user-select: all;
}
.install-repo { font-size: 13px; margin-bottom: 8px; word-break: break-all; }
.install-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.install-hint { font-size: 12.5px; color: var(--muted); }
.install-pkg {
  font-size: 13px; background: var(--bg-soft); border: 1px dashed var(--border-strong);
  padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; word-break: break-all;
}
.locked-box { text-align: center; padding: 26px 10px; color: var(--text-2); font-size: 15px; background: var(--bg-soft); border-radius: 12px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.license-box {
  background: var(--bg-soft); border-radius: 10px; padding: 14px 16px;
  font-size: 13px; line-height: 1.9; white-space: pre-wrap; max-height: 320px; overflow-y: auto;
}
.info-list { list-style: none; }
.info-list li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.info-list li:last-child { border-bottom: none; }
.info-list span { color: var(--muted); }
.related-item { display: flex; gap: 10px; align-items: center; padding: 8px 0; cursor: pointer; border-bottom: 1px dashed var(--border); }
.related-item:last-child { border-bottom: none; }
.related-item img, .related-item .ph { width: 56px; height: 38px; border-radius: 7px; object-fit: cover; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.related-item b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.related-item small { color: var(--muted); font-size: 12px; }

/* 图片灯箱 */
.zoom-mask { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 120; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.zoom-mask img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }
.zoom-mask.lightbox img { max-width: 82vw; max-height: 84vh; }
.lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 50px; height: 66px; border: none; border-radius: 10px;
  background: rgba(255,255,255,.12); color: #fff; font-size: 34px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.lb-btn:hover { background: rgba(255,255,255,.26); }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb-counter {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  color: #fff; background: rgba(0,0,0,.55); padding: 5px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; pointer-events: none;
}

/* ============ 统计卡 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat-card .label { font-size: 12.5px; color: var(--muted); }
.stat-card .value { font-size: 26px; font-weight: 800; margin-top: 4px; }
.stat-card .icon { float: right; font-size: 26px; opacity: .8; }
.stat-card.primary .value { color: var(--primary); }
.stat-card.success .value { color: var(--success); }
.stat-card.warning .value { color: var(--warning); }
.stat-card.danger .value { color: var(--danger); }

/* ============ Toast ============ */
.toast-wrap { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow-lg);
  font-size: 13.5px; display: flex; align-items: center; gap: 8px;
  animation: toastIn .25s ease; max-width: 80vw;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warn { border-left: 4px solid var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all .3s; }

/* ============ 富文本编辑器 ============ */
.rte-toolbar { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px; border: 1px solid var(--border); border-bottom: none; border-radius: 10px 10px 0 0; background: var(--panel-2); }
.rte-toolbar button {
  min-width: 30px; height: 30px; padding: 0 8px; border: none; border-radius: 6px;
  background: none; cursor: pointer; font-size: 13px; color: var(--text-2); font-weight: 600;
}
.rte-toolbar button:hover { background: var(--primary-soft); color: var(--primary); }
.rte-toolbar .rte-select {
  height: 30px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--panel); color: var(--text-2); font-size: 12.5px; font-weight: 600;
  cursor: pointer; padding: 0 6px; outline: none;
}
.rte-toolbar .rte-select:hover { border-color: var(--primary); color: var(--primary); }
.rte-toolbar .rte-color {
  position: relative; width: 30px; height: 30px; border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--panel); overflow: hidden; flex: none;
}
.rte-toolbar .rte-color:hover { border-color: var(--primary); }
.rte-toolbar .rte-color .rte-color-swatch {
  font-size: 13px; font-weight: 700; color: #e11d48; line-height: 1;
}
.rte-toolbar .rte-color .rte-color-swatch.bg {
  color: var(--text); background: #fde68a; border-radius: 3px; padding: 2px 5px;
}
.rte-toolbar .rte-color input[type="color"] {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.rte-box { border: 1px solid var(--border); border-radius: 0 0 10px 10px; min-height: 220px; padding: 14px; background: var(--panel); outline: none; line-height: 1.8; overflow-y: auto; max-height: 460px; }
.rte-box:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.rte-box h3 { font-size: 16px; margin: 10px 0 4px; }
.rte-box ul, .rte-box ol { padding-left: 22px; }
.rte-box code { background: var(--bg-soft); padding: 2px 6px; border-radius: 5px; font-family: ui-monospace, monospace; font-size: 13px; }
.rte-box pre { background: var(--bg-soft); padding: 10px; border-radius: 8px; overflow: auto; }
.rte-box img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.rte-box blockquote { border-left: 3px solid var(--primary); padding-left: 12px; color: var(--text-2); margin: 8px 0; }

/* ============ 图片上传 ============ */
.upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.upload-item { position: relative; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; aspect-ratio: 4/3; background: var(--bg-soft); }
.upload-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-item .rm {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 6px;
  background: rgba(0,0,0,.55); color: #fff; border: none; cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.upload-item .rm:hover { background: var(--danger); }
.upload-add {
  border: 2px dashed var(--border-strong); border-radius: 10px; aspect-ratio: 4/3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer; font-size: 12.5px; gap: 6px; background: var(--panel-2);
}
.upload-add:hover { border-color: var(--primary); color: var(--primary); }
.upload-add .plus { font-size: 26px; line-height: 1; }
.drop-active { border-color: var(--primary) !important; background: var(--primary-soft) !important; }

/* ============ 上传进度条 ============ */
.upload-progress { margin: 0 0 14px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.up-bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.up-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--primary-strong)); border-radius: 4px; transition: width .15s ease; }
.up-text { margin-top: 7px; font-size: 12.5px; color: var(--muted); word-break: break-all; }

/* ============ 页脚 ============ */
.site-footer { border-top: 1px solid var(--border); background: var(--panel); padding: 18px 24px; flex: none; }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }

/* ============ 协议页 ============ */
.agreement-page { max-width: 900px; margin: 0 auto; padding: 34px 20px 80px; }
.agreement-page h1 { text-align: center; font-size: 26px; margin-bottom: 30px; }
.agreement-page h2 { font-size: 19px; margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--primary); color: var(--primary); }
.agreement-page p { margin: 10px 0; }
.agreement-box { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); margin: 14px 0; }
.agreement-tip { background: var(--warning-soft); padding: 14px; border-radius: 8px; border-left: 4px solid var(--warning); margin: 18px 0; }

/* ============ 欢迎/横幅 ============ */
.hero-banner {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 24px 28px; margin-bottom: 18px;
  border-radius: 12px; border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow);
}
[data-theme="light"] .hero-banner { background: #f5f7ff; }
[data-theme="dark"] .hero-banner { background: var(--panel); }
.hero-icon {
  font-size: 46px; line-height: 1; flex: none;
  width: 68px; height: 68px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); border: 1px solid var(--border);
}
.hero-banner h2 { font-size: 22px; margin-bottom: 4px; color: var(--text); }
.hero-banner p { color: var(--text-2); font-size: 13.5px; }
.hero-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hero-banner .btn { background: var(--primary); border-color: var(--primary); color: #fff; }
.hero-banner .btn:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; }

/* 详情页开发者卡片 */
.dev-card .detail-sec-title { margin-bottom: 14px; }
.dev-card-head { display: flex; align-items: center; gap: 12px; padding: 0 2px; }
.dev-avatar-wrap { flex: none; }
.dev-avatar {
  width: 56px; height: 56px; border-radius: 16px; object-fit: cover;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; font-weight: 700;
  box-shadow: 0 4px 14px var(--primary-soft);
}
.dev-card-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dev-name { font-size: 16px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-role { font-size: 12px; color: var(--muted); }
.dev-bio {
  margin: 12px 0; font-size: 12.5px; color: var(--text-2); line-height: 1.65;
  background: var(--bg-soft); border-radius: 10px; padding: 9px 12px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.dev-stats {
  display: flex; margin: 0 0 12px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 0; overflow: hidden;
}
.dev-stats .ds-item { flex: 1; text-align: center; border-right: 1px solid var(--border); }
.dev-stats .ds-item:last-child { border-right: none; }
.dev-stats .ds-item b {
  display: block; font-size: 16px; font-weight: 800; color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.dev-stats .ds-item span { font-size: 11px; color: var(--muted); }
.dev-home-btn {
  background: linear-gradient(120deg, var(--primary), #8b5cf6);
  border: none; color: #fff; font-weight: 600;
}
.dev-home-btn:hover { opacity: .9; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px var(--primary-soft); }

/* ============ 子页面标题 ============ */
.page-title { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.page-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

/* 设置页面板两列并排 */
.settings-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px; align-items: start;
}

/* ============ 状态点 ============ */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.green { background: var(--success); }
.status-dot.yellow { background: var(--warning); }
.status-dot.red { background: var(--danger); }
.status-dot.gray { background: var(--muted); }

/* ============ 支付订单 ============ */
.order-box { text-align: center; padding: 22px; }
.order-amount { font-size: 34px; font-weight: 800; color: var(--warning); margin: 10px 0; }
.order-no { color: var(--muted); font-size: 12.5px; font-family: ui-monospace, monospace; }
.pay-methods { display: flex; gap: 10px; justify-content: center; margin: 16px 0; }
.pay-method {
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; cursor: pointer;
  background: var(--panel); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 110px;
}
.pay-method .pm-icon { font-size: 24px; }
.pay-method.active { border-color: var(--primary); background: var(--primary-soft); }
.pay-method small { color: var(--muted); }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .detail-body { flex-direction: column; }
  .detail-side { width: 100%; position: static; }
  .detail-cover, .placeholder-cover { width: 100%; }
}
@media (max-width: 768px) {
  .sidebar {
    position: fixed; top: var(--topbar-h); bottom: 0; left: 0; z-index: 71;
    margin-left: 0 !important; transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .hamburger { display: inline-flex; }
  .topnav { display: none; }
  .content { padding: 14px 14px; }
  .hero-banner { padding: 18px; }
  .detail-head { padding: 16px; }
  .detail-title { font-size: 20px; }
}
