/**
 * 星火推广任务 - 前端样式文件
 *
 * 统一使用CSS变量，从子比主题读取主色，带fallback。
 * 支持暗黑模式适配。
 * 所有颜色不硬编码，响应式设计。
 *
 * @package XHTG
 * @since   1.0.0
 */

/* ==========================================================================
   1. CSS 变量定义
   ========================================================================== */

:root {
	/* 主色系 — 从子比主题读取 */
	--xhtg-primary: var(--theme-skin, #ff6b35);
	--xhtg-primary-hover: var(--theme-skin-hover, #e55a2b);
	--xhtg-primary-light: var(--theme-skin-light, rgba(255, 107, 53, 0.1));
	--xhtg-primary-rgb: 255, 107, 53;

	/* 功能色 */
	--xhtg-success: #28a745;
	--xhtg-success-light: rgba(40, 167, 69, 0.1);
	--xhtg-danger: #dc3545;
	--xhtg-danger-light: rgba(220, 53, 69, 0.1);
	--xhtg-warning: #ffc107;
	--xhtg-warning-light: rgba(255, 193, 7, 0.1);
	--xhtg-info: #17a2b8;
	--xhtg-info-light: rgba(23, 162, 184, 0.1);

	/* 文字色 — 从子比主题读取 */
	--xhtg-text: var(--main-text-color, #333);
	--xhtg-text-muted: var(--secondary-text-color, #999);
	--xhtg-text-light: var(--secondary-text-color, #bbb);

	/* 背景色 — 从子比主题读取 */
	--xhtg-bg: var(--theme-body-background, #f5f5f5);
	--xhtg-card-bg: var(--theme-box-background, #fff);

	/* 边框 — 从子比主题读取 */
	--xhtg-border: var(--theme-border-color, #e8e8e8);
	--xhtg-border-light: rgba(0, 0, 0, 0.06);

	/* 圆角 — 从子比主题读取 */
	--xhtg-radius: var(--main-radius, 4px);
	--xhtg-radius-lg: 8px;
	--xhtg-radius-sm: 2px;

	/* 阴影 */
	--xhtg-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
	--xhtg-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.1);
	--xhtg-shadow-modal: 0 8px 32px rgba(0, 0, 0, 0.15);

	/* 过渡 */
	--xhtg-transition: 0.3s ease;
	--xhtg-transition-fast: 0.15s ease;

	/* 字体 */
	--xhtg-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	/* 容器 */
	--xhtg-container-max: 1200px;

	/* 动画 */
	--xhtg-spin-duration: 0.8s;
}

/* ==========================================================================
   2. 暗黑模式适配
   ========================================================================== */

[data-theme="dark"] {
	--xhtg-primary: var(--theme-skin, #ff6b35);
	--xhtg-primary-hover: var(--theme-skin-hover, #ff8559);
	--xhtg-primary-light: rgba(255, 107, 53, 0.15);
	--xhtg-primary-rgb: 255, 107, 53;

	--xhtg-success: #34d058;
	--xhtg-success-light: rgba(52, 208, 88, 0.15);
	--xhtg-danger: #f85149;
	--xhtg-danger-light: rgba(248, 81, 73, 0.15);
	--xhtg-warning: #e3b341;
	--xhtg-warning-light: rgba(227, 179, 65, 0.15);
	--xhtg-info: #58a6ff;
	--xhtg-info-light: rgba(88, 166, 255, 0.15);

	--xhtg-text: var(--main-text-color, #e6e6e6);
	--xhtg-text-muted: var(--secondary-text-color, #999);
	--xhtg-text-light: var(--secondary-text-color, #666);

	--xhtg-bg: var(--theme-body-background, #1a1a2e);
	--xhtg-card-bg: var(--theme-box-background, #252540);

	--xhtg-border: var(--theme-border-color, #333355);
	--xhtg-border-light: rgba(255, 255, 255, 0.06);

	--xhtg-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
	--xhtg-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.35);
	--xhtg-shadow-modal: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   3. 基础重置
   ========================================================================== */

.xhtg-container *,
.xhtg-container *::before,
.xhtg-container *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* ==========================================================================
   4. 容器
   ========================================================================== */

.xhtg-container {
	max-width: var(--xhtg-container-max);
	margin: 0 auto;
	padding: 20px 16px;
	font-family: var(--xhtg-font-family);
	color: var(--xhtg-text);
	line-height: 1.6;
	font-size: 14px;
}

/* ==========================================================================
   5. 卡片
   ========================================================================== */

.xhtg-card {
	background: var(--xhtg-card-bg);
	border: 1px solid var(--xhtg-border);
	border-radius: var(--xhtg-radius-lg);
	padding: 20px;
	box-shadow: var(--xhtg-shadow);
	transition: box-shadow var(--xhtg-transition), transform var(--xhtg-transition);
	margin-bottom: 16px;
}

.xhtg-card:hover {
	box-shadow: var(--xhtg-shadow-hover);
}

/* ==========================================================================
   6. 按钮系统
   ========================================================================== */

.xhtg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 20px;
	border: 1px solid transparent;
	border-radius: var(--xhtg-radius);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: all var(--xhtg-transition);
	outline: none;
	white-space: nowrap;
	user-select: none;
	vertical-align: middle;
	font-family: var(--xhtg-font-family);
}

.xhtg-btn:focus-visible {
	box-shadow: 0 0 0 3px rgba(var(--xhtg-primary-rgb), 0.3);
}

/* 主按钮 */
.xhtg-btn-primary {
	background: var(--xhtg-primary);
	color: #fff;
	border-color: var(--xhtg-primary);
}

.xhtg-btn-primary:hover,
.xhtg-btn-primary:focus {
	background: var(--xhtg-primary-hover);
	border-color: var(--xhtg-primary-hover);
	color: #fff;
	transform: translateY(-1px);
	box-shadow: var(--xhtg-shadow-hover);
}

.xhtg-btn-primary:active {
	transform: translateY(0);
}

/* 轮廓按钮 */
.xhtg-btn-outline {
	background: transparent;
	color: var(--xhtg-primary);
	border-color: var(--xhtg-primary);
}

.xhtg-btn-outline:hover,
.xhtg-btn-outline:focus {
	background: var(--xhtg-primary-light);
	color: var(--xhtg-primary-hover);
	border-color: var(--xhtg-primary-hover);
}

/* 成功按钮 */
.xhtg-btn-success {
	background: var(--xhtg-success);
	color: #fff;
	border-color: var(--xhtg-success);
}

.xhtg-btn-success:hover,
.xhtg-btn-success:focus {
	background: #218838;
	border-color: #1e7e34;
	color: #fff;
}

/* 危险按钮 */
.xhtg-btn-danger {
	background: var(--xhtg-danger);
	color: #fff;
	border-color: var(--xhtg-danger);
}

.xhtg-btn-danger:hover,
.xhtg-btn-danger:focus {
	background: #c82333;
	border-color: #bd2130;
	color: #fff;
}

/* 警告按钮 */
.xhtg-btn-warning {
	background: var(--xhtg-warning);
	color: #333;
	border-color: var(--xhtg-warning);
}

.xhtg-btn-warning:hover,
.xhtg-btn-warning:focus {
	background: #e0a800;
	border-color: #d39e00;
	color: #333;
}

/* 小按钮 */
.xhtg-btn-sm {
	padding: 4px 12px;
	font-size: 12px;
	line-height: 1.5;
	border-radius: var(--xhtg-radius-sm);
}

/* 极小按钮 */
.xhtg-btn-xs {
	padding: 2px 8px;
	font-size: 11px;
	line-height: 1.5;
	border-radius: var(--xhtg-radius-sm);
}

/* 禁用状态 */
.xhtg-btn:disabled,
.xhtg-btn.disabled {
	opacity: 0.55;
	cursor: not-allowed;
	pointer-events: none;
}

/* 加载状态 */
.xhtg-btn.loading {
	pointer-events: none;
	opacity: 0.7;
	position: relative;
	color: transparent !important;
}

.xhtg-btn.loading::after {
	content: "";
	position: absolute;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: xhtg-spin var(--xhtg-spin-duration) linear infinite;
}

/* 按钮组 */
.xhtg-btn-group {
	display: inline-flex;
	gap: 0;
}

.xhtg-btn-group .xhtg-btn {
	border-radius: 0;
	margin-left: -1px;
}

.xhtg-btn-group .xhtg-btn:first-child {
	border-radius: var(--xhtg-radius) 0 0 var(--xhtg-radius);
	margin-left: 0;
}

.xhtg-btn-group .xhtg-btn:last-child {
	border-radius: 0 var(--xhtg-radius) var(--xhtg-radius) 0;
}

/* ==========================================================================
   7. Tab 切换
   ========================================================================== */

.xhtg-tab-bar {
	display: flex;
	align-items: center;
	border-bottom: 2px solid var(--xhtg-border);
	position: relative;
	margin-bottom: 20px;
	gap: 4px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.xhtg-tab-item {
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 500;
	color: var(--xhtg-text-muted);
	cursor: pointer;
	transition: color var(--xhtg-transition);
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	white-space: nowrap;
	user-select: none;
	background: none;
	border-top: none;
	border-left: none;
	border-right: none;
	font-family: var(--xhtg-font-family);
}

.xhtg-tab-item:hover {
	color: var(--xhtg-primary);
}

.xhtg-tab-item.active {
	color: var(--xhtg-primary);
	border-bottom-color: var(--xhtg-primary);
	font-weight: 600;
}

.xhtg-tab-content {
	display: none;
}

.xhtg-tab-content.active {
	display: block;
	animation: xhtg-fadeIn 0.3s ease;
}

/* ==========================================================================
   8. 表单
   ========================================================================== */

.xhtg-form-group {
	margin-bottom: 16px;
}

.xhtg-form-label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 500;
	color: var(--xhtg-text);
}

.xhtg-form-label .required {
	color: var(--xhtg-danger);
	margin-left: 2px;
}

.xhtg-form-input,
.xhtg-form-select,
.xhtg-form-textarea {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid var(--xhtg-border);
	border-radius: var(--xhtg-radius);
	font-size: 14px;
	font-family: var(--xhtg-font-family);
	color: var(--xhtg-text);
	background: var(--xhtg-card-bg);
	transition: border-color var(--xhtg-transition-fast), box-shadow var(--xhtg-transition-fast);
	outline: none;
	line-height: 1.5;
}

.xhtg-form-input:focus,
.xhtg-form-select:focus,
.xhtg-form-textarea:focus {
	border-color: var(--xhtg-primary);
	box-shadow: 0 0 0 3px rgba(var(--xhtg-primary-rgb), 0.15);
}

.xhtg-form-input::placeholder,
.xhtg-form-textarea::placeholder {
	color: var(--xhtg-text-light);
}

.xhtg-form-input.error,
.xhtg-form-select.error,
.xhtg-form-textarea.error {
	border-color: var(--xhtg-danger);
	box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.xhtg-form-select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 32px;
}

.xhtg-form-textarea {
	min-height: 100px;
	resize: vertical;
}

.xhtg-form-error {
	color: var(--xhtg-danger);
	font-size: 12px;
	margin-top: 4px;
	display: none;
}

.xhtg-form-error.show {
	display: block;
	animation: xhtg-fadeIn 0.2s ease;
}

.xhtg-form-hint {
	color: var(--xhtg-text-muted);
	font-size: 12px;
	margin-top: 4px;
}

/* 表单行 */
.xhtg-form-row {
	display: flex;
	gap: 16px;
	margin-bottom: 16px;
}

.xhtg-form-row .xhtg-form-group {
	flex: 1;
	margin-bottom: 0;
}

/* ==========================================================================
   9. 文件上传
   ========================================================================== */

.xhtg-upload-area {
	border: 2px dashed var(--xhtg-border);
	border-radius: var(--xhtg-radius-lg);
	padding: 32px 20px;
	text-align: center;
	cursor: pointer;
	transition: all var(--xhtg-transition);
	background: var(--xhtg-card-bg);
	position: relative;
}

.xhtg-upload-area:hover {
	border-color: var(--xhtg-primary);
	background: var(--xhtg-primary-light);
}

.xhtg-upload-area.dragover {
	border-color: var(--xhtg-primary);
	background: var(--xhtg-primary-light);
	box-shadow: 0 0 0 3px rgba(var(--xhtg-primary-rgb), 0.15);
	transform: scale(1.01);
}

.xhtg-upload-area .upload-icon {
	font-size: 36px;
	color: var(--xhtg-text-muted);
	margin-bottom: 8px;
	display: block;
}

.xhtg-upload-area .upload-text {
	font-size: 14px;
	color: var(--xhtg-text-muted);
}

.xhtg-upload-area .upload-text strong {
	color: var(--xhtg-primary);
}

.xhtg-upload-area .upload-hint {
	font-size: 12px;
	color: var(--xhtg-text-light);
	margin-top: 4px;
}

.xhtg-upload-area input[type="file"] {
	display: none;
}

/* 上传预览 */
.xhtg-upload-preview {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	border: 1px solid var(--xhtg-border);
	border-radius: var(--xhtg-radius);
	background: var(--xhtg-card-bg);
	margin-top: 10px;
}

.xhtg-upload-preview img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: var(--xhtg-radius-sm);
	border: 1px solid var(--xhtg-border);
}

.xhtg-upload-preview .preview-info {
	flex: 1;
	min-width: 0;
}

.xhtg-upload-preview .preview-name {
	font-size: 13px;
	color: var(--xhtg-text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.xhtg-upload-preview .preview-size {
	font-size: 12px;
	color: var(--xhtg-text-muted);
}

.xhtg-upload-preview .preview-remove {
	color: var(--xhtg-danger);
	cursor: pointer;
	font-size: 18px;
	padding: 4px;
	border-radius: var(--xhtg-radius);
	transition: background var(--xhtg-transition-fast);
	border: none;
	background: none;
	line-height: 1;
}

.xhtg-upload-preview .preview-remove:hover {
	background: var(--xhtg-danger-light);
}

/* ==========================================================================
   10. 状态标签 / Badge
   ========================================================================== */

.xhtg-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 10px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.8;
	border-radius: 100px;
	white-space: nowrap;
	vertical-align: middle;
}

.xhtg-badge-pending {
	background: var(--xhtg-warning-light);
	color: #b37d00;
	border: 1px solid rgba(255, 193, 7, 0.3);
}

[data-theme="dark"] .xhtg-badge-pending {
	color: #e3b341;
}

.xhtg-badge-approved {
	background: var(--xhtg-success-light);
	color: #1e7e34;
	border: 1px solid rgba(40, 167, 69, 0.3);
}

[data-theme="dark"] .xhtg-badge-approved {
	color: #34d058;
}

.xhtg-badge-rejected {
	background: var(--xhtg-danger-light);
	color: #bd2130;
	border: 1px solid rgba(220, 53, 69, 0.3);
}

[data-theme="dark"] .xhtg-badge-rejected {
	color: #f85149;
}

.xhtg-badge-settled {
	background: var(--xhtg-info-light);
	color: #117a8b;
	border: 1px solid rgba(23, 162, 184, 0.3);
}

[data-theme="dark"] .xhtg-badge-settled {
	color: #58a6ff;
}

.xhtg-badge-invalid {
	background: rgba(0, 0, 0, 0.06);
	color: var(--xhtg-text-muted);
	border: 1px solid var(--xhtg-border);
}

[data-theme="dark"] .xhtg-badge-invalid {
	background: rgba(255, 255, 255, 0.06);
}

.xhtg-badge-active {
	background: var(--xhtg-success-light);
	color: #1e7e34;
	border: 1px solid rgba(40, 167, 69, 0.3);
}

.xhtg-badge-expired {
	background: var(--xhtg-danger-light);
	color: #bd2130;
	border: 1px solid rgba(220, 53, 69, 0.3);
}

.xhtg-badge-claimed {
	background: var(--xhtg-info-light);
	color: #117a8b;
	border: 1px solid rgba(23, 162, 184, 0.3);
}

/* ==========================================================================
   11. 分页
   ========================================================================== */

.xhtg-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	margin-top: 24px;
	flex-wrap: wrap;
}

.xhtg-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid var(--xhtg-border);
	border-radius: var(--xhtg-radius);
	font-size: 13px;
	color: var(--xhtg-text);
	background: var(--xhtg-card-bg);
	cursor: pointer;
	transition: all var(--xhtg-transition-fast);
	text-decoration: none;
}

.xhtg-pagination .page-numbers:hover {
	border-color: var(--xhtg-primary);
	color: var(--xhtg-primary);
	background: var(--xhtg-primary-light);
}

.xhtg-pagination .page-numbers.current {
	background: var(--xhtg-primary);
	color: #fff;
	border-color: var(--xhtg-primary);
	font-weight: 600;
}

.xhtg-pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
	cursor: default;
	color: var(--xhtg-text-muted);
}

.xhtg-pagination .page-numbers.disabled {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: none;
}

/* ==========================================================================
   12. 空状态
   ========================================================================== */

.xhtg-empty {
	text-align: center;
	padding: 48px 20px;
}

.xhtg-empty .empty-icon {
	font-size: 48px;
	color: var(--xhtg-text-light);
	margin-bottom: 16px;
	display: block;
	line-height: 1;
}

.xhtg-empty .empty-title {
	font-size: 16px;
	font-weight: 500;
	color: var(--xhtg-text-muted);
	margin-bottom: 8px;
}

.xhtg-empty .empty-desc {
	font-size: 13px;
	color: var(--xhtg-text-light);
	margin-bottom: 20px;
}

/* ==========================================================================
   13. 弹窗 / Modal
   ========================================================================== */

.xhtg-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.xhtg-modal.show {
	display: flex;
	animation: xhtg-fadeIn 0.2s ease;
}

.xhtg-modal-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	cursor: pointer;
}

.xhtg-modal-content {
	position: relative;
	background: var(--xhtg-card-bg);
	border-radius: var(--xhtg-radius-lg);
	box-shadow: var(--xhtg-shadow-modal);
	width: 100%;
	max-width: 520px;
	max-height: 85vh;
	overflow-y: auto;
	animation: xhtg-slideUp 0.3s ease;
}

.xhtg-modal-content.xhtg-modal-lg {
	max-width: 720px;
}

.xhtg-modal-content.xhtg-modal-sm {
	max-width: 380px;
}

.xhtg-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--xhtg-border);
}

.xhtg-modal-title {
	font-size: 16px;
	font-weight: 600;
	color: var(--xhtg-text);
}

.xhtg-modal-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	background: none;
	color: var(--xhtg-text-muted);
	font-size: 20px;
	cursor: pointer;
	border-radius: var(--xhtg-radius);
	transition: all var(--xhtg-transition-fast);
	line-height: 1;
	padding: 0;
}

.xhtg-modal-close:hover {
	background: var(--xhtg-danger-light);
	color: var(--xhtg-danger);
}

.xhtg-modal-body {
	padding: 20px;
	font-size: 14px;
	line-height: 1.7;
	color: var(--xhtg-text);
}

.xhtg-modal-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	padding: 16px 20px;
	border-top: 1px solid var(--xhtg-border);
}

/* ==========================================================================
   14. Toast 提示
   ========================================================================== */

.xhtg-toast-container {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: 380px;
}

.xhtg-toast {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 16px;
	border-radius: var(--xhtg-radius);
	background: var(--xhtg-card-bg);
	box-shadow: var(--xhtg-shadow-hover);
	border-left: 4px solid var(--xhtg-info);
	font-size: 13px;
	color: var(--xhtg-text);
	animation: xhtg-slideIn 0.3s ease;
	transition: opacity var(--xhtg-transition), transform var(--xhtg-transition);
}

.xhtg-toast.hiding {
	opacity: 0;
	transform: translateX(100%);
}

.xhtg-toast-success {
	border-left-color: var(--xhtg-success);
}

.xhtg-toast-error {
	border-left-color: var(--xhtg-danger);
}

.xhtg-toast-warning {
	border-left-color: var(--xhtg-warning);
}

.xhtg-toast-info {
	border-left-color: var(--xhtg-info);
}

.xhtg-toast .toast-icon {
	font-size: 16px;
	line-height: 1.4;
	flex-shrink: 0;
}

.xhtg-toast-success .toast-icon {
	color: var(--xhtg-success);
}

.xhtg-toast-error .toast-icon {
	color: var(--xhtg-danger);
}

.xhtg-toast-warning .toast-icon {
	color: var(--xhtg-warning);
}

.xhtg-toast-info .toast-icon {
	color: var(--xhtg-info);
}

.xhtg-toast .toast-msg {
	flex: 1;
	line-height: 1.5;
}

.xhtg-toast .toast-close {
	color: var(--xhtg-text-muted);
	cursor: pointer;
	font-size: 14px;
	padding: 2px;
	border: none;
	background: none;
	flex-shrink: 0;
	line-height: 1;
}

/* ==========================================================================
   15. 表格
   ========================================================================== */

.xhtg-table {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	font-size: 13px;
}

.xhtg-table th,
.xhtg-table td {
	padding: 10px 12px;
	text-align: left;
	border-bottom: 1px solid var(--xhtg-border-light);
	vertical-align: middle;
}

.xhtg-table th {
	background: var(--xhtg-bg);
	font-weight: 600;
	font-size: 12px;
	color: var(--xhtg-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.3px;
	white-space: nowrap;
	border-bottom: 1px solid var(--xhtg-border);
}

.xhtg-table td {
	color: var(--xhtg-text);
}

.xhtg-table tbody tr {
	transition: background var(--xhtg-transition-fast);
}

.xhtg-table tbody tr:hover {
	background: var(--xhtg-primary-light);
}

.xhtg-table .text-right {
	text-align: right;
}

.xhtg-table .text-center {
	text-align: center;
}

.xhtg-table .text-primary {
	color: var(--xhtg-primary);
	font-weight: 600;
}

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

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

.xhtg-table .text-muted {
	color: var(--xhtg-text-muted);
}

/* ==========================================================================
   16. 统计卡片
   ========================================================================== */

.xhtg-stat-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-bottom: 24px;
}

.xhtg-stat-card {
	background: var(--xhtg-card-bg);
	border: 1px solid var(--xhtg-border);
	border-radius: var(--xhtg-radius-lg);
	padding: 20px;
	text-align: center;
	box-shadow: var(--xhtg-shadow);
	transition: box-shadow var(--xhtg-transition);
}

.xhtg-stat-card:hover {
	box-shadow: var(--xhtg-shadow-hover);
}

.xhtg-stat-card .stat-value {
	font-size: 28px;
	font-weight: 700;
	color: var(--xhtg-text);
	line-height: 1.2;
	margin-bottom: 6px;
}

.xhtg-stat-card .stat-value.text-primary {
	color: var(--xhtg-primary);
}

.xhtg-stat-card .stat-value.text-success {
	color: var(--xhtg-success);
}

.xhtg-stat-card .stat-value.text-warning {
	color: var(--xhtg-warning);
}

.xhtg-stat-card .stat-value.text-danger {
	color: var(--xhtg-danger);
}

.xhtg-stat-card .stat-label {
	font-size: 12px;
	color: var(--xhtg-text-muted);
	font-weight: 500;
}

/* ==========================================================================
   17. 任务卡片
   ========================================================================== */

.xhtg-task-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

.xhtg-task-card {
	background: var(--xhtg-card-bg);
	border: 1px solid var(--xhtg-border);
	border-radius: var(--xhtg-radius-lg);
	overflow: hidden;
	box-shadow: var(--xhtg-shadow);
	transition: all var(--xhtg-transition);
}

.xhtg-task-card:hover {
	box-shadow: var(--xhtg-shadow-hover);
	transform: translateY(-2px);
}

.xhtg-task-card-thumb {
	width: 100%;
	height: 160px;
	object-fit: cover;
	background: var(--xhtg-bg);
	display: block;
}

.xhtg-task-card-body {
	padding: 16px;
}

.xhtg-task-card-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--xhtg-text);
	margin-bottom: 8px;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.xhtg-task-card-title a {
	color: inherit;
	text-decoration: none;
	transition: color var(--xhtg-transition-fast);
}

.xhtg-task-card-title a:hover {
	color: var(--xhtg-primary);
}

.xhtg-task-card-price {
	font-size: 20px;
	font-weight: 700;
	color: var(--xhtg-primary);
	margin-bottom: 8px;
}

.xhtg-task-card-price small {
	font-size: 12px;
	font-weight: 400;
	color: var(--xhtg-text-muted);
}

.xhtg-task-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	font-size: 12px;
	color: var(--xhtg-text-muted);
	margin-bottom: 12px;
}

.xhtg-task-card-meta span {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.xhtg-task-card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.xhtg-task-card-requirements {
	font-size: 12px;
	color: var(--xhtg-text-muted);
	line-height: 1.6;
	margin-bottom: 12px;
	max-height: 48px;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ==========================================================================
   18. 筛选栏
   ========================================================================== */

.xhtg-filter-bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 20px;
	padding: 12px 16px;
	background: var(--xhtg-card-bg);
	border: 1px solid var(--xhtg-border);
	border-radius: var(--xhtg-radius-lg);
}

.xhtg-filter-bar .xhtg-search-input {
	flex: 1;
	min-width: 200px;
}

.xhtg-search-input {
	position: relative;
}

.xhtg-search-input .xhtg-form-input {
	padding-left: 36px;
}

.xhtg-search-input .search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--xhtg-text-muted);
	font-size: 14px;
	pointer-events: none;
}

/* ==========================================================================
   19. 记录条目
   ========================================================================== */

.xhtg-record-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--xhtg-border-light);
	transition: background var(--xhtg-transition-fast);
}

.xhtg-record-item:last-child {
	border-bottom: none;
}

.xhtg-record-item:hover {
	background: var(--xhtg-primary-light);
	margin: 0 -12px;
	padding-left: 12px;
	padding-right: 12px;
	border-radius: var(--xhtg-radius);
}

.xhtg-record-info {
	flex: 1;
	min-width: 0;
}

.xhtg-record-title {
	font-size: 14px;
	font-weight: 500;
	color: var(--xhtg-text);
	margin-bottom: 4px;
}

.xhtg-record-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 12px;
	color: var(--xhtg-text-muted);
}

