/* 设计令牌层：还原参考图观感（淡紫蓝渐变底 / 白色大圆角卡 / 蓝色图标竖栏 / 环形统计 / 横向排行条）
   改主题只动这个文件。 */

:root {
  --ink: #1d2536;
  --ink-2: #4a5570;
  --muted: #97a1b6;
  --line: #edf0f8;
  --brand: #4d6bf5;
  --brand-2: #7f9cff;
  --brand-soft: #eaf0ff;
  --ok: #2fb878;
  --warn: #f0a43a;
  --bad: #ef5a52;
  --card-r: 18px;
  --shadow: 0 10px 30px rgba(72, 94, 180, .10), 0 2px 6px rgba(72, 94, 180, .05);
  --rail-w: 88px;

  /* 覆盖 Element Plus 主题变量 */
  --el-color-primary: var(--brand);
  --el-color-primary-light-3: #7489f8;
  --el-color-primary-light-5: #97a7fa;
  --el-color-primary-light-7: #bcc6fc;
  --el-color-primary-light-8: #d2d9fd;
  --el-color-primary-light-9: #eaeefe;
  --el-color-primary-dark-2: #3e56c4;
  --el-color-success: var(--ok);
  --el-color-warning: var(--warn);
  --el-color-danger: var(--bad);
  --el-border-radius-base: 10px;
  --el-border-radius-small: 8px;
  --el-text-color-primary: var(--ink);
  --el-text-color-regular: var(--ink-2);
  --el-text-color-secondary: var(--muted);
  --el-border-color-light: var(--line);
  --el-fill-color-blank: #fff;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(160deg, #eff2fc 0%, #e7ebf9 46%, #dfe5f7 100%);
  background-attachment: fixed;
}

[v-cloak] { display: none; }

a { color: var(--brand); text-decoration: none; }

/* ---------- 骨架 ---------- */

.shell { display: flex; min-height: 100vh; }

.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail-w); z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 0 14px;
  background: linear-gradient(180deg, #4f6ef2 0%, #6f8dff 55%, #97aeff 100%);
  box-shadow: 6px 0 26px rgba(79, 110, 242, .22);
}

.rail .brand {
  width: 46px; height: 46px; border-radius: 14px; margin-bottom: 14px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .95); color: var(--brand);
  font-size: 22px; box-shadow: 0 6px 16px rgba(38, 62, 150, .22);
}

.rail .brand img { display: block; width: 34px; height: 34px; object-fit: contain; }

.rail .nav-item {
  width: 62px; padding: 9px 0 7px; border: 0; border-radius: 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: transparent; color: rgba(255, 255, 255, .88); font-size: 11px;
  transition: background .18s, color .18s, transform .18s;
}
.rail .nav-item .el-icon { font-size: 20px; }
.rail .nav-item:hover { background: rgba(255, 255, 255, .16); transform: translateY(-1px); }
.rail .nav-item.on { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 6px 14px rgba(38, 62, 150, .18); }
.rail .spacer { flex: 1; }

.rail .rail-foot {
  width: 62px; padding: 8px 0; border-radius: 12px; text-align: center;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 11px;
}
.rail .rail-foot.bad { background: rgba(239, 90, 82, .9); }

.main { flex: 1; min-width: 0; margin-left: var(--rail-w); padding: 0 22px 26px; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 4px 14px; margin-bottom: 6px;
  backdrop-filter: blur(8px);
  background: linear-gradient(180deg, rgba(238, 241, 251, .96), rgba(238, 241, 251, .55));
}
.topbar h1 { margin: 0; font-size: 21px; letter-spacing: .5px; }
.topbar .sub { color: var(--muted); font-size: 12px; margin-left: 10px; }
.topbar .grow { flex: 1; }

