/* ============================================================
   KORRETTO / TOP-TOOL  —  Shared UI Stylesheet
   Covers: nav, footer, responsive layout, typography
   ============================================================ */

/* --- Global responsive image protection ------------------- */
img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

/* --- Typography ------------------------------------------- */
body {
    background-color: #f9f9f9;
    color: #333;
    font-family: 'Inter', 'Helvetica Neue', 'Roboto', -apple-system,
                 BlinkMacSystemFont, 'Segoe UI', 'Noto Sans',
                 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: -0.1px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

body,
body * {
    font-family: 'Inter', 'Helvetica Neue', 'Roboto', -apple-system,
                 BlinkMacSystemFont, 'Segoe UI', 'Noto Sans',
                 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
}

/* --- Sticky 导航与锚点滚动 ---------------------------------
 * --nav-sticky-offset：桌面顶栏 sticky 时的视觉高度（用于 html scroll-padding、
 * 子级 sticky 的 top: var(--nav-sticky-offset) 等）。移动端导航非 sticky，单独压低 scroll-padding。
 * ----------------------------------------------------------- */
:root {
    --nav-sticky-offset: 58px;
}

html {
    scroll-padding-top: var(--nav-sticky-offset);
}

/* ============================================================
   NAV  —  single-row, sticky (desktop), responsive
   ============================================================ */
nav {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    padding: 6px 16px;
    position: sticky;
    top: 0;
    z-index: 9000;
}

/* Inner wrapper keeps everything in one row */
.nav-inner {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1200px;
}

/* --- Dual-logo row ---------------------------------------- */
nav .logobox {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: 12px;
}

nav .logobox img.logo {
    height: 36px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

nav .logobox img.logo:hover {
    opacity: 0.78;
    transform: scale(1.04);
}

.logo-divider {
    background-color: #ddd;
    flex-shrink: 0;
    height: 28px;
    width: 1px;
}

/* --- Nav menu — flex, nowrap, single line ----------------- */
.daohang {
    flex: 1;
    height: auto !important;   /* override legacy page CSS that sets fixed height (e.g. 80px–200px) */
    min-height: unset !important;
    min-width: 0;
    overflow: visible;   /* must be visible so dropdown menus are not clipped */
}

nav ul.nav {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: 0 6px;
    height: auto !important;   /* override .daohang ul { height: 40px } in style.css / style-en.css */
    justify-content: flex-end;
    list-style: none;
    margin: 0;
    padding: 0;
    width: auto !important;    /* override .daohang ul { width: 1170px / 585px / 300px } */
}

nav ul.nav > li {
    flex-shrink: 0;
    float: none !important;       /* override .nav li { float: left } in style.css */
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
    position: relative;
    white-space: nowrap;
    width: auto !important;       /* override .nav li { width: 130px } in style.css */
}

/* Touch-friendly min-height on all nav links */
nav ul.nav > li > a {
    align-items: center;
    color: #222;
    display: flex;
    min-height: 44px;
    padding: 0 8px;
    text-decoration: none;
    transition: color 0.2s;
}

nav ul.nav > li > a:hover {
    color: #2790f4;
}

/* --- Dropdown submenu — single column, solid bg ----------- */
nav ul.nav li ul {
    background-color: #333 !important;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
    display: none;
    flex-direction: column;
    height: auto !important;      /* override .daohang ul { height:40px } in style.css */
    left: 0;
    list-style: none;
    margin: 0 !important;
    padding: 6px 0;
    position: absolute;
    top: calc(100% + 2px);
    width: max-content !important; /* override .daohang ul { width:1170px } */
    max-width: 280px;
    z-index: 99999 !important;
}

nav ul.nav li:hover > ul {
    display: flex;
}

nav ul.nav li ul li {
    display: block;
    padding: 0;
    width: 100%;
}

nav ul.nav li ul li a {
    color: #e0e0e0;
    display: block;
    font-size: 12.5px;
    font-weight: 400;
    min-height: 40px;
    line-height: 40px;
    padding: 0 18px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s;
}

nav ul.nav li ul li a:hover {
    background-color: #3a3a3a;
    color: #4da3ff;
}

/* ---  mega 下拉：三列网格（长于一屏的「所有产品」等） --- */
@media (min-width: 901px) {
    nav ul.nav > li.nav-mega > ul {
        display: none;
        width: auto !important;
        max-width: min(840px, calc(100vw - 32px)) !important;
        min-width: min(700px, calc(100vw - 32px));
        padding: 10px 12px !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: 8px;
        row-gap: 2px;
        align-items: start;
    }

    nav ul.nav > li.nav-mega:hover > ul {
        display: grid !important;
    }

    nav ul.nav > li.nav-mega > ul > li {
        width: 100%;
    }

    nav ul.nav > li.nav-mega > ul > li > a {
        white-space: normal;
        word-break: break-word;
        line-height: 1.35;
        min-height: 0;
        padding: 9px 10px;
    }
}

@media (max-width: 900px) {
    nav ul.nav > li.nav-mega > ul {
        min-width: 0 !important;
    }
}

/* Plain-text items (no link) in dropdown */
nav ul.nav li ul li:not(:has(a)) {
    color: #777;
    font-size: 12px;
    line-height: 36px;
    padding: 0 18px;
}

/* --- Language toggle -------------------------------------- */
nav ul.nav li.lang-toggle {
    margin-left: 4px;
}

nav ul.nav li.lang-toggle > a {
    align-self: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #444;
    display: inline-flex;
    font-size: 12px;
    font-weight: 600;
    height: auto;
    letter-spacing: 0.4px;
    line-height: 1;
    min-height: unset;
    padding: 4px 8px;
}

nav ul.nav li.lang-toggle > a:hover {
    background-color: #f0f4ff;
    border-color: #2790f4;
    color: #2790f4;
}

nav ul.nav li.lang-toggle > ul {
    left: auto;
    right: 0;
}

/* --- Hamburger button (hidden on desktop) ----------------- */
.nav-toggle {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    display: none;          /* shown via media query */
    flex-direction: column;
    gap: 5px;
    padding: 8px 10px;
    flex-shrink: 0;
}

.nav-toggle span {
    background-color: #333;
    border-radius: 2px;
    display: block;
    height: 2px;
    width: 20px;
    transition: all 0.2s;
}

/* ============================================================
   FOOTER  —  dark background, auto height, no overflow
   ============================================================ */
.kr-footer-cta {
    background: #f2f4f7;
    border-top: 1px solid #dfe7f1;
    box-sizing: border-box;
    padding: clamp(48px, 6vw, 72px) 5% clamp(40px, 5vw, 60px);
}

.kr-footer-cta-inner {
    align-items: center;
    background: linear-gradient(145deg, #101925 0%, #17283c 100%);
    border: 1px solid rgba(39, 144, 244, 0.22);
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
    box-sizing: border-box;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin: 0 auto;
    max-width: 1120px;
    padding: clamp(20px, 3vw, 32px);
}

.kr-footer-cta-kicker {
    color: rgba(140, 190, 255, 0.95);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.08em;
    line-height: 1.3;
    margin: 0 0 6px;
}

.kr-footer-cta-title {
    color: #fff;
    font-size: clamp(18px, 2.3vw, 26px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.35;
    margin: 0 0 10px;
}

.kr-footer-cta-desc {
    color: rgba(220, 232, 250, 0.86);
    font-size: 14px;
    line-height: 1.65;
    margin: 0 0 12px;
    max-width: 680px;
}

.kr-footer-cta-link {
    color: rgba(140, 190, 255, 0.95);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.kr-footer-cta-link:hover {
    color: #fff;
    text-decoration: underline;
}

.kr-footer-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    min-width: 280px;
}

.kr-footer-cta-btn {
    align-items: center;
    border-radius: 10px;
    box-sizing: border-box;
    display: inline-flex;
    font-size: 14px;
    font-weight: 800;
    justify-content: center;
    line-height: 1;
    min-height: 44px;
    padding: 0 20px;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.kr-footer-cta-btn:hover {
    transform: translateY(-2px);
}

.kr-footer-cta-btn--primary {
    background: #D96A28;
    box-shadow: 0 8px 20px rgba(217, 106, 40, 0.28);
    color: #fff !important;
}

.kr-footer-cta-btn--primary:hover {
    background: #B85A22;
}

.kr-footer-cta-btn--secondary {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.92);
    color: #2790f4 !important;
}

.kr-footer-cta-btn--secondary:hover {
    background: #fff;
    color: #0f63bf !important;
}

footer {
    background-color: #000;
    color: #bbb;
    height: auto;
    overflow: visible;
    padding: 20px 20px 16px;
    width: 100%;
    box-sizing: border-box;
}

footer .bottom {
    background-color: transparent;
    height: auto;
}

footer .center {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px 24px;
    height: auto !important;
    margin: 0 auto;
    max-width: 1100px;
    padding-bottom: 32px;
}

/* Dual logos in footer — span all 4 grid columns */
.footer-logos {
    align-items: center;
    display: flex;
    gap: 11px;
    grid-column: 1 / -1;
    justify-content: center;
    margin-bottom: 4px;
    width: 100%;
}

.footer-logos img {
    height: 28px;
    max-width: 128px;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.2s;
    width: auto;
}

.footer-logos img:hover { opacity: 1; }

.footer-logos .logo-divider {
    background-color: #555;
    height: 22px;
    width: 1px;
}

.footer-product-intro {
    grid-column: 1 / -1;
    margin: 0 0 14px;
    color: #9aa3af;
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}

/* Footer link columns */
footer ul.dibuchanpin,
footer ul.dibuchanpin1,
footer ul.dibuchanpin2,
footer ul.dibuchanpin3 {
    height: auto;
    list-style: none;
    margin: 0;
    min-width: 130px;
    padding: 0;
}

footer ul.dibuchanpin li,
footer ul.dibuchanpin1 li,
footer ul.dibuchanpin2 li,
footer ul.dibuchanpin3 li {
    color: #888;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 12.5px !important;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.45;
    margin-bottom: 3px;
    padding: 0;
}

/* Column section heading (first li) — bold, same size, nowrap to keep border aligned */
footer ul.dibuchanpin li:first-child,
footer ul.dibuchanpin1 li:first-child,
footer ul.dibuchanpin2 li:first-child,
footer ul.dibuchanpin3 li:first-child {
    color: #ddd;
    font-size: 14px !important;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.35;
    margin-bottom: 7px;
    padding-bottom: 5px;
    border-bottom: 1px solid #444;
    white-space: nowrap;
}

footer ul.dibuchanpin li a,
footer ul.dibuchanpin1 li a,
footer ul.dibuchanpin2 li a,
footer ul.dibuchanpin3 li a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

footer ul.dibuchanpin li a:hover,
footer ul.dibuchanpin1 li a:hover,
footer ul.dibuchanpin2 li a:hover,
footer ul.dibuchanpin3 li a:hover {
    color: #4da3ff;
}

/* ============================================================
   FOOTER LIGHT VARIANT — Chinese pages (white background)
   ============================================================ */
footer.footer-light {
    background-color: #f2f4f7;
    border-top: 1px solid #dfe7f1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    color: #333;
}

footer.footer-light .bottom {
    background-color: transparent !important;
    display: block !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

footer.footer-light .center {
    border-top: 0 !important;
    display: grid !important;
    float: none !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 12px 24px !important;
    height: auto !important;
    margin: 0 auto !important;
    max-width: 1100px !important;
    padding: 0 0 32px !important;
    width: auto !important;
}

footer.footer-light .center img {
    float: none !important;
    width: auto !important;
}

footer.footer-light .center ul {
    float: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
}

footer.footer-light ul.dibuchanpin li,
footer.footer-light ul.dibuchanpin1 li,
footer.footer-light ul.dibuchanpin2 li,
footer.footer-light ul.dibuchanpin3 li {
    color: #555;
}

footer.footer-light ul.dibuchanpin li:first-child,
footer.footer-light ul.dibuchanpin1 li:first-child,
footer.footer-light ul.dibuchanpin2 li:first-child,
footer.footer-light ul.dibuchanpin3 li:first-child {
    color: #111;
    border-bottom-color: #ccc;
}

footer.footer-light .footer-product-intro {
    color: #5c6370;
}

footer.footer-light ul.dibuchanpin li,
footer.footer-light ul.dibuchanpin1 li,
footer.footer-light ul.dibuchanpin2 li,
footer.footer-light ul.dibuchanpin3 li {
    color: #444;
}

footer.footer-light ul.dibuchanpin li a,
footer.footer-light ul.dibuchanpin1 li a,
footer.footer-light ul.dibuchanpin2 li a,
footer.footer-light ul.dibuchanpin3 li a {
    color: #555;
}

footer.footer-light ul.dibuchanpin li a:hover,
footer.footer-light ul.dibuchanpin1 li a:hover,
footer.footer-light ul.dibuchanpin2 li a:hover,
footer.footer-light ul.dibuchanpin3 li a:hover {
    color: #2790f4;
}

footer.footer-light .footer-logos img  { opacity: 1; filter: none; }
footer.footer-light .footer-logos .logo-divider { background-color: #ddd; }

/* --- Beian / copyright row ------------------------------- */
.beian-row {
    align-items: center;
    background-color: #111;
    box-sizing: border-box;
    color: #555;
    display: flex;
    flex-wrap: wrap;
    font-size: 11px;
    gap: 6px 20px;
    justify-content: center;
    margin: 0;
    padding: 10px 20px;
    width: 100%;
}

.beian-row a {
    align-items: center;
    color: #555;
    display: flex;
    gap: 4px;
    text-decoration: none;
    transition: color 0.2s;
}

.beian-row a:hover { color: #888; }

.beian-row img {
    height: 14px;
    width: auto;
    object-fit: contain;
}

/* EN copyright paragraph (foot-en.htm) */
.footer-copyright {
    background-color: #111;
    box-sizing: border-box;
    color: #555;
    font-size: 11px;
    margin: 0;
    padding: 10px 20px;
    text-align: center;
    width: 100%;
}

/* Fallback: catch legacy inline-div beian blocks and the EN <p> */
footer + div {
    background-color: #111 !important;
    box-sizing: border-box;
    color: #666 !important;
    margin: 0 !important;
    padding: 8px 20px !important;
    text-align: center;
    width: 100% !important;
}

footer + p {
    background-color: #111 !important;
    box-sizing: border-box;
    color: #666 !important;
    font-size: 11px !important;
    margin: 0 !important;
    padding: 10px 20px !important;
    text-align: center !important;
    width: 100% !important;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* --- Tablet: 601–900px ------------------------------------ */
@media (max-width: 900px) {
    html {
        scroll-padding-top: 0.75rem;
    }

    nav {
        padding: 6px 12px;
        /* 移动端：取消顶栏 sticky，避免与展开菜单、视口高度抢夺；下拉仍依赖 position: relative */
        position: relative;
        top: auto;
    }

    .kr-footer-cta-inner {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .kr-footer-cta-actions {
        justify-content: flex-start;
        min-width: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .daohang {
        background-color: #fff;
        border-top: 1px solid #eee;
        box-shadow: 0 4px 12px rgba(0,0,0,0.12);
        display: none;               /* hidden until toggled */
        left: 0;
        padding: 8px 0 12px;
        position: absolute;
        right: 0;
        top: 100%;
        z-index: 9998;
    }

    .daohang.open {
        display: block;
    }

    nav ul.nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 0 8px;
        width: 100% !important;   /* override .daohang ul { width: fixed } in homepage CSS */
    }

    nav ul.nav > li {
        float: none !important;   /* override .nav li { float: left } in style.css */
        height: auto !important;  /* override .nav li { height: 100% } in style.css */
        line-height: normal !important;
        width: 100% !important;
        border-bottom: 1px solid #f0f0f0;
    }

    nav ul.nav > li > a {
        font-size: 14px;
        min-height: 46px;
        padding: 0 12px;
        width: 100%;
    }

    /* Dropdowns — collapsed by default on mobile, toggled by JS (.open class) */
    nav ul.nav li ul {
        background-color: #f7f7f7 !important;
        border-radius: 0;
        box-shadow: none !important;
        display: none !important;
        height: auto !important;
        left: auto !important;
        max-width: 100% !important;
        opacity: 1 !important;
        overflow: hidden;
        padding: 0 0 4px 20px;
        position: static !important;
        top: auto !important;
        width: 100% !important;
    }

    nav ul.nav li.open > ul {
        display: block !important;
    }

    /* Mobile mega menu: reduce vertical height for long "所有产品" lists */
    nav ul.nav > li.nav-mega.open > ul {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2px 8px;
        padding: 6px 10px 8px !important;
    }

    nav ul.nav > li.nav-mega.open > ul > li {
        width: auto !important;
    }

    nav ul.nav > li.nav-mega.open > ul > li > a {
        min-height: 36px;
        line-height: 36px !important;
        padding: 0 8px !important;
        font-size: 12.5px !important;
    }

    @media (min-width: 520px) {
        nav ul.nav > li.nav-mega.open > ul {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }
    }

    /* Arrow indicator for collapsible items */
    nav ul.nav > li:has(> ul) > a::after {
        content: ' ▸';
        font-size: 10px;
        opacity: 0.55;
        margin-left: 2px;
    }

    nav ul.nav > li.open:has(> ul) > a::after {
        content: ' ▾';
        opacity: 0.75;
    }

    nav ul.nav li ul li {
        float: none !important;
        height: auto !important;
        line-height: normal !important;
        position: static !important;
        text-align: left !important;
        width: 100% !important;
    }

    nav ul.nav li ul li a {
        background-color: transparent !important;
        color: #333 !important;
        display: block !important;
        font-size: 13px !important;
        line-height: 40px !important;
        min-height: 40px;
        overflow: hidden;
        text-align: left !important;
        text-overflow: ellipsis;
        white-space: nowrap;
        width: 100% !important;
    }

    nav ul.nav li ul li a:hover {
        background-color: #eef4ff !important;
        color: #2790f4 !important;
    }

    nav ul.nav li.lang-toggle {
        margin-left: 0;
    }
}

/* --- Mobile: ≤ 600px -------------------------------------- */
@media (max-width: 600px) {
    .kr-footer-cta {
        padding: 36px 16px 30px;
    }

    .kr-footer-cta-inner {
        padding: 22px 18px;
    }

    .kr-footer-cta-actions {
        flex-direction: column;
        width: 100%;
    }

    .kr-footer-cta-btn {
        width: 100%;
    }

    nav .logobox img.logo {
        height: 28px;
    }

    .logo-divider {
        height: 22px;
    }

    footer {
        padding: 24px 16px 16px;
    }

    footer .center {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 24px;
    }

    footer.footer-light .center {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px 24px !important;
    }

    .footer-logos img {
        height: 28px;
    }
}

/* --- Very small: ≤ 380px ---------------------------------- */
@media (max-width: 380px) {
    nav .logobox img.logo {
        height: 24px;
    }

    nav .logobox {
        gap: 8px;
    }

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

    footer.footer-light .center {
        grid-template-columns: 1fr !important;
    }
}

/* --- Breadcrumb <nav> — reset sticky/z-index from generic nav rule --- */
nav.breadcrumbs {
    background-color: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    position: static !important;
    top: auto !important;
    z-index: auto !important;
}

/* --- 次级 sticky 条（筛选栏等）：顶在主导航下方、限高；移动端不 sticky --- */
@media (min-width: 901px) {
    .kr-sticky-under-nav {
        box-sizing: border-box;
        max-height: 3.5rem;
        overflow: auto;
        position: sticky;
        top: var(--nav-sticky-offset);
        z-index: 8000;
    }
}

@media (max-width: 900px) {
    .kr-sticky-under-nav {
        max-height: none;
        position: static;
        top: auto;
    }
}

/* --- Mobile language toggle (outside hamburger menu) ------- */
.lang-btn-mobile {
    display: none;                /* shown only on mobile via media query */
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #444;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    line-height: 1;
    padding: 5px 9px;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.lang-btn-mobile:hover {
    background-color: #f0f4ff;
    border-color: #2790f4;
    color: #2790f4;
}

@media (max-width: 900px) {
    .lang-btn-mobile {
        display: inline-flex;
    }
    /* Hide the desktop lang-toggle inside the collapsed menu on mobile */
    nav ul.nav li.lang-toggle {
        display: none;
    }
}

/* --- EN nav: centered, lighter weight, tighter spacing ---- */
nav.nav-en ul.nav {
    justify-content: center;
}

nav.nav-en ul.nav > li {
    font-size: 12.5px;
    font-weight: 400;
    letter-spacing: 0;
}

nav.nav-en ul.nav > li > a {
    padding: 0 6px;
}

nav.nav-en ul.nav li ul li a {
    font-size: 12px;
}

/* ============================================================
   SEARCH BAR  —  legacy, used on some pages
   ============================================================ */
.search-bar {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 10px;
    margin: 20px auto;
    max-width: 960px;
    padding: 10px;
}

.search-bar input {
    border: 1px solid #ccc;
    border-radius: 4px;
    flex: 1;
    font-size: 14px;
    padding: 8px;
}

.search-bar button {
    background-color: #07539f;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 16px;
    transition: background-color 0.2s;
}

.search-bar button:hover {
    background-color: #053f7c;
}

/* ============================================================
   PRODUCT CATEGORY PAGE SPACING FIX  (.t1 + .box layout)
   Overrides legacy page-specific CSS for category pages
   ============================================================ */
.t1 {
    height: auto !important;
    margin-top: 4px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.box {
    padding-bottom: 24px !important;
}

@media (max-width: 900px) {
    .t1 {
        margin-top: 0 !important;
    }
    .box {
        padding-left: 12px !important;
        padding-right: 12px !important;
        padding-bottom: 16px !important;
        justify-content: center !important;
    }
    .box .innerbox {
        height: auto !important;
        margin: 10px 6px !important;
        width: 155px !important;
    }
    .box .innerbox img {
        height: 155px !important;
        width: 155px !important;
    }
}

/* ============================================================
   SOCIAL SHARE WIDGET — fixed, mobile/tablet only
   ============================================================ */
.share-widget {
    align-items: flex-end;
    bottom: 20px;
    display: none;           /* hidden on desktop */
    flex-direction: column;
    gap: 8px;
    position: fixed;
    right: 16px;
    z-index: 9990;
}

@media (max-width: 900px) {
    .share-widget {
        display: flex;
    }
}

.share-main-btn {
    align-items: center;
    background-color: #2790f4;
    border: none;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.28);
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 13px;
    font-weight: 600;
    gap: 6px;
    padding: 10px 16px;
    transition: background-color 0.2s, transform 0.15s;
    white-space: nowrap;
}

.share-main-btn:hover {
    background-color: #1a7de0;
    transform: scale(1.05);
}

.share-panel {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 160px;
    padding: 8px;
}

.share-panel[hidden] {
    display: none;
}

.share-option {
    align-items: center;
    background: none;
    border: none;
    border-radius: 8px;
    color: #333;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    gap: 10px;
    padding: 9px 12px;
    text-decoration: none;
    transition: background-color 0.15s;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.share-option:hover {
    background-color: #f5f7ff;
    color: #2790f4;
}

.share-option svg {
    flex-shrink: 0;
    height: 20px;
    width: 20px;
}

/* WeChat QR / link-copy overlay */
.share-qr-overlay {
    align-items: center;
    background-color: rgba(0,0,0,0.6);
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 99995;
}

.share-qr-overlay[hidden] {
    display: none;
}

.share-qr-box {
    background-color: #fff;
    border-radius: 16px;
    max-width: 300px;
    padding: 24px 20px;
    text-align: center;
    width: 88%;
}

.share-qr-box h3 {
    color: #333;
    font-size: 16px;
    margin: 0 0 12px;
}

.share-qr-box p {
    color: #666;
    font-size: 13px;
    margin: 8px 0 0;
    line-height: 1.5;
}

.share-qr-close {
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 16px;
    padding: 8px 24px;
    font-family: inherit;
}

.share-toast {
    background-color: rgba(0,0,0,0.75);
    border-radius: 8px;
    bottom: 90px;
    color: #fff;
    font-size: 13px;
    padding: 8px 16px;
    position: fixed;
    right: 16px;
    z-index: 99996;
    pointer-events: none;
    transition: opacity 0.4s;
}

/* ============================================================
   MOBILE FIXED CALL-TO-ACTION — 与首页改版一致（左下角药丸条）
   需配合 </main> 后插入的 <a class="kr-mobile-call">；桌面端隐藏。
   与 .share-widget 错层：电话 z-index 低于分享主按钮，右侧留白预留分享区。
   ============================================================ */
.kr-mobile-call {
    display: none;
}

@media (max-width: 760px) {
    body:has(.kr-mobile-call) {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }

    .kr-mobile-call {
        position: fixed;
        left: 14px;
        right: 112px; /* 预留右下角分享按钮空间，须与 .share-widget 宽度协调 */
        bottom: calc(12px + env(safe-area-inset-bottom));
        z-index: 8999;
        display: block;
        padding: 12px 14px;
        border-radius: 999px;
        background: #D96A28;
        color: #fff !important;
        font-size: 0.95rem;
        font-weight: 800;
        line-height: 1.2;
        text-align: center;
        text-decoration: none;
        box-shadow: 0 8px 22px rgba(217, 106, 40, 0.35);
    }

    .kr-mobile-call:hover,
    .kr-mobile-call:focus {
        background: #B85A22;
        color: #fff !important;
    }
}

@media (max-width: 380px) {
    .kr-mobile-call {
        right: 104px;
        font-size: 0.86rem;
        padding-left: 10px;
        padding-right: 10px;
    }
}