.xhtg-record-meta span {
	display: inline-flex;
	align-items: center;
	gap: 3px;
}

.xhtg-record-actions {
	display: flex;
	gap: 6px;
	flex-shrink: 0;
	align-items: center;
}

/* ==========================================================================
   20. 复制按钮
   ========================================================================== */

.xhtg-copy-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	border: 1px solid var(--xhtg-border);
	border-radius: var(--xhtg-radius-sm);
	font-size: 12px;
	color: var(--xhtg-text-muted);
	background: var(--xhtg-card-bg);
	cursor: pointer;
	transition: all var(--xhtg-transition-fast);
}

.xhtg-copy-btn:hover {
	border-color: var(--xhtg-primary);
	color: var(--xhtg-primary);
	background: var(--xhtg-primary-light);
}

.xhtg-copy-btn.copied {
	border-color: var(--xhtg-success);
	color: var(--xhtg-success);
	background: var(--xhtg-success-light);
}

/* ==========================================================================
   21. 外链
   ========================================================================== */

.xhtg-link-external {
	color: var(--xhtg-primary);
	text-decoration: none;
	transition: color var(--xhtg-transition-fast);
}

.xhtg-link-external::after {
	content: " \2197";
	font-size: 0.85em;
}

.xhtg-link-external:hover {
	color: var(--xhtg-primary-hover);
	text-decoration: underline;
}

