/* =========================================================
   leozc.cc — 个人门户
   设计语言：现代 · 简约 · 科技感（Apple 官网调性）
   零依赖、零构建，纯 CSS 变量驱动 + 明暗双主题
   ========================================================= */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .4s ease, color .4s ease;
}

/* 内容不足一屏时，让页脚吸附在视口底部 */
main { flex: 1 0 auto; }

img { max-width: 100%; display: block; }
/* 用图片作为项目图标时，铺满图标容器并继承圆角 */
.icon-logo { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

/* ---------- Design Tokens ---------- */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --bg: #fbfbfd;
  --bg-elev: #ffffff;
  --bg-inset: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: rgba(0, 0, 0, .08);
  --line-2: rgba(0, 0, 0, .12);

  --accent: #0071e3;
  --accent-hover: #0077ed;
  --icon-grad: linear-gradient(150deg, #2c2c2e, #1d1d1f);

  --nav-bg: rgba(251, 251, 253, .72);
  --nav-line: rgba(0, 0, 0, .08);

  --radius: 22px;
  --radius-lg: 28px;
  --radius-sm: 12px;

  --shadow-sm: 0 2px 12px rgba(0, 0, 0, .05);
  --shadow: 0 8px 30px rgba(0, 0, 0, .08);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .14);

  --maxw: 1080px;
  --maxw-wide: 1200px;
  --nav-h: 52px;

  --ease: cubic-bezier(.28, .11, .32, 1);
}

[data-theme="dark"] {
  --bg: #000000;
  --bg-elev: #1d1d1f;
  --bg-inset: #161617;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #86868b;
  --line: rgba(255, 255, 255, .12);
  --line-2: rgba(255, 255, 255, .18);

  --accent: #2997ff;
  --accent-hover: #47a7ff;
  --icon-grad: linear-gradient(150deg, #48484a, #2c2c2e);

  --nav-bg: rgba(0, 0, 0, .72);
  --nav-line: rgba(255, 255, 255, .12);

  --shadow-sm: 0 2px 12px rgba(0, 0, 0, .4);
  --shadow: 0 8px 30px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .6);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}
.container--wide { max-width: var(--maxw-wide); }

.section { padding: 104px 0; }
.section--tight { padding: 64px 0; }
.section--inset { background: var(--bg-inset); }

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
}
.section__title {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.08;
}
.section__lead {
  margin-top: 14px;
  font-size: clamp(17px, 2vw, 21px);
  color: var(--text-2);
  max-width: 62ch;
}
.section__head { margin-bottom: 56px; }
.section__head--center { text-align: center; margin-left: auto; margin-right: auto; }
.section__head--center .section__lead { margin-left: auto; margin-right: auto; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background-color .4s ease;
}
.nav.is-scrolled { border-bottom-color: var(--nav-line); }

.nav__inner {
  height: 100%;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.nav__brand svg { width: 22px; height: 22px; }
.nav__brand .dim { color: var(--text-3); font-weight: 500; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
  font-size: 14px;
}
.nav__links a {
  color: var(--text-2);
  transition: color .2s ease;
}
.nav__links a:hover { color: var(--text); }

.nav__actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-2);
  transition: background-color .2s ease, color .2s ease;
}
.icon-btn:hover { background: var(--line); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

.nav__toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 980px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -.01em;
  transition: transform .2s var(--ease), background-color .2s ease, opacity .2s ease, box-shadow .2s ease;
  will-change: transform;
}
.btn:active { transform: scale(.97); }

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

.btn--ghost { border: 1px solid var(--line-2); color: var(--text); }
.btn--ghost:hover { background: var(--line); }

.btn--link { padding: 0; color: var(--accent); }
.btn--link:hover { text-decoration: underline; }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  text-align: center;
  padding: clamp(84px, 13vw, 152px) 0 clamp(72px, 10vw, 120px);
}
/* 极淡的强调色光晕，保持“纯白”观感的同时增加一点纵深 */
.hero::before {
  content: "";
  position: absolute;
  top: -20%;
  left: 0;
  right: 0;
  height: 72%;
  background: radial-gradient(60% 100% at 50% 0%, rgba(0, 113, 227, .06), transparent 70%);
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; }

