/* =====================================================================
   ustar 主题自定义样式
   由静态 HTML 模板（theme/html/*）的 <style> 块汇总，原样保留，不重写。
   仅放置普通 CSS；依赖 Tailwind 处理的工具类见 inc/ustar_head.tpl 内
   <style type="text/tailwindcss">@layer utilities {...}</style>。
   ===================================================================== */

/* Custom styles */
html {
    scroll-behavior: smooth;
    /* AOS fade-left/fade-right 用 translateX 把元素推出视口；
       Blink/WebKit 会把这段视觉溢出算进横向可滚区域，出现横向滚动条。 */
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

/* Article card (文章列表/相关文章) */
.article-card {
    transition: all 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
}

/* Search result keyword highlight (SearchService 输出 <b>包裹关键字) */
.search-title b {
    color: #4A90E2;
    background-color: rgba(74, 144, 226, 0.12);
    border-radius: 2px;
    padding: 0 2px;
}

.room-card {
    transition: all 0.4s ease;
    overflow: hidden;
}

.room-card:hover img {
    transform: scale(1.05);
}

.room-card img {
    transition: transform 0.5s ease;
}

.navbar {
    transition: background-color 0.3s ease;
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Color variant selector */
.color-variant {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-variant:hover {
    transform: scale(1.1);
}

.color-variant.active {
    border: 2px solid #333;
}

/* 首页幻灯 (Swiper) —— 浅色 hero 背景上保证分页器/导航按钮可见 */
.slide-show .swiper-pagination-bullet-active {
    background: #4A90E2;
}

.slide-show .swiper-button-prev,
.slide-show .swiper-button-next {
    color: #4A90E2;
}

/* Mobile menu */
.mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-menu.open {
    transform: translateX(0);
}

/* Team member cards */
.team-card {
    transition: all 0.3s ease;
}

.team-card:hover {
    transform: translateY(-5px);
}

.team-card img {
    transition: all 0.5s ease;
}

.team-card:hover img {
    transform: scale(1.05);
}

/* Filter sidebar (列表页移动端筛选) */
.filter-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.filter-sidebar.open {
    transform: translateX(0);
}

/* Attribute selector (产品详情款式)：radio 为 sr-only 隐藏，
   选中反馈作用于外层 label 的 active 类（由 product.js 在 change 时同步）。
   不用 :has() 是因为 Chromium 下其对 checked 动态变化的样式失效不可靠 */
.attribute-list label {
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.attribute-list label.active {
    border-color: #4A90E2;
    color: #4A90E2;
    background-color: rgba(74, 144, 226, 0.08);
}

/* 无 JS 兜底：:checked 兄弟选择器在各内核下失效均可靠 */
.attribute-list input[type="radio"]:checked + span {
    color: #4A90E2;
}

/* Quantity selector (产品详情) */
.quantity-btn {
    width: 32px;
    height: 32px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background-color: #f9fafb;
}

.quantity-input {
    width: 48px;
    height: 32px;
    box-sizing: border-box;
    padding: 0;
    text-align: center;
    line-height: 32px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-left: none;
    border-right: none;
}

/* Product image zoom (产品详情) */
.product-image-container {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
}

.product-image {
    transition: transform 0.3s ease;
}

.product-image-container:hover .product-image {
    transform: scale(1.05);
}

/* Tabs (产品详情) */
.tab-button {
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-button.active {
    border-bottom: 2px solid #4A90E2;
    color: #4A90E2;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 收藏按钮（产品详情）：对齐 default 主题 .btn-favorites.ed
   未收藏显示空心心形，收藏后(.ed)切换为实心并变红，覆盖 Tailwind 工具类配色 */
.btn-favorites .heart-active {
    display: none;
}

.btn-favorites .heart-default {
    display: inline-block;
}

.btn-favorites.ed .heart-active {
    display: inline-block;
}

.btn-favorites.ed .heart-default {
    display: none;
}

.btn-favorites.ed,
.btn-favorites.ed:hover {
    color: #da3638;
    border-color: #da3638;
}

/* ---- 与系统 common.css 的少量兼容修正（Tailwind preflight 适配） ---- */
/* 系统分页器/树状菜单等仍用旧标记，避免被 Tailwind 重置破坏 */
.pager ul li,
.tree-box ul li {
    list-style: none;
}

/* ---- 单页内容（page.dwt）基础排版 ---- */
/* 说明：page-content 本身不限制宽度，便于 about 等富内容做全宽分节；
   仅对“直接文本子节点”（纯文本页）居中限宽，保证可读性。
   嵌套在 <section> 内的内容不受影响。 */
.page-content > h1,
.page-content > h2,
.page-content > h3,
.page-content > p,
.page-content > ul,
.page-content > ol,
.page-content > blockquote,
.page-content > table,
.page-content > img {
    max-width: 56rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.page-content > h1 { font-size: 2.25rem; font-weight: 700; margin-top: 2rem; margin-bottom: 1rem; }
.page-content > h2 { font-size: 1.875rem; font-weight: 700; margin-top: 2rem; margin-bottom: 1rem; }
.page-content > h3 { font-size: 1.5rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.75rem; }
.page-content > p { margin-bottom: 1rem; color: #4b5563; line-height: 1.75; }
.page-content > ul,
.page-content > ol { margin-bottom: 1rem; color: #4b5563; line-height: 1.75; }
.page-content > img { margin-top: 1.5rem; margin-bottom: 1.5rem; border-radius: 0.5rem; }

/* ---- 产品详情多图轮播（product.dwt，Swiper gallery） ---- */
/* 定位基准：zoomdiv/jqZoomPup 相对此容器定位 */
.product-gallery {
    position: relative;
    /* 关键：AOS 动画完成后右侧信息列保持 translateZ(0) 创建层叠上下文，
       会遮挡放大浮层（default 无 AOS 无此问题），此处提升画廊列层级压过右侧 */
    z-index: 20;
}
/* 主图：swiper-slide 高度自适应图片原始比例 */
.product-gallery .gallery-top .swiper-slide img {
    display: block;
    width: 100%;
    height: auto;
}

/* 主图前进/后退按钮：白底圆形 + 主题色图标 */
.product-gallery .gallery-top .gallery-nav {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.9);
    color: #4A90E2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.product-gallery .gallery-top .gallery-nav::after {
    font-size: 1rem;
    font-weight: 700;
}
.product-gallery .gallery-top .gallery-nav.swiper-button-disabled {
    opacity: 0.4;
}

/* 缩略图：固定 80px 方块；非激活半透明，激活态主题色描边
   （thumb-active 由 product.js 随主图 slideChange 同步） */
.product-gallery .gallery-thumbs .thumb-item {
    width: 80px;
    height: 80px;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}
.product-gallery .gallery-thumbs .thumb-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-gallery .gallery-thumbs .thumb-item:hover {
    opacity: 1;
}
.product-gallery .gallery-thumbs .thumb-item.thumb-active {
    border-color: #4A90E2;
    opacity: 1;
}

/* ---- 放大镜（照搬 default 模板 jqzoom/zoomdiv/jqZoomPup 样式） ---- */
.product-gallery .jqzoom {
    position: relative;
    cursor: crosshair;
}
.product-gallery .zoomdiv {
    z-index: 100;
    position: absolute;
    top: 0px;
    left: 0px;
    background: #ffffff;
    border: 1px solid #CCCCCC;
    display: none;
    text-align: left;
    overflow: hidden;
}
/* Tailwind preflight 的 img { max-width:100%; height:auto } 会把大图压进
   zoomdiv（498px），比例≈1：取景区铺满主图，右侧只显示缩小的整图。 */
.product-gallery .zoomdiv img {
    display: block;
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
}
.product-gallery .jqZoomPup {
    z-index: 10;
    visibility: hidden;
    position: absolute;
    top: 0px;
    left: 0px;
    width: 50px;
    height: 50px;
    border: 1px solid #aaa;
    background-color: #FFF;
    pointer-events: none;
    opacity: 0.3;
    -moz-opacity: 0.3;
    -khtml-opacity: 0.3;
    filter: alpha(Opacity=30);
}
