/*
Theme Name:   XeDown
Theme URI:    https://www.xenice.com/
Description:  虚拟产品付费下载子主题。
Author:       XeDown
Author URI:   https://www.xenice.com/
Template:     xetheme
Version:      1.0.0
Requires PHP: 7.4
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  xedown
Tags:         custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ============================================================
   0. 基础变量
   ============================================================ */
:root {
  --xe-radius: 10px;
  --xe-shadow: 0 0 1.25rem rgba(31, 45, 61, .05);
  --xe-shadow-hover: 0 1rem 3rem rgba(31, 45, 61, .12);
}

.xe-home {
  padding-bottom: 0;
}

/* ============================================================
   1. 首页 —— 搜索 Hero
   ============================================================ */
.xe-hero {
  position: relative;
  padding: 90px 15px 78px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(circle at 18% 20%, rgba(var(--xe-main-rgb, 255, 94, 82), .35), transparent 45%),
    radial-gradient(circle at 82% 82%, rgba(var(--xe-dark-rgb, 241, 60, 47), .28), transparent 45%),
    #1f1f1f;
  overflow: hidden;
}

.xe-hero__inner {
  max-width: 760px;
}

.xe-hero__title {
  margin: 0 0 14px;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .5px;
  color: #fff;
}

.xe-hero__subtitle {
  margin: 0 0 34px;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .82);
}

/* ---------- 搜索框 ---------- */
.xe-search {
  position: relative;
  display: block;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

.xe-search__input {
  width: 100%;
  height: 56px;
  padding: 0 70px 0 24px;
  font-family: inherit;
  font-size: 16px;
  color: #333;
  background: #fff;
  border: 0;
  border-radius: 999px;
  outline: none;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
  -webkit-appearance: none;
  appearance: none;
}

.xe-search__input::placeholder {
  color: #aaa;
}

.xe-search__btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--xe-main-color, #FF5E52), var(--xe-dark-color, #f13c2f));
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(var(--xe-main-rgb, 255, 94, 82), .45);
  transition: transform .2s ease, box-shadow .2s ease;
}

.xe-search__btn:hover,
.xe-search__btn:focus-visible {
  transform: scale(1.06);
  box-shadow: 0 8px 20px rgba(var(--xe-main-rgb, 255, 94, 82), .55);
  outline: none;
}

.xe-search__btn svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
   2. 首页 —— 最新产品
   ============================================================ */
.xe-latest {
  padding: 48px 0 64px;
  background: var(--xe-bg-color, #fafafa);
}

.xe-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.xe-section-head__text h2 {
  position: relative;
  margin: 0;
  padding-left: 14px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--xe-fg-color, #333);
}

.xe-section-head__text h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 20px;
  margin-top: -10px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--xe-main-color, #FF5E52), var(--xe-dark-color, #f13c2f));
}

