/* ============================================================
   主题变量（白天 / 夜间）
   夜间由 JS 按时间设置 <html data-theme="dark"> 启用
   ============================================================ */
:root {
  --surface: #ffffff;
  --bg-sub: #fafafa;
  --bg-mute: #f0f0f0;
  --bg-input: #f7f7f7;
  --border: #eeeeee;
  --border-2: #e5e5e5;
  --border-strong: #dddddd;
  --text: #222222;
  --text-2: #333333;
  --text-3: #555555;
  --text-4: #666666;
  --text-weak: #888888;
  --text-faint: #999999;
  --text-ghost: #bbbbbb;
  --accent: #42b983;
  --accent-2: #2ecc71;
  --accent-dark: #359b70;
  --accent-soft: #f0faf6;
  --accent-disabled: #a8dcc5;
  --danger: #e74c3c;
  --danger-2: #e57368;
  --danger-bg: #fdecea;
  --danger-bg-2: #fbd6d2;
  --warn-bg: #fff8e6;
  --warn-border: #ffe58f;
  --warn-text: #8a6d3b;
}

[data-theme="dark"] {
  --surface: #161b22;
  --bg-sub: #1a2029;
  --bg-mute: #222a34;
  --bg-input: #1a2029;
  --border: #222a34;
  --border-2: #2a323d;
  --border-strong: #2e3742;
  --text: #e6e6e6;
  --text-2: #cfcfcf;
  --text-3: #b3b3b3;
  --text-4: #9a9a9a;
  --text-weak: #8a8a8a;
  --text-faint: #777777;
  --text-ghost: #5a5a5a;
  --accent: #42b983;
  --accent-2: #2ecc71;
  --accent-dark: #2ecc71;
  --accent-soft: #102319;
  --accent-disabled: #1f3a2e;
  --danger: #ff6b5e;
  --danger-2: #ff8a7e;
  --danger-bg: #2a1a18;
  --danger-bg-2: #3a2420;
  --warn-bg: #2a2415;
  --warn-border: #4a3f1f;
  --warn-text: #d9c08a;
}

/* ============================================================
   基础 reset
   ============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; outline: none; }
ul, ol { list-style: none; }

#main { padding-bottom: 70px; }


/* ============================================================
   Header
   ============================================================ */
#header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: relative; z-index: 100;
}
#header .icon-fanhui { font-size: 20px; color: var(--text-2); cursor: pointer; padding: 4px; flex-shrink: 0; }

/* 搜索胶囊 */
#header .hdr-search {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0;
  height: 40px; padding: 0 14px;
  background: var(--bg-input);
  border: 1px solid transparent; border-radius: 999px;
  transition: background 0.2s, border-color 0.2s;
}
#header .hdr-search:focus-within { background: var(--surface); border-color: var(--border-strong); }
#header .hdr-search .hdr-search-ico { flex-shrink: 0; width: 20px; height: 20px; color: var(--text-faint); }
#header .hdr-search input[type="search"] {
  flex: 1; min-width: 0; height: 100%; width: 100%;
  border: none; background: transparent; outline: none;
  -webkit-appearance: none; appearance: none;
  font-size: 15px; color: var(--text);
}
#header .hdr-search input[type="search"]::placeholder { color: var(--text-faint); }
#header .hdr-search input[type="search"]::-webkit-search-decoration,
#header .hdr-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

/* 右侧圆形图标 */
#header .hdr-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
#header .hdr-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  border: none; background: none; border-radius: 50%;
  color: var(--text); cursor: pointer;
  transition: background 0.2s;
}
#header .hdr-ico:hover { background: var(--bg-mute); }
#header .hdr-ico:active { opacity: 0.6; }
#header .hdr-ico svg { width: 26px; height: 26px; display: block; }

.user-entry {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--text-2); white-space: nowrap;
  flex-shrink: 0; padding: 4px 10px; border-radius: 18px;
}
.user-entry img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.user-entry .user-name { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ============================================================
   底部导航（桌面横排）
   ============================================================ */
@media screen and (min-width: 769px) {
  #bottom-nav { display: flex; align-items: center; gap: 18px; margin-left: auto; }
  #bottom-nav a { font-size: 14px; color: var(--text-3); padding: 4px 2px; transition: color 0.2s; }
  #bottom-nav a:hover { color: var(--accent); }
  #bottom-nav a.router-link-active { color: var(--accent); font-weight: 600; }
}


/* ============================================================
   入场动画
   ============================================================ */
.animate-up {
  animation: slideUp 0.8s ease forwards;
  opacity: 0;
  transform: translateY(30px);
}
@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }

.animate-slide {
  animation: slideLeft 0.9s ease-out forwards;
  opacity: 0;
  transform: translateX(80px);
}
@keyframes slideLeft { to { opacity: 1; transform: translateX(0); } }


/* ============================================================
   首页：未登录引导横幅
   ============================================================ */
