/* ============================================================
 * 慧明眼镜官网样式（对标 docs/官网页面素材 设计稿）
 * 设计语言：白底头部 + 花形logo + 居中导航；浅色极简正文；
 * 居中区块标题 + 藏青短下划线；浅灰 5 列页脚。
 * ============================================================ */

/* ---------------- tokens ---------------- */
:root {
    --navy: #2b4a8f;          /* 强调色：区块下划线/按钮 */
    --navy-deep: #1e3a70;
    --navy-brand: #001b71;    /* 品牌藏青（蓝湖首页新闻双按钮实底，像素采样 #001B71） */
    --red: #d0021b;           /* 强调红：分页当前页/跳转箭头 */
    --ink: #222;              /* 主文字 */
    --ink-2: #555;            /* 次级文字 */
    --ink-3: #888;            /* 弱文字 */
    --line: #e5e5e5;          /* 分隔线 */
    --band: #f4f4f4;          /* 浅灰带（首页新闻区/搜索框，设计稿实测） */
    --band-2: #f2f2f2;        /* 页脚底（设计稿实测） */
    --band-3: #f8f8f8;        /* 单页内容区浅灰（技术方案/产业链设计稿实测） */
    --bg: #fff;
    --header-h: 80px;
    --container: 1200px;
    --container-wide: 1368px; /* 新闻列表等宽版面（Figma 1920 稿 1320 内容宽 + 两侧 24 垫，对齐 .article-wrap 1446=1398+48 约定） */
    --container-xl: 1404px;   /* 首页 bento/新闻/页脚版心（设计稿 258-1662 实测） */
    --ink-design: #3d3935;    /* 设计稿深墨（标题/正文主字色） */
    --font: "HarmonyOS Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", -apple-system, "Segoe UI", Arial, sans-serif;
}

/* ---------------- reset/base ---------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.75;
    color: var(--ink);
    background: var(--bg);
}
img { display: block; max-width: 100%; height: auto; border: 0; }
a { color: inherit; text-decoration: none; transition: color .2s, opacity .2s, border-color .2s; }
a:hover { color: var(--navy); }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }
table { border-collapse: collapse; }
em, i { font-style: normal; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: var(--container-wide); margin: 0 auto; padding: 0 24px; }
.sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px;
    clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

/* ---------------- header ---------------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}
.header-inner {
    margin: 0 auto; padding: 0 clamp(24px, 3.9vw, 74px);
    height: var(--header-h);
    display: flex; align-items: center; gap: 32px;
}
.logo { display: flex; align-items: center; flex: 0 0 auto; }
.logo img { height: 42px; width: auto; }

.main-nav {
    flex: 1 1 auto;
    display: flex; justify-content: center; align-items: center; gap: 64px;
}
.nav-link {
    position: relative;
    font-size: 17px; color: #333;
    line-height: var(--header-h); height: var(--header-h); display: inline-block;
    white-space: nowrap;
    /* 一级菜单项为无链接 span（一级不跳转，仅悬停/点按展开下拉），需补指针光标 */
    cursor: pointer;
}
.nav-link:hover, .nav-link.current { color: var(--navy); }
.nav-link.current::after {
    content: ""; position: absolute; left: 50%; transform: translateX(-50%);
    bottom: 12px; width: 24px; height: 2px; background: var(--navy);
}
/* 品牌与产品下拉：页头下方全宽条带，子项横向排列（对标 FoxCMS）
   .nav-item 不设定位，条带 absolute 锚定到 sticky 的 .site-header 即为全宽 */
