/* ═══════════════════════════════════════════════════════════════
   顾谭琴个人官网 · 样式表
   设计 tokens 与「AI 自媒体系统」官网保持一致：
   黑白灰为主 + 墨绿点缀，胶囊按钮、圆角卡片、虚线分隔、思源黑体。
   页面只有两块：课程视频、关于我。
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* 字体：全部用系统自带的，不引外部字体。
     思源黑体 / Noto Sans SC 在装了的设计机上命中，否则退到苹方、微软雅黑。 */
  --font-sans: "Source Han Sans SC", "Noto Sans SC", "思源黑体", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;

  /* 中性色：纯灰阶 */
  --neutral-50:  #fafafa;
  --neutral-100: #f5f5f5;
  --neutral-200: #ebebeb;
  --neutral-300: #e0e0e0;
  --neutral-400: #b5b5b5;
  --neutral-500: #8a8a8a;
  --neutral-600: #6b6b6b;
  --neutral-700: #4a4a4a;
  --neutral-800: #2b2b2b;
  --neutral-900: #141414;
  --neutral-950: #0a0a0a;

  /* 主色：近黑 */
  --primary:        #141414;
  --primary-strong: #2b2b2b;

  /* 点缀色：墨绿 */
  --brand:        #1f5c4d;
  --brand-strong: #16453a;
  --brand-soft:   #eef5f2;
  --brand-border: #cfe2db;

  /* 背景 / 文字 */
  --bg:          #ffffff;
  --bg-soft:     #fafafa;
  --text-1:      #141414;
  --text-2:      #4a4a4a;
  --text-3:      #8a8a8a;
  --border:      #ebebeb;
  --border-hard: #e0e0e0;

  --max-screen: 1200px;
  --radius-sm:  12px;
  --radius-md:  16px;
  --radius-lg:  24px;

  --shadow-card: 0 1px 2px -1px rgba(20, 20, 20, 0.06);
}

/* ── 基础 ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--text-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* 让页脚在内容少的页面（关于我）也贴着底部 */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

/* 只有一块内容的页面：整体在视口里垂直居中，页脚自然落到下面 */
.page-center {
  display: flex; align-items: center;
  padding-top: 112px; padding-bottom: 32px;
}
@media (min-width: 768px)  { .page-center { padding-top: 148px; } }
@media (min-width: 1024px) { .page-center { padding-top: 168px; } }

h1, h2, h3 { color: var(--text-1); margin: 0; font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

::selection { background: var(--brand); color: #fff; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  padding: 10px 16px; background: var(--brand); color: #fff;
  border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--neutral-200); border-radius: 6px; }
::-webkit-scrollbar-thumb { background: var(--neutral-400); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── 容器 ───────────────────────────────────────────────────── */
.site-container {
  max-width: var(--max-screen);
  margin-inline: auto;
  padding-inline: 20px;
}
@media (min-width: 768px) { .site-container { padding-inline: 32px; } }

/* ── 顶部导航 ───────────────────────────────────────────────── */
#header {
  position: fixed; inset: 16px 0 auto; z-index: 50;
  padding-inline: 12px;
  transition: transform 0.3s ease;
}
@media (min-width: 768px) { #header { inset-block-start: 24px; padding-inline: 24px; } }

.header-inner {
  position: relative;
  max-width: var(--max-screen);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 64px;
  padding: 8px 10px 8px 14px;
  border: 1px solid rgba(20, 20, 20, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  transition: background-color .35s ease, border-color .35s ease, box-shadow .35s ease;
}
#header.is-scrolled .header-inner {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(20, 20, 20, 0.09);
  box-shadow: 0 14px 34px -22px rgba(20, 20, 20, 0.45);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .header-inner { background: #fff; }
}

.brand { display: flex; align-items: center; gap: 10px; padding-right: 8px; flex-shrink: 0; }
.brand-avatar {
  width: 36px; height: 36px; border-radius: 999px; overflow: hidden;
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--neutral-200);
  transition: transform .3s ease;
}
.brand:hover .brand-avatar { transform: scale(1.06); }
.brand-avatar img { width: 100%; height: 100%; object-fit: cover; }
.brand-name {
  font-size: 19px; font-weight: 600; letter-spacing: -0.02em; color: var(--neutral-900);
  white-space: nowrap;
}

.nav-desktop { display: none; }
@media (min-width: 900px) {
  .nav-desktop {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    display: flex; align-items: center; gap: 4px;
    font-size: 15px; font-weight: 500; color: var(--neutral-600);
  }
  .nav-desktop a {
    padding: 8px 14px; border-radius: 999px;
    transition: color .2s ease, background-color .2s ease;
    white-space: nowrap;
  }
  .nav-desktop a:hover { color: var(--neutral-900); background: var(--neutral-100); }
  .nav-desktop a.is-active { color: var(--brand); background: var(--brand-soft); }
}

.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.menu-toggle {
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--neutral-200); background: #fff;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; transition: border-color .2s ease, transform .15s ease;
}
.menu-toggle:active { transform: scale(0.92); }
.menu-toggle:hover { border-color: var(--brand); }
.menu-toggle span {
  display: block; width: 16px; height: 1.5px; border-radius: 2px;
  background: var(--neutral-800); transition: transform .25s ease, opacity .2s ease;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
@media (min-width: 900px) { .menu-toggle { display: none; } }

.nav-mobile {
  max-width: var(--max-screen); margin-inline: auto;
  margin-top: 10px; padding: 12px 14px 16px;
  border: 1px solid var(--neutral-200); border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px -24px rgba(20, 20, 20, 0.35);
  display: none; flex-direction: column; gap: 2px;
}
.nav-mobile.is-open { display: flex; animation: menuIn .28s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.nav-mobile a {
  padding: 12px 14px; border-radius: 999px;
  font-size: 15px; font-weight: 500; color: var(--neutral-700);
}
.nav-mobile a:hover { background: var(--neutral-100); color: var(--neutral-900); }
.nav-mobile a.is-active { color: var(--brand); background: var(--brand-soft); }
@media (min-width: 900px) { .nav-mobile { display: none !important; } }

/* ── 标签胶囊 ───────────────────────────────────────────────── */
.pill-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--neutral-100); color: var(--neutral-700);
  font-size: 13px; line-height: 1.2; font-weight: 500;
}
.pill-tag--brand {
  background: var(--brand-soft); color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand-border);
}
.pill-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex-shrink: 0; }