.hero {
  text-align: center;
  padding: 30px 20px 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 0 0 30px 30px;
  margin: 0 0 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.hero-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.hero-desc  { font-size: 15px; color: var(--text-3); line-height: 1.6; margin-bottom: 18px; padding: 0 10px; }
.btn-login {
  display: inline-block;
  background: var(--accent); color: #fff;
  padding: 10px 40px; border-radius: 30px;
  font-size: 16px; font-weight: 600;
  transition: background 0.3s, transform 0.2s;
  box-shadow: 0 4px 8px rgba(66, 185, 131, 0.3);
}
.btn-login:active { transform: scale(0.95); background: var(--accent-dark); }


/* ============================================================
   首页：精选资源
   ============================================================ */
.systems-header {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0 16px; margin: 12px 0 4px;
}
.systems-title { font-size: 18px; font-weight: 600; color: var(--text); }
.more-link { font-size: 14px; color: var(--accent); }

.systems-scroll {
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  padding: 4px 0 12px;
  margin: 0 12px 12px;
  -webkit-overflow-scrolling: touch;
}
.systems-scroll::-webkit-scrollbar { display: none; }

.systems-list {
  display: inline-flex; gap: 10px;
  padding: 0 4px; white-space: nowrap;
}
.system {
  flex-shrink: 0; display: inline-block;
  background: var(--bg-mute); border-radius: 20px;
  padding: 6px 16px; font-size: 14px; color: var(--text-2);
  transition: background 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.system:active { background: var(--bg-mute); }


/* ============================================================
   Tab 栏
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-2);
  padding: 0 8px;
  margin: 4px 0 16px;
}
.tab {
  flex: 1;
  padding: 14px 0;
  font-size: 15px;
  color: var(--text-weak);
  font-weight: 500;
  position: relative;
}
.tab.active { color: #4a9eff; font-weight: 600; }
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 22%; right: 22%;
  height: 3px;
  background: #4a9eff;
  border-radius: 3px 3px 0 0;
}


/* ============================================================
   应用网格（首页 + 列表共用）
   ============================================================ */
.app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
  row-gap: 22px;
  padding: 8px 16px 20px;
  /* 防止 grid 在预留高度内把行拉伸撑开（否则只有几行时行距会被拉长） */
  align-content: start;
  /* 预留首屏 6 张卡片高度（≈内容高度），避免加载中→数据到达造成布局偏移 */
  min-height: 200px;
}

.app-card {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.app-card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--bg-mute);
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transform-origin: center;
  animation: iconPop 1s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  animation-delay: calc(0.15s * var(--i, 0));
}
@keyframes iconPop {
  0%   { opacity: 0; transform: scale(0.4); }
  100% { opacity: 1; transform: scale(1); }
}

.app-card-info { flex: 1; min-width: 0; }

.app-card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-card-meta {
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.meta-platform { color: var(--accent); }
.meta-dot { color: var(--text-ghost); }
.emoji { font-size: 14px; line-height: 1; }

.list-tip {
  text-align: center;
  color: var(--text-faint);
  padding: 40px 0;
  font-size: 14px;
}

/* 精选资源加载态：预留与 app-grid 相同高度，避免加载中→数据到达把页脚顶下去（CLS） */
.systems-section .list-tip {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ============================================================
   筛选栏（AppList）
   ============================================================ */
.filter-bar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.filter-row { display: flex; gap: 10px; margin-bottom: 8px; }
.filter-row:last-child { margin-bottom: 0; }
.filter-item { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: 11px; color: var(--text-weak); }
.filter-item select {
  width: 100%; height: 34px; padding: 0 8px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg-sub);
  font-size: 13px; color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.filter-item select:focus { border-color: var(--accent); background: var(--surface); }

.btn-filter {
  flex: 1;
  height: 34px;
  background: var(--accent); color: #fff;
  border-radius: 8px;
  font-size: 14px; font-weight: 500;
  align-self: flex-end;
  transition: background 0.2s, transform 0.15s;
}
.btn-filter:hover { background: var(--accent-dark); }
.btn-filter:active { transform: scale(0.97); }

/* 筛选折叠开关 */
.filter-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 0;
}
.btn-filter-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--bg-sub); color: var(--text-2);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-filter-toggle:hover { background: var(--bg-mute); }
.btn-filter-toggle .caret { width: 16px; height: 16px; transition: transform 0.2s; }
.btn-filter-toggle .caret.open { transform: rotate(180deg); }
.filter-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 1;
}

/* ============================================================
   应用列表标题行（应用库 N 个 + 上传安装包）
   ============================================================ */
.list-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 16px 4px;
}
.list-title {
  font-size: 18px; font-weight: 600; color: var(--text);
  display: flex; align-items: baseline; gap: 4px;
}
.list-title .list-count { color: var(--accent); }
.btn-upload {
  display: inline-flex; align-items: center; gap: 4px;
  height: 34px; padding: 0 16px;
  border-radius: 17px; background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
}
.btn-upload:hover { background: var(--accent-dark); }
.btn-upload:active { transform: scale(0.97); }


