/* ============ 基础与配色（对齐 rightforai 主题） ============ */
:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Noto Sans", sans-serif;
  --brand: #6654d9;
  --brand-strong: #5140b5;
  --brand-soft: #f3f0fc;
  --ink: #202124;
  --ink-soft: #55565d;
  --ink-faint: #71717a;
  --line: #e7e7eb;
  --bg-soft: #f7f7f8;
  --radius: 8px;
  --content: 1280px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.03);
  --shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 6px 20px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: #fff;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }
a, button, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
::selection { background: #e8e2fa; }
h1, h2, h3 { font-weight: 500; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ 站点导航 ============ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 2rem;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  min-height: 64px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-brand {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.site-brand span { color: var(--brand); }

.site-links {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
}
.site-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  transition: color 0.15s;
}
.site-links a:hover { color: var(--ink); text-decoration: none; }
.site-links a.active { color: var(--brand); font-weight: 500; }

/* ============ Hero ============ */
.hero-wrap {
  background:
    radial-gradient(1100px 420px at 12% -20%, rgba(102, 84, 217, 0.10), transparent 62%),
    radial-gradient(800px 320px at 90% -30%, rgba(16, 185, 129, 0.06), transparent 60%),
    #fff;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: 2.75rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 2rem;
  align-items: center;
}

.hero-eyebrow {
  grid-column: 1 / -1;
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

.hero-title {
  grid-column: 1;
  margin: 0 0 0.75rem;
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.35;
  color: var(--ink);
  text-wrap: balance;
}
.hero-title .accent { color: var(--brand); }

.hero-copy {
  grid-column: 1;
  margin: 0;
  max-width: 720px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.8;
}

.hero-actions {
  grid-column: 2;
  grid-row: 2 / 4;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0;
  text-align: center;
}

.hero-btn {
  padding: 0.6rem 1.1rem;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.hero-btn.primary { background: var(--brand); color: #fff; }
.hero-btn.primary:hover { background: var(--brand-strong); box-shadow: var(--shadow-md); text-decoration: none; }
.hero-btn.ghost { border: 1px solid var(--line); color: var(--ink-soft); }
.hero-btn.ghost:hover { background: var(--bg-soft); text-decoration: none; }

/* ============ 主内容容器 ============ */
.home {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}

/* ============ 统计条 ============ */
.home-stats {
  display: flex;
  margin: 0 0 2.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}
.home-stat {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.25rem 1.5rem;
  text-align: center;
}
.home-stat + .home-stat { border-left: 1px solid var(--line); }
.home-stat strong {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.home-stat span {
  color: var(--ink-faint);
  font-size: 12px;
}

/* ============ 章节标题 ============ */
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.section-title {
  margin: 0 0 0.3rem;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.section-title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: var(--brand);
  margin-right: 8px;
  vertical-align: -2px;
}
.section-heading p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 13px;
}

/* ============ 筛选 ============ */
.filters {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px 22px;
  align-items: center;
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.filter-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.filter-row > label {
  flex: none;
  font-size: 13px;
  color: var(--ink-faint);
  white-space: nowrap;
}
.search-row { grid-column: 1 / -1; }

select, input[type="search"] {
  width: 100%;
  min-width: 0;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:focus, input[type="search"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active {
  background: var(--brand-soft);
  border-color: #d7cff2;
  color: var(--brand-strong);
  font-weight: 500;
}

/* ============ 结果计数 ============ */
.result-count {
  margin: 16px 2px 12px;
  font-size: 12px;
  color: var(--ink-faint);
}

/* ============ 项目卡片 ============ */
.program-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.program-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.4rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.program-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.2rem;
}
.card-top h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.badge {
  flex: none;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}

.uni {
  font-size: 12.5px;
  color: var(--ink-faint);
}

.meta {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.9rem;
}
.card-foot .uni { flex: 1; min-width: 0; }
.link {
  flex: none;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.link:hover { text-decoration: underline; text-underline-offset: 4px; }

.empty {
  grid-column: 1 / -1;
  padding: 60px 0;
  text-align: center;
  color: var(--ink-faint);
  font-size: 14px;
}

/* ============ 页脚 ============ */
.site-footer {
  max-width: var(--content);
  margin: 2rem auto 0;
  padding: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* ============ 响应式 ============ */
@media (max-width: 960px) {
  .program-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-actions { grid-column: 1; grid-row: auto; flex-direction: row; margin-top: 1.25rem; }
  .site-nav { flex-wrap: wrap; gap: 0.5rem; }
  .site-links { width: 100%; margin: 0; overflow-x: auto; padding-bottom: 0.25rem; }
}

@media (max-width: 600px) {
  .filters { grid-template-columns: 1fr; }
  .program-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-inner { padding: 2rem 1rem 1.5rem; }
  .home { padding: 0 1rem 1.5rem; }
  .home-stat { padding: 0.25rem 0.75rem; }
  .home-stat strong { font-size: 22px; }
  .home-stat span { font-size: 11px; }
  .section-heading { align-items: flex-start; }
  .site-footer { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
