* {
	box-sizing: border-box;
}

.hidden {
	display: none !important;
}

body {
	margin: 0;
	font-family: "Microsoft YaHei", Arial, sans-serif;
	background: #f5f7fb;
	color: #1f2937;
}

body.query-loading-lock {
	overflow: hidden;
}

a {
	color: #2563eb;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

.page {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.card {
	background: #ffffff;
	border-radius: 10px;
	box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
	padding: 24px;
}

.auth-card {
	width: 100%;
	max-width: 420px;
}

.register-card {
	width: 50%;
	max-width: 760px;
}

.register-card h1 {
	text-align: center;
}

h1, h2, h3 {
	margin-top: 0;
}

.form {
	display: grid;
	gap: 12px;
}

.form label {
	display: grid;
	gap: 6px;
	font-size: 14px;
}

.login-form label {
	display: flex;
	align-items: center;
	gap: 8px;
}

.login-form label span {
	white-space: nowrap;
}

.login-form label input {
	flex: 1;
	min-width: 0;
}

.register-form label {
	display: flex;
	align-items: center;
	gap: 8px;
}

.register-form label span {
	flex: 0 0 90px;
	width: 90px;
	text-align: right;
	white-space: nowrap;
}

.register-form label input,
.register-form label select,
.register-form .captcha-inline-row {
	flex: 1;
	min-width: 0;
}

.register-form {
	grid-template-columns: 1fr;
}

input,
select,
button {
	height: 38px;
	border-radius: 6px;
	border: 1px solid #d1d5db;
	padding: 0 10px;
	font-size: 14px;
}

button {
	cursor: pointer;
}

.btn {
	border: none;
	padding: 0 14px;
}

.btn-primary {
	background: #2563eb;
	color: #fff;
}

.btn-light {
	background: #e5e7eb;
	color: #111827;
}

.full {
	width: 100%;
}

.helper-text {
	margin-bottom: 0;
	font-size: 13px;
}

.grid-form {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 16px;
}

.grid-form.register-form {
	grid-template-columns: 1fr;
}

.grid-form .full,
.grid-form .captcha-wrap,
.grid-form .captcha-inline-label {
	grid-column: 1 / -1;
}

.captcha-inline-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.captcha-inline-row input {
	flex: 1;
	min-width: 0;
}

.captcha-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
}

.captcha-img {
	width: 130px;
	height: 38px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	object-fit: contain;
	object-position: center;
	display: block;
	background: #fff;
	cursor: pointer;
}

.layout {
	min-height: 100vh;
	height: 100vh;
	display: flex;
}

.sidebar {
	width: 220px;
	background: #111827;
	color: #fff;
	padding: 20px 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.sidebar h2 {
	font-size: 20px;
	margin-bottom: 10px;
}

.nav-btn {
	border: 1px solid #374151;
	background: #1f2937;
	color: #fff;
	text-align: left;
}

.nav-btn.active {
	background: #2563eb;
	border-color: #2563eb;
}

.nav-btn.danger {
	margin-top: auto;
	background: #b91c1c;
	border-color: #b91c1c;
}

.content {
	flex: 1;
	padding: 20px;
	height: 100vh;
	overflow: hidden;
}

.panel {
	display: none;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
	padding: 18px;
}

.panel.active {
	display: flex;
	flex-direction: column;
	height: calc(100vh - 40px);
	min-height: 0;
	overflow: auto;
}

.info-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px 20px;
	margin-bottom: 16px;
}

.action-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 18px;
}

.brief-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}

.brief-card {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 12px;
	background: #fff;
	display: grid;
	gap: 8px;
}

.brief-card h3 {
	margin: 0;
	font-size: 14px;
	color: #111827;
}

.brief-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 13px;
	color: #4b5563;
}

.brief-row strong {
	font-size: 15px;
	color: #111827;
}

.info-share-wrap {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: 100%;
}

#infoShare {
	word-break: break-all;
}

.copy-link-btn {
	height: 24px;
	min-width: 24px;
	padding: 0 6px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	background: #fff;
	color: #374151;
	font-size: 14px;
	line-height: 1;
}

.copy-link-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.inline-form {
	display: flex;
	align-items: end;
	gap: 10px;
	margin-bottom: 14px;
}

.inline-form label {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 220px;
}

.inline-form label span {
	white-space: nowrap;
}

.inline-form label input,
.inline-form label select {
	flex: 1;
	min-width: 0;
}

.query-submit {
	width: auto;
	min-width: 88px;
}

.inline-form .query-submit {
	margin-left: auto;
}

.grid-form .query-submit {
	grid-column: 1 / -1;
	justify-self: end;
}

.pay-query-form .pay-date-label {
	max-width: none;
}