/* ============================================================
   分页
   ============================================================ */
.pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 16px 40px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.pagination-top {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; justify-content: center;
}
.page-info { font-size: 14px; color: var(--text-4); margin-right: 8px; }
.page-btn {
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 8px;
  background: var(--bg-mute); color: var(--text-2);
  font-size: 14px;
  display: inline-flex;
  align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.page-btn:hover:not(:disabled) { background: var(--border-2); }
.page-btn:active:not(:disabled) { transform: scale(0.95); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-btn.active { background: var(--accent); color: #fff; font-weight: 600; }
.page-ellipsis { padding: 0 6px; color: var(--text-faint); font-size: 14px; }

.page-jump { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-4); }
.page-jump input {
  width: 64px; height: 36px;
  text-align: center;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg-sub);
  font-size: 14px; color: var(--text-2);
  -moz-appearance: textfield;
  appearance: textfield;
}
.page-jump input::-webkit-outer-spin-button,
.page-jump input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.page-jump input:focus { border-color: var(--accent); background: var(--surface); outline: none; }
.page-jump button {
  height: 36px; padding: 0 20px;
  background: var(--accent); color: #fff;
  border-radius: 8px;
  font-size: 14px; font-weight: 500;
  transition: background 0.2s, transform 0.15s;
}
.page-jump button:hover { background: var(--accent-dark); }
.page-jump button:active { transform: scale(0.97); }


/* ============================================================
   发布按钮 + 弹窗
   ============================================================ */
#bottom-nav .publish-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  margin: 0 4px;
  margin-top: -20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 28px; font-weight: 300;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(66, 185, 131, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
#bottom-nav .publish-btn:active {
  transform: scale(0.9);
  box-shadow: 0 2px 6px rgba(66, 185, 131, 0.5);
}

.publish-modal {
  position: fixed; inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: publishFadeIn 0.2s ease;
}
@keyframes publishFadeIn { from { opacity: 0; } to { opacity: 1; } }

.publish-sheet {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  animation: publishSlideUp 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
}
@keyframes publishSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.publish-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 16px;
  font-size: 16px; font-weight: 600; color: var(--text);
}
.publish-close { font-size: 18px; color: var(--text-faint); padding: 4px 8px; }

.publish-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.publish-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 8px;
  background: var(--bg-input);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.publish-option:active { background: var(--bg-mute); transform: scale(0.96); }
.publish-icon { font-size: 32px; line-height: 1; }
.publish-label { font-size: 15px; font-weight: 600; color: var(--text); }
.publish-desc { font-size: 11px; color: var(--text-faint); text-align: center; }


/* ============================================================
   应用详情（AppDetail）
   ============================================================ */
.detail-page {
  padding-bottom: 20px;
}

/* 详情页骨架屏：预留与真实内容等高，避免加载时整页下移（CLS） */
.app-skeleton { display: block; }
.sk {
  background: linear-gradient(100deg, var(--bg-mute) 30%, var(--bg-hover) 50%, var(--bg-mute) 70%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s infinite linear;
  border-radius: 8px;
}
.sk-header { display: flex; align-items: flex-start; gap: 12px; padding: 20px 16px; }
.sk-icon { width: 72px; height: 72px; border-radius: 16px; flex-shrink: 0; }
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 10px; padding-top: 4px; min-width: 0; }
.sk-title { width: 60%; height: 20px; }
.sk-sub { width: 35%; height: 14px; }
.sk-actions-mini { display: grid; grid-template-columns: repeat(2, 72px); gap: 6px; width: 168px; flex-shrink: 0; }
.sk-btn-sm { height: 32px; border-radius: 16px; }
.sk-stats { display: flex; gap: 12px; padding: 0 16px 16px; }
.sk-stat { flex: 1; height: 44px; border-radius: 12px; }
.sk-attrs { display: flex; gap: 22px; padding: 12px 16px; border-bottom: 1px solid var(--border); overflow: hidden; }
.sk-attr { width: 56px; height: 27px; border-radius: 6px; flex-shrink: 0; }
.sk-tabs { display: flex; padding: 0 16px; border-bottom: 1px solid var(--border); }
.sk-tab { flex: 1; height: 43px; border-radius: 0; }
.sk-intro { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.sk-line { height: 14px; }
.sk-line:nth-child(1) { width: 100%; }
.sk-line:nth-child(2) { width: 92%; }
.sk-line:nth-child(3) { width: 78%; }
.sk-shots { display: flex; gap: 10px; padding: 0 16px 20px; margin-top: 8px; overflow: hidden; }
.sk-shot { width: 200px; height: 150px; border-radius: 10px; flex-shrink: 0; }


/* 顶部：左（图标+名称） / 右（按钮组） */
.app-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 16px;
}

