/* Shared AI theme. Keep legacy rich-text/layout compatibility in blog-style.css. */
:root {
    color-scheme: dark;
    --paper: #080f1b;
    --surface: #101c2c;
    --ink: #edf3fc;
    --ink-soft: #b5c2d5;
    --muted: #91a3bd;
    --line: #26384f;
    --accent: #62def5;
    --accent-weak: #132e40;
    --code-bg: #142335;
    --font-serif: var(--font-sans);
    --site-w: 1200px;
    --r-sm: 12px;
}

body {
    font-size: 16px;
    line-height: 1.75;
    background: var(--paper);
}

::selection {
    background: #245f77;
    color: #fff;
}

a, button, input {
    -webkit-tap-highlight-color: transparent;
}

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

button, input {
    font: inherit;
}

img {
    max-width: 100%;
}

.container {
    width: min(100% - 64px, var(--site-w));
    padding: 0;
    margin: 0 auto;
}

#header {
    min-height: 83px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav {
    background: rgba(8, 15, 27, .95);
    border-bottom: 1px solid #172538;
}

.nav-in {
    min-height: 82px;
    gap: 32px;
    padding: 14px 0;
}

.brand {
    display: inline-flex;
    gap: 12px;
    align-items: center;
    font-size: 22px;
    letter-spacing: .03em;
}

.brand b, .footer-brand b {
    color: var(--ink);
}

.brand-mark {
    color: #dceaff;
    font: 700 29px/1 monospace;
    letter-spacing: -4px;
    padding-right: 4px;
}

.nav-links {
    gap: 28px;
    margin: 0 auto;
}

.nav-links a {
    font-size: 16px;
    padding: 12px 0;
    position: relative;
}

.nav-links a.on::after {
    content: '';
    position: absolute;
    height: 2px;
    background: var(--accent);
    left: 0;
    right: 0;
    bottom: 3px;
}

.search {
    background: #0e1928;
    border-color: var(--line);
    font-size: 14px;
    width: 190px;
    height: 40px;
}

.search:focus {
    width: 190px;
}

.nav-toggle {
    background: var(--surface);
    color: var(--ink);
    width: 44px;
    height: 44px;
}

.nav-toggle[aria-expanded="true"] .bars i:first-child {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .bars i:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .bars i:last-child {
    transform: translateY(-7px) rotate(-45deg);
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 20px;
    z-index: 100;
    background: var(--accent);
    color: #07121d;
    padding: 12px 20px;
    border-radius: 6px;
}

.skip-link:focus {
    top: 10px;
}

.layout, .layout.no-aside {
    width: min(100% - 64px, var(--site-w));
    max-width: var(--site-w);
    margin: 0 auto;
    padding: 64px 0 32px;
    min-height: 60vh;
}

.main {
    min-width: 0;
}

.eyebrow {
    display: block;
    font: 12px/1.6 'SFMono-Regular', Consolas, monospace;
    letter-spacing: .25em;
    color: #a6bbdb;
    margin-bottom: 20px;
}

.hero {
    border-bottom: 1px solid var(--line);
    padding-bottom: 36px;
    margin-bottom: 28px;
}

.hero h1, .about-hero h1 {
    color: var(--ink);
    font-size: clamp(32px, 4.3vw, 52px);
    letter-spacing: -.03em;
    line-height: 1.25;
    margin-bottom: 16px;
}

.hero p {
    max-width: 760px;
    color: var(--ink-soft);
    font-size: 18px;
}

body[data-page="home"] .layout {
    padding-top: 12px;
}

.home-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    gap: 24px;
    padding: 8px 0 28px;
    min-height: 560px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 44px;
}

.home-hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 -24px 0 30%;
    pointer-events: none;
    background: linear-gradient(#395b8020 1px, transparent 1px), linear-gradient(90deg, #395b8020 1px, transparent 1px), radial-gradient(ellipse at center, #15314c50, transparent 70%);
    background-size: 64px 64px, 64px 64px, 100% 100%;
    mask-image: radial-gradient(ellipse, black 20%, transparent 72%);
}

.home-hero h1 {
    font-size: clamp(40px, 4.9vw, 66px);
    line-height: 1.27;
    letter-spacing: -.025em;
    margin: 0 0 24px;
}

