/*
Theme Name: Astra Child
Template: astra
Description: 益肤官网子主题 - 左侧导航架构
Author: Tzone
Version: 2.0.0
*/

/* ===== 品牌变量 ===== */
:root {
  --brand: #0E7C7B;
  --brand-dark: #0A5555;
  --brand-darker: #073D3D;
  --brand-light: #E8F6F5;
  --brand-blue: #2D6CDF;
  --brand-purple: #7B5CE0;
  --text-main: #223333;
  --text-sub: #5A6B6B;
  --nav-width: 209px;
}

/* ===== 全局 ===== */
body {
  color: var(--text-main);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  box-sizing: border-box;
}
html { overflow-x: hidden; }

/* ===== 左侧固定导航（桌面端） ===== */
@media (min-width: 922px) {
  body {
    padding-left: var(--nav-width);
  }

  .ast-primary-header-bar {
    position: fixed !important;
    left: 0;
    top: 0;
    width: var(--nav-width);
    height: 100vh;
    background: #fff;
    border-right: 1px solid #e8e8e8;
    z-index: 999;
    display: flex !important;
    flex-direction: column;
    padding: 40px 0;
    overflow-y: visible;
    box-shadow: 1px 0 8px rgba(0,0,0,0.04);
    justify-content: flex-start;
    overflow-x: visible;
  }

  .ast-primary-header-bar .site-primary-header-wrap {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    flex: 0 0 100% !important;
    height: auto;
    padding-left: 0 !important;
  }
  .ast-primary-header-bar .site-primary-header-wrap > * {
    width: 100% !important;
    justify-content: flex-start !important;
  }
  .ast-primary-header-bar .ast-builder-grid-row {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    row-gap: 0 !important;
    width: 100% !important;
  }
  .ast-primary-header-bar .site-header-primary-section-left,
  .ast-primary-header-bar .site-header-primary-section-right {
    height: auto !important;
    min-height: auto !important;
    width: 100% !important;
    justify-content: flex-start !important;
    text-align: left;
  }

  .ast-main-header-bar-alignment {
    width: 159px !important;
    margin-top: 24px;
  }
  .ast-builder-menu-1,
  .main-header-bar-navigation {
    width: 159px !important;
  }

  .main-header-menu {
    display: block !important;
    width: 100% !important;
  }
  .main-header-menu > li {
    display: block !important;
    width: 209px !important;
    min-width: 209px !important;
    margin: 0;
    height: auto !important;
    min-height: auto !important;
    border-radius: 6px;
    transition: background 0.15s ease;
    padding: 0;
    box-sizing: border-box;
    clear: both;
  }
  .main-header-menu > li:hover,
  .main-header-menu > li.menu-item-has-children:hover {
    background: #f5f7fa;
  }
  .main-header-menu > li > a {
    padding: 16px 20px !important;
    display: block !important;
    width: 100% !important;
    font-size: 1.2rem;
    color: #489ad5 !important;
    border-bottom: none;
    line-height: 1.4 !important;
    font-weight: 400 !important;
    white-space: nowrap;
    border-radius: 6px;
    box-sizing: border-box;
    text-align: center;
  }
  .site-header-primary-section-left {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }
  .ast-builder-menu-1 {
    height: auto !important;
    margin-top: 12px !important;
  }
  .main-header-menu > li > a:hover {
    color: #489ad5 !important;
  }
  .main-header-menu > li.current-menu-item > a,
  .main-header-menu > li.current_page_item > a {
    color: #489ad5 !important;
    font-weight: 700;
  }

  /* 子菜单样式 - 导航栏向右扩展，像溪木源 */
  .main-header-menu > li.menu-item-has-children {
    position: static;
    width: 100%;
  }
  .main-header-menu .sub-menu {
    display: none;
    position: fixed !important;
    left: 209px !important;
    top: 0 !important;
    width: 196px !important;
    height: 100vh;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 40px 20px 20px 20px !important;
    margin: 0 !important;
    margin-left: -1px !important;
    box-shadow: 2px 0 12px rgba(0,0,0,0.08);
    border: none;
    border-left: 1px solid #eee;
    z-index: 998;
    overflow-y: auto;
  }
  /* 隐藏父菜单箭头 */
  .main-header-menu .menu-item-has-children > a .ast-icon.icon-arrow,
  .main-header-menu .menu-item-has-children > a::after,
  .main-header-menu .dropdown-menu-toggle,
  .ast-header-break-point .main-header-menu .sub-menu { display: none !important; }
  /* 显示由JS控制 */
  @keyframes slideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
  }
  .main-header-menu .sub-menu li {
    width: 100% !important;
    margin: 0 !important;
    display: block !important;
    float: none !important;
    border-bottom: 1px solid #f0f0f0;
  }
  .main-header-menu .sub-menu li:last-child {
    border-bottom: none;
  }
  .main-header-menu .sub-menu li a {
      padding: 12px 20px !important;
      font-size: 1.0rem;
      color: #489ad5 !important;
      display: block !important;
      width: 100% !important;
      border: none !important;
      border-radius: 0;
      margin: 0 !important;
      font-weight: 400 !important;
      line-height: 1.4 !important;
      box-sizing: border-box;
    }
    .main-header-menu .sub-menu li a:visited {
      color: #555 !important;
    }
  .main-header-menu .sub-menu li a:hover {
    color: #489ad5 !important;
    background: #f5f8fa;
  }
  .main-header-menu > li.menu-item-has-children {
    width: 100%;
  }
  .main-header-menu > li.menu-item-has-children > a {
    width: 100%;
  }
  .site-title {
    width: 100%;
    line-height: 1.2;
    white-space: nowrap;
    text-align: left;
    margin: 0 !important;
    padding: 0 !important;
  }
  .site-title a {
    display: none;
  }
  .site-logo-img .custom-logo-link {
    display: block;
    text-align: center;
    margin-bottom: 24px;
    width: 188px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .custom-logo-link img {
    width: 90%;
    height: auto;
    max-width: 188px;
  }
  .site-branding,
  .ast-site-identity-wrap {
    width: 209px !important;
  }
  .site-header-primary-section-left {
    padding-left: 0 !important;
    margin-left: 0 !important;
  }

  .ast-mobile-header-wrap,
  .ast-below-header-bar,
  .ast-above-header-bar {
    display: none !important;
  }

  .ast-header-break-point .ast-primary-header-bar {
    display: flex !important;
  }
}