/* 左侧：图标 + 名称 + 平台 */
.app-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.app-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--bg-mute);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform-origin: center;
  animation: appIconPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
@keyframes appIconPop {
  0%   { opacity: 0; transform: scale(0.5); }
  100% { opacity: 1; transform: scale(1); }
}

.app-title-wrap { flex: 1; min-width: 0; }

.app-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.3;
  word-break: break-word;
}

.app-platform {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 500;
}

/* 右侧：按钮组（两列 grid） */
.app-header-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  flex-shrink: 0;
  width: 168px;
}

.app-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 8px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--bg-mute);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.2s, transform 0.15s, color 0.2s;
}

.app-action-btn.full {
  grid-column: 1 / -1;
}

.app-action-btn:active {
  background: var(--bg-mute);
  transform: scale(0.96);
}

.app-action-btn.primary {
  background: var(--accent);
  color: #fff;
}

.app-action-btn.primary:active {
  background: var(--accent-dark);
}

@media (min-width: 769px) {
  .app-action-btn:hover { background: var(--border-2); }
  .app-action-btn.primary:hover { background: var(--accent-dark); }
}

/* 属性行（横向可滑） */
.app-attrs {
  display: flex;
  gap: 22px;
  padding: 12px 16px;
  overflow-x: auto;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.app-attrs::-webkit-scrollbar { display: none; }

.app-attr {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.attr-label { font-size: 11px; color: var(--text-faint); }
.attr-value { font-size: 13px; color: var(--text-2); font-weight: 500; }

/* Tab 栏 */
.detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.detail-tab {
  flex: 1;
  padding: 14px 0;
  font-size: 15px;
  color: var(--text-weak);
  background: none;
  border: none;
  position: relative;
  cursor: pointer;
  font-weight: 500;
}
.detail-tab.active { color: var(--accent); font-weight: 600; }
.detail-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 30%; right: 30%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* Tab 内容 */
.detail-tab-content { padding: 16px; min-height: 200px; }

.intro-block { min-height: 100px; }
.intro-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-block { min-height: 100px; }
.comment-tip {
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
  padding: 40px 0;
}


/* ============================================================
   全局提示
   ============================================================ */
.loading-tip,
.error-tip {
  text-align: center;
  font-size: 14px;
  color: var(--text-faint);
  padding: 60px 20px;
}
.error-tip { color: var(--danger); }


/* ============================================================
   全局错误提示条（底部红色）
   ============================================================ */
.global-error-bar {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(90px + env(safe-area-inset-bottom));
  z-index: 9999;
  background: var(--danger);
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(211, 47, 47, 0.35);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  word-break: break-word;
  cursor: pointer;
  max-width: 560px;
  margin: 0 auto;
}
.global-error-bar.show {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================================
   登录页
   ============================================================ */
.login-page {
  padding: 20px 16px 60px;
}

.box {
  max-width: 420px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* 小标题（账号登录 / 第三方登录） */
.box h2 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-faint);
  text-align: center;
  margin-bottom: 18px;
  position: relative;
}
.box h2::before,
.box h2::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 28%;
  height: 1px;
  background: var(--border-2);
}
.box h2::before { left: 6%; }
.box h2::after  { right: 6%; }

/* 账号密码表单 */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.login-field {
  position: relative;
  display: flex;
  align-items: center;
}

.login-field input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 23px;
  background: var(--bg-sub);
  font-size: 15px;
  color: var(--text-2);
  transition: border-color 0.2s, background 0.2s;
}
.login-field input:focus {
  border-color: var(--accent);
  background: var(--surface);
  outline: none;
}
.login-field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 密码框加右侧留白，避免被👁遮住 */
.login-field-pwd input {
  padding-right: 46px;
}

.login-pwd-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  color: var(--text-faint);
  cursor: pointer;
  transition: background 0.15s;
}
.login-pwd-toggle:active {
  background: var(--bg-mute);
}

/* 登录按钮 */
.login-submit {
  width: 100%;
  height: 46px;
  border-radius: 23px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
  transition: background 0.2s, transform 0.15s;
}
.login-submit:disabled {
  background: var(--accent-disabled);
  cursor: not-allowed;
}
.login-submit:not(:disabled):active {
  background: var(--accent-dark);
  transform: scale(0.98);
}

/* 第三方登录分隔标题 */
.login-divider {
  margin-top: 12px;
}

/* 第三方登录按钮 */
.login-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  margin-bottom: 12px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}
.login-oauth:hover {
  opacity: 0.92;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.login-oauth:active {
  transform: scale(0.97);
  opacity: 0.85;
}

/* ============================================================
   记住我
   ============================================================ */
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-3);
  cursor: pointer;
  user-select: none;
  padding: 0 4px;
  margin-top: -2px;
}