/* ==========================================================================
   22. 协议遮罩层
   ========================================================================== */

.xhtg-agreement-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 100000;
	background: rgba(0, 0, 0, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.xhtg-agreement-content {
	background: var(--xhtg-card-bg);
	border-radius: var(--xhtg-radius-lg);
	box-shadow: var(--xhtg-shadow-modal);
	width: 100%;
	max-width: 640px;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
}

.xhtg-agreement-header {
	padding: 20px 24px;
	border-bottom: 1px solid var(--xhtg-border);
	font-size: 18px;
	font-weight: 600;
	color: var(--xhtg-text);
}

.xhtg-agreement-body {
	flex: 1;
	overflow-y: auto;
	padding: 24px;
	font-size: 14px;
	line-height: 1.8;
	color: var(--xhtg-text);
}

.xhtg-agreement-footer {
	padding: 16px 24px;
	border-top: 1px solid var(--xhtg-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.xhtg-agreement-check {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--xhtg-text);
	cursor: pointer;
}

.xhtg-agreement-check input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--xhtg-primary);
}

/* 协议未签署的横幅提示（子页面顶部显示） */
.xhtg-agreement-banner {
	display: flex;
	align-items: center;
	gap: 12px;
	background: linear-gradient(135deg, #fff7e6 0%, #ffe8cc 100%);
	border: 1px solid #ffd591;
	border-left: 4px solid #fa8c16;
	border-radius: 8px;
	padding: 14px 18px;
	margin: 0 0 20px;
	font-size: 14px;
	color: #874d00;
	box-shadow: 0 2px 8px rgba(250, 140, 22, 0.08);
}
.xhtg-agreement-banner__icon {
	font-size: 18px;
	flex-shrink: 0;
}
.xhtg-agreement-banner__text {
	flex: 1;
	line-height: 1.5;
}
.xhtg-agreement-banner__btn {
	background: #fa8c16;
	color: #fff;
	padding: 6px 18px;
	border-radius: 6px;
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
	transition: background 0.2s;
}
.xhtg-agreement-banner__btn:hover {
	background: #d46b08;
	color: #fff;
	text-decoration: none;
}
@media (max-width: 600px) {
	.xhtg-agreement-banner {
		flex-wrap: wrap;
	}
	.xhtg-agreement-banner__btn {
		width: 100%;
		text-align: center;
	}
}

/* ==========================================================================
   23. 进度条
   ========================================================================== */

.xhtg-progress-bar {
	width: 100%;
	height: 8px;
	background: var(--xhtg-bg);
	border-radius: 100px;
	overflow: hidden;
}

.xhtg-progress-bar .progress-fill {
	height: 100%;
	background: var(--xhtg-primary);
	border-radius: 100px;
	transition: width 0.6s ease;
}

.xhtg-progress-bar .progress-fill.success {
	background: var(--xhtg-success);
}

.xhtg-progress-bar .progress-fill.danger {
	background: var(--xhtg-danger);
}

.xhtg-progress-bar .progress-fill.warning {
	background: var(--xhtg-warning);
}

/* ==========================================================================
   24. 加载动画
   ========================================================================== */

.xhtg-loading {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid var(--xhtg-border);
	border-top-color: var(--xhtg-primary);
	border-radius: 50%;
	animation: xhtg-spin var(--xhtg-spin-duration) linear infinite;
}

.xhtg-loading-lg {
	width: 36px;
	height: 36px;
	border-width: 3px;
}

.xhtg-loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
}

