/* =========================================================
   AI 图片工坊 · 视觉系统 v2
   参考 nanoai 式布局：顶栏 + 左侧功能导航 + 主内容 + 右侧历史记录
   浅色底 / 白色卡片 / 品牌绿 / 细边框 / 12–16px 圆角
   ========================================================= */
:root {
  --bg: #f4f6f5;
  --bg-soft: #eef1ef;
  --panel: #ffffff;
  --panel-2: #f7f9f8;
  --line-soft: #eef1ef;

  --border: #e6ebe8;
  --border-2: #d6ddd8;

  --text: #101512;
  --text-dim: #55605a;
  --text-3: #8a938d;

  --brand: #22c55e;
  --brand-dark: #15803d;
  --brand-ink: #062e18;
  --brand-text: #15803d;
  --brand-soft: #ecfdf3;
  --brand-soft-2: #e2f9ec;
  --brand-line: #c8ecd7;
  --brand-grad: linear-gradient(135deg, #2ecb6c, #1ea85c);
  --btn-grad: linear-gradient(180deg, #2ecb6c, #1ea85c);
  --text-grad: linear-gradient(100deg, #15803d, #22c55e 48%, #0d9488);

  --red: #d94a55;
  --red-soft: #fdf0f1;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --amber-line: #fde68a;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --shadow-card: 0 1px 2px rgba(16, 21, 18, 0.03);
  --shadow-hover: 0 6px 20px rgba(16, 21, 18, 0.08);
  --shadow-brand: 0 6px 16px rgba(34, 197, 94, 0.28);

  --topbar-h: 62px;
  --side-w: 232px;
  --rail-w: 268px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
ul { list-style: none; }

.hidden { display: none !important; }
.ico { flex: 0 0 auto; display: block; }

::selection { background: rgba(34, 197, 94, 0.18); }

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #d9e0db; border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: #c6cfc9; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================ 顶栏 ============================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 var(--side-w);
  width: var(--side-w);
  text-align: left;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-grad);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(34, 197, 94, 0.26);
  flex: 0 0 auto;
}

.brand-mark svg { width: 20px; height: 20px; }

.brand-mark-lg {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  margin: 0 auto;
}

.brand-mark-lg svg { width: 26px; height: 26px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text b { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.brand-text i {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-top: 2px;
}

/* 顶栏层级提示：品牌右侧，仅做位置说明 */
.topbar-crumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--text-3);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.topbar-crumb i { font-style: normal; color: var(--border-2); }
.topbar-crumb b { color: var(--text-dim); font-weight: 650; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }

.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 13px 0 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  transition: 0.15s;
}

.credit-pill:hover { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand-dark); }

.coin-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft-2);
  color: var(--brand-dark);
  flex: 0 0 auto;
}

.coin-dot svg { width: 16px; height: 16px; }

.user-chip { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-dim); background: none; border: 0; padding: 3px 8px; border-radius: 999px; cursor: pointer; transition: background 0.14s; }
.user-chip:hover { background: var(--panel-2); color: var(--text); }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #34d399, #22c55e);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  flex: 0 0 auto;
}

.user-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  color: var(--text-3);
  border: 1px solid transparent;
  transition: 0.15s;
}

.icon-btn:hover { background: var(--panel-2); color: var(--text); border-color: var(--border); }

/* ============================ 骨架 ============================ */
.shell-body {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr) var(--rail-w);
  align-items: start;
  min-height: calc(100vh - var(--topbar-h));
}

/* ---------------- 左侧导航 ---------------- */
.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 12px 18px;
  background: #fff;
  border-right: 1px solid var(--border);
}

.side-group { display: flex; flex-direction: column; gap: 2px; }

.side-label {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--text-3);
  text-transform: uppercase;
  padding: 0 10px;
  margin-bottom: 6px;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 44px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--text-dim);
  font-size: 15px;
  text-align: left;
  transition: background 0.14s, color 0.14s;
}

.side-item:hover { background: var(--panel-2); color: var(--text); }
.side-item.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

.side-ic { display: grid; place-items: center; width: 22px; color: var(--text-3); flex: 0 0 auto; }
.side-ic svg { width: 20px; height: 20px; }
.side-item.active .side-ic { color: var(--brand); }
.side-txt { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side-tag {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--brand-soft-2);
  color: var(--brand-dark);
  border: 1px solid var(--brand-line);
}

.side-tag.soft { background: var(--panel-2); color: var(--text-3); border-color: var(--border); }

.side-count {
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 21px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
}

