/* OPCLab 子站 — 极简，与主站青绿色系协调 */

:root {
  --bg: #f6faf8;
  --surface: #fff;
  --text: #1a2f28;
  --muted: #4a6358;
  --accent: #2a7a66;
  --accent-hover: #236b59;
  --border: #d4e5dd;
  --space: 1rem;
  --max: 40rem;
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header__inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: var(--space) 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space);
}

.logo {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}

.logo:hover {
  text-decoration: none;
  color: var(--accent);
}

.logo--brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.logo__mark {
  height: 36px;
  width: auto;
  max-height: 36px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--surface);
}

.logo__text {
  font-weight: 600;
  font-size: 1.05rem;
}

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

.nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.nav a {
  color: var(--muted);
}

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

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

.nav--subsite a:hover {
  color: var(--accent);
}

.main {
  flex: 1;
  width: 100%;
}

.container {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.hero {
  text-align: center;
  padding: 2.5rem 1.25rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.hero__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 600;
}

.hero__sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.columns-intro {
  padding: 1.75rem 0 0.5rem;
}

.columns-intro__lead {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
}

.columns-intro__lead code {
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.columns-intro__lead--small {
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

.columns-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  align-items: center;
}

.columns-nav__chip {
  display: inline-block;
  padding: 0.35em 0.75em;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
}

.columns-nav__chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.columns-nav__chip--ghost {
  color: var(--muted);
  background: transparent;
}

.column-section {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.columns-intro + .column-section {
  border-top: none;
  padding-top: 1rem;
}

.column-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}

.column-section__title {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.column-section__desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 42rem;
}

.column-section__external {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
}

.column-section__more {
  flex-shrink: 0;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.35em 0.65em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.column-section__more:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.column-section__empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.posts--compact .posts__item {
  padding: 0.75rem 0;
}

.post-list--tail {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.post-list {
  padding: 2rem 0 3rem;
}

.posts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.posts__item {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border);
}

.posts__item:first-child {
  padding-top: 0;
}

.posts__link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  text-decoration: none;
  color: var(--text);
}

.posts__link:hover {
  color: var(--accent);
  text-decoration: none;
}

.posts__title {
  font-weight: 600;
  font-size: 1.05rem;
}

.posts__date {
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.posts__excerpt {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}

.empty {
  color: var(--muted);
  padding: 2rem 0;
}

.empty code {
  font-size: 0.9em;
  background: var(--surface);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.pager {
  display: flex;
  justify-content: space-between;
  padding-bottom: 2.5rem;
  font-size: 0.95rem;
}

.post {
  padding: 2rem 0 3rem;
}

.post__header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.post__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 3.5vw, 1.6rem);
  font-weight: 600;
  line-height: 1.3;
}

.post__meta {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.entry-content {
  font-size: 1rem;
  color: var(--text);
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content h2 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.2rem;
}

.entry-content p,
.entry-content li {
  margin: 0.75rem 0;
}

.entry-content a {
  text-decoration: underline;
}

.entry-content pre,
.entry-content code {
  font-size: 0.9em;
}

.archive {
  padding: 2rem 0 3rem;
}

.page-title {
  margin: 0 0 1.5rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.tag-back {
  margin: -0.75rem 0 1.25rem;
  font-size: 0.9rem;
}

.tag-back a {
  color: var(--muted);
}

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.archive-list__year {
  margin: 1.5rem 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  list-style: none;
}

.archive-list__year:first-child {
  margin-top: 0;
}

.archive-list__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.45rem 0;
  font-size: 0.95rem;
}

.archive-list__item time {
  color: var(--muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.page.container {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.site-footer {
  margin-top: auto;
  padding: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.site-footer p {
  margin: 0;
}

.site-footer p + p {
  margin-top: 0.35rem;
}

.site-footer__sub {
  font-size: 0.8rem;
  opacity: 0.9;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========== 移动阅读 / 触控友好 ========== */
html {
  text-size-adjust: 100%;
}

body {
  text-rendering: optimizeLegibility;
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
}

.entry-content {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.entry-content pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 8px;
  background: rgba(26, 47, 40, 0.055);
  font-size: max(0.8125rem, 12px);
  line-height: 1.5;
  tab-size: 2;
}

.entry-content table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
}

.entry-content blockquote {
  margin-left: 0;
  margin-right: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
}

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

@media (hover: none) {
  a:active {
    opacity: 0.9;
  }
}

@media (max-width: 540px) {
  .site-header__inner {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
    padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
  }

  .container {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }

  .hero {
    padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
  }

  .site-footer {
    padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  }

  body {
    font-size: 1.0625rem;
  }

  .entry-content {
    font-size: 1.0625rem;
    line-height: 1.72;
  }

  .entry-content h2 {
    font-size: 1.22rem;
    line-height: 1.35;
  }

  .post__title {
    font-size: clamp(1.28rem, 5.2vw, 1.55rem);
    line-height: 1.28;
  }

  .nav {
    justify-content: flex-end;
  }

  .nav--subsite a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.35rem 0.25rem;
    box-sizing: border-box;
  }

  .columns-nav__chip {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.4em 0.9em;
  }

  .column-section__more {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.45em 0.9em;
    box-sizing: border-box;
  }

  .column-section__head {
    flex-direction: column;
    align-items: stretch;
  }

  .column-section__more {
    align-self: flex-start;
  }

  .posts__link {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .posts__date {
    font-size: 0.82rem;
  }

  .posts__title {
    font-size: 1.07rem;
  }

  .archive-list__item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.55rem 0;
  }

  .pager {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .pager a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0;
  }
}
