html,body{
    padding: 0;
    margin: 0;
    background: #f4f6f8;
    color: #475467;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
body{
    margin: 0 auto;
    max-width: 720px;
    min-height: 100vh;
}

/* 主题色变量（可在后台“站点配色”中调整，前台按配置覆盖） */
:root{
    --primary: #0013D2;
    --primary-light: #0040ff;
    --search-bg: #0013D2;
    --search-bg-light: #0040ff;
    --boxcode-bg: #0013D2;
    --boxcode-bg-light: #0040ff;
    --float-btn-bg: #0013D2;
    --float-btn-bg-light: #0040ff;

    /* 中性色（现代简约商务风）：面 / 线 / 三级文字 / 卡片阴影 */
    --surface: #fff;
    --line: #e8ecf1;
    --line-soft: #eef1f5;
    --ink: #29303d;
    /* 标题等需要最强层级的文字 */
    --ink-strong: #101828;
    --ink-2: #475467;
    /* --ink-3 用于承载信息的次要文字（分类名、规格、图例），按 WCAG AA 调到 4.6:1 */
    --ink-3: #667085;
    /* --ink-4 仅用于纯装饰/分隔，不承载必读信息 */
    --ink-4: #98a2b3;
    --shadow-card: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
    --shadow-card-hover: 0 6px 20px rgba(16,24,40,.10), 0 2px 6px rgba(16,24,40,.05);

    /* 圆角规范 */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --radius-pill: 999px;

    /* 匹配状态色：图例与型号标签共用同一组 token，避免两处各写各的而后期走样 */
    --match-exact: #d92d20;
    --match-partial: #0b6bb0;
    --match-partial-soft: #eaf5fd;

    --price: #b42318;
    --new-badge: #079455;
    --focus-ring: 0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent);
}

/* ============================================
   首页：全屏渐隐轮播作背景板 + 前景内容层
   ============================================ */
/* 背景板：铺满整个视口，固定不动；内容层在它上面滚动 */
.swiper-bg{
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 0;
    overflow: hidden;
    /* 没有轮播图时兜底成深色底，保证上层白卡可读 */
    background: #10161f;
    pointer-events: none;   /* 背景不拦截点击 */
}
.swiper-bg .swiper-wrapper,
.swiper-bg .swiper-slide{
    width: 100%;
    height: 100%;
}
.swiper-bg .swiper-slide img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
/* 分页点在内容层之上，贴屏幕底部居中 */
.swiper-bg-pagination{
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 12px;
    z-index: 5;
    pointer-events: none;
    text-align: center;
}

/* 前景层：把搜索框 / 设备信息条 / 产品列表当作一个整体，
   左右统一留边距、竖直居中（下留白更多 → 视觉上位于中线偏上）。
   注意：这一层本身不带底色，背景板要透出来。 */
.home-layer{
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* 上：避开右上角固定的语言切换器；下：多留出偏移量，让整组内容落在中线偏上 */
    padding: 3.75rem var(--home-gutter, .85rem) 7rem;
}
/* 内容组：30% 白底只铺在这三个元素上（搜索框 + 设备信息条 + 产品列表），
   留一圈内边距让白底比内容略大。
   高度封顶为「视口 - .home-layer 的上下留白（3.75rem + 7rem）」：
   搜索框与设备条固定，结果列表在剩余空间内滚动，长列表不再把整页撑长。 */
.home-stack{
    background: rgba(255, 255, 255, .3);
    border-radius: var(--radius-lg);
    padding: .6rem;
    /* max-height 要包含内边距，否则会多出 1.2rem 把整页再撑出一小段滚动 */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(100vh - 10.75rem);
    max-height: calc(100dvh - 10.75rem);
}
/* 搜索框和设备条始终保持原始高度，不参与压缩，剩余高度全部给列表 */
.home-stack > .home-search,
.home-stack > .mydevice{
    flex: 0 0 auto;
}
.home-search{
    /* 顶部留白已统一由 .home-layer 的 padding 提供 */
    padding-top: 0;
}

