:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --surface-3: #e3e9f2;
  --ink: #0f141a;
  --muted: #5a6472;
  --soft: #7d8896;
  --line: #d8e0ea;
  --line-strong: #b9c4d1;
  --blue: #1f66d1;
  --blue-dark: #154ea5;
  --blue-soft: #eaf1fc;
  --red: #d13b2f;
  --red-dark: #b52d24;
  --red-soft: #fff0ef;
  --green: #177245;
  --green-dark: #126038;
  --green-soft: #eaf7ef;
  --shadow: rgba(16, 19, 24, 0.08);
  --success: #177245;
  --danger: #b42318;
  --waiting: #1769e0;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

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

a,
button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: var(--blue);
  color: var(--surface);
  padding: 0 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease, border-color 140ms ease;
}

a:hover,
button:hover:not(:disabled) {
  transform: translateY(-1px);
}

a:hover,
button:hover:not(:disabled) {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(17, 18, 15, 0.18);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  padding: 0 12px;
}

textarea {
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.45;
}

.user-layout {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 44px);
}

.login-panel,
.admin-layout {
  width: min(980px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 42px var(--shadow);
  padding: clamp(22px, 4vw, 36px);
}

.user-panel,
.auth-panel {
  width: min(520px, 100%);
}

.user-panel {
  padding-bottom: clamp(34px, 7vw, 52px);
}

.admin-layout {
  width: min(1320px, calc(100% - 32px));
  margin: 24px auto;
}

.admin-pages-nav {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
}

.page-tab {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.page-tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--surface);
}

.page-tab {
  border-radius: 999px;
}

.admin-page {
  display: none;
}

.admin-page.active {
  display: block;
}

.session-client-mode .admin-pages-nav,
.session-client-mode .head-actions a,
.session-client-mode #testSoundQuickBtn {
  display: none;
}

.session-client-mode .admin-head {
  margin-bottom: 18px;
}

.topline,
.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.topline {
  justify-content: flex-start;
}

.user-title {
  justify-content: center;
  margin: -8px 0 18px;
  text-align: center;
}

.user-title h1 {
  width: 100%;
  text-align: center;
}

.head-actions,
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.head-actions a,
.actions button {
  background: var(--red);
  color: var(--surface);
  border-color: var(--red);
}

.head-actions a:hover,
.actions button:hover:not(:disabled),
.row-actions .fail-row:hover:not(:disabled) {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.head-actions button,
.auth-form button {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--surface);
}

.head-actions button {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--blue);
  color: var(--surface);
  font-weight: 800;
}

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

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.12;
  font-weight: 800;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

.state-view {
  display: grid;
  gap: 16px;
}

.state-view[hidden] {
  display: none !important;
}

.sms-form {
  display: grid;
  gap: 14px;
  max-width: 420px;
  margin: 0 auto;
}

.sms-field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.field-label {
  font-size: 13px;
  color: var(--muted, #5a6472);
}

.sms-code-row {
  display: flex;
  gap: 8px;
}

.sms-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
}

.sms-input:focus {
  outline: none;
  border-color: var(--blue);
}

.sms-send-btn {
  flex: 0 0 132px;
  width: 132px;
  height: 44px;
  padding: 0 10px;
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 16px;
}

.sms-send-btn:hover:not(:disabled) {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

.sms-send-btn:disabled {
  background: #b0b8c4;
  border-color: #b0b8c4;
  cursor: not-allowed;
}

.captcha-row {
  margin-bottom: 10px;
}

.captcha-label-row {
  margin-bottom: 6px;
}

.captcha-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.captcha-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.2s;
}

.captcha-input:focus {
  outline: none;
  border-color: var(--blue);
}

.captcha-img {
  flex: 0 0 148px;
  width: 148px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  object-fit: fill;
  object-position: center;
}

.sms-form .sms-submit {
  margin-bottom: 10px;
}
  min-height: 44px;
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  border-radius: 8px;
  font-weight: 700;
  margin-bottom: 10px;
  cursor: pointer;
}

.sms-full-btn:hover:not(:disabled) {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  transform: translateY(-1px);
}

.sms-full-btn:disabled {
  background: #b0b8c4;
  border-color: #b0b8c4;
  color: #fff;
  cursor: not-allowed;
  transform: none;
}

.sms-form .sms-submit {
  width: 100%;
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  font-weight: 700;
}

.sms-form .sms-submit:hover:not(:disabled) {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  transform: translateY(-1px);
}

