:root {
  --blue: #244fc4;
  --blue-2: #1b66e5;
  --orange: #ff6a16;
  --orange-2: #ff8a12;
  --red: #f04438;
  --green: #21a665;
  --ink: #172033;
  --muted: #677489;
  --line: #d8e2f2;
  --bg: #eef3fb;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

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

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px clamp(14px, 3vw, 36px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.top-actions,
.row-actions,
.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-btn,
.ghost-btn,
.primary-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  background: #fff;
  color: var(--ink);
}

.nav-btn.active,
.primary-btn {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.ghost-btn.danger {
  color: var(--red);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.service-page {
  position: relative;
  max-width: 1480px;
  min-height: calc(100vh - 63px);
  margin: 0 auto;
  padding-bottom: 96px;
  background: #fff;
}

.blue-banner {
  height: 68px;
  background:
    linear-gradient(90deg, rgba(0, 67, 157, 0.95), rgba(0, 99, 210, 0.92)),
    repeating-linear-gradient(90deg, transparent 0 88px, rgba(255, 255, 255, 0.08) 89px 91px);
  box-shadow: 0 2px 10px rgba(30, 60, 120, 0.3);
}

.company-block,
.status-section,
.service-section,
.inline-pay-section,
.process-section,
.trust-section,
.faq-section {
  padding: 18px 14px;
  border-bottom: 16px solid #dbe5f4;
}

.company-block h1 {
  margin: 12px 0 8px;
  font-size: 22px;
  line-height: 1.3;
}

.company-block p {
  margin: 8px 0;
  color: #111827;
}

.alert-box {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px solid #ff9d9d;
  border-radius: 6px;
  background: #fff5f5;
}

.alert-box strong {
  color: #ff1f1f;
  font-size: 16px;
}

.alert-box span {
  font-weight: 700;
  font-size: 13px;
}

.alert-box small,
.notice-line,
.source-note,
.hint {
  color: var(--muted);
  line-height: 1.6;
}

.notice-line {
  margin-top: 10px;
  font-size: 13px;
}

.status-section h2,
.service-section h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 20px;
}

.section-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #fff;
  background: linear-gradient(180deg, #6286e8, #244fc4);
  font-size: 15px;
}

.status-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: center;
  min-height: 44px;
  text-align: center;
}

.table-head {
  color: #112f65;
  background: #dce4f8;
  font-weight: 700;
}

.table-row {
  border-top: 1px solid #e7edf6;
  font-size: 13px;
}

.text-danger {
  color: var(--red);
}

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

.orange-pill {
  justify-self: center;
  padding: 4px 8px;
  border-radius: 4px;
  color: #fff;
  background: #ff7a00;
  font-size: 12px;
}

.link-btn {
  width: 100%;
  border: 0;
  padding: 10px;
  color: #5d6676;
  background: #fff;
}

.service-options {
  display: grid;
  gap: 10px;
}

.service-card {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 10px;
  align-items: start;
  min-height: 86px;
  padding: 16px 14px;
  border: 1px solid #a9c5f5;
  border-radius: 7px;
  background: #f7fbff;
}

.service-card.selected {
  border: 2px solid var(--blue);
  background: #eef3ff;
}

.service-card strong,
.service-card span,
.service-card em {
  display: block;
}

.service-card em {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 3px;
  color: #fff;
  background: #5fbd68;
  font-size: 12px;
  font-style: normal;
}

.service-card span {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.service-card b {
  align-self: center;
  color: #ff5300;
}

.inline-pay-section {
  display: grid;
  justify-items: center;
  gap: 10px;
  border-bottom-width: 0;
}

.inline-pay-section button {
  width: min(320px, 88vw);
  height: 48px;
  border: 0;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(90deg, var(--orange-2), #ff471a);
  font-size: 20px;
  font-weight: 800;
}

.agreement-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #43536b;
  font-size: 12px;
}

.agreement-line input {
  width: 14px;
  min-height: 14px;
}

.process-section,
.trust-section,
.faq-section {
  display: grid;
  justify-items: center;
  background: #fff;
}

.center-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 16px;
  color: #2b3548;
  font-size: 20px;
}

.center-title span {
  width: 30px;
  height: 18px;
  background:
    linear-gradient(135deg, transparent 35%, #738bcb 36% 50%, transparent 51%),
    linear-gradient(45deg, transparent 35%, #738bcb 36% 50%, transparent 51%);
}

.center-title span:last-child {
  transform: rotate(180deg);
}

.flow-card,
.trust-section,
.faq-section {
  width: min(350px, calc(100vw - 28px));
}

.flow-card {
  padding: 14px 10px;
  border: 1px solid #cfdaf1;
  border-radius: 6px;
  color: #173a7a;
  background: #fff;
}

.flow-slogan,
.flow-path {
  margin: 0;
  text-align: center;
  font-weight: 700;
}

.flow-slogan {
  color: #244fc4;
  font-size: 13px;
}

.flow-path {
  margin-top: 12px;
  color: #0e2859;
  font-size: 14px;
}

.flow-services {
  margin-top: 14px;
  padding: 5px 10px;
  border-radius: 6px;
  background: #eaf1fb;
}

.flow-services div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed #c5d3eb;
}

.flow-services div:last-child {
  border-bottom: 0;
}

.flow-services strong {
  color: #16346e;
}

.flow-services strong::before {
  content: "✓ ";
}

.flow-services span {
  color: #65738a;
  font-size: 12px;
}

.trust-section,
.faq-section {
  margin: 14px auto 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #cfdaf1;
  border-radius: 7px;
  background: #fff;
}

.trust-section h2,
.faq-section h2 {
  width: 100%;
  margin: 0;
  padding: 12px;
  text-align: center;
  color: #172033;
  background: #e7eefc;
  font-size: 17px;
}

.trust-body {
  width: 100%;
  padding: 14px;
}

.trust-body p {
  margin: 0 0 8px;
  color: #3f4c62;
  font-size: 12px;
}

.trust-body p::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #87a6ea;
}

.trust-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.trust-cards div {
  min-height: 90px;
  padding: 12px 8px;
  border: 1px solid #d6e0f3;
  border-radius: 6px;
  text-align: center;
}

.trust-cards b,
.trust-cards span {
  display: block;
}

.trust-cards b {
  color: #244fc4;
  font-size: 12px;
}

.trust-cards span {
  margin-top: 6px;
  color: #536176;
  font-size: 11px;
}

.trust-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding: 10px 18px;
  background: linear-gradient(180deg, #f6f9ff, #edf4ff);
}

.trust-stats div {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.trust-stats strong {
  color: #244fc4;
  font-size: 18px;
}

.trust-stats span {
  color: #536176;
  font-size: 12px;
}

.faq-list {
  width: 100%;
  padding: 0 22px 2px;
}

.faq-list article {
  padding: 16px 0;
  border-bottom: 1px solid #bfcbe0;
}

.faq-list article:last-child {
  border-bottom: 0;
}

.faq-list h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 14px;
}

.faq-list h3 b {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #244fc4;
  background: #b9d7ff;
  font-size: 12px;
}

.faq-list p {
  margin: 0;
  color: #536176;
  font-size: 13px;
  line-height: 1.7;
}

.bottom-paybar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 15;
  transform: translateX(-50%);
  width: min(100%, 1480px);
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
}

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