.pay-query-form .pay-date-label input {
	width: 150px;
	padding-right: 4px;
}

.pay-query-form .query-submit {
	grid-column: 4;
	justify-self: end;
	align-self: end;
}

.pay-query-form {
	display: grid;
	align-items: end;
	column-gap: 10px;
	row-gap: 12px;
}

.pay-query-form label {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.pay-query-form label span {
	white-space: nowrap;
}

.pay-query-form label input,
.pay-query-form label select {
	flex: 1;
	min-width: 0;
}

.pay-query-form input[type="text"],
.pay-query-form select {
	width: 130px;
}

.compact {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin-bottom: 16px;
}

.table-wrap {
	overflow-x: auto;
	overflow-y: auto;
	flex: 1 1 auto;
	height: 100%;
	min-height: 0;
	max-height: none;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
}

table {
	width: 100%;
	border-collapse: collapse;
	min-width: 800px;
}

th,
td {
	border-bottom: 1px solid #e5e7eb;
	padding: 10px;
	text-align: left;
	font-size: 13px;
	vertical-align: middle;
}

.empty-cell {
	text-align: center !important;
}

.result-table th,
.result-table td {
	border: 1px solid #e5e7eb;
}

th {
	background: #f9fafb;
}

.table-wrap thead th {
	position: sticky;
	top: 0;
	z-index: 2;
	background: #f9fafb;
}

.sortable-th {
	cursor: pointer;
	user-select: none;
	white-space: nowrap;
}

.sortable-th .sort-indicator {
	display: inline-block;
	min-width: 1em;
	margin-left: 4px;
	font-weight: 700;
	color: #2563eb;
}

.data-count {
	margin-bottom: 10px;
	font-size: 14px;
}

.list-footer {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 10px;
	margin-top: 12px;
}

.pay-sticky-footer {
	margin-top: 0;
	padding: 4px 10px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-top: none;
	border-radius: 0 0 8px 8px;
	box-shadow: 0 -4px 10px rgba(15, 23, 42, 0.08);
	position: sticky;
	bottom: 0;
	z-index: 3;
}

#paySection .table-wrap {
	border-radius: 8px 8px 0 0;
}

.pay-sticky-footer .page-item {
	height: 30px;
	font-size: 12px;
}

.pay-sticky-footer .page-size-wrap {
	font-size: 12px;
}

.pay-sticky-footer .page-size-wrap select {
	height: 30px;
}

.pager {
	grid-column: 2;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: center;
}

.page-item {
	height: 32px;
	padding: 0 10px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	background: #fff;
	font-size: 13px;
	cursor: pointer;
}

.page-item.current {
	background: #2563eb;
	border-color: #2563eb;
	color: #fff;
	font-weight: 600;
}

.page-size-wrap {
	grid-column: 3;
	justify-self: end;
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
}

.page-size-wrap select {
	width: 80px;
}

.sub-list {
	margin: 0;
	padding-left: 16px;
}

.stats-toggle {
	border: none;
	background: transparent;
	padding: 0;
	color: inherit;
	cursor: pointer;
	font-size: 13px;
	display: inline-flex;
	align-items: center;
	gap: 3px;
}

.stats-toggle-text {
	line-height: 1.2;
}

.stats-toggle-icon {
	width: 0;
	height: 0;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
	border-left: 8px solid #2563eb;
	line-height: 1;
}

.stats-toggle.is-expanded .stats-toggle-icon {
	transform: rotate(90deg);
}

.stats-sub-row > td {
	background: #f9fafb;
	padding: 0;
	border-top: 2px solid #dbeafe;
}

.stats-sub-wrap {
	width: 100%;
	overflow-x: auto;
	background: #eff6ff;
	padding: 0;
}

.stats-sub-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 760px;
	background: #eff6ff;
	margin: 0 auto;
}

.stats-sub-table thead th {
	background: #eff6ff;
	color: #1e3a8a;
}

.stats-sub-table tbody tr:nth-child(even) td {
	background: #eff6ff;
}

.stats-main-table,
.stats-sub-table {
	table-layout: fixed;
}

.stats-main-table th,
.stats-main-table td,
.stats-sub-table th,
.stats-sub-table td {
	word-break: break-all;
}

.stats-sub-table th,
.stats-sub-table td {
	border: 1px solid #e5e7eb;
	padding: 10px;
	font-size: 13px;
}

.agent-sub-row > td {
	background: #f9fafb;
	padding: 0;
	border-top: 2px solid #dbeafe;
}

.agent-sub-wrap {
	width: 100%;
	overflow-x: auto;
	background: #eff6ff;
	padding: 0;
}

.agent-sub-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 760px;
	background: #eff6ff;
	table-layout: fixed;
	margin: 0 auto;
}