.nav-drop {
    position: absolute; top: 100%; left: 0; width: 100%;
    background: #fff; border-radius: 0 0 16px 16px;
    box-shadow: 0 14px 30px rgba(0,0,0,.08);
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: all .25s;
}
.nav-item.open .nav-drop, .nav-item:hover .nav-drop, .nav-item:focus-within .nav-drop {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-drop-inner {
    max-width: var(--container); margin: 0 auto; padding: 26px 24px;
    display: flex; justify-content: center; align-items: center; flex-wrap: wrap;
}
.nav-drop-inner a {
    padding: 8px 34px; font-size: 15px; color: var(--ink-2);
    white-space: nowrap; line-height: 1.5;
}
.nav-drop-inner a:hover { color: var(--navy); }
/* 主导航无下拉箭头：悬停/聚焦展开全宽下拉面板 */

.header-side { flex: 0 0 auto; display: flex; align-items: center; gap: 20px; }
.lang-link { font-size: 17px; color: #333; }
.lang-link:hover, .lang-link.on { color: var(--navy); }
.search-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border: 0; background: none; color: var(--ink);
}
.search-toggle:hover { color: var(--navy); }
.search-toggle svg { width: 19px; height: 19px; }
.nav-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; position: relative; }
.nav-toggle span {
    position: absolute; left: 9px; right: 9px; height: 2px; background: var(--ink);
    transition: all .25s;
}
.nav-toggle span:nth-child(1) { top: 13px; }
.nav-toggle span:nth-child(2) { top: 19px; }
.nav-toggle span:nth-child(3) { top: 25px; }
.nav-toggle.open span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

