:root {
  --bg: #f3f7fb;
  --card: #ffffff;
  --line: #e8eef5;
  --text: #1f2937;
  --muted: #7b8aa0;
  --brand-a: #4580e7;
  --brand-b: #18c48f;
  --danger: #e64963;
  --danger-bg: #fff1f3;
  --soft-blue: #eef6ff;
  --shadow: 0 16px 40px rgba(18, 48, 86, 0.12);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  height: 100%;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

button {
  transition: transform .15s ease, opacity .15s ease, box-shadow .2s ease;
}

button:hover {
  transform: translateY(-1px);
}

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

.layout {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: 260px;
  flex: 0 0 260px;
  background: linear-gradient(180deg, #2d5ca4 0%, #169f85 100%);
  color: #fff;
  padding: 28px 20px;
  box-shadow: 10px 0 28px rgba(15, 51, 92, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 10;
}

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

.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  font-size: 22px;
  font-weight: 700;
}

.logo {
  font-size: 22px;
  font-weight: 700;
}

.logo-sub,
.sidebar-note {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.74);
}

.menu-title {
  margin: 34px 0 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-item {
  border: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
}

.menu-item.active,
.menu-item:hover {
  background: #fff;
  color: #169f85;
  font-weight: 700;
}

.menu-item.active .menu-dot,
.menu-item:hover .menu-dot {
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b));
}

.main {
  flex: 1;
  padding: 28px;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

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

.topbar h1 {
  margin: 0 0 8px;
  font-size: 32px;
}

.sub {
  margin: 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(18, 48, 86, 0.06);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b));
}

.user-name {
  font-weight: 700;
}

.user-role {
  font-size: 12px;
  color: var(--muted);
}

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

.summary-card {
  background: var(--card);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.summary-card.wide {
  grid-column: span 1;
}

.summary-label {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}

.summary-value {
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
}

.summary-inline {
  font-size: 26px;
  font-weight: 800;
  word-break: break-all;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.card {
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 24px;
}

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

.card-head h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

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

.table-wrap {
  overflow: auto;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

thead th {
  background: #f8fbff;
  color: #66758a;
  font-weight: 700;
  font-size: 14px;
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td {
  padding: 15px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:hover {
  background: #fbfdff;
}

.thumb {
  width: 140px;
  height: 76px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(31, 45, 61, 0.12);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
}

.tag.on {
  color: #09916c;
  background: rgba(27, 180, 142, 0.12);
}

.tag.off {
  color: #b66c26;
  background: rgba(235, 161, 67, 0.12);
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.action-btn,
.danger-btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 18px;
  cursor: pointer;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(90deg, var(--brand-a) 0%, var(--brand-b) 100%);
  box-shadow: 0 10px 24px rgba(44, 161, 165, 0.24);
}

.secondary-btn,
.action-btn {
  background: var(--soft-blue);
  color: #2e5aa0;
}

.ghost-btn {
  background: #f1f5f9;
  color: #526172;
}

.danger-btn {
  background: var(--danger-bg);
  color: var(--danger);
}

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

.form-grid.single-gap {
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.field span {
  font-size: 14px;
  color: #5f6d82;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #dbe7f3;
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  background: #fbfdff;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #3ba9d6;
  box-shadow: 0 0 0 4px rgba(75, 154, 214, 0.12);
}

.config-card {
  max-width: 1040px;
}

.config-hint {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(67, 135, 230, 0.08);
  color: #4f5f73;
  line-height: 1.7;
  font-size: 14px;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 30;
}

.modal-mask.hidden {
  display: none;
}

.modal {
  width: min(660px, 100%);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.modal.large {
  width: min(820px, 100%);
}

.modal-head,
.modal-foot {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head {
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  font-size: 20px;
}

.modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-foot {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
  gap: 10px;
}

.icon-btn {
  border: 0;
  background: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #94a3b8;
}

.upload-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.preview-box {
  border: 1px dashed #d7e2ee;
  border-radius: 20px;
  padding: 14px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fbfdff;
  position: relative;
}

.preview-box img {
  max-width: 100%;
  max-height: 260px;
  border-radius: 16px;
  display: none;
}

.preview-empty {
  color: #9aa7b7;
}

.notice-content {
  color: #526172;
  max-width: 360px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 6px;
}

.empty-row td {
  text-align: center;
  color: #94a3b8;
  padding: 40px 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(18, 29, 45, 0.92);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all .24s ease;
  z-index: 50;
}

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

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e9f2ff 0%, #f5fffb 100%);
  padding: 24px;
  gap: 18px;
}


.login-shell {
  width: min(1080px, 100%);
  min-height: 640px;
  background: #fff;
  border-radius: 36px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(23, 54, 88, 0.16);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}

.login-side {
  padding: 56px 48px;
  background: linear-gradient(160deg, #2f64be 0%, #19b189 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  font-size: 34px;
  font-weight: 800;
}

.login-brand h1 {
  margin: 0 0 8px;
  font-size: 34px;
}

.login-brand p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

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

.login-point {
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(6px);
}

.login-point strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.login-point span {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
}

.login-card {
  padding: 60px 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}

.login-card-sub {
  color: var(--muted);
  margin-bottom: 28px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-btn {
  margin-top: 8px;
  width: 100%;
  height: 52px;
  border-radius: 16px;
}

.login-footer {
  font-size: 14px;
  color: #6b7280;
  text-align: center;
}


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

@media (max-width: 980px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    gap: 20px;
  }

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

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

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

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-side,
  .login-card {
    padding: 36px 24px;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 18px;
  }

  .card,
  .summary-card {
    padding: 18px;
    border-radius: 18px;
  }

  .modal-head,
  .modal-foot,
  .modal-body {
    padding: 16px;
  }

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

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

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

.filter-grid,
.time-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

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

.toolbar-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

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

.stat-card {
  border-radius: 20px;
  padding: 18px 20px;
  color: #203046;
}

.stat-card.success {
  background: rgba(27, 180, 142, 0.12);
}

.stat-card.unpaid {
  background: rgba(67, 135, 230, 0.12);
}

.stat-card.failed {
  background: rgba(230, 73, 99, 0.12);
}

.stat-title {
  font-size: 14px;
  color: #5f6d82;
  margin-bottom: 10px;
}

.stat-amount {
  font-size: 28px;
  font-weight: 800;
}

.vertical-action {
  flex-direction: column;
}

.mono {
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
}

.order-company {
  font-weight: 700;
  margin-bottom: 6px;
}

.order-meta {
  color: #6f7f92;
  font-size: 13px;
  line-height: 1.7;
}

.money-text {
  color: #d9465a;
  font-weight: 800;
}

.tag.pending {
  color: #2e5aa0;
  background: rgba(67, 135, 230, 0.12);
}

.tag.danger {
  color: var(--danger);
  background: var(--danger-bg);
}

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

@media (max-width: 980px) {
  .summary-grid-4,
  .filter-grid,
  .time-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }
}


#cfgWxPayPrivateKey,
#cfgWxPayPlatformKey {
  min-height: 180px;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}


.primary-btn.small {
  padding: 10px 18px;
  border-radius: 14px;
  min-width: auto;
}

@media (max-width: 1280px) {
  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

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

.tag.info {
  color: #0b63ce;
  background: rgba(59, 130, 246, 0.12);
}

.tag.warning {
  color: #a16207;
  background: rgba(245, 158, 11, 0.16);
}


.receipt-link {
  color: #2563eb;
  text-decoration: none;
}

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