/* Live application layout and reading rhythm; source reference pages are excluded. */
html[data-ui-live="true"] {
    --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Segoe UI", Arial, sans-serif;
}

html[data-ui-live="true"] body { font-family: var(--sans); }

html[data-ui-live="true"] :is(.page-heading, .channel-card, .channel-paper, .doc-card, .supplier-card) {
    min-width: 0;
}

html[data-ui-live="true"] .page-heading { margin-bottom: 20px; }
html[data-ui-live="true"] .page-heading p { color: #667085; }
html[data-ui-live="true"] .native-main .native-panel { padding: 24px; }
html[data-ui-live="true"] .native-panel > :first-child { margin-top: 0; }
html[data-ui-live="true"] .native-panel > :last-child { margin-bottom: 0; }
html[data-ui-live="true"] .channel-bar nav { scrollbar-width: none; }
html[data-ui-live="true"] .channel-bar nav::-webkit-scrollbar { display: none; }

html[data-ui-live="true"] .channel-card {
    padding: 22px;
    min-height: 0;
}

html[data-ui-live="true"] .channel-card h2 {
    font: 600 18px/1.6 var(--sans);
    margin: 14px 0 10px;
}

html[data-ui-live="true"] :is(.channel-card p, .doc-card p, .supplier-card p, .editorial-card p) {
    font-size: 13px;
    line-height: 1.8;
    color: #596575;
}

html[data-ui-live="true"] :is(.channel-card small, .doc-card small, .doc-card .subtle, .editorial-card .subtle, .supplier-card small) {
    font-size: 12px;
    line-height: 1.7;
    color: #667085;
}

html[data-ui-live="true"] :is(.editorial-card, .doc-card, .supplier-card) h3 {
    font: 600 17px/1.6 var(--sans);
    overflow-wrap: anywhere;
}

html[data-ui-live="true"] .channel-order {
    font: 500 13px/1.6 var(--sans);
    color: #667085;
}

html[data-ui-live="true"] :is(.tag, .portal-vendor small, .portal-vendor p, .portal-stock small, .backend-brand small) {
    font-size: 12px;
    line-height: 1.6;
}

html[data-ui-live="true"] .channel-filter {
    padding: 16px;
    gap: 12px;
}

html[data-ui-live="true"] .channel-filter label { font-size: 13px; }
html[data-ui-live="true"] nav.channel-browser { padding: 12px 16px; }
html[data-ui-live="true"] .channel-browser { margin-top: 16px; }
html[data-ui-live="true"] .channel-summary { padding: 12px 0; margin: 0; color: #667085; }
html[data-ui-live="true"] [data-content-status] { margin: 8px 0; font-size: 12px; line-height: 1.7; color: #667085; }
html[data-ui-live="true"] .channel-card-bottom { margin-top: 8px; }

html[data-ui-live="true"] .channel-paper .legacy-article-content {
    font-size: 15px;
    line-height: 1.9;
    color: #344054;
    overflow-wrap: break-word;
}

html[data-ui-live="true"] :is(.channel-paper, .article) :is(p, li) { line-height: 1.9; }
html[data-ui-live="true"] :is(.channel-paper, .native-panel) img { max-width: 100%; }

/* The public factory directory also uses the backoffice shell. Constrain its
   flex/grid items so a wide table scrolls locally instead of widening the page. */
html[data-ui-live="true"] body.backend .backend-wrap {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

html[data-ui-live="true"] body.backend :is(.backend-layout, .backend-layout > .app, .backend-layout > .app > .main, .backend-content, .ops-panel) {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    width: 100%;
}
html[data-ui-live="true"] body.backend .backend-layout > .app > .main {
    overflow-x: clip;
}

html[data-ui-live="true"] :is(.ops-table-wrap, .table-scroll, .ae-scroll) {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

html[data-ui-live="true"] body.backend .ops-table { font-size: 13px; line-height: 1.7; }
html[data-ui-live="true"] [data-factory-panel] .ops-table { min-width: 760px; }

/* Shared member widgets also appear outside the legacy admin-engine container. */
html[data-ui-live="true"] body.backend .ae-toolbar:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

html[data-ui-live="true"] body.backend .ae-toolbar button:not(.btn):not(.ae-dialog-close) {
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid var(--control);
    border-radius: 8px;
    background: #fff;
    color: var(--ink-2);
    font: 500 13px/1.4 var(--sans);
    cursor: pointer;
}

html[data-ui-live="true"] body.backend .ae-toolbar button:not(.btn):not(.ae-dialog-close):hover:not(:disabled) {
    border-color: var(--accent-line);
    background: var(--accent-wash);
}

html[data-ui-live="true"] body.backend .ae-toolbar button:disabled { opacity: .55; cursor: not-allowed; }
html[data-ui-live="true"] body.backend :is(.ops-notice, .ae-status):empty { display: none; }
html[data-ui-live="true"] body.backend .promotion-post { overflow-wrap: anywhere; }
html[data-ui-live="true"] body.backend .post-head > div { min-width: 0; }
html[data-ui-live="true"] body.backend .post-head time { overflow-wrap: anywhere; }

@media (max-width: 760px) {
    html[data-ui-live="true"] .page-heading { margin-bottom: 16px; }
    html[data-ui-live="true"] .page-heading h1 { font-size: 24px; line-height: 1.5; }
    html[data-ui-live="true"] .native-main .native-panel { padding: 18px; }
    html[data-ui-live="true"] .channel-card { padding: 18px; }
    html[data-ui-live="true"] .channel-card h2 { font-size: 17px; }
    html[data-ui-live="true"] .channel-filter { padding: 14px; }
    html[data-ui-live="true"] .channel-filter > label { flex: 1 1 150px; min-width: 0; }
    html[data-ui-live="true"] .channel-filter :is(input:not([type=checkbox]), select) { width: 100%; min-width: 0; }
    html[data-ui-live="true"] :is(.channel-filter, .ops-toolbar, .ae-toolbar, .native-form) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select),
    html[data-ui-live="true"] .portal-search input {
        font-size: 16px;
        min-height: 42px;
    }
    html[data-ui-live="true"] :is(.channel-filter, .ops-toolbar, .ae-toolbar, .native-form) :is(.btn, button) { min-height: 42px; }
    html[data-ui-live="true"] body.backend .ae-toolbar button:not(.btn):not(.ae-dialog-close) { min-height: 42px; }
    html[data-ui-live="true"] .channel-card-bottom > a { display: inline-flex; align-items: center; min-height: 36px; }
    html[data-ui-live="true"] [data-factory-panel] .ops-table-wrap::before {
        content: "表格可左右滑动";
        display: block;
        position: sticky;
        left: 0;
        padding: 6px 0 10px;
        color: #667085;
        font-size: 12px;
    }
}

/* Formal shop overview: readable introduction and separated destination links. */
html[data-ui-live="true"] .native-main:has(form[action="/shop.html"]) > .native-panel:first-of-type .native-grid { grid-template-columns:minmax(0,1fr) minmax(0,1.35fr); gap:24px 40px; align-items:start; }
html[data-ui-live="true"] .native-main:has(form[action="/shop.html"]) > .native-panel:first-of-type .native-grid > div { min-width:0; }
html[data-ui-live="true"] .native-main:has(form[action="/shop.html"]) > .native-panel:first-of-type .native-grid p { font-size:14px; line-height:1.9; overflow-wrap:anywhere; }
html[data-ui-live="true"] .native-main:has(form[action="/shop.html"]) > .native-panel:first-of-type > p:has(a) { display:flex; flex-wrap:wrap; gap:8px 12px; margin-top:20px; }
html[data-ui-live="true"] .native-main:has(form[action="/shop.html"]) > .native-panel:first-of-type > p > a { display:inline-flex; align-items:center; min-height:44px; box-sizing:border-box; padding:8px 12px; border:1px solid #e1e6ec; border-radius:4px; }
@media(max-width:760px) {
 html[data-ui-live="true"] .native-main:has(form[action="/shop.html"]) > .native-panel:first-of-type .native-grid { grid-template-columns:minmax(0,1fr); gap:12px; }
 html[data-ui-live="true"] .native-main:has(form[action="/shop.html"]) > .native-panel:first-of-type .native-grid > div+div { border-top:1px solid #e1e6ec; padding-top:12px; }
}

.shop-introduction {margin-top:12px;min-width:0;}
.shop-introduction summary {display:list-item;min-height:44px;padding:10px 12px;box-sizing:border-box;border:1px solid #dfe4eb;border-radius:4px;font-size:14px;line-height:1.7;cursor:pointer;}
.shop-introduction summary:focus-visible {outline:2px solid #d95413;outline-offset:2px;}
.shop-introduction[open] > p {margin-top:16px;overflow-wrap:anywhere;}

.shop-stock-scroll-hint {display:none;}
.shop-stock-table:focus-visible {outline:2px solid #d95413;outline-offset:3px;}
.native-main nav.pagination[aria-label="企业库存分页"]:not(:has(a)) {display:none;}
@media(max-width:760px) {
 .native-main .shop-stock-scroll-hint {display:block;margin:8px 0 12px;color:#64748b;font-size:13px;line-height:1.7;}
}
