/* ============================================================
   tw-compat.css — Tailwind 工具类兼容层
   站点迁移时放弃了 Tailwind，但组件模板仍保留了
   Tailwind 工具类（flex / grid / gap / p-* / text-* / mb-* 等）。
   此文件仅提供这些被使用到的工具类的等价 CSS，
   不引入任何 Tailwind 框架依赖。
   默认深色（与 plume 的 html.dark 一致），并提供浅色覆盖。
   ============================================================ */

/* ---------- 显示 / 定位 ---------- */
.block { display: block; }
.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.grid { display: grid; }
.relative { position: relative; }
.z-10 { z-index: 10; }
.w-full { width: 100%; }
.w-5 { width: 1.25rem; }

/* ---------- 间距：内边距 ---------- */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pt-24 { padding-top: 6rem; }
.pb-24 { padding-bottom: 6rem; }
.pl-5 { padding-left: 1.25rem; }

/* ---------- 间距：外边距 ---------- */
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.ml-auto { margin-left: auto; }
.mr-1 { margin-right: 0.25rem; }

/* ---------- Flex / Grid 对齐 ---------- */
.gap { gap: 0.5rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

/* ---------- 网格列 / 跨列 ---------- */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.col-span-1 { grid-column: span 1 / span 1; }

/* ---------- 纵向间距（space-y-*） ---------- */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }

/* ---------- 字体 ---------- */
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-center { text-align: center; }
.text-4xl { font-size: 2.25rem; line-height: 1.1; }
.text-lg { font-size: 1.125rem; line-height: 1.5; }
.text-xl { font-size: 1.25rem; line-height: 1.5; }
.text-sm { font-size: 0.875rem; line-height: 1.5; }
.text-xs { font-size: 0.75rem; line-height: 1.4; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }

/* ---------- 文字颜色（深色默认） ---------- */
.text-white { color: #ffffff; }
.text-white\/80 { color: rgba(255, 255, 255, 0.8); }
.text-white\/70 { color: rgba(255, 255, 255, 0.7); }
.text-white\/60 { color: rgba(255, 255, 255, 0.6); }
.text-white\/50 { color: rgba(255, 255, 255, 0.5); }
.text-white\/40 { color: rgba(255, 255, 255, 0.4); }
.text-white\/30 { color: rgba(255, 255, 255, 0.3); }
.text-white\/20 { color: rgba(255, 255, 255, 0.2); }
.text-accent { color: #345eef; }

/* ---------- 圆角 ---------- */
.rounded-2xl { border-radius: 1rem; }
.rounded-xl { border-radius: 0.75rem; }

/* ---------- 最大宽度 ---------- */
.max-w-2xl { max-width: 42rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-7xl { max-width: 80rem; }

/* ---------- 自定义组件类（跨组件复用，原 Tailwind 之外的项目类） ---------- */
.block-section { margin-bottom: 3rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }

/* ============================================================
   响应式（lg ≥ 1024px / md ≥ 768px / sm ≥ 640px）
   ============================================================ */
@media (min-width: 640px) {
  .sm\:flex-row { flex-direction: row; }
}
@media (min-width: 768px) {
  .md\:text-5xl { font-size: 3rem; line-height: 1.1; }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
}

/* ============================================================
   浅色模式覆盖（plume 通过 html[data-theme="light"] 标记）
   ============================================================ */
html[data-theme="light"] body { color: #1A1A1A; }
html[data-theme="light"] .text-white,
html[data-theme="light"] .text-white\/80,
html[data-theme="light"] .text-white\/70,
html[data-theme="light"] .text-white\/60,
html[data-theme="light"] .text-white\/50 { color: #1A1A1A !important; }
html[data-theme="light"] .text-white\/40 { color: #666 !important; }
html[data-theme="light"] .text-white\/30 { color: #888 !important; }
html[data-theme="light"] .text-white\/20 { color: #aaa !important; }
html[data-theme="light"] .text-accent { color: #345eef; }
html[data-theme="light"] .block-section { color: #1A1A1A; }
