/* =========================================================
   tailwind-utilities.css
   —— 本地手写的 Tailwind 工具类子集，用于替代生产环境不推荐的
      https://cdn.tailwindcss.com 运行时 CDN。

   说明：
   - 只实现本项目 HTML 与 JS 模板中实际用到的工具类（精简、无冗余），
     因此新增用到的类需要在这里补充对应规则。
   - 自定义主题色沿用原 tailwind.config：
       primary   #3A70EE   secondary #6366F1
       darkText  #1F2937   grayText  #6B7280
       cardBg / lightBg #F8FAFC
   - 断点与官方一致：sm≥640 / md≥768 / lg≥1024 / xl≥1280
   - Font Awesome（fa/fas/fab/fa-*）与项目自有组件类（btn-*, card-* 等）
     不在此文件，分别由 Font Awesome 与 common.css / style.css 提供。
   ========================================================= */

:root {
    --tw-primary: #3A70EE;
    --tw-secondary: #6366F1;
    --tw-darkText: #1F2937;
    --tw-grayText: #6B7280;
    --tw-lightBg: #F8FAFC;
}

/* ---------- Preflight（精简版）----------
   还原原 CDN 版 Tailwind 的基础重置中本项目所依赖的部分：
   标题/段落去除默认外边距与粗细、列表去点、媒体块级化、表单继承字体。
   （box-sizing / body 字体等已在 common.css 全局重置中处理。） */
h1, h2, h3, h4, h5, h6 { margin: 0; font-size: inherit; font-weight: inherit; }
p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video, canvas { display: block; vertical-align: middle; }
img, video { max-width: 100%; height: auto; }
button, input, select, textarea { font-family: inherit; font-size: 100%; color: inherit; margin: 0; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: inherit; text-decoration: inherit; }

/* ---------- Display ---------- */
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }

/* ---------- Position ---------- */
.static { position: static; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.bottom-6 { bottom: 1.5rem; }
.right-6 { right: 1.5rem; }

/* ---------- Z-index ---------- */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }

/* ---------- Flex / Grid layout ---------- */
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.shrink-0 { flex-shrink: 0; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-items-center { justify-items: center; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Gap ---------- */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-10 { gap: 2.5rem; }
.gap-12 { gap: 3rem; }
.gap-x-4 { column-gap: 1rem; }
.gap-x-12 { column-gap: 3rem; }
.gap-y-4 { row-gap: 1rem; }
.gap-y-8 { row-gap: 2rem; }

/* ---------- Space between (child margins) ---------- */
.space-x-4 > :not([hidden]) ~ :not([hidden]) { margin-left: 1rem; }
.space-x-9 > :not([hidden]) ~ :not([hidden]) { margin-left: 2.25rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-y-8 > :not([hidden]) ~ :not([hidden]) { margin-top: 2rem; }

/* ---------- Sizing ---------- */
.w-2 { width: 0.5rem; }
.w-14 { width: 3.5rem; }
.w-full { width: 100%; }
.w-\[160px\] { width: 160px; }
.h-2 { height: 0.5rem; }
.h-14 { height: 3.5rem; }
.h-20 { height: 5rem; }
.h-24 { height: 6rem; }
.h-48 { height: 12rem; }
.h-72 { height: 18rem; }
.h-full { height: 100%; }
.h-\[320px\] { height: 320px; }
.max-h-14 { max-height: 3.5rem; }
.max-h-80 { max-height: 20rem; }
.max-w-none { max-width: none; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-7xl { max-width: 80rem; }
.aspect-square { aspect-ratio: 1 / 1; }

/* ---------- Margin ---------- */
.mx-auto { margin-left: auto; margin-right: auto; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.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; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-20 { margin-bottom: 5rem; }
.ml-1 { margin-left: 0.25rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }

/* ---------- Padding ---------- */
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-14 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-6 { padding-top: 1.5rem; }
.pt-20 { padding-top: 5rem; }
.pb-16 { padding-bottom: 4rem; }
.pl-1 { padding-left: 0.25rem; }
.pl-6 { padding-left: 1.5rem; }

/* ---------- Typography ---------- */
.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-\[clamp\(1\.7rem\,2\.8vw\,2\.3rem\)\] { font-size: clamp(1.7rem, 2.8vw, 2.3rem); }
.text-\[clamp\(1\.8rem\,3vw\,2\.4rem\)\] { font-size: clamp(1.8rem, 3vw, 2.4rem); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }

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

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.list-disc { list-style-type: disc; }

/* ---------- Text colors ---------- */
.text-white { color: #fff; }
.text-white\/90 { color: rgba(255, 255, 255, 0.9); }
.text-primary { color: var(--tw-primary); }
.text-darkText { color: var(--tw-darkText); }
.text-grayText { color: var(--tw-grayText); }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: rgba(0, 0, 0, 0.88); }
.text-blue-700 { color: #1d4ed8; }
.text-cyan-700 { color: #0e7490; }
.text-teal-700 { color: #0f766e; }
.text-orange-700 { color: #c2410c; }

/* ---------- Background colors ---------- */
.bg-white { background-color: #fff; }
.bg-white\/20 { background-color: rgba(255, 255, 255, 0.2); }
.bg-white\/70 { background-color: rgba(255, 255, 255, 0.7); }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-green-500 { background-color: #22c55e; }
.bg-primary { background-color: var(--tw-primary); }
.bg-primary\/10 { background-color: rgba(58, 112, 238, 0.1); }
.bg-primary\/60 { background-color: rgba(58, 112, 238, 0.6); }
.bg-lightBg { background-color: var(--tw-lightBg); }
.bg-\[\#f3f4fc\] { background-color: #f3f4fc; }

/* ---------- Gradients ---------- */
.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--tw-gradient-from, transparent), var(--tw-gradient-to, transparent));
}
.bg-gradient-to-b {
    background-image: linear-gradient(to bottom, var(--tw-gradient-from, transparent), var(--tw-gradient-to, transparent));
}
.from-primary { --tw-gradient-from: var(--tw-primary); }
.from-blue-50\/50 { --tw-gradient-from: rgba(239, 246, 255, 0.5); }
.to-secondary { --tw-gradient-to: var(--tw-secondary); }
.to-white { --tw-gradient-to: #fff; }

/* ---------- Borders ---------- */
.border { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-gray-100 { border-color: #f3f4f6; }
.border-primary { border-color: var(--tw-primary); }
.border-primary\/30 { border-color: rgba(58, 112, 238, 0.3); }
.border-white\/60 { border-color: rgba(255, 255, 255, 0.6); }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* ---------- Effects ---------- */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.backdrop-blur-sm { backdrop-filter: blur(4px); }

/* ---------- Object fit ---------- */
.object-contain { object-fit: contain; }
.object-cover { object-fit: cover; }

/* ---------- Overflow ---------- */
.overflow-hidden { overflow: hidden; }

/* ---------- Misc ---------- */
/* Tailwind 默认 container：宽度 100%，并在各断点处封顶最大宽度 */
.container { width: 100%; }
@media (min-width: 640px) { .container { max-width: 640px; } }
@media (min-width: 768px) { .container { max-width: 768px; } }
@media (min-width: 1024px) { .container { max-width: 1024px; } }
@media (min-width: 1280px) { .container { max-width: 1280px; } }
@media (min-width: 1536px) { .container { max-width: 1536px; } }
.cursor-pointer { cursor: pointer; }
.transition-all { padding: 10px 20px; transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-shadow { transition-property: box-shadow; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.animate-pulse { animation: tw-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-fade-in-up { animation: tw-fade-in-up 0.6s ease both; }

@keyframes tw-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@keyframes tw-fade-in-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Typography plugin (prose) —— 已弃用，富文本样式由 quill.css 接管 ---------- */

/* ---------- Hover states ---------- */
.hover\:bg-primary:hover { background-color: var(--tw-primary); }
.hover\:bg-primary\/5:hover { background-color: rgba(58, 112, 238, 0.05); }
.hover\:bg-secondary:hover { background-color: var(--tw-secondary); }
.hover\:bg-white\/30:hover { background-color: rgba(255, 255, 255, 0.3); }
.hover\:text-primary:hover { color: var(--tw-primary); }
.hover\:text-white:hover { color: #fff; }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.hover\:shadow-lg:hover { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }
.hover\:shadow-primary\/30:hover { box-shadow: 0 10px 25px -5px rgba(58, 112, 238, 0.3); }

/* =========================================================
   Responsive —— 与 Tailwind 官方断点一致
   sm ≥640 / md ≥768 / lg ≥1024 / xl ≥1280
   ========================================================= */
@media (min-width: 640px) {
    .sm\:block { display: block; }
    .sm\:flex-row { flex-direction: row; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:w-72 { width: 18rem; }
}

@media (min-width: 768px) {
    .md\:col-span-2 { grid-column: span 2 / span 2; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:h-\[420px\] { height: 420px; }
    .md\:mb-14 { margin-bottom: 3.5rem; }
    .md\:p-10 { padding: 2.5rem; }
    .md\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .md\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .md\:py-20 { padding-top: 5rem; padding-bottom: 5rem; }
    .md\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
    .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .md\:text-5xl { font-size: 3rem; line-height: 1; }
}

@media (min-width: 1024px) {
    .lg\:flex { display: flex; }
    .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-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .lg\:text-5xl { font-size: 3rem; line-height: 1; }
    .lg\:text-6xl { font-size: 3.75rem; line-height: 1; }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
