/* ===========================================================
   Tailwind Preflight（精简版）
   -----------------------------------------------------------
   ★ 为什么需要它：
   Tailwind 的 preflight 提供了 box-sizing / margin 归零 / 按钮与表单元素重置。
   本项目的 style.css 依赖这些基础重置，所以本地兜底样式必须一并提供，
   否则在 CDN 不可用时会出现「每边多 8px 边距、按钮带原生边框」等问题。

   规则与 Tailwind 官方 preflight 保持一致，
   这样 CDN 加载成功后再叠加也不会有任何差异（幂等）。
   =========================================================== */

*,
::before,
::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: #e5e7eb;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

body {
  margin: 0;
  line-height: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

p, figure, blockquote, dl, dd, pre {
  margin: 0;
}

ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: inherit;
}

b, strong {
  font-weight: bolder;
}

small {
  font-size: 80%;
}

button, input, optgroup, select, textarea {
  font-family: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

button, select {
  text-transform: none;
}

button,
[type='button'],
[type='reset'],
[type='submit'] {
  -webkit-appearance: button;
  background-color: transparent;
  background-image: none;
  cursor: pointer;
}

input::placeholder,
textarea::placeholder {
  opacity: 1;
  color: #9ca3af;
}

img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  vertical-align: middle;
}

img, video {
  max-width: 100%;
  height: auto;
}

table {
  border-collapse: collapse;
  border-color: inherit;
  text-indent: 0;
}

hr {
  height: 0;
  color: inherit;
  border-top-width: 1px;
}

/* ===== preflight 结束 ===== */

/* ===========================================================
   tailwind-lite.css —— Tailwind 工具类兜底样式
   -----------------------------------------------------------
   本项目正常通过 cdn.tailwindcss.com 加载 Tailwind。
   但在「内网部署」或「CDN 被墙/被拦」的情况下，页面会完全失去样式。

   这个文件只实现本项目实际用到的那些工具类（共约 95 个 + 17 个响应式变体），
   在 CDN 不可用时由页面注入，保证布局仍然可用（不追求与 CDN 像素级一致）。

   断点与 Tailwind 默认一致：sm 640px / md 768px / lg 1024px
   =========================================================== */

/* ---------- 布局 ---------- */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none; }
.absolute { position: absolute; }
.relative { position: relative; }
.inset-0 { inset: 0; }
.z-10 { z-index: 10; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ---------- 尺寸 ---------- */
.w-full { width: 100%; }
.h-full { height: 100%; }
.w-1\.5 { width: 0.375rem; }
.w-2 { width: 0.5rem; }
.w-9 { width: 2.25rem; }
.h-1\.5 { height: 0.375rem; }
.h-2 { height: 0.5rem; }
.h-9 { height: 2.25rem; }
.min-h-screen { min-height: 100vh; }
.max-w-md { max-width: 28rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-\[1400px\] { max-width: 1400px; }

/* ---------- 内边距 ---------- */
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-7 { padding: 1.75rem; }
.p-8 { padding: 2rem; }
.p-12 { padding: 3rem; }
.px-1\.5 { padding-left: 0.375rem; padding-right: 0.375rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.pt-10 { padding-top: 2.5rem; }
.pb-6 { padding-bottom: 1.5rem; }
.pb-16 { padding-bottom: 4rem; }

/* ---------- 外边距 ---------- */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-7 { margin-top: 1.75rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }
.mt-14 { margin-top: 3.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-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }

/* ---------- 间距 ---------- */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* ---------- 文字 ---------- */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-white { color: #fff; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-800 { color: #1f2937; }
.text-red-600 { color: #dc2626; }

/* ---------- 圆角 / 边框 / 透明度 ---------- */
.rounded { border-radius: 0.25rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-gray-200\/70 { border-color: rgba(229, 231, 235, 0.7); }
.opacity-0 { opacity: 0; }
.opacity-60 { opacity: 0.6; }

/* ---------- group-hover ---------- */
.group:hover .group-hover\:opacity-100 { opacity: 1; }

/* ===========================================================
   响应式（sm 640px 起）
   =========================================================== */
@media (min-width: 640px) {
  .sm\:flex-row { flex-direction: row; }
  .sm\:items-end { align-items: flex-end; }
  .sm\:justify-between { justify-content: space-between; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* ★★ v2.728：补上 sm:p-4 / sm:p-5（扫描发现"用了但没定义"）
     ------------------------------------------------------------
     🔴 4 个页面在用这两个类，但样式表里【没有定义】：
          work.html            p-3 sm:p-4
          edit / index / shop  sm:p-5
        ⇒ 640px 以上它们不会放大内边距，页面比设计的紧一档。
     ⚠️ 这类"用了但没定义"的工具类【不报错、不影响功能】，
        只是悄悄少一层间距 ⇒ 只能靠全站扫描发现（我 v2.728 扫出来的）。
     ★ 取值对齐 Tailwind 官方刻度：4 = 1rem，5 = 1.25rem。
     ⚠️ 放在 sm:p-6 之前，和文件里已有的顺序一致（从小到大）。 */
  .sm\:p-4 { padding: 1rem; }
  .sm\:p-5 { padding: 1.25rem; }
  .sm\:p-6 { padding: 1.5rem; }
  .sm\:p-9 { padding: 2.25rem; }
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:text-base { font-size: 1rem; line-height: 1.5rem; }
  .sm\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
  .sm\:text-5xl { font-size: 3rem; line-height: 1; }
}

/* 响应式（md 768px 起） */
@media (min-width: 768px) {
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, 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)); }
}

/* 兜底：让带响应式前缀的 grid 在窄屏默认单列，避免挤在一起 */
.grid-cols-2 > *,
.sm\:grid-cols-2 > *,
.sm\:grid-cols-3 > *,
.md\:grid-cols-3 > *,
.md\:grid-cols-4 > *,
.lg\:grid-cols-2 > *,
.lg\:grid-cols-3 > *,
.lg\:grid-cols-4 > * {
  min-width: 0;
}

/* 补充：setup.html 用到 */
.pt-5 { padding-top: 1.25rem; }

