:root {
  --bg: #f4f5f8;
  --surface: #fff;
  --border: #e5e7eb;
  --border-strong: #d0d7de;
  --text: #1f2328;
  --text-muted: #6e7781;
  --text-dim: #8a939c;
  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --brand-soft: #eef2ff;
  --danger: #cf222e;
  --danger-soft: #ffebe9;
  --ok: #1a7f37;
  --ok-soft: #dafbe1;
  --warn: #9a6700;
  --warn-soft: #fff8c5;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.92em; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 600; font-size: 16px; color: var(--text); }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.who { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.lang-switch {
  font-size: 13px; font-weight: 600; color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border));
  border-radius: 999px; padding: 3px 10px; line-height: 1.4;
  text-decoration: none; white-space: nowrap;
}
.lang-switch:hover { background: var(--brand-soft); text-decoration: none; }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.tag-admin {
  background: var(--brand-soft); color: var(--brand);
  padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500;
}

.container { max-width: 1080px; margin: 28px auto; padding: 0 24px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 24px 28px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.card.center { text-align: center; max-width: 420px; margin: 80px auto; }
.login-card { max-width: 460px; text-align: left; }
.login-card h1 { text-align: center; }
.login-card > .muted { text-align: center; }
.login-tabs {
  display: flex; gap: 6px; margin: 18px 0 16px; padding: 4px;
  background: var(--bg); border-radius: 10px;
}
.login-tab {
  flex: 1; border: 0; background: transparent; color: var(--text-muted);
  padding: 8px 6px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.login-tab.is-active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.btn-block { display: block; width: 100%; text-align: center; margin-top: 16px; box-sizing: border-box; }
.login-code-row { display: flex; gap: 8px; align-items: center; }
.login-code-row input { flex: 1; max-width: none; }
.login-divider { border: 0; border-top: 1px solid var(--border); margin: 24px 0 16px; }
.login-wechat { text-align: center; margin-top: 8px; }
.login-wechat-qr {
  position: relative;
  width: 300px; height: 400px;
  margin: 12px auto 8px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.login-wechat-qr img.js-wechat-qr:not([hidden]) {
  width: 196px; height: 196px; display: block; border: 0; object-fit: contain;
}
.login-wechat-qr iframe.js-wechat-iframe:not([hidden]) {
  width: 300px; height: 400px; display: block; border: 0; background: #fff;
}
.login-wechat-qr img.js-wechat-qr[hidden],
.login-wechat-qr iframe.js-wechat-iframe[hidden] {
  display: none !important;
}
.login-wechat-spinner { position: absolute; }
.login-wechat-expired {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  padding: 16px; font-size: 14px; line-height: 1.5;
  color: var(--text); background: rgba(255, 255, 255, .82);
  border-radius: 12px;
}
.login-wechat-qr.is-expired .login-wechat-expired { display: flex; }
.login-wechat-qr.is-loading .js-wechat-qr,
.login-wechat-qr.is-loading .js-wechat-iframe { visibility: hidden; }
.login-wechat .js-wechat-refresh { margin: 12px auto 0; min-width: 140px; min-height: 44px; }
@media (prefers-reduced-motion: reduce) {
  .login-wechat-spinner { animation: none; border-top-color: var(--brand); }
}
.login-card form input[type=text],
.login-card form input[type=email],
.login-card form input[type=password] { max-width: none; width: 100%; padding: 8px 10px; }
.js-form-error { margin: 0 0 12px; }

.section-head {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 20px;
}
.section-head h1, .section-head h2 { margin: 0; font-size: 20px; font-weight: 600; }
.section-head h1 { font-size: 22px; }
.section-head .count {
  display: inline-flex; align-items: baseline; gap: 2px;
  background: var(--brand-soft); color: var(--brand);
  padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 500;
}
.section-head .count strong { font-weight: 600; }
.section-head .spacer { flex: 1; }

h1, h2 { margin-top: 0; }
.muted { color: var(--text-muted); font-size: 0.9em; }

table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td {
  text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background-color .12s; }
table.data tbody tr:hover { background: #fafbfc; }
table.data th {
  font-weight: 500; font-size: 12px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border); padding-top: 4px; padding-bottom: 10px;
}
table.data th:first-child, table.data td:first-child { padding-left: 4px; }
table.data th:last-child, table.data td:last-child { padding-right: 4px; text-align: right; }

.cell-stack { display: flex; flex-direction: column; line-height: 1.35; }
.cell-stack .sub { color: var(--text-muted); font-size: 12px; }

.code-chip {
  display: inline-block; max-width: 180px; padding: 4px 8px;
  background: #f3f4f6; color: #4b5563; border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
  cursor: default;
}

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: #f3f4f6; color: var(--text-muted);
}
.status-pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.status-pill.online { background: var(--ok-soft); color: var(--ok); }
.status-pill.offline { background: #f3f4f6; color: var(--text-muted); }
.status-pill.disabled { background: var(--danger-soft); color: var(--danger); }
.status-pill.paid { background: var(--ok-soft); color: var(--ok); }
.status-pill.pending { background: var(--warn-soft); color: var(--warn); }
.status-pill.failed, .status-pill.refunded, .status-pill.canceled {
  background: var(--danger-soft); color: var(--danger);
}

.rename-form { display: inline-flex; align-items: center; gap: 6px; }
.rename-form input[type=text] {
  padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 6px;
  font-size: 14px; width: 160px; background: var(--surface); transition: border-color .12s, box-shadow .12s;
}
.rename-form input[type=text]:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}
.rename-form .icon-btn {
  padding: 6px 8px; border: 1px solid transparent; background: transparent;
  color: var(--text-muted); border-radius: 6px; cursor: pointer; line-height: 1;
}
.rename-form .icon-btn:hover { color: var(--brand); background: var(--brand-soft); }

.btn {
  display: inline-block; padding: 8px 18px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: #f6f8fa; color: var(--text);
  cursor: pointer; font-size: 14px; text-decoration: none;
}
.btn:hover { background: #ebeef1; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); text-decoration: none; }

.link-btn {
  background: none; border: none; color: var(--brand); cursor: pointer;
  padding: 0; font-size: inherit;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

.ghost-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px;
  transition: border-color .12s, color .12s, background-color .12s;
}
.ghost-btn:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

form.inline { display: inline; }
form label { display: block; margin: 12px 0 6px; }
form input[type=text],
form input[type=email],
form input[type=password] {
  padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 4px; font-size: 14px;
  width: 100%; max-width: 320px;
}
.unified-me-card .bg-config { margin: 0; }
.unified-me-card .unified-me-form { padding: 0 4px 8px; }
.unified-me-card .unified-me-form label { margin-top: 10px; color: var(--text-muted); font-size: 13px; }
.unified-me-card .unified-me-form input[type=text],
.unified-me-card .unified-me-form input[type=email],
.unified-me-card .unified-me-form input[type=password] {
  display: block; margin-top: 6px; max-width: 360px; padding: 8px 10px;
}
.unified-me-card .login-code-row input { max-width: none; }
.unified-me-card .primary-btn { margin-top: 8px; }
.unified-me-account { margin: 10px 4px 0; font-size: 14px; }
label.check { display: flex; align-items: center; gap: 6px; }

.flashes { list-style: none; padding: 0; margin: 0 0 16px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--danger-soft); color: var(--danger); }

.empty {
  text-align: center; padding: 32px 16px; color: var(--text-muted);
}
.empty .empty-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--bg); color: var(--text-dim);
  margin-bottom: 12px; font-size: 22px;
}
.empty p { margin: 4px 0; }
.empty .hint { font-size: 13px; color: var(--text-dim); }

