/* 统一 UI 规范（09）手写子集：根字号 16px、最小字号 12px、indigo-600 主色、slate 配色、rounded-xl */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; line-height: 1.5; }
h1, h2, p { margin: 0; }
.font-sans { font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
.font-mono { font-family: ui-monospace, Consolas, monospace; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-base { font-size: 16px; }
.text-xl { font-size: 20px; }
.leading-6 { line-height: 1.5rem; }
.break-all { word-break: break-all; }
.text-left { text-align: left; }
.text-center { text-align: center; }

.bg-slate-50 { background: #f8fafc; }
.text-slate-800 { color: #1e293b; }
.text-slate-700 { color: #334155; }
.text-slate-600 { color: #475569; }
.text-slate-500 { color: #64748b; }
.text-slate-400 { color: #94a3b8; }
.border-b { border-bottom: 1px solid; }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-100 { border-color: #f1f5f9; }

.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.w-full { width: 100%; }
.h-16 { height: 4rem; }
.max-w-6xl { max-width: 72rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.hidden { display: none; }
.overflow-x-auto { overflow-x: auto; }
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* 顶栏与图标块 */
.topbar { background: #fff; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; height: 4rem; z-index: 10; }
.logo { width: 32px; height: 32px; border-radius: 0.75rem; background: #4f46e5; color: #fff; font-weight: 700;
  font-size: 14px; display: flex; align-items: center; justify-content: center; }
.icon-block { width: 48px; height: 48px; border-radius: 0.75rem; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 20px; }
.icon-indigo, .icon-slate { background: #eef2ff; color: #4f46e5; }
.icon-red { background: #fef2f2; color: #ef4444; }
.icon-amber { background: #fffbeb; color: #d97706; }

/* 卡片 */
.card { background: #fff; padding: 1.25rem; border-radius: 0.75rem; border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.login-card { max-width: 28rem; margin: 3rem auto; padding: 1.5rem; background: #fff; border-radius: 1rem;
  border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.alert-box { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 0.75rem;
  padding: 0.75rem; font-size: 14px; font-weight: 700; }
.result { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; border-radius: 0.75rem; padding: 0.75rem;
  font-size: 12px; word-break: break-all; }

/* 按钮与表单 */
.btn-primary { background: #4f46e5; color: #fff; font-weight: 700; padding: 0.625rem 0.875rem; border-radius: 0.75rem;
  font-size: 12px; border: 0; cursor: pointer; box-shadow: 0 4px 6px -1px #e0e7ff; }
.btn-primary:hover { background: #4338ca; }
.btn-secondary { border: 1px solid #c7d2fe; background: #eef2ff; color: #4f46e5; font-weight: 700;
  padding: 0.625rem 0.875rem; border-radius: 0.75rem; font-size: 12px; cursor: pointer; }
.btn-secondary:hover { background: #e0e7ff; }
.btn-danger { background: #ef4444; color: #fff; font-weight: 700; padding: 0.625rem 0.875rem; border-radius: 0.75rem;
  font-size: 12px; border: 0; cursor: pointer; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.pill { font-size: 12px; padding: 0.25rem 0.625rem; border-radius: 9999px; font-weight: 700; border: 1px solid;
  cursor: pointer; white-space: nowrap; }
.pill-amber { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.pill-red { background: #fef2f2; color: #ef4444; border-color: #fecaca; }
.pill-emerald { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.link { font-size: 12px; color: #4f46e5; font-weight: 600; text-decoration: none; background: none; border: 0;
  cursor: pointer; }
.link:hover { text-decoration: underline; }
.link-danger:hover { color: #ef4444; }
.input { width: 100%; padding: 0.625rem 0.875rem; border-radius: 0.75rem; border: 1px solid #e2e8f0; font-size: 12px;
  font-family: inherit; background: #fff; color: #1e293b; }
.input:hover { border-color: #cbd5e1; }
.input:focus { outline: none; box-shadow: 0 0 0 2px #6366f1; }
.label { display: block; font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 0.25rem; }

/* 表格 */
.table { border-collapse: collapse; }
.bg-slate-50 th { background: #f8fafc; }
thead.border-b { border-bottom: 1px solid #e2e8f0; }

/* TAB */
.tabs { display: flex; gap: 0.375rem; overflow-x: auto; background: #fff; padding: 0.375rem; border-radius: 1rem;
  border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); position: sticky; top: 4.5rem; }
.tab { font-size: 12px; font-weight: 700; padding: 0.5rem 0.875rem; border-radius: 0.75rem; color: #475569;
  text-decoration: none; white-space: nowrap; }
.tab:hover { background: #f1f5f9; }
.tab-active, .tab-active:hover { background: #4f46e5; color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }

/* 徽标 */
.badge { font-size: 12px; padding: 0.125rem 0.5rem; border-radius: 9999px; font-weight: 700; border: 1px solid; }
.badge-emerald { color: #059669; background: #ecfdf5; border-color: #a7f3d0; }
.badge-amber { color: #d97706; background: #fffbeb; border-color: #fde68a; }
.badge-red { color: #ef4444; background: #fef2f2; border-color: #fecaca; }
.badge-slate { color: #475569; background: #f8fafc; border-color: #e2e8f0; }

/* toast */
.toast { position: fixed; bottom: 1.25rem; right: 1.25rem; padding: 0.625rem 1rem; border-radius: 0.75rem;
  font-size: 12px; font-weight: 500; color: #fff; background: #1e293b;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); animation: toast-in 0.25s ease-out; }
.toast-ok { background: #059669; }
.toast-err { background: #ef4444; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; }