.swiper{
    overflow: hidden;
}
.swiper-slide img{
    width: 100%;
    display: block;
}
.swiper-pagination-bullet{
    background: #fff;
    opacity: .6;
    transition: width .2s ease, opacity .2s ease;
}
.swiper-pagination-bullet-active{
    background: #fff;
    opacity: 1;
    width: 16px;
    border-radius: var(--radius-pill);
}

/* 设备信息条：与搜索框、产品卡同一列宽，圆角卡片浮在背景板上 */
.mydevice{
    margin: 0 0 0.7rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    animation: fadeIn 0.5s ease;
}
.mydevice-card{
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    background: var(--surface);
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.mydevice-card:hover{
    background: #fafbfd;
    box-shadow: 0 2px 8px rgba(16,24,40,.06);
}

.mydevice-card .mydevice-img{
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: var(--line-soft);
}
.mydevice-card .mydevice-info{
    flex: 1;
    min-width: 0;
}
.mydevice-card .mydevice-name{
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mydevice-card .mydevice-specs{
    font-size: 0.7rem;
    color: var(--ink-3);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 卡片右侧圆形按钮：查看设备详情 */
.mydevice-card .mydevice-detail{
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--line-soft);
    color: var(--ink-3);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.mydevice-card .mydevice-detail:hover{
    background: var(--primary);
    color: #fff;
}
.mydevice-card .mydevice-detail:focus-visible{
    outline: none;
    box-shadow: var(--focus-ring);
}
.mydevice-card .mydevice-img-placeholder{
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--line-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--ink-4);
}
/* 搜索框：不再通栏贴边，改成浮在背景板上的圆角条（左右边距由 .home-layer 提供） */
.searchForm{
    padding: 0.6rem 0.55rem;
    background: linear-gradient(180deg, var(--search-bg) 0%, color-mix(in srgb, var(--search-bg) 86%, #000) 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--search-bg) 32%, transparent);
    margin-bottom: 0.7rem;
}
.icon-search {
    width: 19px;
    height: 19px;
    margin-inline-start: 0.9rem;
    flex-shrink: 0;
    color: var(--ink-3);
}
.search-dropdown {
    position: relative;
    width: 100%;
}

.search-dropdown-input {
    display: flex;
    align-items: center;
    background-color: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    position: relative;
    box-shadow: 0 2px 10px rgba(16,24,40,.16);
}
.search-dropdown-input:focus-within {
    box-shadow: var(--focus-ring), 0 2px 10px rgba(16,24,40,.16);
}
.search-dropdown-input input {
    flex: 1;
    height: 46px;
    width: 100%;
    padding-inline-start: 0.55rem;
    padding-inline-end: 0.5rem;
    border: none;
    background: transparent;
    outline: none;
    font-size: 1rem;
    display: block;
    transition: all 0.3s ease;
}
.search-dropdown-input input::placeholder {
    color: #999;
    font-size: 0.95rem;
}
.dropdown-arrow {
    padding: 0 1rem;
    font-size: 0.7rem;
    color: var(--ink-3);
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
    user-select: none;
    flex-shrink: 0;
    line-height: 45px;
}
.search-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

.search-dropdown-list {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(16,24,40,.12);
    z-index: 1001;
    max-height: 55vh;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}
.search-dropdown.open .search-dropdown-list {
    display: block;
}
.search-dropdown-list ul {
    list-style: none;
    margin: 0;
    padding: 0.3rem 0;
}
.search-dropdown-list li {
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--ink-2);
    transition: background 0.2s ease, color 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
}
.search-dropdown-list li:last-child {
    border-bottom: none;
}
.search-dropdown-list li:hover,
.search-dropdown-list li.highlighted {
    background: #f7f9fc;
    color: var(--primary);
}
.search-dropdown-list li .match-highlight {
    color: var(--primary);
    font-weight: 700;
}
.search-dropdown-list .no-result {
    padding: 1rem;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
}

.search-dropdown-input input[readonly] {
    cursor: pointer;
    caret-color: transparent;
}

.keyword-clear {
    padding: 0 0.6rem;
    font-size: 0.85rem;
    color: var(--ink-3);
    cursor: pointer;
    flex-shrink: 0;
    line-height: 45px;
    transition: color 0.2s ease;
    user-select: none;
}
.keyword-clear:hover {
    color: var(--primary);
}

.dropdown-search-wrap {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.dropdown-search-input {
    width: 100%;
    box-sizing: border-box;
    height: 34px;
    padding: 0 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: none;
    font-size: 0.88rem;
    color: var(--ink);
    background: #f7f9fc;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.dropdown-search-input:focus {
    border-color: var(--primary);
    background: #fff;
}
.dropdown-search-input::placeholder {
    color: #bbb;
}

.search-dropdown-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
}

.search-dropdown-input input.input-invalid {
    animation: shake 0.4s ease;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.search-dropdown-overlay.active {
    display: block;
}
.list li:focus-visible,
.toggle-mobiles:focus-visible{
    outline: none;
    box-shadow: var(--focus-ring);
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* 列表左右边距由 .home-layer 统一提供；底部留白交给 .home-layer 的 padding-bottom。
   结果超过可用高度时在列表区内部滚动：搜索框与设备条保持不动，头尾都够得着。
   少量内边距用于容纳卡片阴影，避免滚动时上下边缘被裁切。 */
.models{
    /* 用逻辑方向留白：RTL 下滚动条在左侧时也能对称留出阴影空间 */
    padding-block: 2px 4px;
    padding-inline: 2px 4px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    /* 让滚动条常显且不挤压卡片：Chrome / Edge / Android 生效，iOS 会隐藏原生滚动条 */
    scrollbar-width: thin;
    scrollbar-color: rgba(16,24,40,.22) transparent;
    scrollbar-gutter: stable;
}
.models::-webkit-scrollbar{
    width: 6px;
}
.models::-webkit-scrollbar-track{
    background: transparent;
}
.models::-webkit-scrollbar-thumb{
    background-color: rgba(16,24,40,.22);
    border-radius: 3px;
}
.models::-webkit-scrollbar-thumb:hover{
    background-color: rgba(16,24,40,.34);
}
/* 最后一张卡不再留额外底边距，避免 30% 白底在卡片下方多出一截 */
.home-stack .models .item:last-child{
    margin-bottom: 0;
}
/* 卡片头部：箱码徽标 / 标题+分类 / 价格 */
.header{
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .7rem;
}
.header .des{
    flex: 1;
    min-width: 0;
}
.models .item{
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1rem 1.1rem;
    margin-bottom: 0.9rem;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    border: 1px solid var(--line);
    /* backwards（不是 both）：动画结束后不残留 transform，否则会盖掉 :hover 的抬升 */
    animation: fadeInUp 0.45s cubic-bezier(.22,.8,.3,1) backwards;
    animation-delay: var(--i, 0ms);
}
.models .item:hover{
    box-shadow: var(--shadow-card-hover);
    border-color: color-mix(in srgb, var(--primary) 26%, var(--line));
    transform: translateY(-2px);
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.models .item .header{
    margin-bottom: 0;
}
/* 有型号时才在头部下方画分隔线，避免空卡片留下一道悬空的横线 */
.models .item.has-models .header{
    padding-bottom: 0.8rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--line-soft);
}
.models .item .boxCode{
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--cat-color, var(--boxcode-bg));
    color: #fff;
    padding: 0 0.8rem;
    border-radius: var(--radius-md);
    height: 40px;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    min-width: 52px;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--cat-color, var(--boxcode-bg)) 30%, transparent);
}
.models .item .title{
    font-weight: 700;
    color: var(--ink-strong);
    font-size: 1.05rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin-bottom: 0.3rem;
    overflow-wrap: anywhere;
}
.models .item .category{
    display: inline-block;
    padding: 0.14rem 0.5rem;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--cat-color, var(--primary)) 10%, #fff);
    color: color-mix(in srgb, var(--cat-color, var(--primary)) 62%, var(--ink-strong));
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
}
.models .item .price{
    flex-shrink: 0;
    align-self: flex-start;
    color: var(--price);
    font-weight: 800;
    font-size: 1.12rem;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    margin-top: 0.1rem;
}
/* ── 精简搜索结果卡：左侧盒号，右侧「分类 + 通用型号区」上下排列 ── */
.models .item.item-simple{
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 0.8rem 1rem;
}
/* 无匹配型号时右侧只剩分类，盒号与分类垂直居中对齐 */
.models .item.item-simple:not(.has-models){
    align-items: center;
}
/* 无型号时右侧内容区的最小高度与盒号一致，左右保持等高 */
.models .item.item-simple:not(.has-models) .item-main{
    min-height: 56px;
    justify-content: center;
}
/* 有匹配型号时盒号随右侧内容一起拉伸，保证左右等高 */
.models .item.item-simple.has-models{
    align-items: stretch;
}
.models .item.item-simple.has-models .boxCode{
    height: auto;
    min-height: 56px;
}
.item-main{
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
}
/* 型号列表占满右侧可用宽度，标签正常换行 */
.item-main .mobile-groups{
    width: 100%;
}
.models .item.item-simple .boxCode{
    height: 56px;
    /* 含内边距计算宽度：min-width 即盒号可见总宽，避免 padding 把区域又撑宽 */
    box-sizing: border-box;
    min-width: 76px;
    padding: 0 0.7rem;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    border-radius: var(--radius-md);
}
.models .item.item-simple .category{
    font-size: 0.82rem;
    padding: 0.2rem 0.65rem;
}
.list{
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    /* 关键：同一行里带 NEW/备注的标签换行会变高，默认 stretch 会把同行的标签一起撑高 */
    align-items: flex-start;
}
.list li{
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    min-height: 1.9rem;
    max-width: 100%;
    padding: 0.28rem 0.7rem;
    border-radius: var(--radius-sm);
    background-color: #f4f6fa;
    color: var(--ink-2);
    font-size: 0.82rem;
    line-height: 1.3;
    border: 1px solid transparent;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease,
                transform 0.18s ease, box-shadow 0.18s ease;
}
/* 型号名允许换行：长型号完整展示，不再用省略号截断；
   anywhere 保证极长且无空格的整体串也能在标签内断开，避免横向溢出。 */
.list li .model-name{
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.list li:hover{
    background-color: #fff;
    border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
    color: var(--ink);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16,24,40,.08);
}
.list li:active{
    transform: translateY(0) scale(.98);
}
.list li.active{
    background: var(--match-exact);
    color: #fff;
    border-color: var(--match-exact);
    font-weight: 600;
    box-shadow: 0 3px 10px color-mix(in srgb, var(--match-exact) 30%, transparent);
}
.list li.sub{
    background: var(--match-partial-soft);
    color: var(--match-partial);
    border-color: color-mix(in srgb, var(--match-partial) 22%, #fff);
    font-weight: 600;
}
/* 新型号标记：命中「型号注解」NEW 的型号右上角上标 NEW */
.list li .new-tag{
    display: inline-block;
    flex-shrink: 0;
    margin-inline-start: 0.35rem;
    padding: 0.05rem 0.3rem;
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 1.55;
    letter-spacing: 0.04em;
    color: #fff;
    background: var(--new-badge);
    border-radius: 6px;
    /* 用 transform 而不是 vertical-align：在 flex 布局里定位更可靠 */
    transform: translateY(-0.34em);
    box-shadow: 0 0 0 1.5px rgba(255,255,255,.9), 0 1px 4px color-mix(in srgb, var(--new-badge) 45%, transparent);
    cursor: inherit;
}
/* 型号备注：跟随型号显示的小号灰字 */
.list li .model-note{
    display: inline-block;
    flex-shrink: 0;
    margin-inline-start: 0.35rem;
    padding-inline-start: 0.4rem;
    border-inline-start: 1px solid currentColor;
    font-size: 0.85em;
    font-weight: 400;
    opacity: 0.72;
    cursor: inherit;
}
.list li.active .model-note,
.list li.sub .model-note{
    opacity: 0.88;
}
/* 通用型号列表容器：只显示匹配型号，直接平铺，不按品牌分组 */
.mobile-groups{
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
dl.info{
    margin: 0.8rem 0 0;
    padding: 0;
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    font-size: 0.72rem;
    color: var(--ink-3);
}
.models .item.has-models dl.info{
    padding-top: 0.7rem;
    border-top: 1px solid var(--line-soft);
}
dl.info dd{
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
dl.info dd .meta-icon{
    flex-shrink: 0;
    opacity: 0.85;
}

.list .mobile-hidden {
    display: none;
}

.toggle-mobiles {
    width: 100%;
    margin-top: 0.8rem;
    padding: 0.55rem 0.9rem;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    text-align: center;
    background-color: color-mix(in srgb, var(--primary) 7%, #fff);
    border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
    border-radius: var(--radius-pill);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.toggle-mobiles:hover {
    background-color: color-mix(in srgb, var(--primary) 12%, #fff);
    border-color: color-mix(in srgb, var(--primary) 32%, var(--line));
    box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 14%, transparent);
}

.toggle-mobiles:active {
    background-color: color-mix(in srgb, var(--primary) 18%, #fff);
}

.toggle-mobiles.expanded {
    background-color: color-mix(in srgb, var(--primary) 12%, #fff);
    color: var(--primary);
}

.toggle-mobiles .toggle-icon {
    font-style: normal;
    transition: transform 0.3s ease;
    font-size: 0.72rem;
}

.toggle-mobiles.expanded .toggle-icon {
    transform: rotate(180deg);
}

.toggle-mobiles .toggle-text {
    font-weight: 600;
}

/* 空结果 */
.empty-state{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 3rem 1.5rem;
    margin-top: 0.5rem;
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    color: var(--ink-3);
    text-align: center;
}
.empty-state .empty-state-icon{
    color: var(--ink-4);
}
.empty-state p{
    margin: 0;
    font-size: 0.85rem;
}

/* ── 列表区提示：首屏等待识别 / 未识别到设备型号（不展示任何产品） ── */
.list-hint{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2.6rem 1.5rem;
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    color: var(--ink-3);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.list-hint:hover{
    border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
    color: var(--ink-strong);
}
.list-hint:focus-visible{
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.list-hint .list-hint-icon{
    color: var(--ink-4);
}
.list-hint p{
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.5;
}
/* 等待识别态：不可点，弱化展示 */
.list-hint-pending{
    border-style: solid;
    border-color: var(--line-soft);
    cursor: default;
    color: var(--ink-4);
}
.list-hint-pending:hover{
    border-color: var(--line-soft);
    color: var(--ink-4);
}
.list-hint-pending p{
    font-weight: 500;
}

.loader{
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 500;
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.12);
}

.to-top,.orderby{
    position: fixed;
    inset-inline-end: 1rem;
    bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    width: 2.75rem;
    height: 2.75rem;
    background: linear-gradient(180deg, var(--float-btn-bg-light) 0%, var(--float-btn-bg) 100%);
    border-radius: 16px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--float-btn-bg) 32%, transparent);
    z-index: 1000;
    color: #fff;
    border: none;
    font-family: inherit;
    transition: box-shadow 0.2s ease, filter 0.2s ease, transform 0.2s ease;
}
.to-top:hover,.orderby:hover{
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--float-btn-bg) 38%, transparent);
}
.to-top:active,.orderby:active{
    transform: translateY(0);
}
.to-top:focus-visible,.orderby:focus-visible{
    outline: none;
    box-shadow: var(--focus-ring), 0 6px 18px color-mix(in srgb, var(--float-btn-bg) 32%, transparent);
}
.orderby{
    bottom: calc(6.2rem + env(safe-area-inset-bottom, 0px));
}
.orderby .orderby-icon{
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
}

.floating-menu-btn {
    position: fixed;
    right: 1rem;
    bottom: 11.5rem;
    width: 2.8rem;
    height: 2.8rem;
    line-height: 2.8rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #fff;
    text-align: center;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 18px rgba(255, 107, 53, 0.45);
    transition: all 0.3s ease;
    border: none;
}
.floating-menu-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.6);
}
.floating-menu-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.floating-menu-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
}
.floating-menu-panel.active {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}
.floating-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    animation: fadeIn 0.2s ease;
}
.floating-menu-content {
    position: absolute;
    right: 1rem;
    bottom: 15rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.16);
    min-width: 160px;
    overflow: hidden;
    animation: slideUp 0.25s ease;
}
.floating-menu-list {
    list-style: none;
    margin: 0;
    padding: 0.3rem 0;
}
.floating-menu-list li {
    margin: 0;
}
.floating-menu-list a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.2rem;
    color: #444;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}
