:root {
  /* Design tokens (统一色板/圆角/阴影) */
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --line: rgba(228, 231, 236, 0.96);
  --line-strong: rgba(203, 213, 225, 0.96);

  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.10);
  --primary-rgb: 37, 99, 235;

  --success: #2563eb;
  --success-soft: rgba(37, 99, 235, 0.12);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --danger: #d92d20;
  --danger-soft: rgba(217, 45, 32, 0.10);

  --shadow: 0 14px 36px rgba(15, 23, 42, 0.10);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.08);

  --radius: 12px;
  --radius-sm: 10px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(var(--primary-rgb), 0.12), transparent 320px),
    linear-gradient(180deg, rgba(246, 248, 250, 0.9) 0, rgba(246, 248, 250, 1) 280px),
    var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
}

body.has-dialog,
body.is-generating {
  overflow: hidden;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

button:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

.app-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 64px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.topbar-brand {
  min-width: 0;
  width: fit-content;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(var(--primary-rgb), 0.24);
}

.brand-mark svg {
  width: 30px;
  height: 30px;
  display: block;
}

.brand-mark img,
.center-auth-mark img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.brand-mark .icon-frame,
.brand-mark .icon-line,
.brand-mark .icon-dot {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark .ai-spark {
  fill: #93c5fd;
  stroke: #ffffff;
  stroke-width: 0.6;
}

.brand-mark .ai-spark.small {
  fill: #ffffff;
  stroke: none;
  opacity: 0.92;
}

.brand-copy {
  min-width: 0;
}

.eyebrow,
.brand-copy .eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

h1,
h2 {
  margin: 0;
  color: var(--text);
  line-height: 1.18;
  letter-spacing: 0;
}

h1 {
  overflow: hidden;
  font-size: 24px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 {
  font-size: 20px;
  font-weight: 750;
}

.grid {
  display: grid;
  gap: 16px;
}

.two-col {
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  align-items: stretch;
}

.narrow-left {
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
}

.card,
.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.card {
  padding: 20px;
}

.section-card {
  margin-top: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 50px;
  margin-bottom: 16px;
}

.card-head>div {
  min-width: 0;
}

.card-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.form {
  display: grid;
  gap: 14px;
}

.field,
.field-grid {
  display: grid;
  gap: 8px;
}

.field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field span {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 150px;
  padding: 12px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(var(--primary-rgb), 0.35);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.14);
}

input[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-weight: 750;
  line-height: 1;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.button.primary {
  background: linear-gradient(135deg, var(--primary) 0%, #0ea5e9 100%);
  color: #fff;
  box-shadow: 0 12px 26px rgba(var(--primary-rgb), 0.22);
}

.button.primary:hover {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--text-soft);
}

.button.secondary:hover,
.button.secondary.active {
  border-color: rgba(var(--primary-rgb), 0.30);
  background: var(--primary-soft);
  color: var(--primary);
}

.button.secondary.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.button.danger {
  border-color: #fecaca;
  background: #fff;
  color: var(--danger);
}

.button.danger:hover {
  background: var(--danger-soft);
}

.button.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

/* 首页：移动端更精致的充值 CTA */
.recharge-cta {
  border-width: 1px;
  border-color: rgba(74, 144, 226, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.96));
  color: #1d4ed8;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
  padding-left: 10px;
  padding-right: 10px;
}

.recharge-cta.recharge-cta-compact {
  padding-left: 6px;
  padding-right: 6px;
}

.recharge-cta:hover {
  border-color: rgba(74, 144, 226, 0.45);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(235, 244, 255, 0.98));
  color: #1e40af;
}

.recharge-cta:active {
  transform: translateY(1px);
}

/* 后台：用户列表“加余额”钱币按钮 + 更精致弹窗 */
.admin-money-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(74, 144, 226, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.98));
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.admin-money-btn:hover {
  border-color: rgba(74, 144, 226, 0.42);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.admin-money-btn:active {
  transform: translateY(0px);
}

.admin-money-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-credits-panel {
  max-width: 520px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(245,249,255,0.94));
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.18);
}

/* 后台：用户管理实名状态 */
.rn-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(228, 231, 236, 0.96);
  background: rgba(248, 250, 252, 0.92);
  color: #64748b;
  white-space: nowrap;
}

.rn-badge svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rn-badge.is-ok {
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.10), rgba(6, 182, 212, 0.06));
  color: #1d4ed8;
}

.rn-badge.is-no {
  opacity: 0.9;
}

/* 后台：按截图重做“增加余额”弹窗 */
.admin-addcredits-modal {
  width: min(420px, calc(100vw - 32px));
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.18);
  padding: 22px 20px 18px;
  position: relative;
  border: 1px solid rgba(228, 231, 236, 0.96);
}

.admin-addcredits-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(228, 231, 236, 0.96);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
}

.admin-addcredits-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-addcredits-title {
  font-size: 22px;
  font-weight: 950;
  color: #0f172a;
  letter-spacing: 0.2px;
  margin-bottom: 14px;
}

.admin-addcredits-form {
  display: grid;
  gap: 12px;
}

.admin-addcredits-pill {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  color: #0f172a;
  font-weight: 900;
  background: rgba(248, 250, 252, 0.92);
}

.admin-addcredits-field span {
  display: none;
}

.admin-addcredits-field input {
  width: 100%;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  background: #fff;
  padding: 0 16px;
  font-weight: 800;
  outline: none;
}

.admin-addcredits-field input:focus {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.admin-addcredits-submit {
  height: 46px;
  border-radius: 999px;
  border: 0;
  color: #fff;
  font-weight: 950;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.22);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.admin-addcredits-submit:hover {
  filter: brightness(1.02);
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.26);
  transform: translateY(-1px);
}

.admin-addcredits-submit:active {
  transform: translateY(0px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.20);
}

.badge,
.status {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

/* 顶部余额：桌面/移动端统一蓝色高亮 */
.badge[data-balance-display] {
  border: 1px solid rgba(var(--primary-rgb), 0.22);
  background: rgba(var(--primary-rgb), 0.10);
  color: var(--primary);
}

.status.succeeded,
.alert.success,
.inline-message.success {
  background: rgba(239, 246, 255, 0.95);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.28);
}

.status.failed,
.alert.error,
.inline-message.error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #fecaca;
}

.status.running,
.status.queued,
.alert.warning,
.inline-message.warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: #fed7aa;
}

.status.deleted {
  background: #f2f4f7;
  color: var(--muted);
  border-color: var(--line-strong);
}

.alert,
.inline-message {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #fff;
  color: var(--text-soft);
  font-weight: 650;
}

.inline-message {
  margin: 14px 0 0;
}

.generation-notice {
  margin-bottom: 14px;
  border: 1px solid #f6d58b;
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff8e6;
  color: #9a6700;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.6;
}

.mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mode-toggle label {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text-soft);
  font-weight: 800;
}

.mode-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-toggle label:has(input:checked) {
  border-color: rgba(var(--primary-rgb), 0.35);
  background: var(--primary-soft);
  color: var(--primary);
}

.edit-upload-box {
  position: relative;
  width: 88px;
  min-width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px dashed #98a2b3;
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

/* 上传区用 label[for=file] 触发原生选图，避免程序化 click 在微信等 WebView 中失效；勿放入会提交的 form 内 */
button.edit-upload-box,
label.edit-upload-box {
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

button.edit-upload-box:focus-visible,
label.edit-upload-box:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.edit-upload-box:hover {
  border-color: var(--primary);
  background: rgba(239, 246, 255, 0.95);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 参考图 file 置于 form 外且不与 form 关联（无 form/name），避免微信等 WebView 选图后误提交表单；屏幕外占位 */
.edit-upload-file-input {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  overflow: hidden;
}

.edit-upload-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.edit-upload-box strong {
  display: block;
  color: #101828;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
}

.edit-upload-box small {
  display: none;
}

.edit-upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 88px));
  gap: 10px;
  min-width: 0;
}

.edit-upload-field:has(.edit-upload-preview:not(.hidden)) {
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: start;
}

.edit-upload-field:has(.edit-upload-preview:not(.hidden))>span {
  grid-column: 1 / -1;
}

.edit-upload-field:has(.edit-upload-preview:not(.hidden)) .edit-upload-box {
  grid-column: 1;
  grid-row: 2;
}

.edit-upload-field:has(.edit-upload-preview:not(.hidden)) .edit-upload-preview {
  grid-column: 2;
  grid-row: 2;
}

.edit-preview-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.edit-preview-item button {
  position: absolute;
  right: 6px;
  bottom: 6px;
  border: 0;
  border-radius: 6px;
  padding: 4px 7px;
  background: rgba(17, 24, 39, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.generate-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.prompt-field-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 2px;
}

.prompt-field-title {
  margin: 0;
  font: inherit;
  cursor: text;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}

.prompt-field-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 2px;
}

.prompt-optimize-button {
  width: auto;
  min-width: 88px;
  height: 30px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #ffffff;
  color: #1d4ed8;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 820;
  cursor: pointer;
}

.prompt-optimize-button:hover,
.prompt-optimize-button:focus-visible {
  border-color: rgba(var(--primary-rgb), 0.35);
  background: var(--primary-soft);
}

.prompt-optimize-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.prompt-field textarea {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  min-height: 140px;
  resize: vertical;
  padding: 12px;
  background: #fff;
  box-shadow: none;
}

.prompt-field textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
  border-color: rgba(var(--primary-rgb), 0.45);
}

.auth-wrap {
  min-height: 62vh;
  display: grid;
  place-items: center;
}

.simple-auth {
  min-height: calc(100vh - 150px);
}

.auth-dashboard {
  min-height: calc(100vh - 142px);
  width: 100%;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 440px);
  gap: 24px;
  align-items: stretch;
  place-items: stretch;
}

.auth-info,
.auth-form-card {
  min-height: 520px;
}

.auth-info {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  border: 1px solid rgba(208, 213, 221, 0.92);
  border-radius: var(--radius);
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: var(--shadow);
}

.auth-info::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: 28px;
  width: min(320px, 46%);
  height: 160px;
  border: 1px solid rgba(var(--primary-rgb), 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(249, 251, 250, 0.8)),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(var(--primary-rgb), 0.12) 24px);
  opacity: 0.76;
}