.login-switch {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.user-panel .login-switch .login-mode-btn {
  display: flex;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transform: none;
  box-shadow: none;
}

.user-panel .login-switch .login-mode-btn:hover:not(:disabled) {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: #fff;
  transform: translateY(-1px);
}

.user-panel .sms-form .login-switch {
  margin-top: 42px;
  padding-top: 14px;
}

.user-panel .login-switch-qr {
  margin-top: -6px;
  padding-top: 8px;
}

.sms-demo-hint {
  font-size: 13px;
  color: #9a6700;
  text-align: center;
}

.qr-wrap {
  position: relative;
  width: min(360px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  box-shadow: inset 0 0 0 6px var(--surface-2);
}

.qr-wrap a {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  padding: 0;
  overflow: hidden;
  transform: none;
}

.qr-wrap a:hover {
  background: transparent;
  border-color: transparent;
  transform: none;
}

.qr-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-empty {
  position: absolute;
  inset: 10px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  padding: 20px;
}

.actions {
  justify-content: center;
  margin: 0;
}

.user-panel .actions button {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 600;
  min-width: 160px;
}

.user-panel .actions button:hover:not(:disabled) {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: #fff;
}

.user-status {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--ink);
  padding: 0 18px;
  text-align: center;
  font-size: clamp(18px, 3vw, 22px);
  line-height: 1.35;
  font-weight: 750;
  word-break: break-word;
}

.user-status.is-error {
  border-color: #f3b4b4;
  background: #fff1f1;
  color: #b42318;
}

.account-view,
.final-view {
  gap: 18px;
}

.user-info-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 12px 30px rgba(16, 19, 24, 0.06);
}

.user-info-card .loader,
.user-info-card .user-status {
  grid-column: 1 / -1;
}

.final-card {
  grid-template-columns: 1fr;
}

.user-info-main {
  min-width: 0;
  overflow: hidden;
}

.account-card {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.account-card h2 {
  margin: 0 0 6px;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.1;
}

.user-info-card h2 {
  margin: 0 0 6px;
  max-width: 100%;
  font-size: clamp(18px, 4vw, 24px);
  line-height: 1.22;
  font-weight: 800;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.user-info-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.account-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.avatar {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--blue);
  color: var(--surface);
  background-size: cover;
  background-position: center;
  font-weight: 800;
}

.loader {
  width: 50px;
  height: 50px;
  justify-self: center;
  border: 4px solid var(--surface-3);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.big-state {
  min-height: 136px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--green-soft);
  padding: 24px 26px;
  text-align: center;
  font-size: clamp(26px, 4.8vw, 36px);
  line-height: 1.32;
  font-weight: 800;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: normal;
  text-wrap: balance;
}

.big-state.done {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(23, 114, 69, 0.28);
}

.big-state.failed {
  background: var(--red-soft);
  color: var(--red-dark);
  border-color: rgba(217, 45, 32, 0.3);
  border-style: solid;
}

.final-meta {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 16px;
}

.final-meta div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: baseline;
}

.final-meta span {
  color: var(--muted);
  font-weight: 700;
}

.final-meta strong {
  min-width: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 750;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.final-action {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b31217;
  border-radius: 8px;
  background: var(--red);
  color: #ffffff;
  font-weight: 750;
  text-decoration: none;
}

.final-action:hover {
  color: #ffffff;
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(16, 19, 24, 0.42);
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.api-modal {
  width: min(392px, calc(100vw - 36px));
  aspect-ratio: 1;
  max-height: calc(100dvh - 36px);
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr) auto;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(16, 19, 24, 0.22);
  overflow: hidden;
}

.api-modal.has-image {
  width: min(392px, calc(100vw - 22px));
  height: min(430px, calc(100vh - 22px));
  aspect-ratio: auto;
  max-height: calc(100vh - 16px);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.api-modal pre {
  min-height: 0;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}

.api-modal.has-image pre,
.api-modal pre.is-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  max-height: none;
  overflow: hidden !important;
  padding: 10px;
}

.modal-head {
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
  text-align: center;
}

.modal-head strong {
  display: block;
  width: 100%;
  font-size: 18px;
}

.modal-actions {
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--line);
  padding: 14px;
}

.modal-actions button {
  min-height: 34px;
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
  min-width: 110px;
}

.status-page {
  max-width: 760px;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.auth-form label {
  color: var(--muted);
  font-weight: 900;
}

.auth-form .remember-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.auth-form .remember-line input {
  width: auto;
  min-height: auto;
}

pre {
  margin: 0;
  min-height: 116px;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
  color: var(--ink);
  line-height: 1.55;
}

pre.is-image {
  display: grid;
  place-items: center;
  background: #fff;
  white-space: normal;
  overflow: hidden !important;
  padding: 10px;
}

.api-modal-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card-tool {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 10px;
  align-items: stretch;
  margin: 0;
}

.card-tool #batchName {
  grid-column: span 2;
}

