/* ==========================================================================
   GDG Xi'an — 极简主题（Light / Pure CSS）
   无任何预处理器、无外部 CDN 依赖
   ========================================================================== */

:root {
  --bg: #ffffff;
  --fg: #1f2328;
  --muted: #6b7280;
  --faint: #9aa3af;
  --border: #e6e8eb;
  --soft: #fafbfc;
  --accent: #1a73e8;
  --accent-dark: #1557b0;
  --accent-soft: #f3f7fe;
  --accent-border: #dbe7fb;
  --code-bg: #f6f8fa;
  --radius: 6px;
  --measure: 44rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --------------------------------------------------------------- 基础元素 */

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 1.8em 0 0.6em;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
h4,
h5,
h6 { font-size: 1rem; }

hr {
  height: 1px;
  margin: 2.5rem 0;
  border: 0;
  background-color: var(--border);
}

img {
  max-width: 100%;
  height: auto;
}

figure {
  margin: 1.5rem 0;
}

figcaption {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.875rem;
}

::selection {
  background-color: #d8e6fd;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  position: static;
  display: inline-block;
  padding: 0.5rem 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------ 页头 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.75rem;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--fg);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--fg);
  text-decoration: none;
}

.brand-logo {
  width: 30px;
  height: auto;
  display: block;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.925rem;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--fg);
  text-decoration: none;
}

.site-nav a.active {
  color: var(--fg);
  font-weight: 500;
}

/* 纯 CSS 移动端菜单（checkbox hack） */

.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.nav-toggle-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: var(--radius);
}

