/* ai-power.com 前台样式 — typography-first, editorial restraint */

:root {
  --bg:           #ffffff;
  --bg-soft:      #f7f7f5;
  --text:         #1d1d1f;
  --text-muted:   #6e6e73;
  --text-faint:   #86868b;
  --line:         rgba(0, 0, 0, 0.08);
  --line-strong:  rgba(0, 0, 0, 0.16);
  --accent:       #1a3a6c;
  --accent-ink:   #0b2447;

  --font-sans:    "PingFang SC", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif:   "Source Han Serif SC", "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  --font-mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --content-w:    816px;  /* 桌面阅读宽度 +20% */
  --reading-w:    864px;  /* 详情页阅读宽度 +20% */
  --pad-x:        32px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #0a0a0a;
    --bg-soft:      #141414;
    --text:         #f5f5f7;
    --text-muted:   #9a9a9f;
    --text-faint:   #6a6a6f;
    --line:         rgba(255, 255, 255, 0.09);
    --line-strong:  rgba(255, 255, 255, 0.18);
    --accent:       #7fa7d9;
    --accent-ink:   #a8c2df;
  }
}

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 120ms ease;
}

time, .tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

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

/* ---------- Header（精确 70px） ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 0.5px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  height: 70px;
  padding: 0 20px;
  display: flex;
  align-items: center;
}
.site-logo {
  flex-shrink: 0;
  color: var(--text);
  line-height: 0;
  text-decoration: none;
}
.site-logo svg {
  display: block;
  height: 20px;
  width: auto;
}
.site-search {
  margin-left: auto;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0.5px solid var(--line);
  border-radius: 50%;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 120ms ease, border-color 120ms ease;
}
.site-search:hover {
  color: var(--text);
  border-color: var(--line-strong);
}
.site-search svg { display: block; }

/* sr-only for accessibility */
.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;
}

@media (max-width: 640px) {
  .header-inner { padding: 0 16px; }
}

/* ---------- Main container ---------- */
main {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 48px var(--pad-x) 96px;
}
main.reading {
  max-width: var(--reading-w);
}

/* ---------- Hero ---------- */
.hero { margin-bottom: 44px; }
.eyebrow {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: none;
  margin: 0 0 18px;
}
.hero-title {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 20px;
}
.hero-title a { color: inherit; }
.hero-title a:hover { color: var(--accent-ink); }
.hero-dek {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 672px;  /* 560px +20%，与容器宽度同步放大 */
  margin: 0 0 18px;
}
.hero-meta {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.hero-meta .sep {
  display: inline-block;
  margin: 0 8px;
  width: 3px;
  height: 3px;
  background: var(--text-faint);
  border-radius: 999px;
  vertical-align: middle;
}
.hero-meta .category {
  border-left: 1px solid var(--line-strong);
  padding-left: 8px;
  margin-left: 4px;
  color: var(--text-muted);
}
.hero-meta a { color: inherit; }
.hero-meta a:hover { color: var(--accent-ink); }

.hero-rule {
  border: 0;
  height: 0;
  border-bottom: 0.5px solid var(--line-strong);
  margin: 0 0 44px;
}

/* ---------- Section ---------- */
.section { margin-bottom: 64px; }
.section:last-child { margin-bottom: 0; }
.section-head {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 0.5px solid var(--line);
}

/* ---------- Highlights ---------- */
.highlights { list-style: none; padding: 0; margin: 0; }
.highlights > li { padding: 28px 0 0; }
.highlights > li:first-child { padding-top: 14px; }
.highlight-title {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 8px;
}
.highlight-title a { color: inherit; }
.highlight-title a:hover { color: var(--accent-ink); }
.highlight-dek {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.highlight-meta {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-faint);
}
.highlight-meta .sep { margin: 0 6px; }
.highlight-meta .category {
  border-left: 1px solid var(--line-strong);
  padding-left: 8px;
  margin-left: 4px;
  color: var(--text-muted);
}
.highlight-meta a { color: inherit; }
.highlight-meta a:hover { color: var(--accent-ink); }

/* ---------- Timeline ---------- */
.timeline { margin-top: 4px; }
.day-label {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin: 24px 0 14px;
}
.day-label:first-child { margin-top: 0; }

.timeline-list { list-style: none; padding: 0; margin: 0; }
.timeline-list > li {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0;
  border-top: 0.5px solid var(--line);
}
.timeline-list > li:first-child { border-top: 0; padding-top: 0; }
.timeline-time {
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.timeline-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--text);
}
.timeline-title:hover { color: var(--accent-ink); }
.timeline-source {
  font-size: 11px;
  color: var(--text-faint);
  text-align: right;
  white-space: nowrap;
}

.see-more {
  margin-top: 40px;
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
}
.see-more a:hover { color: var(--accent-ink); }