.card-result {
  grid-column: 1 / -1;
}

.management-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.agents-page-grid {
  display: grid;
  gap: 16px;
}

.management-main,
.management-side {
  display: grid;
  gap: 16px;
}

.card-tool input {
  min-height: 42px;
}

.card-tool button {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--surface);
}

.card-tool #exportCardsBtn {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.card-result {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 7px 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.card-result strong {
  color: var(--ink);
  font-size: 16px;
}

.card-result a {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
}

.card-search-tool {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0;
}

.card-search-result {
  grid-column: 1 / -1;
  min-height: 40px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 8px 10px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.card-search-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 80px minmax(130px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.card-search-row strong {
  color: var(--ink);
}

.card-search-row span {
  min-width: 0;
}

.card-search-row button {
  min-height: 34px;
  padding: 0 12px;
}

.card-search-row .delete-card {
  background: var(--red);
  border-color: var(--red);
  color: var(--surface);
}

.card-search-row .delete-card:hover:not(:disabled) {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.batch-panel {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.account-panel {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.account-tool,
.filter-bar {
  display: grid;
  gap: 10px;
}

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

.pagination-bar div {
  margin-right: auto;
  color: var(--muted);
  font-weight: 800;
}

.pagination-bar button,
.pagination-bar select {
  min-height: 38px;
}

.account-tool {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 12px;
}

.account-tool button {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--surface);
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

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

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

.stats-shortcuts button {
  min-height: 34px;
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.stats-tool button {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--surface);
}

.agent-stats {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.stats-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 80px 80px 80px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.stats-row:first-child {
  border-top: 0;
}

.stats-head {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stats-row b {
  text-align: center;
}

.account-card-mini {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 12px;
}

.account-card-mini strong,
.account-card-mini span {
  display: block;
}

.account-card-mini span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.account-card-mini label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.account-card-mini input {
  width: auto;
  min-height: auto;
}

.account-card-mini .delete-agent {
  min-height: 36px;
  background: var(--red);
  border-color: var(--red);
  color: var(--surface);
}

.account-card-mini .delete-agent:hover:not(:disabled) {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.pay-links-layout {
  max-width: 1040px;
}

.api-config-layout {
  max-width: 1080px;
}

.cards-layout {
  max-width: 1120px;
}

.api-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.api-config-grid .config-card {
  gap: 14px;
}

.api-config-grid .config-card-actions span {
  color: var(--muted);
  font-weight: 800;
}

.api-config-grid .config-card-actions span.is-error {
  color: var(--red);
}

.api-config-grid .config-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.switch-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.inline-input {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 14px;
}

.input-hint {
  color: var(--muted);
  font-size: 13px;
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
  font-weight: 800;
}

.pay-tool-head {
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.pay-head-actions {
  align-items: stretch;
  flex-direction: column;
}

.pay-top-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.pay-count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.pay-admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  margin-bottom: 16px;
}

.pay-admin-panel .pay-count-grid {
  margin-bottom: 0;
}

.pay-count-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.pay-count-grid span,
.pay-current label span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
}

.pay-count-grid strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.pay-available-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  margin-bottom: 16px;
}

.pay-available-top {
  text-align: center;
  margin: 0 auto 18px;
  max-width: 360px;
}

.pay-available-panel span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
}

.pay-available-panel strong {
  color: var(--ink);
  font-size: 42px;
  line-height: 1;
}

.pay-available-panel.has-stock {
  background: #6d3fd1;
  border-color: #6d3fd1;
}

.pay-available-panel.has-stock span,
.pay-available-panel.has-stock strong {
  color: var(--surface);
}

.pay-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
  gap: 16px;
}

.pay-workbench-single {
  grid-template-columns: minmax(0, 1fr);
}

.pay-current {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.pay-current label + label {
  display: block;
  margin-top: 12px;
}

.pay-link-field {
  margin-top: 12px;
}

.pay-link-field > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
}

.current-pay-link {
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  overflow-wrap: anywhere;
  text-align: left;
}

.current-pay-link.is-empty {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--muted);
}

.pay-qr-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.pay-qr-panel[role="button"] {
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.pay-qr-panel[role="button"]:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  transform: translateY(-1px);
}

.pay-qr-panel[role="button"]:focus-visible {
  outline: 3px solid rgba(31, 102, 209, 0.22);
  outline-offset: 3px;
}

.pay-qr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.pay-qr-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pay-qr-head small {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.pay-qr-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 190px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
}

.pay-qr-preview img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
}

.pay-qr-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.pay-qr-hint {
  margin: 10px 0 0;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
}

.pay-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 32px;
  margin-top: 10px;
}

.pay-actions-top {
  margin-top: 0;
  min-width: min(100%, 520px);
}

.pay-actions button {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--surface);
}

