/* Apple-adjacent flat system: system fonts, neutral palette, generous rhythm */

:root {
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --surface: #fbfbfd;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --accent: #0066cc;
  --accent-hover: #004499;
  --header-bg: rgba(251, 251, 253, 0.72);
  --max-content: 720px;
  --max-wide: 980px;
  --space-section: clamp(4rem, 10vw, 7rem);
  --radius-pill: 980px;
  --shadow-none: none;

  /* 顶栏水平位置
     - padding 只能是 ≥0 的长度，写负数会被浏览器忽略，看起来就像“没反应”。
     - 想更贴左边缘：把下面两个改小，例如 0.5rem 或 0。
     - Logo+文字相对再左/右挪一点：改 --nav-brand-offset（可为负）。 */
  --nav-bar-padding-inline-start: 0rem;
  --nav-bar-padding-inline-end: 0rem;
  /* Logo + 站点名：正值向右，负值向左（margin 允许负值） */
  --nav-brand-offset: 0px;
  /* 仅移动右侧（菜单+链接）：须配合 .nav-end 的 margin-left:auto 使用。
     正值 = 离顶栏右内边距更远（整体往左）；负值 = 更贴右缘。 */
  --nav-end-offset: 0px;
}

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

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  /* 避免因页面高低不同是否出现纵向滚动条而改变可视宽度，导致顶栏等「居中」块左右漂移 */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: var(--header-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nav-bar {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding-inline: var(--nav-bar-padding-inline-start) var(--nav-bar-padding-inline-end);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex-shrink: 0;
  margin-inline-start: var(--nav-brand-offset);
}

.nav-brand .logo {
  display: block;
  height: 60px;
  width: auto;
  object-fit: contain;
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-left: auto;
  margin-inline-end: var(--nav-end-offset);
  flex-shrink: 0;
}

.brand {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0em;
  color: var(--text);
  text-decoration: none;
}

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

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.site-nav a {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

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

.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  padding: 0.35rem;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  border-radius: 1px;
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .nav-end {
    gap: 0.5rem;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1.25rem 1rem;
    background: rgba(251, 251, 253, 0.96);
    border-bottom: 1px solid var(--line-soft);
    gap: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.28s ease, opacity 0.2s ease;
  }

  .site-nav.is-open {
    max-height: 240px;
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav a {
    padding: 0.65rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--line-soft);
  }

  .site-nav a:last-child {
    border-bottom: none;
  }
}

/* —— Main —— */
.site-main {
  flex: 1;
}

/* —— Typography helpers —— */
.headline-hero {
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 0.75rem;
}

.headline-section {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.1;
  margin: 0 0 0.5rem;
}

.lead {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin: 0;
  max-width: 36rem;
  letter-spacing: -0.015em;
}

.prose {
  max-width: var(--max-content);
  margin: 0 auto;
}

.prose p {
  font-size: 1.0625rem;
  color: var(--text);
  margin: 0 0 1.1em;
  letter-spacing: -0.016em;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* —— Links & buttons —— */
.link-inline {
  color: var(--accent);
  text-decoration: none;
}

.link-inline:hover {
  text-decoration: underline;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-pill);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  box-shadow: var(--shadow-none);
}

.btn-pill:hover {
  background: var(--accent-hover);
}

.btn-pill:active {
  transform: scale(0.98);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.btn-ghost:hover {
  border-color: var(--accent);
  background: rgba(0, 102, 204, 0.04);
}

/* —— Sections —— */
.section {
  padding: var(--space-section) 1.25rem;
}

.section-tight {
  padding: 3rem 1.25rem 4rem;
}

.section-surface {
  background: var(--surface);
}

.section-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header .lead {
  margin-left: auto;
  margin-right: auto;
}

/* —— Hero —— */
.hero {
  text-align: center;
  padding: clamp(4rem, 12vw, 7.5rem) 1.25rem 3rem;
}

.hero-actions {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin: 0 0 1rem;
}

/* —— Feature tiles (flat cards) —— */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 800px) {
  .tile-grid {
    grid-template-columns: 1fr;
  }
}

.tile {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 1.5rem 1.35rem;
  min-height: 140px;
  transition: border-color 0.2s ease;
}

.tile:hover {
  border-color: var(--line);
}

.tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.tile-icon.dotnet {
  background: #512bd4;
  color: #fff;
}

.tile-icon.design {
  background: #0071e3;
  color: #fff;
}

.tile-icon.ops {
  background: #1d1d1f;
  color: #fff;
}

.tile h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.tile p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  line-height: 1.45;
}

/* —— Article list —— */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: var(--max-content);
  margin: 0 auto;
}

.article-row {
  display: block;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.2s ease;
}

.article-row:first-child {
  padding-top: 0;
}

.article-row:hover {
  padding-left: 4px;
}

.article-row-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
}

.article-row-meta {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin: 0 0 0.5rem;
}

.article-row-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.45;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.tag {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--line-soft);
  color: var(--text-secondary);
}

/* —— Article detail —— */
.article-hero {
  padding: 3rem 1.25rem 2rem;
  text-align: center;
}

.article-hero .headline-section {
  max-width: 18ch;
  margin-left: auto;
  margin-right: auto;
}

.article-meta-line {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin: 1rem 0 0;
}

.article-body.section {
  padding-top: 0;
}

/* —— About —— */
.about-columns {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 720px) {
  .about-columns {
    grid-template-columns: 1fr;
  }
}

.about-card {
  padding: 1.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: #fff;
}

.about-card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.65rem;
  letter-spacing: -0.015em;
}

.about-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 2rem 1.25rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-note {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-icp {
  flex-basis: 100%;
  margin: 0;
  padding-top: 0.25rem;
  text-align: center;
  font-size: 0.75rem;
}

.footer-icp a {
  color: var(--text-tertiary);
  text-decoration: none;
}

.footer-icp a:hover {
  color: var(--accent);
}

.footer-beian {
  flex-basis: 100%;
  margin: 0;
  padding-top: 0.25rem;
  text-align: center;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.footer-beian .beian-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

.footer-beian a {
  color: var(--text-tertiary);
  text-decoration: none;
}

.footer-beian a:hover {
  color: var(--accent);
}

/* —— Utility —— */
.text-center {
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