.gradient-text {
    color: #69d8ef;
    background: linear-gradient(100deg, #59e3f5, #9a82ee);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.home-hero h2 {
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 12px;
}

.hero-description {
    max-width: 540px;
    color: var(--ink-soft);
    font-size: 17px;
    line-height: 1.9;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.button-primary, .button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 46px;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--accent);
}

.button-primary {
    background: var(--accent);
    color: #081723;
}

.button-primary:hover {
    background: #99edfc;
}

.button-secondary {
    color: var(--ink);
    border-color: #526b89;
    background: transparent;
}

.button-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.hero-art {
    margin: 0;
    min-width: 0;
    width: 100%;
    max-width: 540px;
    justify-self: end;
}

.hero-art img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    -webkit-mask-image: radial-gradient(ellipse, black 40%, transparent 72%);
    mask-image: radial-gradient(ellipse, black 40%, transparent 72%);
}

.hero-art figcaption {
    text-align: right;
    font-size: 13px;
    letter-spacing: .14em;
    color: #a7bfdf;
    margin-top: -12px;
}

.home-motto {
    margin-top: 28px;
    padding: 6px 0 6px 18px;
    gap: 6px 16px;
    border-left: 3px solid #87a9e8;
    border-radius: 0;
    background: none;
}

.home-motto-label {
    font-size: 16px;
    line-height: 1.8;
    font-weight: 500;
    color: #a6bbdb;
    letter-spacing: .08em;
}

.home-motto-text {
    font-size: clamp(17px, 1.5vw, 20px);
    line-height: 1.8;
    font-weight: 500;
    color: #d1def0;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.section-heading h2 {
    border-left: 3px solid #91b3ff;
    padding-left: 12px;
    font-size: 28px;
    line-height: 1;
    margin: 0 0 4px;
}

.section-heading .eyebrow {
    margin: 0;
}

.text-link {
    color: #a8d7ff;
    font-size: 16px;
    text-decoration: none;
}

.text-link:hover {
    color: var(--accent);
}

.post-list {
    display: grid;
    gap: 22px;
}

body[data-page="home"] .post-list, body[data-page="tech-share"] .post-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post, .post:last-child {
    padding: 18px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    transition: border-color .2s, transform .2s;
}

.post:hover {
    border-color: #5b85ad;
    transform: translateY(-3px);
}

.post-cover {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 16/10;
    background: #0b1525 center/cover no-repeat;
    border-radius: 7px;
    margin-bottom: 18px;
}

.cover-0 {
    background-image: url('/pc/images/ai/neural-core.webp');
}

.cover-1 {
    background-image: url('/pc/images/ai/ai-layers.webp');
}

.cover-2 {
    background-image: url('/pc/images/ai/ai-path.webp');
}

.post-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.post-head {
    gap: 10px;
    margin-bottom: 14px;
}

.post .date {
    font: 13px/1.5 'SFMono-Regular', Consolas, monospace;
    color: var(--muted);
    order: -1;
}

.post h2 {
    font-size: 21px;
    line-height: 1.55;
    color: var(--ink);
    font-weight: 600;
    -webkit-line-clamp: 3;
}

.post:hover h2 {
    opacity: 1;
    color: #a5eaf8;
}

.post .excerpt {
    font-size: 15px;
    line-height: 1.85;
    color: var(--ink-soft);
    margin-bottom: 18px;
    -webkit-line-clamp: 3;
}

.post .tags {
    margin-top: auto;
}

.post .tags span, .article .tags span, .case-card .tags span, .case-card-stack span {
    background: transparent;
    border: 1px solid #3b5575;
    color: #b9cde8;
    border-radius: 6px;
    font-size: 13px;
    padding: 2px 10px;
}

.post-read {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #a8d7ff;
    margin-top: 20px;
    font-size: 14px;
}

body[data-page="notes"] .post {
    flex-direction: row;
    gap: 26px;
    padding: 22px;
}

body[data-page="notes"] .post-cover {
    width: 32%;
    margin-bottom: 0;
    align-self: stretch;
    aspect-ratio: auto;
    min-height: 205px;
}

body[data-page="notes"] .post h2 {
    font-size: 24px;
}

.tagcloud, .industry-filter {
    gap: 10px;
    margin-bottom: 28px !important;
}

.chip, .industry-chip {
    padding: 8px 18px;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-soft);
    font-size: 14px;
}