#markPaySuccessBtn {
  background: var(--green);
  border-color: var(--green);
}

#markPayFailBtn {
  background: var(--red);
  border-color: var(--red);
}

.pay-status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.pay-status.is-error {
  color: var(--red);
}

.login-records-layout {
  display: grid;
  gap: 18px;
}

.records-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.records-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
}

.records-summary span,
.record-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.records-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.records-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) 150px repeat(2, 150px) repeat(5, auto);
  gap: 8px;
  align-items: center;
}

.records-list {
  display: grid;
  gap: 6px;
}

.record-card,
.record-row-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0;
}

.record-card-main,
.record-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
}

.record-row-main {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 120px 120px minmax(160px, 1.4fr) 170px 78px auto;
}

.record-row-main > span,
.record-row-main > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-code {
  font-size: 16px;
}

.record-name {
  max-width: 100%;
}

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

.record-row-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 14px;
}

.record-row-detail {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  padding: 10px;
}

.record-row-detail[hidden] {
  display: none;
}

.record-row-detail span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.record-meta {
  display: none;
}

.record-actions {
  display: none;
}

.records-status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.records-status.is-error {
  color: var(--danger);
}

.section-head,
.batch-top,
.batch-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head {
  margin-bottom: 12px;
}

.section-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-shortcut-panel,
.admin-home-shortcuts {
  margin-bottom: 16px;
}

.admin-home-shortcuts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.admin-shortcut-button {
  width: auto;
  min-width: 0;
  min-height: 42px;
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
  font-size: 16px;
}

.admin-shortcut-button:hover {
  background: #f6f8fb;
  border-color: var(--line-strong);
  color: var(--ink);
}

.section-head h2 {
  font-size: 20px;
}

.section-head button {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.batch-grid {
  display: grid;
  gap: 10px;
}

.session-list {
  display: grid;
  gap: 10px;
}

.session-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.session-top,
.session-meta,
.session-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-top {
  justify-content: space-between;
}

.session-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.session-main strong {
  color: var(--ink);
  font-size: 16px;
}

.session-main span,
.session-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.session-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.session-assignee {
  min-width: 180px;
}

.session-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.session-actions button {
  min-height: 38px;
}

.batch-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  padding: 26px;
  text-align: center;
  font-weight: 800;
}

.batch-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.batch-table {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.batch-table-head,
.batch-table-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) 70px 76px 76px 76px 70px 70px minmax(140px, 0.8fr) minmax(300px, 1.2fr);
  gap: 10px;
  align-items: center;
  min-width: 1100px;
  padding: 10px 12px;
}

.batch-table-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.batch-table-row {
  border-top: 1px solid var(--line);
}

.batch-collapse {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.batch-collapse-summary {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(360px, 2fr) 72px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.batch-collapse-summary::-webkit-details-marker {
  display: none;
}

.batch-summary-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(54px, 1fr));
  gap: 8px;
}

.batch-summary-stats span {
  min-width: 0;
  display: grid;
  gap: 2px;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 7px 6px;
}

.batch-summary-stats b {
  color: var(--ink);
  font-size: 15px;
}

.batch-summary-stats small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.batch-expand-label {
  justify-self: end;
  min-width: 56px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.batch-collapse-body {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 12px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding: 12px;
  background: var(--surface-2);
}

.batch-assignee-line {
  display: grid;
  gap: 6px;
}

.batch-assignee-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.batch-name-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.batch-name-cell strong,
.batch-name-cell small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-name-cell small {
  color: var(--muted);
  font-weight: 800;
}

.batch-table-row > b,
.batch-table-row > span {
  font-weight: 900;
  text-align: center;
}

.batch-top strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
}

.batch-top span,
.batch-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.batch-top b {
  min-width: 54px;
  min-height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
}

.batch-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.batch-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.batch-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.batch-stats span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 8px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.batch-stats b {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 15px;
}

.batch-meta {
  display: grid;
  gap: 4px;
}

.batch-actions {
  align-items: stretch;
}

.batch-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 1fr));
  gap: 8px;
}

.batch-actions button {
  min-height: 36px;
  padding: 0 9px;
  font-size: 12px;
  flex: unset;
}

