/* One editorial system for public articles, product documents and CMS previews. */
.news-detail-page,
.rich-editor {
    --cms-accent: #00ffd1;
    --cms-ink: #edf4f2;
    --cms-copy: #bbc8c5;
    --cms-muted: #84958f;
    --cms-rule: rgba(213, 237, 228, 0.14);
    --cms-radius: 8px;
    --cms-motion: 180ms ease;
}

.news-detail-page .news-detail {
    margin-top: 0;
    padding-top: 112px;
}

.news-detail-page .detail-layout {
    align-items: start;
    gap: clamp(24px, 3vw, 40px);
}

.news-detail-page .detail-sidebar {
    top: 104px;
    gap: 16px;
}

/* Reset the old 16px article offset so both columns share the same top edge. */
.news-detail-page .news-article {
    margin-top: 0;
    padding: clamp(24px, 3.4vw, 48px);
    border-radius: var(--cms-radius);
}

.news-detail-page :is(.news-article, .news-toc):hover {
    transform: none;
}

.news-detail-page .back-button.back-link {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid rgba(0, 255, 209, 0.24);
    border-radius: var(--cms-radius);
    background: rgba(0, 255, 209, 0.045);
    color: var(--cms-accent);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color var(--cms-motion), background-color var(--cms-motion);
}

.news-detail-page .back-button.back-link:hover {
    transform: none;
    border-color: var(--cms-accent);
    background: rgba(0, 255, 209, 0.085);
}

.news-detail-page .back-arrow {
    flex-shrink: 0;
    transition: transform var(--cms-motion);
}

.news-detail-page .back-link:hover .back-arrow {
    transform: translateX(-2px);
}

.news-detail-page .back-link {
    white-space: nowrap;
}

.news-detail-page .news-header {
    margin: 0 0 32px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--cms-rule);
    text-align: start;
}

.news-detail-page .news-header::before {
    content: '';
    display: block;
    width: 32px;
    height: 2px;
    margin-bottom: 20px;
    background: var(--cms-accent);
}

.news-detail-page .news-title {
    margin: 0;
    font-size: clamp(26px, 2.6vw, 36px);
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: -0.025em;
    color: var(--cms-ink);
    text-align: start;
    text-wrap: pretty;
    overflow-wrap: anywhere;
}

.news-detail-page .news-header .news-meta {
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin: 22px 0 0;
    padding: 0;
    border: 0;
}

.news-detail-page .news-meta .date {
    color: var(--cms-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

.news-detail-page .detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.news-detail-page .detail-tags .tag {
    padding: 4px 9px;
    border: 1px solid rgba(0, 255, 209, 0.22);
    border-radius: 3px;
    background: transparent;
    color: var(--cms-accent);
    font-size: 11px;
    line-height: 1.65;
    letter-spacing: 0.035em;
    overflow-wrap: anywhere;
}

.news-detail-page .news-toc {
    padding: 22px 16px;
    border-radius: var(--cms-radius);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 209, 0.28) transparent;
}

.news-detail-page .toc-title {
    padding: 0 10px 16px;
    margin: 0 0 8px;
    border-bottom: 1px solid var(--cms-rule);
    color: var(--cms-muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
}

.news-detail-page #tocList {
    margin: 0;
}

.news-detail-page #tocList li {
    margin: 0;
}

.news-detail-page #tocList a {
    padding: 9px 10px;
    border-radius: 3px;
    color: var(--cms-copy);
    font-size: 12px;
    line-height: 1.7;
    transition: color var(--cms-motion), background-color var(--cms-motion);
}

.news-detail-page #tocList :is(a:hover, a:focus-visible) {
    background: rgba(0, 255, 209, 0.055);
    color: var(--cms-accent);
}

.news-detail-page #tocList .toc-h3 { padding-left: 22px; }
.news-detail-page #tocList .toc-h4 { padding-left: 34px; }

.news-detail-page .news-cover {
    margin: 0 0 36px;
    overflow: hidden;
    border: 1px solid var(--cms-rule);
    border-radius: var(--cms-radius);
}