/* ==========================================================================
   25. 折叠面板
   ========================================================================== */

.xhtg-collapse {
	border: 1px solid var(--xhtg-border);
	border-radius: var(--xhtg-radius-lg);
	overflow: hidden;
	margin-bottom: 12px;
}

.xhtg-collapse-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--xhtg-bg);
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	color: var(--xhtg-text);
	transition: background var(--xhtg-transition-fast);
	user-select: none;
	border: none;
	width: 100%;
	text-align: left;
	font-family: var(--xhtg-font-family);
}

.xhtg-collapse-header:hover {
	background: var(--xhtg-primary-light);
}

.xhtg-collapse-header .collapse-arrow {
	transition: transform var(--xhtg-transition);
	font-size: 12px;
	color: var(--xhtg-text-muted);
}

.xhtg-collapse.open .collapse-arrow {
	transform: rotate(180deg);
}

.xhtg-collapse-body {
	display: none;
	padding: 16px;
	border-top: 1px solid var(--xhtg-border);
	background: var(--xhtg-card-bg);
}

.xhtg-collapse.open .xhtg-collapse-body {
	display: block;
	animation: xhtg-fadeIn 0.3s ease;
}

/* ==========================================================================
   26. 详情行
   ========================================================================== */

.xhtg-detail-row {
	display: flex;
	align-items: flex-start;
	padding: 10px 0;
	border-bottom: 1px solid var(--xhtg-border-light);
	font-size: 13px;
}