.agent-sub-table thead th {
	background: #eff6ff;
	color: #1e3a8a;
}

.agent-sub-table tbody tr:nth-child(even) td {
	background: #eff6ff;
}

.agent-main-table {
	table-layout: fixed;
}

.agent-main-table th,
.agent-main-table td {
	word-break: break-all;
}

.agent-main-table td.agent-usdt-cell,
.agent-sub-table td.agent-usdt-cell {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	word-break: normal;
}

.agent-status-action {
	border: none;
	background: transparent;
	padding: 0;
	font-size: 13px;
	color: #2563eb;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.agent-status-icon {
	font-size: 12px;
	line-height: 1;
}

.agent-status-text {
	font-weight: 600;
}

.agent-status-text.status-pass {
	color: #16a34a;
}

.agent-status-text.status-wait {
	color: #2563eb;
}

.agent-status-text.status-reject {
	color: #a16207;
}

.agent-status-text.status-ban {
	color: #7f1d1d;
}

.agent-status-tip {
	margin: 0;
	font-size: 14px;
	color: #111827;
}

.agent-status-choices {
	display: flex;
	gap: 16px;
	font-size: 14px;
	color: #111827;
}

.agent-status-choices label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.agent-sub-table th,
.agent-sub-table td {
	border: 1px solid #e5e7eb;
	padding: 10px;
	font-size: 13px;
	word-break: break-all;
}

.modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	z-index: 30;
}

.modal.hidden {
	display: none;
}

.modal-box {
	width: 100%;
	max-width: 420px;
	border-radius: 10px;
	background: #fff;
	padding: 18px;
}

.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

.app-message-overlay {
	position: fixed;
	inset: 0;
	background: rgba(229, 231, 235, 0.25);
	backdrop-filter: blur(3px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	z-index: 60;
}

.app-message-box {
	width: fit-content;
    min-width: 168px;
	max-width: 380px;
	background: rgba(31, 41, 55, 0.65);
	border-radius: 16px;
	border: 1px solid rgba(148, 163, 184, 0.85);
	box-shadow: 0 8px 20px rgba(17, 24, 39, 0.85);
	padding: 20px;
	display: grid;
	gap: 16px;
}

.app-message-title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.4;
	text-align: left;
	color: #f3f4f6;
	letter-spacing: 0.2px;
}

.app-message-text {
	margin: 0;
	font-size: 15px;
	line-height: 1.7;
	text-align: center;
	word-break: break-word;
	overflow-wrap: anywhere;
	white-space: normal;
	color: #e5e7eb;
}

.app-message-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	padding-top: 2px;
}

.app-message-btn {
	flex: 0 0 auto;
	width: auto;
	min-width: 82px;
	height: 36px;
	padding: 0 16px;
	border-radius: 10px;
	font-weight: 600;
}

.app-query-loading-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	z-index: 80;
	cursor: wait;
}

.app-query-loading-box {
	min-width: 180px;
	padding: 18px 20px;
	background: rgba(17, 24, 39, 0.88);
	border: 1px solid rgba(148, 163, 184, 0.75);
	border-radius: 12px;
	display: grid;
	justify-items: center;
	gap: 10px;
}

.app-query-loading-spinner {
	width: 28px;
	height: 28px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: app-query-spin 0.8s linear infinite;
}

.app-query-loading-text {
	margin: 0;
	color: #f9fafb;
	font-size: 14px;
	line-height: 1.4;
}

@keyframes app-query-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (max-width: 1100px) {
	.compact {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.pay-query-form .query-submit {
		grid-column: 2;
		justify-self: end;
	}
}

@media (max-width: 820px) {
	.layout {
		flex-direction: column;
		height: auto;
	}

	.sidebar {
		width: 100%;
	}

	.content {
		height: auto;
		overflow: visible;
	}

	.panel.active {
		display: block;
		height: auto;
		max-height: none;
		overflow: visible;
	}

	.table-wrap {
		flex: initial;
		height: auto;
		max-height: calc(100vh - 320px);
	}

	.pay-query-form .query-submit {
		grid-column: 1;
		justify-self: end;
	}

	.pay-query-form label {
		justify-content: space-between;
	}

	.pay-query-form label input,
	.pay-query-form label select,
	.pay-query-form .pay-date-label input {
		width: 100%;
	}

	.info-grid,
	.brief-grid,
	.grid-form,
	.compact {
		grid-template-columns: 1fr;
	}

	.inline-form {
		flex-direction: column;
		align-items: stretch;
	}

	.list-footer {
		grid-template-columns: 1fr;
		row-gap: 8px;
	}

	.pager,
	.page-size-wrap {
		grid-column: 1;
	}

	.page-size-wrap {
		justify-self: end;
	}
}