/* ---------- Article detail ---------- */
.article-back {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.article-back:hover { color: var(--accent-ink); }

.article-head { margin-bottom: 40px; }
.article-head .eyebrow { margin-bottom: 12px; }
.article-h1 {
  font-size: 36px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 16px;
}
.article-dek {
  font-size: 18px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 20px;
}
.article-byline {
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 0.5px solid var(--line);
}
.article-byline .sep {
  display: inline-block;
  margin: 0 8px;
  width: 3px;
  height: 3px;
  background: var(--text-faint);
  border-radius: 999px;
}
.article-byline a { color: var(--text-muted); }
.article-byline a:hover { color: var(--accent-ink); }

.article-body {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.9;
  color: var(--text);
}
.article-body p { margin: 0 0 1.4em; }
.article-body a {
  color: var(--accent);
  border-bottom: 1px solid var(--line-strong);
}
.article-body a:hover {
  color: var(--accent-ink);
  border-bottom-color: var(--accent-ink);
}
.article-body h2 {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 1.8em 0 0.5em;
  color: var(--text);
}
.article-body h3 {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.35;
  margin: 1.6em 0 0.4em;
  color: var(--text);
}
.article-body h4 {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  margin: 1.4em 0 0.3em;
  color: var(--text);
}
.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 48px auto;
  border: 0;
}
.article-body figure { margin: 48px 0; }
.article-body figcaption {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
}
.article-body blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--accent);
  color: var(--text-muted);
  font-style: normal;
}
.article-body ul,
.article-body ol {
  padding-left: 1.6em;
  margin: 0 0 1.4em;
}
.article-body li { margin: 0.3em 0; }
.article-body code {
  font-family: var(--font-mono);
  background: var(--bg-soft);
  padding: 1px 6px;
  font-size: 0.9em;
}
.article-body pre {
  font-family: var(--font-mono);
  background: var(--bg-soft);
  padding: 16px 20px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  margin: 1.6em 0;
}
.article-body pre code { background: none; padding: 0; }
.article-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.6em 0;
  font-size: 15px;
  font-family: var(--font-sans);
}
.article-body th,
.article-body td {
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.article-body th {
  font-weight: 500;
  color: var(--text-muted);
  border-bottom-color: var(--line-strong);
}

.article-foot {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 0.5px solid var(--line);
}
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 32px;
}
.article-tags a { color: var(--text-faint); }
.article-tags a:hover { color: var(--accent-ink); }

.article-origin {
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 48px;
}
.article-origin a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  word-break: break-all;
}
.article-origin a:hover { color: var(--accent-ink); border-bottom-color: var(--accent-ink); }

/* ---------- List / category / tag / search ---------- */
.list-head {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 0.5px solid var(--line);
}
.list-h1 {
  font-size: 30px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 6px;
}
.list-count {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- About ---------- */
.about {
  max-width: 620px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}
.about h1 {
  font-size: 30px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 32px;
  padding-bottom: 24px;
  border-bottom: 0.5px solid var(--line);
}
.about h2 {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  margin: 48px 0 14px;
  color: var(--text);
}
.about p { margin: 0 0 1.4em; }
.about ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.4em;
}
.about li {
  padding: 6px 0;
  border-bottom: 0.5px solid var(--line);
}
.about li:last-child { border-bottom: 0; }
.about a {
  color: var(--accent);
  border-bottom: 1px solid var(--line-strong);
}
.about a:hover { color: var(--accent-ink); border-bottom-color: var(--accent-ink); }

/* ---------- 404 ---------- */
.notfound {
  text-align: center;
  padding: 120px 0;
}
.notfound h1 {
  font-size: 36px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  color: var(--text);
}
.notfound p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 24px;
}
.notfound a {
  font-size: 14px;
  color: var(--accent);
}
.notfound a:hover { color: var(--accent-ink); }

/* ---------- Pagination (used on /page/N and list pages) ---------- */
.pagination {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 0.5px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--text-muted);
}
.pagination .pg-btns { display: flex; gap: 24px; }
.pagination a { color: var(--text-muted); }
.pagination a:hover { color: var(--accent-ink); }
.pagination .disabled {
  color: var(--text-faint);
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 0.5px solid var(--line);
  margin: 80px auto 0;
  padding: 48px var(--pad-x) 36px;
  max-width: var(--content-w);
  text-align: center;
}
.footer-tag {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto 28px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.footer-mark {
  display: inline-block;
  color: var(--text);
  line-height: 0;
  margin-bottom: 20px;
  text-decoration: none;
}
.footer-mark svg {
  display: block;
  height: 24px;
  width: auto;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  margin-bottom: 18px;
  font-size: 13px;
}
.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 120ms ease;
}
.footer-nav a:hover { color: var(--text); }
.footer-copy {
  font-size: 11px;
  line-height: 1.65;
  color: var(--text-faint);
}
.footer-copy .sep {
  padding: 0 6px;
  opacity: 0.6;
}