.hero__eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--accent);
  text-transform: uppercase;
}
.hero__title {
  margin-top: 20px;
  font-size: clamp(44px, 9vw, 96px);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.02;
  color: var(--text);
}
.hero__sub {
  margin: 24px auto 0;
  font-size: clamp(18px, 2.4vw, 23px);
  color: var(--text-2);
  letter-spacing: -.01em;
  line-height: 1.45;
}
/* 桌面端保证副标题单行显示；窄屏仍允许换行以免溢出 */
@media (min-width: 640px) {
  .hero__sub { white-space: nowrap; }
}
.hero .btn-row { justify-content: center; margin-top: 38px; }

/* ---------- 首页：压缩模块间留白，尽量一屏展示 ---------- */
.page-home .section { padding: 44px 0; }
.page-home .section__head { margin-bottom: 30px; }
.page-home .hero { padding: 40px 0 56px; }
.page-home .tile { padding: 28px 26px 24px; }
.page-home .tile__icon { width: 52px; height: 52px; border-radius: 14px; margin-bottom: 18px; }
.page-home .tile__icon svg { width: 26px; height: 26px; }
.page-home .tile__cta { margin-top: 18px; }

/* ---------- Page hero (sub pages) ---------- */
.page-hero {
  padding: clamp(56px, 9vw, 96px) 0 40px;
  text-align: center;
}
.page-hero__icon {
  width: 84px; height: 84px;
  margin: 0 auto 24px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow);
}
.page-hero__icon svg { width: 44px; height: 44px; }
.page-hero__title {
  font-size: clamp(34px, 6vw, 60px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
}
.page-hero__sub {
  margin: 18px auto 0;
  max-width: 56ch;
  font-size: clamp(17px, 2.2vw, 22px);
  color: var(--text-2);
}
.page-hero .btn-row { justify-content: center; margin-top: 30px; }

.back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin: 0 0 22px auto;
  font-size: 14px;
  color: var(--text-2);
  transition: color .2s ease;
}
.back-link:hover { color: var(--accent); }
.back-link svg { width: 15px; height: 15px; }

/* ---------- Project tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 36px 32px 32px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s ease;
  overflow: hidden;
}
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% -20%, rgba(0, 113, 227, .10) 0%, transparent 62%);
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}
.tile:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-2);
}
.tile:hover::after { opacity: 1; }
.tile:hover .tile__icon { background: var(--accent); transform: scale(1.05); }

.tile__icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--icon-grad);
  color: #fff;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: background .35s var(--ease), transform .35s var(--ease);
}
.tile__icon svg { width: 30px; height: 30px; }

.tile__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.tile__desc {
  margin-top: 10px;
  font-size: 15.5px;
  color: var(--text-2);
  flex: 1;
}
.tile__cta {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
}
.tile__cta svg { width: 14px; height: 14px; transition: transform .25s var(--ease); }
.tile:hover .tile__cta svg { transform: translateX(4px); }

.tile__badge {
  position: absolute;
  top: 22px; right: 22px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  padding: 4px 10px;
  border-radius: 980px;
  background: var(--bg-inset);
  color: var(--text-3);
  border: 1px solid var(--line);
}

/* ---------- Feature strip ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px 40px;
}
.feature__num {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent);
}
.feature__title {
  margin-top: 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.feature__desc {
  margin-top: 8px;
  font-size: 15.5px;
  color: var(--text-2);
}

/* ---------- Links grid ---------- */
.link-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}
.link-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s ease;
}
.link-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--line-2);
}
.link-card__icon {
  width: 44px; height: 44px;
  flex: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-inset);
  color: var(--text);
}
.link-card__icon svg { width: 22px; height: 22px; }
.link-card__title { display: block; font-size: 16px; font-weight: 600; }
.link-card__desc { display: block; font-size: 13.5px; color: var(--text-3); }
.link-card__arrow { margin-left: auto; color: var(--text-3); }
.link-card__arrow svg { width: 16px; height: 16px; }