/* ── 通用区块 ───────────────────────────────────────────────── */
.section { padding-top: 88px; }
@media (min-width: 768px) { .section { padding-top: 128px; } }

/* 第一个区块顶上要给固定导航让位 */
.section--first { padding-top: 112px; }
@media (min-width: 768px) { .section--first { padding-top: 148px; } }
@media (min-width: 1024px) { .section--first { padding-top: 168px; } }

.section-head { max-width: 640px; }
.section-no {
  display: inline-block; margin-bottom: 14px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.16em;
  color: var(--brand);
}
.section-head h2, .about-text h2 {
  font-size: 30px; line-height: 1.25; letter-spacing: -0.025em;
}
@media (min-width: 768px) { .section-head h2, .about-text h2 { font-size: 38px; } }
.section-head p { margin-top: 14px; font-size: 16px; color: var(--neutral-600); }

/* ── 视频墙 ─────────────────────────────────────────────────── */
.video-grid {
  display: grid; gap: 24px; margin-top: 44px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .video-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .video-grid { grid-template-columns: repeat(3, 1fr); gap: 28px; } }

.video-card {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: #fff; overflow: hidden;
  transition: transform .35s cubic-bezier(.22, 1, .36, 1),
              box-shadow .35s ease, border-color .35s ease;
}
.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-border);
  box-shadow: 0 22px 46px -28px rgba(31, 92, 77, 0.45);
}