/* ===== 内容区 ===== */
.site-content { padding-top: 0; }
.ast-container { max-width: 100%; }
.entry-content { padding-top: 0; }
.entry-content > *:first-child { margin-top: 0; }
@media (min-width: 922px) {
  .ast-container { padding: 0 3%; }
  .entry-content { max-width: 100%; }
}
/* 隐藏 Astra 自动页面标题 */
.entry-header { display: none; }
.ast-single-post .entry-title { display: none; }
/* 所有图片默认撑满 */
.entry-content img { width: 100% !important; height: auto; }
/* 首页图片撑满 */
.wp-block-image { width: 100% !important; max-width: none !important; }
.wp-block-image img { width: 100% !important; }
.yf-series-content { max-width: none !important; }
.yf-series-content img { width: 100% !important; }
.yf-tabs { max-width: none !important; }
.wp-block-columns { max-width: none !important; }
.wp-block-separator { max-width: none !important; }

/* ===== Banner 区（模仿珀芙研） ===== */
.yf-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 60px 0 0 0;
  min-height: 200px;
}
.yf-banner-left { flex: 1; }
.yf-banner-left h1 { font-size: 2.4rem; font-weight: 700; color: var(--text-main); margin-bottom: 8px; }
.yf-banner-left .yf-banner-sub { font-size: 1.1rem; color: var(--text-sub); margin-bottom: 20px; }
.yf-banner-right { flex-shrink: 0; margin-left: 40px; }
.yf-banner-rule {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, #d3c5bb 0%, #d3c5bb 100%);
  margin-top: 20px;
  margin-bottom: 0;
}
@media (max-width: 921px) {
  .yf-banner { flex-direction: column; }
  .yf-banner-right { margin-left: 0; margin-top: 20px; }
  .yf-banner-left h1 { font-size: 1.6rem; }
}