.xhtg-detail-row:last-child {
	border-bottom: none;
}

.xhtg-detail-label {
	flex: 0 0 120px;
	color: var(--xhtg-text-muted);
	font-weight: 500;
}

.xhtg-detail-value {
	flex: 1;
	color: var(--xhtg-text);
	word-break: break-all;
}

.xhtg-detail-value.text-primary {
	color: var(--xhtg-primary);
}

.xhtg-detail-value.text-success {
	color: var(--xhtg-success);
}

.xhtg-detail-value.text-danger {
	color: var(--xhtg-danger);
}

/* ==========================================================================
   27. 图片查看器
   ========================================================================== */

.xhtg-image-viewer {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999998;
	background: rgba(0, 0, 0, 0.85);
	display: none;
	align-items: center;
	justify-content: center;
	cursor: zoom-out;
}

.xhtg-image-viewer.show {
	display: flex;
	animation: xhtg-fadeIn 0.2s ease;
}

.xhtg-image-viewer img {
	max-width: 90%;
	max-height: 90%;
	object-fit: contain;
	border-radius: var(--xhtg-radius);
	cursor: default;
}

.xhtg-image-viewer .viewer-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border: none;
	transition: background var(--xhtg-transition-fast);
}

.xhtg-image-viewer .viewer-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   28. 工具类
   ========================================================================== */