.login-remember input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.login-remember input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ============================================================
   第三方登录按钮：改用 class 命名配色（避免 nth-of-type 顺序问题）
   ============================================================ */
.login-oauth.weibo   { background: #e6162d; }   /* 微博红 */
.login-oauth.qq      { background: #12b7f5; }   /* QQ 蓝 */
.login-oauth.baidu   { background: #2932e1; }   /* 百度蓝 */
.login-oauth.github  { background: #24292e; }   /* GitHub 黑 */
.login-oauth.discord { background: #5865f2; }   /* Discord 紫 */
.login-oauth.line    { background: #06c755; }   /* LINE 绿 */
.login-oauth.twitch  { background: #9146ff; }   /* Twitch 紫 */

/* 如果你之前的样式里有 nth-of-type 配色，可以删掉那一段，改用上面这些 class */


/* ============================================================
   AppUpload
   ============================================================ */
.upload-page {
  padding: 16px 16px 100px;
}

/* 提示条 */
.upload-notice {
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 13px;
  line-height: 1.7;
  border: 1px solid var(--warn-border);
  border-radius: 10px;
  text-align: justify;
}

/* 拖拽区域 */
.upload-dropzone {
  border: 2px dashed var(--text-ghost);
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-sub);
  transition: border-color 0.2s, background 0.2s;
}
.upload-dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.upload-dropzone.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.01);
}
.upload-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 12px;
}
.upload-hint {
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.upload-hint strong { color: var(--accent); }
.upload-subhint {
  font-size: 12px;
  color: var(--text-faint);
}

/* 文件列表 */
.upload-list { margin-top: 20px; }
.upload-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.upload-count { font-size: 13px; color: var(--text-4); }
.upload-clear {
  font-size: 13px;
  color: var(--danger);
  padding: 4px 10px;
  border-radius: 14px;
  background: var(--danger-bg);
  transition: background 0.2s;
}
.upload-clear:disabled { opacity: 0.4; cursor: not-allowed; }
.upload-clear:not(:disabled):active { background: var(--danger-bg-2); }

/* 单个文件 */
.upload-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-sub);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}
.upload-item.is-success {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
}
.upload-item.is-error {
  border-color: var(--danger-bg);
  background: var(--danger-bg);
}
.upload-item-main { flex: 1; min-width: 0; }
.upload-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}
.upload-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--text-weak);
  margin-bottom: 6px;
}
.upload-item-status { color: var(--accent); }
.upload-item.is-error .upload-item-status { color: var(--danger); }
.upload-item-msg { color: var(--danger); flex-basis: 100%; }

/* 进度条 */
.upload-item-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.upload-item-bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.2s ease;
}

/* 移除按钮 */
.upload-item-remove {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-mute);
  color: var(--text-weak);
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.upload-item-remove:active { background: var(--bg-mute); color: var(--text-2); }

/* 底部提示 */
.upload-tips {
  margin-top: 24px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-faint);
  text-align: center;
  padding: 0 8px;
}

/* 底部悬浮操作 */
.upload-action-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1000;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--border-2);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}
.upload-btn-primary {
  display: block;
  width: 100%;
  height: 44px;
  border-radius: 22px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
}
.upload-btn-primary:disabled {
  background: var(--accent-disabled);
  cursor: not-allowed;
}
.upload-btn-primary:not(:disabled):active {
  background: var(--accent-dark);
  transform: scale(0.98);
}


/* ============================================================
   我的页面
   ============================================================ */
.my-page {
  padding: 16px 16px 100px;
}

.my-user {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 16px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 16px;
}
.my-user:active { background: var(--bg-input); }

.my-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-mute);
  flex-shrink: 0;
}
.my-avatar-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--text-ghost);
  background: var(--bg-mute);
}

.my-user-info { flex: 1; min-width: 0; }
.my-nickname {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.my-nickname-empty { color: var(--text-weak); font-weight: 500; }
.my-userid { font-size: 12px; color: var(--text-faint); }
.my-arrow { font-size: 22px; color: var(--text-ghost); flex-shrink: 0; }

/* 账号分析 */
.my-analysis {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 20px 8px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
}
.my-analysis-item {
  flex: 1;
  text-align: center;
  position: relative;
}
.my-analysis-item + .my-analysis-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: var(--border);
}
.my-analysis-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.my-analysis-label { font-size: 12px; color: var(--text-weak); }

/* 菜单 */
.my-menu {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
  overflow: hidden;
}
.my-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--bg-mute);
  transition: background 0.15s;
}
.my-menu-item:last-child { border-bottom: none; }
.my-menu-item:active { background: var(--bg-input); }
.my-menu-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
.my-menu-label {
  flex: 1;
  font-size: 15px;
  color: var(--text-2);
  min-width: 0;
}
.my-menu-arrow {
  font-size: 18px;
  color: var(--text-ghost);
  flex-shrink: 0;
}

