/* 软件口袋 · 静态软件库  样式表（按原版 App 页面还原）
   配色由 data.json -> meta.theme 远程控制（CSS 变量） */
:root {
  --primary: #6c5ce7;
  --primary2: #8b7cff;
  --bg-top: #e8ecff;
  --bg-bottom: #f6f2ff;
  --card: #ffffff;
  --text: #222222;
  --sub: #8a8aa0;
  --radius: 16px;
  --nav-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 45%, #f4f5fb 100%);
  background-attachment: fixed;
  font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h3, h4 { margin: 0; }

#app { min-height: 100vh; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px); }

/* ============ 一级页顶部标题栏（首页/软件/发现/更多） ============ */
.topbar {
  display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 14px;
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(240,242,255,.96), rgba(240,242,255,.80));
  backdrop-filter: saturate(180%) blur(12px);
}
.topbar .title { font-size: 17px; font-weight: 700; flex: 1; }
.btn-mini {
  border: none; background: var(--primary); color: #fff;
  font-size: 12.5px; padding: 5px 13px; border-radius: 14px; cursor: pointer;
}
.btn-mini.ghost { background: rgba(108,92,231,.12); color: var(--primary); }

/* ============ 二级页通栏渐变页头（原版样式） ============ */
.phead { padding: 12px 16px 20px; color: #fff; position: relative; }
.phead .ph-row { display: flex; align-items: center; gap: 6px; }
.phead .ph-back { font-size: 26px; line-height: 1; width: 24px; cursor: pointer; opacity: .95; }
.phead .ph-title { font-size: 19px; font-weight: 800; letter-spacing: .5px; }
.phead .ph-sub { font-size: 12.5px; opacity: .92; margin-top: 4px; padding-left: 30px; }
.phead .ph-sub.nopl { padding-left: 0; }

/* ============ 首页顶部大横幅 ============ */
.banner {
  margin: 12px 12px 14px; padding: 18px 16px 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary2) 100%);
  color: #fff; box-shadow: 0 8px 22px rgba(108,92,231,.26);
  background-size: cover; background-position: center;
}
.banner .b-title { font-size: 25px; font-weight: 800; letter-spacing: 1px; }
.banner .b-sub { font-size: 13px; opacity: .92; margin-top: 2px; }
.banner .b-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.banner .b-tags span { font-size: 12px; padding: 4px 11px; border-radius: 20px; background: rgba(255,255,255,.22); }

/* ============ 首页 2×2 大入口卡片（原版样式） ============ */
.biggrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 12px; }
.bigcard {
  position: relative; height: 98px; border-radius: var(--radius); padding: 14px 14px;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden; cursor: pointer; color: #fff;
  box-shadow: 0 6px 16px rgba(31,38,135,.16);
  transition: transform .12s;
}
.bigcard:active { transform: scale(.97); }
.bigcard .bc-name { font-size: 16.5px; font-weight: 800; letter-spacing: .5px; position: relative; z-index: 2; }
.bigcard .bc-sub { font-size: 11px; opacity: .9; margin-top: 3px; position: relative; z-index: 2; }
.bigcard .bc-ico {
  position: absolute; right: -4px; bottom: -6px; font-size: 62px; line-height: 1;
  opacity: .26; z-index: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.12));
}
.bigcard .bc-ico img { width: 62px; height: 62px; object-fit: contain; }
.bigcard .bc-bg { position: absolute; inset: 0; z-index: 0; object-fit: cover; opacity: .35; }

/* ============ 提示条 ============ */
.tipbar {
  margin: 14px 12px 0; padding: 10px 12px; border-radius: 12px;
  background: rgba(255,122,69,.12); color: #d1540f; font-size: 12.5px;
}

/* ============ 通用区块 ============ */
.sec { margin: 18px 12px 0; }
.sec-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sec-h h3 { font-size: 16px; font-weight: 700; }
.sec-h .more { font-size: 12.5px; color: var(--sub); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 2px 12px rgba(31,38,135,.07); overflow: hidden; }

