/* =========================================================
   Spay · 支付页 & 管理后台 公共样式
   ========================================================= */

:root {
  --bg: #f2f5f1;
  --bg-soft: #e9efe9;
  --card: #ffffff;
  --ink: #0f1a14;
  --ink-soft: #33463c;
  --muted: #6d7f75;
  --line: #e3eae5;
  --green: #07c160;
  --green-dark: #05a650;
  --green-soft: #e7f9ee;
  --green-ring: rgba(7, 193, 96, 0.18);
  --blue: #3a6df0;
  --blue-soft: #eef3ff;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --amber: #b7791f;
  --amber-soft: #fdf5e6;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --shadow-card: 0 18px 50px rgba(15, 26, 20, 0.08), 0 2px 8px rgba(15, 26, 20, 0.04);
  --shadow-pop: 0 24px 70px rgba(15, 26, 20, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

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

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

[hidden] {
  display: none !important;
}

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

.small {
  font-size: 12px;
}

.strong {
  font-weight: 700;
}

:focus-visible {
  outline: 3px solid var(--green-ring);
  outline-offset: 2px;
}

/* ---------- 通用按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 18px;
  height: 46px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease,
    border-color 0.15s ease, opacity 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-primary {
  background: linear-gradient(180deg, #12d66f 0%, var(--green) 60%, #06b658 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px var(--green-ring);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 14px 30px rgba(7, 193, 96, 0.28);
}

.btn-ghost {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink-soft);
}

.btn-ghost:hover:not(:disabled) {
  border-color: #cbd8cf;
  background: #f7faf8;
}

.btn-danger {
  background: #ffffff;
  border-color: #f3c6c7;
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-soft);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  padding: 4px 2px;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-sm {
  height: 36px;
  font-size: 13px;
  padding: 0 14px;
  border-radius: 10px;
}

.btn-block {
  width: 100%;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ---------- 表单 ---------- */

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.field-label .optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  margin-left: 4px;
}

.text-input,
.select-input,
.textarea-input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfdfb;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.text-input::placeholder,
.textarea-input::placeholder {
  color: #a8b5ad;
}

.text-input:focus,
.select-input:focus,
.textarea-input:focus {
  outline: none;
  border-color: var(--green);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--green-ring);
}

.textarea-input {
  min-height: 120px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

.select-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236d7f75' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

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

.field {
  margin-bottom: 18px;
}

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

.form-grid .field-full {
  grid-column: 1 / -1;
}

/* ---------- 提示条 / 通知 ---------- */

.alert {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.55;
  background: var(--danger-soft);
  color: #a3272b;
  border: 1px solid #f6d3d4;
}

.alert.is-success {
  background: var(--green-soft);
  color: #056b36;
  border-color: #c8efd7;
}

.alert.is-warning {
  background: var(--amber-soft);
  color: #8a5a12;
  border-color: #f2e2bd;
}

.alert.is-info {
  background: var(--blue-soft);
  color: #274ea8;
  border-color: #d7e2fb;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(15, 26, 20, 0.92);
  color: #ffffff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  max-width: calc(100vw - 40px);
  text-align: center;
}

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

/* =========================================================
   支付页
   ========================================================= */

.pay-page {
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 50% -18%, #d6f5e2 0%, rgba(214, 245, 226, 0) 62%),
    radial-gradient(900px 520px at 115% 112%, #e3ecff 0%, rgba(227, 236, 255, 0) 58%),
    var(--bg);
  display: flex;
  justify-content: center;
  padding: 34px 18px 56px;
  position: relative;
  overflow-x: hidden;
}

.pay-shell {
  width: 100%;
  max-width: 432px;
  position: relative;
  z-index: 1;
}

.pay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 0 4px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f1a14 0%, #2f5140 100%);
  color: #8af0b7;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  box-shadow: 0 8px 18px rgba(15, 26, 20, 0.18);
  flex: none;
}

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

.brand-text h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
}

.brand-text p {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.mode-badge {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  border: 1px solid #c8efd7;
}

.mode-badge[data-mode="real"] {
  background: var(--blue-soft);
  color: #2b55b4;
  border-color: #d7e2fb;
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(227, 234, 229, 0.8);
  padding: 24px;
}

.pay-card {
  padding: 26px 24px 22px;
}

.card-heading h2 {
  font-size: 17px;
  font-weight: 700;
}

.card-heading p {
  margin-top: 4px;
  font-size: 13px;
}

.amount-field {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 22px 0 8px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--green);
}

.amount-currency {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
}

.amount-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1px;
  padding: 0;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.amount-input::placeholder {
  color: #d2dbd5;
  font-weight: 700;
}

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