.side-count:empty { display: none; }

.side-balance {
  margin-top: auto;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px;
  background: linear-gradient(180deg, #f8fdf9, #fff);
}

.sb-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 11.5px; color: var(--text-3); }
.sb-num { font-size: 17px; font-weight: 750; color: var(--text); letter-spacing: -0.02em; }
.side-balance .btn { margin-top: 10px; height: 32px; font-size: 12.5px; }
.side-foot { font-size: 10.5px; color: var(--text-3); text-align: center; line-height: 1.6; }

/* ---------------- 主区 ---------------- */
.main { padding: 22px 26px 46px; min-width: 0; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-head-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-head-text { min-width: 0; }
.page-icon { width: 40px; height: 40px; border-radius: 12px; }
.page-icon:empty { display: none; }
.page-head-extra { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.page-title { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.3; }
.page-sub { font-size: 12.8px; color: var(--text-3); margin-top: 4px; }
.page-head-extra:empty { display: none; }

.content { display: flex; flex-direction: column; gap: 14px; max-width: 940px; }

.site-foot { font-size: 11.5px; color: var(--text-3); margin-top: 30px; }

/* ---------------- 右侧历史记录 ---------------- */
.rail {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 18px 14px 26px;
  background: #fff;
  border-left: 1px solid var(--border);
}

.rail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rail-title { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--text); }
.rail-title svg { color: var(--text-3); }
.rail-link { font-size: 11.5px; font-weight: 600; color: var(--brand-dark); }
.rail-link:hover { text-decoration: underline; }
.rail-sub { font-size: 11.5px; color: var(--text-3); margin: 4px 0 4px; }

.rail-date { font-size: 11.5px; color: var(--text-3); margin: 14px 0 8px; }

.rail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.rail-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #f4f6f5, #e9edeb);
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 0;
  transition: 0.15s;
}

.rail-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s; }
.rail-thumb:hover { border-color: var(--brand-line); box-shadow: 0 4px 12px rgba(16, 21, 18, 0.08); }
.rail-thumb:hover img { transform: scale(1.04); }
.rail-ph { color: #c3cbc6; }

.rail-empty { padding: 26px 6px; text-align: center; color: var(--text-3); font-size: 12px; }
.rail-empty svg { color: #c3cbc6; margin-bottom: 8px; }
.rail-empty p { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }

/* ============================ 面板 ============================ */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow-card);
}

.panel-head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 16px; }

.head-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.panel-head-text { min-width: 0; flex: 1 1 auto; }
.panel-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.5; }
.sub { font-size: 12.2px; color: var(--text-3); margin-top: 2px; }

/* 生成按钮旁的消耗提示（本次单价，点按前往充值） */
.gen-cost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--brand-line);
  background: linear-gradient(180deg, #f6fdf9, #eafcf1);
  color: var(--brand-dark);
  font-size: 12.6px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 21, 18, 0.04);
  transition: 0.15s;
}

.gen-cost i { font-style: normal; color: var(--text-dim); font-weight: 600; }
.gen-cost b { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: var(--brand-dark); }
.gen-cost:hover { background: var(--brand-soft-2); border-color: var(--brand); }
.gen-cost.cost-low { background: var(--amber-soft); border-color: var(--amber-line); }
.gen-cost.cost-low i, .gen-cost.cost-low b { color: var(--amber); }

/* ---------------- 首页：三个模块大图标入口 ---------------- */
#appView[data-page="home"] .page-head { display: none; }
#appView[data-page="home"] .rail { display: none; }
#appView[data-page="home"] .shell-body { grid-template-columns: var(--side-w) minmax(0, 1fr); }
#appView[data-page="home"] .content { max-width: 1080px; gap: 18px; }

.home-hero { padding: 8px 2px 2px; }
.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  padding: 4px 10px 4px 8px;
}
.home-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 12px 0 8px;
}
.home-sub { font-size: 13.2px; color: var(--text-dim); }
.home-login { margin-top: 12px; }

.mod-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.mod-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  text-align: left;
  padding: 22px 20px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  overflow: hidden;
}

.mod-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--brand-grad);
  opacity: 0;
  transition: opacity 0.18s;
}

.mod-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-line);
  box-shadow: var(--shadow-hover);
}
.mod-card:hover::after { opacity: 1; }

.mod-icon {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand-grad);
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.26);
  margin-bottom: 16px;
}
.mod-icon svg { width: 36px; height: 36px; }