.chip.active, .chip.active:hover, .industry-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #071927;
}

.explore-section {
    margin-top: 36px;
    border-top: 1px solid var(--line);
    padding-top: 28px;
}

.explore-section h2 {
    font-size: 20px;
    margin-bottom: 22px;
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.explore-link {
    color: var(--ink);
    text-decoration: none;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 20px;
    gap: 16px;
    align-items: center;
    padding: 4px 18px 4px 0;
    border-right: 1px solid var(--line);
}

.explore-link:last-child {
    border: 0;
}

.explore-icon {
    display: block;
    width: 44px;
    height: 44px;
    color: #8fb8ff;
    filter: drop-shadow(0 0 5px #5284d526);
}

.explore-link strong {
    display: block;
    font-size: 16px;
}

.explore-link small {
    display: block;
    color: var(--muted);
    font-size: 14px;
}

.explore-link:hover strong {
    color: var(--accent);
}

.blog-pager {
    gap: 10px;
    border-top: 0;
    padding: 12px 0;
    margin-top: 32px;
}

.blog-pager-btn, .blog-pager-num {
    height: 42px;
    min-width: 42px;
    border-radius: 7px;
    background: transparent;
}

.blog-pager-num.active {
    color: #061a25;
}

.blog-pager-btn.disabled {
    opacity: .55;
}

.post-list > .empty, .cases-grid > .empty {
    grid-column: 1/-1;
}

.empty {
    border: 1px dashed #3b5069;
    border-radius: 12px;
    padding: 64px 24px;
    color: var(--ink-soft);
    background: #0c1726;
}

.article {
    max-width: 820px;
    margin: 0 auto;
}

.breadcrumb {
    font-size: 14px;
    margin-bottom: 30px;
}

.breadcrumb, .breadcrumb a, .breadcrumb .current {
    color: var(--muted);
}

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

.breadcrumb .sep {
    color: #536580;
}

.article-head {
    text-align: left;
    padding-bottom: 28px;
    margin-bottom: 32px;
}

.article h1 {
    font-size: clamp(28px, 3.4vw, 42px);
    color: var(--ink);
    line-height: 1.5;
    letter-spacing: -.02em;
    margin-bottom: 18px;
    overflow-wrap: anywhere;
}

.article .date, .article .date-ico {
    color: var(--muted);
    font-size: 14px;
}

.article-content, .about-rich {
    color: var(--ink-soft);
    font-size: 17px;
    line-height: 1.95;
}

.article p, .article-content p, .case-body p {
    color: var(--ink-soft);
    line-height: 1.95;
    margin-bottom: 22px;
}

.article h2 {
    font-size: 25px;
    color: var(--ink);
    margin: 40px 0 18px;
}

.article h3 {
    color: var(--ink);
    font-size: 20px;
}

.article-content a, .about-rich a {
    color: var(--accent);
    text-underline-offset: 4px;
}

.article-content img {
    border-radius: 8px;
}

.article-content blockquote {
    background: #102539;
    border-left: 3px solid var(--accent);
    padding: 18px 22px;
    font-style: normal;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

.article-content hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 28px 0;
}

.article code {
    color: #a8e5f6;
    background: #14283b;
    font-size: 14px;
}

.article pre {
    background: #0c1727;
    padding: 22px;
    border-color: #2e4660;
    line-height: 1.8;
    margin: 24px 0;
}

.article pre code, .article pre code.hljs {
    color: #d5e3f5;
    background: transparent;
}

.article-content .hljs-keyword, .article-content .hljs-selector-tag, .article-content .hljs-type {
    color: #c7a2ff;
}

.article-content .hljs-string, .article-content .hljs-attr, .article-content .hljs-template-tag {
    color: #8ce6c7;
}

.article-content .hljs-title, .article-content .hljs-number, .article-content .hljs-literal {
    color: #8dcaff;
}

.article-content .hljs-comment, .article-content .hljs-quote {
    color: #92a3bb;
}

.article-content td, .article-content th {
    padding: 10px 16px;
    border: 1px solid var(--line);
}

.article-content th {
    background: var(--surface);
    color: var(--ink);
}

/* Rich text may contain old explicit black text/white backgrounds. Keep code token colours. */
.article-content [style*="color"], .about-rich [style*="color"] {
    color: inherit !important;
}

.article-content [style*="background"], .about-rich [style*="background"] {
    background-color: transparent !important;
}

.article-download {
    padding: 24px;
    background: #102033;
    border: 1px solid #2d455f;
    border-radius: 12px;
    margin-top: 36px;
}

.article-download-title {
    font-size: 18px;
}

.article-download-btn, .case-link-btn, .case-detail .case-link-btn, .error-home {
    color: #071b26;
    background: var(--accent);
    font-weight: 600;
    font-size: 14px;
}

.article-download-btn.is-link {
    color: var(--accent);
}

.pager {
    gap: 20px;
}

.pager a {
    flex: 1;
    flex-direction: column;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    align-items: flex-start;
    max-width: 50%;
}

.pager .next {
    align-items: flex-end;
    text-align: right;
}

.pager .label {
    font-size: 13px;
    color: var(--muted);
}

.pager .pager-title {
    white-space: normal;
    font-size: 15px;
}

.cases-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.case-card {
    padding: 16px;
    box-shadow: none;
}

.case-card:hover {
    border-color: #567da6;
    box-shadow: none;
}

.case-cover {
    height: auto;
    aspect-ratio: 16/10;
    border: 1px solid #253a54;
    border-radius: 8px;
    background: #102239;
}

.case-cover .mono {
    font-size: 64px;
    color: #83acee;
    opacity: 1;
}

.case-card .body {
    padding: 22px 6px 8px;
}

.case-card h3 {
    font-size: 24px;
    color: var(--ink);
    line-height: 1.5;
}

.case-card .industry-label, .case-detail .case-industry {
    color: #9fc5ef;
    font-size: 14px;
}

.case-card .excerpt {
    color: var(--ink-soft);
    font-size: 16px;
    line-height: 1.85;
    margin: 12px 0 18px;
}

.case-card-stack {
    margin-top: 12px;
}

.case-detail {
    max-width: 940px;
}

.case-detail .case-head-meta {
    justify-content: flex-start;
}

.case-detail-cover {
    background: #102239;
}

.case-detail-cover img {
    object-fit: contain;
    max-height: 560px;
}

.case-detail-excerpt {
    font-size: 19px;
}

body[data-page="about"] .main {
    max-width: 940px;
    margin: auto;
    width: 100%;
}

.about-hero {
    padding: 20px 0 44px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 40px;
}

.about-hero .tagline {
    color: #b9cbea;
    font-size: 21px;
    font-weight: 500;
}

.about-intro {
    font-size: 17px;
    max-width: 760px;
    margin: 16px 0 0;
}

.about-rich h2, .about-rich h3, .about-rich h4 {
    color: var(--ink);
    margin: 30px 0 14px;
}

.about-rich img {
    max-width: 100% !important;
    height: auto !important;
}

.about-rich {
    overflow-wrap: anywhere;
}

.skills {
    gap: 12px;
}

.skills span {
    border-radius: 8px;
    padding: 10px 18px;
    color: #c3d4eb;
    background: var(--surface);
}

.section-title, .case-section-label {
    color: var(--ink);
    font-size: 24px;
}

.about-contact {
    margin-top: 36px;
    padding-top: 30px;
}

.about-social {
    color: var(--ink-soft);
}

.search-page-form {
    display: flex;
    gap: 14px;
    margin: 24px 0;
    max-width: 900px;
}

.search-page-form input {
    min-width: 0;
    flex: 1;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid #36506d;
    border-radius: 8px;
    color: var(--ink);
    font-size: 17px;
}

.search-page-form button {
    cursor: pointer;
}

.search-head {
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 32px;
    overflow-wrap: anywhere;
}

.search-head .q {
    color: var(--accent);
    font-size: inherit;
}

body[data-page="search"] .post {
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    flex-direction: row-reverse;
    gap: 36px;
    padding: 28px 0;
    transform: none;
}

body[data-page="search"] .post-cover {
    width: 28%;
    min-height: 170px;
    margin: 0;
    align-self: center;
}

body[data-page="search"] .post h2 {
    font-size: 25px;
}

body[data-page="search"] .post-head {
    gap: 8px;
    margin-bottom: 16px;
}

body[data-page="search"] .post .date {
    order: 0;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    letter-spacing: .02em;
    color: #9aadc7;
}

.site-footer {
    background: #080f1b;
    margin-top: 48px;
    padding-bottom: 20px;
    padding-top: 38px;
}

.footer-in {
    grid-template-columns: 1.2fr .7fr 1.1fr auto;
    gap: 32px;
    padding-bottom: 38px;
}

.footer-brand {
    font-size: 21px;
}

.footer-title {
    color: #a2bcdf;
    font-size: 13px;
    letter-spacing: .12em;
}

.footer-tag, .footer-meta, .footer-links a {
    color: var(--muted);
    font-size: 14px;
}

.footer-beian {
    color: #6d8199;
    font-size: 12px;
    border-top-color: #1b2c41;
    padding-top: 20px
}

.footer-qr {
    width: 92px;
    padding: 5px;
    border-radius: 6px;
}

/* Page banners follow the individual approved compositions. */
body {
    background: radial-gradient(ellipse at 80% 0, #10253b55, transparent 650px), #080f1b;
}

body[data-page="notes"] .layout, body[data-page="tech-share"] .layout, body[data-page="cases"] .layout, body[data-page="search"] .layout {
    padding-top: 52px;
}

.hero {
    position: relative;
    isolation: isolate;
    padding-bottom: 30px;
    margin-bottom: 28px;
}

.hero .eyebrow {
    margin-bottom: 16px;
}

.hero h1 {
    font-size: clamp(36px, 4.4vw, 60px);
    margin-bottom: 14px;
}

.hero p {
    font-size: 22px;
    line-height: 1.7;
}

body[data-page="notes"] .hero, body[data-page="tech-share"] .hero {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 28px;
}

body[data-page="notes"] .tagcloud {
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line);
}

.hero-tech {
    min-height: 192px;
}

.hero-tech p {
    max-width: 68%;
}

.banner-network {
    position: absolute;
    width: 40%;
    height: 240px;
    right: 0;
    top: -40px;
    z-index: -1;
    opacity: .85;
}

.banner-note {
    position: absolute;
    right: 12px;
    top: 26px;
    font-size: 14px;
    line-height: 1.9;
    color: #95b4db;
}

body[data-page="cases"] .hero p {
    max-width: 75%;
}

body[data-page="cases"] .industry-chip {
    border-radius: 18px;
}

body[data-page="about"] .layout {
    padding-top: 0;
}

body[data-page="about"] .main {
    max-width: 1200px;
}

.about-hero {
    position: relative;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    align-items: center;
    min-height: 480px;
    padding: 40px 0;
    gap: 20px;
}

.about-hero-copy {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 1;
}

.about-hero h1 {
    font-size: clamp(36px, 4.2vw, 58px);
}

.about-hero .tagline {
    font-size: 24px;
    line-height: 1.6;
}

.about-intro {
    max-width: 610px;
}

.about-code-art {
    grid-column: 2;
    grid-row: 1;
    color: #a9ceff;
    text-align: right;
    background: linear-gradient(#31517724 1px, transparent 1px), linear-gradient(90deg, #31517724 1px, transparent 1px);
    background-size: 64px 64px;
}

.about-code-art svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 360px;
    filter: drop-shadow(0 0 16px #427be650);
}

.about-code-art span {
    font-size: 13px;
    letter-spacing: .15em;
}

.banner-signature {
    display: block;
    color: #91aed2;
    font: 10px/1.7 monospace;
    letter-spacing: .2em;
    margin-top: 38px;
}

body[data-page="search"] .hero {
    padding-bottom: 30px;
    margin-bottom: 12px;
}

.search-page-form {
    max-width: none;
    margin: 26px 0 18px;
}

.search-page-form input {
    padding-left: 20px;
}

.search-page-form button {
    min-width: 130px;
}

.search-head {
    margin: 0;
}

body[data-page="article"] .layout, body[data-page="case"] .layout {
    padding-top: 38px;
}

.article .breadcrumb {
    margin-bottom: 20px;
}

.article-head {
    border-bottom: 1px solid var(--line);
}

.article-head .date {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.article .article-head-tags {
    display: inline-flex;
    margin: 0 0 0 14px;
}

.case-detail {
    max-width: 1200px;
}

.case-detail .article-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
    border: 0;
    padding: 0;
    margin-bottom: 28px;
}

.case-detail .article-head h1 {
    margin: 0;
    font-size: clamp(32px, 4vw, 54px);
}

.case-detail .case-head-meta {
    margin: 0;
}

.case-detail .case-industry {
    padding: 5px 16px;
    border: 1px solid #34577b;
    border-radius: 20px;
}

.case-detail .case-detail-excerpt {
    flex-basis: 100%;
    margin: 0;
    font-size: 22px;
}

@media (max-width: 1050px) {
    .nav-in {
        gap: 18px;
    }

    .nav-links {
        gap: 18px;
    }

    .search, .search:focus {
        width: 150px;
    }

    .home-hero {
        min-height: 460px;
    }

    .home-hero h1 {
        font-size: 44px;
    }

    body[data-page="home"] .post-list, body[data-page="tech-share"] .post-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body[data-page="home"] .post:last-child:nth-child(3) {
        grid-column: 1/-1;
        flex-direction: row;
        gap: 24px;
    }

    body[data-page="home"] .post:last-child:nth-child(3) .post-cover {
        width: 35%;
        margin: 0;
    }
}

@media (max-width: 800px) {
    #header {
        min-height: 70px;
    }

    .home-hero::before {
        inset: 0;
    }

    .container, .layout, .layout.no-aside {
        width: calc(100% - 40px);
        margin: 0 auto;
    }

    .layout, .layout.no-aside {
        padding: 36px 0 12px;
        min-height: 50vh;
    }

    .nav .container.nav-in {
        width: calc(100% - 40px);
        margin: 0 auto;
        padding: 12px 0;
        min-height: 70px;
        gap: 12px;
        flex-wrap: wrap;
    }

    .brand {
        order: 1;
        font-size: 18px;
        max-width: none;
    }

    .brand-mark {
        font-size: 24px;
    }

    .search-form {
        order: 2;
        flex: 1;
        min-width: 80px;
        margin-left: auto;
    }

    .search-form .search, .search-form .search:focus {
        width: 100%;
        font-size: 16px;
        height: 42px;
    }

    .nav-toggle {
        order: 3;
        display: inline-flex;
        flex: 0 0 44px;
    }

    .nav-links {
        order: 4;
        display: none;
        flex-basis: 100%;
        width: 100%;
        margin: 0;
        padding: 8px 0;
        border-top: 1px solid var(--line);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .nav-links.is-open {
        display: flex;
    }

    .nav-links a.txt {
        padding: 12px;
        border: 0;
        font-size: 16px;
    }

    .nav-links a.on {
        background: #12263a;
        border-radius: 6px;
    }

    .nav-links a.on::after {
        display: none;
    }

    .home-hero {
        grid-template-columns: 1fr;
        padding: 12px 0 12px;
        gap: 12px;
        min-height: 0;
        margin-bottom: 32px;
    }

    .home-hero h1 {
        font-size: clamp(36px, 7vw, 52px);
    }

    .home-hero h2 {
        font-size: 19px;
    }

    .hero-art {
        max-width: 430px;
        width: 100%;
        margin: -10px auto 0;
    }

    .hero-art img {
        max-height: 340px;
        object-fit: contain;
    }

    .hero-art figcaption {
        margin-top: -8px;
        text-align: center;
    }

    .hero {
        padding-bottom: 24px;
    }

    .hero p {
        font-size: 16px;
    }

    .post h2 {
        font-size: 20px;
    }

    .post .excerpt {
        font-size: 15px;
    }

    body[data-page="notes"] .post {
        gap: 18px;
        padding: 16px;
    }

    body[data-page="notes"] .post h2 {
        font-size: 20px;
    }

    .explore-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .explore-link {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 18px 0;
    }

    .cases-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .case-card h3 {
        font-size: 20px;
    }

    .footer-in {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-col {
        grid-column: 1 / -1;
    }

    .footer-links {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px 16px;
    }

    .footer-beian {
        margin-top: 20px;
        padding-bottom: 20px;
    }

    .blog-pager {
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 28px;
    }

    .blog-pager-btn {
        flex: initial;
        width: auto;
        padding: 0 12px;
    }

    .blog-pager-num {
        display: inline-flex;
    }

    .article-content {
        font-size: 16px;
    }

    .article h2 {
        font-size: 23px;
    }

    .article-head {
        padding-bottom: 20px;
    }

    .case-detail .case-link-btn {
        width: auto;
        display: inline-block;
    }
    .footer-title {
        color: #fff;
        font-size: 16px;
        font-weight: bold;
    }
}

@media (max-width: 800px) {
    body[data-page="notes"] .layout, body[data-page="tech-share"] .layout, body[data-page="cases"] .layout, body[data-page="search"] .layout {
        padding-top: 32px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero p {
        font-size: 17px;
    }

    .hero-tech {
        min-height: 0;
    }

    .hero-tech p {
        max-width: 100%;
    }

    .banner-network {
        width: 50%;
        opacity: .3;
        top: -16px;
        height: 180px;
    }

    .banner-note {
        display: none;
    }

    body[data-page="cases"] .hero p {
        max-width: 100%;
    }

    .about-hero {
        grid-template-columns: 1fr;
        padding: 32px 0;
        gap: 16px;
        min-height: 0;
    }

    .about-code-art {
        grid-column: 1;
        grid-row: 2;
        width: min(100%, 340px);
        justify-self: center;
    }

    .about-hero .tagline {
        font-size: 20px;
    }

    .banner-signature {
        margin-top: 22px;
    }

    .search-page-form button {
        min-width: 0;
    }

    .case-detail .case-detail-excerpt {
        font-size: 18px;
    }
}

@media (max-width: 560px) {
    .container, .layout, .layout.no-aside, .nav .container.nav-in {
        width: calc(100% - 32px);
    }

    .nav .container.nav-in {
        gap: 8px;
    }

    .brand {
        font-size: 16px;
        gap: 8px;
    }

    .brand-mark {
        font-size: 22px;
    }

    .search-form .search::placeholder {
        font-size: 13px;
    }

    .nav-toggle {
        border: 0;
        flex-basis: 40px;
    }

    .eyebrow {
        font-size: 12px;
        letter-spacing: .16em;
    }

    .hero-description {
        font-size: 16px;
    }

    body[data-page="home"] .post-list, body[data-page="tech-share"] .post-list, .cases-grid {
        grid-template-columns: 1fr;
    }

    body[data-page="home"] .post:last-child:nth-child(3), body[data-page="notes"] .post, body[data-page="search"] .post {
        flex-direction: column;
        gap: 0;
    }

    body[data-page="home"] .post:last-child:nth-child(3) .post-cover, body[data-page="notes"] .post-cover, body[data-page="search"] .post-cover {
        width: 100%;
        min-height: 0;
        aspect-ratio: 16/9;
        margin: 0 0 18px;
    }

    body[data-page="search"] .post h2 {
        font-size: 21px;
    }

    .section-heading h2 {
        font-size: 24px;
    }

    .post-read {
        margin-top: 18px;
    }

    .article pre {
        padding: 16px;
    }

    .article-download {
        padding: 18px;
    }

    .pager {
        flex-direction: column;
    }

    .pager a {
        max-width: 100%;
        width: 100%;
    }

    .pager .next {
        align-items: flex-start;
        text-align: left;
    }

    .search-page-form {
        gap: 8px;
    }

    .search-page-form input {
        padding: 12px;
    }

    .search-page-form button {
        padding: 10px 16px;
    }

    .blog-pager-num {
        display: none;
    }

    .blog-pager-num.active {
        display: inline-flex;
    }

    .blog-pager-btn {
        flex: 1;
    }

    .footer-in {
        grid-template-columns: 1fr;
    }

    .footer-col {
        grid-column: 1 / -1;
    }

    .footer-qr {
        width: 90px;
    }

    .site-footer {
        margin-top: 18px;
        padding-bottom: 0px;
    }
    .footer-tag {
        max-width: 100%;
    }
    .footer-in {

        padding-bottom: 18px;
    }

}

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

    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }

    .post:hover, .case-card:hover {
        transform: none;
    }
}

/* Homepage selected writing: match the approved three-card composition. */
body[data-page="home"] .section-heading {
    margin-bottom: 18px;
}

body[data-page="home"] .section-heading h2 {
    font-size: 32px;
    font-weight: 650;
}

body[data-page="home"] .section-heading .eyebrow {
    padding-left: 15px;
    font-size: 12px;
    letter-spacing: .2em;
}

body[data-page="home"] .section-heading .text-link {
    font-size: 16px;
}

body[data-page="home"] .post-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

body[data-page="home"] .post, body[data-page="home"] .post:last-child:nth-child(3) {
    grid-column: auto;
    flex-direction: column;
    gap: 0;
    padding: 18px 18px 22px;
    border: 1px solid #304e70;
    border-radius: 11px;
    background: linear-gradient(135deg, #102033, #0c1727);
}

body[data-page="home"] .post .post-cover, body[data-page="home"] .post:last-child:nth-child(3) .post-cover {
    width: 100%;
    aspect-ratio: 5/3;
    min-height: 0;
    margin: 0 0 20px;
    border-radius: 6px;
}

body[data-page="home"] .post:nth-child(3n+1) .post-cover {
    background-image: url('/pc/images/ai/neural-network.webp');
}

body[data-page="home"] .post:nth-child(3n+2) .post-cover {
    background-image: url('/pc/images/ai/ai-layers.webp');
}

body[data-page="home"] .post:nth-child(3n) .post-cover {
    background-image: url('/pc/images/ai/ai-path.webp');
}

body[data-page="home"] .post-head {
    gap: 12px;
    margin-bottom: 16px;
}

body[data-page="home"] .post .date {
    font-size: 14px;
    color: #9bb5d6;
    letter-spacing: .08em;
}

body[data-page="home"] .post h2 {
    font-size: 24px;
    line-height: 1.5;
    font-weight: 650;
    min-height: 3em;
    -webkit-line-clamp: 2;
}

body[data-page="home"] .post .excerpt {
    font-size: 17px;
    line-height: 1.75;
    -webkit-line-clamp: 4;
    min-height: 7em;
    margin-bottom: 22px;
    color: #b9cbe2;
}

body[data-page="home"] .post .tags {
    min-height: 32px;
    align-items: flex-start;
}

body[data-page="home"] .post .tags span {
    font-size: 14px;
    line-height: 1.7;
    padding: 3px 12px;
    border-color: #668ab4;
    color: #bfd7f4;
}

body[data-page="home"] .post-read {
    margin-top: 20px;
    font-size: 16px;
    color: #9fd6ff;
    gap: 14px;
}

body[data-page="home"] .post:hover {
    border-color: #6c9bcd;
}

@media (max-width: 1050px) and (min-width: 801px) {
    body[data-page="home"] .post {
        padding: 14px;
    }

    body[data-page="home"] .post h2 {
        font-size: 21px;
    }

    body[data-page="home"] .post .excerpt {
        font-size: 16px;
    }
}

@media (max-width: 800px) {
    body[data-page="home"] .post-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body[data-page="home"] .section-heading h2 {
        font-size: 28px;
    }

    body[data-page="home"] .post h2 {
        font-size: 22px;
    }
}

@media (max-width: 560px) {
    body[data-page="home"] .post-list {
        grid-template-columns: 1fr;
    }

    body[data-page="home"] .section-heading h2 {
        font-size: 26px;
    }

    body[data-page="home"] .section-heading .text-link {
        font-size: 16px;
    }

    body[data-page="home"] .post h2, body[data-page="home"] .post .excerpt {
        min-height: 0;
    }
}

/* Dedicated illustrations for each listing-page banner. */
.hero.page-banner {
    min-height: 238px;
    padding-top: 18px;
    padding-right: 42%;
}

.hero.page-banner p {
    max-width: none;
}

.page-banner-art {
    position: absolute;
    right: 12px;
    top: -22px;
    width: 38%;
    height: 252px;
    object-fit: contain;
    pointer-events: none;
    z-index: -1;
    opacity: .82;
}

@media (max-width: 800px) {
    .hero.page-banner {
        min-height: 210px;
        padding-right: 38%;
        padding-top: 4px;
    }

    .page-banner-art {
        width: 40%;
        right: 0;
        top: -12px;
        height: 210px;
    }
}

@media (max-width: 560px) {
    .hero.page-banner {
        display: flex;
        flex-direction: column;
        padding-right: 0;
        min-height: 0;
    }

    .hero.page-banner .page-banner-art {
        position: static;
        order: 1;
        align-self: center;
        width: 100%;
        max-width: 340px;
        height: auto;
        aspect-ratio: 3/2;
        margin: 8px 0 -12px;
    }
}
