/* ============================================================
   gitark.cn 首页样式
   结构参照 github.com 未登录首页（营销页）：
     宣言式 hero → 产品界面（带边框的截图轮播）→ 真实内容带
     → 两段「左文案手风琴 / 右真实截图」区块 → 数字带 → 结尾行动带
   几何与字号取自 GitHub 品牌 token 的实测值：
     --brand-text-size-1000 = 2.5rem → 3.5rem → 4rem（40/56/64px）
     --brand-text-size-400  = 1.25rem（副标题）
     --brand-breakpoint-*   = 34/48/63.25/80/87.5rem
     区块容器 maxWidth = 80rem，区块左右内边距 = 1.5rem
   所有选择器都限定在 .gh 下，不会外溢到 Gitea 自己的页面。
   ============================================================ */

.gh {
  --can: #0d1117;
  --can-subtle: #161b22;
  --can-inset: #010409;
  --border: #30363d;
  --border-muted: #21262d;
  --fg: #e6edf3;
  --fg-muted: #9198a1;
  --fg-subtle: #6e7681;
  --accent: #58a6ff;
  --accent-soft: #388bfd;
  --btn: #238636;
  --btn-hover: #2ea043;
  --lang: #f78166;

  --maxw: 80rem;
  --pad: 1.5rem;
  --r: 6px;
  --r-lg: 14px;

  --t100: 0.875rem;
  --t200: 1rem;
  --t300: 1.125rem;
  --t400: 1.25rem;

  position: relative;
  color: var(--fg);
  background: var(--can);
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC",
    "Hiragino Sans GB", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--t200);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.gh *, .gh *::before, .gh *::after { box-sizing: border-box; }
.gh h1, .gh h2, .gh h3, .gh p, .gh ul, .gh ol, .gh li, .gh figure { margin: 0; padding: 0; }
.gh ul, .gh ol { list-style: none; }
.gh img { max-width: 100%; height: auto; }
.gh a { color: var(--accent); text-decoration: none; }
.gh a:hover { text-decoration: underline; }
.gh summary { cursor: pointer; }
.gh summary::-webkit-details-marker { display: none; }
.gh summary::marker { content: ""; }

.gh-wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.gh-band { padding: clamp(3.5rem, 7vw, 6.5rem) 0; border-top: 1px solid var(--border-muted); }
.gh-band--flush { border-top: 0; }

/* ---------- 1. hero ---------- */
.gh-hero {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6rem) 0 0;
  overflow: hidden;
  text-align: center;
}
.gh-hero__glow {
  position: absolute;
  inset: -12rem 0 auto 0;
  height: 46rem;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(42% 46% at 50% 6%, rgba(56, 139, 253, 0.20), transparent 70%),
    radial-gradient(30% 34% at 22% 0%, rgba(163, 113, 247, 0.16), transparent 72%),
    radial-gradient(30% 34% at 78% 2%, rgba(63, 185, 80, 0.10), transparent 72%);
}
.gh-hero > .gh-wrap { position: relative; z-index: 1; }

.gh-eyebrow {
  font-size: var(--t100);
  letter-spacing: 0.02em;
  color: var(--fg-subtle);
  font-variant-numeric: tabular-nums;
}
.gh-h1 {
  margin-top: 1.25rem;
  font-size: clamp(2.5rem, 6.2vw, 4rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.015em;
}
.gh-lede {
  max-width: 46rem;
  margin: 1.5rem auto 0;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.75;
  color: var(--fg-muted);
}

.gh-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  max-width: 34rem;
  margin: 2rem auto 0;
}
.gh-input {
  flex: 1 1 14rem;
  min-width: 0;
  height: 2.5rem;
  padding: 0 0.875rem;
  color: var(--fg);
  background: var(--can-inset);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font: inherit;
  font-size: var(--t200);
}
.gh-input::placeholder { color: var(--fg-subtle); }
.gh-input:focus { outline: 2px solid var(--accent-soft); outline-offset: -1px; border-color: var(--accent-soft); }

.gh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--r);
  font-size: var(--t200);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}