.mod-card:nth-child(2) .mod-icon {
  background: linear-gradient(135deg, #38bdf8, #0e8bd8);
  box-shadow: 0 8px 20px rgba(14, 139, 216, 0.24);
}
.mod-card:nth-child(3) .mod-icon {
  background: linear-gradient(135deg, #a78bfa, #7c5cf0);
  box-shadow: 0 8px 20px rgba(124, 92, 240, 0.24);
}

.mod-name { font-size: 17px; font-weight: 750; letter-spacing: -0.02em; color: var(--text); }
.mod-desc { font-size: 12.6px; color: var(--text-dim); margin-top: 6px; line-height: 1.65; }

.mod-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.mod-tags i {
  font-style: normal;
  font-size: 11px;
  color: var(--text-3);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}

.mod-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.mod-price { font-size: 12.6px; font-weight: 700; color: var(--brand-dark); }
.mod-go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.4px;
  font-weight: 650;
  color: var(--text-3);
  transition: color 0.15s, gap 0.15s;
}
.mod-card:hover .mod-go { color: var(--brand-dark); gap: 8px; }

.home-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.8px;
  color: var(--text-3);
}

/* ---------------- 上传 + 结果两栏 ---------------- */
.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.studio-input { min-width: 0; }

.studio-output {
  min-width: 0;
  min-height: 238px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: grid;
  place-items: center;
  padding: 10px;
  overflow: hidden;
}

.studio-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.3px;
  color: var(--text-3);
  margin-top: 9px;
  line-height: 1.5;
}

.result-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-3); font-size: 12.5px; }
.result-empty svg { color: #c3cbc6; }

/* 上传框 */
.upload-box {
  display: block;
  position: relative;
  min-height: 238px;
  border: 1.5px dashed var(--border-2);
  border-radius: var(--r);
  background: #fbfcfb;
  overflow: hidden;
  cursor: pointer;
  transition: 0.16s;
}

.upload-box:hover { border-color: var(--brand-line); background: #f7fdf9; }

.upload-preview {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 16px;
  text-align: center;
  color: var(--text-3);
}

.upload-preview svg { color: #b8c2bc; }
.upload-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* 上传框内的真实 input：不用 hidden（部分内置浏览器点不开），改为视觉隐藏但仍可点 */
.up-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  padding: 0;
}

/* 已上传：模糊底衬铺满画框，原图完整居中，竖构图不再缩成窄条 */
.upload-preview.has-img { padding: 8px; gap: 0; overflow: hidden; background: #e9edeb; }

.upload-preview .up-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(18px) brightness(0.93) saturate(0.9);
  transform: scale(1.14);
}

.upload-preview .up-fg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  filter: drop-shadow(0 2px 10px rgba(16, 21, 18, 0.16));
}

.upload-preview .up-badge {
  position: absolute;
  z-index: 2;
  right: 9px;
  bottom: 9px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
  color: #fff;
  background: rgba(16, 21, 18, 0.55);
  border-radius: 999px;
  padding: 2px 8px;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.16s, transform 0.16s;
  pointer-events: none;
}

.upload-box:hover .up-badge,
.upload-preview.has-img:focus-within .up-badge { opacity: 1; transform: none; }

.upload-box.filled { border-style: solid; border-color: var(--border); background: #eef1ef; }
.upload-title { font-size: 13px; font-weight: 600; color: var(--text); }
.upload-tip { font-size: 11.4px; color: var(--text-3); line-height: 1.5; }

.upload-box-sm { min-height: 108px; }
.upload-preview-sm { gap: 5px; font-size: 12px; color: var(--text-dim); }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 12px; }
.field > label {
  display: block;
  font-size: 12.2px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}

input[type="text"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea { height: auto; min-height: 88px; padding: 9px 11px; line-height: 1.6; resize: vertical; }
.area-sm { min-height: 74px; }

input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.13); }
input::placeholder, textarea::placeholder { color: #a6afaa; }

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a938d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9.5l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1 1 auto; }
.code-row .btn { flex: 0 0 auto; }

.form-error { color: var(--red); font-size: 12.5px; min-height: 18px; margin: 2px 0 8px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}