/* 底部 */
.my-footer {
  text-align: center;
  padding: 24px 0 8px;
  font-size: 12px;
  color: var(--text-ghost);
  line-height: 1.8;
}
.my-version { color: var(--text-ghost); }

/* ============================================================
   统计行（下载数 / 浏览数）
   ============================================================ */
.app-stats {
  display: flex;
  gap: 12px;
  padding: 0 16px 16px;
}

.app-stat {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  background: var(--bg-sub);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.app-stat-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.app-stat-label {
  font-size: 12px;
  color: var(--text-weak);
  line-height: 1;
}

/* ============================================================
   编辑应用页（AppEdit）
   ============================================================ */
.edit-page {
  padding: 16px 16px 40px;
}

.edit-form {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ============================================================
   字段容器
   ============================================================ */
.edit-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edit-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.edit-label-hint {
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 400;
}

.edit-hint {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.6;
}

/* ============================================================
   输入框 / 文本域 / 下拉框
   ============================================================ */
.edit-field input[type="text"],
.edit-field textarea,
.edit-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-sub);
  font-size: 14px;
  color: var(--text-2);
  transition: border-color 0.2s, background 0.2s;
}

.edit-field input[type="text"]:focus,
.edit-field textarea:focus,
.edit-field select:focus {
  border-color: var(--accent);
  background: var(--surface);
  outline: none;
}

.edit-field textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
}

.edit-field select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23999' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.edit-field select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   图标（拖入 + 点击）
   ============================================================ */
.edit-icon-row {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  padding: 10px;
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--bg-sub);
  transition: border-color 0.2s, background 0.2s;
}

.edit-icon-row:active,
.edit-icon-row.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.edit-icon-preview {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--bg-mute);
  flex-shrink: 0;
}

.edit-icon-hint {
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.6;
}
.edit-icon-hint small {
  color: var(--text-ghost);
  font-size: 12px;
}

/* ============================================================
   截图（拖入 + 点击）
   ============================================================ */
.edit-screenshots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--bg-sub);
  min-height: 140px;
  transition: border-color 0.2s, background 0.2s;
}

.edit-screenshots.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.edit-ss-item {
  position: relative;
  width: 90px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-mute);
  flex-shrink: 0;
}

.edit-ss-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.edit-ss-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.edit-ss-remove:active {
  background: rgba(0, 0, 0, 0.8);
}

.edit-ss-add {
  width: 90px;
  height: 120px;
  border: 2px dashed var(--border-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--text-faint);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.edit-ss-add:active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ============================================================
   复选（不提供在线玩）
   ============================================================ */
.edit-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-2);
  user-select: none;
}

.edit-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ============================================================
   拖入区（安装包 / 资源包）
   ============================================================ */
.edit-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 16px;
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--bg-sub);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.edit-dropzone:active,
.edit-dropzone.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.edit-dropzone-name {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  text-align: center;
}

.edit-dropzone-hint {
  font-size: 12px;
  color: var(--text-faint);
}

/* ============================================================
   操作按钮（返回 / 保存）
   ============================================================ */
.edit-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.edit-btn {
  flex: 1;
  height: 46px;
  border-radius: 23px;
  background: var(--bg-mute);
  color: var(--text-3);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.edit-btn:active:not(:disabled) {
  background: var(--bg-mute);
  transform: scale(0.98);
}

.edit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.edit-btn.primary {
  background: var(--accent);
  color: #fff;
}

.edit-btn.primary:active:not(:disabled) {
  background: var(--accent-dark);
}

/* ============================================================
   重置密码页
   ============================================================ */
.reset-page {
  padding: 20px 16px 60px;
}

.reset-box {
  max-width: 420px;
  margin: 0 auto;
  padding: 24px 20px;
}

.reset-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
}

.reset-desc {
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 28px;
}

/* ============================================================
   表单
   ============================================================ */
.reset-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.reset-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reset-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
}

.reset-field input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 23px;
  background: var(--bg-sub);
  font-size: 15px;
  color: var(--text-2);
  transition: border-color 0.2s, background 0.2s;
}
.reset-field input:focus {
  border-color: var(--accent);
  background: var(--surface);
  outline: none;
}
.reset-field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================
   邮箱 + 获取验证码
   ============================================================ */
.reset-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.reset-row input {
  flex: 1;
  min-width: 0;
}

.reset-code-btn {
  flex-shrink: 0;
  height: 46px;
  padding: 0 18px;
  border-radius: 23px;
  background: var(--bg-mute);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--accent);
  cursor: pointer;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background 0.2s, transform 0.15s, color 0.2s, border-color 0.2s;
}
.reset-code-btn:active:not(:disabled) {
  background: var(--accent-soft);
  transform: scale(0.97);
}
.reset-code-btn:disabled {
  color: var(--text-ghost);
  border-color: var(--border-strong);
  background: var(--bg-mute);
  cursor: not-allowed;
}