.nav-toggle-label span {
  display: block;
  height: 2px;
  background-color: var(--fg);
  border-radius: 2px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.nav-toggle:focus-visible + .nav-toggle-label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-nav {
  display: none;
}

.nav-toggle:checked ~ .site-nav {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 0.5rem 0 0.75rem;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav-toggle:checked ~ .site-nav ul {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.nav-toggle:checked ~ .site-nav a {
  display: block;
  padding: 0.5rem 0;
  font-size: 1rem;
}

.nav-toggle:checked + .nav-toggle-label span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle:checked + .nav-toggle-label span:nth-child(2) {
  opacity: 0;
}

.nav-toggle:checked + .nav-toggle-label span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 40rem) {
  .nav-toggle,
  .nav-toggle-label {
    display: none;
  }

  .site-nav,
  .nav-toggle:checked ~ .site-nav {
    display: block;
    position: static;
    padding: 0;
    border: 0;
    background: none;
  }

  .site-nav ul,
  .nav-toggle:checked ~ .site-nav ul {
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
    padding: 0;
  }

  .nav-toggle:checked ~ .site-nav a {
    display: inline;
    padding: 0;
    font-size: 0.925rem;
  }
}

/* ------------------------------------------------------------------ 主体 */

#main {
  padding: 2.5rem 0 1rem;
  min-height: 55vh;
}

/* 讲师招募提示 */

.notice {
  margin: 0 0 2.5rem;
  padding: 1rem 1.25rem;
  background-color: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  font-size: 0.925rem;
  line-height: 1.65;
}

.notice p {
  margin: 0.3rem 0;
}

.notice ul {
  margin: 0.3rem 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.notice li {
  margin: 0.1rem 0;
}

.notice .notice-action {
  margin-top: 0.6rem;
  font-weight: 500;
}

/* -------------------------------------------------- 首页轮播（活动 + 招募） */

.carousel {
  margin: 0 0 2.5rem;
}

.carousel-viewport {
  overflow: hidden;
  border-radius: var(--radius);
  touch-action: pan-y;
}

.carousel.is-dragging,
.carousel.is-dragging .carousel-viewport {
  -webkit-user-select: none;
  user-select: none;
}

.carousel-track {
  display: flex;
  align-items: stretch;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

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

.promo-card--notice .notice {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}

.promo-card--notice .notice .notice-action {
  margin-top: auto;
  padding-top: 0.75rem;
}

.promo-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
}

.promo-media {
  display: block;
  background-color: var(--soft);
  border-bottom: 1px solid var(--accent-border);
}

.promo-media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.promo-media--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #eef4ff 0%, #f7f9fc 55%, #fdf7ec 100%);
}

.promo-mark {
  display: inline-flex;
  align-items: baseline;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.promo-mark .c-blue { color: #4285f4; }
.promo-mark .c-red { color: #ea4335; }
.promo-mark .c-yellow { color: #fbbc05; }

.promo-mark-city {
  margin-left: 0.4rem;
  color: var(--muted);
  font-size: 1.3rem;
  font-weight: 600;
}

.promo-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem 1.25rem;
}

.promo-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.promo-tag {
  padding: 0.05rem 0.5rem;
  background-color: #fff;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 500;
}

.promo-title {
  margin: 0.5rem 0 0;
  font-size: 1.15rem;
}

.promo-title a {
  color: var(--fg);
}

.promo-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.promo-facts,
.promo-talks {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}

.promo-facts li {
  display: flex;
  gap: 0.5rem;
  margin: 0.2rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.promo-fact-icon {
  flex: none;
}

.promo-talks {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--accent-border);
}

.promo-talks li {
  margin: 0.4rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.promo-talk-title {
  color: var(--fg);
  font-weight: 500;
}

.promo-talk-speaker {
  margin-left: 0.35rem;
  color: var(--muted);
  font-size: 0.85em;
}

.promo-action {
  margin: auto 0 0;
  padding-top: 0.75rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.promo-link {
  color: var(--accent);
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.carousel-dots li {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
}

.carousel-dot {
  position: relative;
  display: block;
  width: 0.65rem;
  height: 0.65rem;
  padding: 0;
  background-color: #d4d9e0;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* 24×24 的点击热区，不随激活态宽度变化 */
.carousel-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.5rem;
  height: 1.5rem;
  transform: translate(-50%, -50%);
  border-radius: 999px;
}

.carousel-dot:hover {
  background-color: var(--faint);
}

.carousel-dot.is-active {
  width: 1.1rem;
  background-color: var(--accent);
}

.carousel-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: none;
  border: 0;
  color: var(--faint);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.carousel-arrow:hover {
  color: var(--accent);
}

.carousel-arrow[hidden],
.carousel-dots[hidden] {
  display: none;
}

.carousel-arrow:focus-visible,
.carousel-dot:focus-visible,
.promo-title a:focus-visible,
.promo-link:focus-visible,
.promo-media:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 30rem) {
  .carousel-controls {
    gap: 0.35rem;
  }

  .promo-body {
    padding: 0.85rem 1rem;
  }

  .promo-title {
    font-size: 1.05rem;
  }

  .promo-facts li,
  .promo-talks li {
    font-size: 0.85rem;
  }

  .promo-mark {
    font-size: 1.7rem;
  }

  .promo-mark-city {
    font-size: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track,
  .carousel-dot {
    transition: none;
  }
}

/* -------------------------------------------------------------- 文章列表 */

.post-list {
  display: flex;
  flex-direction: column;
}

.post-item {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--border);
}

.post-item:first-child {
  padding-top: 0.25rem;
}

.post-date {
  display: block;
  color: var(--faint);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.post-title {
  margin: 0.2rem 0 0.45rem;
  font-size: 1.25rem;
}

.post-title a {
  color: var(--fg);
}

.post-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.post-list-empty {
  color: var(--muted);
}

/* ---------------------------------------------------------------- 文章页 */

.article-header {
  margin-bottom: 2rem;
}

.article-title {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.3;
}

.article-meta {
  margin: 0.6rem 0 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

.article-meta time {
  font-variant-numeric: tabular-nums;
}

.article-tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.5rem;
  background-color: var(--soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
}

.article-content {
  overflow-wrap: break-word;
  word-break: break-word;
}

.article-content > *:first-child {
  margin-top: 0;
}

.article-content p {
  margin: 1rem 0;
}

.article-content h2 {
  margin-top: 2.4rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.article-content h3 {
  margin-top: 2rem;
}

.article-content a {
  text-decoration: underline;
  text-decoration-color: #b9d2f7;
  text-underline-offset: 3px;
}

.article-content a:hover {
  text-decoration-color: currentColor;
}

.article-content ul,
.article-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.article-content li {
  margin: 0.35rem 0;
}

.article-content li > ul,
.article-content li > ol {
  margin: 0.35rem 0;
}

.article-content blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background-color: var(--soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #3f4650;
}

.article-content blockquote > *:first-child {
  margin-top: 0;
}

.article-content blockquote > *:last-child {
  margin-bottom: 0;
}

.article-content code {
  padding: 0.15em 0.4em;
  background-color: var(--code-bg);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;
  font-size: 0.875em;
}

.article-content pre {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  background-color: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.6;
}

.article-content pre code {
  padding: 0;
  background: none;
  font-size: 0.875rem;
}

.article-content table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: 0.925rem;
}

.article-content th,
.article-content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

.article-content th {
  background-color: var(--soft);
  font-weight: 600;
}

.article-content .striped tbody tr:nth-child(even),
.article-content table.striped tr:nth-child(even) {
  background-color: var(--soft);
}

.article-content img {
  border-radius: var(--radius);
}

.article-content .responsive-img {
  max-width: 100%;
  height: auto;
}

/* 活动信息（{% include event.html %}） */

.event {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background-color: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.event dt {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.event dt:first-child {
  margin-top: 0;
}

.event dd {
  margin: 0.15rem 0 0;
}

.event dd p {
  margin: 0;
}

.event figure {
  margin: 0.75rem 0 0;
}

/* 上一篇 / 下一篇 */

.post-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.post-nav a {
  display: block;
  max-width: 20rem;
}

.post-nav .post-nav-label {
  display: block;
  color: var(--faint);
  font-size: 0.75rem;
}

/* ------------------------------------------------------------------ 分页 */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  font-size: 0.9rem;
}

.pagination .page-info {
  color: var(--faint);
  font-size: 0.8rem;
}

.pagination .is-disabled {
  color: #d0d5db;
}

/* ------------------------------------------------------------------ 归档 */

.page-heading {
  margin: 0 0 2rem;
  font-size: 1.5rem;
}

.archive-year {
  margin: 2.5rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.archive-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.archive-list li:last-child {
  border-bottom: 0;
}

.archive-list a {
  color: var(--fg);
}

.archive-list a:hover {
  color: var(--accent);
  text-decoration: none;
}

.archive-list time {
  flex: none;
  color: var(--faint);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ 页脚 */

.site-footer {
  margin-top: 4rem;
  padding: 2.25rem 0 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.9rem;
  margin: 0 0 0.6rem;
}

.footer-label {
  flex: none;
  color: var(--faint);
  font-size: 0.8rem;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: none;
}

.footer-meta {
  margin: 1.5rem 0 0;
  color: var(--faint);
  font-size: 0.8rem;
}

/* ----------------------------------------------- 兼容旧文章的辅助类 */

.text-center { text-align: center; }
.small { font-size: 0.875rem; }
.text-info { color: var(--accent); }
.grey-text { color: var(--muted); }
.white-text { color: #fff; }

.btn {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 0.925rem;
  line-height: 1.5;
}

.btn:hover {
  background-color: var(--accent-soft);
  text-decoration: none;
}

.btn-success {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-success:hover {
  background-color: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}