/* 会员：顶栏身份胶囊 + 登录弹窗 */
.user-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 13px; color: var(--ink); cursor: pointer;
  box-shadow: 0 2px 8px rgba(72, 94, 180, .08);
}
.user-chip:hover { border-color: #c3d0fa; }
.user-chip .user-mail { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .chev { color: var(--muted); font-size: 12px; }

.auth-hd { display: flex; align-items: center; gap: 12px; }
.auth-logo {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, #eef2ff, #dfe7ff); color: var(--brand); font-size: 22px;
}
.auth-hd h3 { margin: 0; font-size: 17px; }
.auth-hd p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.auth-body { display: flex; flex-direction: column; gap: 14px; }
.auth-row { display: flex; gap: 10px; }
.auth-row .el-input { flex: 1; }
.auth-send { white-space: nowrap; min-width: 116px; }
.auth-go { width: 100%; }
.auth-fine { margin: 0; font-size: 11.5px; color: var(--muted); text-align: center; }

/* 会员 ID 与订单号：报工单要用的一串字符，随时可复制 */
.member-id {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
  border: 1px dashed #c9d5f7; border-radius: 999px; background: #f7f9ff; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.member-id:hover { border-color: var(--brand); background: #eef3ff; }
.member-id .cb-label { font-size: 11px; color: var(--muted); letter-spacing: .5px; }
.member-id .mid-num {
  font-size: 13.5px; font-weight: 700; color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.member-id .mid-copy { font-size: 13px; color: var(--muted); }
.order-tag {
  display: inline-flex; padding: 2px 8px; border-radius: 6px; white-space: nowrap;
  border: 1px solid var(--line); background: #f7f9fd; color: var(--muted);
  font-size: 11.5px; cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.order-tag:hover { border-color: var(--brand); color: var(--brand); }

/* 充值弹窗 */
.auth-logo.pay { background: linear-gradient(135deg, #fff7e2, #ffe9b8); color: #c8870a; }
.pay-body { display: flex; flex-direction: column; gap: 14px; }
.pay-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pay-card {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 16px 6px 13px; border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
}
.pay-card:hover { border-color: #e8d18e; transform: translateY(-1px); }
.pay-card.on {
  border-color: #e7ab24; background: linear-gradient(180deg, #fffaf0, #fff3d6);
  box-shadow: 0 8px 18px rgba(231, 171, 36, .18);
}
.pay-card .pay-cr {
  font-size: 24px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums;
}
.pay-card .pay-cr i {
  font-style: normal; font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 2px;
}
.pay-card .pay-price { font-size: 18px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pay-card.on .pay-cr { color: #a86a06; }
.pay-card.on .pay-price { color: #b9770a; font-weight: 600; }
.pay-custom { padding: 14px 16px; border: 1px dashed #e8dcae; border-radius: 14px; background: #fffdf6; }
.pay-custom-hd { font-size: 12px; color: var(--muted); margin-bottom: 9px; }
.pay-custom-row { display: flex; align-items: center; gap: 12px; }
.pay-num { width: 176px; }
.pay-eq { color: var(--muted); }
.pay-amount { font-size: 21px; font-weight: 800; color: #b9770a; font-variant-numeric: tabular-nums; }
.pay-go { width: 100%; }

/* 扫码支付弹窗：会员停在本站，二维码本地渲染 */
.payqr-body { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 2px 0 4px; }
.payqr-amount { display: flex; align-items: baseline; gap: 10px; }
.payqr-amount span { font-size: 12px; color: var(--muted); }
.payqr-amount b {
  font-size: 30px; font-weight: 800; color: #b9770a; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.payqr-amount em { font-style: normal; font-size: 12px; color: var(--muted); }
.payqr-box {
  width: 236px; height: 236px; padding: 12px; border-radius: 16px;
  border: 1px solid #eee3c8; background: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 24px rgba(185, 119, 10, .10);
}
.payqr-code { width: 100%; height: 100%; display: grid; place-items: center; }
.payqr-code svg { display: block; width: 100%; height: auto; }
.payqr-empty { padding: 0 18px; font-size: 12px; color: var(--muted); text-align: center; }
.payqr-done { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.payqr-done .el-icon { font-size: 54px; color: #2f9e44; }
.payqr-done b { font-size: 16px; color: var(--ink); }
.payqr-done span { font-size: 12px; color: var(--muted); }
.payqr-tip { font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.7; }
.payqr-tip span { font-size: 11.5px; color: #9aa3b2; }
.payqr-tip.warn { color: #c05621; }
.payqr-acts { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 480px) {
  .payqr-box { width: 200px; height: 200px; }
}

.page { display: flex; flex-direction: column; gap: 16px; }

/* ---------- 卡片 ---------- */

.panel { background: #fff; border-radius: var(--card-r); box-shadow: var(--shadow); padding: 18px 20px; }
.panel.pad0 { padding: 0; }
.panel-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-hd h2 { margin: 0; font-size: 16px; font-weight: 700; }
.panel-hd .grow { flex: 1; }
.panel-hd .hint { color: var(--muted); font-size: 12px; }

.grid2 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid2.rev { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
.grid2 > .quick-panel { grid-column: 1; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

/* ---------- 模板宫格（参考图「我的应用」圆形图标） ---------- */

.chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px 10px; }
.chip { position: relative; border: 0; background: none; cursor: pointer; padding: 4px 2px 0; text-align: center; }
.chip .thumb {
  width: 66px; height: 66px; margin: 0 auto 7px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 32% 28%, #fff, var(--brand-soft) 70%);
  border: 2px solid transparent;
  box-shadow: 0 6px 16px rgba(72, 94, 180, .12);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.chip .thumb img { width: 100%; height: 100%; object-fit: cover; }
.chip .thumb .el-icon { font-size: 26px; color: var(--brand-2); }
.chip .nm { font-size: 12px; color: var(--ink-2); line-height: 1.3; word-break: break-all; }
.chip:hover .thumb { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(72, 94, 180, .2); }
.chip.on .thumb { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(77, 107, 245, .14); }
.chip.on .nm { color: var(--brand); font-weight: 700; }
.chip .off-dot { position: absolute; top: 6px; left: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.chip .acts { position: absolute; top: 2px; right: 4px; display: none; gap: 3px; }
.chip:hover .acts, .chip:focus .acts { display: flex; }
.chip .acts > span {
  width: 21px; height: 21px; border-radius: 7px; background: #fff; color: var(--ink-2);
  box-shadow: 0 3px 10px rgba(29, 37, 54, .16); display: grid; place-items: center; cursor: pointer;
  font-size: 12px;
}
.chip .acts > span:hover { background: var(--brand); color: #fff; }
.chip .acts > span.danger:hover { background: var(--bad); }

/* 用户端模板卡：整卡锁死 170×150（含标题行），多列自动分布 */
.ucard-grid {
  display: grid; grid-template-columns: repeat(auto-fill, 170px);
  gap: 16px; justify-content: start;
}
.ucard {
  display: flex; flex-direction: column; width: 170px; height: 150px;
  cursor: pointer; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 4px 14px rgba(72, 94, 180, .07);
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.ucard:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(72, 94, 180, .14); }
.ucard:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ucard.on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(77, 107, 245, .16); }
/* 预览框吃掉标题行以外的剩余高度；仍用 contain 不裁字效，但贴顶对齐 + 白底，
   免得横图被垂直居中后在卡片顶部留出一条灰带。 */
.ucard .shot { display: block; flex: 1; min-height: 0; background: #fff; overflow: hidden; }
.ucard .shot img {
  width: 100%; height: 100%; object-fit: contain; object-position: top center;
}
.ucard .shot .el-icon {
  display: grid; place-items: center; height: 100%; font-size: 30px; color: var(--brand-2);
}
.ucard .nm {
  padding: 9px 10px 11px; text-align: center; font-size: 13px; font-weight: 700;
  color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 文字内容：一处一个窄框，圈 + 加框、圈 − 删框（第一处固定） */
.txt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.txt-cell { display: flex; align-items: center; gap: 6px; }
.txt-in { width: 190px; flex: 0 0 auto; }
.txt-note { font-size: 12px; margin-top: 8px; }
.cbtn {
  flex: none; width: 30px; height: 30px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--brand); background: #fff; color: var(--brand);
  display: grid; place-items: center; font-size: 14px;
  transition: background .16s, color .16s;
}
.cbtn:hover { background: var(--brand); color: #fff; }
.cbtn.danger { border-color: var(--bad); color: var(--bad); }
.cbtn.danger:hover { background: var(--bad); color: #fff; }

/* 分类按钮组 + 生成设置两列表单 */
.cat-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.cat-btns .el-radio-group, .set-grid .el-radio-group { flex-wrap: wrap; row-gap: 8px; }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.set-grid .span2 { grid-column: 1 / -1; }

/* ---------- 后台模板卡：一屏多放、操作都在卡上 ---------- */

.tpl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.tcard {
  position: relative; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; padding: 7px 8px 8px; transition: border-color .16s, box-shadow .16s;
}
.tcard:hover { border-color: var(--brand); box-shadow: 0 8px 20px rgba(72, 94, 180, .13); }
.tcard.off { background: #fafbfe; }
.tcard .shot {
  position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; cursor: pointer;
  border-radius: 9px; overflow: hidden; background: #f2f4fa;
}
.tcard .shot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tcard .shot .ph { display: grid; place-items: center; width: 100%; height: 100%; font-size: 24px; color: #b7c0d6; }
.tcard .shot .mask {
  position: absolute; left: 0; right: 0; bottom: 0; display: none; align-items: center;
  justify-content: center; gap: 4px; height: 24px; font-size: 11px; color: #fff;
  background: rgba(38, 62, 150, .72);
}
.tcard .shot:hover .mask { display: flex; }
.tcard .acts { position: absolute; top: 12px; left: 12px; display: none; gap: 3px; }
.tcard:hover .acts, .tcard:focus-within .acts { display: flex; }
.tcard .acts > span, .tcard .x {
  width: 21px; height: 21px; border-radius: 7px; background: #fff; color: var(--ink-2);
  box-shadow: 0 3px 10px rgba(29, 37, 54, .16); display: grid; place-items: center;
  cursor: pointer; font-size: 12px;
}
.tcard .acts > span:hover { background: var(--brand); color: #fff; }
.tcard .x { position: absolute; top: 12px; right: 12px; display: none; }
.tcard:hover .x { display: grid; }
.tcard .x:hover { background: var(--bad); color: #fff; }
.tcard .nm { margin-top: 7px; font-size: 12px; font-weight: 600; color: var(--ink); cursor: text; }
.tcard .nm span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard .nm input {
  width: 100%; box-sizing: border-box; border: 1px solid var(--brand); border-radius: 6px;
  font-size: 12px; padding: 2px 5px; outline: none;
}
.tcard .row2 { display: flex; align-items: center; gap: 5px; margin-top: 5px; }
.tcard .cat-sel {
  flex: 1; min-width: 0; height: 22px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--ink-2); font-size: 11px; padding: 0 3px; cursor: pointer;
}
.tcard .cat-sel:focus { border-color: var(--brand); outline: none; }
.tcard .meta { margin-top: 5px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pager { display: flex; justify-content: center; margin-top: 16px; }

/* ---------- 底部胶囊快捷（参考图最下方一排） ---------- */

.pillbar { display: flex; gap: 12px; flex-wrap: wrap; }
.pillbtn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  height: 46px; padding: 0 20px 0 6px; border: 0; border-radius: 999px;
  color: #fff; font-size: 14px; font-weight: 600; letter-spacing: .5px;
  box-shadow: 0 8px 18px rgba(72, 94, 180, .22); transition: transform .16s, box-shadow .16s;
}
.pillbtn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(72, 94, 180, .3); }
.pillbtn .ico {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .9); color: var(--brand); font-size: 17px;
}
.pillbtn.b1 { background: linear-gradient(120deg, #5b8cff, #86aaff); }
.pillbtn.b2 { background: linear-gradient(120deg, #8d7bf5, #b3a4ff); }
.pillbtn.b3 { background: linear-gradient(120deg, #f5b04a, #fbd79b); }
.pillbtn.b4 { background: linear-gradient(120deg, #3fc9c9, #82e4e4); }
.pillbtn.b5 { background: linear-gradient(120deg, #ef7ba8, #f8b6d0); }

/* ---------- 环形统计 ---------- */

.ringrow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ring { text-align: center; }
.ring .cap { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- 排行条（参考图「办结率排名」） ---------- */

.rank { display: flex; flex-direction: column; gap: 12px; }
.rank-row { display: grid; grid-template-columns: 22px 88px 1fr 52px; align-items: center; gap: 10px; }
.rank-row .no { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: #f1f3fa; color: var(--muted); }
.rank-row:nth-child(1) .no { background: linear-gradient(135deg, #ffd479, #f5a623); color: #fff; }
.rank-row:nth-child(2) .no { background: linear-gradient(135deg, #dfe4ee, #b9c1d1); color: #fff; }
.rank-row:nth-child(3) .no { background: linear-gradient(135deg, #f3c3a1, #d9945f); color: #fff; }
.rank-row .nm { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .track { height: 8px; border-radius: 999px; background: #f0f3fa; overflow: hidden; }
.rank-row .fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.rank-row .val { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fill.c1 { background: linear-gradient(90deg, #f0554f, #f88b78); }
.fill.c2 { background: linear-gradient(90deg, #f6a33c, #fbc97e); }
.fill.c3 { background: linear-gradient(90deg, #3ec98a, #79e0b0); }
.fill.c4 { background: linear-gradient(90deg, #4d7cf7, #86a8fb); }
.fill.c5 { background: linear-gradient(90deg, #8d7bf5, #b6a8fb); }

/* ---------- 双色汇总块 ---------- */

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.tile .k { font-size: 12px; opacity: .75; }
.tile .v { font-size: 24px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile .el-icon { font-size: 24px; opacity: .55; }
.tile.blue { background: linear-gradient(135deg, #e7efff, #f2f6ff); color: #2f5bd0; }
.tile.green { background: linear-gradient(135deg, #e3f7ec, #f1fbf5); color: #1f8f5e; }
.tile.amber { background: linear-gradient(135deg, #fdf1de, #fdf7ec); color: #b97a17; }
.tile.red { background: linear-gradient(135deg, #fdeaea, #fdf3f3); color: #c9403a; }

/* ---------- 记录列表（参考图「我的待办」） ---------- */

.rec-list { display: flex; flex-direction: column; }
.rec-list.scroll { max-height: 620px; overflow: auto; padding-right: 6px; }
.rec { display: flex; align-items: flex-start; gap: 10px; padding: 12px 2px; border-bottom: 1px dashed var(--line); }
.rec:last-child { border-bottom: 0; }
.rec .txt { flex: 1; min-width: 0; }
.rec .t1 { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec .t2 { margin-top: 5px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.rec a.t1:hover { color: var(--brand); }
.tagchip { padding: 1px 8px; border-radius: 5px; background: var(--brand-soft); color: var(--brand); font-size: 11px; }
.tagchip.gray { background: #f1f3fa; color: var(--muted); }
.badge-bad { padding: 1px 9px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; }
.badge-ok { padding: 1px 9px; border-radius: 999px; background: rgba(47, 184, 120, .12); color: var(--ok); font-size: 11px; }
.badge-rfd { padding: 1px 9px; border-radius: 999px; background: #f1f3fa; color: #7d8aa5; font-size: 11px; }
.badge-wait { padding: 1px 9px; border-radius: 999px; background: #f1f3fa; color: #7d8aa5; font-size: 11px; }
.badge-warn { padding: 1px 9px; border-radius: 999px; background: #fdf1de; color: #b97a17; font-size: 11px; }
.pay-conf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
  padding: 8px 12px; border: 1px dashed var(--line); border-radius: 10px; font-size: 12px; }
.pay-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.pay-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pay-field.wide { grid-column: span 2; }
.pay-field > label { font-size: 12px; color: var(--muted); font-weight: 700; }
.pay-field .hint { font-size: 11.5px; color: var(--muted); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.pay-switch { display: flex; align-items: center; gap: 9px; min-height: 32px; }
.pay-acts { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pay-acts .grow { flex: 1; }
.pay-acts .hint { color: var(--muted); font-size: 11.5px; }

/* ---------- 后台订单与会员 ---------- */

.filter-bar { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-bar .grow { flex: 1; }
.filter-bar .hint { color: var(--muted); font-size: 12px; }
.mid-id {
  padding: 1px 8px; border-radius: 6px; background: #f1f5ff; color: var(--brand);
  font-size: 11.5px; font-weight: 700; letter-spacing: .5px; white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.mid-id.link { cursor: pointer; }
.mid-id.link:hover { background: var(--brand-soft); text-decoration: underline; }
.rfd-note { color: #8a6a1e; font-size: 11.5px; }
.err-line { color: var(--bad); font-size: 11.5px; }
.rec .order-tag { font-size: 11.5px; }

.mbr-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mbr-wrap.scroll { max-height: 640px; overflow-y: auto; }
.mbr-head, .mbr-row {
  display: grid; gap: 10px; padding: 10px 14px; align-items: center;
  grid-template-columns: 104px minmax(150px, 1.6fr) 74px 74px 74px 96px 68px 150px minmax(240px, auto);
}
.mbr-head {
  position: sticky; top: 0; z-index: 1; background: #f7f9fd; border-bottom: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted); font-weight: 700; letter-spacing: .3px;
}
.mbr-row { border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.mbr-row:last-child { border-bottom: 0; }
.mbr-row:hover { background: #fafbff; }
.mbr-row .em { display: block; font-style: normal; color: var(--muted); font-size: 11px; margin-top: 2px; }
.mbr-row .num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.mbr-row .num em { display: block; font-style: normal; font-weight: 400; }
.mbr-row .rfdnum { color: #8a6a1e; }
.mbr-row .clnum { color: var(--muted); }
.mbr-row .when { color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.mbr-row .when em { display: block; font-style: normal; }
.mbr-row .ops { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mbr-row .el-button + .el-button { margin-left: 0; }

.auth-logo.refund { background: linear-gradient(135deg, #ffeaea, #ffd9d9); color: #d44a44; }
.rfd-body { display: flex; flex-direction: column; gap: 9px; }
.rfd-line { display: flex; align-items: baseline; gap: 9px; font-size: 13px; }
.rfd-line > span:first-child { color: var(--muted); min-width: 68px; }
.rfd-line b { font-size: 15px; }
.rfd-line.after b { color: var(--ok); }
.rfd-tip { font-size: 12px; line-height: 1.7; padding: 9px 11px; border-radius: 10px; background: #f7f9fd; }
.cr-seg { margin-bottom: 4px; }

.dt-head { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px dashed var(--line); }
.dt-head .muted { margin-left: 8px; }
.dt-credits { font-size: 13px; color: var(--muted); }
.dt-credits b { font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.dt-stats { display: flex; flex-wrap: wrap; gap: 7px; font-size: 11.5px; color: var(--muted); }
.dt-stats span { padding: 2px 8px; border-radius: 6px; background: #f4f6fb; }
.dt-stats .rfdnum { color: #8a6a1e; }
.mid-id.big { font-size: 15px; padding: 3px 10px; cursor: default; }
.rec .ck { padding: 1px 7px; border-radius: 5px; background: #f1f3fa; color: var(--muted); font-size: 11px; margin-right: 6px; }
.rec .ck.charge { background: #fdeaea; color: #c9403a; }
.rec .ck.refund { background: #fdf1de; color: #b97a17; }
.rec .ck.gift, .rec .ck.recharge { background: #e3f7ec; color: #1f8f5e; }
.rec b.pos { color: var(--ok); } .rec b.neg { color: var(--bad); }

/* ---------- 结果与图层 ---------- */

.result-img { width: 100%; border-radius: 14px; display: block; background: #f6f7fb; }
.layers { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.layers figure { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.layers .box {
  height: 108px; display: grid; place-items: center;
  background: conic-gradient(#d8dce6 0 25%, #fff 0 50%, #d8dce6 0 75%, #fff 0) 0 0 / 16px 16px;
}
.layers img { max-width: 100%; max-height: 108px; display: block; }
.layers figcaption { padding: 6px 8px; font-size: 11px; color: var(--ink-2); background: #fff; display: flex; justify-content: space-between; gap: 6px; }

/* ---------- 生成记录（最近 7 天，缩略图点击放大） ---------- */

.hist-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px; max-height: 430px; overflow-y: auto; padding-right: 4px;
}
.hist-card {
  display: flex; flex-direction: column; gap: 6px; padding: 6px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.hist-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(72, 94, 180, .14); }
.hist-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.hist-shot {
  display: grid; place-items: center; aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: 8px; background: #f6f7fb;
}
.hist-shot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hist-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hist-meta b { font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-meta span { font-size: 11px; color: var(--muted); }
.hist-panel .empty .el-button { margin-top: 10px; }
.hist-view { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hist-view img { max-width: 100%; max-height: 68vh; border-radius: 12px; display: block; background: #f6f7fb; }
.hist-view-note { margin: 0; font-size: 12px; color: var(--muted); word-break: break-all; }

.empty { text-align: center; color: var(--muted); padding: 34px 10px; font-size: 13px; }
.empty .el-icon { font-size: 34px; color: #cfd6e8; display: block; margin: 0 auto 8px; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { color: var(--ink); font-weight: 600; text-align: right; word-break: break-all; }
.ok-t { color: var(--ok); } .bad-t { color: var(--bad); }

.money { font-variant-numeric: tabular-nums; color: #b97a17; font-weight: 700; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.sec-title { font-size: 13px; font-weight: 700; color: var(--ink); margin: 18px 0 9px; display: flex; align-items: center; gap: 7px; }
.sec-title:before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--brand); }

/* 模型库页：分类区/模板区的行头（标题 + 说明 + 右侧操作） */
.lib-hd { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; }
.lib-hd .sec-title { margin: 0; }
.lib-hd .hint { color: var(--muted); font-size: 12px; }
.lib-hd .grow { flex: 1; }

/* 模板编辑弹窗：插槽快捷标记行 */
.slot-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 6px; }
.slot-bar .hint { color: var(--muted); font-size: 12px; }

/* 接入页：平台卡（一行四张）与模型表 */
.prov-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.prov-card {
  display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  background: #fbfcff; transition: border-color .15s, box-shadow .15s;
}
.prov-card:hover { border-color: #ccd8f5; box-shadow: 0 8px 20px rgba(40, 68, 130, .06); }
.prov-card.off { opacity: .62; }
.prov-hd { display: flex; align-items: center; gap: 8px; min-width: 0; }
.prov-hd strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prov-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.prov-line {
  margin-top: 8px; color: var(--ink-2); font-size: 12px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prov-line.mono { color: var(--muted); font-size: 11.5px; }
.prov-test { margin-top: 8px; min-height: 18px; font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.prov-test .muted { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prov-sum { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.prov-sum b { color: var(--ink); }
.prov-del { display: inline-flex; cursor: pointer; color: var(--muted); }
.prov-del:hover { color: var(--bad); }
.prov-acts { display: flex; gap: 6px; margin-top: auto; padding-top: 12px; flex-wrap: wrap; }
.prov-acts .el-button { margin-left: 0; }
.mtable { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.mrow {
  display: grid; grid-template-columns: 1.1fr minmax(0, 2.2fr) .8fr .8fr 1fr 1.7fr 96px;
  gap: 8px; padding: 8px 12px; align-items: center; font-size: 12.5px;
  border-bottom: 1px solid var(--line);
}
.mrow:last-child { border-bottom: 0; }
.mrow.mhead { background: #f7f9fd; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.mprov { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mname { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mname b { font-size: 13px; }
.mname em { color: var(--muted); font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtags { display: flex; gap: 4px; flex-wrap: wrap; }
.vec-cap { display: flex; flex-direction: column; gap: 2px; }
.vec-cap .el-checkbox { margin-right: 0; }
.i-acts { display: flex; gap: 10px; justify-content: flex-end; color: var(--muted); }
.i-acts span { cursor: pointer; }
.i-acts span:hover { color: var(--brand); }
.i-acts .danger:hover { color: var(--bad); }
.empty.mini { padding: 18px 10px; }

/* 用户端：模型计价弹窗 */
.price-list { display: flex; flex-direction: column; gap: 8px; }
.price-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
}
.price-row .pname { font-weight: 700; margin-right: auto; }
.price-row .pname em { font-style: normal; color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.price-row .ptier { padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 11.5px; }

/* ---------- 矢量工具（文转 / 图转） ---------- */

.vec-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.vec-tool {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 18px; background: #fff;
}
.vec-tool-hd {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcff, #fff);
}
.vec-tool-icon {
  flex: none; width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px;
  background: var(--brand-soft); color: var(--brand);
}
.vec-tool-icon.img { background: #fff3e2; color: #c17a12; }
.vec-tool-title { min-width: 0; }
.vec-tool-title h3 { margin: 0; font-size: 15px; font-weight: 700; }
.vec-tool-title p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.vec-tool-tag { margin-left: auto; flex: none; }
.vec-tool-body { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.vec-tool-result { margin-top: auto; padding: 0 16px 16px; }
.txt-prompt .el-textarea__inner { font-family: inherit !important; font-size: 13px; line-height: 1.7; }
.vec-ratio-row { align-items: flex-start; }
.vec-ratio-row > .muted { flex: none; padding-top: 6px; }
.ratio-group { display: flex; flex-wrap: wrap; gap: 6px; }
.ratio-group .el-radio-button { margin: 0; }
.ratio-group .el-radio-button .el-radio-button__inner {
  border: 1px solid var(--line); border-radius: 9px; box-shadow: none;
  padding: 6px 11px; font-size: 12px;
}
.ratio-group .el-radio-button:first-child .el-radio-button__inner,
.ratio-group .el-radio-button:last-child .el-radio-button__inner { border-radius: 9px; }
.ratio-group .el-radio-button.is-active .el-radio-button__inner {
  border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: none;
}
.vec-size { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.vec-size .el-input-number { width: 120px; }
.vec-times { color: var(--muted); }
.vec-size-hint { font-size: 12px; color: var(--muted); }
.vec-size-hint b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.vec-upload { display: block; }
.vec-upload .el-upload { display: block; width: 100%; }
.vec-upload .el-upload-dragger {
  width: 100%; padding: 0; border-radius: 16px; overflow: hidden;
  border: 1.5px dashed #c9d4f2; background: #fbfcff;
  transition: border-color .18s, background .18s;
}
.vec-upload .el-upload-dragger:hover { border-color: var(--brand); background: var(--brand-soft); }
.vec-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  min-height: 196px; padding: 22px; text-align: center;
}
.vec-drop .el-icon { font-size: 38px; color: var(--brand-2); }
.vec-drop b { font-size: 14px; color: var(--ink-2); }
.vec-drop span { font-size: 12px; color: var(--muted); }
.vec-preview { display: block; width: 100%; max-height: 300px; object-fit: contain; background: #f6f7fb; }
.vec-file {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-width: 0;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 12.5px; color: var(--ink-2);
}
.vec-file > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vec-file .el-icon { color: var(--brand-2); }
.vec-file .grow { flex: 1; }
.vec-clear { color: var(--brand); cursor: pointer; white-space: nowrap; }
.vec-clear:hover { text-decoration: underline; }
.vec-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.vec-cost { font-size: 13px; color: var(--ink-2); }
.vec-cost b { color: #b9770a; font-size: 17px; font-variant-numeric: tabular-nums; }
.vec-go { width: 100%; }
.vec-note { font-size: 12px; line-height: 1.7; }
.vec-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  min-height: 300px; padding: 20px; text-align: center;
  border: 1px dashed #d5dcf0; border-radius: 16px; background: #fbfcff; color: var(--muted);
}
.vec-empty .el-icon { font-size: 42px; color: #cfd6e8; }
.vec-empty b { font-size: 14px; color: var(--ink-2); }
.vec-empty span { font-size: 12px; }
.vec-resultbox {
  display: grid; place-items: center; min-height: 300px; max-height: 440px; overflow: auto;
  padding: 14px; border: 1px solid var(--line); border-radius: 16px;
  background: conic-gradient(#e9ecf3 0 25%, #fff 0 50%, #e9ecf3 0 75%, #fff 0) 0 0 / 20px 20px;
}
.vec-resultbox img { display: block; max-width: 100%; max-height: 408px; }
.vec-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; }
.vec-meta .grow { flex: 1; }

/* ---------- Element Plus 局部微调 ---------- */

.el-tabs__item { font-size: 13px; }
.el-table th.el-table__cell { background: #f7f9fd !important; color: var(--ink-2); font-weight: 600; }
.el-table .cell { font-size: 13px; }
.el-button { border-radius: 10px; }
.el-button.big { height: 48px; font-size: 15px; font-weight: 700; letter-spacing: 1px; border-radius: 14px; }
.el-dialog { border-radius: var(--card-r); }
.el-dialog__header { margin-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.el-form-item__label { font-weight: 600; color: var(--ink-2); }
.el-textarea__inner { border-radius: 12px; font-family: ui-monospace, Consolas, monospace !important; }

.gen-btn {
  width: 100%; height: 50px; border: 0; border-radius: 14px; cursor: pointer;
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 2px;
  background: linear-gradient(120deg, #4d6bf5, #7f9cff);
  box-shadow: 0 12px 26px rgba(77, 107, 245, .32); transition: transform .16s, box-shadow .16s, opacity .16s;
}
.gen-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(77, 107, 245, .4); }
.gen-btn:disabled { opacity: .6; cursor: not-allowed; }
.gen-btn.locked {
  background: linear-gradient(120deg, #aeb8ce, #c9d2e4);
  box-shadow: none; cursor: pointer;
}
.gen-btn.locked:hover { transform: none; box-shadow: none; }

.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: r .7s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes r { to { transform: rotate(360deg); } }

/* ---------- 自适应 ---------- */

@media (max-width: 1440px) {
  .prov-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .grid2, .grid2.rev { grid-template-columns: minmax(0, 1fr); }
  .prov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vec-tools { grid-template-columns: minmax(0, 1fr); }
  .pay-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pay-field.wide { grid-column: span 2; }
}
@media (max-width: 860px) {
  :root { --rail-w: 64px; }
  .ringrow { grid-template-columns: repeat(2, 1fr); }
  .grid3 { grid-template-columns: 1fr; }
  .prov-grid { grid-template-columns: 1fr; }
  .pay-form { grid-template-columns: 1fr; }
  .pay-field.wide { grid-column: auto; }
  .mtable { overflow-x: auto; }
  .mrow { min-width: 720px; }
  .main { padding: 0 12px 20px; }
  .vec-empty, .vec-resultbox { min-height: 240px; }
  .vec-drop { min-height: 180px; }
}