.auth-info::before {
  content: "";
  position: absolute;
  inset: 24px 24px auto auto;
  width: min(360px, 42%);
  aspect-ratio: 1;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  border-radius: 50%;
  background:
    linear-gradient(90deg, rgba(var(--primary-rgb), 0.16) 1px, transparent 1px),
    linear-gradient(180deg, rgba(var(--primary-rgb), 0.16) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.72;
}

.auth-info-head,
.auth-metrics {
  position: relative;
  z-index: 2;
}

.auth-tag {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(var(--primary-rgb), 0.35);
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.auth-info h2 {
  max-width: 560px;
  margin-top: 22px;
  font-size: 42px;
  line-height: 1.08;
}

.auth-info p {
  max-width: 500px;
  margin: 14px 0 0;
  color: var(--text-soft);
  font-size: 16px;
  font-weight: 650;
}

.auth-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.auth-metrics div {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 7px;
  border: 1px solid rgba(208, 213, 221, 0.88);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.auth-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.auth-metrics strong {
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-card {
  width: min(440px, 100%);
}

.auth-form-card {
  width: 100%;
  display: grid;
  align-content: center;
  align-self: stretch;
  padding: 30px;
}

.auth-card.wide {
  width: min(640px, 100%);
}

.auth-card h2 {
  margin-bottom: 18px;
}

.auth-card-head {
  margin-bottom: 22px;
}

.auth-card-head h2 {
  margin-bottom: 8px;
  font-size: 26px;
  color: var(--text);
}

.auth-form-card .field input {
  background: #fff;
}

.auth-form-card .field input::placeholder {
  color: #98a2b3;
}

.auth-card-head span,
.auth-switch {
  color: var(--muted);
  font-weight: 650;
}

.auth-form-card .button.primary {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
}

.auth-switch {
  margin: 18px 0 0;
  text-align: center;
}

.setup-card {
  width: min(920px, 100%);
  margin: 0 auto;
}

.setup-form {
  gap: 18px;
}

.setup-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fbfdfc;
}

.setup-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.muted {
  color: var(--muted);
}

.preview-card {
  display: grid;
  grid-template-rows: auto minmax(390px, 1fr);
}

.preview-stage {
  min-height: 390px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(45deg, rgba(208, 213, 221, 0.42) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(208, 213, 221, 0.42) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(208, 213, 221, 0.42) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(208, 213, 221, 0.42) 75%),
    #f9fbff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.preview-stage img {
  width: 100%;
  height: 100%;
  max-height: 620px;
  object-fit: contain;
  background: #fff;
}

.empty-state,
.preview-loading {
  width: min(240px, 90%);
  min-height: 116px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px dashed #b8c7dc;
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.preview-loading span {
  font-size: 13px;
  font-weight: 600;
}

.preview-error {
  width: min(360px, 92%);
  min-height: 128px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 18px;
  background: var(--danger-soft);
  color: var(--danger);
  text-align: center;
  font-weight: 700;
}

.preview-error span {
  color: #991b1b;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.preview-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #dbeafe;
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.history-list .record-card {
  height: 236px;
  min-height: 236px;
  display: grid;
  grid-template-rows: 128px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: #fff;
  color: inherit;
  cursor: pointer;
  text-align: left;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.history-list .record-card:hover {
  border-color: rgba(var(--primary-rgb), 0.35);
  background: #fbfdfc;
  box-shadow: var(--shadow-soft);
}

.history-list .record-card:focus-visible {
  outline: 3px solid rgba(var(--primary-rgb), 0.16);
  outline-offset: 2px;
}

.record-image {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #e8f7f0, #f9fbfa);
  color: var(--muted);
  font-weight: 750;
}

.record-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.record-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 10px;
}

.record-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.record-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-meta span:first-child:not(.status) {
  color: var(--primary);
}

.record-body p {
  max-height: 42px;
  margin: 0;
  overflow: hidden;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.record-body time {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.record-foot--with-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 6px;
}

.record-foot--with-actions time {
  margin-right: auto;
}

.record-featured-btn {
  flex-shrink: 0;
  min-height: 32px !important;
  padding: 0 14px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 0.03em;
  border-radius: 999px !important;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.record-featured-btn:disabled {
  cursor: default;
  opacity: 1;
}

.record-featured-btn__inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.record-featured-star-icon {
  flex-shrink: 0;
  display: block;
}

.record-featured-btn--idle {
  border-color: rgba(148, 163, 184, 0.55) !important;
  background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
  color: #475569 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.record-featured-btn--idle .record-featured-star-icon {
  color: #94a3b8;
}

.record-featured-btn--idle:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: rgba(var(--primary-rgb), 0.38) !important;
  background: linear-gradient(180deg, #ffffff, #f0f9ff) !important;
  color: var(--primary) !important;
  box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.12);
}

.record-featured-btn--idle:not(:disabled):hover .record-featured-star-icon {
  color: var(--primary);
}

.record-featured-btn--pending {
  border-color: rgba(251, 191, 36, 0.5) !important;
  background: linear-gradient(145deg, #fffbeb 0%, #fef9c3 100%) !important;
  color: #a16207 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 2px 6px rgba(245, 158, 11, 0.12);
}

.record-featured-btn--pending .record-featured-star-icon {
  color: #d97706;
}

/* 待审核：描边星，与「已加入」实心星区分 */
.record-featured-btn--pending .record-featured-star-icon path {
  fill: rgba(254, 243, 199, 0.65);
  stroke: #d97706;
  stroke-width: 1.15;
  stroke-linejoin: round;
}

.record-featured-btn--approved {
  border-color: rgba(251, 191, 36, 0.65) !important;
  background: linear-gradient(145deg, #fffdf7 0%, #fef3c7 42%, #fde68a 100%) !important;
  color: #78350f !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 2px 10px rgba(245, 158, 11, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}

.record-featured-btn--approved .record-featured-star-icon {
  width: 16px;
  height: 16px;
  color: #f59e0b;
}

/* 已加入精选：实心填充（显式 fill，避免部分 WebView 对 currentColor / filter 表现异常） */
.record-featured-btn--approved .record-featured-star-icon path {
  fill: #f59e0b;
  stroke: #ea580c;
  stroke-width: 0.35;
  stroke-linejoin: round;
}

/* 记录页：横向卡片（左图右文），绘画橙标 / 编辑紫标 */
body.page-records .records-page-card .history-list {
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 880px) {
  body.page-records .records-page-card .history-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.page-records .records-page-card .history-list .record-card--row {
  height: auto;
  min-height: 0;
  overflow: visible;
  display: grid;
  /* 左栏不加宽：增高只靠更竖的比例（见下方 aspect-ratio），文案区更宽 */
  grid-template-columns: clamp(88px, 22vw, 118px) minmax(0, 1fr);
  grid-template-rows: auto;
  gap: 12px 14px;
  align-items: stretch;
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  /* 收敛整张卡的 transition，避免点脚栏时与全局 .record-card 长动画叠加造成迟钝感 */
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

body.page-records .records-page-card .history-list .record-card--row .record-image {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  /* 固定栏宽下增高：竖图比例 2:3（宽:高），比 3:4 更高、不增加列宽 */
  aspect-ratio: 2 / 3;
  min-height: 0;
  border-radius: 12px;
  overflow: hidden;
  align-self: start;
}

@media (min-width: 880px) {
  body.page-records .records-page-card .history-list .record-card--row .record-image {
    aspect-ratio: 3 / 4;
  }
}

body.page-records .records-page-card .history-list .record-card--row .record-body {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  justify-content: flex-start;
}

/* 顶栏：标签一行；时间在下一行左对齐，与下方提示词同一垂线 */
body.page-records .record-card__top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

body.page-records .record-card__pills {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: none;
  width: 100%;
}

body.page-records .record-mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.15;
  border: 1px solid transparent;
  white-space: nowrap;
}

body.page-records .record-mode-pill--draw {
  border-color: rgba(234, 88, 12, 0.42);
  background: linear-gradient(180deg, #fff7ed, #ffedd5);
  color: #c2410c;
}

body.page-records .record-mode-pill--edit {
  border-color: rgba(147, 51, 234, 0.4);
  background: linear-gradient(180deg, #faf5ff, #f3e8ff);
  color: #7e22ce;
}

body.page-records .record-card--row .record-status-pill.status {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.15;
  border-radius: 999px;
  border: 1px solid transparent;
}

body.page-records .record-card--row .record-status-pill.status.succeeded {
  border-color: rgba(37, 99, 235, 0.32);
  background: rgba(239, 246, 255, 0.98);
  color: #1d4ed8;
}

body.page-records .record-card--row .record-status-pill.status.failed {
  border-color: #fecaca;
  background: var(--danger-soft);
  color: var(--danger);
}

body.page-records .record-card--row .record-status-pill.status.running,
body.page-records .record-card--row .record-status-pill.status.queued {
  border-color: rgba(37, 99, 235, 0.32);
  background: rgba(239, 246, 255, 0.98);
  color: #1d4ed8;
}

body.page-records .record-card--row .record-status-pill.status.deleted {
  border-color: var(--line-strong);
  background: #f2f4f7;
  color: var(--muted);
}

body.page-records .record-card__time {
  margin: 0;
  align-self: stretch;
  width: 100%;
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

body.page-records .records-page-card .history-list .record-card--row .record-body .record-prompt-snippet {
  margin: 0;
  padding-top: 0;
  font-size: 14px;
  font-weight: 650;
  color: #334155;
  line-height: 1.45;
  max-height: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.page-records .records-page-card .record-foot--records.record-foot--with-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  /* 与左侧缩略图底部对齐：占位顶满网格行后把按钮推到底 */
  margin-top: auto;
  padding-top: 0;
  isolation: isolate;
}

/*
 * 记录页横向卡：整卡不再随 hover/active 加重阴影（避免点「提交精选」时像误触整张卡片；触摸场景下子元素 hover 往往滞后，单靠 :has(脚栏) 覆盖面不足）。
 * 交互反馈集中在脚栏按钮（见下方 .record-featured-btn）。
 */
body.page-records .records-page-card .history-list .record-card--row:hover {
  transform: none !important;
  border-color: var(--line);
  background: #fff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

body.page-records .records-page-card .history-list .record-card--row:hover .record-image img {
  transform: none !important;
}

/* 按下脚栏内按钮的瞬间：强制保持与静态一致的阴影，避免继承全局 .history-list .record-card 的加重样式 */
body.page-records .records-page-card .history-list .record-card--row:has(.record-foot--records button:active) {
  transform: none !important;
  border-color: var(--line);
  background: #fff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

@media (max-width: 720px) {
  body.page-records .records-page-card .history-list .record-card--row:hover,
  body.page-records .records-page-card .history-list .record-card--row:has(.record-foot--records button:active) {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  }
}

body.page-records .records-page-card .record-foot--records .record-featured-btn {
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0;
  justify-content: center;
  min-height: 30px !important;
  padding: 0 10px !important;
  font-size: 11px !important;
  font-weight: 750 !important;
}

body.page-records .records-page-card .record-foot--records .record-featured-btn .record-featured-star-icon {
  width: 13px;
  height: 13px;
}

body.page-records .records-page-card .record-foot--records .record-featured-btn--approved .record-featured-star-icon {
  width: 14px;
  height: 14px;
}

body.page-records .records-page-card .record-foot--records .record-delete {
  flex: 0 0 auto;
  width: auto !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid #fecaca;
  font-size: 11px;
  font-weight: 750;
}

/* 记录页：未提交精选（提交精选 / 再次提交）——中性灰，与已通过琥珀色区分 */
body.page-records .records-page-card .record-featured-btn--idle {
  border-color: rgba(148, 163, 184, 0.55) !important;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9) !important;
  color: #64748b !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body.page-records .records-page-card .record-featured-btn--idle .record-featured-star-icon {
  color: #94a3b8;
}

body.page-records .records-page-card .record-featured-btn--idle:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.42) !important;
  background: linear-gradient(180deg, #eff6ff, #dbeafe) !important;
  color: #1e40af !important;
  box-shadow:
    0 0 0 2px rgba(37, 99, 235, 0.22),
    0 6px 16px rgba(37, 99, 235, 0.12);
}

body.page-records .records-page-card .record-featured-btn--idle:not(:disabled):hover .record-featured-star-icon {
  color: #2563eb;
}

body.page-records .records-page-card .record-featured-btn--idle:not(:disabled):focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(37, 99, 235, 0.35),
    0 4px 12px rgba(37, 99, 235, 0.14);
}

body.page-records .records-page-card .record-featured-btn--idle:not(:disabled):active {
  transform: translateY(0) scale(0.98);
  border-color: rgba(37, 99, 235, 0.5) !important;
  box-shadow:
    0 0 0 2px rgba(37, 99, 235, 0.28),
    0 2px 8px rgba(15, 23, 42, 0.08);
}

.record-delete {
  min-height: 28px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 0 9px;
  background: #fff;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.record-delete:hover {
  background: var(--danger-soft);
}

.history-empty-inline {
  grid-column: 1 / -1;
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed #b8c7dc;
  border-radius: var(--radius);
  color: var(--muted);
  background: #fbfdff;
  font-weight: 750;
}

.records-page-main {
  align-items: stretch;
  gap: 14px;
}

.records-page-card {
  margin-top: 0;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
}

body.page-records .records-page-card .card-head h2 {
  letter-spacing: -0.02em;
}

@media (max-width: 720px) {
  /* 记录列表底部与固定底栏之间的额外间距 */
  body.page-records .records-page-card .history-list {
    padding-bottom: 12px;
  }
}

/* Auth Pro (login/register page refresh) */
body.page-auth:has(.auth-pro-page) {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 14% 12%, rgba(56, 189, 248, 0.16), transparent 36%),
    radial-gradient(circle at 82% 88%, rgba(37, 99, 235, 0.08), transparent 32%),
    linear-gradient(180deg, #eef4fb 0%, #f5f8fd 38%, #f2f6fb 100%);
}

body.page-auth:has(.auth-pro-page) .app-shell {
  width: min(100% - 48px, 1180px);
  max-width: 1180px;
  min-height: 100vh;
  display: grid;
  align-content: center;
  padding: 30px 0;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.auth-pro-page {
  width: 100%;
}

.auth-pro-shell {
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(380px, 0.88fr);
  overflow: hidden;
  border: 1px solid #e4e9f1;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 26px 60px rgba(20, 43, 75, 0.12);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
  backdrop-filter: blur(12px) saturate(1.08);
}

.auth-pro-showcase {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(32px, 6vw, 58px);
  background:
    radial-gradient(circle at 18% 10%, rgba(56, 189, 248, 0.2), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(37, 99, 235, 0.08), transparent 32%),
    linear-gradient(180deg, #f0f8ff 0%, #eaf5ff 100%);
}

.auth-pro-brand {
  width: fit-content;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin-top: -20px;
  color: #101828;
  text-decoration: none;
}

.auth-pro-brand > span {
  display: grid;
  align-content: start;
  gap: 4px;
  padding-top: 0;
}

.auth-pro-mark {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.22) 0%, rgba(6, 182, 212, 0.18) 100%);
  box-shadow: 0 12px 24px rgba(var(--primary-rgb), 0.18);
}

.auth-pro-mark img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.auth-pro-mark svg {
  width: 42px;
  height: 42px;
}

.auth-pro-brand strong {
  display: block;
  font-size: 34px;
  font-weight: 900;
  line-height: 1.05;
}

.auth-pro-brand small {
  display: block;
  margin-top: 5px;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.auth-pro-tag {
  width: fit-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #d7e8f8;
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #3b82b1;
  font-size: 12px;
  font-weight: 760;
}

.auth-pro-showcase h1 {
  margin: 2px 0 0;
  color: #0f172a;
  font-size: clamp(40px, 4.3vw, 62px);
  font-weight: 920;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.auth-pro-showcase p {
  max-width: 600px;
  margin: 0;
  color: #475467;
  font-size: 17px;
  line-height: 1.72;
}

.auth-pro-metrics {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.auth-pro-metrics article {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid #dce6f3;
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.06);
}

.auth-pro-metrics strong {
  color: #0f172a;
  font-size: 18px;
  font-weight: 880;
}

.auth-pro-metrics span {
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.auth-pro-form-side {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(28px, 4vw, 42px);
  background: rgba(255, 255, 255, 0.9);
}

.auth-pro-mobile-brand {
  display: none;
}

.auth-pro-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  min-height: 54px;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  padding: 6px;
  background: #eef2f7;
}

.auth-pro-tabs a {
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #667085;
  font-size: 14px;
  font-weight: 780;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.22s ease, background-color 0.22s ease, color 0.22s ease;
}

.auth-pro-tabs a.active {
  color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.26);
}

.auth-pro-tabs a:not(.active):hover {
  color: #344054;
  background: rgba(255, 255, 255, 0.66);
}

.auth-pro-tabs a:hover {
  transform: translateY(-1px);
}

.auth-pro-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 42px;
  font-weight: 900;
}

.auth-pro-header p {
  margin: 8px 0 0;
  color: #667085;
  font-size: 15px;
  font-weight: 600;
}

.auth-pro-form {
  display: grid;
  gap: 12px;
}

.auth-pro-login-panel {
  display: grid;
  gap: 12px;
}

.auth-pro-login-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 0;
  flex-wrap: wrap;
}

.auth-pro-login-mode-link {
  border: 0;
  padding: 0;
  background: none;
  color: #0ea5e9;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.auth-pro-login-mode-link:hover {
  text-decoration: underline;
}

.auth-pro-login-bottom .auth-pro-switch {
  margin: 0;
  text-align: right;
}

.auth-pro-field {
  display: grid;
  gap: 7px;
}

.auth-pro-field span {
  color: #344054;
  font-size: 13px;
  font-weight: 760;
}

.auth-pro-field input {
  width: 100%;
  height: 50px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  padding: 0 14px;
  background: #eaf2ff;
  color: #101828;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.auth-pro-field input::placeholder {
  color: #98a2b3;
}

.auth-pro-field input:hover {
  border-color: #9ca3af;
}

.auth-pro-field input:focus {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

/* 验证码/短信行：单外框 + 柔分隔；左右同色系，避免「两块拼贴」感 */
.auth-pro-captcha-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 50px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  box-sizing: border-box;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.auth-pro-captcha-row:focus-within {
  border-color: #2563eb;
  background: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0 0 3px rgba(37, 99, 235, 0.14);
}

.auth-pro-captcha-row input {
  flex: 1 1 auto;
  min-width: 0;
  height: auto;
  min-height: 50px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding-left: 14px;
  padding-right: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-pro-captcha-row input:hover {
  border-color: transparent;
}

.auth-pro-captcha-row input:focus {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  outline: none;
}

.auth-pro-captcha-trigger {
  flex: 0 0 128px;
  width: 128px;
  min-height: 50px;
  height: auto;
  align-self: stretch;
  border: 0;
  border-left: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  box-shadow: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.auth-pro-captcha-trigger img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  background: #f8fafc;
}

.auth-pro-captcha-trigger:hover {
  background: linear-gradient(180deg, #f1f5f9 0%, #e8edf3 100%);
  border-left-color: rgba(100, 116, 139, 0.45);
}

.auth-pro-captcha-trigger:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: -2px;
  z-index: 1;
}

.auth-pro-check {
  min-height: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.auth-pro-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2563eb;
}

.auth-pro-check span {
  color: #475467;
  font-size: 13px;
  font-weight: 640;
}

.auth-pro-check a {
  color: #0284c7;
  font-weight: 780;
}

.auth-pro-check--muted span {
  font-size: 12px;
  font-weight: 520;
  color: #667085;
  line-height: 1.45;
}

.auth-pro-submit {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  margin-bottom: 10px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 860;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.24s ease, filter 0.2s ease;
}

.auth-pro-submit:hover {
  filter: brightness(1.02);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22);
}

.auth-pro-submit:active {
  transform: translateY(0) scale(0.988);
}

.auth-pro-submit::after {
  content: "";
  position: absolute;
  top: -45%;
  left: -32%;
  width: 28%;
  height: 190%;
  opacity: 0;
  transform: rotate(18deg);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.auth-pro-submit:hover::after {
  animation: authSubmitShine 0.72s ease;
}

body.page-auth.is-auth-switching .auth-pro-form-side,
body.page-auth.is-auth-switching .auth-pro-showcase {
  opacity: 0;
  transform: translateY(8px) scale(0.992);
  filter: blur(1px);
}

body.page-auth .auth-pro-form-side,
body.page-auth .auth-pro-showcase {
  transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.auth-pro-switch {
  margin: 2px 0 0;
  color: #667085;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.auth-pro-switch a {
  color: #0ea5e9;
  font-weight: 840;
}

@media (max-width: 980px) {
  body.page-auth:has(.auth-pro-page) .app-shell {
    width: min(100% - 24px, 920px);
    align-content: start;
    padding: 16px 0 22px;
    min-height: 100dvh;
    margin-left: auto;
    margin-right: auto;
  }

  .auth-pro-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .auth-pro-showcase {
    padding: 22px 22px 20px;
    gap: 12px;
  }

  .auth-pro-showcase h1 {
    font-size: clamp(30px, 6.5vw, 48px);
  }

  .auth-pro-showcase p {
    font-size: 14px;
    line-height: 1.55;
  }

  .auth-pro-metrics {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .auth-pro-metrics article {
    min-height: 0;
    padding: 12px;
  }

  .auth-pro-form-side {
    padding: 20px 20px 18px;
    gap: 14px;
  }

  .auth-pro-header h2 {
    font-size: clamp(28px, 5vw, 36px);
  }

  .auth-pro-header p {
    font-size: 14px;
  }
}

@media (max-width: 720px) {
  body.page-auth:has(.auth-pro-page) .app-shell {
    width: min(100% - 40px, 336px);
    max-width: 336px;
    min-height: 100dvh;
    padding: max(12px, env(safe-area-inset-top, 0px)) 0 max(16px, env(safe-area-inset-bottom, 0px));
    align-content: center;
    justify-items: stretch;
    margin-left: auto;
    margin-right: auto;
  }

  .auth-pro-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(20, 43, 75, 0.09);
  }

  .auth-pro-showcase {
    display: none;
  }

  .auth-pro-form-side {
    gap: 10px;
    padding: 14px 14px 12px;
    background: #fff;
  }

  .auth-pro-mobile-brand {
    width: fit-content;
    display: inline-grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    justify-self: center;
    margin: 0 auto 2px;
    gap: 8px;
    color: #101828;
    text-decoration: none;
  }

  .auth-pro-mobile-brand .auth-pro-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .auth-pro-mobile-brand span {
    color: #0f172a;
    font-size: 16px;
    font-weight: 850;
    line-height: 1.15;
  }

  .auth-pro-tabs {
    min-height: 48px;
    padding: 4px;
    border-radius: 12px;
  }

  .auth-pro-tabs a {
    min-height: 40px;
    font-size: 13px;
    border-radius: 9px;
  }

  .auth-pro-header h2 {
    font-size: clamp(22px, 5.2vw, 26px);
    font-weight: 880;
    letter-spacing: -0.02em;
  }

  .auth-pro-header p {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 600;
  }

  .auth-pro-form {
    gap: 10px;
  }

  .auth-pro-login-panel {
    gap: 10px;
  }

  .auth-pro-field {
    gap: 5px;
  }

  .auth-pro-field span {
    font-size: 12px;
  }

  .auth-pro-field input {
    height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 16px;
  }

  .auth-pro-captcha-row {
    min-height: 44px;
    border-radius: 10px;
  }

  .auth-pro-captcha-row input {
    min-height: 44px;
    height: 44px;
    padding-left: 12px;
    padding-right: 8px;
  }

  .auth-pro-captcha-trigger {
    flex: 0 0 108px;
    width: 108px;
    min-height: 44px;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.15;
    padding: 0 4px;
  }

  .auth-pro-captcha-trigger img {
    object-fit: contain;
  }

  .auth-pro-check {
    min-height: 22px;
    padding: 0;
    gap: 6px;
  }

  .auth-pro-check span {
    font-size: 11.5px;
    line-height: 1.4;
  }

  .auth-pro-submit {
    min-height: 48px;
    margin-top: 2px;
    margin-bottom: 6px;
    border-radius: 11px;
    font-size: 15px;
  }

  .auth-pro-login-bottom {
    margin-top: 0;
    gap: 8px;
  }

  .auth-pro-login-mode-link {
    font-size: 12px;
  }

  .auth-pro-switch {
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  body.page-auth:has(.auth-pro-page) .app-shell {
    width: min(100% - 36px, 336px);
    max-width: 336px;
    min-height: 100dvh;
    padding: max(10px, env(safe-area-inset-top, 0px)) 0 max(14px, env(safe-area-inset-bottom, 0px));
    align-content: center;
    justify-items: stretch;
    margin-left: auto;
    margin-right: auto;
  }

  .auth-pro-shell {
    border-radius: 12px;
  }

  .auth-pro-form-side {
    padding: 12px 12px 10px;
    gap: 9px;
  }

  .auth-pro-header h2 {
    font-size: 21px;
  }

  .auth-pro-header p {
    font-size: 12.5px;
  }
}

@keyframes authSubmitShine {
  from {
    left: -32%;
    opacity: 0;
  }

  18% {
    opacity: 1;
  }

  to {
    left: 122%;
    opacity: 0;
  }
}

/* Policy pages */
.policy-page {
  width: min(860px, 100%);
  margin: 0 auto;
}

.policy-card {
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  padding: clamp(20px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
}

.policy-card h1 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 900;
  color: #0f172a;
}

.policy-updated {
  margin: 0 0 16px;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.policy-card h2 {
  margin: 20px 0 8px;
  font-size: 18px;
  font-weight: 850;
  color: #111827;
}

.policy-card p,
.policy-card li {
  color: #475467;
  font-size: 14px;
  line-height: 1.75;
}

.policy-card ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.policy-back {
  margin-top: 20px;
  text-align: right;
}

.grid.help-center-page {
  max-width: min(680px, 100%);
  margin-inline: auto;
  gap: 14px;
}

.help-center-hero .card-head {
  margin-bottom: 2px;
}

.help-intro {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.9);
  color: #475569;
  font-size: 14px;
  line-height: 1.65;
}

.help-intro a {
  font-weight: 750;
  color: #2563eb;
  text-decoration: none;
}

.help-intro a:hover {
  text-decoration: underline;
}

.help-toc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.help-toc a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  font-weight: 750;
  font-size: 14px;
  color: #1d4ed8;
  text-decoration: none;
  text-align: center;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
}

.help-toc a:active {
  background: rgba(239, 246, 255, 0.95);
}

.help-faq-block {
  font-size: 15px;
  line-height: 1.68;
  color: #334155;
}

.help-faq-block > p:first-child,
.help-faq-block > .inline-message:first-child {
  margin-top: 0;
}

.help-faq-block > p:last-child {
  margin-bottom: 0;
}

.help-lead {
  margin: 0 0 12px;
}

.help-footnote {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.help-actions {
  margin-top: 14px;
  margin-bottom: 0;
}

.help-faq-block .help-list {
  margin: 10px 0 0;
  padding-left: 1.15em;
  line-height: 1.65;
  color: #475569;
}

.help-faq-block .help-list.help-list--tight-top {
  margin-top: 4px;
}

.help-faq-block .help-list li {
  margin-bottom: 12px;
  padding-left: 0.15em;
}

.help-faq-block .help-list li:last-child {
  margin-bottom: 0;
}

body.page-help #faq-realname,
body.page-help #faq-credits,
body.page-help #faq-invite,
body.page-help #faq-ai-label {
  scroll-margin-top: 96px;
}

.grid.help-center-page > .section-card:first-child {
  margin-top: 0;
}

@media (max-width: 720px) {
  body.page-help .grid.help-center-page {
    gap: 12px;
  }

  body.page-help .card {
    padding: 16px 14px;
  }

  body.page-help .card-head h2 {
    font-size: 17px;
    line-height: 1.25;
  }

  body.page-help .help-intro {
    margin-bottom: 12px;
    padding: 10px 12px;
    font-size: 14px;
  }

  body.page-help .help-toc {
    gap: 8px;
  }

  body.page-help .help-toc a {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 13px;
  }

  body.page-help .help-faq-block {
    font-size: 14px;
  }

  body.page-help .help-footnote {
    font-size: 12px;
  }
}

.legal-pages-form .legal-pages-textarea {
  width: 100%;
  min-height: 280px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
}

.policy-back a {
  color: #0ea5e9;
  font-weight: 800;
  text-decoration: none;
}

/* Recharge page */
.recharge-wrap {
  min-height: calc(100vh - 170px);
}

.recharge-page {
  padding: 16px 12px 40px;
}

.recharge-shell {
  width: min(440px, 100%);
  margin: 0 auto;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.98);
  background: #fff;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 20px 50px rgba(15, 23, 42, 0.1);
  overflow: hidden;
}

.recharge-shell-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 14px;
  padding: 14px 18px 14px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 52%, #0f172a 100%);
  color: #f8fafc;
}

.recharge-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.2;
}

.recharge-wallet {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  border-radius: 10px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  text-align: right;
  min-width: 0;
}

.recharge-wallet-label {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.78;
  white-space: nowrap;
}

.recharge-wallet-num {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
}

.recharge-alert {
  margin: 16px 22px 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.recharge-alert--warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

/* 关闭在线充值时：不出现「支付」字样；主提示放大；兑换入口为大按钮 */
.recharge-alert--offline {
  display: grid;
  gap: 16px;
  margin: 16px 22px 0;
  padding: 18px 16px 20px;
  border-radius: 14px;
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #334155;
}

.recharge-offline-hint-main {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.5;
  color: #0f172a;
  letter-spacing: -0.02em;
}

a.recharge-redeem-cta.button.primary {
  display: inline-flex;
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  min-height: 50px;
  padding: 0 18px;
  font-size: 16px;
  font-weight: 850;
  text-decoration: none;
  border-radius: 14px;
}

.recharge-checkout {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.recharge-field {
  display: grid;
  gap: 8px;
}

.recharge-field-label {
  font-size: 13px;
  font-weight: 750;
  color: #475569;
}

.recharge-select-wrap {
  position: relative;
}

.recharge-select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  pointer-events: none;
  opacity: 0.85;
}

.recharge-select {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font-size: 15px;
  font-weight: 650;
  background: #fff;
  color: #0f172a;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.recharge-select:hover:not(:disabled) {
  border-color: #94a3b8;
}

.recharge-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.recharge-select:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.recharge-offer-card {
  border-radius: 16px;
  padding: 18px 18px 16px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 55%);
}

.recharge-offer-metrics {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0 14px;
  align-items: stretch;
}

.recharge-offer-sep {
  width: 1px;
  background: linear-gradient(180deg, transparent, #e2e8f0 12%, #e2e8f0 88%, transparent);
  align-self: stretch;
  min-height: 56px;
}

.recharge-offer-block-label {
  display: block;
  font-size: 11px;
  font-weight: 750;
  color: #64748b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.recharge-offer-price {
  margin-top: 6px;
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.1;
}

.recharge-offer-credits {
  margin-top: 6px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.recharge-offer-credits-num {
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #1d4ed8;
  line-height: 1.1;
}

.recharge-offer-credits-unit {
  font-size: 14px;
  font-weight: 750;
  color: #64748b;
}

.recharge-offer-name {
  margin: 16px 0 0;
  font-size: 1.08rem;
  font-weight: 850;
  color: #0f172a;
}

.recharge-offer-desc {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: #64748b;
}

.recharge-pay-block {
  display: grid;
  gap: 10px;
}

.recharge-pay-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  font-weight: 850;
}

.recharge-pay-btn-inner {
  display: block;
  text-align: center;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}

.recharge-footnote {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #94a3b8;
  text-align: center;
}

@media (max-width: 520px) {
  .recharge-shell-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .recharge-wallet {
    flex: 0 1 auto;
    margin-left: auto;
  }
}

@media (max-width: 360px) {
  .recharge-pay-btn-inner {
    font-size: 14px;
  }
}

@media (max-width: 400px) {
  .recharge-offer-metrics {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .recharge-offer-sep {
    display: none;
  }
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.pagination > span {
  color: var(--muted);
  font-weight: 750;
}

.pagination-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  line-height: 1.35;
}

.pagination-summary .pagination-count {
  font-size: 12px;
  font-weight: 650;
  opacity: 0.88;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.admin-nav-shell {
  margin-bottom: 16px;
}

.admin-nav-shell .admin-nav {
  margin-bottom: 0;
}

.admin-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 0;
}

.admin-nav-toggle-icon {
  display: inline-flex;
  line-height: 0;
}

.admin-nav-toggle-text {
  font-weight: 780;
}

.admin-nav-links .admin-nav-account-link:first-of-type {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.admin-nav-drawer {
  position: relative;
}

.admin-nav-drawer-backdrop {
  display: none;
}

.admin-nav-drawer-head {
  display: none;
}

.admin-nav-drawer-panel {
  position: relative;
}

.admin-nav-drawer-close {
  display: none;
}

/* 管理后台：左侧导航 + 右侧操作区（桌面）；手机仍为抽屉 */
.admin-layout {
  display: grid;
  grid-template-columns: minmax(220px, 268px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 8px;
}

.admin-layout-main {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.admin-layout-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 12px;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  align-self: start;
  position: sticky;
  top: 96px;
}

.admin-layout-sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-layout-sidebar-title {
  font-size: 17px;
  font-weight: 850;
  color: var(--text);
  text-decoration: none;
  line-height: 1.25;
}

.admin-layout-sidebar-title:hover {
  color: var(--primary);
}

.admin-layout-sidebar-sub {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  line-height: 1.3;
}

.admin-layout-sidebar-brand-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.admin-layout-sidebar-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-layout-sidebar-platform {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-layout-sidebar-brand-main:hover .admin-layout-sidebar-platform {
  color: var(--primary);
}

.admin-layout-sidebar .admin-nav-shell {
  margin-bottom: 0;
}

.admin-layout-sidebar .admin-nav.admin-nav-links {
  margin-bottom: 0;
  border: 0;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.admin-layout-main .admin-version-footer {
  margin-top: 28px;
  padding-bottom: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 16px;
}

.stat-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 30px;
  line-height: 1.1;
}

/* 后台数据看板：指标统一在同一卡片内分区展示 */
.admin-dash-metrics-unified .card-head {
  align-items: flex-start;
}

.admin-dash-card-lead {
  margin: 8px 0 0;
  max-width: 52ch;
}

.admin-reg-stat-date-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.admin-reg-stat-date-field span {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
}

.admin-reg-stat-date-field input[type="date"] {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  color: #262626;
  background: #fff;
}

.admin-dash-kpi-stack {
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

.admin-dash-kpi-block {
  padding: 18px 0 0;
  margin-top: 16px;
  border-top: 1px solid rgba(226, 232, 240, 0.95);
}

.admin-dash-kpi-block:first-child {
  margin-top: 0;
  padding-top: 4px;
  border-top: 0;
}

.admin-dash-kpi-block-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.admin-dash-kpi-block-sub {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  color: #94a3b8;
}

.admin-dash-kpi-block--last {
  padding-bottom: 2px;
}

body.page-admin .admin-dash-stat-grid .admin-dash-stat-card--with-foot strong {
  margin-top: 8px;
  padding-top: 0;
}

body.page-admin .admin-dash-stat-grid .stat-card .admin-dash-stat-card-hint {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.4;
  color: #94a3b8;
  font-weight: 600;
}

body.page-admin .admin-dash-stat-grid.stats-grid {
  grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

body.page-admin .admin-dash-stat-grid--dense.stats-grid {
  gap: 11px;
}

.admin-dash-metrics-unified .admin-dash-stat-grid.stats-grid {
  margin-bottom: 0;
}

body.page-admin .admin-dash-stat-grid .stat-card {
  display: flex;
  flex-direction: column;
  min-height: 102px;
  padding: 14px 13px 13px;
  border-radius: 12px;
  border: 1px solid #ebeef3;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.page-admin .admin-dash-stat-grid .stat-card:hover {
  border-color: #dce3ee;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.055);
}

body.page-admin .admin-dash-stat-grid .stat-card span {
  font-size: 12px;
  font-weight: 760;
  color: #64748b;
  line-height: 1.35;
}

body.page-admin .admin-dash-stat-grid .stat-card strong {
  margin-top: auto;
  padding-top: 10px;
  font-size: 23px;
  font-weight: 880;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.admin-reg-stat-card-head {
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.admin-reg-stat-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.admin-reg-stat-bar .field {
  margin: 0;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

body.page-admin .table-wrap {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

body.page-admin .table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

body.page-admin .table-wrap table,
body.page-admin .table-scroll table {
  width: max-content;
  min-width: 100%;
  max-width: none;
  table-layout: auto;
}

body.page-admin .table-wrap th,
body.page-admin .table-wrap td,
body.page-admin .table-scroll th,
body.page-admin .table-scroll td {
  overflow: visible;
  text-overflow: clip;
  max-width: none;
}

/* 管理后台 · 生成记录表：整表不随提示词撑出视口，提示词列省略号（操作列留在屏内） */
body.page-admin .table-wrap table[data-admin-records] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}

body.page-admin .table-wrap table[data-admin-records] td.admin-prompt-cell,
body.page-admin .table-wrap table[data-admin-records] th:nth-child(7) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* 管理后台 · 精选审核：提示词 2 行省略（悬停 title 看全文），避免长文案撑乱表格 */
body.page-admin .table-wrap table[data-admin-featured] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}

body.page-admin .table-wrap table[data-admin-featured] td.admin-featured-prompt-cell {
  min-width: 0;
  vertical-align: top;
}

body.page-admin .table-wrap table[data-admin-featured] .admin-featured-prompt-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
  font-size: 13px;
  color: var(--text-soft);
}

body.page-admin .admin-users-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

body.page-admin .admin-users-table-wrap .admin-users-unified-table {
  width: max-content;
  min-width: 100%;
  max-width: none;
  table-layout: auto;
}

body.page-admin .admin-users-table-wrap .admin-users-unified-table th,
body.page-admin .admin-users-table-wrap .admin-users-unified-table td {
  overflow: visible;
  text-overflow: clip;
  max-width: none;
}

.admin-table-scroll-hint {
  display: none;
}

@media (max-width: 720px) {
  body.page-admin .admin-table-scroll-hint {
    display: block;
    margin: 0 0 10px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 750;
    color: var(--muted);
    line-height: 1.45;
    border-radius: 10px;
    border: 1px dashed rgba(var(--primary-rgb), 0.3);
    background: rgba(var(--primary-rgb), 0.06);
  }
}

table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom-color: #dfe5ec;
  background: #f9fafb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 860;
  letter-spacing: 0;
  white-space: nowrap;
}

tbody tr {
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

tbody tr:hover td {
  background: #fbfdff;
}

tr.is-deleted td {
  background: #fafafa;
  color: var(--muted);
}

tr.is-deleted:hover td {
  background: #f6f6f6;
}

[data-admin-records] th,
[data-admin-users] th,
[data-admin-codes] th {
  text-transform: none;
}

[data-admin-records] {
  min-width: 0;
}

[data-admin-records] th:nth-child(1),
[data-admin-records] td:nth-child(1) {
  width: 64px;
  text-align: center;
}

[data-admin-records] th:nth-child(2),
[data-admin-records] td:nth-child(2) {
  width: 110px;
}

[data-admin-records] th:nth-child(3),
[data-admin-records] td:nth-child(3) {
  width: 92px;
}

[data-admin-records] th:nth-child(4),
[data-admin-records] td:nth-child(4) {
  width: 130px;
}

[data-admin-records] th:nth-child(5),
[data-admin-records] td:nth-child(5) {
  width: 88px;
}

[data-admin-records] th:nth-child(6),
[data-admin-records] td:nth-child(6) {
  width: 92px;
}

[data-admin-records] th:nth-child(8),
[data-admin-records] td:nth-child(8) {
  width: 176px;
}

[data-admin-records] th:nth-child(9),
[data-admin-records] td:nth-child(9) {
  width: 150px;
}

/* 用户管理：统一卡片表格，占满容器宽度 */
[data-admin-users].admin-users-unified-table {
  min-width: 0;
  width: 100%;
}

[data-admin-users].admin-users-unified-table th:first-child,
[data-admin-users].admin-users-unified-table td:first-child {
  width: 100%;
}

[data-admin-codes] {
  min-width: 1160px;
}

[data-admin-codes] th:nth-child(1),
[data-admin-codes] td:nth-child(1) {
  width: 230px;
}

[data-admin-codes] th:nth-child(2),
[data-admin-codes] td:nth-child(2),
[data-admin-codes] th:nth-child(3),
[data-admin-codes] td:nth-child(3),
[data-admin-codes] th:nth-child(4),
[data-admin-codes] td:nth-child(4),
[data-admin-codes] th:nth-child(5),
[data-admin-codes] td:nth-child(5) {
  width: 96px;
}

[data-admin-codes] th:nth-child(6),
[data-admin-codes] td:nth-child(6),
[data-admin-codes] th:nth-child(8),
[data-admin-codes] td:nth-child(8) {
  width: 170px;
}

[data-admin-codes] th:nth-child(7),
[data-admin-codes] td:nth-child(7) {
  width: 120px;
}

[data-admin-codes] th:nth-child(9),
[data-admin-codes] td:nth-child(9) {
  width: 150px;
}

.admin-prompt-cell {
  color: var(--text-soft);
  max-width: 360px;
  line-height: 1.45;
}

.admin-record-row td {
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-cell {
  max-width: 130px;
  font-weight: 750;
}

.table-primary-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-muted-cell {
  color: var(--muted);
}

.admin-record-id-cell {
  line-height: 1.35;
}

.admin-record-id {
  display: inline-block;
  color: var(--text);
  font-weight: 850;
}

.admin-record-id-cell .status {
  margin-top: 5px;
}

.table-check-cell input,
[data-check-all-records] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

.admin-number-cell {
  color: #344054;
  font-variant-numeric: tabular-nums;
}

.admin-number-cell strong {
  color: var(--text);
  font-weight: 880;
}

.admin-table-actions {
  overflow: visible;
}

.admin-table-actions>.button,
.admin-table-actions>.inline-delete-form,
.admin-table-actions>.table-action-group {
  vertical-align: middle;
}

.deleted-time {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.table-thumb {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.table-thumb:hover {
  border-color: rgba(var(--primary-rgb), 0.35);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.table-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inline-delete-form {
  display: inline-flex;
  margin: 0 0 0 6px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  border: 1px solid #eef2f6;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

.filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.filter-bar.admin-record-filter {
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 150px) minmax(130px, 160px) auto;
}

.filter-bar.admin-user-filter {
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
}

.filter-bar.admin-orders-filter {
  grid-template-columns: minmax(130px, 150px) repeat(2, minmax(0, 1fr)) minmax(0, 1fr) auto;
  gap: 12px 14px;
  align-items: end;
}

@media (max-width: 1100px) {
  .filter-bar.admin-orders-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  }
}

@media (max-width: 640px) {
  .filter-bar.admin-orders-filter {
    grid-template-columns: 1fr;
  }

  .filter-bar.admin-orders-filter .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.admin-orders-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line, #e4e7ec);
  border-radius: 10px;
  background: #f8fafc;
}

.admin-orders-export-form {
  margin-top: 4px;
}

.admin-orders-table .admin-orders-check-col {
  width: 40px;
  text-align: center;
  vertical-align: middle;
}

.admin-orders-table .admin-orders-check-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* 用户管理：单行统一卡片，信息集中、操作横向排列 */
.admin-users-table-wrap .admin-users-unified-table {
  table-layout: fixed;
}

.admin-users-unified-table thead th {
  text-align: left;
  font-weight: 750;
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.admin-users-unified-td {
  padding: 10px 12px !important;
  vertical-align: middle;
}

.admin-users-unified-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
  padding: 10px 14px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

tr.is-deleted .admin-users-unified-card {
  opacity: 0.72;
  background: #f8fafc;
}

.admin-users-unified-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex-shrink: 0;
  min-width: 0;
}

.admin-users-unified-phone {
  font-size: 13px;
  color: var(--muted);
  font-weight: 650;
}

.admin-users-unified-badges {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.admin-users-unified-stats {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.admin-users-stat {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 0;
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid #eef2f6;
}

.admin-users-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.admin-users-stat-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  font-size: 14px;
}

.admin-users-unified-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 8px;
  border-left: 1px dashed rgba(148, 163, 184, 0.45);
}

.admin-users-unified-actions .inline-admin-form {
  flex-wrap: nowrap;
}

.admin-users-realname-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.admin-users-realname-inline .admin-users-realname-select {
  min-width: 92px;
  max-width: 120px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  background: #fff;
}

@media (max-width: 900px) {
  .admin-users-unified-card {
    align-items: flex-start;
  }

  .admin-users-unified-badges {
    flex-wrap: wrap;
  }
}

/* 管理后台：手机端抽屉导航 */
@media (max-width: 768px) {
  .admin-nav-shell {
    margin-bottom: 12px;
  }

  .admin-nav-toggle {
    display: inline-flex;
  }

  body.page-admin .admin-nav-shell > .admin-nav-toggle {
    display: none !important;
  }

  body.page-admin .site-header {
    position: relative;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
  }

  body.page-admin .site-header .site-brand {
    grid-column: 1;
    grid-row: 1;
  }

  body.page-admin .site-header .site-nav,
  body.page-admin .site-header .site-actions {
    display: none !important;
  }

  body.page-admin .site-header .site-menu-button {
    display: grid !important;
    place-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
    cursor: pointer;
  }

  body.page-admin .site-header .site-menu-button span {
    width: 18px;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: var(--text);
    transition: transform 0.18s ease, opacity 0.18s ease;
  }

  body.page-admin .site-header.is-menu-open .site-menu-button span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.page-admin .site-header.is-menu-open .site-menu-button span:nth-child(2) {
    opacity: 0;
  }

  body.page-admin .site-header.is-menu-open .site-menu-button span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .admin-nav-drawer {
    position: fixed;
    inset: 0;
    z-index: 10070;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0.3s linear;
  }

  .admin-nav-shell.is-open .admin-nav-drawer {
    pointer-events: auto;
    visibility: visible;
  }

  .admin-nav-drawer-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .admin-nav-shell.is-open .admin-nav-drawer-backdrop {
    opacity: 1;
  }

  .admin-nav-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 12px 14px 16px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    background: #fff;
  }

  .admin-nav-drawer-title {
    font-weight: 850;
    font-size: 16px;
    color: var(--text);
  }

  .admin-nav-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -6px -4px -6px 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
  }

  .admin-nav-drawer-close:hover {
    background: rgba(148, 163, 184, 0.16);
  }

  .admin-nav-drawer-panel {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    width: min(88vw, 300px);
    height: 100%;
    max-height: 100%;
    background: #fff;
    box-shadow: 8px 0 36px rgba(15, 23, 42, 0.2);
    transform: translateX(-105%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
  }

  .admin-nav-shell.is-open .admin-nav-drawer-panel {
    transform: translateX(0);
  }

  .admin-nav-shell .admin-nav.admin-nav-links {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    margin: 0;
    margin-bottom: 0;
    padding: 12px 12px 24px;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .admin-nav-shell .admin-nav-links .button {
    width: 100%;
    justify-content: flex-start;
    flex-shrink: 0;
    white-space: normal;
    text-align: left;
    min-height: 44px;
  }

  .admin-nav-shell .admin-nav-links .admin-nav-link {
    width: 100%;
    min-height: 44px;
  }

  body.page-admin .admin-layout {
    grid-template-columns: 1fr;
    /* 1fr 在多数引擎中等价于 minmax(auto,1fr)，第二行最小高度=子项内容高，会撑破视口且 main 无法出现滚动条 */
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
    min-height: 0;
  }

  body.page-admin .admin-layout-sidebar {
    position: static;
    top: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    gap: 0;
  }

  body.page-admin .admin-layout-sidebar-brand {
    display: none;
  }

  body.page-admin .admin-layout {
    height: 100%;
    max-height: 100%;
  }

  body.page-admin .admin-layout-workspace {
    min-width: 0;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  body.page-admin .admin-layout-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  body.page-admin .admin-layout-main > .grid {
    min-height: 0;
  }
}

@media (min-width: 769px) {
  .admin-nav-shell .admin-nav-toggle {
    display: none !important;
  }

  .admin-nav-shell .admin-nav-drawer-head {
    display: none !important;
  }

  .admin-nav-shell .admin-nav-drawer-close {
    display: none !important;
  }

  .admin-nav-shell .admin-nav-drawer {
    position: relative;
    z-index: auto;
    pointer-events: auto;
    visibility: visible;
  }

  .admin-nav-shell .admin-nav-drawer-backdrop {
    display: none !important;
  }

  .admin-nav-shell .admin-nav-drawer-panel {
    position: static;
    width: auto;
    height: auto;
    max-height: none;
    transform: none !important;
    box-shadow: none;
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .admin-layout-sidebar .admin-nav-shell .admin-nav.admin-nav-links {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow-x: visible;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 0;
    gap: 4px;
    flex: 0 0 auto;
    max-height: none;
  }

  .admin-layout-sidebar .admin-nav-shell .admin-nav.admin-nav-links::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .admin-layout-sidebar .admin-nav-shell .admin-nav-links .admin-nav-link {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
    min-height: 40px;
  }

  .admin-layout-sidebar .admin-nav-shell .admin-nav-links .admin-nav-link.active {
    background: #fff;
    color: var(--admin-sidebar-nav-active-fg, #0958d9);
    font-weight: 750;
    box-shadow:
      inset 3px 0 0 #1677ff,
      0 2px 8px rgba(0, 40, 80, 0.12);
  }
}

/* ========== 管理后台：Pro 壳（蓝色侧栏 + 顶栏 + 灰主区）========== */
html:has(body.page-admin) {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.page-admin {
  --primary: #1890ff;
  --primary-dark: #096dd9;
  --primary-soft: #e6f7ff;
  --primary-rgb: 24, 144, 255;
  /* 与登录页 `.auth-pro-submit` 一致：135° 蓝→青，比纯 Ant 蓝侧栏更柔和 */
  --admin-sidebar-bg: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  --admin-sidebar-border: rgba(255, 255, 255, 0.22);
  --admin-sidebar-nav-active-fg: #0958d9;
  --admin-sidebar-nav-active-icon: #1677ff;
  --admin-main-bg: #f0f2f5;
  --brand-gradient: linear-gradient(135deg, #096dd9 0%, #1890ff 50%, #40a9ff 100%);
  background: var(--admin-main-bg);
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 一屏布局：仅主内容区滚动，侧栏与顶栏固定 */
body.page-admin .app-shell {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

body.page-admin .admin-layout {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/*
 * 少数页面把整块 admin-layout 包在 app-shell 下一层的 .grid 里。
 * 该包装层默认高度随内容增高，会使内部 main 无法形成「定高 + overflow」从而无法纵向滚动。
 */
body.page-admin .app-shell > .grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

body.page-admin .app-shell > .grid > .admin-layout {
  min-height: 0;
}

body.page-admin .admin-layout-workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

body.page-admin .admin-layout-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

body.page-admin .admin-topbar {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
  min-height: 56px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

body.page-admin .admin-topbar-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

body.page-admin .admin-topbar-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #262626;
}

body.page-admin .admin-topbar-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body.page-admin .admin-topbar-title-text {
  font-size: 16px;
  font-weight: 750;
  color: #262626;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.page-admin .admin-topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

body.page-admin .admin-topbar-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
}

body.page-admin .admin-topbar-user-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

body.page-admin .admin-topbar-user-name {
  font-size: 14px;
  font-weight: 800;
  color: #262626;
  line-height: 1.2;
}

body.page-admin .admin-topbar-user-role {
  font-size: 12px;
  font-weight: 600;
  color: #8c8c8c;
  line-height: 1.2;
}

body.page-admin .admin-topbar-user-home {
  margin-left: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #d9d9d9;
  background: #fff;
  font-size: 12px;
  font-weight: 750;
  color: #595959;
  text-decoration: none;
  white-space: nowrap;
}

body.page-admin .admin-topbar-user-home:hover {
  border-color: #1890ff;
  color: #1890ff;
}

body.page-admin .admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

body.page-admin .admin-nav-link-icon {
  display: inline-flex;
  flex-shrink: 0;
  opacity: 0.9;
}

body.page-admin .admin-nav-link-text {
  flex: 1;
  min-width: 0;
  text-align: left;
}

body.page-admin .admin-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

body.page-admin .admin-nav-group-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 6px;
  font-size: 12px;
  font-weight: 750;
  color: var(--muted, #64748b);
  user-select: none;
}

body.page-admin .admin-nav-group-title {
  flex: 1;
  min-width: 0;
  text-align: left;
  line-height: 1.2;
}

body.page-admin .admin-nav-link--sub {
  padding-left: 4px;
}

body.page-admin .admin-nav-link-icon--sub {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
}

body.page-admin .admin-nav-link-icon--sub::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.announcements-feed {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.announcements-feed-item {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line, #e5e7eb);
}

.announcements-feed-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.announcements-feed-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
}

.announcements-feed-meta {
  margin: 0 0 10px;
  font-size: 12px;
}

.announcements-feed-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.announcements-feed-body p {
  margin: 0 0 0.65em;
}

@media (min-width: 769px) {
  body.page-admin .app-shell {
    padding: 0;
  }

  body.page-admin .admin-layout {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    margin: 0;
    max-width: 100%;
    border-radius: 0;
    border: none;
    background: var(--admin-main-bg);
    box-shadow: none;
  }

  body.page-admin .admin-layout-sidebar {
    position: sticky;
    top: 0;
    align-self: stretch;
    min-height: 0;
    height: 100%;
    max-height: none;
    overflow-x: hidden;
    /* 菜单项一屏可展示完时不需要侧栏内滚动条；主内容区 .admin-layout-main 仍可滚动 */
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 8px;
    padding: 16px 12px 20px;
    border: 0;
    border-radius: 0;
    border-right: 1px solid var(--admin-sidebar-border);
    background: var(--admin-sidebar-bg);
    box-shadow: inset -1px 0 0 rgba(0, 40, 100, 0.12);
  }

  body.page-admin .admin-layout-sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  body.page-admin .admin-layout-sidebar-brand {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 16px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--admin-sidebar-border);
  }

  body.page-admin .admin-layout-sidebar-brand-main {
    flex: 1;
    min-width: 0;
  }

  body.page-admin .admin-layout-sidebar-brand-main:hover .admin-layout-sidebar-platform {
    color: #bae0ff;
  }

  body.page-admin .admin-layout-sidebar-mark.brand-mark {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  }

  body.page-admin .admin-layout-sidebar-mark.brand-mark svg {
    width: 26px;
    height: 26px;
  }

  body.page-admin .admin-layout-sidebar-platform {
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.02em;
  }

  body.page-admin .admin-layout-sidebar-sub {
    display: block;
    font-size: 11px;
    font-weight: 650;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.25;
  }

  body.page-admin .admin-layout-sidebar-brand-main:hover .admin-layout-sidebar-sub {
    color: rgba(255, 255, 255, 0.72);
  }

  body.page-admin .admin-layout-sidebar .admin-nav-shell {
    flex: 0 0 auto;
    margin-top: 0;
    margin-bottom: 0;
    overflow: visible;
  }

  body.page-admin .admin-layout-sidebar .admin-nav-drawer,
  body.page-admin .admin-layout-sidebar .admin-nav-drawer-panel {
    overflow: visible;
    max-height: none;
  }

  body.page-admin .admin-layout-workspace {
    /* 与全局 min-height:0 一致，避免强制 ≥100vh 撑破网格行导致主区域无法出现滚动条 */
    min-height: 0;
    background: var(--admin-main-bg);
  }

  body.page-admin .admin-layout-sidebar .admin-nav-links .admin-nav-account-link:first-of-type {
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    margin-top: 12px;
    padding-top: 12px;
  }

  body.page-admin .admin-layout-sidebar .admin-nav-shell .admin-nav.admin-nav-links {
    gap: 4px;
    overflow-x: visible;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 0 0 auto;
    max-height: none;
  }

  body.page-admin .admin-layout-sidebar .admin-nav-shell .admin-nav.admin-nav-links::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  body.page-admin .admin-layout-sidebar .admin-nav-shell .admin-nav-links .admin-nav-link {
    color: rgba(255, 255, 255, 0.92);
    min-height: 42px;
  }

  body.page-admin .admin-layout-sidebar .admin-nav-shell .admin-nav-links .admin-nav-link-icon {
    color: rgba(255, 255, 255, 0.72);
  }

  body.page-admin .admin-layout-sidebar .admin-nav-shell .admin-nav-links .admin-nav-link:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
  }

  body.page-admin .admin-layout-sidebar .admin-nav-shell .admin-nav-links .admin-nav-link:hover .admin-nav-link-icon {
    color: #fff;
  }

  body.page-admin .admin-layout-sidebar .admin-nav-shell .admin-nav-links .admin-nav-link.active {
    background: #fff;
    color: var(--admin-sidebar-nav-active-fg, #0958d9);
    font-weight: 750;
    box-shadow:
      inset 3px 0 0 #1677ff,
      0 2px 8px rgba(0, 40, 80, 0.12);
  }

  body.page-admin .admin-layout-sidebar .admin-nav-shell .admin-nav-links .admin-nav-link.active .admin-nav-link-icon {
    color: var(--admin-sidebar-nav-active-icon, #1677ff);
  }

  body.page-admin .admin-layout-sidebar .admin-nav-group-heading {
    color: rgba(255, 255, 255, 0.58);
    padding-top: 12px;
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }

  body.page-admin .admin-layout-sidebar .admin-nav-group-heading .admin-nav-link-icon {
    color: rgba(255, 255, 255, 0.65);
  }

  body.page-admin .admin-layout-sidebar .admin-nav-group--active .admin-nav-group-heading {
    color: rgba(255, 255, 255, 0.78);
  }

  body.page-admin .admin-layout-sidebar .admin-nav-shell .admin-nav-links .admin-nav-link--account {
    font-size: 13px;
    font-weight: 600;
  }

  body.page-admin .admin-layout-main {
    padding: 20px 24px 32px;
    background: var(--admin-main-bg);
    min-width: 0;
    max-width: 100%;
  }

  body.page-admin .admin-layout-main .card {
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow:
      0 1px 2px rgba(15, 23, 42, 0.03),
      0 4px 14px rgba(15, 23, 42, 0.05);
    background: #fff;
  }

  body.page-admin .admin-layout-main .settings-tabs-page {
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    box-shadow:
      0 1px 2px rgba(15, 23, 42, 0.03),
      0 4px 14px rgba(15, 23, 42, 0.05);
  }

  body.page-admin .admin-layout-main .stat-card {
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow:
      0 1px 2px rgba(15, 23, 42, 0.03),
      0 4px 12px rgba(15, 23, 42, 0.04);
  }

  body.page-admin .admin-layout-main .card-head {
    border-bottom-color: #f0f0f0;
  }

  body.page-admin .table-wrap thead th,
  body.page-admin .table-scroll thead th {
    background: #fafafa;
    color: #595959;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.02em;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
  }

  body.page-admin .table-wrap tbody tr:nth-child(even),
  body.page-admin .table-scroll tbody tr:nth-child(even) {
    background: #fafafa;
  }

  body.page-admin .admin-layout-main .table-wrap,
  body.page-admin .admin-layout-main .table-scroll {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    border-color: #e8e8e8;
    background: #fff;
  }

  body.page-admin .admin-layout-main .table-wrap th,
  body.page-admin .admin-layout-main .table-wrap td,
  body.page-admin .admin-layout-main .table-scroll th,
  body.page-admin .admin-layout-main .table-scroll td {
    vertical-align: middle;
    padding: 11px 14px;
    text-align: left;
  }

  body.page-admin .admin-layout-main .table-wrap td,
  body.page-admin .admin-layout-main .table-scroll td {
    font-variant-numeric: tabular-nums;
  }

  body.page-admin .admin-layout-main .table-wrap td:last-child .button,
  body.page-admin .admin-layout-main .table-scroll td:last-child .button {
    vertical-align: middle;
  }

  body.page-admin .admin-layout-main .pagination {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
  }

  body.page-admin .admin-layout-main .admin-users-table-wrap {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    border-color: #e8e8e8;
    background: #fff;
  }

  body.page-admin .admin-layout-main .admin-users-unified-table th,
  body.page-admin .admin-layout-main .admin-users-unified-table td {
    vertical-align: middle;
    padding: 11px 14px;
  }

  body.page-admin .admin-version-footer {
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid #e8e8e8;
    color: #8c8c8c;
    font-size: 12px;
    font-weight: 600;
  }

  body.page-admin .filter-bar {
    border-radius: 12px;
    border-color: #e8e8e8;
    background: #fff;
  }

  body.page-admin .settings-tab-nav {
    border-radius: 12px;
    border-color: #e8e8e8;
    background: #fafafa;
  }

  body.page-admin .admin-dash-stat-grid .stat-card {
    border-radius: 12px;
    border-color: #e8e8e8;
    background: #fff;
    box-shadow:
      0 1px 2px rgba(15, 23, 42, 0.03),
      0 4px 12px rgba(15, 23, 42, 0.04);
    transition:
      border-color 0.18s ease,
      box-shadow 0.18s ease;
  }

  body.page-admin .admin-dash-stat-grid .stat-card:hover {
    border-color: #d9d9d9;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
    transform: none;
  }

  body.page-admin .admin-dash-stat-grid .stat-card span {
    color: #8c8c8c;
  }

  body.page-admin .admin-dash-stat-grid .stat-card .admin-dash-kpi-card-pro-trend--muted {
    color: #bfbfbf;
  }

  body.page-admin .admin-dash-stat-grid .stat-card strong {
    color: #262626;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  body.page-admin .admin-dash-kpi-block-title {
    position: relative;
    padding-left: 12px;
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 800;
    color: #262626;
  }

  body.page-admin .admin-dash-kpi-block-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: #1890ff;
  }

  body.page-admin .admin-dash-stat-grid--kpi-pro {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  body.page-admin .admin-dash-kpi-card-pro {
    padding: 16px 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 132px;
  }

  body.page-admin .admin-dash-kpi-card-pro-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  body.page-admin .admin-dash-kpi-card-pro-icon {
    display: inline-flex;
    line-height: 0;
  }

  body.page-admin .admin-dash-kpi-card-pro-trend {
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
  }

  body.page-admin .admin-dash-kpi-card-pro-trend--muted {
    color: #bfbfbf;
  }

  body.page-admin .admin-dash-kpi-card-pro-trend--up {
    color: #52c41a;
  }

  body.page-admin .admin-dash-kpi-card-pro-trend--down {
    color: #ff4d4f;
  }

  body.page-admin .admin-dash-stat-grid .stat-card .admin-dash-kpi-card-pro-label {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 650;
    color: #8c8c8c;
  }

  body.page-admin .admin-dash-kpi-card-pro strong {
    margin-top: 4px;
    padding-top: 0;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #262626;
  }
}

@media (max-width: 768px) {
  body.page-admin .admin-topbar-menu-btn {
    display: flex;
    grid-column: 1;
  }

  body.page-admin .admin-topbar.is-menu-open .admin-topbar-menu-btn span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.page-admin .admin-topbar.is-menu-open .admin-topbar-menu-btn span:nth-child(2) {
    opacity: 0;
  }

  body.page-admin .admin-topbar.is-menu-open .admin-topbar-menu-btn span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  body.page-admin .admin-topbar-menu-btn span {
    transition: transform 0.18s ease, opacity 0.18s ease;
  }

  body.page-admin .admin-topbar {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    row-gap: 10px;
    padding: 10px 12px;
    align-items: center;
  }

  body.page-admin .admin-topbar-title {
    grid-column: 2;
    grid-row: 1;
  }

  body.page-admin .admin-topbar-user {
    display: none;
  }

  body.page-admin .admin-nav-drawer-head {
    background: rgba(255, 255, 255, 0.14);
    border-bottom-color: rgba(255, 255, 255, 0.22);
  }

  body.page-admin .admin-nav-drawer-title {
    color: #fff;
  }

  body.page-admin .admin-nav-drawer-close {
    color: rgba(255, 255, 255, 0.75);
  }

  body.page-admin .admin-nav-drawer-panel {
    background: var(--admin-sidebar-bg);
    box-shadow: 8px 0 36px rgba(0, 0, 0, 0.35);
  }

  body.page-admin .admin-nav-shell .admin-nav-links .admin-nav-link {
    color: rgba(255, 255, 255, 0.92);
  }

  body.page-admin .admin-nav-shell .admin-nav-links .admin-nav-link-icon {
    color: rgba(255, 255, 255, 0.72);
  }

  body.page-admin .admin-nav-shell .admin-nav-links .admin-nav-link:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
  }

  body.page-admin .admin-nav-shell .admin-nav-links .admin-nav-link:hover .admin-nav-link-icon {
    color: #fff;
  }

  body.page-admin .admin-nav-shell .admin-nav-links .admin-nav-link.active {
    background: #fff;
    color: var(--admin-sidebar-nav-active-fg, #0958d9);
    box-shadow:
      inset 3px 0 0 #1677ff,
      0 2px 8px rgba(0, 40, 80, 0.12);
  }

  body.page-admin .admin-nav-shell .admin-nav-links .admin-nav-link.active .admin-nav-link-icon {
    color: var(--admin-sidebar-nav-active-icon, #1677ff);
  }

  body.page-admin .admin-nav-links .admin-nav-account-link:first-of-type {
    border-top-color: rgba(255, 255, 255, 0.22);
  }

  body.page-admin .admin-dash-stat-grid--kpi-pro {
    grid-template-columns: 1fr;
  }

  body.page-admin .admin-layout-main {
    background: #f5f7fa;
  }

  body.page-admin .admin-layout-main .card,
  body.page-admin .admin-layout-main .stat-card {
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow:
      0 1px 2px rgba(15, 23, 42, 0.03),
      0 4px 14px rgba(15, 23, 42, 0.05);
  }

  body.page-admin .admin-layout-main .settings-tabs-page {
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    box-shadow:
      0 1px 2px rgba(15, 23, 42, 0.03),
      0 4px 14px rgba(15, 23, 42, 0.05);
  }

  body.page-admin .table-wrap thead th,
  body.page-admin .table-scroll thead th {
    background: #fafafa;
    color: #595959;
    font-size: 12px;
    font-weight: 650;
    vertical-align: middle;
    border-bottom-color: #f0f0f0;
  }

  body.page-admin .admin-layout-main .table-wrap th,
  body.page-admin .admin-layout-main .table-wrap td,
  body.page-admin .admin-layout-main .table-scroll th,
  body.page-admin .admin-layout-main .table-scroll td {
    vertical-align: middle;
    padding: 11px 12px;
  }

  body.page-admin.admin-drawer-open {
    overflow: hidden;
  }
}

/* 用户管理卡片：窄屏改为纵向堆叠，取消「整张卡横向滚动条」 */
@media (max-width: 640px) {
  .admin-users-unified-card {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 12px;
  }

  .admin-users-unified-identity {
    width: 100%;
  }

  .admin-users-unified-badges {
    flex-wrap: wrap;
    width: 100%;
  }

  .admin-users-unified-stats {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
  }

  .admin-users-stat {
    flex: 1 1 auto;
    min-width: calc(50% - 6px);
  }

  .admin-users-unified-actions {
    margin-left: 0;
    padding-left: 0;
    padding-top: 10px;
    border-left: 0;
    border-top: 1px dashed rgba(148, 163, 184, 0.45);
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
  }

  .admin-users-unified-actions .button {
    flex: 1 1 auto;
    min-width: min(100%, 120px);
  }
}

.admin-record-bulk-form {
  margin-bottom: 12px;
  border: 1px solid #fee2e2;
  border-radius: 10px;
  background: #fffafa;
  padding: 10px 12px;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.code-create-card .card-head {
  margin-bottom: 12px;
}

.code-create-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
}

.code-create-form .button {
  min-width: 96px;
}

.code-export-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.code-export-actions span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.logo-preview img {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.user-identity {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.user-identity strong,
.user-identity span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-identity strong {
  color: var(--text);
  font-weight: 850;
  line-height: 1.2;
}

.user-identity>span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.inline-admin-form,
.table-action-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin: 0;
  vertical-align: middle;
}

.table-action-group {
  width: 100%;
  flex-wrap: wrap;
}

.compact-input {
  width: 88px;
  height: 36px;
  border-radius: 8px;
  padding: 0 9px;
  font-size: 13px;
}

.compact-input.password-input {
  width: 146px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

.code-token {
  display: inline-flex;
  max-width: 100%;
  min-height: 30px;
  align-items: center;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0 9px;
  color: #1d2939;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-copy-button {
  cursor: pointer;
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.code-copy-button:hover,
.code-copy-button:focus-visible {
  border-color: rgba(var(--primary-rgb), 0.35);
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.redeem-dialog,
.record-dialog,
.generation-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(10px);
}

.generation-overlay {
  z-index: 10002;
  pointer-events: auto;
}

.redeem-panel,
.record-dialog-panel,
.generation-modal {
  width: min(430px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(16, 24, 40, 0.3);
}

.record-dialog-panel {
  width: min(920px, 100%);
  max-height: min(860px, calc(100vh - 40px));
  overflow: auto;
}

.generation-modal {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 26px 22px;
  text-align: center;
}

.generation-modal h2 {
  font-size: 22px;
}

.generation-modal p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.generation-loader {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  height: 42px;
}

.generation-loader span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
  animation: pulse 0.9s ease-in-out infinite;
}

.generation-loader span:nth-child(2) {
  animation-delay: 0.12s;
}

.generation-loader span:nth-child(3) {
  animation-delay: 0.24s;
}

.generation-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--primary-soft);
}

.generation-progress i {
  width: 42%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #0ea5e9, var(--primary));
  animation: progress 1.3s ease-in-out infinite;
}

.redeem-head,
.record-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.96);
}

.record-dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  backdrop-filter: blur(12px);
}

.redeem-form {
  padding: 20px;
}

.dialog-close {
  min-width: 72px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 12px;
  background: #fff;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 750;
}

.dialog-close:hover {
  border-color: rgba(var(--primary-rgb), 0.35);
  background: var(--primary-soft);
  color: var(--primary);
}

.record-dialog-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 20px;
}

.record-dialog-image {
  min-height: 420px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #e8f7f0, #f9fbfa);
  color: var(--muted);
  font-weight: 750;
}

.record-dialog-output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
  padding: 10px;
  min-height: 0;
  align-items: start;
}

.record-dialog-output-grid .record-dialog-image-button {
  min-height: 140px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  background: #fff;
}

.record-dialog-output-grid .record-dialog-image-inner img {
  max-height: 220px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.record-dialog-image:has(.record-dialog-output-grid) {
  min-height: 0;
}

.record-dialog-save-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.record-dialog-save-actions.hidden {
  display: none;
}

.record-dialog-save-hint {
  margin: 0;
  max-width: 36rem;
  text-align: center;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

.record-dialog-image-button {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
}

.record-dialog-image-button img,
.record-dialog-image img {
  width: 100%;
  height: 100%;
  max-height: 640px;
  object-fit: contain;
  background: #fff;
}

.record-input-images {
  display: grid;
  gap: 10px;
}

.record-input-images>span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.record-input-images [data-dialog-input-list] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}

.record-input-image-button {
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 0;
  cursor: zoom-in;
}

.record-input-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.86);
}

.image-viewer-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.image-viewer-toolbar button,
.image-viewer-toolbar span {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--radius);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 800;
}

.image-viewer-toolbar span {
  min-width: 72px;
}

/* 精选页大图：不显示顶部工具栏；底部「向下 / 关闭」 */
.image-viewer-footer {
  display: none;
  min-width: 0;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.72);
}

body.page-featured .image-viewer-footer {
  display: flex;
}

.image-viewer-footer-btn {
  flex: 1;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  font-size: 15px;
  font-weight: 750;
}

.image-viewer-footer-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.image-viewer-footer-btn--close {
  flex: 0 0 auto;
  min-width: 52px;
  padding: 0;
  border-radius: 12px;
  font-size: 0;
}

.image-viewer-footer-btn-icon {
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
}

.image-viewer-footer-btn-icon--xl {
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}

.image-viewer-footer-btn-text {
  font-size: 14px;
  font-weight: 750;
}

/* 精选页大图：不显示顶部工具栏（仍可用滚轮/双指缩放、拖拽，点空白处或 Esc 关闭） */
body.page-featured .image-viewer {
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  padding: 12px 12px 0;
}

body.page-featured .image-viewer .image-viewer-stage {
  grid-row: 1;
}

body.page-featured .image-viewer .image-viewer-footer {
  grid-row: 2;
}

body.page-featured .image-viewer-toolbar {
  display: none !important;
}

.image-viewer-stage {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.48);
  cursor: grab;
  /* 双指缩放由脚本处理，避免浏览器整页缩放抢走手势 */
  touch-action: none;
}

.image-viewer-canvas {
  min-width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
}

.image-viewer-imgwrap {
  position: relative;
  display: inline-block;
  line-height: 0;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  user-select: none;
}

.image-viewer-stage.is-dragging {
  cursor: grabbing;
}

.image-viewer-stage img {
  display: block;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: #fff;
  box-shadow: none;
  user-select: none;
}

.image-viewer-imgwrap canvas.image-viewer-pix {
  display: block;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  user-select: none;
  -webkit-touch-callout: default;
}

/* 微信内「下载含标识」：程序化 <a download> 无效，改为长按指引层 */
.wechat-stamp-save-overlay {
  position: fixed;
  inset: 0;
  z-index: 10035;
  display: grid;
  place-items: center;
  padding: 16px;
  box-sizing: border-box;
}

.wechat-stamp-save-overlay.hidden {
  display: none;
}

.wechat-stamp-save-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
}

.wechat-stamp-save-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(92vh, 720px);
  display: grid;
  gap: 12px;
  padding: 18px 16px 16px;
  border-radius: var(--radius);
  background: #fff;
  color: #0f172a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  overflow: auto;
}

.wechat-stamp-save-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
}

.wechat-stamp-save-hint {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
  text-align: center;
}

.wechat-stamp-save-img-wrap {
  max-height: min(58vh, 480px);
  overflow: auto;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.wechat-stamp-save-img-wrap img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  -webkit-touch-callout: default;
}

.wechat-stamp-save-close {
  margin: 0;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
}

.record-detail-grid {
  display: grid;
  grid-template-columns:
    minmax(108px, 0.52fr) minmax(128px, 0.58fr) minmax(168px, 0.88fr) minmax(88px, 0.4fr) minmax(300px, 1.55fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.record-detail-grid div {
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px;
  background: #fbfdff;
}

.record-detail-grid .record-detail-time {
  min-width: 360px;
}

.record-detail-grid .record-detail-status strong {
  width: fit-content;
}

.record-detail-featured-value {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-weight: 850;
  font-size: 13px;
  line-height: 1.35;
}

.record-detail-featured-value.is-muted {
  color: #94a3b8;
  font-weight: 700;
}

.record-detail-featured-value.is-featured-approved {
  color: #92400e;
}

.record-detail-featured-value.is-featured-approved .record-featured-star-icon {
  color: #f59e0b;
}

.record-detail-featured-value.is-featured-approved .record-featured-star-icon path {
  fill: #f59e0b;
  stroke: #ea580c;
  stroke-width: 0.35;
  stroke-linejoin: round;
}

.record-detail-featured-value.is-featured-pending {
  color: #a16207;
}

.record-detail-featured-value.is-featured-pending .record-featured-star-icon {
  color: #d97706;
}

.record-detail-featured-value.is-featured-pending .record-featured-star-icon path {
  fill: rgba(254, 243, 199, 0.65);
  stroke: #d97706;
  stroke-width: 1.15;
  stroke-linejoin: round;
}

.record-detail-featured-value.is-featured-rejected,
.record-detail-featured-value.is-featured-none {
  color: #64748b;
}

.record-detail-grid span,
.record-full-prompt span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.record-detail-grid strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.record-detail-grid strong.status {
  color: inherit;
  font-size: 13px;
}

.record-full-prompt {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.record-full-prompt p {
  max-height: 132px;
  overflow: auto;
  margin: 0;
  color: #1f2937;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.record-error {
  grid-column: 1 / -1;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 12px;
  background: var(--danger-soft);
  color: var(--danger);
}

.history-list::-webkit-scrollbar,
.record-full-prompt p::-webkit-scrollbar,
.record-dialog-panel::-webkit-scrollbar,
.admin-nav::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.history-list::-webkit-scrollbar-thumb,
.record-full-prompt p::-webkit-scrollbar-thumb,
.record-dialog-panel::-webkit-scrollbar-thumb,
.admin-nav::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c8d5e6;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  50% {
    transform: translateY(-7px);
    opacity: 1;
  }
}

@keyframes progress {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(260%);
  }
}

@media (max-width: 1180px) {
  .history-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .app-topbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topbar-right {
    justify-content: flex-start;
  }

  .two-col,
  .narrow-left,
  .auth-dashboard {
    grid-template-columns: 1fr;
  }

  .auth-info,
  .auth-form-card {
    min-height: auto;
  }

  .auth-info {
    gap: 28px;
  }

  .preview-card {
    grid-template-rows: auto minmax(300px, auto);
  }

  .preview-stage {
    min-height: 300px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .code-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .code-create-form .button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 16px, 1180px);
    padding-top: 8px;
    padding-bottom: 24px;
  }

  .app-topbar {
    min-height: auto;
    padding: 12px;
  }

  .topbar-brand {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 19px;
  }

  .topbar-right {
    display: grid;
    gap: 8px;
    width: 100%;
  }

  .topbar-nav,
  .topbar-account {
    width: 100%;
    min-height: 40px;
  }

  .topbar-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
  }

  .topbar-account {
    display: grid;
    grid-template-columns: minmax(78px, 1fr) auto auto auto;
  }

  .topbar-nav a,
  .topbar-account .balance,
  .topbar-account .nav-redeem,
  .topbar-account .logout-link {
    height: 32px;
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .card {
    padding: 14px;
  }

  .card-head {
    align-items: flex-start;
    min-height: auto;
    gap: 10px;
    margin-bottom: 14px;
  }

  .field-grid,
  .stats-grid,
  .auth-metrics,
  .filter-bar,
  .code-create-form {
    grid-template-columns: 1fr;
  }

  .card-head-actions,
  .filter-actions {
    width: 100%;
  }

  .code-export-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .code-export-actions .button {
    width: 100%;
  }

  .card-head-actions .button,
  .filter-actions .button {
    flex: 1;
  }

  /* 工作台：标题 + 积分 + 充值同一行，必要时标题省略 */
  .workspace-card .card-head.workspace-section-head--toolbar {
    flex-wrap: nowrap;
    align-items: center;
  }

  .workspace-card .card-head.workspace-section-head--toolbar .workspace-toolbar-heading {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .workspace-card .card-head.workspace-section-head:not(.workspace-section-head--toolbar) > div:first-child {
    flex: 1 1 200px;
    min-width: 0;
  }

  .workspace-card .card-head-actions {
    width: auto;
    max-width: 100%;
    flex: 0 1 auto;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .workspace-card.workspace-card--creative .card-head.workspace-section-head--toolbar .card-head-actions {
    flex-wrap: nowrap;
    flex-shrink: 0;
  }

  .workspace-card--creative .card-head.workspace-section-head--toolbar .card-head-actions .button {
    flex: 0 0 auto;
  }

  .workspace-card .card-head-actions .badge {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace-card .card-head-actions .recharge-cta {
    flex: 0 0 auto;
    min-height: 32px;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 12px;
  }

  .prompt-field-head {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .prompt-field-head > .prompt-field-title {
    min-width: 0;
  }

  .prompt-field-actions {
    flex-shrink: 1;
    min-width: 0;
    gap: 6px;
  }

  .prompt-optimize-button {
    min-width: 0;
    height: 26px;
    padding: 0 8px;
    font-size: 11px;
  }

  .workspace-card .workspace-advanced-preview {
    font-size: 11px;
  }

  .workspace-card .workspace-advanced-dropdown {
    width: 34px;
    height: 34px;
  }

  .auth-dashboard {
    gap: 12px;
  }

  .auth-info,
  .auth-form-card {
    padding: 16px;
  }

  .auth-info h2 {
    font-size: 28px;
  }

  input,
  select {
    height: 42px;
  }

  textarea {
    min-height: 138px;
  }

  .button {
    min-height: 42px;
  }

  .history-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .history-list .record-card {
    height: 108px;
    min-height: 108px;
    grid-template-columns: 92px minmax(0, 1fr);
    grid-template-rows: 1fr;
    gap: 10px;
    padding: 8px;
  }

  .history-list .record-image {
    width: 92px;
    height: 92px;
    border-radius: var(--radius);
  }

  .history-list .record-body {
    align-content: center;
    padding: 0;
  }

  .redeem-dialog,
  .record-dialog,
  .generation-overlay {
    align-items: end;
    padding: 10px;
  }

  .redeem-dialog.poster-modal-dialog {
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
      max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  }

  .poster-modal-panel {
    max-height: min(calc(100dvh - 24px), calc(100vh - 24px), 900px);
    width: min(560px, calc(100vw - 20px));
  }

  .redeem-panel,
  .generation-modal {
    width: 100%;
  }

  .record-dialog-panel {
    max-height: calc(100vh - 20px);
  }

  .redeem-head,
  .record-dialog-head,
  .redeem-form {
    padding: 14px;
  }

  .record-dialog-body {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px;
  }

  .record-dialog-image {
    min-height: 280px;
  }

  .pagination {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: nowrap;
  }

  .pagination > span {
    flex: 1;
    min-width: 0;
    font-size: 12px;
  }

  .pagination-summary .pagination-pages {
    font-size: 13px;
  }

  .pagination-summary .pagination-count {
    font-size: 11px;
  }

  .pagination .button.secondary {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 650;
  }

  .image-viewer {
    padding: 10px;
  }

  body.page-featured .image-viewer {
    padding: 10px 10px 0;
  }

  .image-viewer-toolbar {
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .image-viewer-toolbar button,
  .image-viewer-toolbar span {
    width: 100%;
    padding: 0 8px;
    font-size: 13px;
  }

  .record-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .app-shell {
    width: min(100% - 12px, 1180px);
  }

  .topbar-account {
    grid-template-columns: 1fr 1fr;
  }

  .topbar-account .balance {
    grid-column: 1 / -1;
  }
}

/* Enterprise UI refresh（与全站蓝青品牌渐变统一，避免绿色主色） */
:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --text: #172033;
  --text-soft: #344054;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #e8f0ff;
  --primary-rgb: 37, 99, 235;
  --success: #2563eb;
  --success-soft: #e8f0ff;
  --warning: #b7791f;
  --warning-soft: #fff7e6;
  --danger: #d92d20;
  --danger-soft: #fff1f0;
  --shadow: 0 18px 44px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 8px 24px rgba(16, 24, 40, 0.05);
  --radius: 8px;
}

html {
  background: var(--bg);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74) 0, rgba(243, 246, 248, 0) 280px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.07) 0, transparent 38%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.app-shell {
  width: calc(100% - 36px);
  max-width: 1440px;
  padding-top: 14px;
}

.app-topbar,
.topbar-brand,
.topbar-right,
.topbar-nav,
.topbar-account,
.grid,
.two-col,
.section-card,
.preview-card {
  min-width: 0;
  max-width: 100%;
}

.app-topbar {
  position: sticky;
  top: 12px;
  z-index: 1000;
  min-height: 62px;
  margin-bottom: 18px;
  border-color: rgba(228, 231, 236, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.07);
}

.brand-mark {
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.24);
}

h1 {
  font-size: 21px;
  font-weight: 850;
}

h2 {
  font-size: 19px;
  font-weight: 800;
}

.eyebrow {
  color: #7a8699;
  font-size: 11px;
  text-transform: uppercase;
}

.topbar-nav,
.topbar-account {
  border-color: #eaecf0;
  border-radius: 8px;
  background: #f8fafc;
}

.topbar-nav a,
.topbar-account .balance,
.topbar-account .nav-redeem,
.topbar-account .logout-link {
  border-radius: 6px;
  color: #475467;
  font-size: 13px;
  font-weight: 750;
}

.topbar-nav a.active {
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.topbar-nav a:not(.active):hover,
.topbar-account .logout-link:hover {
  background: #eef2f6;
  color: var(--text);
}

.topbar-account .balance {
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: rgba(239, 246, 255, 0.92);
  color: var(--primary-dark);
}

.topbar-account .nav-redeem {
  border: 1px solid #1d4ed8;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  color: #ffffff;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
}

.topbar-account .nav-redeem:hover {
  border-color: #1e40af;
  background: linear-gradient(135deg, #1d4ed8 0%, #0284c7 100%);
  color: #ffffff;
}

.grid {
  gap: 18px;
}

.two-col {
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
}

.settings-page {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}

.settings-tabs-page {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.settings-tab-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #f8fafc;
  padding: 8px;
  box-shadow: var(--shadow-soft);
}

.settings-tab-nav button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #475467;
  font-weight: 820;
  cursor: pointer;
  white-space: nowrap;
}

.settings-tab-nav button:hover,
.settings-tab-nav button.active {
  border-color: rgba(var(--primary-rgb), 0.35);
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.settings-tab-nav.settings-tab-nav-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-tab-nav.settings-tab-nav-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #475467;
  font-weight: 820;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  box-sizing: border-box;
}

.settings-tab-nav.settings-tab-nav-links a:hover,
.settings-tab-nav.settings-tab-nav-links a.active {
  border-color: rgba(var(--primary-rgb), 0.35);
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.settings-tab-nav.settings-tab-nav-links a:focus-visible {
  outline: 2px solid rgba(var(--primary-rgb), 0.45);
  outline-offset: 2px;
}

.settings-tab-panel {
  grid-column: 1 / -1;
}

[data-settings-tabs] > .settings-tab-panel:not(.active),
[data-legal-center-tabs] > .settings-tab-panel:not(.active) {
  display: none !important;
}

/* 系统配置 · 审核优化：分块与双线路说明 */
.admin-prompt-intro {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: linear-gradient(165deg, rgba(248, 250, 252, 0.95), rgba(239, 246, 255, 0.5));
  font-size: 14px;
  line-height: 1.65;
  color: #334155;
}

.admin-prompt-intro ol {
  margin: 10px 0 0 1.1rem;
  padding: 0;
  display: grid;
  gap: 8px;
}

.admin-prompt-intro strong {
  color: #0f172a;
}

.admin-prompt-ref-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}

@media (max-width: 900px) {
  .admin-prompt-ref-grid {
    grid-template-columns: 1fr;
  }
}

.admin-prompt-ref-card {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.admin-prompt-ref-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 850;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.admin-prompt-ref-dl {
  margin: 0;
  display: grid;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.admin-prompt-ref-dl > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
}

.admin-prompt-ref-dl dt {
  margin: 0;
  color: #64748b;
  font-weight: 750;
}

.admin-prompt-ref-dl dd {
  margin: 0;
  color: #1e293b;
  word-break: break-word;
}

.admin-prompt-ref-dl code {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #0f172a;
}

.admin-settings-section {
  margin: 0 0 22px;
  padding: 0 0 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.admin-settings-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 8px;
}

.admin-settings-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 850;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.admin-settings-section .section-lead {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.55;
  color: #64748b;
}

.admin-settings-section .section-lead code {
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #f8fafc;
}

.admin-announce-quill-wrap {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: var(--radius, 10px);
  background: #fff;
  /* 外框与 Quill 内置边框叠在一起会在编辑器底部多出一条横线 */
  overflow: hidden;
}

.admin-announce-quill-wrap .ql-toolbar.ql-snow {
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 1px solid var(--line, #e5e7eb);
}

.admin-announce-quill-wrap .ql-toolbar.ql-snow + .ql-container.ql-snow,
.admin-announce-quill-wrap .ql-container.ql-snow {
  border: none;
}

.admin-announce-quill-editor .ql-editor {
  min-height: 280px;
  font-size: 15px;
  line-height: 1.55;
}

/* 公告配置：去掉标题/记录区 card-head 装饰下划线，避免与表单、表格分割线叠成「多一条线」 */
[data-legal-center-tabs] [data-legal-panel="announce"] > .card-head::after,
[data-legal-center-tabs] .announce-history-block .card-head::after {
  display: none;
}

.home-announcement-modal {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  box-sizing: border-box;
}

.home-announcement-modal.hidden {
  display: none !important;
}

.home-announcement-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}

.home-announcement-modal__panel {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  max-height: min(78vh, 620px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 22px 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(37, 99, 235, 0.18),
    0 24px 56px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.home-announcement-modal__heading {
  margin: 0;
  font-size: 18px;
  font-weight: 850;
  text-align: center;
  color: var(--text, #0f172a);
}

.home-announcement-modal__subtitle {
  margin: 0;
  font-size: 15px;
  font-weight: 780;
  text-align: center;
  color: var(--primary, #2563eb);
}

.home-announcement-modal__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text, #0f172a);
  -webkit-overflow-scrolling: touch;
}

.home-announcement-modal__body p {
  margin: 0 0 0.6em;
}

.home-announcement-modal__body p:last-child {
  margin-bottom: 0;
}

.home-announcement-modal__body pre,
.home-announcement-modal__body .ql-syntax {
  max-width: 100%;
  overflow: auto;
  font-size: 12px;
}

.home-announcement-modal__ok {
  width: 100%;
  max-width: 280px;
  margin: 4px auto 0;
  border-radius: 999px;
  min-height: 44px;
  font-weight: 800;
  font-size: 15px;
}

button.account-quick-tile {
  border-style: solid;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  font: inherit;
  cursor: pointer;
}

.cs-qr-dialog {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  box-sizing: border-box;
}

.cs-qr-dialog.hidden {
  display: none !important;
}

.cs-qr-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}

.cs-qr-dialog__panel {
  position: relative;
  width: min(360px, calc(100vw - 32px));
  max-height: min(86vh, 520px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 20px 20px 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(37, 99, 235, 0.14),
    0 24px 56px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.cs-qr-dialog__title {
  margin: 0;
  font-size: 17px;
  font-weight: 850;
  text-align: center;
  color: var(--text, #0f172a);
}

.cs-qr-dialog__img-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--line, #e5e7eb);
  background: #fafafa;
  -webkit-overflow-scrolling: touch;
}

.cs-qr-dialog__img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

.cs-qr-dialog__close {
  align-self: center;
  min-width: 160px;
  border-radius: 999px;
}

.settings-page>.card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.settings-page>.card>.form {
  flex: 1;
}

.settings-page>.card>.form>.button:last-child {
  margin-top: auto;
}

.cloud-storage-card {
  grid-column: 1 / -1;
}

.cloud-storage-form {
  align-content: start;
}

.cloud-storage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.storage-options-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.switch-field {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: end;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fbfdff;
  padding: 0 12px;
  color: #475467;
  font-size: 13px;
  font-weight: 760;
}

.switch-field input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.settings-page textarea {
  min-height: 104px;
}

.card,
.stat-card {
  min-width: 0;
  border-color: #e4e7ec;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
}

.card {
  padding: 18px;
}

.section-card {
  margin-top: 18px;
}

.card-head {
  min-height: 46px;
  margin-bottom: 16px;
}

.card-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form {
  gap: 13px;
}

.field span {
  color: #475467;
  font-size: 13px;
  font-weight: 760;
}

input,
select,
textarea {
  border-color: #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #101828;
}

input,
select {
  height: 42px;
}

textarea {
  min-height: 144px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #98a2b3;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.button {
  min-height: 40px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 780;
  box-shadow: none;
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.button.primary:hover {
  filter: brightness(1.02);
  background: linear-gradient(135deg, #1d4ed8 0%, #0284c7 100%);
}

.button.secondary {
  border-color: #d0d5dd;
  background: #fff;
  color: #344054;
}

.button.secondary:hover,
.button.secondary.active {
  border-color: #98a2b3;
  background: #f2f4f7;
  color: #101828;
}

.button.online-action {
  border-color: rgba(37, 99, 235, 0.32);
  background: rgba(239, 246, 255, 0.95);
  color: #1d4ed8;
}

.button.online-action:hover,
.button.online-action:focus-visible {
  border-color: rgba(37, 99, 235, 0.45);
  background: #dbeafe;
  color: #1e40af;
}

.button.danger {
  border-color: #fecdca;
  background: #fff;
}

.badge,
.status {
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge {
  border-color: #d0d5dd;
  background: #fff;
}

.alert,
.inline-message,
.generation-notice {
  border-radius: 8px;
  box-shadow: none;
}

.generation-notice {
  border-color: #f6d58b;
  background: #fffaf0;
}

.mode-toggle {
  gap: 10px;
}

.mode-toggle label {
  min-height: 40px;
  border-radius: 8px;
  background: #f8fafc;
}

.mode-toggle label:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(239, 246, 255, 0.95);
  color: var(--primary-dark);
}

.edit-upload-preview {
  grid-template-columns: repeat(auto-fill, minmax(78px, 88px));
}

.preview-card {
  display: grid;
  grid-template-rows: auto minmax(520px, 1fr);
}

.preview-stage {
  min-height: 520px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background:
    linear-gradient(45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f8fafc 75%),
    linear-gradient(-45deg, transparent 75%, #f8fafc 75%),
    #fff;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.preview-stage img {
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.14);
}

.history-list {
  gap: 14px;
  padding-bottom: 4px;
}

.history-list .record-card {
  border-color: #e4e7ec;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.history-list .record-card:hover {
  border-color: #b9c3d0;
  box-shadow: 0 12px 26px rgba(16, 24, 40, 0.08);
}

.history-list .record-image {
  border-radius: 8px;
  background: #f2f4f7;
}

.record-meta span:first-child:not(.status) {
  font-weight: 850;
}

.record-body p,
.admin-prompt-cell {
  color: #475467;
}

.admin-nav {
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.admin-nav .button {
  min-height: 36px;
  border: 0;
}

.admin-nav .button.secondary.active {
  background: var(--primary);
  color: #fff;
}

.admin-version-footer {
  margin-top: 22px;
  padding: 14px 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.site-footer {
  margin-top: 22px;
  padding: 14px 0 4px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--primary-dark);
  font-weight: 750;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  min-height: 96px;
  padding: 16px;
  background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
}

.stat-card span {
  color: #667085;
  font-size: 12px;
  font-weight: 760;
}

.stat-card strong {
  margin-top: 8px;
  color: #101828;
  font-size: 26px;
  font-weight: 880;
}

.table-wrap {
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fff;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  border-bottom: 1px solid #eaecf0;
  padding: 12px 14px;
}

th {
  background: #f8fafc;
  color: #667085;
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr:hover td {
  background: #fbfcfe;
}

tr:last-child td {
  border-bottom: 0;
}

.table-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
}

.inline-admin-form,
.table-action-group {
  gap: 7px;
}

.compact-input {
  height: 34px;
  border-radius: 7px;
}

.filter-bar {
  grid-template-columns: minmax(260px, 1fr) minmax(170px, 220px) auto;
  padding: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fbfdff;
}

.filter-bar.admin-record-filter {
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 150px) minmax(130px, 160px) auto;
}

.filter-bar.admin-user-filter {
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
}

.filter-bar.admin-orders-filter {
  grid-template-columns: minmax(130px, 150px) repeat(2, minmax(0, 1fr)) minmax(0, 1fr) auto;
  gap: 12px 14px;
  align-items: end;
}

@media (max-width: 1100px) {
  .filter-bar.admin-orders-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  }
}

@media (max-width: 640px) {
  .filter-bar.admin-orders-filter {
    grid-template-columns: 1fr;
  }

  .filter-bar.admin-orders-filter .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.admin-orders-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line, #e4e7ec);
  border-radius: 10px;
  background: #f8fafc;
}

.admin-orders-export-form {
  margin-top: 4px;
}

.admin-orders-table .admin-orders-check-col {
  width: 40px;
  text-align: center;
  vertical-align: middle;
}

.admin-orders-table .admin-orders-check-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.code-create-card {
  background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
}

.code-create-form {
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
}

.auth-dashboard {
  min-height: calc(100vh - 140px);
  grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
}

.auth-info,
.auth-form-card {
  min-height: 540px;
  border-radius: 10px;
}

.auth-info {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), transparent 42%),
    linear-gradient(180deg, #fff 0%, #f7fafc 100%);
}

.auth-info h2 {
  max-width: 620px;
  color: #101828;
}

.auth-info p {
  max-width: 560px;
  color: #475467;
}

.auth-tag {
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(239, 246, 255, 0.95);
  color: var(--primary-dark);
}

.auth-metrics div {
  border-color: #e4e7ec;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.record-dialog-panel,
.redeem-panel {
  border-radius: 10px;
}

.record-dialog-head,
.redeem-head {
  border-bottom: 1px solid #eaecf0;
  background: #f8fafc;
}

.record-dialog-image {
  border-radius: 10px;
  background: #f8fafc;
}

.record-detail-grid div,
.record-full-prompt,
.record-input-images {
  border-color: #e4e7ec;
  border-radius: 8px;
}

.image-viewer-toolbar button,
.image-viewer-toolbar span {
  border-radius: 8px;
}

@media (max-width: 1180px) {
  .app-shell {
    width: calc(100% - 24px);
    max-width: 1180px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .code-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .app-topbar {
    position: static;
  }

  .two-col,
  .settings-page,
  .auth-dashboard {
    grid-template-columns: 1fr;
  }

  .cloud-storage-card {
    grid-column: auto;
  }

  .cloud-storage-grid,
  .storage-options-grid {
    grid-template-columns: 1fr;
  }

  .settings-tab-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
  }

  .settings-tab-nav button {
    min-height: 38px;
    padding: 0 6px;
    font-size: 13px;
  }

  .preview-card {
    grid-template-rows: auto minmax(340px, auto);
  }

  .preview-stage {
    min-height: 340px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: calc(100% - 16px);
    max-width: 720px;
    padding-top: 8px;
  }

  .app-topbar,
  .card,
  .stat-card,
  .admin-nav-shell,
  .admin-nav,
  .table-wrap {
    border-radius: 8px;
  }

  .topbar-account {
    grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  }

  .stats-grid,
  .filter-bar,
  .code-create-form,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .auth-info,
  .auth-form-card {
    min-height: auto;
  }

  .auth-info h2 {
    font-size: 26px;
  }

  .history-list .record-card {
    min-height: 112px;
  }

  th,
  td {
    padding: 10px 12px;
  }
}

@media (max-width: 720px) {

  html,
  body.page-app,
  body.page-records,
  body.page-help,
  body.page-account,
  body.page-admin {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
  }

  body.page-app,
  body.page-records,
  body.page-account,
  body.page-help {
    /*
     * pan-y 易触发「先判滚动再派发点击」，底部固定导航上表现为明显的 ~300ms 延迟甚至丢点击。
     * manipulation 保留纵向滚动与缩放手势，并取消双击缩放等待，显著改善底栏与其它可点区域的响应。
     */
    position: relative;
    touch-action: manipulation;
  }

  body.page-admin {
    position: relative;
    touch-action: pan-y;
  }

  body.page-app .app-shell,
  body.page-records .app-shell,
  body.page-help .app-shell,
  body.page-account .app-shell,
  body.page-admin .app-shell {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding-right: 8px;
    padding-left: 8px;
  }

  body.page-app main,
  body.page-app section,
  body.page-app form,
  body.page-app label,
  body.page-app input,
  body.page-app select,
  body.page-app textarea,
  body.page-app button,
  body.page-records main,
  body.page-records section,
  body.page-records form,
  body.page-records label,
  body.page-records input,
  body.page-records select,
  body.page-records textarea,
  body.page-records button,
  body.page-help main,
  body.page-help section,
  body.page-help form,
  body.page-help label,
  body.page-help input,
  body.page-help select,
  body.page-help textarea,
  body.page-help button,
  body.page-account main,
  body.page-account section,
  body.page-account form,
  body.page-account label,
  body.page-account input,
  body.page-account select,
  body.page-account textarea,
  body.page-account button,
  body.page-admin main,
  body.page-admin section,
  body.page-admin form,
  body.page-admin label,
  body.page-admin input,
  body.page-admin select,
  body.page-admin textarea,
  body.page-admin button {
    max-width: 100%;
    min-width: 0;
  }

  body.page-app .app-topbar,
  body.page-app .card,
  body.page-app .preview-stage,
  body.page-app .history-list,
  body.page-app .history-list .record-card,
  body.page-records .card,
  body.page-records .history-list,
  body.page-records .history-list .record-card,
  body.page-help .card,
  body.page-account .card,
  body.page-admin .card,
  body.page-admin .stat-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: visible;
  }

  body.page-admin .admin-layout,
  body.page-admin .admin-nav-shell,
  body.page-admin .admin-nav,
  body.page-admin .table-wrap,
  body.page-admin .table-scroll {
    width: 100%;
    max-width: min(100%, calc(100vw - 16px));
    min-width: 0;
  }

  body.page-admin .card-head {
    flex-wrap: wrap;
    gap: 10px;
  }

  body.page-admin .card-head-actions {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
  }

  body.page-admin .filter-bar {
    grid-template-columns: 1fr !important;
  }

  body.page-admin .filter-actions {
    width: 100%;
    justify-content: stretch;
  }

  body.page-admin .filter-actions .button {
    flex: 1;
    min-width: 0;
  }

  body.page-admin .code-create-form {
    grid-template-columns: 1fr !important;
  }

  body.page-admin .settings-tab-nav:not(.settings-tab-nav-links) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.page-app .topbar-right,
  body.page-app .topbar-nav,
  body.page-app .topbar-account {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.page-app .topbar-account {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.page-app .topbar-nav a,
  body.page-app .topbar-account .balance,
  body.page-app .topbar-account .nav-redeem,
  body.page-app .topbar-account .logout-link {
    min-width: 0;
    padding-right: 6px;
    padding-left: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.page-app .card-head,
  body.page-records .card-head,
  body.page-help .card-head,
  body.page-admin .card-head {
    min-width: 0;
    max-width: 100%;
  }

  body.page-app textarea {
    overflow-wrap: anywhere;
  }

  body.page-app .workspace-main {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.page-app .workspace-card.workspace-card--creative {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.page-app .workspace-card--creative .workspace-card-generation-notice {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.page-app .workspace-create-shell {
    min-width: 0;
    max-width: 100%;
  }

  body.page-app .workspace-ai-hint-wrap {
    min-width: 0;
    max-width: 100%;
  }
}

/* Polished motion and depth layer */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.16);
  --shadow-lift: 0 18px 44px rgba(16, 24, 40, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a,
button,
.button,
.topbar-nav a,
.topbar-account .balance,
.topbar-account .nav-redeem,
.topbar-account .logout-link,
.mode-toggle label,
.record-card,
.stat-card,
.table-thumb,
.record-input-image-button,
.record-dialog-image-button,
.dialog-close {
  transition:
    transform 0.22s var(--ease-out),
    border-color 0.22s var(--ease-out),
    background-color 0.22s var(--ease-out),
    color 0.22s var(--ease-out),
    box-shadow 0.22s var(--ease-out),
    opacity 0.22s var(--ease-out);
}

input,
select,
textarea {
  transition:
    border-color 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out),
    background-color 0.2s var(--ease-out);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.record-card:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.app-topbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
  backdrop-filter: blur(18px) saturate(1.18);
}

.topbar-brand:hover .brand-mark {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.26);
}

.topbar-nav a.active,
.topbar-account .nav-redeem,
.button.primary {
  background: linear-gradient(135deg, #1dbf82 0%, var(--primary) 58%, #0d7f5b 100%);
}

.topbar-nav a:not(.active):hover,
.topbar-account .logout-link:hover,
.button.secondary:hover,
.dialog-close:hover {
  transform: translateY(-1px);
}

.button:not(:disabled):active,
.topbar-nav a:active,
.topbar-account .nav-redeem:active,
.dialog-close:active,
.mode-toggle label:active {
  transform: translateY(0) scale(0.985);
}

.button.primary:hover,
.topbar-account .nav-redeem:hover {
  box-shadow: 0 12px 24px rgba(8, 127, 91, 0.22);
}

.card,
.stat-card,
.auth-info,
.auth-form-card,
.history-list .record-card {
  background: rgba(255, 255, 255, 0.58);
  border-color: rgba(228, 231, 236, 0.72);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
  backdrop-filter: blur(12px) saturate(1.08);
}

.card,
.stat-card,
.history-list .record-card {
  box-shadow: 0 1px 1px rgba(16, 24, 40, 0.03), var(--shadow-soft);
}

.history-list .record-card:hover {
  background: rgba(255, 255, 255, 0.68);
}

.record-meta .status {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
  line-height: 1;
  font-weight: 850;
}

.record-meta .status.succeeded {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(239, 246, 255, 0.95);
  color: #1d4ed8;
}

.record-meta .status.failed {
  border-color: #fecaca;
  background: var(--danger-soft);
  color: var(--danger);
}

.record-meta .status.running,
.record-meta .status.queued {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(239, 246, 255, 0.95);
  color: #1d4ed8;
}

/* 记录页缩略图占位：与「已生成」同系蓝，覆盖全局 .status.running 黄底 */
body.page-records .record-image .status.running,
body.page-records .record-image .status.queued {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(239, 246, 255, 0.95);
  color: #1d4ed8;
}

.record-meta .status.deleted {
  border-color: var(--line-strong);
  background: #f2f4f7;
  color: var(--muted);
}

.card-head {
  position: relative;
}

.card-head::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -9px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.2), rgba(228, 231, 236, 0.72), transparent);
}

.badge {
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.generation-notice {
  position: relative;
  overflow: hidden;
}

.generation-notice::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 999px;
  background: #d99a18;
}

.mode-toggle label {
  position: relative;
  overflow: hidden;
}

.mode-toggle label:has(input:checked) {
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12), 0 8px 20px rgba(37, 99, 235, 0.1);
}

.mode-toggle label:has(input:checked)::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

select {
  appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 13px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

textarea::placeholder,
input::placeholder {
  color: #98a2b3;
}

.edit-upload-box {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 250, 252, 0.92)),
    #f8fafc;
}

.edit-upload-box:hover {
  transform: translateY(-1px);
}

.edit-preview-item,
.table-thumb,
.record-input-image-button {
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.preview-stage {
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.preview-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 34%),
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.08), transparent 46%);
}

.preview-stage>* {
  position: relative;
  z-index: 1;
}

.preview-stage img {
  animation: fadeLift 0.42s var(--ease-soft);
}

.empty-state,
.preview-loading,
.preview-error,
.history-empty-inline {
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.06);
}

.preview-spinner {
  border-color: rgba(37, 99, 235, 0.14);
  border-top-color: var(--primary);
}

.history-list .record-card {
  transform: translateZ(0);
}

.history-list .record-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.history-list .record-card:hover .record-image img,
.table-thumb:hover img,
.record-input-image-button:hover img {
  transform: scale(1.035);
}

.record-image img,
.table-thumb img,
.record-input-image-button img,
.record-dialog-image img {
  transition: transform 0.42s var(--ease-soft);
}

.record-delete:hover,
.button.danger:hover {
  transform: translateY(-1px);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: #d0d5dd;
  box-shadow: var(--shadow-lift);
}

tbody tr td {
  transition: background-color 0.18s var(--ease-out);
}

.redeem-dialog,
.record-dialog,
.generation-overlay,
.image-viewer {
  animation: overlayIn 0.22s var(--ease-out);
}

.redeem-panel,
.record-dialog-panel,
.generation-modal {
  animation: panelIn 0.28s var(--ease-soft);
}

.image-viewer-stage img {
  animation: viewerIn 0.28s var(--ease-soft);
}

.jpt-layer-root {
  position: relative;
  z-index: 10040;
}

.jpt-toast-stack {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 10060;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.jpt-toast {
  min-height: 46px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(228, 231, 236, 0.94);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-soft);
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.14);
  backdrop-filter: blur(18px) saturate(1.12);
  cursor: pointer;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.45;
  overflow-wrap: anywhere;
  pointer-events: auto;
  animation: toastIn 0.28s var(--ease-soft);
}

.jpt-toast.is-leaving {
  animation: toastOut 0.18s var(--ease-out) forwards;
}

.jpt-toast-icon,
.jpt-layer-icon {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
}

.jpt-toast-icon {
  width: 18px;
  height: 18px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.11);
}

.jpt-toast-icon::after,
.jpt-layer-icon::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: inherit;
  background: #fff;
}

.jpt-toast.success {
  border-color: rgba(37, 99, 235, 0.28);
  color: #1d4ed8;
}

.jpt-toast.error {
  border-color: #fecdca;
  color: var(--danger);
}

.jpt-toast.warning {
  border-color: #fed7aa;
  color: var(--warning);
}

.jpt-toast.info {
  border-color: #d0d5dd;
}

.jpt-toast.success .jpt-toast-icon {
  background: var(--success);
}

.jpt-toast.error .jpt-toast-icon {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.1);
}

.jpt-toast.warning .jpt-toast-icon {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(183, 121, 31, 0.12);
}

.jpt-toast.info .jpt-toast-icon {
  background: #475467;
  box-shadow: 0 0 0 4px rgba(71, 84, 103, 0.1);
}

.jpt-layer-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(10px);
  animation: overlayIn 0.22s var(--ease-out);
}

.jpt-layer-overlay.is-leaving {
  animation: overlayOut 0.18s var(--ease-out) forwards;
}

.jpt-layer-panel {
  width: min(420px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(16, 24, 40, 0.3);
  animation: panelIn 0.28s var(--ease-soft);
}

.jpt-layer-overlay.is-leaving .jpt-layer-panel {
  animation: panelOut 0.18s var(--ease-out) forwards;
}

.jpt-layer-head {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding: 22px 22px 18px;
}

.jpt-layer-icon {
  width: 40px;
  height: 40px;
  margin-top: 2px;
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.1);
}

.jpt-layer-panel.warning .jpt-layer-icon {
  background: var(--warning);
  box-shadow: 0 0 0 6px rgba(183, 121, 31, 0.12);
}

.jpt-layer-panel.error .jpt-layer-icon {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(217, 45, 32, 0.1);
}

.jpt-layer-panel.info .jpt-layer-icon {
  background: #475467;
  box-shadow: 0 0 0 6px rgba(71, 84, 103, 0.1);
}

.jpt-layer-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 850;
}

.jpt-layer-head p {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.jpt-layer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #eaecf0;
  padding: 14px 18px;
  background: #f8fafc;
}

.jpt-layer-actions .button {
  min-width: 88px;
}

@keyframes fadeLift {
  from {
    transform: translateY(8px) scale(0.985);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes panelIn {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes viewerIn {
  from {
    transform: scale(0.985);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes overlayOut {
  to {
    opacity: 0;
  }
}

@keyframes panelOut {
  to {
    transform: translateY(10px) scale(0.985);
    opacity: 0;
  }
}

@keyframes toastIn {
  from {
    transform: translateX(18px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  to {
    transform: translateX(18px);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 720px) {
  .card-head::after {
    bottom: -8px;
  }

  .jpt-toast-stack {
    top: 12px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .jpt-layer-overlay {
    align-items: end;
    padding: 10px;
  }

  .jpt-layer-panel {
    width: 100%;
    border-radius: 12px;
  }

  .jpt-layer-head {
    padding: 20px 18px 16px;
  }

  .jpt-layer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 12px;
  }

  .jpt-layer-actions .button:only-child {
    grid-column: 1 / -1;
  }

  .mode-toggle label:has(input:checked)::after {
    right: 10px;
  }

  .history-list .record-card:hover,
  .stat-card:hover,
  .edit-upload-box:hover {
    transform: none;
  }
}

body.page-auth:has(.center-auth-page) {
  min-height: 100vh;
  background:
    linear-gradient(180deg, #ffffff 0%, rgba(248, 250, 252, 0) 260px),
    #f6f8fb;
}

body.page-auth:has(.center-auth-page) .app-shell {
  width: min(100% - 36px, 430px);
  min-height: 100vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding: 28px 0 34px;
}

body.page-auth:has(.center-auth-register) .app-shell {
  width: min(100% - 36px, 450px);
}

.center-auth-page {
  width: 100%;
  align-self: center;
  display: grid;
  place-items: center;
  padding: 0;
}

.center-auth-panel {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.center-auth-top {
  margin-bottom: 26px;
  padding: 0;
  background: transparent;
}

.center-auth-brand {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 28px;
  color: #101828;
  text-align: center;
  text-decoration: none;
}

.center-auth-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  color: #fff;
  font-size: 19px;
  font-weight: 850;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.center-auth-mark svg {
  width: 37px;
  height: 37px;
  display: block;
}

.center-auth-mark .icon-frame,
.center-auth-mark .icon-line,
.center-auth-mark .icon-dot {
  fill: none;
  stroke: #fff;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.center-auth-mark .ai-spark {
  fill: #93c5fd;
  stroke: #fff;
  stroke-width: 0.6;
}

.center-auth-mark .ai-spark.small {
  fill: #fff;
  stroke: none;
  opacity: 0.92;
}

.center-auth-brand strong {
  display: block;
  color: #101828;
  font-size: 28px;
  font-weight: 850;
  line-height: 1.08;
}

.center-auth-brand small {
  display: block;
  margin-top: 5px;
  color: #667085;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
}

.center-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  min-height: 42px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  padding: 4px;
  background: #edf1f5;
}

.center-auth-tabs a {
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #667085;
  font-size: 14px;
  font-weight: 780;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.center-auth-tabs a.active {
  background: #fff;
  color: #101828;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.center-auth-tabs a:not(.active):hover {
  color: #344054;
}

.center-auth-body {
  padding: 0;
}

.center-auth-form {
  display: grid;
  gap: 13px;
}

.center-auth-register .center-auth-form {
  gap: 12px;
}

.center-auth-field {
  display: grid;
  gap: 8px;
}

.center-auth-register .center-auth-field {
  gap: 7px;
}

.center-auth-field span {
  color: #344054;
  font-size: 13px;
  font-weight: 740;
}

.center-auth-field input {
  width: 100%;
  height: 48px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: #101828;
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.center-auth-register .center-auth-field input {
  height: 46px;
}

.center-auth-field input::placeholder {
  color: #98a2b3;
}

.center-auth-field input:hover {
  border-color: #98a2b3;
}

.center-auth-field input:focus {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.center-auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.2);
  transition: box-shadow 0.15s ease, filter 0.15s ease, transform 0.15s ease;
}

.center-auth-submit:hover {
  filter: brightness(0.98);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.24);
}

.center-auth-submit:active {
  transform: translateY(1px);
}

@media (max-width: 720px) {
  body.page-auth:has(.center-auth-page) .app-shell {
    width: min(100% - 32px, 390px);
    padding: 14px 0 20px;
  }

  body.page-auth:has(.center-auth-register) .app-shell {
    width: min(100% - 32px, 390px);
  }

  .center-auth-page {
    padding: 0;
    align-self: start;
    padding-top: clamp(18px, 8vh, 54px);
  }

  .center-auth-top {
    margin-bottom: 20px;
  }

  .center-auth-brand {
    gap: 9px;
    margin-bottom: 24px;
  }

  .center-auth-mark {
    width: 42px;
    height: 42px;
  }

  .center-auth-mark svg {
    width: 30px;
    height: 30px;
  }

  .center-auth-brand strong {
    font-size: 22px;
  }

  .center-auth-brand small {
    margin-top: 3px;
    font-size: 11px;
  }

  .center-auth-tabs {
    min-height: 40px;
    border-radius: 8px;
  }

  .center-auth-tabs a {
    font-size: 13px;
  }

  .center-auth-form {
    gap: 12px;
  }

  .center-auth-field {
    gap: 6px;
  }

  .center-auth-field span {
    font-size: 12px;
  }

  .center-auth-field input {
    height: 46px;
    border-radius: 8px;
    font-size: 14px;
  }

  .center-auth-submit {
    min-height: 46px;
    margin-top: 6px;
    font-size: 14px;
  }
}

.mobile-menu-toggle {
  display: none;
}

@media (max-width: 720px) {
  .app-topbar {
    position: sticky;
    top: 8px;
    z-index: 1000;
    display: grid !important;
    grid-template-columns: 44px 42px !important;
    justify-content: space-between;
    align-items: center;
    gap: 0;
    min-height: 58px;
    padding: 8px 10px;
    border-radius: 14px;
    overflow: visible !important;
  }

  .topbar-brand {
    width: 44px;
    grid-template-columns: 44px !important;
    gap: 0;
    padding: 0;
  }

  .brand-copy {
    display: none;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .brand-mark svg {
    width: 31px;
    height: 31px;
  }

  .mobile-menu-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    place-content: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
  }

  .mobile-menu-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
    transition: transform 0.18s ease, opacity 0.18s ease;
  }

  .app-topbar.is-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .app-topbar.is-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .app-topbar.is-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .topbar-right {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    width: min(280px, calc(100vw - 24px));
    display: none !important;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(228, 231, 236, 0.96);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.16);
    backdrop-filter: blur(16px) saturate(1.12);
  }

  .app-topbar.is-menu-open .topbar-right {
    display: grid !important;
  }

  .topbar-nav {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
  }

  .topbar-nav a {
    height: 38px;
    min-height: 38px;
    justify-content: flex-start;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 800;
  }

  .topbar-account {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
  }

  .topbar-account .balance {
    grid-column: auto;
    justify-content: flex-start;
  }

  .topbar-account .balance,
  .topbar-account .nav-redeem,
  .topbar-account .logout-link {
    height: 36px;
    min-height: 36px;
    justify-content: flex-start;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
  }

  body.has-mobile-menu .app-shell {
    overflow: visible;
  }
}

@media (max-width: 420px) {
  .topbar-right {
    right: 0;
    width: min(260px, calc(100vw - 20px));
  }

  .topbar-nav a,
  .topbar-account .balance,
  .topbar-account .nav-redeem,
  .topbar-account .logout-link {
    padding: 0 6px;
    font-size: 12px;
  }
}

@media (max-width: 720px) {
  .app-topbar .topbar-right {
    min-height: 0 !important;
  }

  .app-topbar .topbar-right .topbar-nav,
  .app-topbar .topbar-right .topbar-account {
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    padding: 6px !important;
  }

  .app-topbar .topbar-right .topbar-nav a,
  .app-topbar .topbar-right .topbar-account .balance,
  .app-topbar .topbar-right .topbar-account .nav-redeem,
  .app-topbar .topbar-right .topbar-account .logout-link {
    width: 100% !important;
    min-width: 0 !important;
    height: 38px !important;
    min-height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 12px !important;
    overflow: hidden !important;
    border-radius: 10px !important;
    text-align: left !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .app-topbar .topbar-right .topbar-account .balance {
    grid-column: auto !important;
  }
}

.mobile-topbar-menu {
  display: none;
}

@media (min-width: 721px) {

  .mobile-menu-toggle,
  .mobile-topbar-menu {
    display: none !important;
  }
}

@media (max-width: 720px) {
  .app-topbar {
    position: sticky !important;
    top: 8px !important;
    z-index: 1000 !important;
    display: grid !important;
    grid-template-columns: 44px 44px !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 60px !important;
    padding: 8px 10px !important;
    overflow: visible !important;
    border-radius: 14px !important;
  }

  .app-topbar>.topbar-brand {
    width: 44px !important;
    min-width: 44px !important;
    display: block !important;
    padding: 0 !important;
  }

  .app-topbar>.topbar-brand .brand-copy {
    display: none !important;
  }

  .app-topbar>.topbar-brand .brand-mark {
    width: 44px !important;
    height: 44px !important;
    border-radius: 13px !important;
  }

  .app-topbar>.topbar-brand .brand-mark svg {
    width: 32px !important;
    height: 32px !important;
  }

  .app-topbar>.topbar-right {
    display: none !important;
  }

  .mobile-menu-toggle {
    width: 44px !important;
    height: 44px !important;
    display: grid !important;
    place-content: center !important;
    gap: 5px !important;
    padding: 0 !important;
    border: 1px solid var(--line) !important;
    border-radius: 13px !important;
    background: #fff !important;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08) !important;
  }

  .mobile-menu-toggle span {
    width: 18px !important;
    height: 2px !important;
    display: block !important;
    border-radius: 999px !important;
    background: var(--text) !important;
    transition: transform 0.18s ease, opacity 0.18s ease !important;
  }

  .app-topbar.is-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg) !important;
  }

  .app-topbar.is-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0 !important;
  }

  .app-topbar.is-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg) !important;
  }

  .mobile-topbar-menu {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    width: min(280px, calc(100vw - 24px)) !important;
    display: none !important;
    padding: 10px !important;
    border: 1px solid rgba(228, 231, 236, 0.96) !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.16) !important;
    backdrop-filter: blur(16px) saturate(1.12) !important;
  }

  .app-topbar.is-menu-open .mobile-topbar-menu {
    display: grid !important;
    gap: 8px !important;
  }

  .mobile-menu-balance {
    min-width: 0 !important;
    min-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 12px !important;
    overflow: hidden !important;
    border: 1px solid rgba(37, 99, 235, 0.22) !important;
    border-radius: 11px !important;
    background: rgba(239, 246, 255, 0.95) !important;
    color: var(--primary-dark) !important;
    font-size: 13px !important;
    font-weight: 850 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .mobile-menu-nav,
  .mobile-menu-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  .mobile-menu-nav a,
  .mobile-menu-actions a,
  .mobile-menu-actions button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 12px !important;
    border: 1px solid transparent !important;
    border-radius: 11px !important;
    background: #f8fafc !important;
    color: var(--text-soft) !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    text-align: left !important;
    text-decoration: none !important;
  }

  .mobile-menu-nav a.active,
  .mobile-menu-actions button {
    border-color: #065f46 !important;
    background: #065f46 !important;
    color: #fff !important;
  }

  .mobile-menu-nav a:not(.active):hover,
  .mobile-menu-actions a:hover {
    border-color: #d0d5dd !important;
    background: #eef2f6 !important;
    color: var(--text) !important;
  }
}

@media (max-width: 380px) {
  .mobile-topbar-menu {
    width: min(260px, calc(100vw - 18px)) !important;
  }
}

.site-header {
  position: sticky;
  top: 12px;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px solid rgba(228, 231, 236, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.07);
  backdrop-filter: blur(16px) saturate(1.12);
}

.site-brand {
  min-width: 0;
  display: inline-grid;
  grid-template-columns: 42px minmax(0, auto);
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.site-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22) 0%, rgba(6, 182, 212, 0.18) 100%);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.16);
}

.site-brand-mark svg {
  width: 31px;
  height: 31px;
  display: block;
}

.site-brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.site-brand-mark .icon-frame,
.site-brand-mark .icon-line,
.site-brand-mark .icon-dot {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-brand-mark .ai-spark {
  fill: #93c5fd;
  stroke: #ffffff;
  stroke-width: 0.6;
}

.site-brand-mark .ai-spark.small {
  fill: #ffffff;
  stroke: none;
  opacity: 0.92;
}

.site-brand-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 20px;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-nav {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.site-nav a {
  height: 36px;
  min-width: 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 0 14px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.site-nav a.active {
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.site-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.site-balance,
.site-action {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.site-balance {
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, #ffffff);
  background: color-mix(in srgb, var(--primary) 8%, #ffffff);
  color: var(--primary-dark);
  text-overflow: ellipsis;
}

.site-mobile-balance {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
  border: 1px solid rgba(var(--primary-rgb), 0.22);
  background: rgba(var(--primary-rgb), 0.10);
  color: var(--primary);
}

.site-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-soft);
  text-decoration: none;
}

.site-action-primary {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #fff;
}

/* App pages: primary blue + sky second stop（与顶栏 Logo 方块一致） */
body.page-app,
body.page-records,
body.page-featured,
body.page-account,
body.page-help {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #e8f0ff;
  --brand-gradient: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
}

body.page-app .button.primary,
body.page-records .button.primary,
body.page-featured .button.primary,
body.page-admin .button.primary,
body.page-account .button.primary,
body.page-help .button.primary,
body.page-app .topbar-account .nav-redeem,
body.page-records .topbar-account .nav-redeem,
body.page-featured .topbar-account .nav-redeem,
body.page-admin .topbar-account .nav-redeem,
body.page-account .topbar-account .nav-redeem,
body.page-help .topbar-account .nav-redeem,
body.page-app .topbar-nav a.active,
body.page-records .topbar-nav a.active,
body.page-featured .topbar-nav a.active,
body.page-admin .topbar-nav a.active,
body.page-account .topbar-nav a.active,
body.page-help .topbar-nav a.active,
body.page-app .site-action-primary,
body.page-records .site-action-primary,
body.page-featured .site-action-primary,
body.page-admin .site-action-primary,
body.page-account .site-action-primary,
body.page-help .site-action-primary {
  background: var(--brand-gradient);
  border-color: transparent;
}

body.page-app .site-nav a.active,
body.page-records .site-nav a.active,
body.page-featured .site-nav a.active,
body.page-admin .site-nav a.active,
body.page-account .site-nav a.active,
body.page-help .site-nav a.active {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
}

body.page-app .mode-toggle label:has(input:checked),
body.page-records .mode-toggle label:has(input:checked),
body.page-admin .mode-toggle label:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.35);
  background: color-mix(in srgb, #2563eb 12%, #ffffff);
  color: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12), 0 10px 22px rgba(37, 99, 235, 0.1);
}

body.page-app .mode-toggle label:has(input:checked) span,
body.page-records .mode-toggle label:has(input:checked) span,
body.page-admin .mode-toggle label:has(input:checked) span {
  color: #0f172a;
}

body.page-app .button.secondary.active,
body.page-records .button.secondary.active,
body.page-account .button.secondary.active {
  border-color: rgba(37, 99, 235, 0.35);
  background: color-mix(in srgb, #2563eb 10%, #ffffff);
  color: #1d4ed8;
}

body.page-admin .button.secondary.active {
  border-color: rgba(var(--primary-rgb), 0.35);
  background: color-mix(in srgb, var(--primary) 10%, #ffffff);
  color: var(--primary-dark);
}

body.page-app .button.primary:hover,
body.page-records .button.primary:hover,
body.page-admin .button.primary:hover,
body.page-account .button.primary:hover,
body.page-app .site-action-primary:hover,
body.page-records .site-action-primary:hover,
body.page-admin .site-action-primary:hover,
body.page-account .site-action-primary:hover {
  filter: brightness(1.02);
  box-shadow: 0 16px 30px rgba(var(--primary-rgb), 0.22);
}

body.page-app input:focus,
body.page-records input:focus,
body.page-admin input:focus,
body.page-account input:focus,
body.page-app select:focus,
body.page-records select:focus,
body.page-admin select:focus,
body.page-account select:focus,
body.page-app textarea:focus,
body.page-records textarea:focus,
body.page-admin textarea:focus,
body.page-account textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.14);
}

.poster-editor-preview-wrap {
  display: grid;
  gap: 8px;
}

.poster-create-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 14px;
  align-items: start;
}

.poster-create-left {
  display: grid;
  gap: 12px;
}

.poster-editor-preview {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 0;
  min-height: 220px;
  max-height: 62vh;
  overflow: auto;
}

.poster-editor-preview img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  user-select: none;
  -webkit-user-drag: none;
  object-fit: contain;
}

.poster-editor-qr {
  position: absolute;
  left: 0;
  top: 0;
  width: 100px;
  height: 100px;
  border: 2px dashed #2563eb;
  border-radius: 8px;
  background-color: rgba(37, 99, 235, 0.12);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  pointer-events: none;
}

.poster-modal-figure {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #f1f5f9;
}

.poster-modal-figure.is-loading {
  aspect-ratio: 800 / 420;
  min-height: 140px;
}

.poster-modal-skeleton {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  background: linear-gradient(145deg, #e2e8f0 0%, #f8fafc 50%, #e2e8f0 100%);
}

.poster-modal-figure.is-loading .poster-modal-skeleton {
  opacity: 1;
}

.poster-modal-skeleton-shimmer {
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 45%,
    transparent 90%
  );
  animation: posterSkeletonShimmer 1.35s ease-in-out infinite;
}

@keyframes posterSkeletonShimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.poster-modal-skeleton-block {
  position: absolute;
  left: 10%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  opacity: 0.85;
}

.poster-modal-skeleton-block--wide {
  top: 22%;
  width: 72%;
}

.poster-modal-skeleton-block--mid {
  top: 38%;
  width: 48%;
}

.poster-modal-skeleton-block--short {
  top: 52%;
  width: 32%;
}

.poster-modal-image {
  position: relative;
  z-index: 1;
  border: 0;
  border-radius: 0;
  transition: opacity 0.22s ease;
}

.poster-modal-figure.is-loading .poster-modal-image {
  opacity: 0;
}

.poster-modal-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  background: rgba(248, 250, 252, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.poster-modal-figure.is-loading .poster-modal-loading {
  opacity: 1;
}

.poster-modal-loading-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 750;
  color: #64748b;
}

.poster-spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid rgba(37, 99, 235, 0.18);
  border-top-color: rgba(37, 99, 235, 0.85);
  animation: posterSpin .9s linear infinite;
}

@keyframes posterSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
  .poster-create-layout {
    grid-template-columns: 1fr;
  }
}

.site-menu-button,
.site-mobile-menu {
  display: none;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: minmax(160px, 1fr) auto;
  }

  .site-nav {
    order: 3;
    grid-column: 1 / -1;
    justify-self: stretch;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .site-actions {
    grid-column: 2;
  }
}

@media (max-width: 720px) {
  .site-header {
    top: 8px;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    min-height: 60px;
    padding: 8px 10px;
    border-radius: 14px;
  }

  .site-brand {
    width: 100%;
    grid-template-columns: 44px minmax(0, 1fr);
    justify-content: start;
    gap: 10px;
  }

  .site-nav,
  .site-actions,
  .site-menu-button,
  .site-mobile-menu {
    display: none;
  }

  .site-brand-name {
    display: block;
    align-self: center;
    font-size: 18px;
  }

  .site-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }

  .app-shell {
    /* 底栏约 74px + 余量；含安全区避免最后一张卡片的操作按钮被遮挡 */
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 720px) {
  body.page-admin .mobile-bottom-nav {
    display: none !important;
  }

  body.page-admin .app-shell {
    padding-bottom: 24px !important;
  }
}

/*
 * 窄屏性能（尤其微信内置浏览器）：backdrop-filter 会显著拖慢首帧、滚动与点击合成。
 * 以下在 ≤720px 对常用前台页改用实色卡片/顶栏，并收敛阴影与 hover 位移动画。
 */
@media (max-width: 720px) {
  body.page-app,
  body.page-records,
  body.page-account,
  body.page-help {
    background: var(--bg);
  }

  body.page-app .site-header,
  body.page-records .site-header,
  body.page-account .site-header,
  body.page-help .site-header {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 14px rgba(16, 24, 40, 0.06);
  }

  body.page-app .card,
  body.page-app .stat-card,
  body.page-records .card,
  body.page-records .stat-card,
  body.page-account .card,
  body.page-help .card,
  body.page-app .history-list .record-card,
  body.page-records .history-list .record-card {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  }

  body.page-app .history-list .record-card:hover,
  body.page-records .history-list .record-card:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.07);
  }

  body.page-app .history-list .record-card:hover .record-image img,
  body.page-records .history-list .record-card:hover .record-image img {
    transform: none;
  }

  body.page-app .stat-card:hover,
  body.page-records .stat-card:hover {
    transform: none;
  }

  body.page-app .record-image img,
  body.page-records .record-image img,
  body.page-account .record-image img {
    transition: none;
  }

  body.page-auth:has(.auth-pro-page) .auth-pro-shell {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: #fff;
  }
}

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 720px) {
  .mobile-bottom-nav {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    /* 高于主内容区（含 backdrop-filter 卡片）叠层，且低于全屏弹层 10000 */
    z-index: 9990;
    pointer-events: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    padding: 7px;
    border: 1px solid rgba(228, 231, 236, 0.96);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 38px rgba(16, 24, 40, 0.16);
    /* 底栏毛玻璃在低端机/微信内核上易拖慢点击合成，改为实底 */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    /* 独立合成层，减少与主内容滚动/滤镜抢合成 */
    isolation: isolate;
    transform: translateZ(0);
  }

  .mobile-bottom-nav.mobile-bottom-nav--5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    padding: 6px 5px;
  }

  .mobile-bottom-nav.mobile-bottom-nav--5 a,
  .mobile-bottom-nav.mobile-bottom-nav--5 button {
    font-size: 11px;
    letter-spacing: -0.02em;
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    min-width: 0;
    min-height: 48px;
    display: grid;
    place-items: center;
    gap: 3px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
  }

  .mobile-bottom-nav .mobile-nav-icon {
    width: 23px;
    height: 23px;
    display: grid;
    place-items: center;
    line-height: 1;
  }

  .mobile-bottom-nav .mobile-nav-icon svg {
    width: 23px;
    height: 23px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-bottom-nav a.active,
  .mobile-bottom-nav button.active {
    background: var(--brand-gradient, linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%));
    color: #fff;
  }

  /* mobile-account-sheet 已废弃：改为 /account 独立页面 */
}

/* 敏感信息页面（实名、充值等）：同行控件 + 稳重视觉 */
.sensitive-surface {
  align-content: start;
}

.sensitive-card {
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 6px 20px rgba(15, 23, 42, 0.04);
}

.sensitive-card .card-head {
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid #f1f5f9;
}

.sensitive-card .eyebrow {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sensitive-card .card-head h2 {
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sensitive-card .badge {
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-weight: 650;
}

.sensitive-notice {
  margin-top: 0;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #64748b;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  line-height: 1.55;
  padding: 12px 14px;
}

.sensitive-form {
  gap: 16px;
}

.sensitive-form .field span {
  color: #475569;
  font-size: 13px;
  font-weight: 650;
}

.sensitive-card input,
.sensitive-card select {
  border-color: #cbd5e1;
  border-radius: 6px;
  font-size: 15px;
}

.sensitive-card input:focus,
.sensitive-card select:focus {
  border-color: #475569;
  box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.14);
}

.realname-phone-combo {
  gap: 8px;
}

.realname-phone-sms-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  width: 100%;
}

.realname-phone-input {
  min-width: 0;
  width: 100%;
}

.realname-phone-input.realname-phone-input--readonly {
  cursor: default;
  color: #475569;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.sensitive-card .realname-sms-btn {
  min-height: 44px;
  height: 44px;
  align-self: stretch;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
}

.sensitive-card .realname-sms-btn:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #f1f5f9;
}

body.page-account .account-page-card {
  padding: 12px 16px 20px;
  min-width: 0;
  overflow-x: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.account-profile-merged {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.account-profile-merged-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 16px 16px 14px;
  background: linear-gradient(180deg, #eef5ff 0%, rgba(248, 250, 252, 0.65) 52%, rgba(255, 255, 255, 0) 100%);
}

.account-profile-merged .account-avatar--hero {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 0;
  box-shadow: none;
  font-size: 21px;
}

.account-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  /* 与 default-avatar.svg 底色一致（主色浅底 #eff6ff）；裂图或透明 PNG 时与系统蓝一致 */
  background: #eff6ff;
  color: #2563eb;
  font-weight: 900;
  font-size: 20px;
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.22);
  flex-shrink: 0;
}

.account-avatar--hero {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  font-size: 21px;
  box-shadow: none;
}

.account-meta--hero {
  flex: 1;
  min-width: 0;
  padding-top: 0;
}

.account-meta--hero .account-name {
  font-size: 1.05rem;
  font-weight: 780;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.account-profile-merged-balance.account-points-slab {
  margin-top: 0;
  padding: 16px 16px 18px;
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  box-shadow: none;
  display: grid;
  gap: 14px;
}

.account-points-slab-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.account-points-slab-value {
  flex: 1;
  min-width: 0;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.25;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.account-points-value-prefix,
.account-points-value-num {
  color: inherit;
}

.account-points-value-num {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

a.account-points-detail-btn {
  flex-shrink: 0;
  align-self: center;
  min-height: 36px;
  padding-left: 12px;
  padding-right: 12px;
  font-size: 13px;
  font-weight: 750;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

a.account-points-detail-btn.button.secondary:hover,
a.account-points-detail-btn.button.secondary.active {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

a.account-points-recharge-btn.button.secondary {
  display: inline-flex;
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  text-decoration: none;
  min-height: 44px;
  font-size: 15px;
  font-weight: 750;
  color: var(--text);
}

a.account-points-recharge-btn.button.secondary:hover,
a.account-points-recharge-btn.button.secondary.active {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

body.page-account .account-page-card > .account-promo-banner,
body.page-account .account-page-card > a.account-promo-banner {
  display: block;
  margin-top: 14px;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  min-width: 0;
  background: var(--surface-soft);
}

body.page-account .account-page-card > .account-promo-banner img,
body.page-account .account-page-card > a.account-promo-banner img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
  object-fit: contain;
  object-position: center top;
}

a.account-promo-banner:active {
  opacity: 0.94;
}

/* 首页工作台：与「我的」页同一套后台横幅（account_banner_*） */
body.page-app .workspace-main > .workspace-page-banner,
body.page-app .workspace-main > a.workspace-page-banner {
  display: block;
  margin-top: 6px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  min-width: 0;
  background: var(--surface-soft);
}

body.page-app .workspace-main > .workspace-page-banner img,
body.page-app .workspace-main > a.workspace-page-banner img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
  object-fit: contain;
  object-position: center top;
}

body.page-app .workspace-main > a.workspace-page-banner:active {
  opacity: 0.94;
}

/* 首页工作台：系统邀请条（与卡片风格一致，替代大图横幅） */
.workspace-invite-strip {
  margin-top: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.96) 0%, rgba(255, 255, 255, 0.99) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 8px 26px -14px rgba(15, 23, 42, 0.1);
  min-width: 0;
}

.workspace-invite-strip__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  min-width: 0;
}

.workspace-invite-strip__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #2563eb;
  background: rgba(239, 246, 255, 0.98);
  border: 1px solid rgba(191, 219, 254, 0.75);
}

.workspace-invite-strip__text {
  flex: 1;
  min-width: 0;
}

.workspace-invite-strip__title {
  margin: 0 0 2px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.workspace-invite-strip__desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #64748b;
}

.workspace-invite-strip .workspace-invite-strip__btn.button.small {
  flex-shrink: 0;
  align-self: center;
  white-space: nowrap;
  /* 与左侧图标块（40px）视觉对齐，避免「按钮偏下」观感 */
  min-height: 40px;
  box-sizing: border-box;
}

@media (max-width: 420px) {
  .workspace-invite-strip__inner {
    flex-wrap: wrap;
  }

  .workspace-invite-strip__btn {
    width: 100%;
    justify-content: center;
  }
}

.account-meta {
  min-width: 0;
}

.account-name {
  font-weight: 750;
  color: var(--text-soft);
  letter-spacing: -0.01em;
}

.account-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.account-settings-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}

.account-settings-icon {
  display: block;
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}

.account-settings-link:hover {
  border-color: rgba(148, 163, 184, 0.75);
  color: var(--text-soft);
  background: var(--surface-soft);
}

.account-settings-link:active {
  opacity: 0.9;
}

.account-sub {
  font-size: 12px;
}

.account-verify {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.account-verify .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #cbd5e1;
  box-shadow: 0 0 0 4px rgba(203, 213, 225, 0.35);
}

.account-verify.is-verified {
  color: #1d4ed8;
}

.account-verify.is-verified .dot {
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

a.account-verify--link {
  text-decoration: none;
  color: #0284c7;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 10px;
  margin-left: -4px;
  margin-right: -4px;
  padding: 4px 4px 4px 4px;
}

a.account-verify--link:active {
  opacity: 0.9;
}

.account-balance-card {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.08), rgba(6, 182, 212, 0.06));
}

.account-balance-value {
  font-size: 20px;
  font-weight: 950;
  color: #0f172a;
}

.account-balance-num {
  font-size: 22px;
  font-weight: 950;
  color: #0f172a;
  letter-spacing: 0.2px;
}

/* 资料编辑页：更现代的头像选择（自动上传） */
.profile-modern {
  display: grid;
  gap: 14px;
}

.profile-avatar-form {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.profile-avatar-picker {
  position: relative;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
}

.profile-avatar-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.profile-avatar-preview {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
  color: #fff;
  font-weight: 950;
  font-size: 30px;
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-avatar-badge {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(228, 231, 236, 0.96);
  background: rgba(255, 255, 255, 0.96);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
  color: #2563eb;
}

.profile-avatar-badge svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-avatar-hint {
  font-size: 12px;
}

.profile-phone-form {
  margin-top: 2px;
}

.profile-account-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.profile-account-footer .account-section-title {
  margin-bottom: 10px;
}

body.page-account main.grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
}

/* 积分明细（/credits）：全局 table 在窄屏为 nowrap+ellipsis，时间列会被「…」截断；此表单独允许换行 */
@media (max-width: 720px) {
  body.page-account .credits-ledger-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  body.page-account .credits-ledger-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }

  body.page-account .credits-ledger-table th,
  body.page-account .credits-ledger-table td {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    vertical-align: top;
  }

  body.page-account .credits-ledger-table td:nth-child(3) strong,
  body.page-account .credits-ledger-table td:nth-child(4) strong {
    white-space: nowrap;
  }
}

/* 邀请好友页（/invite_friends） */
.invite-friends-main {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: grid;
  gap: 8px;
  align-content: start;
}

.invite-hero-card {
  border-radius: 16px;
  padding: 18px 16px 20px;
  background: var(--brand-gradient);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.invite-hero-top {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.invite-hero-title {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 950;
  letter-spacing: -0.02em;
  color: #fff;
  flex: 1 1 auto;
  min-width: 0;
}

.invite-hero-rebate {
  flex: 0 1 auto;
  max-width: min(19.5rem, 88vw);
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.invite-hero-rebate-text {
  margin: 0;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.96);
  text-align: right;
}

/* 充值返利角标：强制单行（配合加宽容器） */
.invite-hero-rebate-text--nowrap {
  white-space: nowrap;
  letter-spacing: -0.03em;
}

@media (max-width: 360px) {
  .invite-hero-rebate-text--nowrap {
    font-size: 10px;
  }
}

.invite-hero-rebate-text strong {
  font-weight: 950;
  color: #fff;
}

.invite-hero-rules {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.invite-hero-badge {
  max-width: 100%;
  font-size: 11px;
  font-weight: 780;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 6px 12px;
}

.invite-hero-stats {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.invite-hero-stat {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

.invite-hero-stat-value {
  font-size: clamp(26px, 7vw, 32px);
  font-weight: 950;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.invite-hero-stat-label {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 750;
  color: rgba(255, 255, 255, 0.88);
}

.invite-hero-stat-divider {
  width: 1px;
  align-self: stretch;
  min-height: 44px;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

.invite-poster-card {
  padding: 10px 14px 14px;
  overflow-x: hidden;
}

.invite-poster-viewport {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.invite-poster-figure.poster-modal-figure {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
}

.invite-poster-figure.is-loading {
  aspect-ratio: unset;
  min-height: min(38vh, 260px);
}

.invite-poster-figure .poster-modal-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  vertical-align: top;
}

.invite-poster-tpl-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  min-width: 0;
}

.invite-poster-tpl-row .invite-poster-tpl-cycle {
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
  font-weight: 780;
}

.invite-poster-tpl-row .invite-poster-tpl-caption {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
}

.invite-poster-tpl-row--single {
  justify-content: flex-end;
}

.invite-poster-actions {
  margin-top: 12px;
  display: flex;
  justify-content: stretch;
}

.invite-poster-actions .button {
  width: 100%;
}

.invite-copy-card {
  padding: 16px 14px;
}

.invite-copy-card--compact {
  padding: 14px 12px;
}

.invite-copy-card--link-first {
  padding: 14px 12px;
}

.invite-copy-card-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
}

.invite-url-copy-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.invite-url-copy-value {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e4e7ec;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  word-break: break-all;
  line-height: 1.45;
  color: #0f172a;
}

.invite-copy-card--link-first .invite-url-copy-row + .invite-url-copy-row {
  margin-top: 12px;
}

.invite-url-copy-tag {
  font-weight: 750;
  font-size: 12px;
  color: #64748b;
  margin-right: 8px;
}

.invite-url-copy-code {
  font-weight: 800;
  letter-spacing: 0.06em;
}

.invite-share-rows {
  display: grid;
  gap: 8px;
}

.invite-share-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.invite-share-tag {
  flex: 0 0 auto;
  width: 28px;
  display: grid;
  place-items: center;
  align-self: stretch;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 900;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.invite-share-value {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e4e7ec;
  background: #f8fafc;
  font-weight: 850;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: #0f172a;
  display: flex;
  align-items: center;
}

.invite-share-value--url {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  word-break: break-all;
  line-height: 1.4;
}

.invite-copy-btn--sm {
  min-width: 56px !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
  font-size: 12px !important;
  min-height: 36px !important;
}

.invite-copy-block + .invite-copy-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(228, 231, 236, 0.95);
}

.invite-copy-label {
  font-size: 13px;
  font-weight: 850;
  color: #0f172a;
  margin-bottom: 8px;
}

.invite-copy-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.invite-copy-value {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e4e7ec;
  background: #f8fafc;
  font-weight: 850;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: #0f172a;
}

.invite-copy-value--url {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  word-break: break-all;
  line-height: 1.45;
}

.invite-copy-btn {
  flex: 0 0 auto;
  min-width: 72px;
  border-radius: 12px !important;
  font-weight: 850 !important;
  background: var(--brand-gradient) !important;
  border-color: transparent !important;
  color: #fff !important;
}

.invite-copy-btn:hover {
  filter: brightness(1.03);
}

.invite-copy-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.invite-rewards-card {
  padding: 16px 14px;
}

.invite-rewards-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
}

.invite-rewards-empty {
  margin: 0;
  text-align: center;
  font-size: 13px;
  padding: 18px 8px;
}

.invite-rewards-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.invite-rewards-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(228, 231, 236, 0.95);
  background: rgba(248, 250, 252, 0.85);
  font-size: 13px;
}

.invite-rewards-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.invite-rewards-time {
  font-weight: 750;
  color: #64748b;
  font-size: 12px;
}

.invite-rewards-delta {
  flex: 0 0 auto;
  font-weight: 950;
  color: #1d4ed8;
  font-size: 15px;
}

.invite-rewards-note {
  font-size: 12px;
  line-height: 1.45;
}

.invite-back-wrap {
  text-align: center;
  margin: 4px 0 8px;
}

.invite-back-link {
  font-size: 14px;
  font-weight: 800;
  color: #2563eb;
  text-decoration: none;
}

.invite-back-link:hover {
  text-decoration: underline;
}

.account-body {
  margin-top: 2px;
}

.account-section {
  margin-top: 20px;
}

.account-section:first-child {
  margin-top: 14px;
}

.account-section--help {
  margin-top: 18px;
}

.account-section--quick {
  margin-top: 14px;
}

.account-section--account {
  margin-top: 22px;
  padding-top: 4px;
  border-top: 1px solid rgba(226, 232, 240, 0.95);
}

.account-quick-grid {
  display: grid;
  gap: 10px;
}

.account-quick-tile {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(228, 231, 236, 0.96);
  background: rgba(248, 250, 252, 0.92);
  text-decoration: none;
  color: var(--text);
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.page-account .account-quick-tile--media {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

body.page-account .account-quick-tile--media:hover {
  border-color: rgba(148, 163, 184, 0.55);
}

body.page-account .account-quick-tile-icon {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(var(--primary-rgb), 0.38);
}

body.page-account .account-quick-tile-icon svg {
  display: block;
}

body.page-account .account-quick-tile-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.account-quick-tile:hover {
  border-color: rgba(148, 163, 184, 0.55);
}

.account-quick-tile.is-featured {
  border-color: rgba(37, 99, 235, 0.38);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(6, 182, 212, 0.06));
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.12);
}

body.page-account .account-quick-tile--media.is-featured {
  border-color: rgba(var(--primary-rgb), 0.22);
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.12);
}

.account-quick-tile-title {
  font-weight: 900;
  font-size: 15px;
  color: #0f172a;
}

.account-quick-tile-desc {
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

.account-section-actions--inline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 380px) {
  .account-section-actions--inline {
    grid-template-columns: 1fr;
  }
}

.account-section-title {
  margin: 0 0 8px 4px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  color: #64748b;
}

.account-section-actions {
  display: grid;
  gap: 10px;
}

.account-action {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(228, 231, 236, 0.96);
  background: rgba(248, 250, 252, 0.9);
  text-decoration: none;
  color: var(--text);
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

button.account-action {
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.account-action span {
  font-weight: 900;
}

.account-action.is-highlight {
  border-color: rgba(37, 99, 235, 0.36);
  background: rgba(37, 99, 235, 0.08);
}

.account-action--compact {
  padding: 12px 14px;
  gap: 0;
}

.account-action--danger {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(254, 242, 242, 0.65);
}

.account-action--danger span {
  color: #b91c1c;
}

@media (max-width: 720px) {
  body.page-account .account-page-card {
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 10px;
  }

  /* 顶部资料 + 积分：同一资料卡内分区，不再套第二层卡片 */
  body.page-account .account-profile-merged {
    position: relative;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    background:
      radial-gradient(100% 85% at 100% -5%, rgba(99, 102, 241, 0.2), transparent 52%),
      radial-gradient(90% 70% at -8% 10%, rgba(14, 165, 233, 0.16), transparent 48%),
      linear-gradient(165deg, #f4f7ff 0%, #fafbff 38%, #ffffff 100%);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.85) inset,
      0 14px 42px -18px rgba(15, 23, 42, 0.22),
      0 6px 18px rgba(var(--primary-rgb), 0.1);
    overflow: hidden;
  }

  body.page-account .account-profile-merged::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.45) 48%, transparent 56%);
    opacity: 0.55;
  }

  body.page-account .account-profile-merged-top {
    position: relative;
    z-index: 1;
    padding: 20px 18px 18px;
    gap: 14px;
    background: transparent;
  }

  body.page-account .account-profile-merged .account-avatar--hero {
    width: 60px;
    height: 60px;
    font-size: 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 0;
    box-shadow: none;
  }

  body.page-account .account-meta--hero .account-name {
    font-size: 1.12rem;
    font-weight: 850;
    letter-spacing: -0.03em;
    color: #0f172a;
  }

  body.page-account .account-settings-link {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.82);
    color: #475569;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  }

  body.page-account .account-verify,
  body.page-account a.account-verify--link {
    margin-top: 8px;
    padding: 5px 10px 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.95);
  }

  body.page-account .account-verify.is-verified {
    color: #1d4ed8;
    background: rgba(239, 246, 255, 0.95);
    border-color: rgba(147, 197, 253, 0.65);
  }

  body.page-account .account-verify.is-unverified:not(.account-verify--link) {
    color: #64748b;
  }

  body.page-account a.account-verify--link {
    background: rgba(240, 253, 250, 0.95);
    border-color: rgba(45, 212, 191, 0.35);
    color: #0f766e;
  }

  body.page-account .account-profile-merged-balance.account-points-slab {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 16px 18px 18px;
    border: 0;
    border-radius: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.28);
    background: transparent;
    box-shadow: none;
    gap: 12px;
  }

  body.page-account .account-points-slab-value {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    line-height: 1.1;
  }

  body.page-account .account-points-value-prefix {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #64748b;
  }

  body.page-account .account-points-value-num {
    font-size: 1.55rem;
    font-weight: 950;
    letter-spacing: -0.04em;
    line-height: 1.05;
    background: linear-gradient(120deg, #1d4ed8 0%, #4f46e5 42%, #0d9488 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  body.page-account a.account-points-detail-btn.button.secondary {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border-color: rgba(226, 232, 240, 0.98);
    background: rgba(255, 255, 255, 0.9);
    color: #334155;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  }

  body.page-account a.account-points-recharge-btn.button.secondary {
    min-height: 48px;
    border-radius: 16px;
    border: 0;
    font-size: 15px;
    font-weight: 850;
    color: #fff;
    background: linear-gradient(118deg, #2563eb 0%, #4f46e5 45%, #0d9488 100%);
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.32);
  }

  body.page-account a.account-points-recharge-btn.button.secondary:hover,
  body.page-account a.account-points-recharge-btn.button.secondary.active {
    color: #fff;
    filter: brightness(1.06);
    border-color: transparent;
    background: linear-gradient(118deg, #2563eb 0%, #4f46e5 45%, #0d9488 100%);
  }

  body.page-account a.account-points-detail-btn.button.secondary:hover {
    background: #fff;
    border-color: rgba(var(--primary-rgb), 0.25);
    color: #1e293b;
  }
}

/* 推广海报弹窗：始终在视口内居中，避免移动端与其它 redeem 弹窗一样贴底导致按钮被遮挡 */
.redeem-dialog.poster-modal-dialog {
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}

.poster-modal-panel {
  width: min(560px, calc(100vw - 28px));
  max-height: min(85vh, calc(100dvh - 32px), 900px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.2);
}

.poster-modal-tpl-bar {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  justify-items: stretch;
}

.poster-modal-tpl-cycle {
  width: 100%;
  font-weight: 780;
}

.poster-modal-tpl-caption {
  margin: 0;
  font-size: 12px;
  text-align: center;
  line-height: 1.45;
}

.poster-modal-panel .poster-modal-image {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #fff;
  display: block;
}

.poster-modal-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.poster-template-switch,
.poster-modal-template-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

.poster-tpl-arrow {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.poster-tpl-arrow:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.06);
}

.poster-tpl-pills {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.poster-tpl-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 750;
  background: #f8fafc;
  color: var(--text-soft);
  cursor: pointer;
  max-width: 100%;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.poster-tpl-pill:hover {
  border-color: rgba(37, 99, 235, 0.25);
  color: #1d4ed8;
}

.poster-tpl-pill.is-active {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.poster-tpl-hint {
  margin: 0;
  font-size: 13px;
  text-align: center;
  width: 100%;
}

.poster-modal-template-switch {
  margin-bottom: 4px;
}

/* —— 精选页：窄栏信息流 + 小预览图 —— */
body.page-featured {
  background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 42%, #f1f5f9 100%);
}

body.page-featured .featured-page-main {
  align-items: stretch;
  gap: 12px;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 0 12px 22px;
  box-sizing: border-box;
}

@media (min-width: 720px) {
  body.page-featured .featured-page-main {
    width: min(100%, 720px);
  }
}

.featured-hero {
  border-radius: 14px;
  padding: 12px 14px 10px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.featured-hero__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.featured-hero__titles {
  min-width: 0;
}

.featured-hero__eyebrow {
  margin: 0 0 2px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
}

.featured-hero__title {
  margin: 0;
  font-size: clamp(1.05rem, 3.2vw, 1.25rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.2;
}

.featured-hero__aside {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.featured-hero__count {
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

/* 与底栏 active、全站主色一致的品牌蓝渐变（勿用青绿阴影） */
body.page-featured .featured-hero__cta.button.primary {
  border-radius: 12px !important;
  border-color: transparent !important;
  background: var(--brand-gradient, linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%)) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.28) !important;
}

body.page-featured .featured-hero__cta.button.primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 28px rgba(var(--primary-rgb), 0.32) !important;
}

.featured-hero__cta {
  padding: 0 14px !important;
  min-height: 36px !important;
  font-size: 13px !important;
  font-weight: 850 !important;
}

.featured-hero__cta-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

/* 精选「去创作」内 AI 标：与 .brand-mark 同语义，独立 class 避免被其它 svg 规则误伤 */
body.page-featured .featured-hero__cta-ai-mark {
  flex-shrink: 0;
  display: block;
  margin-top: 1px;
}

body.page-featured .featured-hero__cta-ai-frame,
body.page-featured .featured-hero__cta-ai-line,
body.page-featured .featured-hero__cta-ai-dot {
  fill: none;
  stroke: #fff;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.page-featured .featured-hero__cta-ai-spark {
  fill: rgba(255, 255, 255, 0.88);
  stroke: #fff;
  stroke-width: 0.55;
}

body.page-featured .featured-hero__cta-ai-spark-sm {
  fill: #fff;
  stroke: none;
  opacity: 0.95;
}

.featured-hero-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.featured-hero-search__input {
  flex: 1 1 160px;
  min-width: 0;
  max-width: 100%;
  padding: 8px 11px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
  color: #0f172a;
}

.featured-hero-search__input::placeholder {
  color: #94a3b8;
}

.featured-hero-search__input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.featured-hero-search__submit,
.featured-hero-search__clear {
  flex-shrink: 0;
  min-height: 36px !important;
}

.featured-hero__hint {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(241, 245, 249, 0.98);
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

.featured-hero__hint strong {
  color: #1d4ed8;
  font-weight: 850;
}

.featured-empty-panel {
  text-align: center;
  padding: 28px 16px 32px;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  background: rgba(255, 255, 255, 0.88);
  color: #64748b;
}

.featured-empty-panel__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(241, 245, 249, 0.95);
  color: #94a3b8;
}

.featured-empty-panel__icon svg {
  width: 28px;
  height: 28px;
}

.featured-empty-panel__title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 900;
  color: #334155;
}

.featured-empty-panel__text {
  margin: 0 auto;
  max-width: 20rem;
  font-size: 13px;
  line-height: 1.5;
}

.featured-masonry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.featured-tile {
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(226, 232, 240, 0.85);
  background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.95) inset, 0 4px 14px rgba(15, 23, 42, 0.06);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.featured-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(148, 163, 184, 0.55);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 10px 22px rgba(15, 23, 42, 0.07);
}

/* 双列卡片：略矮的横向预览 */
.featured-tile__media {
  position: relative;
  height: clamp(72px, 28vw, 102px);
  background: linear-gradient(145deg, #f1f5f9, #e8eef5);
}

.featured-tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body.page-featured .featured-tile__img[data-preview-src] {
  cursor: zoom-in;
}

body.page-admin img.admin-featured-thumb[data-preview-src] {
  cursor: zoom-in;
}

.featured-tile__img--placeholder {
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
}

.featured-tile__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.35) 0%, transparent 42%);
  pointer-events: none;
}

.featured-tile__content {
  padding: 10px 11px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
}

.featured-tile__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
}

.featured-tile__author {
  font-weight: 900;
  color: #334155;
}

.featured-tile__date {
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.featured-tile__prompt {
  margin: 0;
  flex: 1;
  min-height: 0;
  max-height: 4.5em;
  overflow: auto;
  font-size: 12px;
  line-height: 1.45;
  color: #334155;
  word-break: break-word;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.98);
  border: 1px solid rgba(241, 245, 249, 0.98);
  -webkit-overflow-scrolling: touch;
}

.featured-tile__same {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.32);
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.featured-tile__same:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.featured-tile__same-icon {
  font-size: 11px;
  opacity: 0.95;
}

.featured-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 0 2px;
}

.featured-pagination__btn {
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  color: #1e40af;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.featured-pagination__btn:hover:not(.is-disabled) {
  border-color: rgba(37, 99, 235, 0.45);
  color: #1d4ed8;
}

.featured-pagination__btn.is-disabled {
  opacity: 0.38;
  pointer-events: none;
}

.featured-pagination__info {
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

/* —— 工作台 UI 刷新（创作流 / 折叠参数 / 预览与历史） —— */
.workspace-main {
  align-items: stretch;
  /* 覆盖 .grid 默认间距，让邀请条更贴近创作卡 */
  gap: 10px;
}

.workspace-card--creative .workspace-section-head {
  padding-bottom: 10px;
  margin-bottom: 0;
}

.workspace-card--creative:not(:has(.workspace-card-generation-notice)) .workspace-section-head {
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  margin-bottom: 2px;
  padding-bottom: 10px;
}

.workspace-card--creative:has(.workspace-card-generation-notice) .workspace-section-head {
  border-bottom: none;
}

.workspace-card--creative .workspace-card-generation-notice {
  margin: 0 0 10px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid rgba(246, 211, 139, 0.65);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

.workspace-card--creative #generateForm.form {
  margin-top: 0;
}

.workspace-card--creative:not(:has(.workspace-card-generation-notice)) .workspace-create-shell {
  margin-top: 6px;
}

.workspace-eyebrow {
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 800;
  color: #64748b;
}

.help-eyebrow {
  text-transform: none;
  letter-spacing: 0.04em;
  font-weight: 800;
  color: #64748b;
}

.workspace-section-head {
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  align-items: flex-start;
}

.workspace-section-head--toolbar {
  align-items: center;
}

.workspace-toolbar-heading {
  margin: 0;
  min-width: 0;
}

.workspace-card--creative .workspace-section-head--toolbar .workspace-toolbar-heading {
  flex: 1 1 auto;
  min-width: 0;
}

.workspace-card--creative .workspace-section-head--toolbar .card-head-actions {
  flex-shrink: 0;
}

.workspace-section-head .workspace-eyebrow {
  margin-bottom: 4px;
}

.workspace-card--creative .card-head h2,
.preview-card--creative .card-head h2,
.history-section-workspace .card-head h2 {
  letter-spacing: -0.02em;
  margin: 0;
  font-size: clamp(18px, 4.2vw, 20px);
}

.workspace-create-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 0;
  padding: 12px 12px 10px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.99) 48%, rgba(239, 246, 255, 0.72) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 12px 36px rgba(15, 23, 42, 0.06);
}

/*
 * 编辑模式参考图：用 :has() 在选中「编辑」时强制显示，覆盖 .hidden（display:none !important）。
 * 避免微信等强缓存旧版 user.js、脚本未执行时整块仍被隐藏；与 JS 去 hidden 双保险。
 */
body.page-app .workspace-card--creative .workspace-create-shell:has(input[name="mode"][value="edit"]:checked) > .field.edit-upload-field[data-edit-upload] {
  display: grid !important;
  gap: 8px;
}

.workspace-create-shell .prompt-field-head {
  margin-top: 0;
}

.workspace-create-shell .mode-toggle--segmented {
  flex-shrink: 0;
}

.mode-toggle--segmented {
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(226, 232, 240, 0.95);
  gap: 4px;
}

.mode-toggle--segmented label {
  border-radius: 10px;
  border: 0;
  min-height: 36px;
}

.mode-toggle--segmented label:has(input:checked) {
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
}

.workspace-advanced-details {
  margin-top: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.workspace-advanced-summary {
  list-style: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  font-weight: 850;
  font-size: 13px;
  color: #334155;
  display: block;
  user-select: none;
}

.workspace-advanced-summary::-webkit-details-marker {
  display: none;
}

.workspace-advanced-summary-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 10px 12px 10px 14px;
  border-radius: 10px;
  border: 1px solid #d0d5dd;
  background: #f8fafc;
  box-shadow: none;
  box-sizing: border-box;
}

.workspace-advanced-details[open] .workspace-advanced-summary-row {
  border-radius: 10px 10px 0 0;
  border-bottom-color: transparent;
  box-shadow: none;
}

.workspace-advanced-title {
  flex: 0 0 auto;
  font-weight: 850;
  font-size: 13px;
  color: #1e293b;
  letter-spacing: 0.02em;
}

.workspace-advanced-preview {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  font-size: 12px;
  color: #64748b;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.workspace-advanced-dropdown {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.workspace-advanced-summary:hover .workspace-advanced-dropdown {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #2563eb;
}

.workspace-advanced-chevron {
  display: block;
  transition: transform 0.2s var(--ease-out, ease);
}

.workspace-advanced-details[open] .workspace-advanced-chevron {
  transform: rotate(180deg);
}

.workspace-advanced-details[open] .workspace-advanced-dropdown {
  border-color: rgba(37, 99, 235, 0.28);
  color: #2563eb;
  background: rgba(239, 246, 255, 0.85);
}

.workspace-advanced-hint {
  font-weight: 650;
  color: #94a3b8;
  font-size: 12px;
}

.workspace-advanced-body {
  padding: 12px 12px 14px;
  display: grid;
  gap: 10px;
  border: 1px solid #d0d5dd;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: #fafbfc;
  margin: -1px 0 2px;
}

.workspace-create-shell .field textarea {
  line-height: 1.45;
  min-height: 6.5rem;
}

.generate-actions-wrap {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.generate-cost-hint {
  margin: 0 auto;
  max-width: 26rem;
  text-align: center;
  font-size: 12px;
  line-height: 1.35;
  color: #64748b;
  font-weight: 650;
  padding: 0 6px;
}

.generate-actions {
  gap: 12px;
}

.generate-actions--queue-only {
  display: flex;
  justify-content: center;
  width: 100%;
}

.generate-actions--queue-only .generate-btn-primary {
  width: min(96%, 24rem);
  margin: 0 auto;
  min-height: 48px;
  border-radius: 12px;
}

.workspace-ai-hint-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  text-align: center;
  padding: 0 2px 0;
}

.workspace-ai-hint-wrap::-webkit-scrollbar {
  display: none;
}

.workspace-ai-hint {
  display: inline-block;
  margin: 0;
  padding: 0 4px;
  font-size: 10.5px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: #94a3b8;
  white-space: nowrap;
}

.record-card .record-prompt-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #334155;
  word-break: break-word;
}

.generate-actions .generate-btn-primary,
.generate-actions .generate-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-left: 12px;
  padding-right: 12px;
}

.generate-btn-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.2;
  min-width: 0;
}

.generate-btn-title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.generate-btn-sub {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.88;
  color: inherit;
}

.generate-actions .generate-btn-primary {
  min-height: 52px;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(8, 127, 91, 0.22);
}

.generate-actions .generate-btn-primary .generate-btn-sub {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 750;
}

.generate-actions .generate-btn-secondary {
  min-height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px dashed #cbd5e1;
  color: #475569;
  font-weight: 820;
}

.generate-actions .generate-btn-secondary .generate-btn-title {
  font-size: 14px;
  font-weight: 880;
}

.generate-actions .generate-btn-secondary:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.preview-card--creative {
  border-radius: 14px;
}

.preview-stage--creative {
  min-height: 360px;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(37, 99, 235, 0.09), transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  background-size: auto, auto;
}

.preview-empty-creative {
  width: min(100%, 340px);
  padding: 20px 18px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.55);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
}

.preview-empty-visual {
  width: 100%;
  max-width: 200px;
  height: 100px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(6, 182, 212, 0.1)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.preview-empty-title {
  margin: 8px 0 0;
  font-size: 16px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.preview-empty-steps {
  margin: 4px 0 0;
  padding: 0 0 0 1.2em;
  text-align: left;
  font-size: 13px;
  line-height: 1.7;
  color: #475569;
  font-weight: 650;
  width: 100%;
  max-width: 288px;
}

.preview-empty-steps li + li {
  margin-top: 6px;
}

.preview-loading.preview-loading--creative {
  width: min(100%, 320px);
  min-height: auto;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border-style: solid;
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(255, 255, 255, 0.92);
}

.preview-loading--creative .preview-spinner {
  margin-top: 4px;
}

.preview-skeleton {
  position: relative;
  width: 100%;
  max-width: 220px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #e2e8f0, #f1f5f9);
}

.preview-skeleton-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.65);
  top: 16px;
}

.preview-skeleton-bar--short {
  top: 36px;
  right: 40%;
}

.preview-skeleton-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 45%,
    transparent 90%
  );
  animation: previewShine 1.6s ease-in-out infinite;
}

@keyframes previewShine {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.preview-queued-creative {
  width: min(100%, 320px);
  padding: 20px 18px;
  display: grid;
  gap: 10px;
  text-align: center;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: linear-gradient(180deg, #fffbeb, #fff7ed);
  color: #92400e;
  font-weight: 700;
}

.preview-queued-creative span {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
  color: #9a3412;
}

.history-section-workspace {
  margin-top: 4px;
}

/* 「最新记录」与「查看全部」同一行垂直居中，避免按钮相对标题偏上/偏下 */
.history-section-workspace .card-head.workspace-section-head {
  align-items: center;
}

.history-section-workspace .card-head.workspace-section-head .button.secondary {
  flex-shrink: 0;
  border-radius: 8px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1;
}

/* 避免「最新记录」标题同时存在 border-bottom（.workspace-section-head）与 .card-head::after 叠成双横线或左侧残线 */
.history-section-workspace .card-head.workspace-section-head::after {
  display: none;
}

.history-list.history-list--strip {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 6px 4px calc(18px + env(safe-area-inset-bottom, 0px));
  margin: 0 -4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.history-list--strip .history-empty-inline {
  flex: 1 0 100%;
  width: 100%;
  min-width: 100%;
  min-height: 120px;
  margin: 4px 0 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff, #f8fafc);
  font-size: 13px;
  color: #64748b;
}

.history-list--strip .record-card {
  flex: 0 0 min(200px, 46vw);
  width: min(200px, 46vw);
  max-width: 220px;
  min-height: 0;
  height: auto;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* auto 行高：避免第二行被 1fr 压扁导致底部时间与删除按钮被裁切 */
  grid-template-rows: 112px auto;
  overflow-x: hidden;
  overflow-y: visible;
}

.history-list--strip .record-image {
  width: 100%;
  height: 112px;
  border-radius: 10px 10px 0 0;
}

.history-list--strip .record-body {
  padding: 8px 10px 10px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-list--strip .record-body p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.history-list--strip .record-meta {
  font-size: 11px;
}

.history-list--strip .record-foot {
  font-size: 11px;
  margin-top: auto;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .workspace-create-shell {
    padding: 14px 12px 12px;
  }

  .history-list.history-list--strip {
    gap: 10px;
  }

  .history-list--strip .record-card {
    flex: 0 0 min(168px, 72vw);
    width: min(168px, 72vw);
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 100px auto;
  }

  .history-list--strip .record-image {
    height: 100px;
  }

  /* 首页底部「最新记录」：手机只展示 1 条，纵向整宽卡片（对齐设计稿） */
  body.page-app .history-section-workspace .workspace-section-head .workspace-eyebrow {
    display: none;
  }

  body.page-app .history-section-workspace .workspace-section-head h2 {
    font-size: 17px;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -0.02em;
  }

  body.page-app .history-section-workspace .workspace-section-head .button.secondary {
    border-radius: 8px;
    border-color: #e8e8e8;
    color: #333;
    font-size: 12px;
    font-weight: 650;
    padding: 0 12px;
    min-height: 34px;
  }

  body.page-app #historyList.workspace-history-strip.history-list--strip {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-x: visible;
    overflow-y: visible;
    scroll-snap-type: none;
    margin: 0;
    /* 与 app-shell 底栏留白一致，避免最后一屏手势与底栏抢触摸 */
    padding: 2px 0 calc(22px + env(safe-area-inset-bottom, 0px));
    gap: 0;
  }

  body.page-app #historyList.workspace-history-strip .record-card ~ .record-card {
    display: none !important;
  }

  body.page-app #historyList.workspace-history-strip .record-card {
    flex: none !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    scroll-snap-align: unset;
    border-radius: 14px;
    border: 1px solid #ebebeb;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    grid-template-rows: auto minmax(0, auto);
    overflow: hidden;
  }

  body.page-app #historyList.workspace-history-strip .record-card:hover {
    transform: none;
  }

  body.page-app #historyList.workspace-history-strip .record-card:hover .record-image img {
    transform: none;
  }

  body.page-app #historyList.workspace-history-strip .record-image {
    width: 100%;
    height: auto;
    min-height: 132px;
    max-height: 200px;
    aspect-ratio: 16 / 9;
    border-radius: 12px 12px 0 0;
  }

  body.page-app #historyList.workspace-history-strip .record-body {
    padding: 10px 12px 12px;
    gap: 8px;
  }

  body.page-app #historyList.workspace-history-strip .record-meta--workspace-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }

  body.page-app #historyList.workspace-history-strip .record-status-label {
    color: #4a90e2;
    font-weight: 800;
    font-size: 11px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
  }

  body.page-app #historyList.workspace-history-strip .record-card[data-status="failed"] .record-status-label,
  body.page-app #historyList.workspace-history-strip .record-card[data-status="deleted"] .record-status-label {
    color: #ff4d4f;
  }

  body.page-app #historyList.workspace-history-strip .record-meta-detail {
    color: #999;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.45;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
  }

  body.page-app #historyList.workspace-history-strip .record-body .record-prompt-snippet {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.45;
    margin-top: 2px;
  }

  body.page-app #historyList.workspace-history-strip .record-foot time {
    font-size: 10px;
    color: #999;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    font-variant-numeric: tabular-nums;
  }

  body.page-app #historyList.workspace-history-strip .record-delete {
    border: 1px solid #ffb3b3;
    border-radius: 8px;
    color: #ff4d4f;
    background: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 10px;
    min-height: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preview-skeleton-shine {
    animation: none;
  }
}