.btn-primary { background: var(--btn-grad); color: #fff; box-shadow: 0 4px 12px rgba(34, 197, 94, 0.24); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #33d475, #20b464); box-shadow: 0 7px 18px rgba(34, 197, 94, 0.3); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.btn-ghost { background: #fff; border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand-line); color: var(--brand-dark); background: var(--brand-soft); }

/* 微信登录主按钮（站内唯一登录方式） */
.btn-wechat {
  background: #07c160;
  color: #fff;
  box-shadow: 0 6px 16px rgba(7, 193, 96, 0.28);
  font-weight: 650;
}
.btn-wechat:hover:not(:disabled) { background: #06ad56; box-shadow: 0 9px 22px rgba(7, 193, 96, 0.34); }
.btn-wechat svg { width: 20px; height: 20px; flex: 0 0 auto; }

.login-alt { text-align: center; margin-top: 10px; }
.link-btn {
  background: none;
  border: 0;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12.4px;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.14s, background 0.14s;
}
.link-btn:hover { color: var(--brand-dark); background: var(--brand-soft); }

.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: 40px; font-size: 13.5px; border-radius: 10px; }
.btn-block { width: 100%; }

.btn-generate { height: 38px; padding: 0 18px; border-radius: 10px; letter-spacing: 0.01em; }
.btn-generate svg { width: 16px; height: 16px; }

/* ---------------- 比例选择（九宫格） ---------------- */
.ratio-wrap { min-width: 0; }

.ratio-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border-radius: var(--r);
  transition: outline-color 0.2s;
}

.ratio-row.ratio-need { outline: 1.5px dashed #f0b57c; outline-offset: 5px; }

/* 封面有五档比例：一行放五个，避免最后一个被挤到第二行 */
.ratio-row.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* 固定比例展示（三视图 16:9） */
.ratio-fixed {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--brand-line);
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.ratio-fixed .ratio-glyph { opacity: 0.9; }
.ratio-fixed em { font-style: normal; font-weight: 500; font-size: 11.5px; color: var(--text-3); }

.ratio-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 62px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 500;
  transition: 0.14s;
}

.ratio-tile:hover { border-color: var(--border-2); background: var(--panel-2); }

.ratio-tile.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 650;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.ratio-glyph {
  display: block;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  opacity: 0.5;
}

.ratio-tile.active .ratio-glyph { opacity: 0.95; }

.ratio-tip { font-size: 11.5px; color: var(--amber); margin-top: 8px; }
.ratio-hint { font-size: 11.5px; color: var(--text-3); }

.ratio-shake { animation: shake 0.5s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
}

/* ---------------- 生成设置区（参考图底部操作卡） ---------------- */
.composer {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: #fcfdfc;
}

.composer-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.composer-label { font-size: 12.5px; font-weight: 650; color: var(--text); }
.composer-hint { font-size: 11.4px; color: var(--text-3); }

.composer-bar { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.composer-bar .algo-note { margin-top: 0; flex: 1 1 240px; }
.composer-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.algo-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11.4px;
  color: var(--text-3);
  line-height: 1.65;
  margin-top: 10px;
}

.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }

/* ---------------- 结果展示 ---------------- */
.compare-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }

/* 修复结果只展示修复后的成图（不再并排原图），单图可看更大 */
.compare-row.single { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin: 0 auto; }
.compare-row.single .compare-item img { max-height: 460px; }

.compare-item {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
}

.compare-item h4 { font-size: 11.4px; font-weight: 600; color: var(--text-3); margin-bottom: 6px; }

.compare-item img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
  border-radius: 7px;
  background: var(--panel-2);
}

.compare-after { border-color: var(--brand-line); background: var(--brand-soft); }

.tri-real {
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px;
  width: 100%;
}

.tri-real img { width: 100%; display: block; border-radius: 8px; }
.tri-label { font-size: 11.4px; color: var(--text-3); text-align: center; padding: 8px 4px 2px; }

.tri-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
.tri-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 7px; min-width: 0; }
.tri-card img { width: 100%; display: block; border-radius: 6px; }

.work-desc { font-size: 12.5px; color: var(--text-dim); margin-bottom: 12px; line-height: 1.7; }

/* ---------------- 作品网格 ---------------- */
.work-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.work-count { font-size: 11.8px; color: var(--text-3); }

.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 13px; }

.work-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: 0.16s;
}

.work-card:hover { border-color: var(--border-2); box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.work-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, #f4f6f5, #e9edeb);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.work-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-card-ph { color: #c3cbc6; }

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-dark);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--brand-line);
  border-radius: 6px;
  padding: 1px 6px;
  backdrop-filter: blur(4px);
}

.work-card-del {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  color: var(--text-3);
  opacity: 0;
  transition: 0.15s;
}

.work-card:hover .work-card-del { opacity: 1; }
.work-card-del:hover { color: var(--red); border-color: #f3c6c9; background: #fff; }

.work-card-body { padding: 9px 11px 11px; }
.work-card-body h4 { font-size: 12.8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.work-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-3);
}

