/*
Theme Name: Liningyao
Theme URI: https://www.liningyao.com/
Author: 李宁姚 Jack Lee
Description: 外贸 × AI × Web Coding × SEO/GEO 个人实战博客主题。色块杂志风格，应用式侧边导航，支持深色模式。
Version: 1.0.1
Requires PHP: 7.4
Text Domain: liningyao
*/

:root {
  --bg: #EFEDE5; --tile: #FFFFFF; --soft: #F3F1EA; --ink: #121212; --dim: #505050; --line: #DFDDD5; --link: #1B2FD6;
  --hero: #D42E16; --cobalt: #1B2FD6; --butter: #FFCF3F; --mint: #BDE7D2; --lilac: #E3DAFF; --black: #121212; --paper: #F7F6F1;
  --sans: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, Menlo, monospace;
  --pad: clamp(22px, 3vw, 34px);
}
[data-theme="dark"] {
  --bg: #0F0F10; --tile: #1C1C1F; --soft: #2A2A2E; --ink: #F4F3EE; --dim: #B6B6BB; --line: #333338; --link: #A9B7FF;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 20px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.7; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-weight: 900; line-height: 1.3; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; padding: 8px 14px; background: var(--ink); color: var(--bg); border-radius: 8px; }

/* Shell */
.app { display: flex; align-items: flex-start; min-height: 100vh; }
.side { position: sticky; top: 0; flex: 0 0 232px; height: 100vh; display: flex; flex-direction: column; gap: 10px; padding: 18px 12px 14px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 6px; }
.brand svg { flex: none; width: 44px; height: 44px; }
.brand b { display: block; font-size: 18px; font-weight: 900; line-height: 1.25; }
.brand i { display: block; font-family: var(--serif); font-size: 17px; line-height: 1.25; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav p { margin: 14px 0 2px; padding: 0 12px; font-family: var(--mono); font-size: 12px; color: var(--dim); }
.nav a { display: flex; align-items: center; min-height: 42px; padding: 0 12px; border-radius: 12px; font-size: 15px; font-weight: 500; }
.nav a:hover { background: var(--tile); }
.nav a[aria-current="page"] { background: var(--hero); color: #FFF; }
.side-card { margin-top: auto; padding: 16px; background: var(--butter); color: var(--black); border-radius: 16px; }
.side-card b { display: block; font-size: 15px; font-weight: 900; }
.side-card span { display: block; margin: 2px 0 10px; font-size: 13px; }
.side-card a { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 10px; background: var(--black); color: var(--paper); font-size: 14px; font-weight: 700; }
.col { flex: 1 1 auto; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px clamp(12px, 2vw, 20px) 10px; }
.search { flex: 0 1 480px; min-width: 0; display: flex; }
.search input { width: 100%; min-height: 46px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--tile); font-size: 14px; }
.search input::placeholder { color: var(--dim); opacity: 1; }
.toggle { flex: none; display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--tile); cursor: pointer; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 2px clamp(12px, 2vw, 20px) 24px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.tabbar { display: none; }

/* Tiles */
.tile { background: var(--tile); border-radius: 24px; padding: var(--pad); }
.lift { transition: transform .22s ease; }
.lift:hover { transform: translateY(-4px); }
.c-hero { background: var(--hero); color: #FFF; }
.c-cobalt { background: var(--cobalt); color: #FFF; }
.c-butter { background: var(--butter); color: var(--black); }
.c-mint { background: var(--mint); color: var(--black); }
.c-lilac { background: var(--lilac); color: var(--black); }
.c-black { background: var(--black); color: var(--paper); }
.mono { font-family: var(--mono); font-size: 12px; }
.dim { color: var(--dim); }
.big { font-size: clamp(28px, 3.4vw, 40px); }
.head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.more { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 700; color: var(--link); }
.c-black .more { color: var(--butter); }
.c-butter .more { color: var(--black); }
.grid { display: grid; gap: 14px; }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.gc { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.gr { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.split { display: flex; flex-wrap: wrap; gap: 14px; }
.split > .wide { flex: 999 1 460px; min-width: 0; }
.split > .narrow { flex: 1 1 320px; min-width: 0; }

/* Banner */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: clamp(26px, 4vw, 52px); border-radius: 24px; overflow: hidden; }
.hero .txt { flex: 999 1 420px; min-width: 0; }
.hero .art { flex: 1 1 340px; min-width: 0; max-width: 460px; }
.hero h1 { font-size: clamp(44px, 6vw, 82px); line-height: 1.12; letter-spacing: -.02em; }
.hero .lead { margin: 22px 0 28px; max-width: 480px; font-size: 18px; line-height: 1.75; }
.hero .kicker { margin-bottom: 22px; font-family: var(--mono); font-size: 13px; letter-spacing: .05em; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; min-height: 50px; padding: 0 24px; border-radius: 12px; background: #FFF; color: var(--black); font-weight: 700; }
.btn.ghost { border: 1px solid #FFF; background: transparent; color: #FFF; }
.banner { padding: clamp(26px, 4vw, 48px); border-radius: 24px; }
.banner h1 { font-size: clamp(40px, 6vw, 76px); line-height: 1.14; letter-spacing: -.02em; }
.banner p { margin-top: 12px; max-width: 580px; font-size: 18px; }
.banner .kicker { margin: 0 0 10px; font-family: var(--mono); font-size: 13px; }

/* Cards */
.start { display: block; padding: 22px; border-radius: 20px; background: var(--tile); }
.start b { display: block; margin-top: 8px; font-size: 21px; font-weight: 900; line-height: 1.4; }
.start em { display: block; margin-top: 12px; font-size: 14px; font-style: normal; font-weight: 700; color: var(--link); }
.line { display: flex; flex-direction: column; justify-content: space-between; min-height: 220px; padding: 22px; border-radius: 20px; }
.line .r { display: flex; justify-content: space-between; align-items: flex-start; }
.line .mark { font-family: var(--serif); font-size: 64px; line-height: 1; }
.line b { display: block; font-size: 24px; font-weight: 900; line-height: 1.35; }
.line span.d { display: block; margin-top: 4px; font-size: 14px; }
.feature { display: flex; flex-wrap: wrap; border-radius: 24px; background: var(--tile); overflow: hidden; }
.feature img { flex: 1 1 420px; min-width: 0; width: 100%; object-fit: cover; }
.feature .t { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: clamp(24px, 3.4vw, 44px); }
.feature b { margin-top: 12px; font-size: clamp(26px, 3vw, 38px); font-weight: 900; line-height: 1.32; }
.feature span.g { margin-top: 12px; color: var(--dim); }
.feature em { margin-top: 18px; font-size: 15px; font-style: normal; font-weight: 700; color: var(--link); }
.card { display: flex; flex-direction: column; border-radius: 20px; background: var(--tile); overflow: hidden; }
.card img { width: 100%; aspect-ratio: 8 / 5; object-fit: cover; }
.card .t { display: flex; flex: 1 1 auto; flex-direction: column; gap: 6px; padding: 18px 20px 20px; }
.card b { font-size: 19px; font-weight: 700; line-height: 1.5; }
.card span.g { font-size: 14px; line-height: 1.65; color: var(--dim); }
.card.flat { border-radius: 0; background: transparent; overflow: visible; }
.card.flat img { border-radius: 14px; }
.card.flat .t { padding: 12px 0 0; }
.c-black .card.flat span.g { color: #D5D4CE; }
.c-black .card.flat .dim { color: #D5D4CE; }
.row { display: flex; justify-content: space-between; gap: 16px; min-height: 50px; padding: 11px 0; border-top: 1px solid currentColor; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; border-radius: 18px; background: var(--tile); }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--soft); font-size: 15px; font-weight: 500; cursor: pointer; }
.chip[aria-current="page"], .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.tag { align-self: flex-start; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.caserow { display: flex; flex-wrap: wrap; border-radius: 20px; background: var(--tile); overflow: hidden; }
.caserow img { flex: 1 1 300px; min-width: 0; width: 100%; object-fit: cover; }
.caserow .t { flex: 999 1 420px; min-width: 0; padding: 24px 26px; }
.caserow b { display: block; margin: 6px 0 8px; font-size: 24px; font-weight: 900; line-height: 1.4; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
.pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--tile); font-size: 15px; }
.pager .current { background: var(--ink); color: var(--bg); }
.list-row { display: flex; flex-wrap: wrap; gap: 2px 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.list-row time { flex: 0 0 96px; font-family: var(--mono); font-size: 13px; color: var(--dim); }
.list-row b { flex: 999 1 300px; min-width: 0; font-size: 17px; font-weight: 500; }
.bar { display: flex; gap: 4px; height: 44px; margin-top: 28px; }
.bar span { border-radius: 8px; min-width: 6px; }

/* Article */
.ahead { display: flex; flex-wrap: wrap; border-radius: 24px; overflow: hidden; }
.ahead .t { flex: 999 1 460px; min-width: 0; padding: clamp(26px, 4vw, 48px); }
.ahead img { flex: 1 1 300px; align-self: center; min-width: 0; max-width: 400px; height: auto; margin: 0 clamp(20px, 3vw, 36px) clamp(20px, 3vw, 36px); margin-top: clamp(20px, 3vw, 36px); border-radius: 16px; }
.ahead h1 { font-size: clamp(32px, 4.4vw, 54px); line-height: 1.24; }
.ahead .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 22px; font-size: 14px; }
.ahead .ev { padding: 2px 12px; border-radius: 999px; background: var(--black); color: var(--paper); }
.alayout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px; }
.abody { flex: 999 1 560px; min-width: 0; padding: clamp(24px, 4vw, 52px); border-radius: 20px; background: var(--tile); font-size: 18px; line-height: 1.95; }
.aside { flex: 1 1 250px; min-width: 0; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 14px; }
.aside .box { padding: 20px 22px; border-radius: 20px; background: var(--tile); }
.aside .box a { display: block; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.5; }
.abody > *:first-child { margin-top: 0; }
.abody p, .abody ul, .abody ol, .abody blockquote, .abody table, .abody pre { margin: 0 0 16px; }
.abody h2 { margin: 40px 0 10px; font-size: 30px; line-height: 1.35; }
.abody h3 { margin: 28px 0 8px; font-size: 22px; }
.abody a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.abody ul, .abody ol { padding-left: 1.3em; }
.abody li { margin-bottom: 6px; }
.abody img { border-radius: 12px; height: auto; }
.abody blockquote { padding: 4px 0 4px 18px; border-left: 4px solid var(--hero); color: var(--dim); }
.abody table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
.abody th, .abody td { padding: 9px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.abody th { background: var(--soft); }
.abody code { padding: 1px 6px; border-radius: 6px; background: var(--soft); font-family: var(--mono); font-size: .86em; }
.abody pre { position: relative; padding: 16px; border-radius: 14px; overflow-x: auto; background: var(--black); color: var(--paper); font-family: var(--mono); font-size: 14px; line-height: 1.7; white-space: pre; }
.abody pre code { padding: 0; background: transparent; color: inherit; font-size: inherit; }
.copy { position: absolute; top: 8px; right: 8px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--butter); color: var(--black); font-size: 13px; font-weight: 700; cursor: pointer; }
.tldr { margin: 0 0 28px; padding: 22px 24px; border-radius: 16px; background: var(--butter); color: var(--black); font-size: 16px; line-height: 1.75; }
.tldr p { margin: 0 0 8px; font-size: 20px; font-weight: 900; }
.tldr ol { margin: 0; padding-left: 1.2em; }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; margin: 0 0 16px; font-size: 16px; line-height: 1.75; }
.compare > div { padding: 20px; border-radius: 14px; background: var(--soft); }
.compare > div.after { background: var(--mint); color: var(--black); }
.compare p { margin: 0; }
.compare p.h { margin-bottom: 6px; font-weight: 900; }
.verdict { margin: 32px 0 16px; padding: 22px 24px; border-radius: 16px; background: var(--lilac); color: var(--black); font-size: 17px; }
.verdict p { margin: 0; }
.verdict p.h { margin-bottom: 4px; font-size: 19px; font-weight: 900; }
.sources { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--dim); }
.sources p { margin: 0 0 4px; font-weight: 700; }
.sources ul { margin: 0; padding-left: 1.2em; }
.sources a { color: var(--dim); }
.abody details { border-top: 1px solid var(--line); font-size: 17px; }
.abody details:last-of-type { border-bottom: 1px solid var(--line); }
.abody summary { min-height: 54px; padding: 12px 0; font-weight: 700; cursor: pointer; }
.old-note { padding: 14px 18px; border-radius: 14px; background: var(--soft); font-size: 15px; }
.comments { padding: var(--pad); border-radius: 20px; background: var(--tile); }
.comments ol { margin: 0 0 20px; padding: 0; list-style: none; }
.comments li { padding: 12px 0; border-top: 1px solid var(--line); }
.comments input[type=text], .comments input[type=email], .comments input[type=url], .comments textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.comments .submit { min-height: 44px; padding: 0 20px; border: 0; border-radius: 10px; background: var(--ink); color: var(--bg); font-weight: 700; cursor: pointer; }
.step { display: flex; gap: 12px; min-height: 46px; padding: 9px 0; border-top: 1px solid currentColor; font-size: 15px; }
.step span { flex: none; font-family: var(--mono); }
.qa { padding: 24px 26px; border-radius: 20px; background: var(--tile); }
.qa h2 { font-size: 22px; line-height: 1.45; }
.qa p { margin-top: 8px; font-size: 17px; }
.qa a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 700; color: var(--link); }
.yr b { display: block; font-family: var(--serif); font-size: 38px; font-weight: 400; line-height: 1.1; color: var(--link); }
.yr { padding-top: 12px; border-top: 2px solid var(--ink); }
.foot { margin-top: 14px; padding: clamp(24px, 3vw, 36px); border-radius: 24px; background: var(--tile); }
.foot .cols { display: flex; flex-wrap: wrap; gap: 28px 56px; }
.foot .slogan { font-family: var(--serif); font-size: 34px; line-height: 1.2; }
.foot .c { flex: 1 1 110px; font-size: 14px; }
.foot .c b { display: block; margin-bottom: 6px; }
.foot .c a { display: block; padding: 3px 0; color: var(--dim); }
.foot .copy-line { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--dim); }

@media (max-width: 860px) {
  .side { display: none; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--tile); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; align-items: center; justify-content: center; min-width: 60px; min-height: 48px; font-size: 13px; }
  .tabbar a[aria-current="page"] { font-weight: 700; color: var(--hero); }
  body { padding-bottom: 72px; }
  .aside { position: static; order: -1; flex-basis: 100%; }
  .abody { font-size: 17px; }
  .abody h2 { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) { .lift { transition: none; } html { scroll-behavior: auto; } }
@media print { .side, .top, .tabbar, .aside, .foot { display: none; } .abody { padding: 0; } }
