/* 后台管理、我的账户 */
/* ---------- 后台 ---------- */
.admin { flex: 1; overflow-y: auto; }
.admin-inner { max-width: 980px; margin: 0 auto; padding: 4px 20px 40px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; } /* 不要出现上下滚动条（标签下划线多出 1 像素） */
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: transparent; padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.active { color: var(--text); border-color: var(--accent); font-weight: 600; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h3 { margin: 0; font-size: 17px; }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; flex-basis: 100%; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; display: grid; gap: 10px; align-content: start;
}
.card.off { opacity: .6; }
.card-top { display: flex; align-items: center; gap: 10px; }
.card-top .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; }
.card-top .n { flex: 1; min-width: 0; }
.card-top .n b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-top .n small { color: var(--faint); font-size: 12px; }
.kv { font-size: 13px; color: var(--muted); display: grid; gap: 2px; }
.kv code { font-family: var(--mono); font-size: 12px; word-break: break-all; color: var(--text); }
.badge { display: inline-block; white-space: nowrap; font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--hover); color: var(--muted); font-weight: 600; }
.badge.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge.warn { background: var(--accent-soft); color: var(--accent); }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: 14px; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { font-size: 12px; color: var(--faint); font-weight: 600; background: var(--hover); }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .mono { font-family: var(--mono); font-size: 12px; color: var(--muted); word-break: break-all; }
.table-scroll { overflow-x: auto; border-radius: var(--radius); }
.prov-group { margin-bottom: 22px; }
.prov-group h4 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* ---------- 我的账户 / 后台面板 ---------- */
.balance-card {
  border-radius: 20px; padding: 20px 22px; margin: 4px 0 16px; color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 30%, transparent);
}
.balance-card .who-line { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.balance-card .who-line .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); }
.balance-card .badge { background: rgba(255, 255, 255, 0.22); color: #fff; }
.balance-card .lbl { margin-top: 16px; font-size: 13px; opacity: .85; }
.balance-card .big { font-size: 36px; font-weight: 750; letter-spacing: .5px; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; }
.balance-card .big.low { color: #ffe1e1; }
.balance-card .sub { font-size: 13px; opacity: .85; margin-top: 4px; }
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; display: grid; gap: 10px;
}
.panel h3 { margin: 0; font-size: 16px; }
.panel .table { border-radius: 10px; }
.topup-note { white-space: pre-wrap; word-break: break-word; font-size: 15px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); }
.pw-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; }
.settings { gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 4px; }
.stat span { font-size: 12px; color: var(--faint); }
.stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.sub-h { margin: 18px 0 8px; font-size: 14px; }
.table td.pos { color: var(--ok); }
.table td.neg { color: var(--danger); }
.table tr.dim td { opacity: .55; }
.table .actions-cell { text-align: right; white-space: nowrap; }
.table .actions-cell .btn + .btn { margin-left: 4px; }
.code-big { font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: 1px; }
.quick-amounts { display: flex; flex-wrap: wrap; gap: 8px; }
.field-title { font-weight: 600; font-size: 13px; margin-bottom: 6px; }