.news-detail-page .news-cover img {
    display: block;
    width: 100%;
    max-height: 580px;
    object-fit: contain;
    border-radius: 0;
}

.news-detail-page.cms-layout-wide .news-detail > .container {
    max-width: 1600px;
}

.news-detail-page.cms-no-toc .detail-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.news-detail-page.cms-no-toc .detail-sidebar {
    position: static;
    max-height: none;
}

.news-detail-page.cms-no-toc .back-button {
    width: fit-content;
    max-width: 100%;
}

.news-detail-page :is(.news-toc, .news-cover, .news-meta)[hidden] {
    display: none;
}

:is(.news-detail-page .news-text.cms-content, .rich-editor) {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--cms-copy);
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 16px;
    line-height: 1.95;
}

:is(.news-detail-page .cms-content, .rich-editor) p {
    margin: 0 0 1.4em;
    line-height: inherit;
    text-indent: 0;
    text-align: start;
    text-align-last: auto;
    text-wrap: wrap;
}

/* Inline alignment chosen by the author takes precedence over this default. */
:is(.news-detail-page:lang(zh) .cms-content, .rich-editor:lang(zh)) p {
    text-align: justify;
    text-justify: inter-ideograph;
    text-indent: 2em;
}

:is(.news-detail-page .cms-content, .rich-editor) :is(h2, h3, h4) {
    margin: 1.9em 0 0.85em;
    color: var(--cms-ink);
    font-family: inherit;
    font-weight: 600;
    text-align: start;
    letter-spacing: -0.015em;
    line-height: 1.55;
    text-wrap: pretty;
    scroll-margin-top: 112px;
}

:is(.news-detail-page .cms-content, .rich-editor) h2 {
    padding-left: 14px;
    border-left: 2px solid var(--cms-accent);
    font-size: clamp(22px, 1.9vw, 26px);
}

:is(.news-detail-page .cms-content, .rich-editor) h3 { font-size: 20px; }
:is(.news-detail-page .cms-content, .rich-editor) h4 { font-size: 17px; }
:is(.news-detail-page .cms-content, .rich-editor) > :first-child { margin-top: 0; }
:is(.news-detail-page .cms-content, .rich-editor) :is(strong, b) { color: inherit; font-weight: 600; }

/* Imported articles use this class on strong/b as well as span. */
:is(.news-detail-page .cms-content, .rich-editor) .rich-highlight {
    color: var(--cms-accent);
    font-weight: 600;
}

/* Indent prose only. Alignment and semantic component content stay deliberate. */
:is(.news-detail-page:lang(zh) .cms-content, .rich-editor:lang(zh)) :is(li, th, td, figcaption, blockquote) p,
:is(.news-detail-page:lang(zh) .cms-content, .rich-editor:lang(zh)) :is(p.rich-note, p.media-caption),
:is(.news-detail-page:lang(zh) .cms-content, .rich-editor:lang(zh)) p:has(> img, > video),
:is(.news-detail-page:lang(zh) .cms-content, .rich-editor:lang(zh)) p:is([style*="text-align: center"], [style*="text-align:center"], [style*="text-align: right"], [style*="text-align:right"]) {
    text-indent: 0;
}

:is(.news-detail-page .cms-content, .rich-editor) :is(ul, ol) {
    margin: 0 0 24px;
    padding-left: 1.4em;
    color: inherit;
}

:is(.news-detail-page .cms-content, .rich-editor) li {
    margin: 0 0 0.6em;
    padding-left: 0.25em;
    line-height: inherit;
}

:is(.news-detail-page .cms-content, .rich-editor) li::marker { color: var(--cms-accent); }
:is(.news-detail-page .cms-content, .rich-editor) li > p { margin-bottom: 0.6em; }
:is(.news-detail-page .cms-content, .rich-editor) a {
    color: var(--cms-accent);
    text-decoration: underline;
    text-decoration-color: rgba(0, 255, 209, 0.35);
    text-underline-offset: 4px;
    transition: text-decoration-color var(--cms-motion), color var(--cms-motion);
}

:is(.news-detail-page .cms-content, .rich-editor) a:hover { text-decoration-color: currentColor; }
:is(.news-detail-page .cms-content, .rich-editor) a::after { display: none; }

