:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --text: #1d2320;
  --muted: #69736d;
  --line: #dce2dc;
  --field: #fbfcfa;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --warning: #9a5a00;
  --warning-bg: #fff7df;
  --success: #136c3a;
  --success-bg: #eaf7ee;
  --error: #a32222;
  --error-bg: #fff0f0;
  --shadow: 0 24px 70px rgba(33, 44, 39, 0.14);
  --shadow-soft: 0 12px 34px rgba(33, 44, 39, 0.1);
  --shadow-lift: 0 18px 46px rgba(33, 44, 39, 0.16);
}

/* iOS settings style for the public recharge page only. */
body.recharge-ios {
  color: #1d1d1f;
  background:
    radial-gradient(circle at 50% -18%, rgba(255, 255, 255, 0.92), transparent 36%),
    #f5f5f7;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

.recharge-ios .page-shell::before {
  display: none;
}

.recharge-ios-shell {
  width: min(100% - 32px, 760px);
  align-items: start;
  padding: clamp(28px, 6vw, 66px) 0;
}

.recharge-ios-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.recharge-ios-hero {
  margin: 0 0 22px;
  padding: 0 6px;
}

.recharge-ios .eyebrow {
  color: #0071e3;
  font-size: 13px;
  letter-spacing: 0;
}

.recharge-ios h1 {
  color: #1d1d1f;
  font-size: clamp(34px, 7vw, 52px);
  font-weight: 800;
  line-height: 1.04;
}

.recharge-ios .summary {
  max-width: 620px;
  color: #6e6e73;
  font-size: 16px;
  line-height: 1.55;
}

.recharge-ios-form {
  gap: 14px;
}

.recharge-ios .ios-settings-group {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.055);
  backdrop-filter: blur(18px);
}

.recharge-ios .ios-section-title,
.recharge-ios .compact-header h2 {
  margin: 0;
  color: #1d1d1f;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.recharge-ios .field-group {
  gap: 9px;
}

.recharge-ios label,
.recharge-ios .ios-label-line {
  color: #424245;
  font-size: 13px;
  font-weight: 700;
}

.recharge-ios .ios-label-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recharge-ios .ios-label-line a {
  flex: 0 0 auto;
  color: #0071e3;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.recharge-ios .ios-label-line a:hover {
  text-decoration: underline;
}

.recharge-ios input,
.recharge-ios textarea,
.recharge-ios select {
  color: #1d1d1f;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: rgba(245, 245, 247, 0.78);
}

.recharge-ios input,
.recharge-ios select {
  height: 50px;
  padding: 0 16px;
}

.recharge-ios textarea {
  min-height: 178px;
  padding: 14px 16px;
}

.recharge-ios input:focus,
.recharge-ios textarea:focus,
.recharge-ios select:focus {
  border-color: rgba(0, 113, 227, 0.58);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.13);
}

.recharge-ios .inline-action,
.recharge-ios .wide-action {
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 10px;
}

.recharge-ios button {
  height: 50px;
  border-radius: 12px;
  font-weight: 800;
}

.recharge-ios #verify-btn,
.recharge-ios #query-btn {
  color: #ffffff;
  background: #0071e3;
}

.recharge-ios #verify-btn:not(:disabled):hover,
.recharge-ios #query-btn:not(:disabled):hover {
  background: #0066cc;
}

.recharge-ios .primary-btn {
  color: #ffffff;
  background: #1d1d1f;
}

.recharge-ios .primary-btn:not(:disabled):hover {
  background: #000000;
}

.recharge-ios .secondary-btn {
  color: #1d1d1f;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #e8e8ed;
  box-shadow: none;
}

.recharge-ios .secondary-btn:not(:disabled):hover {
  color: #1d1d1f;
  background: #dedee3;
}

.recharge-ios .ios-action-group {
  gap: 10px;
}

.recharge-ios .step-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.recharge-ios .step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  color: #ffffff;
  background: #1d1d1f;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.recharge-ios .step-hint {
  margin: -2px 0 14px;
  color: #6e6e73;
  font-size: 14px;
  line-height: 1.5;
}

.recharge-ios .action-step-title {
  margin-bottom: 4px;
}

.recharge-ios .session-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #ffffff;
  background: #1d1d1f;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.recharge-ios .session-link-button:hover {
  background: #000000;
}