.batch-actions .clean-batch,
.batch-actions .export-batch,
.batch-actions .copy-batch-link {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.batch-actions .clean-batch:hover:not(:disabled),
.batch-actions .export-batch:hover:not(:disabled),
.batch-actions .copy-batch-link:hover:not(:disabled) {
  background: var(--surface-2);
}

.batch-actions .delete-batch {
  background: var(--red);
  border-color: var(--red);
  color: var(--surface);
}

.batch-actions .delete-batch:hover:not(:disabled) {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.notify-panel {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.notify-panel summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}

.notify-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.notify-grid label {
  display: grid;
  gap: 6px;
}

.notify-grid label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.notify-grid button {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--surface);
}

.notify-grid > span {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--muted);
  line-height: 1.45;
}

.notify-section-title {
  grid-column: 1 / -1;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
}

.notify-help {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.notify-advanced {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
}

.notify-advanced summary {
  cursor: pointer;
  font-weight: 600;
}

.notify-advanced .notify-grid {
  margin-top: 12px;
}

.config-card .notify-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-items: end;
}

.config-card .notify-grid label {
  min-width: 0;
}

.config-card .notify-grid label span {
  min-height: 0;
  line-height: 1.35;
}

.config-card .notify-grid input,
.config-card .notify-grid select {
  width: 100%;
  min-width: 0;
}

.config-card .notify-grid .static-field {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
}

.config-card .notify-grid .full-span,
.config-card .notify-grid .notify-help,
.config-card .notify-grid .notify-advanced,
.config-card .notify-grid .config-card-actions {
  grid-column: 1 / -1;
}

#settingsPage .admin-settings-board {
  margin-top: 0;
}

.settings-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.settings-page-head h2 {
  font-size: 24px;
}

.settings-page-desc {
  margin: 0;
  max-width: 420px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-settings-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.config-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  min-width: 0;
}

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

.config-card-head h2 {
  font-size: 20px;
}

.config-subtitle {
  grid-column: 1 / -1;
  margin: 10px 0 0;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.config-card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.config-card-actions button {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--surface);
  flex-shrink: 0;
}

.config-card-actions span {
  min-height: auto;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.notify-grid .full-span {
  grid-column: 1 / -1;
}

@media (min-width: 1100px) {
  .management-grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .agents-page-grid .management-side {
    grid-template-columns: minmax(420px, 1fr) minmax(360px, 0.8fr);
    align-items: start;
  }
}

@media (max-width: 1200px) {
  .admin-settings-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .config-card .notify-grid {
    grid-template-columns: 1fr;
  }

  .card-tool #batchName {
    grid-column: 1 / -1;
  }

  .card-search-tool,
  .card-search-row {
    grid-template-columns: 1fr;
  }

  .batch-collapse-summary {
    grid-template-columns: 1fr;
  }

  .batch-summary-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .batch-expand-label {
    justify-self: stretch;
  }

  .batch-collapse-body {
    grid-template-columns: 1fr;
  }

  .pay-workbench,
  .pay-actions {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 900px) and (max-width: 1200px) {
  .admin-settings-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#resetSmsDemoBtn {
  grid-column: 1 / -1;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font: inherit;
  cursor: pointer;
}

.status-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.filter-bar {
  grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(140px, 0.7fr) minmax(260px, 1.4fr) 110px;
  margin: 0 0 14px;
}

.filter-bar button {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.status-tabs .tab {
  min-height: 42px;
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.status-tabs .tab span {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  margin-left: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
}

.status-tabs .tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--surface);
}

.status-tabs .tab.active span {
  background: rgba(255, 255, 255, 0.14);
  color: var(--surface);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(320px, 390px);
  gap: 22px;
  align-items: start;
}

.decision-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.decision-actions button {
  width: 100%;
}

.selection-summary {
  min-height: 136px;
  display: grid;
  align-content: start;
  gap: 8px;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  color: var(--muted);
  line-height: 1.45;
}

.selection-summary strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.selection-summary span {
  overflow-wrap: anywhere;
}

.copy-button {
  width: 100%;
  margin-bottom: 10px;
  background: var(--blue);
  border-color: var(--blue);
  color: var(--surface);
}

.row-actions {
  display: grid;
  grid-template-columns: minmax(112px, 1.2fr) minmax(100px, 1fr) minmax(100px, 1fr);
  gap: 8px;
  min-width: 340px;
}

.assign-row,
.batch-assignee {
  min-height: 36px;
  padding: 0 8px;
  font-size: 12px;
}

.row-actions button {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
}

.row-actions .copy-row {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--surface);
}

.row-actions .complete-row {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--surface);
}

.row-actions .fail-row {
  background: var(--red);
  border-color: var(--red);
  color: var(--surface);
}

.copy-tip {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  table-layout: fixed;
}