.quick-chip {
  border: 1px solid var(--line);
  background: #fbfdfb;
  border-radius: 12px;
  height: 42px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.14s ease;
}

.quick-chip:hover {
  border-color: var(--green);
  color: var(--green-dark);
  background: var(--green-soft);
}

.quick-chip.is-active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
}

.pay-card .field-label {
  margin-top: 4px;
}

.pay-card .text-input {
  margin-bottom: 22px;
}

.pay-card .btn-primary {
  width: 100%;
  height: 54px;
  font-size: 17px;
  border-radius: 15px;
}

.pay-footnote {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.pay-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  color: #93a29a;
  font-size: 12px;
}

.pay-footer .dot {
  opacity: 0.6;
}

/* 状态卡片 */

.status-card,
.success-card {
  margin-top: 18px;
  text-align: center;
  padding: 30px 24px;
  animation: rise 0.28s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.status-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: var(--amber-soft);
}

.status-card h2 {
  font-size: 18px;
  font-weight: 700;
}

.status-card > .muted {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.6;
}

.kv {
  margin: 20px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  padding: 12px 0;
  text-align: left;
}

.kv > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
}

.kv dt {
  font-size: 13px;
  color: var(--muted);
  flex: none;
}

.kv dd {
  font-size: 13.5px;
  font-weight: 600;
  text-align: right;
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}

.kv dd.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}

.action-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.action-row .btn {
  width: 100%;
}

.spinner-large {
  width: 46px;
  height: 46px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid var(--green-soft);
  border-top-color: var(--green);
  animation: spin 0.9s linear infinite;
}

.status-card .btn-ghost,
.status-card .btn-link {
  margin-top: 14px;
}

