:root {
  --ink: #29231f;
  --muted: #756e68;
  --brand: #754426;
  --brand-dark: #60371f;
  --line: #e8dfd8;
  --cream: #faf9fc;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 15px/1.75 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid #c1987c; outline-offset: 4px; }
.wrap { width: min(1080px, calc(100% - 40px)); margin: auto; }
.site-header { background: #fff; border-bottom: 1px solid #eeeef3; }
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; white-space: nowrap; }
.logo { width: 34px; height: 34px; object-fit: contain; }
.navlinks { display: flex; align-items: center; gap: 27px; color: #5c5550; font-size: 14px; }
.navlinks a[aria-current] { color: var(--brand); font-weight: 700; }
.navlinks a:hover, .site-footer a:hover { color: var(--brand); }
.tutorials-main { padding: 34px 0 64px; min-height: calc(100vh - 190px); }
.breadcrumbs { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.breadcrumbs a:hover { color: var(--brand); text-decoration: underline; }
.tutorials-intro { margin-bottom: 28px; }
.eyebrow { margin: 0 0 10px; color: var(--brand); font-size: 13px; font-weight: 700; letter-spacing: 1px; }
h1 { margin: 0 0 14px; font-size: 36px; line-height: 1.35; letter-spacing: -1px; overflow-wrap: anywhere; }
.tutorials-intro > p:last-child { margin: 0; color: var(--muted); font-size: 16px; }
.search-form { display: flex; align-items: stretch; gap: 10px; max-width: 660px; margin-bottom: 32px; }
.search-form input { min-width: 0; flex: 1; padding: 11px 16px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.search-form input::placeholder { color: #938b85; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 11px 22px; border: 1px solid transparent; border-radius: 10px; color: #fff; background: var(--brand); font-weight: 700; transition: background .15s ease; white-space: nowrap; }
.button:hover { background: var(--brand-dark); }
.button.light { color: var(--brand); background: #f7eade; border-color: #e8d6c7; }
.button.light:hover { background: #f0ddcc; }
.search-summary { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 20px; font-size: 14px; }
.search-summary p { margin: 0; overflow-wrap: anywhere; }
.search-summary span { color: var(--muted); }
.search-summary a { color: var(--brand); white-space: nowrap; }
.tutorial-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.tutorial-card { display: flex; flex-direction: column; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 7px 18px rgba(82, 50, 31, .025); }
.tutorial-card h2 { margin: 0 0 10px; font-size: 23px; line-height: 1.45; overflow-wrap: anywhere; }
.tutorial-card h2 a:hover { color: var(--brand); }
.tutorial-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 12px; }
.tutorial-excerpt { margin: 16px 0 22px; color: #645c56; font-size: 14px; overflow-wrap: anywhere; }
.read-more { display: inline-flex; align-items: center; gap: 8px; width: fit-content; color: var(--brand); font-size: 14px; font-weight: 700; }
.tutorial-card .read-more { margin-top: auto; }
.read-more:hover { text-decoration: underline; }
.empty-state { grid-column: 1 / -1; padding: 58px 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; text-align: center; }
.empty-state h2 { margin: 0 0 10px; font-size: 23px; }
.empty-state > p { margin: 0 0 24px; color: var(--muted); }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 36px; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; }
a.page-link:hover { border-color: var(--brand); color: var(--brand); }
.page-link.current { color: #fff; background: var(--brand); border-color: var(--brand); }
.page-gap { color: var(--muted); padding: 0 2px; }
.article-card { max-width: 900px; margin: auto; padding: 42px 48px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 7px 18px rgba(82, 50, 31, .025); }
.article-header { margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid #eee7e1; }
.article-header h1 { font-size: 34px; }
.article-excerpt { margin: 20px 0 0; color: #645c56; font-size: 17px; }
.article-body { color: #443d37; font-size: 16px; line-height: 1.9; overflow-wrap: anywhere; }
.article-body > :first-child { margin-top: 0; }
.article-body > :last-child { margin-bottom: 0; }
.article-body h1, .article-body h2, .article-body h3, .article-body h4, .article-body h5, .article-body h6 { margin: 1.7em 0 .7em; color: var(--ink); line-height: 1.5; letter-spacing: 0; }
.article-body h1 { font-size: 28px; }
.article-body h2 { font-size: 25px; }
.article-body h3 { font-size: 21px; }
.article-body h4 { font-size: 18px; }
.article-body h5, .article-body h6 { font-size: 16px; }
.article-body p, .article-body ul, .article-body ol { margin: 0 0 1.25em; }
.article-body ul, .article-body ol { padding-left: 1.6em; }
.article-body li + li { margin-top: .35em; }
.article-body li > p { margin: .35em 0; }
.article-body a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.article-body img { display: block; height: auto; margin: 1.5em auto; border-radius: 10px; }
.article-body blockquote { margin: 1.4em 0; padding: 14px 20px; border-left: 3px solid #c69879; border-radius: 0 8px 8px 0; color: #675950; background: #fcf7f2; }
.article-body blockquote > :last-child { margin-bottom: 0; }
.article-body code { padding: 2px 5px; border-radius: 5px; background: #f4f0ed; color: #67472f; font: .88em/1.6 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
.article-body pre { max-width: 100%; margin: 1.4em 0; padding: 18px 20px; overflow-x: auto; border: 1px solid #e8e1db; border-radius: 10px; background: #f7f5f3; overflow-wrap: normal; }
.article-body pre code { padding: 0; background: transparent; white-space: pre; color: #403b37; }
.article-body table { display: block; max-width: 100%; margin: 1.4em 0; overflow-x: auto; border-collapse: collapse; font-size: 14px; }
.article-body th, .article-body td { min-width: 100px; padding: 10px 14px; border: 1px solid var(--line); text-align: left; }
.article-body th { color: var(--ink); background: #f6eee8; font-weight: 700; }
.article-body tr:nth-child(even) td { background: #fcfaf8; }
.article-body hr { margin: 2em 0; border: 0; border-top: 1px solid var(--line); }
.article-body input[type="checkbox"] { margin-right: 8px; accent-color: var(--brand); }
.article-footer { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 18px; margin-top: 40px; padding-top: 22px; border-top: 1px solid #eee7e1; color: var(--brand); font-size: 14px; }
.article-footer a:hover { text-decoration: underline; }
.message-state { max-width: 700px; margin: 52px auto; }
.message-state .status-code { margin-bottom: 14px; color: #ae8770; font-size: 46px; font-weight: 800; line-height: 1; }
.message-state h1 { font-size: 28px; }
.site-footer { padding: 26px 0; border-top: 1px solid #eeeef3; background: #fff; }
.footer-content { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-brand { font-size: 16px; }
.footer-brand .logo { width: 26px; height: 26px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--muted); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 10px 16px; background: var(--brand); color: #fff; border-radius: 8px; }
.skip-link:focus { top: 12px; }

@media (max-width: 700px) {
  .wrap { width: calc(100% - 28px); }
  .nav { min-height: 66px; gap: 12px; }
  .brand { font-size: 17px; gap: 7px; }
  .brand .logo { width: 30px; height: 30px; }
  .navlinks { gap: 14px; font-size: 12px; }
  .tutorials-main { padding: 24px 0 42px; }
  .breadcrumbs { margin-bottom: 24px; font-size: 12px; }
  h1 { font-size: 28px; letter-spacing: -.5px; }
  .tutorials-intro > p:last-child { font-size: 14px; }
  .search-form { gap: 8px; margin-bottom: 24px; }
  .search-form input { padding: 10px 12px; }
  .search-form .button { padding: 10px 14px; font-size: 13px; }
  .search-summary { flex-wrap: wrap; gap: 6px; font-size: 13px; }
  .tutorial-grid { grid-template-columns: 1fr; gap: 14px; }
  .tutorial-card { padding: 22px; }
  .tutorial-card h2 { font-size: 21px; }
  .empty-state { padding: 42px 20px; }
  .article-card { padding: 26px 20px; border-radius: 15px; }
  .article-header { margin-bottom: 26px; padding-bottom: 22px; }
  .article-header h1 { font-size: 27px; }
  .article-excerpt { font-size: 15px; }
  .article-body { font-size: 15px; line-height: 1.85; }
  .article-body h1 { font-size: 25px; }
  .article-body h2 { font-size: 22px; }
  .article-body h3 { font-size: 19px; }
  .article-body pre { padding: 14px; }
  .article-body blockquote { padding: 12px 15px; }
  .footer-content { flex-direction: column; align-items: flex-start; gap: 14px; }
  .message-state { margin: 32px auto; }
}

@media (max-width: 380px) {
  .nav { flex-wrap: wrap; padding: 12px 0; gap: 8px; }
  .navlinks { width: 100%; justify-content: space-between; }
  .page-link { min-width: 36px; min-height: 36px; padding: 6px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}

.article-toc { margin: 0 0 32px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 12px; background: #faf9fc; }
.article-toc h2 { margin: 0 0 10px; font-size: 15px; }
.article-toc ol { margin: 0; padding: 0 0 0 20px; font-size: 14px; color: var(--muted); }
.article-toc li + li { margin-top: 6px; }
.article-toc .toc-level-3 { margin-left: 16px; }
.article-toc a:hover { color: var(--brand); text-decoration: underline; }
.article-body :is(h2,h3) { scroll-margin-top: 24px; }