/* ---------- Prose (content pages) ---------- */
.prose { max-width: 720px; margin: 0 auto; }
.prose h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.015em;
  margin: 44px 0 12px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 8px;
}
.prose p { margin: 12px 0; color: var(--text-2); font-size: 16.5px; }
.prose ul { margin: 12px 0; padding-left: 4px; }
.prose li {
  position: relative;
  padding-left: 22px;
  margin: 8px 0;
  color: var(--text-2);
  font-size: 16.5px;
}
.prose li::before {
  content: "";
  position: absolute;
  left: 4px; top: 11px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.prose strong { color: var(--text); font-weight: 600; }
.prose a:not(.btn) { color: var(--accent); }
.prose a:not(.btn):hover { text-decoration: underline; }

.note {
  margin: 20px 0;
  padding: 16px 20px;
  background: var(--bg-inset);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text-2);
}
.note p { margin: 6px 0; }

/* ---------- 文档页（隐私政策 / 技术支持）---------- */
.doc-meta {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-3);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 15px;
}
.prose th,
.prose td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.prose th {
  background: var(--bg-inset);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.prose td { color: var(--text-2); }
.prose code {
  background: var(--bg-inset);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .88em;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.doc-en {
  margin-top: 56px;
  padding-top: 44px;
  border-top: 1px solid var(--line);
}
.doc-en h1 {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
}

/* 文档页（隐私政策 / 技术支持）：顶部收紧，进入即可见正文 */
.page-doc .page-hero { padding: 26px 0 16px; }
.page-doc .back-link { margin-bottom: 12px; }
.page-doc .page-hero__title { font-size: clamp(28px, 5vw, 40px); }
.page-doc .section--tight { padding-top: 22px; }

/* ---------- Feature cards / preview ---------- */
.preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: stretch;
}
.preview__card {
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
}
.preview__card--accent {
  background: linear-gradient(160deg, #1d1d1f 0%, #2b2b31 100%);
  color: #f5f5f7;
  border-color: transparent;
}
.preview__card--accent .preview__text { color: #b8bcc9; }
.preview__label { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .03em; }
.preview__card--accent .preview__label { color: #6ea8ff; }
.preview__title { margin-top: 12px; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.preview__text { margin-top: 10px; color: var(--text-2); font-size: 15.5px; }
.preview__list { margin-top: 20px; display: grid; gap: 10px; }
.preview__list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-2);
}
.preview__card--accent .preview__list li { color: #d1d3da; }
.preview__list svg { width: 17px; height: 17px; flex: none; color: var(--accent); }
.preview__card--accent .preview__list svg { color: #6ea8ff; }

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-inset);
  border-top: 1px solid var(--line);
  padding: 20px 0;
  font-size: 13.5px;
  color: var(--text-3);
}
.footer__inner {
  padding: 0 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: center;
  justify-content: space-between;
}
/* 备案信息（与页脚同一行）*/
.footer__beian { font-size: 13px; }
.footer__beian a { color: var(--text-3); transition: color .2s ease; }
.footer__beian a:hover { color: var(--text); }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .08s; }
.reveal-d2 { transition-delay: .16s; }
.reveal-d3 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .tile, .link-card, .btn { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .tiles { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; gap: 30px; }
  .preview { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .section { padding: 64px 0; }
  .link-grid { grid-template-columns: 1fr; }

  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 8px 22px 20px;
    background: var(--nav-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--nav-line);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
  }
  .nav__links a {
    padding: 14px 0;
    font-size: 17px;
    border-bottom: 1px solid var(--line);
  }
  .nav.open .nav__links { opacity: 1; transform: none; visibility: visible; }

  .nav__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    color: var(--text);
  }
  .nav__toggle svg { width: 20px; height: 20px; }
  .nav__toggle .close { display: none; }
  .nav.open .nav__toggle .close { display: block; }
  .nav.open .nav__toggle .menu { display: none; }
}