.bottom-paybar strong {
  color: #ff5300;
  font-size: 22px;
}

.bottom-paybar button {
  height: 56px;
  border: 0;
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(90deg, var(--orange-2), #ff471a);
  font-size: 22px;
  font-weight: 800;
}

.floating-service {
  position: fixed;
  right: 10px;
  top: 42%;
  z-index: 14;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 52px;
  padding: 8px 6px;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(29, 68, 151, 0.28);
  font-size: 12px;
}

.admin-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 14px 48px;
}

.login-box,
.admin-card,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.login-box {
  max-width: 420px;
  margin: 44px auto;
  padding: 22px;
}

.login-box h1,
.admin-head h1,
.admin-card h2 {
  margin: 0 0 8px;
}

.login-box p,
.admin-head p {
  margin: 0 0 18px;
  color: var(--muted);
}

.admin-panel {
  padding: 18px;
}

.admin-head,
.list-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.list-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

.list-tools input {
  max-width: 420px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.admin-card {
  margin-bottom: 14px;
  padding: 16px;
}

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

.form-grid.compact {
  margin-bottom: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #344155;
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

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

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

th,
td {
  padding: 10px;
  border-bottom: 1px solid #e6edf7;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}

th {
  color: #475569;
  background: #f6f8fc;
}

.mini-input {
  min-width: 310px;
  font-size: 12px;
}

.save-msg,
.form-msg {
  display: block;
  margin-top: 8px;
  color: var(--green);
}

.form-msg {
  color: var(--red);
}

.hidden {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 30;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(16, 24, 40, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.toast.show {
  opacity: 1;
}

.chat-page {
  min-height: calc(100vh - 63px);
  display: grid;
  grid-template-rows: 44px 1fr auto auto;
  background: #dfe8f6;
}

.submit-page {
  min-height: calc(100vh - 63px);
  background: #f2f6fc;
}

.submit-head {
  position: sticky;
  top: 63px;
  z-index: 12;
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.submit-head button {
  border: 0;
  color: #2f72ff;
  background: transparent;
  text-align: left;
}

.submit-head strong {
  text-align: center;
}

.submit-head a,
.submit-actions a {
  border-radius: 8px;
  padding: 9px 12px;
  color: #fff;
  background: #14a76c;
  text-decoration: none;
  font-size: 13px;
  text-align: center;
}

.submit-company-card,
.submit-form {
  width: min(720px, calc(100vw - 28px));
  margin: 14px auto 0;
}

.submit-company-card,
.submit-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.submit-company-card span {
  color: var(--muted);
  font-size: 13px;
}

.submit-company-card h1 {
  margin: 8px 0 12px;
  font-size: 22px;
  line-height: 1.35;
}

.submit-company-card p {
  margin: 7px 0;
  color: #455166;
}

.submit-form {
  display: grid;
  gap: 12px;
  padding-bottom: 36px;
}

.submit-card h2 {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 18px;
}

.submit-card input[type="file"] {
  padding: 9px;
  background: #f8fbff;
}

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

.submit-actions {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 10px;
}

.submit-actions button,
.submit-actions a {
  min-height: 46px;
}

.chat-head {
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: #f8fafc;
}

.chat-head button {
  border: 0;
  color: #2468ff;
  background: transparent;
  font-weight: 700;
}

.chat-body {
  padding: 18px 12px;
}

.agent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 13px;
}

.agent-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #3176ec;
}

.chat-bubble {
  width: min(306px, calc(100vw - 72px));
  margin: -14px 0 18px 40px;
  padding: 14px 12px;
  border-radius: 7px;
  background: #fff;
}

.chat-bubble strong,
.chat-bubble p {
  display: block;
  margin: 0;
}

.chat-bubble strong {
  margin-bottom: 8px;
}

.quick-question {
  display: block;
  width: min(348px, calc(100vw - 24px));
  margin: 8px 0;
  padding: 12px;
  border: 0;
  border-radius: 7px;
  color: #2f72ff;
  background: #fff;
  font-size: 13px;
  text-align: left;
}

.quick-question::before {
  content: "· ";
}

.chat-messages {
  width: min(560px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.message-row {
  display: flex;
}

.message-row div {
  max-width: min(430px, 78vw);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
}

.message-row.user {
  align-items: flex-start;
  gap: 7px;
  justify-content: flex-end;
}

.message-row.user div {
  color: #fff;
  background: #2f74ef;
}

.message-row.agent {
  justify-content: flex-start;
}

.message-row.agent div {
  color: #172033;
  background: #fff;
}

.message-row.pay-card-row div {
  max-width: min(348px, calc(100vw - 24px));
}

.chat-pay-card {
  width: min(348px, calc(100vw - 24px));
  padding: 14px;
  border-radius: 7px;
  background: #fff;
}

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

.pay-card-head strong {
  font-size: 16px;
}

.pay-card-head em {
  color: #ff5300;
  font-style: normal;
  font-size: 13px;
}

.pay-card-head button {
  border: 0;
  border-radius: 7px;
  padding: 9px 13px;
  color: #fff;
  background: #ff7a16;
  font-weight: 700;
}

.chat-pay-card p {
  margin: 12px 0;
  color: #6b7280;
  font-size: 12px;
}

.pay-divider {
  height: 1px;
  background: #cdd7ea;
}

.wechat-line {
  margin-top: 10px;
  color: #172033;
}

.wechat-line span,
.wechat-line b,
.chat-agree span {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: #fff;
  background: #1bb21f;
  font-size: 11px;
}

.wechat-line b {
  margin-left: 4px;
  font-weight: 400;
}

.chat-agree {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  color: #526176;
  font-size: 12px;
}

.message-row.typing div {
  color: #2f72ff;
}

.user-name {
  color: #344155;
  font-size: 13px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 36%, #fff 0 5px, transparent 6px),
    radial-gradient(circle at 50% 88%, #fff 0 11px, transparent 12px),
    #8aa0c4;
}

.chat-actions {
  display: flex;
  gap: 10px;
  padding: 10px 18px 8px;
}

.chat-actions button {
  border: 0;
  border-radius: 6px;
  padding: 10px 20px;
  color: #fff;
  font-weight: 700;
}

.blue-action {
  background: #2f74ef;
}

.red-action {
  background: #ff7875;
}

.chat-inputbar {
  display: grid;
  grid-template-columns: minmax(0, 348px) 48px;
  gap: 0;
  padding: 16px;
  background: #fff;
}

.chat-inputbar input {
  border: 1px solid #3b78ff;
  border-right: 0;
  border-radius: 8px 0 0 8px;
  padding: 0 12px;
}

.chat-inputbar button {
  border: 1px solid #3b78ff;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  color: #2f72ff;
  background: #fff;
  font-size: 20px;
}

@media (max-width: 780px) {
  .topbar,
  .admin-head,
  .list-head {
    flex-direction: column;
    align-items: stretch;
  }

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

  .process-strip {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .process-strip i {
    width: 2px;
    height: 16px;
    justify-self: center;
  }

  .bottom-paybar {
    grid-template-columns: 100px 1fr;
  }

  .bottom-paybar button {
    height: 52px;
    font-size: 17px;
  }

  .company-block h1 {
    font-size: 19px;
  }
}