.floating-menu-list a:hover,
.floating-menu-list a:active {
    background: #f5f5f5;
    color: var(--primary);
}

.wrapper-about{
    background-color: #fff;
    padding: 1rem;
    margin: 1rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
}

/* 手机详情弹窗样式 */
.mobile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

/* 设备选择弹窗 */
.device-select-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.device-select-modal.active {
    opacity: 1;
    visibility: visible;
}
.device-select-modal.closing {
    opacity: 0;
    visibility: hidden;
}
.dsm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.dsm-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(16, 24, 40, 0.18);
    animation: slideUp 0.3s ease;
}
.dsm-header {
    padding: 1.5rem 1.5rem 0.5rem;
    text-align: center;
}
.dsm-header h3 {
    margin: 0 0 0.3rem;
    font-size: 1.15rem;
    color: var(--ink);
    font-weight: 600;
    letter-spacing: -0.01em;
}
.dsm-header p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ink-3);
    line-height: 1.45;
}
.dsm-body {
    padding: 0.8rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.dsm-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 0.95rem;
    color: var(--ink-2);
    text-align: left;
    width: 100%;
    outline: none;
}
.dsm-option:hover,
.dsm-option:focus {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 5%, #fff);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 12%, transparent);
}
.dsm-option:active {
    background: color-mix(in srgb, var(--primary) 9%, #fff);
    box-shadow: none;
}
.dsm-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}
.dsm-model-name {
    font-weight: 600;
    flex: 1;
}
.dsm-footer {
    padding: 0.5rem 1.2rem 1.2rem;
    text-align: center;
}
.dsm-manual {
    padding: 0.55rem 1.6rem;
    margin-right: 0.4rem;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.dsm-manual:hover {
    background: var(--primary);
    color: #fff;
}
.dsm-skip {
    padding: 0.55rem 1.6rem;
    border: none;
    background: transparent;
    color: var(--ink-3);
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.dsm-skip:hover {
    background: #f2f4f7;
    color: var(--ink-2);
}

.mobile-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.mobile-modal .modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    /* 必须给 width：否则作为 flex 子项会被内容撑成 shrink-to-fit，手机上窄一大截 */
    width: 100%;
    max-width: 90%;
    max-height: 85vh;
    /* 滚动交给 .modal-body，关闭按钮才能绝对定位常驻右上角而不占布局 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(16, 24, 40, 0.20);
    animation: slideUp 0.3s ease;
    margin: 1rem;
}

.mobile-modal .modal-close {
    /* 悬浮在右上角，不占一行/一列 */
    position: absolute;
    top: 0;
    inset-inline-end: 0;
    font-size: 26px;
    font-weight: 300;
    line-height: 1;
    color: var(--ink-2);
    cursor: pointer;
    padding: 0.35rem 0.55rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    border-start-end-radius: 16px;
    border-end-start-radius: 12px;
    z-index: 1;
    transition: all 0.3s ease;
}

.mobile-modal .modal-close:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

.mobile-modal .modal-body {
    /* 窄屏收紧内边距，把宽度让给参数内容 */
    padding: 0.85rem 1rem 1rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.mobile-modal .modal-body.loading {
    text-align: center;
    padding: 3rem;
    color: var(--ink-3);
    font-size: 1.05rem;
}

.mobile-detail {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.mobile-detail .detail-image {
    text-align: center;
    background: #f7f9fc;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 1rem;
}

.mobile-detail .detail-image img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
}

.mobile-detail .detail-info {
    display: flex;
    flex-direction: column;
}

.mobile-detail .detail-info h3 {
    margin: 0 0 0.75rem 0;
    /* 让开右上角悬浮的关闭按钮 */
    padding-inline-end: 2.2rem;
    color: var(--primary);
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.3;
}

/* 完整参数表：全宽单列；标签列用固定宽度，保证所有行的数值左边缘对齐 */
.mobile-detail .detail-info .spec-list {
    --spec-label-w: 7.5em;
    margin: 0;
    padding: 0.2rem 0.85rem;
    background: #fafbfc;
    border: 1px solid #eef1f5;
    border-radius: 10px;
}

.mobile-detail .detail-info .spec-item {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.42rem 0;
    border-bottom: 1px solid #eef1f5;
    font-size: 0.78rem;
    line-height: 1.5;
}

.mobile-detail .detail-info .spec-item:last-child {
    border-bottom: none;
}

.mobile-detail .detail-info .spec-item dt {
    flex: 0 0 var(--spec-label-w);
    width: var(--spec-label-w);
    color: #8a94a6;
    font-weight: 500;
    /* 贴住数值：左对齐会在标签与数值之间留出一大片空白 */
    text-align: end;
    hyphens: auto;
}

.mobile-detail .detail-info .spec-item dd {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    color: #1f2937;
    font-weight: 500;
    overflow-wrap: anywhere;
}

/* 窄屏：标签与数值改为上下排列，避免数值列被挤得太窄 */
@media (max-width: 400px) {
    .mobile-detail .detail-info .spec-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.1rem;
        padding: 0.5rem 0;
    }

    .mobile-detail .detail-info .spec-item dt {
        flex: none;
        width: auto;
        text-align: start;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 600px) {
    .mobile-modal .modal-content {
        max-width: 760px;
    }

    .mobile-modal .modal-body {
        padding: 1rem 1.5rem 1.5rem;
    }
    
    .mobile-detail {
        flex-direction: row;
    }
    
    .mobile-detail .detail-image {
        flex: 0 0 170px;
    }
    
    .mobile-detail .detail-info {
        flex: 1;
    }
}

/* ============================================
   语言切换器
   ============================================ */
.lang-switcher {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1001;
}
.lang-switcher-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.lang-switcher-btn:hover {
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.24);
}
.lang-switcher-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.16);
    min-width: 170px;
    max-height: 60vh;
    overflow-y: auto;
    display: none;
}
.lang-switcher-panel.active {
    display: block;
    animation: fadeIn 0.2s ease;
}
.lang-switcher-panel ul {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
}
.lang-switcher-panel li {
    padding: 0.6rem 1.1rem;
    font-size: 0.88rem;
    color: var(--ink-2);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}