/* ===== 横向 Tab 导航 ===== */
.yf-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 48px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.yf-tab {
  padding: 12px 18px;
  font-size: 0.9rem;
  color: #888;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  background: none !important;
  outline: none;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s, border-color 0.2s;
}
.yf-tab:hover { color: var(--brand); }
.yf-tab.active {
  color: #489ad5;
  border-bottom: 3px solid #489ad5;
  border-radius: 2px 2px 0 0;
  font-weight: 600;
  background: none !important;
}
.yf-tab:focus,
.yf-tab:focus-visible,
.yf-tab:active {
  outline: none;
  background: none !important;
  box-shadow: none;
}

/* 小屏 Tab 缩放 */
@media (max-width: 480px) {
  .yf-tab {
    padding: 6px 8px;
    font-size: 0.6rem;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
    word-break: keep-all;
  }
}

/* ===== 占位图 ===== */
.yf-placeholder {
  width: 100%;
  max-width: none !important;
  background: #f0f0f0;
  border: 2px dashed #ccc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.9rem;
  overflow: hidden;
}
.yf-placeholder.sketch { width: 320px; height: 180px; }
.yf-placeholder.license { width: 400px; height: 565px; margin: 0 auto; }
.yf-placeholder.product { width: 100%; height: auto; aspect-ratio: 16/9; }
.yf-placeholder.news { width: 100%; height: auto; aspect-ratio: 1.6/1; max-width: 780px !important; }

/* ===== 产品详情占位图 ===== */
.yf-detail-placeholder {
  width: 100%;
  min-height: 500px;
  background: #f0f4f8;
  border: 2px dashed #c0d0e0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8899aa;
  font-size: 18px;
  cursor: pointer;
}
/* ===== 产品大图区 ===== */
.yf-product-link { display: block; margin-bottom: 15px; }
.yf-product-link img { width: 100%; height: 550px; object-fit: cover; display: block; }
.yf-product-hero { text-align: center; padding: 40px 0; }
.yf-product-hero h1 { font-size: 2.4rem; font-weight: 700; }
.yf-product-hero .yf-product-sub { font-size: 1.1rem; color: var(--text-sub); margin-bottom: 48px; }
.yf-product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 781px) { .yf-product-grid { grid-template-columns: 1fr; } }

/* ===== 新闻区 ===== */
.yf-news-hero { text-align: center; padding: 40px 0; }
.yf-news-hero h1 { font-size: 2.4rem; font-weight: 700; }
.yf-news-hero .yf-news-sub { font-size: 1.1rem; color: var(--text-sub); margin-bottom: 48px; }
.yf-news-item { margin-bottom: 48px; }
.yf-news-item h3 { font-size: 1.2rem; font-weight: 600; margin: 16px 0 8px; }
.yf-news-item p { font-size: 0.95rem; color: var(--text-sub); }
.yf-news-date { font-size: 0.85rem; color: var(--brand); }