.work-type { display: inline-flex; align-items: center; gap: 4px; }
.card-link { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--brand-dark); white-space: nowrap; }

/* ---------------- 空状态 ---------------- */
.empty-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--text-3);
  font-size: 12.5px;
  text-align: center;
  line-height: 1.6;
}

.empty-hint svg { color: #c3cbc6; }

.empty-state {
  grid-column: 1 / -1;
  padding: 42px 16px;
  border: 1.5px dashed var(--border-2);
  border-radius: var(--r);
  background: #fbfcfb;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  color: var(--text-3);
}

.empty-state svg { color: #c3cbc6; }
.empty-state h4 { font-size: 13.5px; font-weight: 650; color: var(--text); }
.empty-state p { font-size: 12px; }
.empty-state .btn { margin-top: 4px; }

/* ---------------- 分段控件（筛选） ---------------- */
.seg-row {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.seg-btn {
  height: 28px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12.3px;
  color: var(--text-dim);
  transition: 0.14s;
}

.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: #fff; color: var(--text); font-weight: 650; box-shadow: 0 1px 3px rgba(16, 21, 18, 0.09); }

/* ============================ 充值 ============================ */
.credit-big {
  flex: 0 0 auto;
  text-align: right;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--brand-dark);
  line-height: 1.2;
}

.credit-big small { display: block; font-size: 10.5px; font-weight: 600; color: var(--text-3); letter-spacing: 0; margin-top: 2px; }

.shortage-box {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12.2px;
  line-height: 1.65;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.shortage-box b { font-weight: 700; }

.notice-box {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 14px 0;
}

.credit-rates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 2px 0 16px; }

.credit-rates span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.8px;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
  line-height: 1.5;
}

.credit-rates svg { color: var(--text-3); }

.block-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12.8px; font-weight: 650; color: var(--text); margin: 2px 0 10px; }
.block-title span { font-size: 11.4px; font-weight: 400; color: var(--text-3); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; margin-bottom: 4px; }

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  padding: 13px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: #fff;
  transition: 0.15s;
}

.plan-card:hover { border-color: var(--brand-line); background: #fbfefc; }

.plan-card.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1); }

.plan-amount { font-size: 17px; font-weight: 750; letter-spacing: -0.02em; }
.plan-credit { font-size: 11.8px; color: var(--text-dim); }
.gift-tag {
  align-self: flex-start;
  font-size: 10.4px;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  border-radius: 5px;
  padding: 0 5px;
  margin-top: 4px;
}
.plan-plain { font-size: 10.4px; color: var(--text-3); margin-top: 4px; }
.plan-label { font-size: 10.4px; color: var(--text-3); margin-top: 2px; }

.plan-flag {
  position: absolute;
  top: -8px;
  right: 9px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  padding: 0 7px;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.34);
}

.recharge-form { margin-top: 6px; }
.pay-bar { margin-top: 2px; }
.pay-summary-wrap { font-size: 12.5px; color: var(--text-dim); }

.order-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.8fr 0.9fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 7px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 12.3px;
}

.order-row:last-child { margin-bottom: 0; }
.order-time { font-size: 11.4px; color: var(--text-3); text-align: right; }

.st { justify-self: start; font-size: 10.8px; font-weight: 700; padding: 1px 7px; border-radius: 6px; }
.st-paid { color: var(--brand-dark); background: var(--brand-soft); border: 1px solid var(--brand-line); }
.st-pending { color: var(--amber); background: var(--amber-soft); border: 1px solid var(--amber-line); }
.st-rej { color: var(--red); background: var(--red-soft); border: 1px solid #f3c6c9; }
.st-info { color: var(--text-2, #475569); background: rgba(127,127,127,.10); border: 1px solid rgba(127,127,127,.22); }

.delta-plus { color: var(--brand-dark); font-weight: 650; }
.delta-minus { color: var(--red); font-weight: 650; }

/* ============================ 加载与提示 ============================ */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(34, 197, 94, 0.22);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}

@keyframes spin { to { transform: rotate(360deg); } }

#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  transform: translate(-50%, 10px);
  opacity: 0;
  pointer-events: none;
  max-width: 82vw;
  padding: 10px 16px;
  border-radius: 10px;
  background: #111a14;
  color: #fff;
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  transition: opacity 0.22s, transform 0.22s;
}

#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: #b3202c; }

/* ============================ 登录 ============================ */
.login-wrap {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  overflow: hidden;
  background: var(--bg);
}

.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38rem 20rem at 50% -10%, rgba(34, 197, 94, 0.13), transparent 62%),
    linear-gradient(180deg, #fbfdfb 0%, #f1f4f2 100%);
}