th:nth-child(1),
td:nth-child(1) { width: 200px; }
th:nth-child(2),
td:nth-child(2) { width: 120px; }
th:nth-child(3),
td:nth-child(3) { width: 92px; }
th:nth-child(4),
td:nth-child(4) { width: 140px; }
th:nth-child(5),
td:nth-child(5) { width: 110px; }
th:nth-child(6),
td:nth-child(6) { width: 130px; }
th:nth-child(7),
td:nth-child(7) { width: 120px; }
th:nth-child(8),
td:nth-child(8) { width: 220px; }

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

td small {
  color: var(--soft);
  font-size: 12px;
}

tbody tr {
  cursor: default;
  transition: background 140ms ease;
}

tbody tr:hover {
  background: #fafaf8;
}

tbody tr.selected {
  background: var(--surface-2);
  box-shadow: inset 4px 0 0 var(--blue);
}

.empty-row td {
  color: var(--muted);
  text-align: center;
  padding: 36px 18px;
}

.pill {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  border: 1px solid currentColor;
  font-weight: 900;
  white-space: nowrap;
}

.success {
  color: var(--success);
  background: var(--green-soft);
}

.expired {
  color: var(--danger);
  background: var(--red-soft);
}

.waiting {
  color: var(--waiting);
  background: var(--blue-soft);
}

@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

  .batch-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .account-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .admin-head {
    align-items: stretch;
    flex-direction: column;
  }

  .user-layout {
    padding: 14px;
  }

  .login-panel,
  .admin-layout {
    width: min(100%, 100%);
  }
}

@media (max-width: 560px) {
  .user-layout {
    padding: 8px 10px;
    align-items: stretch;
  }

  .login-panel,
  .admin-layout {
    padding: 16px;
  }

  .user-panel {
    min-height: calc(100dvh - 16px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 44px;
    padding-bottom: 32px;
  }

  .topline {
    gap: 12px;
  }

  .mark {
    width: 42px;
    height: 42px;
  }

  .actions,
  .head-actions,
  .decision-actions,
  .status-tabs,
  .card-tool,
  .account-tool,
  .account-grid,
  .filter-bar,
  .records-summary,
  .records-toolbar,
  .record-meta,
  .record-row-main,
  .record-row-detail,
  .pagination-bar,
  .notify-grid,
  .batch-grid,
  .batch-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .section-head,
  .batch-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .topline {
    align-items: center;
  }

  .topline h1 {
    font-size: 26px;
  }

  .batch-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  th:nth-child(1),
  td:nth-child(1),
  th:nth-child(8),
  td:nth-child(8) {
    width: auto;
  }

  .row-actions {
    grid-template-columns: 1fr;
    min-width: 180px;
  }

  a,
  button {
    width: 100%;
  }

  .account-card {
    align-items: flex-start;
  }

  .user-info-card {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 14px;
    padding: 16px;
  }

  .user-info-card .avatar {
    justify-self: center;
  }

  .qr-wrap {
    width: min(100%, 320px);
    padding: 8px;
  }

  .user-status {
    min-height: 54px;
    font-size: 18px;
    padding: 0 14px;
  }

  .big-state {
    min-height: 110px;
    padding: 18px;
    font-size: 24px;
  }

  .api-modal {
    width: min(100%, calc(100vw - 22px));
  }

  .final-meta div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  th,
  td {
    padding: 11px;
  }
}

.kuwo-redeem-layout {
  min-height: 100dvh;
  --redeem-scale: clamp(1, calc(100vw / 296px), 1.45);
  padding: 0;
  place-items: center;
  align-items: start;
  align-content: start;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf4 58%, #fff3e7 100%);
  overflow-x: hidden;
  overflow-y: auto;
}

.kuwo-redeem-layout .redeem-phone {
  position: relative;
  display: block;
  justify-content: normal;
  align-items: stretch;
  width: 296px;
  min-height: 0;
  height: auto;
  zoom: var(--redeem-scale);
  transform-origin: top center;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf4 70%, #fff3e7 100%);
  box-shadow: none;
  color: #171717;
}

.kuwo-redeem-layout .redeem-phone > .redeem-hero,
.kuwo-redeem-layout .redeem-phone > .redeem-sheet {
  flex: none;
}

.redeem-hero {
  position: relative;
  z-index: 1;
  height: 177px;
  overflow: hidden;
  padding: calc(34px + env(safe-area-inset-top)) 20px 0;
  display: flex;
  align-items: center;
  color: #fff0dc;
  background:
    linear-gradient(90deg, rgba(3, 11, 13, 0.98) 0%, rgba(3, 11, 13, 0.9) 34%, rgba(3, 11, 13, 0.42) 62%, rgba(3, 11, 13, 0.02) 100%),
    url("/assets/kuwo-banner-clean-bg.jpg") center top / cover no-repeat;
}

.redeem-phone::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0 0 auto;
  height: 177px;
  background:
    linear-gradient(90deg, rgba(3, 11, 13, 0.98) 0%, rgba(3, 11, 13, 0.9) 34%, rgba(3, 11, 13, 0.42) 62%, rgba(3, 11, 13, 0.02) 100%),
    url("/assets/kuwo-banner-clean-bg.jpg") center top / cover no-repeat;
}