/* 倒计时状态 */
.reset-code-btn.counting {
  color: var(--text-faint);
  border-color: var(--bg-mute);
  background: var(--bg-mute);
  cursor: not-allowed;
}

/* ============================================================
   密码框
   ============================================================ */
.reset-pwd-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.reset-pwd-wrap input {
  padding-right: 46px;
}

.reset-pwd-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  color: var(--text-faint);
  cursor: pointer;
  transition: background 0.15s;
}
.reset-pwd-toggle:active {
  background: var(--bg-mute);
}

.reset-hint {
  font-size: 12px;
  color: var(--text-faint);
}

/* ============================================================
   提交按钮
   ============================================================ */
.reset-submit {
  width: 100%;
  height: 46px;
  border-radius: 23px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
  transition: background 0.2s, transform 0.15s;
}
.reset-submit:disabled {
  background: var(--accent-disabled);
  cursor: not-allowed;
}
.reset-submit:not(:disabled):active {
  background: var(--accent-dark);
  transform: scale(0.98);
}

/* ============================================================
   底部链接
   ============================================================ */
.reset-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-ghost);
}

.reset-link {
  color: var(--accent);
  cursor: pointer;
  padding: 0 4px;
}

.reset-sep {
  margin: 0 4px;
  color: var(--border-strong);
}


/* ============================================================
   应用详情：截图区
   ============================================================ */
.screenshot-section {
  margin-top: 24px;
}

.screenshot-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px;
  padding-left: 4px;
  position: relative;
}
.screenshot-title::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
}

/* 横向滑动容器 */
.screenshot-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  margin: 0 -16px;   /* 让截图向左右两侧铺满 */
  padding-left: 16px;
  padding-right: 16px;
}
.screenshot-scroll::-webkit-scrollbar { display: none; }

.screenshot-list {
  display: inline-flex;
  gap: 10px;
  white-space: nowrap;
}

.screenshot-item {
  display: block;
  width: 200px;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg-mute);
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* 截图：可点击替换 */
.edit-ss-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.15s;
}
.edit-ss-img:hover {
  opacity: 0.85;
}
.edit-ss-img:active {
  opacity: 0.7;
}

/* ============================================================
   小"清除"按钮（图标 / 安装包 / 资源包 右上角 X）
   ============================================================ */
.edit-icon-row,
.edit-dropzone {
  position: relative;
}

.edit-clear-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.edit-clear-btn:active {
  background: rgba(0, 0, 0, 0.8);
}

/* ============================================================
   资源包 删除态
   ============================================================ */
.edit-dropzone.is-deleted {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.edit-dropzone.is-deleted .edit-dropzone-name {
  color: var(--danger);
}
.edit-dropzone.is-deleted .edit-dropzone-hint {
  color: var(--danger-2);
}

/* ============================================================
   资源包 操作按钮（删除 / 取消删除）
   ============================================================ */
.edit-resource-actions {
  display: flex;
  justify-content: flex-end;
}

.edit-btn-small {
  padding: 6px 14px;
  border-radius: 14px;
  background: var(--bg-mute);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.edit-btn-small:active {
  background: var(--bg-mute);
}
.edit-btn-small.danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.edit-btn-small.danger:active {
  background: var(--danger-bg-2);
}

/* ============================================================
   搜索页
   ============================================================ */
.search-page {
  padding: 12px 16px 40px;
}

/* ===== 搜索栏 ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.search-input {
  flex: 1;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--bg-input);
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s;
}
.search-input:focus {
  border-color: var(--accent);
  background: var(--surface);
  outline: none;
}

.search-btn {
  flex-shrink: 0;
  height: 40px;
  padding: 0 18px;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
}
.search-btn:active {
  background: var(--accent-dark);
  transform: scale(0.97);
}

/* ===== 搜索历史 ===== */
.search-history {
  margin-top: 8px;
}

.search-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.search-history-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.search-history-clear {
  font-size: 13px;
  color: var(--danger);
  padding: 4px 10px;
  border-radius: 14px;
  background: var(--danger-bg);
  transition: background 0.15s;
}
.search-history-clear:active {
  background: var(--danger-bg-2);
}

.search-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-sub);
  cursor: pointer;
  transition: background 0.15s;
}
.search-history-item:active {
  background: var(--bg-mute);
}

.search-history-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-history-remove {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-ghost);
  font-size: 12px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
}
.search-history-remove:active {
  background: var(--bg-mute);
  color: var(--text-2);
}

.search-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
  font-size: 14px;
}

/* ===== Tab 栏 ===== */
.search-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.search-tab {
  flex: 1;
  padding: 12px 0;
  font-size: 15px;
  color: var(--text-weak);
  background: none;
  border: none;
  position: relative;
  cursor: pointer;
  font-weight: 500;
}
.search-tab.active {
  color: var(--accent);
  font-weight: 600;
}
.search-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 30%;
  right: 30%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ===== 筛选 ===== */