/* ── 视频封面（占位 + 播放） ────────────────────────────────── */
.video-cover {
  position: relative; display: block; width: 100%;
  aspect-ratio: 16 / 10;
  border: 0; padding: 0; cursor: pointer;
  background:
    radial-gradient(120% 90% at 50% 0%, #f2f6f4 0%, #eef2f0 42%, #e8ecea 100%);
  overflow: hidden;
}
.cover-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(31, 92, 77, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 92, 77, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(110% 80% at 50% 30%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(110% 80% at 50% 30%, #000 40%, transparent 100%);
}

.play-badge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 58px; height: 58px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  box-shadow: 0 18px 40px -16px rgba(31, 92, 77, 0.75);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), background-color .3s ease;
}
.play-badge::after {
  content: ""; position: absolute; inset: -6px; border-radius: 999px;
  border: 1px solid var(--brand); opacity: 0;
  animation: ring 3s cubic-bezier(.4, 0, .2, 1) infinite;
}
@keyframes ring {
  0%   { opacity: 0;   transform: scale(0.94); }
  45%  { opacity: .38; transform: scale(1.06); }
  100% { opacity: 0;   transform: scale(1.16); }
}
.video-cover:hover .play-badge { transform: translate(-50%, -50%) scale(1.07); background: var(--brand-strong); }

.duration {
  position: absolute; right: 12px; bottom: 12px;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(20, 20, 20, 0.72); color: #fff;
  font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums;
}

.video-meta { padding: 18px 20px 22px; }
.video-meta h3 { font-size: 16px; line-height: 1.45; letter-spacing: -0.01em; }
.video-meta p { margin-top: 8px; font-size: 14px; line-height: 1.65; color: var(--neutral-500); }

/* ── 关于我 ─────────────────────────────────────────────────── */
.about-layout {
  display: grid; gap: 40px; align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .about-layout { grid-template-columns: 0.85fr 1.15fr; gap: 64px; }
}

/* 去背人像 + 浅色底：底部做渐隐，像"站在浅底上"，不会有被切一刀的硬边 */
.photo-box {
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 34px 26px 0;
  background: linear-gradient(180deg, var(--brand-soft) 0%, #f6f9f8 58%, #fbfcfc 100%);
  box-shadow: inset 0 0 0 1px var(--neutral-200);
}
.photo-box img {
  width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(180deg, #000 76%, rgba(0, 0, 0, 0.35) 94%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 76%, rgba(0, 0, 0, 0.35) 94%, transparent 100%);
}

.about-text p { margin-top: 16px; font-size: 16px; line-height: 1.8; color: var(--neutral-600); }
.about-text h2 { margin-top: 14px; }
.about-text em { font-style: normal; color: var(--brand); }
.about-slogan { margin-top: 20px; }
.about-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.about-tags li {
  padding: 8px 14px; border-radius: 999px;
  background: var(--neutral-100); color: var(--neutral-700);
  font-size: 13px; font-weight: 500;
}

/* ── 页脚 ───────────────────────────────────────────────────── */
.site-footer {
  margin-top: 96px;
  border-top: 1px dashed var(--neutral-200);
}
@media (min-width: 768px) { .site-footer { margin-top: 140px; } }
.footer-inner {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  gap: 16px; padding-block: 36px;
}
@media (min-width: 640px) { .footer-inner { flex-direction: row; } }
.footer-inner p { font-size: 14px; color: var(--neutral-400); }
.footer-inner nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; }
.footer-inner nav a { font-size: 14px; color: var(--neutral-500); transition: color .2s ease; }
.footer-inner nav a:hover { color: var(--brand); }
.footer-inner nav a.is-active { color: var(--brand); }

/* ── 视频弹窗 ───────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.lightbox[hidden] { display: none; }
.lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 10, 10, 0.62);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fadeIn .22s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.lightbox-panel {
  position: relative; width: 100%; max-width: 960px;
  background: #fff; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(10, 10, 10, 0.55);
  animation: popIn .3s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.lightbox-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 14px 14px 20px;
  border-bottom: 1px solid var(--neutral-200);
}
.lightbox-head strong { font-size: 15px; font-weight: 600; color: var(--neutral-900); }
.lightbox-close {
  width: 34px; height: 34px; border-radius: 999px; flex-shrink: 0;
  border: 1px solid var(--neutral-200); background: #fff; cursor: pointer;
  display: grid; place-items: center; color: var(--neutral-700);
  transition: border-color .2s ease, color .2s ease, transform .15s ease;
}
.lightbox-close:hover { border-color: var(--neutral-900); color: var(--neutral-900); }
.lightbox-close:active { transform: scale(0.92); }

.lightbox-body { background: var(--neutral-950); aspect-ratio: 16 / 9; }
.lightbox-body video { width: 100%; height: 100%; display: block; background: #000; }

.video-missing {
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  padding: 24px; text-align: center; color: var(--neutral-400);
  background:
    radial-gradient(110% 80% at 50% 20%, #1b211f 0%, #101312 60%, #0a0a0a 100%);
}
.video-missing b { color: var(--neutral-100); font-size: 15px; font-weight: 600; }
.video-missing code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; padding: 6px 12px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.07); color: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  word-break: break-all;
}
.video-missing span { font-size: 12.5px; max-width: 380px; line-height: 1.7; }

/* ── 回到顶部 ───────────────────────────────────────────────── */
.to-top {
  position: fixed; right: 20px; bottom: 24px; z-index: 60;
  width: 44px; height: 44px; border-radius: 999px;
  border: 1px solid var(--neutral-200); background: #fff; color: var(--neutral-800);
  cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 12px 30px -14px rgba(20, 20, 20, 0.35);
  transition: transform .2s ease, border-color .2s ease, color .2s ease;
}
.to-top[hidden] { display: none; }
.to-top:hover { transform: translateY(-3px); border-color: var(--brand); color: var(--brand); }

/* ── 滚动入场 ───────────────────────────────────────────────── */
/* 渐进增强：只有在 <html> 拿到 .js-motion（脚本可用 + 用户没关动效）时才隐藏，
   脚本没跑起来时内容照常可见，不会出现「整页空白」。 */
.js-motion .reveal { opacity: 0; transform: translateY(14px); }
.js-motion .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .6s cubic-bezier(.22, 1, .36, 1), transform .6s cubic-bezier(.22, 1, .36, 1);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-motion .reveal, .js-motion .reveal.is-in { opacity: 1; transform: none; transition: none; }
  .play-badge::after, .lightbox-panel, .lightbox-backdrop, .nav-mobile.is-open {
    animation: none !important;
  }
}