.bind-info dt { color: var(--text-muted); font-size: 0.9em; margin-top: 8px; }
.bind-info dd { margin: 0; font-size: 1em; }

.qrcode-box img { display: block; margin: 16px auto; max-width: 240px; }


/* ===== 配额 chip + 行操作 ===== */
.quota-chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500;
  background: #f3f4f6; color: var(--text-muted);
  white-space: nowrap;
}
.quota-chip.ok { background: var(--ok-soft); color: var(--ok); }
.quota-chip.muted { background: #f3f4f6; color: var(--text-dim); }
.cell-stack .quota-chip + .quota-chip { margin-top: 4px; }

.row-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }


/* ===== 设备外观配置（/me 设备表内嵌） ===== */
tr.bg-row td { border-top: none; padding: 0 4px 18px; }
.bg-config {
  background: #fbfcff; border: 1px solid #e6eaf2;
  border-radius: 12px; padding: 0 18px 16px;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
.bg-config > summary {
  cursor: pointer; color: var(--text, #111827); padding: 15px 0;
  user-select: none; text-align: left; list-style: none;
  display: flex; align-items: center; gap: 10px;
}
.bg-config > summary::-webkit-details-marker { display: none; }
.bg-config > summary::after {
  content: "›"; margin-left: 2px; color: #8b95a7; font-size: 22px; line-height: 1;
  transform: rotate(90deg); transition: transform .16s ease;
}
.bg-config[open] > summary::after { transform: rotate(-90deg); }
.appearance-summary-icon {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px;
  background: linear-gradient(135deg, #dcecff 0 50%, #f7d9ef 50% 100%);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, .08);
}
.bg-config > summary > span:nth-child(2) {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1 1 auto; min-width: 0;
}
.bg-config > summary strong { font-size: 15px; line-height: 1.25; }
.bg-config > summary small { color: var(--text-dim); font-size: 12px; font-weight: 400; }
.appearance-summary-current {
  margin-left: auto; padding: 4px 10px; border-radius: 999px;
  color: var(--brand); background: var(--brand-soft); font-size: 12px; font-weight: 500;
}
.theme-form { padding: 16px; border: 1px solid #e7eaf2; border-radius: 10px; background: #fff; }
.appearance-section-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px;
}
.appearance-section-head > div { display: flex; flex-direction: column; gap: 3px; }
.appearance-section-head strong { font-size: 14px; color: var(--text); }
.appearance-section-head span { font-size: 12px; color: var(--text-dim); }
.theme-form-row { display: flex; align-items: center; gap: 14px; }
.theme-options { display: grid; grid-template-columns: repeat(2, minmax(190px, 1fr)); gap: 10px; flex: 1; }
.theme-choice { display: block; margin: 0; cursor: pointer; }
.theme-choice input { position: absolute; opacity: 0; pointer-events: none; }
.theme-choice-content {
  min-height: 66px; display: flex; align-items: center; gap: 11px; position: relative;
  padding: 10px 38px 10px 11px; border: 1px solid #dfe4ec; border-radius: 9px;
  background: #fff; transition: border-color .14s, box-shadow .14s, background .14s;
}
.theme-choice:hover .theme-choice-content { border-color: #b7c5ec; background: #fafbff; }
.theme-choice input:focus-visible + .theme-choice-content { box-shadow: 0 0 0 3px rgba(79, 70, 229, .14); }
.theme-choice input:checked + .theme-choice-content {
  border-color: var(--brand); background: #f7f7ff; box-shadow: 0 0 0 1px var(--brand);
}
.theme-choice-content > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; }
.theme-choice-content strong { font-size: 14px; }
.theme-choice-content small { font-size: 11px; color: var(--text-dim); }
.theme-preview {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 10px; display: flex;
  align-items: flex-end; justify-content: center; gap: 3px; padding: 8px 6px;
}
.theme-preview i { display: block; width: 7px; border-radius: 4px; background: rgba(255,255,255,.9); }
.theme-preview i:nth-child(1) { height: 13px; }.theme-preview i:nth-child(2) { height: 21px; }.theme-preview i:nth-child(3) { height: 17px; }
.theme-preview-blue { background: linear-gradient(145deg, #79bfff, #4169c7); }
.theme-preview-pink { background: linear-gradient(145deg, #ff9bd8, #a77be8); }
.theme-preview-tech-blue { background: linear-gradient(145deg, #031021, #1677c8); }
.theme-preview-tech-red { background: linear-gradient(145deg, #1e0714, #b83263); }
.theme-choice-check {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%) scale(.7);
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; background: var(--brand); font-size: 12px; opacity: 0; transition: opacity .14s, transform .14s;
}
.theme-choice input:checked + .theme-choice-content .theme-choice-check { opacity: 1; transform: translateY(-50%) scale(1); }
.appearance-save-btn { flex: 0 0 auto; min-height: 42px; }
.appearance-divider { height: 1px; background: #e9edf3; margin: 18px 0; }
.appearance-size-tip { white-space: nowrap; padding: 3px 8px; border-radius: 6px; background: #f2f4f8; }
.bg-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bg-slot { padding: 14px; border: 1px solid #e3e7ee; border-radius: 10px; background: #fff; }
.bg-slot-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.bg-slot-head strong { font-size: 14px; }
.bg-state { font-size: 11px; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.bg-state.ok { background: var(--ok-soft, #dafbe1); color: var(--ok, #1a7f37); }
.bg-state.muted { background: #f3f4f6; color: var(--text-dim, #9ca3af); }
.bg-form { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.bg-form input[type="file"] {
  font-size: 12px; color: var(--text-dim); max-width: 100%; min-width: 0; flex: 1;
  border: 1px solid #e1e5ec; border-radius: 7px; background: #f8f9fb;
}
.bg-form input[type="file"]::file-selector-button {
  margin-right: 10px; padding: 8px 11px; border: 0; border-right: 1px solid #e1e5ec;
  background: #fff; color: var(--text); font-weight: 500; cursor: pointer;
}
.bg-form input[type="file"]::file-selector-button:hover { background: #f2f5fb; }
.bg-upload-btn { padding: 8px 13px; white-space: nowrap; }
.bg-slot .ghost-btn { padding: 5px 10px; font-size: 12px; }
.bg-config .hint { font-size: 12px; color: var(--text-dim, #9ca3af); }
.appearance-footnote { margin: 13px 0 0 !important; display: flex; align-items: center; gap: 5px; }

/* ===== 出图模型（/me） ===== */
.model-pref-config { margin-top: 10px; }
.model-pref-icon {
  background:
    radial-gradient(circle at 30% 30%, #eef2ff 0 42%, transparent 43%),
    linear-gradient(145deg, #c7d2fe 0%, #818cf8 48%, #6366f1 100%);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .16);
  position: relative;
}
.model-pref-icon::after {
  content: "";
  position: absolute; inset: 9px 8px 8px;
  border: 1.5px solid rgba(255, 255, 255, .88);
  border-radius: 4px;
  border-top-width: 3px;
  opacity: .92;
}
.model-pref-current {
  max-width: min(42vw, 280px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 1 auto;
}
.model-pref-form { padding: 14px 16px 12px; }
.model-pref-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.model-pref-field {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
.model-pref-field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: .02em;
}
.model-pref-select {
  width: 100%;
  min-height: 42px;
  padding: 0 36px 0 12px;
  border: 1px solid #dfe4ec;
  border-radius: 9px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, #8b95a7 50%),
    linear-gradient(135deg, #8b95a7 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color .14s, box-shadow .14s, background-color .14s;
}
.model-pref-select:hover { border-color: #b7c5ec; background-color: #fafbff; }
.model-pref-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
  background-color: #fff;
}
.model-pref-save {
  flex: 0 0 auto;
  min-width: 88px;
  justify-content: center;
}
.model-pref-footnote {
  margin-top: 10px !important;
  align-items: flex-start;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .theme-form-row { align-items: stretch; flex-direction: column; }
  .appearance-save-btn { align-self: flex-start; }
  .bg-slots { grid-template-columns: 1fr; }
  .model-pref-row { align-items: stretch; flex-direction: column; }
  .model-pref-save { align-self: flex-start; }
}
@media (max-width: 620px) {
  tr.bg-row td { padding-left: 0; padding-right: 0; }
  .bg-config { padding-left: 12px; padding-right: 12px; }
  .appearance-summary-current { display: none; }
  .theme-options { grid-template-columns: 1fr; }
  .appearance-section-head { flex-direction: column; gap: 8px; }
  .bg-form { align-items: stretch; flex-direction: column; }
  .bg-upload-btn { align-self: flex-start; }
}


/* ===== primary 按钮（购买/下一步等） ===== */
.primary-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 8px; font-size: 14px; font-weight: 500;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
  cursor: pointer; text-decoration: none; transition: background-color .12s, border-color .12s;
}
.primary-btn:hover {
  background: var(--brand-hover); border-color: var(--brand-hover);
  color: #fff; text-decoration: none;
}


/* ===== 套餐选择页 ===== */
.form-row { margin-bottom: 24px; }
.form-row label { display: block; margin: 0 0 6px; font-size: 14px; }
.form-row select {
  padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 6px;
  font-size: 14px; background: var(--surface); width: 100%;
  /* 旧 max-width:480px 会把"设备名 · 16字节device_code · 订阅至 yyyy-mm-dd"
     这种长 option 文本截断，索性放开撑满 form 宽度。 */
}
.form-row .muted { margin: 8px 0 0; font-size: 12px; }

.plans-title {
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
  margin: 28px 0 12px;
}

.plan-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
  margin-bottom: 8px;
}
.plan-card {
  position: relative; cursor: pointer; display: block;
}
.plan-card input[type=radio] {
  position: absolute; opacity: 0; pointer-events: none;
}
.plan-card-inner {
  border: 1px solid var(--border); border-radius: 10px; padding: 18px 16px;
  background: var(--surface); transition: border-color .12s, box-shadow .12s, background .12s;
  height: 100%; display: flex; flex-direction: column; gap: 6px;
}
.plan-card:hover .plan-card-inner { border-color: var(--brand); }
.plan-card input[type=radio]:checked + .plan-card-inner {
  border-color: var(--brand); background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.plan-title { font-size: 15px; font-weight: 600; color: var(--text); }
.plan-price { font-size: 13px; color: var(--text-muted); display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.plan-price strong { font-size: 24px; font-weight: 600; color: var(--text); margin-left: 2px; }
/* 续费打折：原价小灰划掉 + 续费价高亮 + 「续费价」橙徽章 */
.plan-price-original { font-size: 13px; color: var(--text-dim); text-decoration: line-through; }
.plan-price-badge {
  font-size: 11px; font-weight: 600; color: #b45309;
  background: rgba(245, 158, 11, 0.18);
  padding: 1px 8px; border-radius: 999px;
}
.plan-meta { font-size: 12px; color: var(--text-muted); }
.plan-desc { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* 支付方式卡片：把 .plan-card-inner 默认的纵向布局换成「图标 + 文案」横向 */
.pay-method-grid .plan-card-inner.pay-method {
  flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px;
}
.pay-icon {
  flex: 0 0 auto; width: 32px; height: 32px; display: inline-flex;
  align-items: center; justify-content: center;
}
.pay-icon svg { display: block; }
.pay-method-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.form-actions { margin-top: 24px; display: flex; gap: 12px; align-items: center; }


/* ===== 收银台 / QR 页 ===== */
.pay-card { max-width: 520px; margin: 32px auto; }

.pay-summary {
  background: #f8f9fb; border-radius: 8px; padding: 14px 18px; margin-bottom: 20px;
}
.pay-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.pay-label { color: var(--text-muted); }
.pay-value { color: var(--text); font-weight: 500; }
.pay-value code { font-size: 12px; background: #fff; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border); }
.pay-amount strong { font-size: 22px; font-weight: 600; color: var(--brand); margin-left: 2px; }
/* 续费打折：原价划掉 + 「续费价」徽章，与套餐选择页样式对齐 */
.pay-original-price { font-size: 13px; color: var(--text-dim); text-decoration: line-through; margin-right: 8px; }
.pay-renewal-badge {
  font-size: 11px; font-weight: 600; color: #b45309;
  background: rgba(245, 158, 11, 0.18);
  padding: 1px 8px; border-radius: 999px; margin-left: 8px;
}

.pay-qr-wrap {
  min-height: 280px; display: flex; align-items: center; justify-content: center;
  background: #fafbfc; border: 1px dashed var(--border-strong); border-radius: 12px;
  padding: 16px; margin-bottom: 16px;
}
.pay-qr-img { display: block; width: 240px; height: 240px; }
.pay-qr-loading { color: var(--text-muted); font-size: 14px; }
.pay-qr-paid { color: var(--ok); font-size: 28px; font-weight: 600; }
.pay-qr-error { color: var(--danger); font-size: 14px; text-align: center; padding: 16px; }

.pay-status { text-align: center; margin: 8px 0 16px; }
.pay-status p { margin: 4px 0; font-size: 13px; }
.pay-status-ok p { color: var(--ok); }
.pay-status-error p { color: var(--danger); }


/* ===== 我的照片 ===== */
.photos-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.photos-toolbar .spacer { flex: 1; }
.photos-toolbar .check { font-size: 14px; cursor: pointer; user-select: none; }

.photo-grid {
  /* 双图卡片需要更宽，最小宽度从 200 调到 280 */
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
}
.photo-card {
  display: block; position: relative; cursor: pointer;
}
.photo-card input[type=checkbox] {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  width: 18px; height: 18px; cursor: pointer;
  /* 提高对比度，缩略图上才看得见 */
  accent-color: var(--brand);
  background: rgba(255, 255, 255, .85);
  border-radius: 4px;
}
.photo-card-inner {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--surface); transition: border-color .12s, box-shadow .12s;
  display: flex; flex-direction: column;
}
.photo-card:hover .photo-card-inner { border-color: var(--brand); box-shadow: var(--shadow-md); }
.photo-card input[type=checkbox]:checked ~ .photo-card-inner {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}
.photo-thumb-pair {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--border);  /* 1px 间隙就是这条 border 色 */
}
.photo-thumb-cell {
  position: relative; aspect-ratio: 1 / 1; background: #fafbfc; overflow: hidden;
}
.photo-thumb-cell img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.photo-thumb-tag {
  position: absolute; bottom: 6px; left: 6px;
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(15, 23, 42, .55); color: #fff; letter-spacing: .5px;
  pointer-events: none;
}
.photo-meta {
  padding: 10px 12px 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.photo-date { font-size: 13px; color: var(--text); flex: 1; min-width: 0; }
.photo-actions {
  padding: 6px 12px 12px; display: flex; gap: 6px;
}
.photo-actions .ghost-btn { flex: 1; text-align: center; padding: 5px 8px; }

.pager {
  display: flex; justify-content: center; align-items: center; gap: 14px;
  margin-top: 24px;
}
.pager .ghost-btn.disabled {
  opacity: .4; pointer-events: none;
}

/* ===== 用户中心异步操作反馈（与 console 的交互保持一致） ===== */
.me-operation-modal {
  position: fixed; inset: 0; z-index: 10000; display: flex;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(15, 23, 42, .28); opacity: 0; visibility: hidden;
  transition: opacity .15s ease, visibility .15s ease;
}
.me-operation-modal.is-visible { opacity: 1; visibility: visible; }
.me-operation-card {
  min-width: 220px; display: flex; flex-direction: column; align-items: center;
  gap: 9px; padding: 24px 30px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-md);
}
.me-operation-spinner {
  width: 30px; height: 30px; border: 3px solid rgba(79, 70, 229, .18);
  border-top-color: var(--brand); border-radius: 50%; animation: me-spin .75s linear infinite;
}
.me-operation-title { font-size: 16px; color: var(--text); }
.me-operation-note { font-size: 12px; color: var(--text-muted); }
@keyframes me-spin { to { transform: rotate(360deg); } }

.me-operation-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 10001;
  max-width: min(440px, calc(100vw - 32px)); padding: 10px 16px;
  border-radius: 8px; color: #fff; font-size: 14px; line-height: 1.45;
  box-shadow: var(--shadow-md); opacity: 0; transform: translate(-50%, 8px);
  transition: opacity .18s ease, transform .18s ease;
}
.me-operation-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.me-operation-toast.is-success { background: #1a7f37; }
.me-operation-toast.is-error { background: var(--danger); }