/* 登录弹窗：游客可直接浏览网站，点右上角「登录 / 注册」弹出 */
.login-modal {
  position: fixed;
  inset: 0;
  min-height: 0;
  z-index: 998;
  background: rgba(15, 18, 22, 0.45);
  backdrop-filter: blur(3px);
  animation: loginFadeIn 0.16s ease;
}
@keyframes loginFadeIn { from { opacity: 0; } to { opacity: 1; } }
.login-modal .login-bg { display: none; }
.login-modal .login-card {
  max-height: calc(100vh - 56px);
  overflow: auto;
  box-shadow: 0 24px 70px rgba(10, 14, 12, 0.35);
}
.login-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3, #999);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.login-close:hover { background: var(--panel-2, #f4f6f5); color: var(--text, #222); }

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 30px 26px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: 0 20px 50px rgba(16, 21, 18, 0.08);
}

.login-brand { text-align: center; margin-bottom: 20px; }
.login-brand h1 { font-size: 19px; font-weight: 750; letter-spacing: -0.02em; margin-top: 11px; }
.login-brand p { font-size: 12.4px; color: var(--text-3); margin-top: 5px; }

.login-note { font-size: 11.2px; color: var(--text-3); text-align: center; line-height: 1.7; margin-top: 14px; }

.divider { position: relative; text-align: center; font-size: 11px; color: var(--text-3); margin: 16px 0 12px; }
.divider::before, .divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 30px);
  height: 1px;
  background: var(--border);
}
.divider::before { left: 0; }
.divider::after { right: 0; }

