/* 基础与变量 */
:root {
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1f2937;
  --ring: #3b82f6;
}
html, body { min-height: 100%; }
body { font-family: Inter, system-ui, sans-serif; color: #0f172a; background-color: #ffffff; }

/* 按钮 */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.5rem 1rem; border-radius: 0.375rem;
  background-color: var(--brand-600); color: #ffffff;
  font-size: 0.875rem; font-weight: 600; text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background-color .2s ease, box-shadow .2s ease;
}
.btn-primary:hover { background-color: var(--brand-700); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.5rem 1rem; border-radius: 0.375rem;
  background-color: #ffffff; color: #0f172a;
  border: 1px solid var(--slate-300);
  font-size: 0.875rem; font-weight: 600; text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease;
}
.btn-secondary:hover { background-color: var(--slate-50); }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.5rem 1rem; border-radius: 0.375rem;
  background-color: #ffffff; color: #0f172a;
  border: 1px solid var(--slate-200);
  font-size: 0.875rem; text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease;
}
.btn-ghost:hover { background-color: var(--slate-50); }

.btn-icon { padding: 0.5rem; border-radius: 0.375rem; background: transparent; }
.btn-icon:hover { background: var(--slate-100); }

/* 标题与卡片 */
.section-title { font-size: 1.25rem; font-weight: 700; line-height: 1.75rem; }
.card { padding: 1.5rem; border-radius: 0.75rem; border: 1px solid var(--slate-200); background-color: #ffffff; }
.card-title { font-weight: 600; color: #0f172a; }
.card-desc { font-size: 0.875rem; color: #475569; margin-top: 0.25rem; }
.icon-circle { width: 2.5rem; height: 2.5rem; border-radius: 9999px; background: var(--slate-100); display: flex; align-items: center; justify-content: center; color: var(--brand-600); }
.case-card { border-radius: 0.75rem; border: 1px solid var(--slate-200); overflow: hidden; background: #ffffff; box-shadow: 0 1px 2px rgba(0,0,0,0.05); display: flex; flex-direction: column; height: 100%; }
.case-cover { width: 100%; height: 11rem; object-fit: cover; display: block; }
.case-card .p-4 { display: flex; flex-direction: column; height: 100%; }
.case-card .p-4 a.btn-ghost { margin-top: auto; }

/* 表单 */
.form-label { display: block; font-size: 0.875rem; font-weight: 500; color: #334155; margin-bottom: 0.25rem; }
.form-input, .form-textarea {
  width: 100%; border-radius: 0.375rem; border: 1px solid var(--slate-300);
  padding: 0.5rem 0.75rem; font-size: 0.875rem; line-height: 1.25rem;
  color: #0f172a; background-color: #ffffff; outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-input::placeholder, .form-textarea::placeholder { color: #94a3b8; }
.form-input:focus, .form-textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.3);
}

/* 弹窗 */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.modal-panel { position: relative; z-index: 10; width: 100%; max-width: 28rem; border-radius: 0.75rem; background: #ffffff; padding: 1.5rem; box-shadow: 0 10px 15px rgba(0,0,0,0.1); border: 1px solid var(--slate-200); }

/* 标签 */
.chip { display: inline-flex; align-items: center; padding: 0.25rem 0.625rem; border-radius: 9999px; border: 1px solid var(--slate-300); font-size: 0.75rem; }
.chip-good { border-color: #86efac; color: #166534; background: #f0fdf4; }
.chip-mid { border-color: #fcd34d; color: #92400e; background: #fffbeb; }
.chip-bad { border-color: var(--slate-300); color: #334155; background: #f8fafc; }

/* 微交互 */
.me-2 { margin-inline-end: 0.5rem; }

/* Tooltip for author hover */
.author-name { position: relative; cursor: pointer; }
.tooltip-card {
  position: absolute; z-index: 30; top: 100%; left: 0;
  transform: translateY(0.25rem);
  background: #ffffff; color: #0f172a;
  border: 1px solid var(--slate-200);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  min-width: 14rem;
}
.tooltip-title { font-weight: 600; margin-bottom: 0.25rem; }
.tooltip-row { font-size: 0.8125rem; color: var(--slate-700); }
.tooltip-value { font-weight: 600; color: var(--brand-600); }