/* =========================================================
   世际香氛 · 产品视频展示 —— 样式
   ========================================================= */
* { box-sizing: border-box; }

/* 兜底：作者样式会覆盖浏览器默认的 [hidden]{display:none}。
   不加这条，像 .modal 这种设置了 display 的元素即使带 hidden 属性
   也会一直显示，把整个页面盖住、导致卡片点不动。 */
[hidden] { display: none !important; }

:root {
  --ink: #101828;
  --ink-2: #1b2440;
  --ink-soft: #545e78;
  --gold: #b8893c;
  --gold-lt: #e7cd95;
  --paper: #f7f4ef;
  --card: #fffdf9;
  --line: rgba(16, 24, 40, .10);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-md: 0 2px 6px rgba(16, 24, 40, .06), 0 18px 40px -18px rgba(16, 24, 40, .34);
  --r: 16px;
  --font-ui: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Hiragino Sans GB",
             "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  --font-d: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
}

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 10% -12%, rgba(184, 137, 60, .20), transparent 62%),
    radial-gradient(900px 460px at 94% -6%, rgba(27, 36, 64, .13), transparent 58%),
    linear-gradient(180deg, #fcfaf7 0%, #f5f1ea 52%, #efe9e0 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 细腻颗粒质感，避免大面积纯色 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .55;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='150' height='150'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/><feColorMatrix type='saturate' values='0'/></filter><rect width='150' height='150' filter='url(%23n)' opacity='.05'/></svg>");
}

header, .toolbar, main, footer, .modal { position: relative; z-index: 1; }

/* ---------------- 品牌页头 ---------------- */
.brand {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #111111 0%, #1a1a1a 46%, #2b2417 100%);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .8);
}

.brand::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(680px 260px at 84% 8%, rgba(231, 205, 149, .34), transparent 62%),
    radial-gradient(520px 240px at 6% 108%, rgba(197, 160, 89, .20), transparent 62%);
}

.brand-inner {
  position: relative;
  z-index: 2;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 22px;
  display: flex;
  align-items: center;
  gap: 18px 26px;
  flex-wrap: wrap;
}

.brand-id { display: flex; align-items: center; gap: 14px; min-width: 0; }

.logo {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(140deg, rgba(231, 205, 149, .95), rgba(184, 137, 60, .85));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 8px 20px -10px rgba(0, 0, 0, .7);
}

.logo span {
  font-family: var(--font-d);
  font-size: 30px;
  line-height: 1;
  color: #1a1408;
  font-weight: 700;
}

.logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.brand-text { min-width: 0; }

.brand-name {
  margin: 0;
  font-family: var(--font-d);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.25;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 10.5px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: rgba(231, 205, 149, .82);
}

.brand-slogan {
  margin: 0;
  padding-left: 22px;
  border-left: 1px solid rgba(255, 255, 255, .18);
  font-size: 14px;
  letter-spacing: .06em;
  color: rgba(255, 255, 255, .72);
}

.brand-contact {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-item {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13px;
  color: #fff;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(6px);
}

.contact-item i {
  font-style: normal;
  font-size: 11px;
  color: rgba(231, 205, 149, .92);
  letter-spacing: .04em;
}

/* ---------------- 工具条 ---------------- */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 248, 244, .84);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--line);
}

.toolbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* 换行占位：插在「全部」之后，让各产品分支按钮另起一行（不占高度、不可见） */
.chips-break { flex: 0 0 100%; height: 0; }

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .72);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 14.5px;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .22s cubic-bezier(.2, .8, .2, 1);
  white-space: nowrap;
}

.chip:hover { border-color: rgba(184, 137, 60, .55); color: var(--gold); transform: translateY(-1px); }

/* 各产品分支按钮：浅浅的橙色底（选中态仍用深色渐变，不受影响） */
.chip[data-branch]:not([data-branch="all"]):not(.on) {
  background: rgba(237, 155, 65, .13);
  border-color: rgba(237, 155, 65, .36);
}

