: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: 22px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* ---------- category tabs ---------- */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: -26px 16px 0;
  padding: 8px;
  background: var(--card);
  border-radius: 16px;
  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;
}

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

.detail {
  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: 0;
  display: block;
  margin: 0;
}

/* 只含图片的段落间距也归零，保证连续截图之间无缝 */
.detail p:has(> img) {
  margin: 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);
}

/* ---------- 首页：轮播 ---------- */
.carousel {
  position: relative;
  overflow: hidden;
  background: #e8ecf7;
}

.carousel-track {
  display: flex;
  transition: transform 0.4s ease;
}

.carousel-slide {
  flex: 0 0 100%;
}

.carousel-slide img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all 0.2s ease;
}

.carousel-dot.active {
  background: #fff;
  transform: scale(1.25);
}

/* ---------- 首页：区块标题 ---------- */
.section {
  padding: 22px 16px 6px;
}

.section-title {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

/* ---------- 首页：一级分类导航（一行最多 3 个） ---------- */
.group-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 14px;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 8px;
  max-width: 400px;
  margin: 0 auto;
}

.group-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
}

.group-card:active {
  transform: scale(0.95);
}

.group-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f6df5 0%, #9a63ec 100%);
  color: #fff;
  font-size: 34px;
  font-weight: 600;
}

.group-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.group-name {
  font-size: 14px;
  color: var(--text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 首页：下单须知 ---------- */
.notice-content {
  margin-bottom: 12px;
}

.empty-tip {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
}