/* —— 修改密码（手机验证）：与全站令牌统一、圆角柔和 —— */
.change-password-wrap {
  min-height: calc(100vh - 140px);
  padding: 24px 16px 40px;
  background: transparent;
}

.change-password-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 28px 24px 30px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.change-password-card.auth-card {
  width: min(420px, 100%);
}

.change-password-head .eyebrow {
  display: none;
}

.change-password-head h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 750;
  color: var(--text);
  letter-spacing: -0.02em;
}

.change-password-lead {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  font-weight: 550;
}

.change-password-phone-block {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.change-password-label {
  display: block;
  font-size: 12px;
  font-weight: 750;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.change-password-phone {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}

.change-password-form {
  gap: 16px;
}

.cpw-sms-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.cpw-sms-field {
  flex: 1 1 160px;
  min-width: 0;
  margin: 0;
}

.cpw-sms-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: var(--radius-sm);
  border-color: var(--line-strong);
  color: var(--text-soft);
  font-weight: 700;
  background: var(--surface);
}

.cpw-sms-btn:hover:not(:disabled) {
  border-color: rgba(var(--primary-rgb), 0.35);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.change-password-divider {
  height: 0;
  margin: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.change-password-pw-block {
  margin-top: 0;
  padding-top: 14px;
  opacity: 0.78;
  transition: opacity 0.22s ease;
}

.change-password-pw-block.is-unlocked {
  opacity: 1;
}

.change-password-step-hint {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.change-password-step-hint.is-active {
  color: var(--text-soft);
}

.change-password-form .field input {
  border-radius: var(--radius-sm);
  border-color: var(--line-strong);
  background: var(--surface);
}

.change-password-form .field input:read-only {
  background: var(--surface-soft);
  color: var(--muted);
}

body.page-account .change-password-submit.button.primary,
.change-password-submit.button.primary {
  margin-top: 4px;
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius-lg);
  font-weight: 800;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.22);
}

body.page-account .change-password-submit.button.primary:hover {
  filter: brightness(1.04);
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.28);
}

@media (max-width: 480px) {
  .change-password-card {
    padding: 22px 18px 24px;
    border-radius: 18px;
  }

  .cpw-sms-btn {
    width: 100%;
  }
}

/* 人工智能生成合成内容显式提示 */
.ai-synthetic-disclaimer {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  background: rgba(var(--primary-rgb), 0.06);
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  border-radius: var(--radius);
}

.record-image:has(> img) {
  display: grid;
  grid-template: 1fr / 1fr;
  position: relative;
}

.record-image > img {
  grid-area: 1 / 1;
}

/* 记录列表缩略图：加载完成前转圈占位，减轻「白块/半拉图」卡顿感 */
.record-image:has(> img) > .record-image-spinner {
  grid-area: 1 / 1;
  place-self: center;
  z-index: 2;
  box-sizing: border-box;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(15, 23, 42, 0.12);
  border-top-color: rgba(var(--primary-rgb), 0.88);
  animation: spin 0.68s linear infinite;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.record-image.record-image--thumb-loading > img {
  opacity: 0;
}

.record-image.record-image--thumb-loaded > img {
  opacity: 1;
  transition: opacity 0.22s ease;
}

.record-image.record-image--thumb-loaded > .record-image-spinner {
  opacity: 0;
}

.record-dialog-image-inner {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 100%;
}

.record-dialog-image-inner img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 640px;
  margin: 0 auto;
  object-fit: contain;
  background: #fff;
}

/* 管理后台：精选审核 / 生成记录 — 卡片栅格与稳定缩略图（URL 含 v + 服务端 ETag，避免反复整图下载） */
.admin-records-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-records-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.admin-media-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.admin-media-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  min-height: 100%;
}