.chip[data-branch]:not([data-branch="all"]):not(.on):hover {
  background: rgba(237, 155, 65, .22);
  border-color: rgba(237, 155, 65, .55);
}

.chip.on {
  background: linear-gradient(135deg, #16203a, #2a2247);
  border-color: transparent;
  color: var(--gold-lt);
  box-shadow: 0 6px 16px -8px rgba(16, 24, 40, .7);
}

.chip b { font-weight: 600; opacity: .55; margin-left: 6px; font-size: 12.5px; }

.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  min-width: 210px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--line);
  transition: border-color .22s, box-shadow .22s;
}

.search:focus-within { border-color: rgba(184, 137, 60, .65); box-shadow: 0 0 0 4px rgba(184, 137, 60, .12); }
.search svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--ink-soft); }
.search input {
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  width: 100%;
}
.search input::-webkit-search-cancel-button { cursor: pointer; }

/* ---------------- 内容区 ---------------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 26px 22px 60px; }

.stat { font-size: 13px; color: var(--ink-soft); letter-spacing: .04em; margin-bottom: 18px; }
.stat b { color: var(--gold); font-weight: 700; }

.section { margin-bottom: 40px; animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }

.sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.sec-head h2 {
  margin: 0;
  font-family: var(--font-d);
  font-size: 19px;
  letter-spacing: .1em;
  color: var(--ink);
}

.sec-head span {
  font-size: 12px;
  color: var(--ink-soft);
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(184, 137, 60, .12);
  color: var(--gold);
}

.sec-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(276px, 1fr));
  gap: 20px;
}

/* ---------------- 视频卡片 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform .36s cubic-bezier(.2, .8, .2, 1), box-shadow .36s, border-color .36s;
  animation: rise .5s cubic-bezier(.2, .8, .2, 1) both;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(184, 137, 60, .42);
  box-shadow: var(--shadow-md);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #1b2340 0%, #2b2447 55%, #3b2b41 100%);
}

.thumb canvas, .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.thumb .veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 14, 26, 0) 38%, rgba(9, 14, 26, .55) 100%);
}

.thumb .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-d);
  font-size: 40px;
  color: rgba(231, 205, 149, .28);
  letter-spacing: .2em;
}

.play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .45);
  backdrop-filter: blur(3px);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), background .3s;
}

.card:hover .play { transform: scale(1.1); background: rgba(231, 205, 149, .85); border-color: transparent; }
.card:hover .play svg { fill: #1a1408; }
.play svg { width: 17px; height: 17px; fill: #fff; margin-left: 3px; transition: fill .3s; }

.badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(9, 14, 26, .62);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(4px);
}

.card-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }

.card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* 置顶两个视频（软件下载/调试指导视频）的标题：橘黄色圆角方框圈起来，更显眼。
   电脑端与手机端同步生效（不放在任何媒体查询里） */
.toprow .card-title {
  align-self: flex-start;
  padding: 4px 12px;
  border: 2px solid #E8913A;
  border-radius: 12px;
  background: rgba(237, 155, 65, .1);
  color: #A9620F;
  box-shadow: 0 3px 12px -6px rgba(232, 145, 58, .6);
}

.card-meta { margin-top: auto; font-size: 12px; color: var(--ink-soft); display: flex; gap: 10px; align-items: center; }
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }

/* ---------------- 状态提示 ---------------- */
.state { text-align: center; color: var(--ink-soft); font-size: 14px; padding: 40px 0; }
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid rgba(184, 137, 60, .28);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.empty {
  text-align: center;
  padding: 54px 26px;
  border: 1px dashed rgba(184, 137, 60, .42);
  border-radius: 22px;
  background: rgba(255, 255, 255, .55);
}

