/* Grok Bot Notes — clean bilingual reading blog */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&display=swap");

:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --accent: #1e3a5f;
  --accent-soft: #3b82f6;
  --accent-bg: #eff6ff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
  --max: 880px;
  --max-wide: 960px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif: "Source Serif 4", "Georgia", "Times New Roman", serif;
  --font-zh: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
html[lang^="zh"] body {
  font-family: var(--font-zh), var(--font);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-soft); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 {
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  color: var(--ink);
  font-weight: 700;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.35rem); }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.55rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
ul, ol { margin: 0 0 1.25em; padding-left: 1.25em; color: var(--ink-soft); }
li { margin-bottom: .4em; }

.container {
  width: min(100%, var(--max-wide));
  margin-inline: auto;
  padding-inline: max(1.25rem, env(safe-area-inset-left)) max(1.25rem, env(safe-area-inset-right));
}
.container-narrow {
  width: min(100%, var(--max));
  margin-inline: auto;
  padding-inline: max(1.25rem, env(safe-area-inset-left)) max(1.25rem, env(safe-area-inset-right));
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: .5rem 1rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .9rem 0; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: .65rem;
  text-decoration: none; color: var(--ink); font-weight: 700;
}
.brand img { width: 32px; height: 32px; }
.brand small {
  display: block; font-weight: 500; font-size: .72rem;
  color: var(--muted); letter-spacing: 0;
}
.nav {
  display: flex; align-items: center; gap: .35rem 1rem; flex-wrap: wrap;
  font-size: .92rem;
}
.nav a {
  text-decoration: none; color: var(--ink-soft); font-weight: 500;
  padding: .3rem .1rem;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }

.lang-switch { position: relative; font-size: .85rem; }
.lang-switch summary {
  list-style: none; cursor: pointer; padding: .35rem .7rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink-soft); font-weight: 500;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch[open] summary { border-color: var(--accent-soft); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + .35rem);
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 130px; padding: .35rem; z-index: 60;
}
.lang-menu a {
  display: block; padding: .4rem .6rem; border-radius: 8px;
  text-decoration: none; color: var(--ink-soft);
}
.lang-menu a:hover, .lang-menu a[aria-current="true"] {
  background: var(--accent-bg); color: var(--accent);
}

/* Hero / page header */
.hero {
  padding: 2.75rem 0 2rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 50% at 10% 0%, rgba(59,130,246,.08), transparent),
    linear-gradient(180deg, #fff 0%, var(--bg) 100%);
}
.hero .page-card {
  max-width: 100%;
}
.hero .page-card .eyebrow { margin-bottom: .85rem; }
.hero .page-card h1 { margin-bottom: .55rem; }
.hero .page-card .lead { margin-bottom: .65em; }
.hero .page-card .lead:last-child { margin-bottom: 0; }
.eyebrow {
  display: inline-block;
  font-size: .75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--accent);
  background: var(--accent-bg); padding: .3rem .7rem; border-radius: 999px;
  margin-bottom: 1rem;
}
.lead { font-size: 1.1rem; color: var(--muted); max-width: 38rem; }
.page-header { padding: 2rem 0 1rem; }
.breadcrumb {
  font-size: .85rem; color: var(--muted); margin-bottom: .75rem;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-soft); }

/* Post list */
.section { padding: 2.25rem 0 3rem; }
.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }

/* Shared card frame (“三角处边框”) — site standard */
.post-card,
.card,
.page-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow); transition: border-color .15s ease;
}
.post-card:hover,
.card:hover,
.page-card:hover { border-color: #bfdbfe; }
.page-card + .page-card { margin-top: 1rem; }
.post-card a.title {
  text-decoration: none; color: var(--ink); font-weight: 700;
  font-size: 1.15rem; display: block; margin-bottom: .35rem;
}
.post-card a.title:hover { color: var(--accent-soft); }
.post-meta {
  font-size: .82rem; color: var(--muted); margin-bottom: .55rem;
  display: flex; gap: .75rem; flex-wrap: wrap;
}
.post-card .excerpt { margin: 0 0 .55em; font-size: .95rem; }
.post-card .excerpt:last-child { margin-bottom: 0; }
.post-card .excerpt-body { margin: .35rem 0 .75rem; }
.post-card .excerpt-body .zh-section .excerpt { margin-bottom: .55em; }
.post-card .excerpt-body .lang-en-section .excerpt { margin-bottom: .55em; font-size: .93em; color: var(--muted); }
.post-card .excerpt-body .lang-en-section { margin-top: 1rem; padding-top: 0.85rem; }
.post-card .read-more {
  display: inline-block; margin-top: .85rem;
  font-size: .88rem; font-weight: 600; text-decoration: none;
  color: var(--accent-soft);
}
.post-card .read-more:hover { color: var(--accent); text-decoration: underline; }


/* Article detail card — same frame as homepage .post-card */
.article-card {
  width: 100%;
  margin-bottom: 0;
}
/* If used without .post-card, inherit the shared frame */
.article-card:not(.post-card) {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
}
.article-card > h1 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  margin-bottom: .35rem;
}
.article-card .prose {
  margin-top: .25rem;
}
/* Article body */
.article {
  padding: 1.5rem 0 3rem;
}
.article .post-meta { margin-bottom: 1.5rem; }
.prose {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
}
html[lang^="zh"] .prose {
  font-family: var(--font-zh), var(--font);
  font-size: 1rem;
  line-height: 1.7;
}
.article .prose p,
.article .prose li {
  font-size: 0.98rem;
  line-height: 1.7;
}
.article .prose p {
  margin: 0 0 0.55em;
}
.article .prose .zh-section > p:last-child {
  margin-bottom: 0;
}
.prose h2 { margin-top: 2rem; font-family: var(--font); }
html[lang^="zh"] .prose h2 { font-family: var(--font-zh), var(--font); }
.prose h3 { margin-top: 1.5rem; font-family: var(--font); }
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--accent-bg);
  padding: .12em .35em;
  border-radius: 4px;
}
.prose blockquote {
  margin: 1.25em 0;
  padding: .75rem 1rem;
  border-left: 3px solid var(--accent-soft);
  background: var(--accent-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-soft);
}
.prose blockquote p:last-child { margin-bottom: 0; }