/* ============================ 响应式 ============================ */
@media (max-width: 1240px) {
  .shell-body { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .rail { display: none; }
}

@media (max-width: 1080px) {
  .mod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .shell-body { grid-template-columns: minmax(0, 1fr); }

  .topbar { padding: 0 14px; gap: 10px; }
  .brand { flex: 0 0 auto; width: auto; }

  .sidebar {
    position: sticky;
    top: var(--topbar-h);
    z-index: 30;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar { display: none; }
  .side-group { flex-direction: row; gap: 6px; }
  .side-label, .side-balance, .side-foot { display: none; }

  .side-item {
    width: auto;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    background: #fff;
    padding: 0 13px;
    font-size: 13.5px;
    gap: 8px;
  }

  .side-ic svg { width: 17px; height: 17px; }

  .side-tag, .side-count { display: none; }

  .main { padding: 16px 14px 40px; }
  .page-title { font-size: 20px; }
  .panel { padding: 15px 15px 17px; border-radius: 14px; }
  .studio-grid { grid-template-columns: minmax(0, 1fr); }
  .credit-rates { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .user-name { display: none; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-icon { width: 34px; height: 34px; border-radius: 10px; }
  .upload-box, .studio-output { min-height: 178px; }
  .page-title { font-size: 19px; }
  .topbar-right { gap: 6px; }
  .page-head { margin-bottom: 12px; }
  .page-sub { font-size: 12px; }
  .panel-head { flex-wrap: wrap; }
  .mod-grid { grid-template-columns: minmax(0, 1fr); }
  .home-title { font-size: 24px; }
  .mod-card { padding: 18px 16px 16px; }
  .mod-icon { width: 58px; height: 58px; border-radius: 17px; margin-bottom: 13px; }
  .mod-icon svg { width: 30px; height: 30px; }
  .ratio-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ratio-row.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .compare-row { grid-template-columns: minmax(0, 1fr); }
  .tri-grid { grid-template-columns: minmax(0, 1fr); }
  .work-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .work-card-body { padding: 8px 9px 10px; }
  .work-card-meta { font-size: 10.5px; }
  .card-link span { display: none; }
  .order-row { grid-template-columns: 1fr 1fr; gap: 6px 10px; }
  .order-time { grid-column: 1 / -1; text-align: left; }
  .composer { padding: 12px; }
  .composer-actions { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .composer-actions .btn { flex: 1 1 auto; }
  .gen-cost { order: -1; width: 100%; justify-content: center; height: 34px; }
  .login-card { padding: 24px 18px 20px; }
  .credit-big { font-size: 19px; }
  .plan-grid { grid-template-columns: 1fr 1fr; }
}

@media (hover: none) {
  .work-card-del { opacity: 1; }
  .upload-preview .up-badge { opacity: 1; transform: none; }
}

/* 封面结果：本次实际使用的提示词（便于核对是否带入用户内容） */
.prompt-peek { margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); overflow: hidden; }
.prompt-peek > summary { cursor: pointer; padding: 9px 13px; font-size: 12.5px; color: var(--text-dim); list-style: none; }
.prompt-peek > summary::-webkit-details-marker { display: none; }
.prompt-peek > summary::before { content: "▸ "; }
.prompt-peek[open] > summary::before { content: "▾ "; }
.prompt-peek > pre { margin: 0; padding: 0 13px 12px; font-size: 12px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; color: var(--text-dim); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* 封面结果区容器：图片 / 下载 / 提示词纵向排列，避免被结果区居中裁切 */
.result-stack { width: 100%; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.result-stack .prompt-peek { width: 100%; max-width: 560px; }

/* 表单里的可选标注（如「修复要求（可选）」） */
.field .label-opt { color: var(--text-dim); font-weight: 400; font-size: 12px; margin-left: 2px; }

/* ---------- 微信扫码支付弹窗 ---------- */
.pay-modal-mask { position: fixed; inset: 0; z-index: 999; background: rgba(15,18,22,.62); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: payFadeIn .18s ease; }
@keyframes payFadeIn { from { opacity: 0; } to { opacity: 1; } }
.pay-modal-box { position: relative; width: 340px; max-width: calc(100vw - 40px); background: var(--panel, #fff); border: 1px solid var(--line); border-radius: 18px; padding: 26px 22px 22px; text-align: center; box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.pay-modal-box h3 { margin: 0 0 6px; font-size: 17px; }
.pay-modal-amount { font-size: 34px; font-weight: 800; color: var(--green, #07c160); letter-spacing: -.5px; }
.pay-modal-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.pay-modal-qr { margin: 16px auto 4px; width: 224px; height: 224px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pay-modal-qr img { width: 200px; height: 200px; display: block; }
.pay-modal-code { display: flex; flex-direction: column; gap: 8px; padding: 12px; font-size: 12px; color: var(--text-dim); word-break: break-all; }
.pay-modal-code code { font-size: 11px; user-select: all; }
.pay-modal-tip { margin: 12px 0 0; font-size: 13px; color: var(--text-dim); line-height: 1.7; }
.pay-modal-tip span { color: var(--brand-text, #2563eb); }
.pay-modal-close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border: none; background: transparent; color: var(--text-dim); cursor: pointer; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.pay-modal-close:hover { background: rgba(127,127,127,.12); }
@media (max-width: 480px) { .pay-modal-qr { width: 190px; height: 190px; } .pay-modal-qr img { width: 168px; height: 168px; } }

/* ---------- 输出清晰度选择（1K / 2K / 4K） ---------- */
.res-wrap { margin-top: 8px; }
.res-row { display: flex; flex-wrap: wrap; gap: 8px; }
.res-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 96px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--text-dim); cursor: pointer; line-height: 1.2;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.res-tile b { font-size: 14px; font-weight: 750; letter-spacing: .2px; }
.res-tile span { font-size: 11px; color: var(--text-dim); }
.res-tile:hover { border-color: var(--border-2); background: var(--panel-2); }
.res-tile.active {
  border-color: var(--brand); background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}
.res-tile.active b { color: var(--brand-dark); }
.res-tile.active span { color: var(--brand-text); }
@media (max-width: 560px) {
  .res-tile { flex: 1 1 30%; min-width: 0; padding: 8px 6px; }
}

/* ---------------- 作品详情：按实际生成质量展示原图 ---------------- */
.work-shot {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.work-shot img {
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  display: block;
  border-radius: var(--r);
  background: var(--panel-2);
  cursor: zoom-in;
  transition: opacity 0.18s ease;
}

.work-shot img.is-loading { opacity: 0.6; }

.work-shot figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 2px 2px;
  font-size: 11.6px;
  color: var(--text-3);
}

.shot-cap { font-weight: 600; color: var(--text-dim); }

.shot-chip {
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-size: 10.6px;
  font-weight: 650;
  letter-spacing: 0.2px;
}

.shot-tip {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.78;
}

/* 原图查看层 */
.img-viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 26px;
  background: rgba(9, 13, 11, 0.87);
  backdrop-filter: blur(2px);
}

.img-viewer.show { display: grid; }

.img-viewer img {
  max-width: 100%;
  max-height: calc(100vh - 78px);
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.5);
  background: #0b0f0d;
}

.img-viewer-x {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.img-viewer-x:hover { background: rgba(255, 255, 255, 0.3); }

.img-viewer-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  color: #e7ecea;
  font-size: 12.4px;
}

body.viewer-open { overflow: hidden; }

@media (max-width: 640px) {
  .work-shot { padding: 8px; border-radius: var(--r); }
  .work-shot img { max-height: 62vh; }
  .shot-tip { margin-left: 0; width: 100%; }
}

/* ---------------- 品牌标志（ARAIGC） ---------------- */
.brand-mark.brand-mark-img {
  background: transparent;
  box-shadow: none;
  padding: 0;
  overflow: hidden;
}
.brand-mark-img img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.brand-text b { letter-spacing: 0.02em; }
.brand-text b em {
  font-style: normal;
  background: linear-gradient(100deg, #22c55e, #0b7f47);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-text i { letter-spacing: 0.14em; }

/* ---- 用户中心 ---- */
.uc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 1080px; margin: 0 auto; }
.uc-card { margin: 0; }
.uc-card.uc-wide { grid-column: 1 / -1; }

.uc-profile { display: flex; gap: 18px; align-items: flex-start; }
.uc-avatar { width: 58px; height: 58px; font-size: 24px; flex: 0 0 auto; }
.uc-profile-form { flex: 1; min-width: 0; }
.uc-label { display: block; font-size: 12.2px; color: var(--text-3); font-weight: 600; margin-bottom: 5px; }
.uc-nick-row { display: flex; gap: 8px; }
.uc-input {
  flex: 1; min-width: 0; height: 36px; padding: 0 11px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 13.2px;
  transition: border-color 0.14s;
}
.uc-input:focus { outline: none; border-color: var(--brand); }
.uc-hint { font-size: 11.6px; color: var(--text-3); margin: 7px 0 0; }
.uc-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 13px; font-size: 12.4px; color: var(--text-dim); align-items: center; }
.uc-uid { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.uc-uid:hover { color: var(--brand-dark); }

.uc-pass { display: grid; gap: 12px; max-width: 360px; }
.uc-pass .uc-input { width: 100%; }
.uc-pass-row { display: flex; align-items: center; gap: 12px; }
.uc-pass-msg { font-size: 12px; color: var(--red); }

/* 用户中心 · 登录方式（仅微信） */
.uc-login-way { display: block; }
.uc-way-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2, #f8faf9);
}
.uc-way-ic {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: #07c160;
  color: #fff;
  box-shadow: 0 4px 12px rgba(7, 193, 96, 0.26);
}
.uc-way-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.uc-way-text b { font-size: 13.6px; color: var(--text); }
.uc-way-text span { font-size: 11.8px; color: var(--text-3); line-height: 1.5; }
.uc-way-badge {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-dark, #15803d);
  background: var(--brand-soft, #e8f8ee);
  border: 1px solid var(--brand-line, #bfe8cd);
  border-radius: 999px;
  padding: 2px 9px;
}

.uc-balance-box { margin-left: auto; display: flex; align-items: baseline; gap: 6px; }
.uc-balance-box b { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; color: var(--brand-dark); }
.uc-balance-box span { font-size: 11.6px; color: var(--text-3); }
.uc-month { font-size: 12.4px; color: var(--text-dim); margin: -4px 0 12px; }
.uc-month b { color: var(--brand-dark); }

.uc-logs { display: flex; flex-direction: column; }
.uc-log-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 12.6px;
}
.uc-log-row:last-child { border-bottom: 0; }
.uc-log-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.uc-log-feat { color: var(--text-3); font-size: 11.8px; }
.uc-kind { font-size: 11.4px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.uc-kind.uc-plus { color: var(--brand-dark); background: var(--brand-soft); }
.uc-kind.uc-minus { color: var(--text-dim); background: var(--panel-2); }
.uc-log-right { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.uc-log-right b { font-weight: 700; font-variant-numeric: tabular-nums; }
.uc-plus { color: var(--brand-dark); }
.uc-minus { color: var(--amber); }
.uc-log-bal { color: var(--text-3); font-size: 11.6px; }
.uc-log-time { color: var(--text-3); font-size: 11.6px; }
.uc-page-info { font-size: 11.8px; color: var(--text-3); }
#ucPager { justify-content: center; align-items: center; gap: 12px; margin-top: 12px; }

@media (max-width: 900px) {
  .uc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .uc-log-time { display: none; }
  .uc-profile { flex-direction: column; }
}

