/* twc-utils.css — 纯 CSS 版 Tailwind 工具类替代（2026-11-05 去 Tailwind 专项）
 * 覆盖全站实际用到的 143 个工具类，逐一对齐 Tailwind 默认值。
 * 响应式断点：md=768px，lg=1024px，xl=1280px。 */

/* ===== 显示 ===== */
.block { display: block; }
.hidden { display: none; }
.fixed { position: fixed; }

/* ===== Flex ===== */
.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-start { justify-content: flex-start; }

/* ===== Grid ===== */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.col-span-full { grid-column: 1 / -1; }

/* ===== 间距：gap ===== */
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }

/* ===== 间距：padding ===== */
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-1\.5 { padding-top: 6px; padding-bottom: 6px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.py-10 { padding-top: 40px; padding-bottom: 40px; }
.pt-2 { padding-top: 8px; }
.pb-2 { padding-bottom: 8px; }
.pb-4 { padding-bottom: 16px; }
.pb-6 { padding-bottom: 24px; }
.pl-6 { padding-left: 24px; }

/* ===== 间距：margin ===== */
.mt-2 { margin-top: 8px; }
.mt-5 { margin-top: 20px; }
.mt-3 { margin-top: 12px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

/* ===== 间距：space-y（子元素间距） ===== */
.space-y-1 > * + * { margin-top: 4px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-5 > * + * { margin-top: 20px; }

/* ===== 尺寸：宽 ===== */
.w-4 { width: 16px; }
.w-12 { width: 48px; }
.w-16 { width: 64px; }
.w-20 { width: 80px; }
.w-48 { width: 192px; }
.w-full { width: 100%; }

/* ===== 尺寸：高 ===== */
.h-1\.5 { height: 6px; }
.h-4 { height: 16px; }
.h-6 { height: 24px; }
.h-24 { height: 96px; }
.h-32 { height: 128px; }
.h-full { height: 100%; }
.min-h-0 { min-height: 0; }
.min-h-\[24px\] { min-height: 24px; }
.min-h-\[150px\] { min-height: 150px; }
.min-h-\[180px\] { min-height: 180px; }
.min-h-\[200px\] { min-height: 200px; }
.min-h-\[220px\] { min-height: 220px; }
.min-h-\[350px\] { min-height: 350px; }
.max-h-\[360px\] { max-height: 360px; }
.max-h-\[380px\] { max-height: 380px; }
.max-h-\[420px\] { max-height: 420px; }
.max-h-\[480px\] { max-height: 480px; }

/* ===== 定位 ===== */
.top-20 { top: 80px; }
.right-8 { right: 32px; }

/* ===== 文字：尺寸 ===== */
.text-xs { font-size: 12px; line-height: 16px; }
.text-sm { font-size: 14px; line-height: 20px; }
.text-lg { font-size: 18px; line-height: 28px; }
.text-xl { font-size: 20px; line-height: 28px; }
.text-2xl { font-size: 24px; line-height: 32px; }
.text-3xl { font-size: 30px; line-height: 36px; }
.text-4xl { font-size: 36px; line-height: 40px; }
.text-5xl { font-size: 48px; line-height: 48px; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--twc-font-mono, ui-monospace, monospace); }
.leading-relaxed { line-height: 1.625; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.underline { text-decoration: underline; }

/* ===== 文字/背景颜色（Tailwind 色板值） ===== */
.text-white { color: #fff; }
.text-gray-400 { color: #9ca3af; }
.text-green-700 { color: #15803d; }
.text-red-600 { color: #dc2626; }
.text-zinc-400 { color: #a1a1aa; }
.text-zinc-600 { color: #52525b; }
.text-zinc-800 { color: #27272a; }
.text-zinc-900 { color: #18181b; }
.bg-white { background-color: #fff; }
.bg-blue-50 { background-color: #eff6ff; }

/* ===== 边框 ===== */
.border { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-t-2 { border-top-width: 2px; border-top-style: solid; }
.border-l-2 { border-left-width: 2px; border-left-style: solid; }
.border-dashed { border-style: dashed; }
.border-black { border-color: #000; }
.border-blue-200 { border-color: #bfdbfe; }
.border-gray-300 { border-color: #d1d5db; }
.border-zinc-100 { border-color: #f4f4f5; }

/* ===== 圆角 ===== */
.rounded { border-radius: 4px; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-b-2xl { border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; }
.rounded-full { border-radius: 9999px; }

/* ===== 阴影 ===== */
.shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.shadow-lg { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); }

/* ===== 溢出 ===== */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* ===== 交互 ===== */
.cursor-pointer { cursor: pointer; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }
.disabled\:opacity-50:disabled { opacity: 0.5; }
.duration-300 { transition-duration: 300ms; }
.transition-all { transition-property: all; }
.transform { transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0)); }
.translate-x-full { --tw-translate-x: 100%; transform: translate(100%, 0); }

/* ===== 响应式：md (≥768px) ===== */
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ===== 响应式：lg (≥1024px) ===== */
@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:col-span-1 { grid-column: span 1 / span 1; }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:col-span-3 { grid-column: span 3 / span 3; }
}

/* ===== 响应式：xl (≥1280px) ===== */
@media (min-width: 1280px) {
    .xl\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .xl\:col-span-4 { grid-column: span 4 / span 4; }
    .xl\:col-span-8 { grid-column: span 8 / span 8; }
}

/* ===== 补充：JS 动态生成的类 ===== */
/* 定位 */
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0\.5 { top: 2px; }
.top-1 { top: 4px; }
.left-0 { left: 0; }
.left-0\.5 { left: 2px; }
.left-1 { left: 4px; }
.right-0 { right: 0; }
.right-0\.5 { right: 2px; }
.right-1 { right: 4px; }
.bottom-0 { bottom: 0; }
.z-10 { z-index: 10; }

/* 间距补充 */
.ml-1 { margin-left: 4px; }
.mr-2 { margin-right: 8px; }
.mt-1 { margin-top: 4px; }
.px-1 { padding-left: 4px; padding-right: 4px; }
.px-1\.5 { padding-left: 6px; padding-right: 6px; }
.p-1\.5 { padding: 6px; }
.py-0\.5 { padding-top: 2px; padding-bottom: 2px; }
.gap-0\.5 { gap: 2px; }
.gap-1 { gap: 4px; }

/* 尺寸补充 */
.h-3 { height: 12px; }
.h-3\.5 { height: 14px; }
.h-5 { height: 20px; }
.h-16 { height: 64px; }
.h-40 { height: 160px; }
.h-\[140px\] { height: 140px; }
.w-1 { width: 4px; }
.w-3 { width: 12px; }
.w-3\.5 { width: 14px; }
.w-5 { width: 20px; }
.w-6 { width: 24px; }
.w-\[100px\] { width: 100px; }
.max-w-full { max-width: 100%; }
.max-w-\[100px\] { max-width: 100px; }
.max-h-full { max-height: 100%; }
.min-w-0 { min-width: 0; }

/* 颜色补充 */
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-600 { background-color: #4b5563; }
.bg-black { background-color: #000; }
.bg-black\/60 { background-color: rgba(0, 0, 0, 0.6); }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-600 { background-color: #2563eb; }
.bg-opacity-0 { background-color: transparent; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-blue-600 { color: #2563eb; }
.text-green-500 { color: #22c55e; }
.text-red-500 { color: #ef4444; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-transparent { border-color: transparent; }
.border-b-2 { border-bottom-width: 2px; border-bottom-style: solid; }
.border-l-4 { border-left-width: 4px; border-left-style: solid; }

/* 效果 */
.opacity-0 { opacity: 0; }
.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; }
.transition-opacity { transition-property: opacity; }
.transition-transform { transition-property: transform; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }
.object-contain { object-fit: contain; }
.pointer-events-none { pointer-events: none; }
.animate-spin { animation: twc-spin 1s linear infinite; }
@keyframes twc-spin { to { transform: rotate(360deg); } }
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-\[1\/1\.4\] { aspect-ratio: 1 / 1.4; }
.bg-gradient-to-t { background-image: linear-gradient(to top, var(--tw-gradient-stops)); }
.from-black\/70 { --tw-gradient-from: rgba(0, 0, 0, 0.7); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(0, 0, 0, 0)); }
.from-black\/80 { --tw-gradient-from: rgba(0, 0, 0, 0.8); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(0, 0, 0, 0)); }
.to-transparent { --tw-gradient-to: transparent; }

/* Hover 态 */
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-gray-200:hover { background-color: #e5e7eb; }
.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:bg-red-100:hover { background-color: #fee2e2; }
.hover\:border-blue-400:hover { border-color: #60a5fa; }
.hover\:border-gray-300:hover { border-color: #d1d5db; }
.hover\:border-red-300:hover { border-color: #fca5a5; }
.hover\:shadow-sm:hover { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.hover\:text-blue-300:hover { color: #93c5fd; }
.hover\:text-blue-600:hover { color: #2563eb; }
.hover\:text-red-300:hover { color: #fca5a5; }
.hover\:text-red-500:hover { color: #ef4444; }
.hover\:text-red-600:hover { color: #dc2626; }
.hover\:-translate-y-0\.5:hover { transform: translateY(-2px); }
.group:hover .group-hover\:bg-opacity-30 { background-color: rgba(0, 0, 0, 0.3); }
.group:hover .group-hover\:opacity-100 { opacity: 1; }
.group:hover .group-hover\:scale-105 { transform: scale(1.05); }