.xhtg-text-primary { color: var(--xhtg-primary); }
.xhtg-text-success { color: var(--xhtg-success); }
.xhtg-text-danger { color: var(--xhtg-danger); }
.xhtg-text-warning { color: var(--xhtg-warning); }
.xhtg-text-muted { color: var(--xhtg-text-muted); }

.xhtg-text-center { text-align: center; }
.xhtg-text-right { text-align: right; }
.xhtg-text-left { text-align: left; }

.xhtg-mt-0 { margin-top: 0; }
.xhtg-mt-10 { margin-top: 10px; }
.xhtg-mt-16 { margin-top: 16px; }
.xhtg-mt-20 { margin-top: 20px; }
.xhtg-mb-0 { margin-bottom: 0; }
.xhtg-mb-10 { margin-bottom: 10px; }
.xhtg-mb-16 { margin-bottom: 16px; }
.xhtg-mb-20 { margin-bottom: 20px; }

.xhtg-flex { display: flex; }
.xhtg-flex-center { display: flex; align-items: center; justify-content: center; }
.xhtg-flex-between { display: flex; align-items: center; justify-content: space-between; }
.xhtg-flex-wrap { flex-wrap: wrap; }
.xhtg-gap-8 { gap: 8px; }
.xhtg-gap-10 { gap: 10px; }
.xhtg-gap-16 { gap: 16px; }

