/**
 * 自定义样式（Tailwind 之外的少量补充）
 */

/* 自托管字体（SIL OFL 1.1，见 assets/fonts/LICENSE.txt）：仅拉丁字符，中文自动回退系统字体 */
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-semi-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-semi-condensed-700.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/source-sans-3-400.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/source-sans-3-600.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/source-sans-3-700.woff2") format("woff2"); }
/* 阿拉伯文字体：unicode-range 限定阿拉伯字符，其他语言页面不会下载 */
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic-400.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic-600.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic-700.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }

/* 从右往左（阿拉伯语）：字间距会拆断阿拉伯字母连写；标题行高需更宽松 */
[dir="rtl"] body, [dir="rtl"] body * { letter-spacing: 0 !important; }
[dir="rtl"] .text-hero, [dir="rtl"] .text-h1, [dir="rtl"] .text-h2 { line-height: 1.3; }

/* 德语等长复合词在窄卡片里自动断词（依赖 <html lang>） */
h1, h2, h3, dt { overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }

/* 懒加载图片淡入：仅在 JS 可用时生效，禁用 JS 时图片正常显示 */
html.js .lazy-img { opacity: 0; transition: opacity .45s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
html.js .lazy-img.is-loaded { opacity: 1; }

/* 进入视口时的轻微上浮（data-reveal，JS 添加 is-visible） */
html.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
html.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* 产品详情/简介等格式化文本 */
.prose-content p { margin-bottom: 1em; }
.prose-content p + ul { margin-top: -.5em; }
.prose-content p:last-child { margin-bottom: 0; }
.prose-content ul { margin: 0 0 1em; padding-inline-start: 0; list-style: none; }
.prose-content li { position: relative; padding-inline-start: 1.5em; margin-bottom: .45em; }
.prose-content li::before {
  content: ""; position: absolute; inset-inline-start: .2em; top: .6em;
  width: .45em; height: .45em; background: #2f7de1;
}

/* 横向滚动列表（移动端分类栏）：隐藏滚动条 */
.scroll-x { scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.scroll-x::-webkit-scrollbar { display: none; }

/* 内页横幅细网格纹理 */
.bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* 手机底部操作栏占位，避免遮挡页脚内容 */
body.has-bottom-bar { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) { body.has-bottom-bar { padding-bottom: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
  html.js [data-reveal] { opacity: 1; transform: none; }
}