/* ===== 底部信息 ===== */
.yf-footer-info { text-align: center; padding: 40px 0; font-size: 0.85rem; color: #999; border-top: 1px solid #eee; margin-top: 80px; }

/* ===== 首页 Hero 图 ===== */
.yf-hero-img { margin-bottom: 60px; }
.yf-hero-img img { width: 100%; height: auto; border-radius: 0; }
/* ===== Banner 配图 ===== */
.yf-sketch-img { max-width: 320px; }
.yf-sketch-img img { width: 100%; height: auto; }
.yf-product-card {
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 24px rgba(14,124,123,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.yf-product-card:hover { transform: translateY(-6px); box-shadow: 0 12px 32px rgba(14,124,123,0.16); }
.yf-product-card img { width: 100%; height: 220px; object-fit: cover; }
.yf-product-card .yf-product-body { padding: 18px 20px 22px; }
.yf-product-card .yf-product-name { font-size: 1.05rem; font-weight: 700; margin: 0 0 6px; }
.yf-product-card .yf-product-desc { font-size: 0.9rem; color: var(--text-sub); margin: 0; }

/* ===== 荣誉/数据带 ===== */
.yf-stats {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
}
.yf-stat-num { font-size: 2.6rem; font-weight: 800; color: #fff; }
.yf-stat-label { color: rgba(255,255,255,0.85); margin-top: 6px; }

/* ===== 新闻卡片 ===== */
.yf-news-card {
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0,0,0,0.06);
}
.yf-news-card img { width: 100%; height: 170px; object-fit: cover; }
.yf-news-card .yf-news-body { padding: 16px 18px 20px; }
.yf-news-date { color: var(--brand); font-size: 0.85rem; }
.yf-news-card h3 { font-size: 1.05rem; font-weight: 700; margin: 8px 0; line-height: 1.5; }
.yf-news-card p { font-size: 0.9rem; color: var(--text-sub); margin: 0; }

/* ===== 按钮 ===== */
.yf-btn {
  display: inline-block;
  background: var(--brand);
  color: #fff !important;
  padding: 12px 32px;
  border-radius: 30px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: background 0.2s ease;
}
.yf-btn:hover { background: var(--brand-dark); }
.yf-btn.outline { background: transparent; border: 1px solid #fff; }

/* ===== 页脚 ===== */
.site-footer { background: var(--brand-darker); color: rgba(255,255,255,0.75); }

/* ===== 响应式 ===== */
@media (max-width: 921px) {
  body { padding-left: 0; padding-top: 52px; }
  .yf-section { padding: 48px 0; }
  .yf-product-card img { height: 160px; }

  /* 隐藏桌面侧栏和Astra移动端header */
  .ast-primary-header-bar,
  .ast-mobile-header-wrap { display: none !important; }

  /* === 移动端顶部导航栏 === */
  #mobile-topbar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 52px;
    background: #fff;
    border-bottom: 1px solid #eee;
    z-index: 10000;
    padding: 0 12px;
    box-sizing: border-box;
  }
  #mobile-logo { height: 36px; }
  #mobile-logo img { height: 100%; width: auto; }

  /* 汉堡按钮 */
  #mobile-toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    font-size: 22px;
    color: #333;
    cursor: pointer;
    flex-shrink: 0;
  }

  /* 菜单面板 */
  #mobile-menu-panel {
    display: none;
    position: fixed;
    top: 52px; left: 0;
    width: 100%;
    max-height: calc(100vh - 52px);
    background: #fff;
    z-index: 9999;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  #mobile-menu-toggle:checked ~ #mobile-menu-panel { display: block; }

  /* 菜单项 */
  #mobile-menu-panel .mobile-nav-menu,
  #mobile-menu-panel .main-header-menu {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #mobile-menu-panel .mobile-nav-menu > li,
  #mobile-menu-panel .main-header-menu > li {
    width: 100% !important;
    border-bottom: 1px solid #f0f0f0 !important;
  }
  #mobile-menu-panel .mobile-nav-menu > li > a,
  #mobile-menu-panel .main-header-menu > li > a {
    display: block !important;
    padding: 15px 20px !important;
    font-size: 1.05rem !important;
    color: #489ad5 !important;
    text-decoration: none !important;
  }
  #mobile-menu-panel .sub-menu {
    display: none;
    background: #f8f9fa;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }
  #mobile-menu-panel .sub-menu li a {
    display: block !important;
    padding: 13px 20px 13px 36px !important;
    font-size: 0.95rem !important;
    color: #489ad5 !important;
    text-decoration: none !important;
    border-bottom: 1px solid #eee;
  }
}
/* ===== 产品详情页 ===== */
.yf-back-link { margin-bottom: 12px; margin-left: 0 !important; max-width: none !important; }
.yf-back-link a { display: inline-flex; align-items: center; gap: 6px; color: #555; font-size: 14px; text-decoration: none; padding: 6px 14px; border: 1px solid #d0d8e0; border-radius: 6px; background: #fff; transition: all 0.15s; }
.yf-back-link a:hover { color: #0E7C7B; border-color: #0E7C7B; background: #f5fafa; }

/* 隐藏 Astra 默认页脚版权 */
.site-below-footer-wrap { display: none !important; }
.ast-small-footer { display: none !important; }
