:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #64748b;
  --line: #d8e0ea;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --danger: #b42318;
  --success: #157f3b;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.customer-service-float {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  bottom: 24px;
  box-shadow: var(--shadow);
  color: #ffffff;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  height: 56px;
  justify-content: center;
  position: fixed;
  right: 24px;
  text-decoration: none;
  width: 56px;
  z-index: 900;
}

.customer-service-float:hover {
  background: var(--accent-strong);
}

.toast-container {
  display: grid;
  gap: 12px;
  left: 50%;
  max-width: min(560px, calc(100% - 24px));
  position: fixed;
  top: 16px;
  transform: translateX(-50%);
  width: 100%;
  z-index: 1000;
}

.toast {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 14px 16px;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.success {
  border-color: rgba(21, 127, 59, 0.3);
  background: #effaf3;
  color: var(--success);
}

.toast.error {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff3f1;
  color: var(--danger);
}

.toast.is-hiding {
  opacity: 0;
  transform: translateY(-8px);
}

.toast-text {
  flex: 1;
  line-height: 1.5;
  word-break: break-word;
}

.toast-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toast-action-link {
  min-height: 34px;
  padding: 0 14px;
}

.toast-close {
  background: transparent;
  color: inherit;
  min-height: auto;
  padding: 0;
}

.toast-close:hover {
  background: transparent;
  opacity: 0.72;
}

main {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

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

.brand {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

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

.nav-link {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.success-panel {
  border-color: rgba(21, 127, 59, 0.3);
  background: #effaf3;
  color: var(--success);
  margin-top: 22px;
}

.panel-note {
  line-height: 1.7;
  margin: 12px 0 0;
}

.grid {
  display: grid;
  gap: 18px;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  padding: 12px 14px;
  outline: none;
}

textarea {
  min-height: 220px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  padding: 0 18px;
}

.button-link {
  align-items: center;
  background: var(--accent);
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  font-weight: 700;
  min-height: 44px;
  padding: 0 18px;
  text-decoration: none;
}

.button-link:hover {
  background: var(--accent-strong);
}

.success-panel .button-link {
  background: var(--success);
}

.success-panel .button-link:hover {
  background: #11612d;
}

button:hover {
  background: var(--accent-strong);
}

button.secondary {
  background: #e6f3f1;
  color: var(--accent-strong);
}

button.secondary:hover {
  background: #d3ebe7;
}

button.danger {
  background: #b42318;
}

button.danger:hover {
  background: #8f1d14;
}

button.small {
  min-height: 34px;
  padding: 0 12px;
}

.mono {
  font-family: Consolas, "Courier New", monospace;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.message {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 20px;
  padding: 16px;
  word-break: break-word;
}

.message.success {
  border-color: rgba(21, 127, 59, 0.3);
  background: #effaf3;
  color: var(--success);
}

.message.error {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff3f1;
  color: var(--danger);
}

.tips-list {
  color: var(--text);
  line-height: 1.8;
  margin: 16px 0 0;
  padding-left: 22px;
}

.tips-list li + li {
  margin-top: 8px;
}

.card-code {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
}

#allocated-link-panel {
  margin-top: 18px;
}

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

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

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

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

.table {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 18px;
  overflow: hidden;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 180px;
  gap: 12px;
  padding: 12px 14px;
}

.claims-table .table-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 180px;
}

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

.table-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.table-row > span a {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.table-head {
  background: #f1f5f9;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pager {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 16px;
}

.pager span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

@media (max-width: 720px) {
  main {
    width: min(100% - 24px, 920px);
    padding: 28px 0;
  }

  .topbar,
  .grid.two,
  .stats,
  .table-row {
    grid-template-columns: 1fr;
  }

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