:root {
  --primary: #4f6df5;
  --primary-dark: #3a55d6;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2430;
  --text-muted: #7a8299;
  --border: #e6eaf3;
  --radius: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- header ---------- */
.page-header {
  background: linear-gradient(135deg, #3d5ae0 0%, #6a63e8 55%, #9a63ec 100%);
  color: #fff;
  text-align: center;
  padding: 36px 20px 44px;
}

.site-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
}

.site-subtitle {
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.85;
}

/* ---------- category tabs ---------- */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: -26px 16px 0;
  padding: 8px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(31, 36, 48, 0.14);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex-shrink: 0;
  padding: 9px 18px;
  border: none;
  border-radius: 10px;
  background: #eef0f6;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.category-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 109, 245, 0.4);
}

/* ---------- content ---------- */
.content-wrap {
  flex: 1;
  padding: 20px 16px 32px;
}

.detail {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 20px;
  min-height: 260px;
  box-shadow: 0 4px 16px rgba(31, 36, 48, 0.06);
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail h1, .detail h2, .detail h3 {
  margin: 1.1em 0 0.5em;
  line-height: 1.4;
}

.detail h1:first-child, .detail h2:first-child, .detail h3:first-child {
  margin-top: 0;
}

.detail p {
  margin: 0.7em 0;
}

.detail img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
  margin: 0.8em 0;
}

.detail ul, .detail ol {
  padding-left: 1.4em;
  margin: 0.7em 0;
}

.detail blockquote {
  margin: 0.8em 0;
  padding: 10px 14px;
  border-left: 4px solid var(--primary);
  background: #f0f3ff;
  border-radius: 6px;
  color: var(--text-muted);
}

.detail code {
  background: #eef1f8;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.detail pre {
  background: #1f2430;
  color: #e8ecf7;
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0.8em 0;
}

.detail pre code {
  background: transparent;
  padding: 0;
}

.loading, .error {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 0;
}

.error {
  color: #d9534f;
}

/* ---------- footer ---------- */
.page-footer {
  text-align: center;
  padding: 18px;
  font-size: 12px;
  color: var(--text-muted);
}