.lang-switcher-panel li:hover {
    background: #f7f9fc;
    color: var(--primary);
}
.lang-switcher-panel li.active {
    color: var(--primary);
    font-weight: 600;
}
.lang-switcher-panel li.lang-auto {
    margin-top: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line-soft);
    color: var(--ink-3);
}
.lang-switcher-panel li.lang-auto.active {
    color: var(--primary);
}

/* ============================================
   RTL 适配（阿拉伯语）
   ============================================ */
[dir="rtl"] .lang-switcher {
    right: auto;
    left: 0.75rem;
}
[dir="rtl"] .lang-switcher-panel {
    right: auto;
    left: 0;
}
[dir="rtl"] .to-top,
[dir="rtl"] .orderby,
[dir="rtl"] .floating-menu-btn {
    right: auto;
    left: 1rem;
}
[dir="rtl"] .search-dropdown-input input {
    direction: rtl;
    text-align: right;
}

/* ============================================
   动效偏好：系统开启「减弱动态效果」时关掉位移/缩放类动效
   （保留轮播自身的滑动，避免影响 Swiper 的行为）
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .models .item,
    .models .item:hover,
    .list li,
    .list li:hover,
    .list li:active,
    .to-top,
    .orderby,
    .toggle-mobiles .toggle-icon {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
    .models .item{
        opacity: 1;
    }
}