.empty-icon { width: 48px; height: 48px; color: var(--gold); opacity: .75; }
.empty h2 { font-family: var(--font-d); font-size: 19px; letter-spacing: .1em; margin: 14px 0 10px; }
.empty p { margin: 6px 0; font-size: 14px; color: var(--ink-soft); }
.empty code {
  font-family: Consolas, "Courier New", monospace;
  background: rgba(184, 137, 60, .13);
  color: var(--gold);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
}
.empty-tip { font-size: 12.5px !important; opacity: .8; }

.foot {
  text-align: center;
  font-size: 12.5px;
  letter-spacing: .1em;
  color: var(--ink-soft);
  padding: 26px 20px 34px;
  border-top: 1px solid var(--line);
}

/* ---------------- 页头右侧 APP 下载码二维码 ---------------- */
.brand-qr {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 8px 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(231, 205, 149, .34);
  box-shadow: 0 12px 26px -14px rgba(0, 0, 0, .85);
}

.brand-qr img {
  display: block;
  width: 92px;
  height: 92px;
  border-radius: 8px;
  background: #fff;
}

.brand-qr span {
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .12em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

/* ---------------- 播放弹窗 ---------------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 22px; }

.modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 22, .82);
  backdrop-filter: blur(7px);
  animation: fade .3s ease both;
}

.modal-box {
  position: relative;
  width: min(1080px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: #0e1524;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .9);
  animation: pop .34s cubic-bezier(.2, .9, .25, 1) both;
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0));
}

.modal-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-tools { display: flex; gap: 8px; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-family: inherit;
  font-size: 18px;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  cursor: pointer;
  transition: background .22s, color .22s, transform .22s;
}

.icon-btn:hover { background: var(--gold-lt); color: #1a1408; transform: translateY(-1px); }
.icon-btn:disabled { opacity: .3; cursor: default; transform: none; }

.modal-video { background: #000; line-height: 0; }
.modal-video video { width: 100%; max-height: 72vh; background: #000; display: block; }

.modal-foot {
  padding: 11px 16px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .62);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------------- 动画 ---------------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------- 响应式 ---------------- */

/* 电脑版（>900px）：第一行 品牌 + 标语 + 右上角二维码（92px，贴到页头右上角留白处）；
   电话/地址/官网 三个选项另起一行，左边缘与上方 Logo 左边缘对齐 —— 手机端不受影响 */
@media (min-width: 901px) {
  .brand-id { order: 1; flex: 0 0 auto; }
  /* 介绍文字占满二维码之前剩下的宽度，长度到二维码前自动换行
     注意 basis 必须为 0：用 auto 会以「整段文字的最大宽度」参与排布，导致整段被挤到独立一行 */
  .brand-slogan { order: 2; flex: 1 1 0; min-width: 0; }
  .brand-qr { order: 3; margin-left: auto; }
  /* 屏幕比内容列（1240px）宽时，把二维码再往右上角推，与右边距约 24px；
     屏幕较窄时该值为 0，保持原样（min() 兜底，旧浏览器不支持则退回原位置） */
  .brand-qr { margin-right: min(0px, (100vw - 1240px) / -2 + 24px); }
  .brand-contact { order: 4; margin-left: 0; flex: 1 1 100%; }
  .brand-qr img { width: 92px; height: 92px; }
  .brand-qr span { white-space: nowrap; }
}

/* 手机 / 窄屏（≤900px）：介绍文字显示出来（原来隐藏），
   联系方式三个选项下移到最下面一行、靠左，二维码保持右下角不动 —— 与电脑版互不影响 */
@media (max-width: 900px) {
  .brand-slogan {
    display: block;
    order: 2;
    flex: 1 1 100%;
    padding-left: 0;
    border-left: 0;
    font-size: 12.5px;
    line-height: 1.6;
  }
  /* basis 必须为 0：用 auto（= 整块最大宽度约 533px）参与换行判定时，
     窄屏放不下就会整块另起一行、把二维码挤到下面 */
  .brand-contact { order: 3; margin-left: 0; width: auto; flex: 1 1 0; min-width: 0; }
  .brand-qr { order: 4; padding: 7px 7px 5px; border-radius: 12px; }
  .brand-qr img { width: 78px; height: 78px; border-radius: 6px; }
  .brand-qr span { font-size: 12px; letter-spacing: .1em; }
  /* 二维码占掉一部分宽度，联系方式挤一些：字号与内边距略缩，
     并允许长地址在药丸内换行，保证与二维码并排、不溢出、不换到下一行 */
  .contact-item { font-size: 12px; padding: 5px 11px; gap: 6px; max-width: 100%; min-width: 0; }
  .contact-item i { font-size: 10.5px; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .brand-inner { padding: 18px 16px; gap: 14px; }
  .brand-name { font-size: 21px; letter-spacing: .1em; }
  .logo { width: 48px; height: 48px; flex-basis: 48px; border-radius: 14px; }
  .logo span { font-size: 25px; }
  .brand-qr { gap: 4px; padding: 6px 6px 4px; border-radius: 11px; }
  .brand-qr img { width: 64px; height: 64px; border-radius: 5px; }
  .brand-qr span { font-size: 11px; letter-spacing: .08em; }
  /* 手机更窄：介绍文字与联系方式再缩一点，保证和二维码并排不溢出 */
  .brand-slogan { font-size: 12px; line-height: 1.55; }
  .brand-contact { gap: 6px; }
  .contact-item { font-size: 11.5px; padding: 4px 9px; gap: 5px; }
  .contact-item i { font-size: 10px; }
  .toolbar-inner { padding: 10px 16px; }
  .search { margin-left: 0; width: 100%; }
  .wrap { padding: 20px 16px 48px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .modal { padding: 0; }
  .modal-box { border-radius: 0; max-height: 100%; }
  .modal-video video { max-height: 62vh; }
}

/* ---------------- 二级导航（型号） ---------------- */
.subtabs-bar {
  border-bottom: 1px solid var(--line);
  background: rgba(250, 248, 244, .72);
}

.subtabs-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.subtabs-inner::-webkit-scrollbar { display: none; }

.subtabs { display: flex; gap: 8px; flex-wrap: nowrap; }

.subtab {
  font: inherit;
  font-size: 13.5px;
  border: 1px solid transparent;
  background: rgba(184, 137, 60, .10);
  color: var(--gold);
  padding: 6px 15px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .25s, color .25s, transform .25s, box-shadow .25s;
}

.subtab:hover { background: rgba(184, 137, 60, .22); transform: translateY(-1px); }

.subtab.on {
  background: linear-gradient(135deg, #b8893c, #d8b567);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.subtab b { font-weight: 600; opacity: .6; margin-left: 6px; font-size: 12px; }
.subtab.on b { opacity: .9; }

/* ---------------- 置顶一排：软件下载和调试（单独排在最上面，不混进产品栏目） ---------------- */
.toprow {
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(760px 200px at 8% 0%, rgba(231, 205, 149, .26), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, .74), rgba(250, 248, 244, .34));
}

.toprow-inner { max-width: 1240px; margin: 0 auto; padding: 18px 22px 22px; }

.toprow .sec-head { margin-bottom: 14px; }

/* 这一排只有几个视频，卡片不铺满整行，靠左排列，和下方产品视频区分开 */
.grid-top {
  grid-template-columns: repeat(auto-fill, minmax(240px, 320px));
  gap: 18px;
}

/* 栏目内容待上线 */
.empty.hold { border-style: solid; border-color: var(--line); }

@media (max-width: 640px) {
  .subtabs-inner { padding: 8px 16px; }
  .subtab { font-size: 13px; padding: 5px 12px; }
  .toprow-inner { padding: 14px 16px 18px; }
  .grid-top { grid-template-columns: 1fr; }
}