.admin-record-card {
  position: relative;
}

.admin-record-card__check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  cursor: pointer;
}

.admin-record-card__check input {
  width: 16px;
  height: 16px;
}

.admin-media-card__visual {
  position: relative;
  aspect-ratio: 1 / 1;
  background: rgba(15, 23, 42, 0.04);
}

.admin-media-card__thumb-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.admin-media-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-media-card__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}

.admin-media-card__badge {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
}

.admin-media-card__rid {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
}

.admin-media-card__body {
  padding: 12px 12px 4px;
  flex: 1;
}

.admin-record-card__headline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.admin-media-card__user {
  margin: 0 0 6px;
  font-size: 14px;
}

.admin-media-card__prompt {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.admin-media-card__time {
  margin: 8px 0 0;
  font-size: 12px;
}

.admin-media-card__note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.admin-media-card__meta {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.admin-media-card__meta div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.admin-media-card__meta dt {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.admin-media-card__meta dd {
  margin: 0;
  text-align: right;
  font-weight: 650;
}

.admin-media-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

.admin-media-card__form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-media-card__form--grow {
  flex: 1;
  min-width: 0;
}

.admin-media-card__reject-input {
  flex: 1;
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

@media (max-width: 640px) {
  .admin-media-board {
    grid-template-columns: 1fr;
  }
}

/* 管理后台：生成记录 — 横向紧凑列表（每行一条） */
.admin-records-list-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.admin-records-toolbar--inlist {
  padding: 8px 12px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.02);
}

.admin-records-rows {
  display: flex;
  flex-direction: column;
}

.admin-record-row-compact {
  display: grid;
  grid-template-columns: 34px 88px minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.admin-record-row-compact:last-child {
  border-bottom: 0;
}

.admin-record-row-compact.is-deleted {
  opacity: 0.9;
}

.admin-record-row-compact__check {
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-record-row-compact__check input {
  width: 16px;
  height: 16px;
}

.admin-record-row-compact__thumb {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}

.admin-record-row-compact__thumb-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.04);
  cursor: zoom-in;
  overflow: hidden;
}

.admin-record-row-compact__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-record-row-compact__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
}

.admin-record-row-compact__main {
  min-width: 0;
}

.admin-record-row-compact__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 4px;
  font-size: 12px;
}

.admin-record-row-compact__id {
  font-weight: 750;
}

.admin-record-row-compact__user {
  font-size: 13px;
  font-weight: 700;
}

.admin-record-row-compact__time {
  margin-left: auto;
  font-size: 12px;
}

.admin-record-row-compact__prompt {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.admin-record-row-compact__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

@media (max-width: 720px) {
  .admin-record-row-compact {
    grid-template-columns: 32px 72px 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "ck th main"
      "ck th actions";
  }

  .admin-record-row-compact__check {
    grid-area: ck;
  }

  .admin-record-row-compact__thumb {
    grid-area: th;
    width: 72px;
    height: 72px;
  }

  .admin-record-row-compact__thumb-btn {
    width: 72px;
    height: 72px;
  }

  .admin-record-row-compact__main {
    grid-area: main;
  }

  .admin-record-row-compact__actions {
    grid-area: actions;
    flex-direction: row;
    justify-content: flex-end;
    align-self: end;
  }
}