.status-card .btn-link {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.success-card {
  padding: 34px 24px 28px;
}

.success-check {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(160deg, #17d978, var(--green));
  color: #ffffff;
  font-size: 38px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px rgba(7, 193, 96, 0.35);
  animation: pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.success-card h2 {
  font-size: 19px;
  font-weight: 700;
}

.success-amount {
  margin-top: 10px;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.success-card .kv {
  margin-top: 24px;
}

.success-card .btn {
  width: 100%;
  height: 50px;
  margin-top: 16px;
}

.success-card .muted.small {
  margin-top: 14px;
}

/* =========================================================
   管理后台
   ========================================================= */

.admin-page {
  background: #f3f5f4;
  min-height: 100vh;
}

/* 登录 */

.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 460px at 50% -20%, #d6f5e2 0%, rgba(214, 245, 226, 0) 62%),
    radial-gradient(800px 460px at 110% 110%, #e3ecff 0%, rgba(227, 236, 255, 0) 60%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 390px;
  padding: 30px 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.login-brand h1 {
  font-size: 20px;
  font-weight: 800;
}

.login-brand p {
  font-size: 13px;
  margin-top: 3px;
}

.login-card .btn {
  width: 100%;
  margin-top: 20px;
  height: 48px;
}

.login-card .muted.small {
  margin-top: 18px;
  line-height: 1.6;
  text-align: center;
}

.login-alert {
  margin-top: 14px;
}

/* 主框架 */

.admin-app {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #0f1a14;
  color: #d8e6dd;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.sidebar-brand .brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 19px;
}

.sidebar-brand div {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.sidebar-brand strong {
  font-size: 16px;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.sidebar-brand span {
  font-size: 11.5px;
  color: #8fa397;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: 11px;
  border: none;
  background: transparent;
  color: #c3d4c9;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-item.is-active {
  background: rgba(7, 193, 96, 0.16);
  color: #7cf0ad;
  font-weight: 600;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
}

.sidebar-foot .nav-item {
  font-size: 13px;
  color: #9db2a5;
  padding: 9px 14px;
}

.version {
  padding: 8px 14px 0;
  font-size: 11px;
  color: #586b60;
}

.admin-main {
  padding: 30px 34px 60px;
  min-width: 0;
  max-width: 1180px;
}

.default-password-banner {
  background: var(--amber-soft);
  border: 1px solid #f2e2bd;
  color: #8a5a12;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  margin-bottom: 22px;
}

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

.page-head h1 {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.page-head p {
  margin-top: 5px;
  font-size: 13px;
}

/* 概览 */

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

.stat-card {
  background: #ffffff;
  border: 1px solid rgba(227, 234, 229, 0.9);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: 0 8px 24px rgba(15, 26, 20, 0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 12.5px;
  color: var(--muted);
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
}

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

.panel {
  padding: 22px 24px;
  margin-bottom: 22px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 16px;
  font-weight: 700;
}

.mode-summary {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.mode-summary strong {
  color: var(--ink);
}

/* 表格 */

.table-wrap {
  overflow-x: auto;
  margin: 0 -6px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 640px;
}

.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid #eef2ef;
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #fafcfb;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .mono {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
}

.data-table .num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.table-empty {
  text-align: center;
  color: var(--muted);
  padding: 34px 12px !important;
  font-size: 13.5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.badge-paid {
  background: var(--green-soft);
  color: var(--green-dark);
}

.badge-pending {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-closed {
  background: #f0f2f1;
  color: #7c8a82;
}

.badge-failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.row-actions .btn-link {
  font-size: 13px;
}

/* 筛选栏 & 分页 */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-bar .select-input {
  width: 130px;
}

.filter-bar .search-input {
  flex: 1;
  min-width: 160px;
  max-width: 320px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-controls .btn {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

/* 配置表单 */

.config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.config-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-card {
  padding: 22px 24px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 16px;
  font-weight: 700;
}

.section-head p {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.status-pill {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.status-pill.is-ok {
  background: var(--green-soft);
  color: var(--green-dark);
}

.status-pill.is-warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill.is-off {
  background: #f0f2f1;
  color: #7c8a82;
}

.mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.mode-option {
  position: relative;
  display: flex;
  gap: 11px;
  padding: 15px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
  background: #fbfdfb;
}

.mode-option:hover {
  border-color: #c4d3c8;
}

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

.mode-option .mode-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #c4d3c8;
  flex: none;
  margin-top: 2px;
  position: relative;
  transition: border-color 0.14s ease;
}

.mode-option strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.mode-option span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.mode-option.is-selected {
  border-color: var(--green);
  background: var(--green-soft);
}

.mode-option.is-selected .mode-radio {
  border-color: var(--green);
}

.mode-option.is-selected .mode-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--green);
}

.secret-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-dark);
  background: var(--green-soft);
  border-radius: 999px;
  padding: 2px 9px;
  margin-left: 8px;
  vertical-align: 1px;
}

.secret-state.is-empty {
  color: var(--amber);
  background: var(--amber-soft);
}

.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.config-side {
  position: sticky;
  top: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-card {
  padding: 20px 22px;
}

.side-card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13px;
  line-height: 1.5;
}

.check-list li {
  display: flex;
  gap: 8px;
  color: var(--ink-soft);
}

.check-list li::before {
  content: "•";
  color: var(--muted);
  flex: none;
}

.check-list li.is-done {
  color: var(--green-dark);
}

.check-list li.is-done::before {
  content: "✓";
  color: var(--green);
  font-weight: 700;
}

.check-list li.is-missing {
  color: var(--amber);
}

.check-list li.is-missing::before {
  content: "!";
  color: var(--amber);
  font-weight: 700;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.form-actions .btn {
  min-width: 132px;
}

.form-actions .save-state {
  font-size: 13px;
  color: var(--muted);
}

.form-actions .save-state.is-error {
  color: var(--danger);
}

.form-actions .save-state.is-ok {
  color: var(--green-dark);
}

/* 账户安全 */

.security-layout {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.security-tips {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

.security-tips strong {
  color: var(--ink-soft);
}

/* 弹窗 */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 26, 20, 0.45);
  backdrop-filter: blur(2px);
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: min(86vh, 720px);
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 24px 26px;
  animation: rise 0.2s ease both;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.modal-head h2 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  border: none;
  background: #f1f5f2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--ink-soft);
  flex: none;
}

.modal-close:hover {
  background: #e6ece8;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* 响应式 */

@media (max-width: 1080px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .config-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .config-side {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .config-side .side-card {
    flex: 1;
    min-width: 240px;
  }
}

@media (max-width: 860px) {
  .admin-app {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    overflow-x: auto;
  }

  .sidebar-brand div {
    display: none;
  }

  .sidebar-brand .brand-logo {
    width: 34px;
    height: 34px;
  }

  .nav {
    flex-direction: row;
    gap: 4px;
    flex: none;
  }

  .nav-item {
    padding: 8px 13px;
    font-size: 13px;
    white-space: nowrap;
  }

  .sidebar-foot {
    border-top: none;
    padding-top: 0;
    flex-direction: row;
    margin-left: auto;
    gap: 2px;
  }

  .sidebar-foot .nav-item {
    padding: 8px 12px;
  }

  .version {
    display: none;
  }

  .admin-main {
    padding: 22px 18px 48px;
  }

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

@media (max-width: 560px) {
  .pay-page {
    padding: 22px 14px 40px;
  }

  .card {
    padding: 20px 18px;
  }

  .amount-input {
    font-size: 38px;
  }

  .brand-text h1 {
    max-width: 150px;
  }

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

  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .mode-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    flex-wrap: wrap;
  }

  .sidebar-foot {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }

  .action-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .modal-card {
    padding: 20px 18px;
  }
}

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