/* ---------------- 搜索打开态（蓝湖「首页 - 搜索弹窗」：header 行内替换 + 热词面板下拉，页面不加遮罩） ---------------- */
/* 常态隐藏搜索框行；打开态导航/语言/搜索钮让位（.search-open 由 site.js 切换在 .site-header 上） */
/* gap 3px 是对齐契约：设计框右缘 1847（1404+443）与关闭钮左缘 1850 缝恰 3px——改 gap 会平移搜索框，破坏其与热词面板（同锚 x1404）的边缘共线 */
/* z 序：面板自框后方钻出（设计框底边框压面板上缘可见），行须高于 .search-panel（z-index:1） */
.search-bar-row {
    display: none;
    flex: 1 1 auto; align-items: center; justify-content: flex-end; gap: 3px;
    position: relative; z-index: 2;
}
.site-header.search-open .main-nav,
.site-header.search-open .header-side { display: none; }
.site-header.search-open .search-bar-row { display: flex; }
/* 搜索框：白底 1px 浅描边 4px 圆角（蓝湖 1404,9 起 443×65，placeholder 17px #999；放大镜切图 35×35 距右缘 25px → 左缘恰 x1787） */
.search-bar {
    display: flex; align-items: center; gap: 10px;
    width: min(443px, 100%); height: 65px; padding: 0 25px 0 26px;
    background: #fff; border: 1px solid #e5e5e5; border-radius: 4px;
    box-shadow: 0 4px 14px rgba(17, 24, 39, .05);
}
.search-bar input {
    flex: 1; border: 0; outline: none; font-size: 17px; color: var(--ink);
    background: none; font-family: inherit; min-width: 0;
}
/* 键盘焦点可见（WCAG 2.4.7）：outline:none 移除了默认指示，此处仅键盘 Tab/:focus-visible 补回，鼠标点入不触发 */
.search-bar input:focus-visible {
    outline: 2px solid var(--navy); outline-offset: 4px; border-radius: 2px;
}
.search-bar input::placeholder { color: #999; }
/* 提交钮=蓝湖切图 suosou 35×35（蓝湖 1787,23）墨色 #999：background:currentColor 借 mask alpha 成形，:hover 仍走 color 切换 */
.search-bar button {
    flex: 0 0 35px; width: 35px; height: 35px; border: 0; padding: 0;
    color: #999; background-color: currentColor;
    -webkit-mask: url('/static/images/design/search-submit.png') center / contain no-repeat;
    mask: url('/static/images/design/search-submit.png') center / contain no-repeat;
}
.search-bar button:hover { color: var(--navy); }
.search-close {
    flex: 0 0 auto; width: 40px; height: 40px; border: 0; padding: 0;
    color: #999; background-color: currentColor;
    /* 蓝湖关闭钮贴画板右缘 30px（越过 header 版心 74px padding）；与框的 3px 缝由 .search-bar-row gap 承担，框左缘随之对齐 1404 */
    margin-right: -44px;
    /* 切图 ｏｆｆ 28×29（蓝湖 1862,28）：glyph 右缘与钮右缘平齐(左 12=40-28)、距钮顶 8px */
    -webkit-mask: url('/static/images/design/search-close.png') 12px 8px / 28px 29px no-repeat;
    mask: url('/static/images/design/search-close.png') 12px 8px / 28px 29px no-repeat;
}
.search-close:hover { color: var(--navy); }
/* 视口窄于 1128px 时 header padding 不足 44px，负 margin 会把关闭钮推出视口 */
@media (max-width: 1127px) {
    .search-close { margin-right: 0; }
}
/* 热词面板：搜索框正下方白底 8px 圆角浮层（蓝湖 x1404 y69 w442，与框 443 左右边缘共线、1px 宽差为设计原值；
   面板右缘对齐契约：桌面 = 版心线（即框右缘 1847 - 1px 宽差）；<1128 档 +43 见上，≤768 档 right 59 见 05-responsive；
   top 69 藏于框底（65 高居中 80 header = 底 72.5）之后，自框后钻出、压 header 底缘融合阴影） */
.search-panel {
    position: absolute; top: calc(100% - 11px);
    right: clamp(24px, 3.9vw, 74px); z-index: 1;
    width: 442px; max-width: calc(100vw - 48px);
    background: #fff; border-radius: 8px;
    box-shadow: 0 20px 40px rgba(17, 24, 39, .10), 0 4px 14px rgba(17, 24, 39, .06);
    padding: 34px 36px 38px;
    display: none;
}
.site-header.search-open .search-panel { display: block; }
/* <1128 档面板右缘跟随框右缘（= 版心线 - 钮40 - 缝3）：须位于基础规则之后赢同特异性级联，勿上移合并进 .search-close 的媒体块 */
@media (max-width: 1127px) {
    .search-panel { right: calc(clamp(24px, 3.9vw, 74px) + 43px); }
}
.search-hot h3 {
    font-size: 22px; font-weight: 700; color: #333;
    padding-bottom: 20px; border-bottom: 1px solid #eee;
}
/* 蓝湖：热词两列 4 行、16px #777、行距 45px；后台热词删空时隐藏空列表防面板空荡 */
.search-hot ul { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; margin-top: 22px; }
.search-hot ul:empty { display: none; }
.search-hot li { line-height: 45px; }
.search-hot a { font-size: 16px; color: #777; }
.search-hot a:hover { color: var(--navy); }

/* 搜索结果页分组标题（页面命中组 / 内容组共用） */
.search-group-title { font-size: 20px; font-weight: 700; color: var(--ink); margin: 0 0 18px; }
/* 页面命中组：品牌/系列/栏目页直达行（名称 + 类型标签 + 所属品牌），全行可点 */
.sph-list { list-style: none; margin: 0 0 36px; padding: 0; border-top: 1px solid #eee; }
.sph-item a {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    padding: 14px 4px; border-bottom: 1px solid #eee;
    font-size: 16px; color: var(--ink); text-decoration: none;
}
.sph-item a:hover .sph-name { color: var(--navy); }
.sph-tag {
    flex: 0 0 auto; font-size: 12px; font-style: normal; line-height: 1;
    color: var(--navy); background: rgba(30, 58, 138, .08);
    padding: 5px 10px; border-radius: 999px;
}
.sph-brand { flex: 0 0 auto; color: #999; font-size: 14px; }

/* 搜索即时联想（site.js 输入防抖拉取，命中列表替换热词区展示；沿用页面命中组视觉语言） */
.search-suggest { max-height: calc(100vh - 140px); overflow: auto; }
.ss-group h4 { font-size: 13px; font-weight: 500; color: #999; margin: 20px 0 6px; }
.ss-group:first-child h4 { margin-top: 0; }
.ss-group ul { list-style: none; margin: 0; padding: 0; }
.ss-group li a {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    padding: 10px 2px; border-bottom: 1px solid #f0f0f0;
    font-size: 15px; color: var(--ink); text-decoration: none;
}
.ss-group li a:hover .ss-name, .ss-group li a:hover .ss-title { color: var(--navy); }
.ss-tag {
    flex: 0 0 auto; font-size: 12px; font-style: normal; line-height: 1;
    color: var(--navy); background: rgba(30, 58, 138, .08);
    padding: 4px 8px; border-radius: 999px;
}
.ss-brand { flex: 0 0 auto; color: #999; font-size: 13px; }
.ss-thumb { flex: 0 0 auto; width: 40px; height: 30px; object-fit: cover; border-radius: 3px; }
.ss-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-empty { margin: 20px 0 0; font-size: 15px; color: #999; }

