@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;600&family=Noto+Sans+SC:wght@400;600&display=swap");

:root {
  --bg: #f4f1ea;
  --bg-2: #e8efe9;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --primary: #1f6f5c;
  --primary-dark: #155547;
  --accent: #f0a202;
  --danger: #c33d2b;
  --line: rgba(31, 41, 51, 0.12);
  --shadow: 0 18px 40px rgba(31, 41, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans SC", "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 100%);
  min-height: 100vh;
}

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(31, 111, 92, 0.15), transparent 45%),
    radial-gradient(circle at 78% 22%, rgba(240, 162, 2, 0.18), transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(31, 41, 51, 0.08), transparent 55%);
  z-index: 0;
}

.top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 5vw;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 600;
  letter-spacing: 0.4px;
}

nav {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

nav a,
nav button {
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
}

nav form {
  margin: 0;
}

.container {
  position: relative;
  z-index: 1;
  padding: 40px 5vw 60px;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 0 5vw 24px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer .sep {
  margin: 0 6px;
}

.card {
  background: var(--surface);
  border-radius: 18px;
  padding: 28px 30px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(31, 41, 51, 0.05);
  overflow-wrap: anywhere;
}

.card.narrow {
  max-width: 420px;
}

h1 {
  margin: 0 0 12px;
  font-size: 24px;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

p {
  margin: 0 0 16px;
}

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

.promo-red {
  margin: 0 0 12px;
  color: #cf2a2a !important;
  -webkit-text-fill-color: #cf2a2a !important;
  font-weight: 700;
  font-size: 18px;
  opacity: 1;
}

.form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  min-width: 0;
  width: 100%;
}

.form > * {
  min-width: 0;
}

label {
  font-size: 14px;
  color: var(--muted);
}

input,
select,
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

.form input,
.form select,
.form textarea,
.form button {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

textarea {
  resize: vertical;
}

select {
  -webkit-appearance: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #6b7280 50%),
    linear-gradient(135deg, #6b7280 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

button {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}

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

button.primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

button.primary:hover {
  background: var(--primary-dark);
}

a.primary-btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  text-decoration: none;
}

a.primary-btn:hover {
  background: var(--primary-dark);
}

button.danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

button.ghost,
nav .ghost {
  background: transparent;
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 10px;
}

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

.actions-inline form {
  margin: 0;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 18px;
}

.chip {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.chip.active {
  background: var(--accent);
  color: #1f2933;
  border-color: transparent;
}

.chip.disabled {
  color: #9aa6b2;
  pointer-events: none;
  background: #f3f6f8;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
}

.pagination-summary {
  color: var(--muted);
  font-size: 13px;
}

.pagination-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.page-ellipsis {
  color: var(--muted);
  font-size: 13px;
  padding: 0 2px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.status {
  font-weight: 600;
}

.status.ok {
  color: var(--primary);
}

.status.warn {
  color: var(--accent);
}

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

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

.alert {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(195, 61, 43, 0.12);
  color: var(--danger);
  margin-bottom: 12px;
  font-size: 14px;
}

.notice {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 14px;
}

.notice.ok {
  background: rgba(31, 111, 92, 0.14);
  color: var(--primary-dark);
}

.announcement-text {
  margin: 0 0 12px;
  color: #1f6f5c;
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.pay-box {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 12px;
}

.pay-box img {
  width: min(240px, 100%);
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
}

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

.panel {
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.success-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(31, 111, 92, 0.35);
  background: rgba(31, 111, 92, 0.12);
  color: var(--primary-dark);
}

.success-mark {
  color: #1f8f66;
  font-size: 18px;
  line-height: 1;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 8px 0 14px;
}

.result-item {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: rgba(31, 41, 51, 0.04);
}

.result-item.ok {
  border-color: rgba(31, 111, 92, 0.35);
  background: rgba(31, 111, 92, 0.12);
}

.result-item.fail {
  border-color: rgba(195, 61, 43, 0.35);
  background: rgba(195, 61, 43, 0.12);
}

.result-item.pending {
  border-color: rgba(240, 162, 2, 0.38);
  background: rgba(240, 162, 2, 0.15);
}

.result-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.result-item strong {
  font-size: 16px;
}

.detail {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(31, 41, 51, 0.06);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

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

.kv span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.kv strong {
  font-size: 14px;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}

.form.compact {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.search-form {
  margin-bottom: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.search-form .field {
  display: grid;
  gap: 6px;
}

.search-form .actions {
  margin-top: 0;
}

.search-form .field-actions {
  align-self: end;
}

.search-form .actions button,
.search-form .actions .chip {
  width: auto;
}

@media (max-width: 640px) {
  .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }

  nav a,
  nav button {
    font-size: 13px;
  }

  .container {
    padding: 28px 6vw 50px;
  }

  .site-footer {
    padding: 0 6vw 18px;
    font-size: 12px;
    line-height: 1.8;
  }

  .card {
    padding: 22px;
  }

  h1 {
    font-size: 22px;
  }

  input,
  select,
  button {
    font-size: 16px;
  }

  .form button {
    width: 100%;
  }

  .actions .chip {
    width: 100%;
    justify-content: center;
  }

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

  .search-form .actions button,
  .search-form .actions .chip {
    width: 100%;
    justify-content: center;
  }

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

  .pagination-links {
    justify-content: flex-start;
  }

  .promo-red {
    color: #cf2a2a !important;
    -webkit-text-fill-color: #cf2a2a !important;
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .table-cards thead {
    display: none;
  }

  .table-cards tbody tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 10px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.9);
  }

  .table-cards tbody td {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 10px;
    border-bottom: 0;
    padding: 8px 0;
  }

  .table-cards tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
  }

  .table-cards tbody td[colspan] {
    display: block;
  }

  .table-cards tbody td[colspan]::before {
    content: none;
  }
}