.redeem-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 241, 222, 0.05), transparent 34%),
    linear-gradient(0deg, rgba(2, 11, 13, 0.2), transparent 42%);
}

.redeem-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 180px;
  transform: translateY(-18px);
}

.redeem-hero h1 {
  margin: 0;
  color: #ffe8ce;
  font-family: "Microsoft YaHei UI Light", "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  font-size: 34px;
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: 1.2px;
  background: linear-gradient(105deg, #fff1d8 0%, #f4cda8 42%, #79eee4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(105, 233, 223, 0.18)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.32));
}

.redeem-hero h1 small {
  display: block;
  margin-bottom: 7px;
  font-size: 15px;
  line-height: 1.08;
  font-weight: 300;
  letter-spacing: 1.4px;
}

.redeem-sheet {
  position: relative;
  z-index: 3;
  inset: auto;
  margin-top: -32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 14px 16px 28px;
  overflow: visible;
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 62%, #fffaf4 88%, #fff3e7 100%);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -10px 26px rgba(0, 0, 0, 0.1);
  scrollbar-width: none;
}

.redeem-sheet::-webkit-scrollbar {
  display: none;
}

.redeem-sheet .user-title {
  height: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

.redeem-card {
  flex: 0 0 auto;
  padding: 22px 12px 20px;
  border-radius: 11px;
  background: linear-gradient(180deg, #ffffff 0%, #fffdfb 100%);
  border: 1px solid rgba(225, 212, 202, 0.72);
  box-shadow: 0 16px 36px rgba(65, 44, 26, 0.1);
}

.redeem-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.redeem-head strong {
  color: #2a2521;
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 1.2px;
}

.redeem-head span {
  display: none;
}

.redeem-sheet .sms-form {
  max-width: none;
  gap: 11px;
}

.redeem-sheet .sms-field {
  margin: 0;
}

.redeem-field {
  min-height: 31px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 8px;
  background: #f4f4f4;
  border: 1px solid #eeeeee;
}

.redeem-field .field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.redeem-icon,
.redeem-icon svg {
  width: 13px;
  height: 13px;
  color: #c6955d;
  flex: 0 0 13px;
  display: block;
}

.redeem-sheet input {
  height: 29px;
  min-height: 0;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #343434;
  font-size: 11px;
  line-height: 29px;
  font-weight: 500;
  text-align: left;
  caret-color: #f07b58;
  padding: 0;
}

.redeem-sheet input::placeholder {
  color: #9c9c9f;
  font-weight: 400;
}

.redeem-code-field {
  grid-template-columns: none;
  padding-right: 0;
  display: block;
  position: relative;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.redeem-code-field > .redeem-icon {
  position: absolute;
  z-index: 1;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.redeem-code-field .sms-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 73px;
  align-items: center;
  gap: 7px;
}

.redeem-code-field .sms-input {
  height: 31px;
  min-height: 0;
  padding: 0 10px 0 34px;
  border: 1px solid #eeeeee;
  border-radius: 8px;
  background: #f4f4f4;
  line-height: 31px;
}

.redeem-code-field .sms-send-btn {
  width: 73px;
  height: 31px;
  padding: 0 5px;
  border: 0;
  border-radius: 8px;
  color: #6e3d16;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
  background: linear-gradient(180deg, #ffe8a3, #f7c457);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.redeem-code-field .sms-send-btn:disabled {
  color: #7b6a4e;
  background: linear-gradient(180deg, #f2e1b3, #d6b665);
}

.redeem-sheet .captcha-row {
  margin: 0;
}

.redeem-sheet .captcha-label-row {
  margin: 0 0 6px;
}

.redeem-sheet .captcha-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 94px;
  gap: 7px;
}

.redeem-sheet .captcha-input {
  height: 31px;
  padding: 0 10px;
  border: 1px solid #eeeeee;
  border-radius: 8px;
  background: #f4f4f4;
}

.redeem-sheet .captcha-img {
  width: 94px;
  height: 31px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.redeem-sheet .sms-submit {
  width: 100%;
  min-height: 31px;
  height: 31px;
  margin: 4px 0 0;
  border: 0;
  border-radius: 999px;
  color: #fff8f3;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 1.8px;
  background: linear-gradient(90deg, #f07b58, #e86b45);
  box-shadow: 0 10px 20px rgba(232, 107, 69, 0.24);
}

.redeem-sheet .sms-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(90deg, #f07b58, #e86b45);
}

.redeem-sheet .sms-submit:disabled {
  background: linear-gradient(90deg, #d0aaa0, #bd8e82);
}

.redeem-sheet .user-status {
  min-height: 18px;
  border: 0;
  background: transparent;
  color: #8b8b8f;
  padding: 0 6px;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 600;
}

.redeem-sheet .user-status.is-error {
  color: #b42318;
  background: transparent;
}

.redeem-sheet .login-switch {
  margin-top: 26px;
  padding-top: 0;
  border-top: 0;
  max-width: none;
}

.redeem-sheet .sms-qr-switch {
  display: none !important;
}

.redeem-sheet .login-switch .login-mode-btn {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  color: #6e3d16;
  background: #fff1d5;
  font-size: 13px;
  font-weight: 800;
}

.redeem-benefits {
  min-height: 0;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 2px;
  padding-bottom: 10px;
}

.redeem-benefits h2 {
  margin: 0;
  color: #151515;
  font-size: 16px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0;
  text-align: center;
}

.benefit-panel {
  height: 146px;
  flex: 0 0 auto;
  padding: 14px 12px 12px;
  border-radius: 9px;
  background:
    radial-gradient(circle at 16% 12%, rgba(240, 123, 88, 0.08), transparent 24%),
    radial-gradient(circle at 84% 82%, rgba(244, 196, 95, 0.1), transparent 26%),
    #f7f6f5;
  border: 1px solid rgba(235, 230, 224, 0.82);
}

.benefit-grid {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  align-items: center;
  column-gap: 8px;
  row-gap: 0;
}

.benefit {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.benefit svg {
  width: 23px;
  height: 23px;
  color: #f0a17e;
  stroke-width: 1.8;
}

.benefit span {
  max-width: 7em;
  color: #313133;
  font-size: 9px;
  line-height: 1.18;
  font-weight: 400;
}

.redeem-sheet #qrView,
.redeem-sheet .account-view,
.redeem-sheet .final-view {
  min-height: 0;
  overflow: auto;
}

.redeem-sheet #qrView {
  padding-top: 10px;
}

.redeem-sheet .qr-wrap {
  width: min(270px, 100%);
  border-radius: 14px;
}

.redeem-sheet .account-view,
.redeem-sheet .final-view {
  padding-top: 18px;
}

.redeem-sheet .user-info-card {
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(65, 44, 26, 0.1);
}

@media (max-height: 740px) {
  .kuwo-redeem-layout .redeem-phone {
    min-height: 0;
  }

  .redeem-hero {
    height: 145px;
    padding-top: calc(25px + env(safe-area-inset-top));
  }

  .redeem-phone::before {
    height: 145px;
  }

  .redeem-hero-copy {
    transform: translateY(-14px);
  }

  .redeem-hero h1 {
    font-size: 31px;
  }

  .redeem-hero h1 small {
    font-size: 13px;
  }

  .redeem-sheet {
    top: auto;
    margin-top: -27px;
    gap: 12px;
    padding: 13px 14px 12px;
  }

  .redeem-card {
    padding: 17px 11px 14px;
  }

  .redeem-head {
    margin-bottom: 10px;
  }

  .redeem-field,
  .redeem-code-field .sms-send-btn,
  .redeem-sheet .captcha-input,
  .redeem-sheet .captcha-img,
  .redeem-sheet .sms-submit {
    min-height: 30px;
    height: 30px;
  }

  .redeem-sheet .sms-form {
    gap: 9px;
  }

  .redeem-sheet input {
    font-size: 13px;
    line-height: 30px;
  }

  .redeem-benefits h2 {
    font-size: 15px;
  }

  .benefit-panel {
    height: 135px;
    padding: 11px;
  }

  .benefit svg {
    width: 21px;
    height: 21px;
  }

  .benefit span {
    font-size: 10px;
  }
}

@media (max-width: 350px) {
  .redeem-hero {
    padding-left: 22px;
  }

  .redeem-hero h1 {
    font-size: 34px;
  }

  .redeem-hero h1 small {
    font-size: 14px;
  }

  .redeem-sheet {
    padding-left: 14px;
    padding-right: 14px;
  }

  .redeem-code-field .sms-code-row,
  .redeem-sheet .captcha-input-row {
    grid-template-columns: minmax(0, 1fr) 73px;
  }

  .redeem-code-field .sms-send-btn,
  .redeem-sheet .captcha-img {
    width: 73px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }

  .loader {
    animation: spin 0.9s linear infinite !important;
  }
}
