/* ========================================
   Personal Site — xuntrans
   ======================================== */

:root {
  --color-bg: #f9fafb;
  --color-surface: #ffffff;
  --color-text: #111827;
  --color-text-secondary: #6b7280;
  --color-accent: #4f46e5;
  --color-accent-light: #eef2ff;
  --color-border: #e5e7eb;
  --max-width: 720px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Header ---- */

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

 .site-logo {
   font-size: 16px;
   font-weight: 600;
   color: var(--color-text);
   text-decoration: none;
   letter-spacing: -0.01em;
 }
  .site-logo-sub {
    font-size: 11px;
    color: var(--color-text-secondary);
    margin-left: 8px;
    font-weight: 400;
  }

.site-nav {
  display: flex;
  gap: 24px;
}

.site-nav a {
  font-size: 14px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--color-text);
}

/* ---- Main ---- */

main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ---- Hero (homepage) ---- */

.hero {
  padding: 80px 0 56px;
  text-align: center;
}

.hero-title {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.hero-desc {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
}

.hero-line {
  width: 40px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-accent);
  margin: 0 auto;
}

/* ---- Index sections ---- */

.sections-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 80px;
}

.section-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.section-link:hover {
  border-color: var(--color-accent);
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.06);
}

.section-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.section-text {
  flex: 1;
  min-width: 0;
}

.section-text h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.section-text p {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0;
}

.section-arrow {
  flex-shrink: 0;
  color: var(--color-text-secondary);
  transition: color 0.15s, transform 0.15s;
}

.section-link:hover .section-arrow {
  color: var(--color-accent);
  transform: translateX(3px);
}

/* ---- Page Header (sub-pages) ---- */

.page-header {
  padding: 40px 0 32px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 4px;
}

.page-header .page-meta {
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* ---- Content (sub-pages) ---- */

.content-page {
  padding-bottom: 64px;
}

.content-page section {
  margin-bottom: 32px;
}

.content-page h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
}

.content-page h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 8px;
}

.content-page p {
  margin-bottom: 12px;
  color: var(--color-text);
}

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

.content-page a:hover {
  text-decoration: underline;
}

.content-page ul,
.content-page ol {
  margin: 0 0 12px 20px;
}

.content-page li {
  margin-bottom: 4px;
}

/* ---- Back link ---- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--color-text-secondary);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.15s;
}

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

/* ---- Empty state ---- */

.empty-state {
  text-align: center;
  padding: 80px 0;
}

.empty-state p {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

/* ---- Footer ---- */

.site-footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-text-secondary);
  background: var(--color-surface);
}

/* ---- Responsive ---- */

@media (max-width: 480px) {
  .hero {
    padding: 56px 0 40px;
  }

  .hero-title {
    font-size: 32px;
  }

  .section-link {
    padding: 16px 18px;
  }

  .header-inner {
    padding: 0 18px;
  }

  .page-header {
    padding: 28px 0 24px;
  }

  .page-header h1 {
    font-size: 24px;
  }
}