.gh-btn:hover { text-decoration: none; }
.gh-btn--primary { color: #fff; background: var(--btn); border-color: rgba(240, 246, 252, 0.1); }
.gh-btn--primary:hover { background: var(--btn-hover); }
.gh-btn--ghost { color: var(--fg); background: var(--can-subtle); border-color: var(--border); }
.gh-btn--ghost:hover { background: #21262d; border-color: #8b949e; }
.gh-btn--wide { padding: 0 1.5rem; }

.gh-meta {
  margin-top: 1.5rem;
  font-size: var(--t100);
  color: var(--fg-subtle);
}
.gh-meta span + span::before { content: "·"; margin: 0 0.5rem; color: #484f58; }

/* ---------- 2. 产品界面轮播 ---------- */
.gh-carousel { position: relative; z-index: 1; margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.gh-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
  margin-bottom: 1.25rem;
  padding: 0 var(--pad);
}
.gh-tab {
  height: 2.25rem;
  padding: 0 0.875rem;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r);
  font: inherit;
  font-size: var(--t100);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.14s ease, background-color 0.14s ease;
}
.gh-tab:hover { color: var(--fg); background: var(--can-subtle); }
.gh-tab[aria-selected="true"] {
  color: var(--fg);
  background: var(--can-subtle);
  border-color: var(--border);
}
.gh-panel[hidden] { display: none; }

.gh-frame {
  position: relative;
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
  background: rgba(110, 123, 242, 0.07);
  border: 1px solid rgba(110, 123, 242, 0.42);
  border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.gh-frame::before {
  content: "";
  position: absolute;
  top: -1px; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(160, 170, 255, 0.75), transparent);
}
.gh-frame img {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--can);
}
.gh-cap {
  margin-top: 0.875rem;
  text-align: center;
  font-size: var(--t100);
  color: var(--fg-subtle);
}
.gh-cap code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

/* ---------- 3. 真实仓库带 ---------- */
.gh-head { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-end; justify-content: space-between; }
.gh-h2 {
  font-size: clamp(1.625rem, 3.4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.gh-sub {
  max-width: 44rem;
  margin-top: 0.875rem;
  font-size: var(--t300);
  line-height: 1.75;
  color: var(--fg-muted);
}
.gh-more { font-size: var(--t200); font-weight: 600; }

.gh-repos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}
.gh-repo {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--can-subtle);
  border: 1px solid var(--border-muted);
  border-radius: 0.5rem;
}
.gh-repo__name {
  font-size: var(--t200);
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
.gh-repo__desc {
  flex: 1 1 auto;
  font-size: var(--t100);
  line-height: 1.65;
  color: var(--fg-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gh-repo__meta { display: flex; align-items: center; gap: 1rem; font-size: 0.8125rem; color: var(--fg-subtle); }
.gh-repo__lang { display: inline-flex; align-items: center; gap: 0.375rem; }
.gh-repo__lang::before { content: ""; width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--lang); }

/* ---------- 4. 左文案 / 右截图 ---------- */
.gh-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.gh-split--flip .gh-split__media { order: -1; }
.gh-split__body .gh-h2 { margin-bottom: 1rem; }
.gh-split__lede { font-size: var(--t300); line-height: 1.75; color: var(--fg-muted); }

.gh-acc { margin-top: 2rem; border-top: 1px solid var(--border-muted); }
.gh-item { display: grid; padding: 1.25rem 0 1.125rem; border-bottom: 1px solid var(--border-muted); }
.gh-item__summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.gh-item__h { font-size: var(--t200); font-weight: 600; line-height: 1.5; }
.gh-item__ico { position: relative; flex: 0 0 auto; width: 1rem; height: 1rem; }
.gh-item__ico::before, .gh-item__ico::after {
  content: "";
  position: absolute;
  background: var(--fg-muted);
  border-radius: 2px;
  transition: transform 0.18s ease;
}
.gh-item__ico::before { left: 0; top: 0.4375rem; width: 1rem; height: 0.125rem; }
.gh-item__ico::after { left: 0.4375rem; top: 0; width: 0.125rem; height: 1rem; }
.gh-item[open] .gh-item__ico::after { transform: scaleY(0); }
.gh-item__p { margin-top: 0.5rem; font-size: 0.9375rem; line-height: 1.75; color: var(--fg-muted); }
.gh-item:hover .gh-item__h { color: var(--accent); }

.gh-shot {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--can-subtle);
  box-shadow: 0 24px 60px -34px rgba(1, 4, 9, 0.9);
}
.gh-shot img { display: block; width: 100%; }

/* ---------- 5. 数字带 ---------- */
.gh-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem 2rem; margin-top: 2.5rem; }
.gh-stat__n {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.gh-stat__l { margin-top: 0.375rem; font-size: var(--t100); color: var(--fg-muted); line-height: 1.6; }
.gh-note {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-muted);
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--fg-subtle);
}
.gh-note code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875rem;
  color: var(--fg-muted);
}

/* ---------- 6. 结尾行动带 ---------- */
.gh-cta { text-align: center; }
.gh-cta .gh-sub { margin-left: auto; margin-right: auto; }
.gh-cta__row { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 2rem; }

/* ---------- 响应式 ---------- */
@media (max-width: 63.25rem) {
  .gh-split { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .gh-split--flip .gh-split__media { order: 0; }
  .gh-repos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gh-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 48rem) {
  .gh-h1 { letter-spacing: -0.005em; }
  .gh-tabs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .gh-tabs::-webkit-scrollbar { display: none; }
  .gh-frame { padding: 0.5rem 0.5rem 0; border-radius: 0.75rem 0.75rem 0 0; }
  .gh-repos { grid-template-columns: minmax(0, 1fr); }
  .gh-item { padding: 1rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  .gh *, .gh *::before, .gh *::after { transition: none !important; animation: none !important; }
}