.recharge-ios .cancel-queue-btn {
  margin-top: 0;
}

.recharge-ios .status-box {
  min-height: 48px;
  align-items: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: rgba(245, 245, 247, 0.86);
  box-shadow: none;
  color: #6e6e73;
}

.recharge-ios .status-box[data-state="success"] {
  color: #0f7a3b;
  border-color: rgba(15, 122, 59, 0.16);
  background: #eaf7ee;
}

.recharge-ios .status-box[data-state="error"] {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.16);
  background: #fff0f0;
}

.recharge-ios .status-box[data-state="warning"] {
  color: #805200;
  border-color: rgba(128, 82, 0, 0.14);
  background: #fff7df;
}

.recharge-ios .submit-result {
  min-height: 22px;
  padding: 0 4px;
  color: #6e6e73;
  font-size: 13px;
}

.recharge-ios .self-service {
  margin-top: 14px;
  padding-top: 18px;
  border-top: 0;
}

.recharge-ios .compact-header {
  margin-bottom: 0;
}

.recharge-ios .batch-query-block {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.recharge-ios .batch-query-table {
  overflow: hidden;
  border-radius: 14px;
}

@media (max-width: 620px) {
  .recharge-ios-shell {
    width: min(100% - 20px, 760px);
    padding: 22px 0;
  }

  .recharge-ios h1 {
    font-size: 36px;
  }

  .recharge-ios .ios-settings-group {
    padding: 14px;
    border-radius: 16px;
  }

  .recharge-ios .ios-label-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .recharge-ios .inline-action,
  .recharge-ios .wide-action {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.09), transparent 38%),
    linear-gradient(260deg, rgba(154, 90, 0, 0.1), transparent 36%),
    var(--bg);
  background-attachment: fixed;
  font-family:
    Inter, "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

[hidden] {
  display: none !important;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(100% - 32px, 760px);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 40px 0;
  position: relative;
  isolation: isolate;
}

.page-shell::before,
.admin-shell::before {
  content: "";
  position: absolute;
  inset: 22px -12px;
  z-index: -1;
  border: 1px solid rgba(29, 35, 32, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.32);
  box-shadow: var(--shadow-soft);
  pointer-events: none;
}

.recharge-panel {
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(29, 35, 32, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow-lift);
  padding: clamp(24px, 4vw, 42px);
  position: relative;
  isolation: isolate;
}

.panel-header {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.15;
  letter-spacing: 0;
}

.summary {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.form-stack {
  display: grid;
  gap: 20px;
}

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

label {
  font-size: 14px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

input,
select {
  height: 46px;
  padding: 0 14px;
}

textarea {
  resize: vertical;
  min-height: 146px;
  padding: 12px 14px;
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(15, 118, 110, 0.72);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

input:disabled,
textarea:disabled,
select:disabled {
  color: #8a928c;
  background: #eff2ef;
  cursor: not-allowed;
}

.inline-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 10px;
}

button {
  height: 46px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

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

#verify-btn {
  color: #ffffff;
  background: #2f554e;
}

#verify-btn:not(:disabled):hover {
  background: #23463f;
}

.primary-btn {
  width: 100%;
  color: #ffffff;
  background: var(--accent);
}

.primary-btn:not(:disabled):hover {
  background: var(--accent-dark);
}

.secondary-btn {
  width: 100%;
  color: var(--accent);
  background: #eef5f1;
  border: 1px solid rgba(15, 118, 110, 0.22);
  box-shadow: var(--shadow-soft);
}

.secondary-btn:not(:disabled):hover {
  color: #ffffff;
  background: var(--accent);
}

.cancel-queue-btn {
  margin-top: -6px;
}

.hint,
.submit-result {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.char-counter {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.char-counter[data-state="warning"] {
  color: var(--warning);
  font-weight: 700;
}

.status-box {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #f8faf7;
  line-height: 1.5;
  box-shadow: var(--shadow-soft);
}

.status-box[data-state="success"] {
  color: var(--success);
  border-color: rgba(19, 108, 58, 0.25);
  background: var(--success-bg);
}

.status-box[data-state="error"] {
  color: var(--error);
  border-color: rgba(163, 34, 34, 0.25);
  background: var(--error-bg);
}

.status-box[data-state="warning"] {
  color: var(--warning);
  border-color: rgba(154, 90, 0, 0.28);
  background: var(--warning-bg);
}

.session-account-confirm {
  margin-top: 10px;
}

.submit-result[data-state="success"] {
  color: var(--success);
}

.submit-result[data-state="error"] {
  color: var(--error);
}

.self-service {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  position: relative;
}

.compact-header {
  margin-bottom: 16px;
}

h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.wide-action {
  grid-template-columns: minmax(0, 1fr) 88px 120px;
}

.new-cdk-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 76px;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(19, 108, 58, 0.25);
  border-radius: 8px;
  background: var(--success-bg);
}

.new-cdk-box span {
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
}

.new-cdk-box code {
  overflow-wrap: anywhere;
  color: var(--success);
  font-weight: 700;
}

.new-cdk-box button {
  height: 34px;
  color: #ffffff;
  background: var(--success);
}

.batch-query-block {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.batch-query-result {
  min-height: 80px;
  display: block;
  overflow-x: auto;
}

.batch-query-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.batch-query-table th,
.batch-query-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.batch-query-table td:last-child {
  min-width: 220px;
  white-space: normal;
}

.batch-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  background: #eef5f1;
}

.batch-state[data-state="success"],
.batch-state[data-state="unused"] {
  color: var(--success);
  background: var(--success-bg);
}

.batch-state[data-state="failed"],
.batch-state[data-state="retryable"],
.batch-state[data-state="not_found"] {
  color: var(--error);
  background: var(--error-bg);
}

.batch-state[data-state="pending"],
.batch-state[data-state="operating"],
.batch-state[data-state="submitting"] {
  color: #1f5f9f;
  background: #edf5ff;
}

.admin-shell {
  width: min(100% - 32px, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 0;
  position: relative;
  isolation: isolate;
}

.admin-panel,
.admin-dashboard {
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(29, 35, 32, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow-lift);
  padding: clamp(22px, 3vw, 34px);
  position: relative;
  isolation: isolate;
}

.admin-panel {
  max-width: 520px;
  margin: 10vh auto 0;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

.tab-btn {
  height: 40px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.toolbar-actions,
.mini-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-actions button,
.mini-btn {
  height: 34px;
  padding: 0 12px;
  color: var(--text);
  background: #e8eee9;
}

.toolbar-actions button:disabled,
.mini-btn:disabled,
.status-select:disabled,
.status-note:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.toolbar-actions button:hover,
.mini-btn:hover {
  background: #dce5df;
}

.toolbar-actions button:disabled:hover,
.mini-btn:disabled:hover {
  background: #e8eee9;
}

.copy-session-btn {
  color: #ffffff;
  background: var(--accent);
}

.copy-session-btn:hover {
  background: var(--accent-dark);
}

.copy-session-btn:disabled,
.copy-session-btn:disabled:hover {
  color: #53615a;
  background: #e8eee9;
}

.ghost-btn {
  color: var(--muted);
  background: #f0f3f1;
}

.danger-btn {
  color: var(--error);
  background: var(--error-bg);
}

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

.stat-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.stat-item strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color 180ms ease;
}

.stat-item span,
.muted-line {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.operator-stats-card {
  margin: 12px 0 14px;
  padding: 14px;
  border: 1px solid rgba(29, 35, 32, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.operator-stats-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 14px;
}

.operator-stats-row .operator-stats-card {
  margin: 0;
}

.operator-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.operator-stat-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.operator-stat-item strong {
  display: block;
  font-size: 26px;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  transition: color 180ms ease;
}

.stat-item strong.is-number-jumping,
.operator-stat-item strong.is-number-jumping {
  color: var(--accent-dark);
  animation: numberJump 660ms ease;
}

@keyframes numberJump {
  0% {
    transform: translateY(0) scale(1);
  }
  35% {
    transform: translateY(-4px) scale(1.12);
  }
  70% {
    transform: translateY(2px) scale(0.98);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.operator-stat-item span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.submission-list-group {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(29, 35, 32, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.submission-list-group.processed-list {
  margin-top: 28px;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
}

.list-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.collapse-toggle {
  min-width: 66px;
}

.list-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.list-count {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef3ef;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.records-table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
  background: #ffffff;
}

.submissions-table {
  min-width: 920px;
}

.agent-table {
  min-width: 860px;
}

.agent-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, max-content));
  gap: 8px;
  align-items: center;
}

.agent-note {
  grid-column: 1 / -1;
  min-width: 260px;
}

.agent-note-shortcuts {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-processed-note {
  display: grid;
  gap: 8px;
  min-width: 280px;
}

.agent-processed-note .agent-note {
  min-width: 0;
}

.inventory-table {
  min-width: 1420px;
}

.exchange-chain-cell {
  min-width: 280px;
  max-width: 420px;
  overflow-wrap: anywhere;
  color: #3f4f48;
  line-height: 1.55;
}

.submissions-table th:nth-child(1),
.submissions-table td:nth-child(1) {
  width: 170px;
}

.submissions-table th:nth-child(2),
.submissions-table td:nth-child(2) {
  width: 210px;
}

.submissions-table th:nth-child(3),
.submissions-table td:nth-child(3) {
  width: 340px;
}

.records-table th,
.records-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.records-table th {
  color: var(--muted);
  background: #f7f9f7;
  font-weight: 700;
}

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

.submission-row-animating-source {
  opacity: 0;
}

.submission-row-reflowing {
  position: relative;
  z-index: 2;
  will-change: transform;
}

.submission-flight-card {
  position: fixed;
  z-index: 2000;
  display: grid;
  overflow: hidden;
  pointer-events: none;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 26px 70px rgba(15, 43, 38, 0.24);
  transform-origin: center center;
  will-change: transform, opacity;
  contain: layout paint;
  backface-visibility: hidden;
}

.submission-flight-cell {
  min-width: 0;
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  word-break: break-word;
}

.submission-flight-cell:last-child {
  border-right: 0;
}

.submission-flight-card button,
.submission-flight-card input,
.submission-flight-card select,
.submission-flight-card textarea {
  pointer-events: none;
}

.stat-drop-target {
  animation: statDropTargetPulse 780ms ease;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.13);
}

@keyframes statDropTargetPulse {
  0% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.operator-locked-row {
  background: #f7f9f8;
}

.operator-locked-row td {
  opacity: 0.78;
}

.session-value {
  display: block;
  max-width: 320px;
  margin-bottom: 8px;
  padding: 8px;
  overflow-wrap: anywhere;
  border-radius: 6px;
  background: #f3f5f2;
  color: #28322d;
  white-space: pre-wrap;
}

.session-cell .mini-actions {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 320px;
  gap: 10px;
}

.session-cell .copy-session-btn {
  width: 100%;
  height: 48px;
  font-size: 17px;
  font-weight: 800;
  border-radius: 8px;
}

.session-cell .copy-session-btn:disabled,
.session-cell .copy-session-btn:disabled:hover {
  color: #9aa29e;
  background: #f0f3f1;
}

.session-cell .ghost-btn {
  width: 100%;
}

.account-line {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.operator-line {
  display: block;
  margin: -2px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 8px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pending {
  color: var(--warning);
  background: var(--warning-bg);
}

.status-operating {
  color: #1f5f9f;
  background: #edf5ff;
}

.status-operating.operator-pill {
  min-height: 34px;
  padding: 0 14px;
  color: #ffffff;
  background: #1f5f9f;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(31, 95, 159, 0.22);
}

.status-success {
  color: var(--success);
  background: var(--success-bg);
}

.status-failed {
  color: var(--error);
  background: var(--error-bg);
}

.status-canceled {
  color: var(--warning);
  background: var(--warning-bg);
}

.status-select,
.status-note {
  width: 100%;
  height: 34px;
  margin-bottom: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
}

.save-status {
  width: 100%;
}

.save-status.saved-status {
  color: #ffffff;
  background: var(--success);
}

.complete-status {
  width: auto;
  min-height: 34px;
  color: #ffffff;
  background: var(--success);
}

.status-save-feedback[data-state="success"] {
  color: var(--success);
  font-weight: 700;
}

.status-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.admin-toast {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 50;
  min-width: 220px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 14px 18px;
  border: 1px solid rgba(19, 108, 58, 0.24);
  border-radius: 8px;
  color: var(--success);
  background: rgba(234, 247, 238, 0.98);
  box-shadow: var(--shadow-lift);
  font-size: 16px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.admin-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.admin-toast[data-state="error"] {
  border-color: rgba(163, 34, 34, 0.24);
  color: var(--error);
  background: rgba(255, 240, 240, 0.98);
}

.shortcut-btn {
  width: auto;
  min-height: 34px;
  padding: 6px 10px;
  text-align: left;
  white-space: normal;
}

.generate-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) 132px;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.library-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.library-form .span-2 {
  grid-column: span 2;
}

.checkbox-row {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.library-table {
  min-width: 1080px;
}

.generated-codes {
  width: 100%;
  min-height: 160px;
  font-family: Consolas, "Courier New", monospace;
}

.generated-codes-box {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.generated-codes-box .mini-btn {
  justify-self: start;
}

.inventory-export-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.muted-inline {
  color: var(--muted);
  font-size: 12px;
}

.inventory-search-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 88px 88px;
  gap: 10px;
  align-items: end;
  margin: 12px 0 14px;
  max-width: 720px;
}

#submission-search-form {
  grid-template-columns: minmax(220px, 1fr) 132px 88px 88px;
  max-width: 880px;
}

.inventory-search-form .mini-btn {
  height: 46px;
}

.compact-code {
  max-width: 320px;
  margin-bottom: 0;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 8px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.source-admin_batch {
  color: var(--success);
  background: var(--success-bg);
}

.source-exchange {
  color: var(--warning);
  background: var(--warning-bg);
}

.source-seed {
  color: var(--muted);
  background: #eef3ef;
}

.exported-pill {
  color: var(--warning);
  background: var(--warning-bg);
}

.not-exported-pill {
  color: var(--success);
  background: var(--success-bg);
}

.exchange-source-row td {
  background: #fffaf0;
}

.cdk-state-unused {
  color: var(--success);
  background: var(--success-bg);
}

.cdk-state-submitting,
.cdk-state-retryable,
.cdk-state-exchanged {
  color: var(--warning);
  background: var(--warning-bg);
}

.cdk-state-used,
.cdk-state-disabled,
.cdk-state-expired,
.cdk-state-not_found {
  color: var(--error);
  background: var(--error-bg);
}

.empty-cell {
  height: 120px;
  color: var(--muted);
  text-align: center !important;
  vertical-align: middle !important;
}

.exchange-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(18, 36, 55, 0.44), rgba(18, 36, 55, 0.1) 52%, rgba(18, 36, 55, 0.05)),
    url("/assets/exchange-forest-worker.png?v=20260615a") center / cover no-repeat fixed;
}

.exchange-shell {
  min-height: 100vh;
  width: min(100% - 28px, 1040px);
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 32px 0;
}

.exchange-card {
  width: min(100%, 560px);
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 26px 80px rgba(18, 36, 55, 0.24);
  backdrop-filter: blur(14px);
}

.exchange-header {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.exchange-badge {
  width: max-content;
  padding: 7px 11px;
  border-radius: 999px;
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.92);
  font-size: 13px;
  font-weight: 800;
}

.exchange-header h1 {
  font-size: clamp(30px, 6vw, 44px);
  color: #111827;
}

.exchange-header p {
  margin: 0;
  color: #475569;
  line-height: 1.75;
}

.exchange-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.exchange-step {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.exchange-step.is-active {
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(219, 234, 254, 0.86);
}

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

.exchange-form label {
  color: #111827;
  font-size: 15px;
}

.exchange-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 106px;
  gap: 10px;
}

.exchange-input-row input {
  height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
}

.exchange-input-row button,
.exchange-primary-btn,
.exchange-success button {
  min-height: 50px;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.exchange-primary-btn {
  width: 100%;
  margin-top: 2px;
  background: linear-gradient(135deg, #fb923c, #f97316);
  box-shadow: 0 14px 28px rgba(249, 115, 22, 0.24);
}

.exchange-primary-btn:disabled,
.exchange-input-row button:disabled,
.exchange-success button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.exchange-result {
  min-height: 72px;
  padding: 14px 15px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 14px;
  color: #475569;
  background: rgba(248, 250, 252, 0.76);
  line-height: 1.6;
}

.exchange-result[data-state="success"] {
  color: #166534;
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(240, 253, 244, 0.88);
}

.exchange-result[data-state="error"] {
  color: #b91c1c;
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(254, 242, 242, 0.9);
}

.exchange-result[data-state="info"] {
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.28);
  background: rgba(239, 246, 255, 0.9);
}

.exchange-success {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 118px;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  color: #14532d;
  background: rgba(240, 253, 244, 0.9);
  border: 1px solid rgba(34, 197, 94, 0.24);
}

.exchange-success span {
  font-weight: 800;
}

.exchange-success code {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: #111827;
  background: rgba(255, 255, 255, 0.82);
  word-break: break-all;
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 20px, 760px);
    align-items: start;
    padding: 18px 0;
  }

  .recharge-panel {
    padding: 22px 18px;
  }

  .inline-action {
    grid-template-columns: 1fr;
  }

  .wide-action {
    grid-template-columns: 1fr;
  }

  .new-cdk-box {
    grid-template-columns: 1fr;
  }

  #verify-btn {
    width: 100%;
  }

  .admin-shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }

  .admin-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .operator-stats-row {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    overflow-x: auto;
  }

  .generate-form {
    grid-template-columns: 1fr;
  }

  .inventory-search-form {
    grid-template-columns: 1fr;
  }

  .library-form {
    grid-template-columns: 1fr;
  }

  .library-form .span-2 {
    grid-column: auto;
  }

  .exchange-page {
    background-position: 65% center;
  }

  .exchange-shell {
    align-items: end;
    padding: 18px 0;
  }

  .exchange-card {
    border-radius: 14px;
  }

  .exchange-steps,
  .exchange-input-row,
  .exchange-success {
    grid-template-columns: 1fr;
  }
}

/* Final scoped overrides: keep the iOS recharge page isolated from legacy styles above. */
body.recharge-ios main.recharge-ios-shell {
  width: min(100% - 32px, 760px);
  align-items: start;
  padding: clamp(28px, 6vw, 66px) 0;
}

body.recharge-ios section.recharge-ios-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.recharge-ios .recharge-ios-form,
body.recharge-ios .self-service.ios-settings-group {
  display: grid;
  gap: 14px;
}

body.recharge-ios .ios-settings-group {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.055);
}

body.recharge-ios .inline-action,
body.recharge-ios .wide-action {
  grid-template-columns: minmax(0, 1fr) 88px;
}

body.recharge-ios .recharge-ios-panel button {
  height: 50px;
  border-radius: 12px;
}

body.recharge-ios .recharge-ios-panel input,
body.recharge-ios .recharge-ios-panel textarea {
  border-radius: 12px;
}

@media (max-width: 620px) {
  body.recharge-ios main.recharge-ios-shell {
    width: min(100% - 20px, 760px);
    padding: 22px 0;
  }

  body.recharge-ios section.recharge-ios-panel {
    padding: 0;
  }

  body.recharge-ios .inline-action,
  body.recharge-ios .wide-action {
    grid-template-columns: 1fr;
  }
}

/* ==================== 提交成功大提示框 ==================== */
.submit-success-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 30, 22, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: submit-success-fade 200ms ease-out;
}

.submit-success-modal__box {
  width: min(100%, 380px);
  background: #ffffff;
  border-radius: 20px;
  padding: 32px 28px 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: submit-success-pop 260ms cubic-bezier(0.2, 0.9, 0.35, 1.2);
}

.submit-success-modal__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #16a34a;
  color: #ffffff;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 12px 28px rgba(22, 163, 74, 0.35);
}

.submit-success-modal__title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #136c3a;
}

.submit-success-modal__desc {
  font-size: 15px;
  line-height: 1.55;
  color: #4a5a52;
  margin: 0 0 22px;
  word-break: break-all;
}

.submit-success-modal__account {
  display: inline-block;
  background: #eaf7ee;
  color: #136c3a;
  border-radius: 10px;
  padding: 6px 12px;
  margin-top: 4px;
  font-weight: 600;
  font-size: 14px;
}

.submit-success-modal__btn {
  width: 100%;
  padding: 12px 20px;
  border-radius: 12px;
  border: 0;
  background: #16a34a;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease;
}

.submit-success-modal__btn:hover,
.submit-success-modal__btn:focus-visible {
  background: #128a3f;
  outline: none;
}

.submit-success-modal__btn:active {
  background: #0f7534;
}

@keyframes submit-success-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes submit-success-pop {
  0%   { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

@media (max-width: 480px) {
  .submit-success-modal__box {
    padding: 26px 20px 20px;
  }
  .submit-success-modal__icon {
    width: 60px;
    height: 60px;
    font-size: 36px;
  }
  .submit-success-modal__title {
    font-size: 20px;
  }
}
