/* =========================================================================
 * tw.css  —  Tailwind 工具类的本地替代实现（自包含，无需 CDN / 联网）
 * 只实现本应用实际用到的类，保证离线、单文件即可完整显示。
 * ========================================================================= */

/* ---------- 基础 ---------- */
body {
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #fffbeb;
  color: #292524;
  margin: 0;
  -webkit-text-size-adjust: 100%;
}
input, textarea, button { font-family: inherit; font-size: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- 布局 ---------- */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.inline-block { display: inline-block; }
.block { display: block; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1 1 0%; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 640px) {
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@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)); }
}
.gap-2 { gap: .5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* ---------- 尺寸 ---------- */
.w-full { width: 100%; }
.w-24 { width: 6rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ---------- 间距 ---------- */
.p-3 { padding: .75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: .5rem; padding-right: .5rem; }
.px-3 { padding-left: .75rem; padding-right: .75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: .25rem; padding-bottom: .25rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-3 { padding-top: .75rem; padding-bottom: .75rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.space-y-1 > * + * { margin-top: .25rem; }
.space-y-2 > * + * { margin-top: .5rem; }
.space-y-3 > * + * { margin-top: .75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-10 > * + * { margin-top: 2.5rem; }

/* ---------- 排版 ---------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: .875rem; line-height: 1.25rem; }
.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.1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }

/* ---------- 颜色 ---------- */
.text-white { color: #fff; }
.text-primary { color: #f59e0b; }
.text-accent { color: #ec4899; }
.text-muted-foreground { color: #78716c; }
.text-foreground { color: #292524; }
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }
.text-green-600 { color: #16a34a; }
.bg-card { background-color: #fff; }
.bg-muted { background-color: #f5f5f4; }
.bg-primary { background-color: #f59e0b; }
.bg-accent { background-color: #ec4899; }
.bg-primary\/10 { background-color: rgba(245, 158, 11, .1); }
.bg-accent\/10 { background-color: rgba(236, 72, 153, .1); }
.bg-gradient-to-br {
  background-image: linear-gradient(to bottom right, #fffbeb, #fffbeb, rgba(252, 211, 77, .18));
}

/* ---------- 边框 / 圆角 / 阴影 ---------- */
.border { border-width: 1px; border-style: solid; }
.border-border { border-color: #e7e5e4; }
.border-secondary { border-color: #fcd34d; }
.rounded-lg { border-radius: .5rem; }
.rounded-xl { border-radius: .75rem; }
.rounded-full { border-radius: 9999px; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); }

/* ---------- 交互 ---------- */
.cursor-pointer { cursor: pointer; }
.transition-shadow { transition: box-shadow .15s ease; }
.transition-colors { transition: background-color .15s ease, color .15s ease; }
.hover\:opacity-90:hover { opacity: .9; }
.hover\:bg-muted:hover { background-color: #f5f5f4; }
.hover\:shadow-lg:hover { box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); }
.hover\:text-foreground:hover { color: #292524; }
.group:hover .group-hover\:bg-primary\/20 { background-color: rgba(245, 158, 11, .2); }
.group:hover .group-hover\:bg-accent\/20 { background-color: rgba(236, 72, 153, .2); }
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(245, 158, 11, .55); }

/* ---------- 表单控件外观 ---------- */
input[type="text"], input[type="number"], input:not([type]), textarea {
  box-sizing: border-box;
  background: #fff;
  color: #292524;
}
button:disabled { cursor: default; }