/* About / contact — .card frame unified with .post-card above */
.contact-grid {
  display: grid; gap: 1.5rem;
}
@media (min-width: 800px) {
  .contact-grid { grid-template-columns: 1.2fr .8fr; align-items: start; }
}

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: .88rem; font-weight: 600;
  color: var(--ink); margin-bottom: .35rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: .65rem .8rem;
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: 2px solid #93c5fd; outline-offset: 1px; border-color: var(--accent-soft);
}
.form-row {
  display: grid; gap: 1rem;
}
@media (min-width: 560px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}
.form-honeypot {
  position: absolute; left: -9999px; height: 0; overflow: hidden;
}
.form-actions {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-top: .5rem;
}
.form-note { font-size: .85rem; color: var(--muted); margin: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .65rem 1.25rem; border-radius: 999px; font-weight: 600;
  font-size: .92rem; border: none; cursor: pointer; text-decoration: none;
}
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover { background: #152a45; color: #fff; }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-secondary {
  background: var(--card); color: var(--accent);
  border: 1px solid var(--line);
}
.btn-secondary:hover { border-color: var(--accent-soft); color: var(--accent-soft); }

.notice {
  margin-top: 1rem; padding: .75rem 1rem; border-radius: 8px;
  background: #ecfdf5; color: #065f46; font-size: .92rem;
}
.notice-error { background: #fef2f2; color: #991b1b; }

.channel-list {
  list-style: none; padding: 0; margin: 0 0 1rem;
}
.channel-list li {
  margin-bottom: 1rem;
  display: flex; flex-direction: column; gap: .25rem;
}
.channel-list strong { color: var(--ink); font-size: .9rem; }
.wechat-qr {
  width: 148px; height: 148px;
  border: 1px solid var(--line); border-radius: 8px; margin-top: .5rem;
}
.muted { color: var(--muted); font-size: .95rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 2.25rem 0 2rem;
  margin-top: auto;
}
.footer-grid {
  display: grid; gap: 1.5rem;
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.site-footer h3 {
  font-size: .85rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin-bottom: .65rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent-soft); }
.footer-bottom {
  margin-top: 1.75rem; padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: .85rem; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  justify-content: space-between;
}

body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }


/* Post figures / screenshots */
.post-figure {
  margin: 1.15rem 0 1.35rem;
}
.post-figure img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #fff;
}
.post-figure figcaption {
  margin-top: .55rem;
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.45;
}
.post-card .post-figure {
  margin: .75rem 0 .9rem;
}
.post-card .post-figure img {
  max-width: min(100%, 420px);
}

/* Bilingual layout: full Chinese block, then gap, then English section */
.zh-section {
  margin-bottom: 0;
}
.zh-section > p:last-child {
  margin-bottom: 0;
}
.lang-en-section {
  margin-top: 1.75rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font);
}
.lang-en-section--compact {
  margin-top: 1rem;
  padding-top: 0.85rem;
}
.lang-en-section > p,
.lang-en-section > h2,
.lang-en-section > h3 {
  color: var(--muted);
}
.lang-en-section > p {
  font-size: 0.96em;
  line-height: 1.75;
  margin-bottom: 1em;
}
.lang-en-section > p:last-child {
  margin-bottom: 0;
}
.lang-en-section > h2 {
  margin-top: 1.5rem;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  color: var(--ink-soft);
}
.lang-en-section > h2:first-of-type {
  margin-top: 0.35rem;
}
.en-notice {
  font-style: italic;
  color: var(--muted);
  font-size: 0.85em;
  line-height: 1.55;
  margin: 1.1em 0 0;
  font-family: var(--font), sans-serif;
}
.lang-en-section > .en-notice:last-child {
  margin-bottom: 0;
}
.post-card .excerpt-body .lang-en-section .en-notice {
  margin-top: 0.85em;
  margin-bottom: 0;
  font-size: 0.82em;
}

/* Back to home */
.back-home {
  margin: 0 0 1rem;
}
.back-home--after {
  margin: 1.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.back-home .btn {
  font-size: 0.88rem;
  padding: 0.5rem 1.05rem;
}
.lang-zh {
  margin-bottom: 0.35em;
}
.lang-en {
  color: var(--muted);
  font-size: 0.95em;
  margin-bottom: 1.15em;
  font-family: var(--font), var(--font-serif);
}
.hero .lang-en.lead,
.page-header .lang-en.lead,
.page-header .lang-en-section .lead {
  margin-top: 0;
  max-width: 38rem;
}
.site-footer .lang-en {
  margin-bottom: 0;
  font-size: 0.9em;
}
/* Hide unused lang-switch if any leftover markup appears */
.lang-switch { display: none; }


/* About page: ZH heading+EN on same line; EN paragraph right after ZH */
.about-block { margin-bottom: 1.75rem; }
.about-block > h2 { margin-bottom: .55rem; }
.about-block > p.lang-en,
.about-block > ul.lang-en {
  margin-top: .65rem;
  color: var(--muted);
  font-size: .98em;
}
.about-block > ul.lang-en { padding-left: 1.25em; }
.about-block--last { margin-bottom: 0; }
.page-card .about-block:last-child { margin-bottom: 0; }