.search-filter {
  margin-bottom: 12px;
}

.search-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 16px;
  background: var(--bg-mute);
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}
.search-filter-toggle:active {
  background: var(--bg-mute);
}

.search-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.search-filter-arrow {
  font-size: 10px;
  color: var(--text-faint);
}

.search-filter-panel {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-sub);
  border: 1px solid var(--border);
}

.search-filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.search-filter-row:last-of-type {
  margin-bottom: 0;
}

.search-filter-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-filter-label {
  font-size: 11px;
  color: var(--text-weak);
}

.search-filter-item select {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.search-filter-item select:focus {
  border-color: var(--accent);
  outline: none;
}

.search-filter-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.search-filter-btn {
  padding: 6px 18px;
  border-radius: 16px;
  background: var(--bg-mute);
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}
.search-filter-btn:active {
  background: var(--bg-mute);
}
.search-filter-btn.primary {
  background: var(--accent);
  color: #fff;
}
.search-filter-btn.primary:active {
  background: var(--accent-dark);
}

/* ===== 结果 ===== */
.search-results {
  padding-top: 4px;
}

/* ============================================================
   桌面端
   ============================================================ */
@media screen and (min-width: 769px) {
  .search-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px 0 60px;
  }
  .search-input {
    height: 44px;
  }
  .search-btn {
    height: 44px;
    padding: 0 24px;
    font-size: 15px;
  }
  .search-history-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .search-history-item {
    width: auto;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 18px;
  }
}

/* ============================================================
   手机端
   ============================================================ */
@media screen and (max-width: 768px) {
  .search-page {
    padding: 12px 12px 30px;
  }
}


/* ============================================================
   首页：用户列表（横向滑动）
   ============================================================ */
.users-section {
  margin: 8px 0 20px;
}

.users-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin: 0 12px;
  padding: 4px 0 12px;
  /* 预留一行头像高度，避免加载中→数据到达造成布局偏移 */
  min-height: 92px;
}
.users-scroll::-webkit-scrollbar { display: none; }

.users-list {
  display: inline-flex;
  gap: 14px;
  padding: 0 4px;
  white-space: nowrap;
}

.user-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 64px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s;
}
.user-card:active {
  transform: scale(0.95);
}

.user-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-mute);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.user-nickname {
  font-size: 12px;
  color: var(--text-3);
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* ============================================================
   横幅广告（循环轮播卡片）
   ============================================================ */
.banner-wrap {
  margin: 12px 0 20px;
}

.banner-scroll {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 8px;
  margin: 0 12px;
}
.banner-scroll::-webkit-scrollbar { display: none; }

/* 卡片 */
.banner-item {
  flex-shrink: 0;
  width: 88%;
  margin-right: 12px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-mute);
  scroll-snap-align: center;
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.banner-item:active {
  transform: scale(0.98);
}
.banner-item:last-child {
  margin-right: 12px;
}

.banner-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;    /* 卡片比例，可改 16/9 */
  object-fit: cover;
  background: var(--bg-mute);
}

/* 横幅骨架屏：与真实横幅同尺寸，加载前预留空间，避免 CLS */
.banner-skeleton {
  aspect-ratio: 16 / 7;
  background: linear-gradient(100deg, var(--bg-mute) 30%, var(--bg-hover) 50%, var(--bg-mute) 70%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s infinite linear;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.banner-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 14px 10px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 指示点 */
.banner-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.banner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-ghost);
  cursor: pointer;
  transition: background 0.2s, width 0.2s;
}

.banner-dot.active {
  background: var(--accent);
  width: 18px;
  border-radius: 3px;
}

/* ============================================================
   首页 Tab 栏
   ============================================================ */
.home-page {
  padding-top: 4px;
}

.home-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 10;
}

.home-tab {
  flex: 1;
  padding: 14px 0;
  font-size: 15px;
  color: var(--text-weak);
  background: none;
  border: none;
  position: relative;
  cursor: pointer;
  font-weight: 500;
}
.home-tab.active {
  color: var(--accent);
  font-weight: 600;
}
.home-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 30%;
  right: 30%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* 子页面容器 */
.home-subpage {
  padding: 0 16px 40px;
}

/* 关注/好友：用户网格 */
.home-subpage .users-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 8px 0;
}
.home-subpage .user-card {
  width: auto;
}
.home-subpage .user-avatar {
  width: 56px;
  height: 56px;
}

/* ============================================================

/* ============================================================
   暗色特例（渐变、半透明白底等无法用单一变量表达）
   ============================================================ */
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #1a2330 0%, #0e131b 100%);
}
[data-theme="dark"] .upload-action-bar {
  background: rgba(18, 23, 30, 0.92);
  border-top-color: #232a33;
}
[data-theme="dark"] .global-error-bar {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