:is(.news-detail-page .cms-content, .rich-editor) blockquote {
    margin: 30px 0;
    padding: 22px 24px;
    border: 1px solid var(--cms-rule);
    border-left: 2px solid var(--cms-accent);
    border-radius: 0 var(--cms-radius) var(--cms-radius) 0;
    color: #d7e3de;
    background-color: rgba(0, 255, 209, 0.035);
}

:is(.news-detail-page .cms-content, .rich-editor) blockquote > :last-child { margin-bottom: 0; }
:is(.news-detail-page .cms-content, .rich-editor) hr {
    margin: 36px 0;
    height: 1px;
    border: 0;
    background: var(--cms-rule);
}

:is(.news-detail-page .cms-content, .rich-editor) pre {
    max-width: 100%;
    margin: 28px 0;
    padding: 20px;
    overflow-x: auto;
    border: 1px solid var(--cms-rule);
    border-radius: var(--cms-radius);
    font: 13px/1.8 Consolas, monospace;
    color: #cbe1d9;
    background-color: rgba(0, 0, 0, 0.16);
}

:is(.news-detail-page .cms-content, .rich-editor) :not(pre) > code {
    color: var(--cms-accent);
    font-size: 0.88em;
    padding: 2px 5px;
    border: 1px solid var(--cms-rule);
    border-radius: 3px;
}

:is(.news-detail-page .cms-content, .rich-editor) mark {
    padding: 1px 3px;
    border-radius: 2px;
    background-color: #a3ffdc;
    color: #061c15;
}

:is(.news-detail-page .cms-content, .rich-editor) :is(.rich-grid, .rich-grid-2, .rich-grid-3) {
    display: grid;
    gap: 24px;
    margin: 32px 0;
    align-items: start;
}

:is(.news-detail-page .cms-content, .rich-editor) .rich-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

:is(.news-detail-page .cms-content, .rich-editor) .rich-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

:is(.news-detail-page .cms-content, .rich-editor) :is(.rich-grid, .rich-grid-2, .rich-grid-3) > * {
    min-width: 0;
    margin: 0;
}

:is(.news-detail-page .cms-content, .rich-editor) .rich-panel {
    padding: 22px;
    border: 1px solid var(--cms-rule);
    border-radius: var(--cms-radius);
}

:is(.news-detail-page .cms-content, .rich-editor) .rich-panel > :first-child { margin-top: 0; }
:is(.news-detail-page .cms-content, .rich-editor) .rich-panel > :last-child { margin-bottom: 0; }

:is(.news-detail-page .news-text.cms-content, .rich-editor) figure {
    height: auto;
    margin: 32px 0;
    padding: 0;
    border-radius: var(--cms-radius);
    background-color: transparent;
    overflow: hidden;
}

:is(.news-detail-page .news-text.cms-content, .rich-editor) :is(img, video),
:is(.news-detail-page .news-text.cms-content, .rich-editor) figure:hover :is(img, video) {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 78vh;
    margin: 0 auto;
    object-fit: contain;
    border: 1px solid var(--cms-rule);
    border-radius: var(--cms-radius);
    opacity: 1;
    transform: none;
    transition: border-color var(--cms-motion);
}

:is(.news-detail-page .news-text.cms-content, .rich-editor) figure:hover :is(img, video) {
    border-color: rgba(0, 255, 209, 0.3);
}

:is(.news-detail-page .news-text.cms-content, .rich-editor) .rich-grid > figure {
    margin: 0;
}

:is(.news-detail-page .news-text.cms-content, .rich-editor) :is(figcaption, figure > p) {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    padding: 12px 2px 0;
    text-indent: 0;
    text-align: start;
    color: var(--cms-muted);
    font-size: 12px;
    line-height: 1.7;
    letter-spacing: 0.02em;
    transform: none;
}

:is(.news-detail-page .news-text.cms-content, .rich-editor) figcaption::before,
:is(.news-detail-page .news-text.cms-content, .rich-editor) figcaption::after {
    display: none;
}