/* ============ 最近更新：横向卡片（带头像+名称+大小+查看按钮） ============ */
.recent-list { display: flex; flex-direction: column; gap: 9px; }
.recent-item {
  display: flex; align-items: center; gap: 11px;
  background: var(--card); border-radius: 14px; padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(31,38,135,.06); cursor: pointer;
}
.recent-item:active { transform: scale(.99); }
.recent-item .r-av {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: linear-gradient(135deg, #eef0ff, #f6f2ff);
}
.recent-item .r-av img { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; }
.recent-item .r-info { flex: 1; min-width: 0; }
.recent-item .r-name {
  font-size: 14px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.recent-item .r-meta { font-size: 11.5px; color: var(--sub); margin-top: 3px; }
.recent-item .r-btn {
  flex: none; background: var(--primary); color: #fff; font-size: 12px;
  padding: 6px 15px; border-radius: 15px;
}

/* ============ 公告专区 2×2 图标格 ============ */
.grid { display: grid; gap: 10px; }
.grid.g2 { grid-template-columns: repeat(2, 1fr); }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
.entry {
  background: var(--card); border-radius: 14px; padding: 14px 4px 11px;
  text-align: center; box-shadow: 0 2px 10px rgba(31,38,135,.06);
  cursor: pointer; transition: transform .12s;
}
.entry:active { transform: scale(.96); }
.entry .ico {
  width: 46px; height: 46px; margin: 0 auto 7px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff;
}
.entry .ico img { width: 28px; height: 28px; object-fit: contain; }
.entry .nm { font-size: 13px; font-weight: 600; }
.entry .ds { font-size: 10.5px; color: var(--sub); margin-top: 1px; }

/* ============ 发现页 / 工具页 图标墙 ============ */
.dgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 12px; }
.dgrid.g3 { grid-template-columns: repeat(3, 1fr); }
.ditem {
  background: var(--card); border-radius: 14px; padding: 10px;
  display: flex; align-items: center; gap: 9px;
  box-shadow: 0 2px 10px rgba(31,38,135,.06); cursor: pointer;
}
.ditem:active { transform: scale(.98); }
.ditem .di-ico {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff;
}
.ditem .di-ico img { width: 24px; height: 24px; object-fit: contain; }
.ditem .di-nm {
  font-size: 13px; font-weight: 600; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ============ 软件页：双列卡片网格 ============ */
.appgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 12px; }
.appcard {
  background: var(--card); border-radius: 14px; padding: 11px;
  display: flex; gap: 10px; align-items: center;
  box-shadow: 0 2px 10px rgba(31,38,135,.06); cursor: pointer;
}
.appcard:active { transform: scale(.98); }
.appcard .a-ico {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: linear-gradient(135deg, #eef0ff, #f6f2ff);
}
.appcard .a-ico img { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; }
.appcard .a-nm {
  font-size: 13px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.appcard .a-mt { font-size: 11px; color: var(--sub); margin-top: 4px; }

/* ============ 分类标签 ============ */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 12px 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 6px 15px; border-radius: 18px; font-size: 13px;
  background: var(--card); color: var(--sub); cursor: pointer;
  box-shadow: 0 1px 6px rgba(31,38,135,.06);
}
.tab.on { background: var(--primary); color: #fff; font-weight: 600; }

/* ============ 搜索 ============ */
.searchbar { display: flex; gap: 8px; padding: 10px 12px 0; }
.searchbar input {
  flex: 1; border: none; outline: none; background: var(--card);
  border-radius: 20px; padding: 9px 15px; font-size: 14px;
  box-shadow: 0 1px 6px rgba(31,38,135,.06);
}

/* ============ 影视海报墙（3 列竖版） ============ */
.postergrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 12px; }
.poster { cursor: pointer; }
.poster .p-img {
  aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #dfe6ff, #f0e9ff);
  display: flex; align-items: center; justify-content: center; font-size: 32px;
  box-shadow: 0 3px 10px rgba(31,38,135,.09);
}
.poster .p-img img { width: 100%; height: 100%; object-fit: cover; }
.poster .p-nm {
  font-size: 12.5px; font-weight: 600; margin-top: 6px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.poster .p-note { font-size: 11px; color: var(--sub); }

/* ============ 列表行（更多页 / 站点 / 音源） ============ */
.lst { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 11px; padding: 13px 14px; border-bottom: 1px solid rgba(0,0,0,.05); cursor: pointer; }
.row:last-child { border-bottom: none; }
.row:active { background: rgba(0,0,0,.02); }
.row .r-ico {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 19px; color: #fff;
}
.row .r-ico img { width: 24px; height: 24px; object-fit: contain; }
.row .r-main { flex: 1; min-width: 0; }
.row .r-main .t { font-size: 14.5px; font-weight: 600; }
.row .r-main .d { font-size: 11.5px; color: var(--sub); margin-top: 2px; word-break: break-all; }
.row .r-go { color: var(--sub); font-size: 13px; flex: none; }

/* ============ 文本块页（软件问题/报毒解决/口袋介绍/分享口袋） ============ */
.block {
  background: var(--card); border-radius: 14px; padding: 14px 15px; margin: 0 12px 11px;
  box-shadow: 0 2px 10px rgba(31,38,135,.06);
}
.block h4 { font-size: 14.5px; font-weight: 700; margin-bottom: 7px; }
.block p { margin: 0; font-size: 13.5px; color: #444; white-space: pre-wrap; }
.block.red p, .red { color: #e0483d; }

/* ============ 表单 ============ */
.form { padding: 16px; }
.form label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 7px; }
.form label i { color: #e0483d; font-style: normal; }
.form input[type=text], .form textarea {
  width: 100%; border: 1px solid rgba(0,0,0,.10); border-radius: 12px;
  padding: 11px 13px; font-size: 14px; font-family: inherit; outline: none; background: #fbfbff;
}
.form textarea { min-height: 104px; resize: vertical; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 15px; border-radius: 18px; font-size: 13px; cursor: pointer; background: #f2f3fb; color: var(--sub); }
.chip.on { background: var(--primary); color: #fff; font-weight: 600; }
.btn {
  display: block; width: 100%; border: none; border-radius: 14px;
  padding: 13px; font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  margin-top: 18px; cursor: pointer;
}
.form-note { font-size: 12px; color: var(--sub); margin-top: 14px; text-align: center; line-height: 1.6; }

/* ============ 更多页头部 ============ */
.me-head { display: flex; align-items: center; gap: 13px; margin: 12px; padding: 15px; background: var(--card); border-radius: var(--radius); box-shadow: 0 2px 12px rgba(31,38,135,.07); }
.me-head .me-av {
  width: 54px; height: 54px; border-radius: 15px; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--primary2)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.me-head .me-av img { width: 100%; height: 100%; border-radius: 15px; object-fit: cover; }
.me-head .me-n { font-size: 16.5px; font-weight: 700; }
.me-head .me-s { font-size: 12px; color: var(--sub); margin-top: 3px; }

/* ============ 底部导航（原版四个） ============ */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255,255,255,.95);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid rgba(0,0,0,.06);
}
.nav .n { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; color: var(--sub); font-size: 11px; }
.nav .n .ni { font-size: 21px; line-height: 1; }
.nav .n.on { color: var(--primary); font-weight: 700; }

/* ============ 弹窗 / Toast ============ */
.mask { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.modal { width: 100%; max-width: 340px; background: #fff; border-radius: 18px; padding: 20px; max-height: 78vh; overflow: auto; }
.modal h3 { font-size: 17px; margin-bottom: 10px; }
.modal .m-body { font-size: 14px; white-space: pre-wrap; color: #444; }
.modal .m-acts { display: flex; gap: 10px; margin-top: 18px; }
.modal .m-acts button { flex: 1; border: none; border-radius: 12px; padding: 11px; font-size: 14px; cursor: pointer; }
.modal .m-acts .ok { background: var(--primary); color: #fff; font-weight: 700; }
.modal .m-acts .no { background: #f1f2f7; color: #666; }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 300; background: rgba(0,0,0,.82); color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 14px; max-width: 80%; animation: fade .15s ease; }

/* ============ 下载弹层 ============ */
.dlbox .dl-t { font-weight: 700; font-size: 15.5px; margin-bottom: 4px; }
.dlbox .dl-s { font-size: 12.5px; color: var(--sub); margin-bottom: 12px; }
.dlbox .dl-pwd { background: #f6f6fb; border-radius: 10px; padding: 9px 11px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dlbox .dl-btns { display: flex; flex-direction: column; gap: 8px; }
.dlbox .dl-btns button { border: none; border-radius: 12px; padding: 12px; font-size: 14px; cursor: pointer; }
.dlbox .b1 { background: var(--primary); color: #fff; font-weight: 700; }
.dlbox .b2 { background: #f1f2f7; color: #444; }

.empty { text-align: center; color: var(--sub); font-size: 13px; padding: 40px 0; }