/* 运行状态 */
.hdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--faint); }
.hdot.ok { background: var(--ok); }
.hdot.error { background: var(--danger); }
.health-ok { color: var(--ok); font-weight: 600; }
.health-alert { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: color-mix(in srgb, var(--danger) 6%, var(--panel)); }
.health-alert h3 { color: var(--danger); }
.hp { display: grid; gap: 2px; font-size: 14px; }
.hp span { font-size: 13px; color: var(--muted); word-break: break-word; }
.stat small { font-size: 12px; color: var(--faint); }
.stat b.neg, .hint.neg { color: var(--danger); }
.err-text { font-size: 12.5px; color: var(--muted); word-break: break-word; }
.table td.nowrap { white-space: nowrap; }
.only-sm { display: none; }
.notify-panel { margin-top: 22px; }
.steps { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
@media (max-width: 820px) { .only-sm { display: table-row; } }

/* 充值申请 */
/* 充值申请表单：第一行付款方式 + 付款金额，第二行备注，第三行截图（大的虚线框，选好显示缩略图） */
.topup-form { display: grid; gap: 12px; }
.topup-form .tf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.topup-form .tf-row.one { grid-template-columns: minmax(0, 260px); }
.shot-pick {
  position: relative; display: grid; place-items: center; width: 100%; max-width: 360px; min-height: 96px; padding: 10px;
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: 14px;
  background: var(--accent-soft); color: var(--accent); cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s;
}
.shot-pick:hover { border-color: var(--accent); }
.shot-empty { display: grid; justify-items: center; gap: 2px; }
.shot-empty b { font-size: 26px; line-height: 1; }
.shot-empty span { font-weight: 650; font-size: 14px; }
.shot-empty small { color: var(--muted); font-size: 12px; }
.shot-pick.has { padding: 0; border-style: solid; background: var(--hover); }
.shot-pick img { display: block; width: 100%; max-height: 220px; object-fit: contain; }
.shot-state { position: absolute; left: 8px; bottom: 8px; padding: 3px 10px; border-radius: 99px; font-size: 12px; background: rgba(0, 0, 0, 0.6); color: #fff; }
.badge.ok { background: rgba(31, 138, 67, .14); color: #1f8a43; }
.topup-shot { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.admin-tab-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--danger, #d33); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* 收款码 */
.pay-qrs { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.pay-qr { margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel, #fff); text-align: center; width: 200px; max-width: 100%; }
.pay-qr figcaption { font-weight: 650; margin-bottom: 8px; }
.pay-qr img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: #fff; display: block; }
.pm-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); }
.pm-row:first-child { border-top: 0; }
.pm-qr { width: 120px; flex: none; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.pm-qr img { width: 120px; height: 120px; object-fit: contain; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.pm-fields { flex: 1; min-width: 0; display: grid; gap: 4px; }

/* 首页快捷提示词预览 */
.sg-preview { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.sg-preview summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.sg-preview ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; max-height: 320px; overflow: auto; }

/* 用户 → 模型权限 */
.um-group { margin-bottom: 10px; }
.um-g { font-size: 12px; font-weight: 600; color: var(--faint); padding: 6px 2px; }
.um-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; }
.um-row:hover { background: var(--hover); }
.um-row.dim { opacity: .6; }
.um-name { flex: 1; min-width: 0; display: grid; gap: 1px; font-size: 14px; }
.um-name small { font-size: 12px; color: var(--faint); }
.um-own { color: var(--accent); font-weight: 600; }
.um-limit { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.um-limit .input { width: 64px; min-height: 30px; padding: 2px 6px; text-align: center; font-size: 13px; }

/* 添加模型：每个模型下面一行说明（厂商、用途、价格） */
.pick-tools { gap: 10px; align-items: center; }
.pick-tools .input { flex: 1; min-width: 0; }
.pick-list label { align-items: flex-start; }
.pick-list label > input { margin-top: 3px; }
.pick-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.pick-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.pick-line .mono { word-break: break-all; }
.pick-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.pick-list label.nochat .mono { opacity: .7; }
.pick-list label[hidden] { display: none; } /* 上面写了 display:flex，会盖过 hidden，筛选时要显式藏起来 */

/* 设置页：左边分类菜单 + 右边内容；手机上菜单变成一排可以横着滑的按钮 */
.set-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: start; }
.set-nav { position: sticky; top: 8px; display: grid; gap: 4px; }
.set-item { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; border: 1px solid transparent; }
.set-item small { color: var(--faint); font-size: 12px; line-height: 1.4; }
.set-item:hover { background: var(--hover); }
.set-item.on { background: var(--panel); border-color: var(--border); box-shadow: var(--shadow-sm); }
.set-item.on b { color: var(--accent); }
.set-body { display: grid; gap: 16px; min-width: 0; }
.set-body > .panel, .set-body > form.panel { margin: 0; }
@media (max-width: 820px) {
  .set-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .set-nav { position: static; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-item { flex-shrink: 0; padding: 7px 14px; border-radius: 99px; border-color: var(--border); background: var(--panel); }
  .set-item small { display: none; }
  .set-item.on { background: var(--accent); border-color: var(--accent); }
  .set-item.on b { color: var(--accent-text); }
}

/* 限制与防刷 */
.lim-unit { color: var(--muted); font-size: 13px; white-space: nowrap; }
.lim-changed { color: var(--accent); font-weight: 600; }
.lim-save { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); }

/* 用户头像（内置小咸鱼 / 自己上传的） */
.uavatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--hover); vertical-align: middle; }
.uavatar.big { width: 56px; height: 56px; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55); }
.uavatar.nav { width: 22px; height: 22px; }
.uavatar.sm { width: 24px; height: 24px; margin-right: 6px; }
.balance-card .who-line { gap: 12px; }
.balance-card .who-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.balance-card .who-text b { font-size: 17px; }
.balance-card .who-text small { opacity: .8; font-size: 12px; }
.balance-card .edit-prof { background: rgba(255, 255, 255, 0.18); color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.balance-card .edit-prof:hover { background: rgba(255, 255, 255, 0.28); }
.prof { display: grid; gap: 16px; }
.prof-now { display: grid; place-items: center; }
.prof-now .uavatar { width: 88px; height: 88px; box-shadow: var(--shadow-sm); }
.prof-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.prof-opt { display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border-radius: 12px; border: 2px solid var(--border); background: var(--panel); color: var(--text); font-size: 13px; cursor: pointer; }
.prof-opt img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.prof-opt img.dim { opacity: .35; filter: grayscale(1); }
.prof-opt:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.prof-opt.on { border-color: var(--accent); background: var(--accent-soft); }

/* 我的账户：标签页、折叠、查看更多 */
.acct-tabs { margin: 4px 0 14px; }
.acct-tabs .tab { text-decoration: none; }
.acct-tab { display: grid; gap: 16px; }
.acct-tab > .panel { margin: 0; }
.card-link { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
details.fold { margin-top: 8px; }
details.fold > summary { cursor: pointer; color: var(--accent); font-size: 13px; padding: 6px 0; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸ "; }
details.fold[open] > summary::before { content: "▾ "; }
.more-row { display: flex; justify-content: center; margin-top: 10px; }
.price-search { max-width: 360px; }
.uavatar.prof-tab { width: 48px; height: 48px; }

/* 记录列表（充值申请、余额记录）：一行一条，左边内容、右边状态 / 金额，手机上也不挤 */
.rec-list { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rec { display: flex; align-items: center; gap: 12px; padding: 11px 14px; }
.rec + .rec { border-top: 1px solid var(--border); }
.rec-main { flex: 1; min-width: 0; }
.rec-amt { font-size: 15px; font-variant-numeric: tabular-nums; }
.rec-sub { color: var(--faint); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.rec-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.rec-side.col { flex-direction: column; align-items: flex-end; gap: 0; }
.rec-amt.pos { color: var(--ok); }
.rec-amt.neg { color: var(--text); }

/* 编辑资料里的小标签 */
.prof-tabs { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border-radius: 12px; background: var(--hover); margin-bottom: 6px; }
.prof-tabs button { border: 0; background: transparent; border-radius: 9px; padding: 7px 0; color: var(--muted); font-size: 14px; cursor: pointer; }
.prof-tabs button.on { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.modal-foot[hidden] { display: none; }

/* 我的账户 → 设置 */
.set-list .set-line { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.set-list .set-line + .set-line { border-top: 1px solid var(--border); }
.set-list .set-line > div:first-child { flex: 1; min-width: 0; display: grid; gap: 2px; }
.set-list .set-line small { color: var(--faint); font-size: 12px; line-height: 1.5; }
.set-seg { display: inline-grid; grid-auto-flow: column; grid-template-columns: none; gap: 0; flex-shrink: 0; }
.set-seg button { padding: 6px 12px; white-space: nowrap; }
.danger-btn { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.danger-btn:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
#set-instr { resize: vertical; min-height: 90px; }
@media (max-width: 820px) {
  .set-list .set-line { flex-wrap: wrap; }
  .set-list .set-line > div:first-child { flex-basis: 100%; }
}