.xe-section-head__text p {
  margin: 6px 0 0 14px;
  font-size: 13px;
  color: var(--xe-muted, #999);
}

.xe-section-head__more {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--xe-muted, #999);
  background: #fff;
  border: 1px solid var(--xe-border-color, #f0f0f0);
  border-radius: 999px;
  text-decoration: none;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.xe-section-head__more:hover {
  color: #fff;
  background: var(--xe-main-color, #FF5E52);
  border-color: var(--xe-main-color, #FF5E52);
}

.xe-section-head__more svg {
  width: 12px;
  height: 12px;
}

/* WooCommerce 循环微调 */
.xe-products.woocommerce ul.products {
  margin-bottom: 0;
}

.xe-empty {
  padding: 48px 24px;
  text-align: center;
  font-size: 14px;
  color: var(--xe-muted, #999);
  background: #fff;
  border-radius: var(--xe-radius);
  box-shadow: var(--xe-shadow);
}

/* ============================================================
   3. 响应式
   ============================================================ */
@media screen and (max-width: 991px) {
  .xe-hero {
    padding: 70px 15px 62px;
  }
  .xe-hero__title {
    font-size: 30px;
  }
}

@media screen and (max-width: 767px) {
  .xe-hero {
    padding: 56px 15px 48px;
  }
  .xe-hero__title {
    font-size: 24px;
    margin-bottom: 10px;
  }
  .xe-hero__subtitle {
    font-size: 14px;
    margin-bottom: 24px;
  }

  .xe-search__input {
    height: 48px;
    padding: 0 58px 0 20px;
    font-size: 15px;
  }
  .xe-search__btn {
    top: 5px;
    right: 5px;
    width: 38px;
    height: 38px;
  }
  .xe-search__btn svg {
    width: 16px;
    height: 16px;
  }

  .xe-latest {
    padding: 32px 0 44px;
  }
  .xe-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
  }
  .xe-section-head__text h2 {
    font-size: 19px;
    padding-left: 12px;
  }
  .xe-section-head__text h2::before {
    width: 3px;
    height: 17px;
    margin-top: -8px;
  }
  .xe-section-head__text p {
    font-size: 12px;
    padding-left: 12px;
  }
  .xe-section-head__more {
    align-self: flex-end;
    padding: 5px 12px;
    font-size: 12px;
  }
}



/* ============================================================
   首页 —— 产品分页
   ============================================================ */
.xe-products-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 36px 0 0;
  padding: 0;
}

.xe-products-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  color: #666;
  background: #fff;
  border: 1px solid var(--xe-border-color, #f0f0f0);
  border-radius: 8px;
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.xe-products-pagination .page-numbers:hover {
  color: var(--xe-main-color, #FF5E52);
  border-color: var(--xe-light-color, #fc938b);
}

.xe-products-pagination .page-numbers.current {
  color: #fff;
  background: var(--xe-main-color, #FF5E52);
  border-color: var(--xe-main-color, #FF5E52);
  box-shadow: 0 4px 12px rgba(var(--xe-main-rgb, 255, 94, 82), .3);
}

.xe-products-pagination .page-numbers.dots {
  background: transparent;
  border-color: transparent;
}

/* 小屏适配 */
@media screen and (max-width: 767px) {
  .xe-products-pagination {
    margin-top: 28px;
    gap: 5px;
  }
  .xe-products-pagination .page-numbers {
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    font-size: 13px;
    border-radius: 6px;
  }
}


/* ============================================================
   单产品页 —— Free Download / View Demo / Admin Download 独立配色
   覆盖父主题 .woocommerce a.button.alt 的主色渐变
   ============================================================ */

/* ---------- Free Download：绿色（免费感） ---------- */
.woocommerce a.button.alt.xe-free-download-link {
  color: #fff;
  background: linear-gradient(135deg, #33c66c, #22a356);
  box-shadow: 0 6px 16px rgba(51, 198, 108, .35);
}
.woocommerce a.button.alt.xe-free-download-link:hover {
  color: #fff;
  background: linear-gradient(135deg, #22a356, #1c8a47);
  box-shadow: 0 10px 22px rgba(51, 198, 108, .45);
}

/* ---------- View Demo：蓝色（查看/演示） ---------- */
.woocommerce a.button.alt.xe-demo-link,
.woocommerce .product-demo-link a.button.alt {
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  box-shadow: 0 6px 16px rgba(14, 165, 233, .35);
}
.woocommerce a.button.alt.xe-demo-link:hover,
.woocommerce .product-demo-link a.button.alt:hover {
  color: #fff;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  box-shadow: 0 10px 22px rgba(14, 165, 233, .45);
}

/* ---------- Admin Download：深灰（仅管理员，不抢视觉） ---------- */
.woocommerce a.button.alt.xe-admin-download-link {
  color: #fff;
  background: linear-gradient(135deg, #6b7280, #4b5563);
  box-shadow: 0 6px 16px rgba(75, 85, 99, .35);
}
.woocommerce a.button.alt.xe-admin-download-link:hover {
  color: #fff;
  background: linear-gradient(135deg, #4b5563, #374151);
  box-shadow: 0 10px 22px rgba(75, 85, 99, .45);
}

/* ============================================================
   单产品页 —— 标题右侧版本号 Badge
   ============================================================ */
.xe-version-badge {
  display: inline-block;
  margin-left: 3px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .02em;
  color: #fff;
  background: linear-gradient(135deg, var(--xe-main-color, #FF5E52), var(--xe-dark-color, #f13c2f));
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(var(--xe-main-rgb, 255, 94, 82), .3);
  transform: translateY(-1px);
}

@media screen and (max-width: 767px) {
  .xe-version-badge {
    margin-left: 3px;
    padding: 2px 8px;
    font-size: 12px;
  }
}