.xhtg-hidden { display: none !important; }
.xhtg-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ==========================================================================
   29. 动画
   ========================================================================== */

@keyframes xhtg-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

@keyframes xhtg-fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes xhtg-slideUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes xhtg-slideIn {
	from {
		opacity: 0;
		transform: translateX(40px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@keyframes xhtg-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

/* ==========================================================================
   30. 响应式适配
   ========================================================================== */

/* 平板 */
@media (max-width: 1024px) {
	.xhtg-stat-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.xhtg-task-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* 小平板 */
@media (max-width: 768px) {
	.xhtg-container {
		padding: 16px 12px;
	}

	.xhtg-stat-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.xhtg-task-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.xhtg-tab-bar {
		gap: 0;
	}

	.xhtg-tab-item {
		padding: 8px 14px;
		font-size: 13px;
	}

	.xhtg-filter-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.xhtg-filter-bar .xhtg-search-input {
		min-width: 100%;
	}

	.xhtg-form-row {
		flex-direction: column;
		gap: 0;
	}

	.xhtg-detail-row {
		flex-direction: column;
	}

	.xhtg-detail-label {
		flex: 0 0 auto;
		margin-bottom: 4px;
	}

	.xhtg-record-item {
		flex-direction: column;
	}

	.xhtg-record-actions {
		width: 100%;
		justify-content: flex-end;
	}

	.xhtg-modal-content {
		max-width: 100%;
		max-height: 90vh;
		margin: 10px;
	}
}

/* 移动端 */
@media (max-width: 480px) {
	.xhtg-stat-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}

	.xhtg-stat-card {
		padding: 14px;
	}

	.xhtg-stat-card .stat-value {
		font-size: 22px;
	}

	.xhtg-task-grid {
		grid-template-columns: 1fr;
	}

	.xhtg-task-card-thumb {
		height: 120px;
	}

	.xhtg-card {
		padding: 14px;
		border-radius: var(--xhtg-radius);
	}

	.xhtg-btn {
		padding: 8px 14px;
		font-size: 13px;
	}

	.xhtg-pagination .page-numbers {
		min-width: 32px;
		height: 32px;
		font-size: 12px;
	}

	.xhtg-modal-footer {
		flex-direction: column;
	}

	.xhtg-modal-footer .xhtg-btn {
		width: 100%;
	}

	.xhtg-table {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.xhtg-agreement-content {
		max-width: 100%;
		margin: 10px;
	}
}

/* ==========================================================================
   31. 打印样式
   ========================================================================== */

@media print {
	.xhtg-btn,
	.xhtg-pagination,
	.xhtg-filter-bar,
	.xhtg-toast-container {
		display: none !important;
	}

	.xhtg-card {
		box-shadow: none;
		break-inside: avoid;
	}

	.xhtg-container {
		max-width: 100%;
	}
}

/* ===== 独立前端页面导航栏 ===== */
.xhtg-frontend-page {
	min-height: 70vh;
	padding: 20px 0;
}

.xhtg-nav-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	border-bottom: 2px solid var(--xhtg-border, #e8e8e8);
	margin-bottom: 24px;
	padding: 0 4px;
}

.xhtg-nav-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 16px;
	font-size: 14px;
	color: var(--xhtg-text-muted, #999);
	text-decoration: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	transition: all 0.2s ease;
}

.xhtg-nav-item:hover {
	color: var(--xhtg-primary, var(--theme-skin, #ff6b35));
}

.xhtg-nav-icon {
	font-size: 16px;
	line-height: 1;
	margin-right: 4px;
}

@media (max-width: 768px) {
	.xhtg-nav-bar {
		overflow-x: auto;
		flex-wrap: nowrap;
		-webkit-overflow-scrolling: touch;
	}

	.xhtg-nav-item {
		white-space: nowrap;
		padding: 8px 12px;
		font-size: 13px;
	}
}