/* Historical captions contain p tags; do not inherit the old image-hover overlay. */
:is(.news-detail-page .news-text.cms-content, .rich-editor) figcaption p {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    text-indent: 0;
    text-align: inherit;
    text-shadow: none;
    transform: none;
}

:is(.news-detail-page .cms-content, .rich-editor) .rich-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    margin: 28px 0;
    border: 1px solid var(--cms-rule);
    border-radius: var(--cms-radius);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 209, 0.3) transparent;
}

:is(.news-detail-page .cms-content, .rich-editor) table {
    width: 100%;
    min-width: 520px;
    table-layout: auto;
    margin: 0;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.8;
    font-variant-numeric: tabular-nums;
    background-color: transparent;
}

/* The editable table stays within its canvas; published tables scroll in their wrapper. */
.rich-editor[contenteditable] table {
    min-width: 0;
}

.rich-editor .tableWrapper {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

:is(.news-detail-page .cms-content, .rich-editor) :is(th, td) {
    padding: 14px 18px;
    border: 0;
    border-right: 1px solid var(--cms-rule);
    border-bottom: 1px solid var(--cms-rule);
    text-align: start;
    vertical-align: top;
}

:is(.news-detail-page .cms-content, .rich-editor) th {
    color: var(--cms-ink);
    background-color: rgba(0, 255, 209, 0.12);
    font-weight: 600;
    border-bottom-color: rgba(0, 255, 209, 0.34);
}

:is(.news-detail-page .cms-content, .rich-editor) :is(th, td):last-child { border-right: 0; }
:is(.news-detail-page .cms-content, .rich-editor) tbody tr:last-child td { border-bottom: 0; }
:is(.news-detail-page:lang(zh) .cms-content, .rich-editor:lang(zh)) :is(th, td) p { margin: 0; text-align: inherit; text-indent: 0; }
.news-detail-page :is(.back-link, #tocList a, .cms-content a, .rich-table-wrap):focus-visible {
    outline: 2px solid var(--cms-accent);
    outline-offset: 4px;
}

.neural-stage-page .info-title .product-title-link {
    color: inherit;
}

.neural-stage-page .info-title .product-title-link:hover {
    color: var(--primary-color);
}

.neural-stage-page .info-category-tags,
.neural-stage-page .news-meta .meta-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

.neural-stage-page :is(.info-category-tag, .news-meta .tag) {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.neural-stage-page :is(.news-grid, .info-grid) > :is(.loading, .error, .no-results) {
    grid-column: 1 / -1;
    width: 100%;
    padding: 32px 20px;
    text-align: center;
}

@media (max-width: 900px) {
    :is(.news-detail-page .cms-content, .rich-editor) .rich-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1000px) {
    .news-detail-page .detail-sidebar { position: static; max-height: none; }
    .news-detail-page .news-toc { max-height: 210px; padding: 18px 16px; }
    .news-detail-page .back-button.back-link { width: fit-content; }
}

@media (max-width: 640px) {
    .news-detail-page .news-detail { padding-top: 100px; }
    .news-detail-page .news-article { padding: 22px 20px; }
    .news-detail-page .news-header { margin-bottom: 26px; padding-bottom: 24px; }
    .news-detail-page .news-title { font-size: 26px; line-height: 1.5; }
    :is(.news-detail-page .news-text.cms-content, .rich-editor) { font-size: 15px; line-height: 1.95; }
    .news-detail-page .news-cover { margin-bottom: 28px; }
    :is(.news-detail-page .cms-content, .rich-editor) blockquote { padding: 18px; }
    :is(.news-detail-page .cms-content, .rich-editor) .rich-panel { padding: 18px; }
    :is(.news-detail-page .cms-content, .rich-editor) :is(.rich-grid, .rich-grid-2, .rich-grid-3) { gap: 18px; }
    :is(.news-detail-page .cms-content, .rich-editor) :is(.rich-grid-2, .rich-grid-3) {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .news-detail-page :is(.back-button, .back-arrow, #tocList a, .cms-content a, .cms-content img, .cms-content video) {
        transition: none;
    }
    .news-detail-page .back-link:hover .back-arrow { transform: none; }
    .news-detail-page :is(.news-article, .news-toc) { transition: none; }
}