@media (max-width: 640px) {
  .site-footer { margin-top: 56px; padding: 40px var(--pad-x) 28px; }
  .footer-tag  { font-size: 13px; margin-bottom: 24px; }
  .footer-nav  { gap: 18px; font-size: 12px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  :root { --pad-x: 20px; }
  main { padding: 32px var(--pad-x) 64px; }
  .section { margin-bottom: 48px; }
  .hero-title { font-size: 28px; }
  .hero-dek { font-size: 15px; }
  .article-h1 { font-size: 26px; }
  .article-body { font-size: 17px; line-height: 1.85; }
  .article-body h2 { font-size: 22px; }
  .article-body h3 { font-size: 19px; }
  .list-h1 { font-size: 24px; }
  .timeline-list > li {
    grid-template-columns: 44px 1fr;
    row-gap: 4px;
  }
  .timeline-source {
    grid-column: 2;
    text-align: left;
  }
  .about { font-size: 15px; }
  .notfound { padding: 80px 0; }
}

/* ---------- Article cover & TOC ---------- */
.article-cover {
  margin: 16px 0 24px;
}
.article-cover img {
  width: 100%; height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: #f3f3f3;
}

.article-toc {
  margin: 18px 0 26px;
  padding: 14px 18px 14px 20px;
  background: #fafafa;
  border-left: 3px solid #111;
  border-radius: 2px;
  font-size: 14px;
  line-height: 1.7;
}
.article-toc .toc-head {
  margin: 0 0 6px;
  font-weight: 700;
  color: #111;
  letter-spacing: 0.02em;
}
.article-toc ol {
  margin: 0; padding-left: 20px;
}
.article-toc li { margin: 2px 0; }
.article-toc li.toc-h3 {
  margin-left: 16px;
  list-style-type: circle;
  color: #666;
}
.article-toc a {
  color: #333;
  text-decoration: none;
}
.article-toc a:hover { color: #000; text-decoration: underline; }
.article-body h2, .article-body h3 { scroll-margin-top: 24px; }

@media (prefers-color-scheme: dark) {
  .article-cover img { background: #1c1c1c; }
  .article-toc { background: #141414; border-left-color: #eee; }
  .article-toc .toc-head { color: #eee; }
  .article-toc a { color: #cfcfcf; }
  .article-toc a:hover { color: #fff; }
  .article-toc li.toc-h3 { color: #999; }
}

/* ---------- SEO/GEO enhancements ---------- */
.skip-link:focus {
  position: fixed; top: 8px; left: 8px;
  width: auto; height: auto; padding: 8px 12px;
  background: #111; color: #fff; z-index: 1000;
  text-decoration: none; border-radius: 4px;
  clip: auto; clip-path: none; overflow: visible; white-space: nowrap;
}

.breadcrumbs {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 24px 0;
  font-size: 13px;
  color: #666;
}
.breadcrumbs a { color: #666; text-decoration: none; }
.breadcrumbs a:hover { color: #000; text-decoration: underline; }
.breadcrumbs .bc-sep { margin: 0 6px; color: #bbb; }
.breadcrumbs [aria-current="page"] { color: #111; }

.article-license {
  margin-top: 28px;
  padding: 12px 16px;
  border-left: 3px solid #e6e6e6;
  background: #fafafa;
  color: #666;
  font-size: 13px;
  line-height: 1.7;
}

.faq { margin: 16px 0 32px; }
.faq-item {
  border-bottom: 1px solid #eaeaea;
  padding: 12px 0;
}
.faq-item > summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  padding-right: 24px;
  position: relative;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+"; position: absolute; right: 4px; top: 0;
  color: #999; font-weight: 400; font-size: 18px;
}
.faq-item[open] > summary::after { content: "−"; }
.faq-item > div { padding: 6px 0 4px; color: #333; line-height: 1.75; }

.about-head .about-lede {
  font-size: 17px;
  color: #333;
  line-height: 1.7;
}
.about-body h2 {
  margin-top: 28px;
  font-size: 18px;
  font-weight: 700;
}

@media (prefers-color-scheme: dark) {
  .breadcrumbs { color: #888; }
  .breadcrumbs a { color: #aaa; }
  .breadcrumbs a:hover { color: #fff; }
  .breadcrumbs [aria-current="page"] { color: #eee; }
  .article-license { background: #161616; border-left-color: #2a2a2a; color: #999; }
  .faq-item { border-bottom-color: #2a2a2a; }
  .faq-item > div { color: #ccc; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .article-back, .breadcrumbs { display: none; }
  main { padding: 0; max-width: none; }
  .article-body { font-size: 12pt; }
  .faq-item[open] > div, .faq-item > div { display: block !important; }
}
