@charset "utf-8";

/* ============================================================
   theme.css - 全局设计系统（所有页面统一引入）
   用于 normal 模板下的旧版页面（detail/list/category/cart/member）
   ============================================================ */

/* ---------- CRMEB 图标字体（重命名为 ci 避免与原 iconfont 冲突）---------- */
@import url('iconfont/iconfont.css');

/* ---------- 设计变量 ---------- */
:root {
  /* 主色 */
  --primary-color: #019C50;
  --primary-light: #01B05A;
  --primary-dark: #018A47;
  --primary-gradient: linear-gradient(135deg, #019C50 0%, #01B05A 100%);
  /* 强调色（价格） */
  --accent-color: #FF5556;
  --accent-light: #FF7B7C;
  --accent-gradient: linear-gradient(135deg, #FF5556 0%, #FF7B7C 100%);
  /* 功能色 */
  --success-color: #07C160;
  --warning-color: #FF976A;
  --info-color: #1989FA;
  /* 文字 */
  --text-primary: #323233;
  --text-secondary: #969799;
  --text-placeholder: #C8C9CC;
  --text-white: #FFFFFF;
  /* 背景/卡片/边框 */
  --bg-color: #F7F8FA;
  --bg-gray: #F5F6F8;
  --card-bg: #FFFFFF;
  --border-color: #EBEDF0;
  --border-light: #F5F5F5;
  /* 阴影 */
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-float: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-top: 0 -2px 8px rgba(0, 0, 0, 0.06);
  /* 圆角 */
  --radius-small: 8px;
  --radius-medium: 12px;
  --radius-large: 16px;
  --radius-round: 999px;
  /* 动画 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* ---------- D-DIN PRO 价格数字字体 ---------- */
@font-face {
  font-family: 'DIN-PRO';
  src: url('fonts/D-DIN-PRO-400-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DIN-PRO';
  src: url('fonts/D-DIN-PRO-600-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- 全局基础重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text-primary);
  text-decoration: none;
}

img {
  max-width: 100%;
  vertical-align: middle;
}

/* ---------- 通用价格样式 ---------- */
.price-text,
.price-amount {
  font-family: 'DIN-PRO', -apple-system, sans-serif;
  font-weight: 600;
  color: var(--accent-color);
}

.price-symbol {
  font-size: 0.75em;
  font-weight: 400;
  margin-right: 1px;
}

/* ---------- 通用卡片样式 ---------- */
.theme-card {
  background: var(--card-bg);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* ---------- 通用按钮样式 ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 0.8rem;
  padding: 0 0.4rem;
  background: var(--primary-gradient);
  color: var(--text-white);
  border: none;
  border-radius: var(--radius-round);
  font-size: 0.28rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(1, 156, 80, 0.3);
  transition: var(--transition-fast);
  cursor: pointer;
  outline: none;
}

.btn-primary:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 0.8rem;
  padding: 0 0.4rem;
  background: var(--accent-gradient);
  color: var(--text-white);
  border: none;
  border-radius: var(--radius-round);
  font-size: 0.28rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(255, 85, 86, 0.3);
  transition: var(--transition-fast);
  cursor: pointer;
  outline: none;
}

.btn-accent:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 0.8rem;
  padding: 0 0.4rem;
  background: var(--card-bg);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: var(--radius-round);
  font-size: 0.28rem;
  font-weight: 500;
  transition: var(--transition-fast);
  cursor: pointer;
  outline: none;
}

.btn-outline:active {
  background: rgba(1, 156, 80, 0.05);
  transform: scale(0.96);
}

/* ---------- 通用标签/胶囊样式 ---------- */
.tag-primary {
  display: inline-block;
  padding: 0.04rem 0.16rem;
  background: rgba(1, 156, 80, 0.1);
  color: var(--primary-color);
  font-size: 0.2rem;
  border-radius: var(--radius-round);
  line-height: 1.5;
}

.tag-accent {
  display: inline-block;
  padding: 0.04rem 0.16rem;
  background: var(--accent-gradient);
  color: var(--text-white);
  font-size: 0.2rem;
  border-radius: var(--radius-round);
  line-height: 1.5;
}

.tag-outline {
  display: inline-block;
  padding: 0.04rem 0.16rem;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  font-size: 0.2rem;
  border-radius: var(--radius-round);
  line-height: 1.5;
}

/* ---------- 通用过渡动画 ---------- */
a,
button,
input,
[class*="card"],
[class*="item"] {
  transition: var(--transition-fast);
}

/* 卡片/按钮点击反馈 */
.click-feedback:active {
  transform: scale(0.96);
}

/* 页面内容淡入 */
.page-wrap,
.ui-wrap {
  animation: pageFadeIn 0.3s ease;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- 图片加载优化 ---------- */
img[data-original],
img.lazy {
  background-color: var(--bg-gray);
  transition: opacity 0.3s ease;
}

/* ---------- 顶部导航栏统一样式（覆盖旧版 common.css） ---------- */
.sys-head {
  box-shadow: none !important;
}

.sys-head > .sys-top-bar {
  background: var(--primary-gradient) !important;
  box-shadow: 0 2px 8px rgba(1, 156, 80, 0.25);
}

.sys-head > .sys-top-bar .go-back {
  filter: brightness(0) invert(1);
}

.sys-head > .sys-top-bar .search-btn,
.sys-head > .sys-top-bar .hd-link {
  color: var(--text-white) !important;
}

.sys-head > .sys-top-bar .top-search .search-ipt {
  background-color: rgba(255, 255, 255, 0.25) !important;
  border-radius: var(--radius-round) !important;
  color: var(--text-white);
}

.sys-head > .sys-top-bar .top-search .search-ipt::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.sys-head > .sys-top-bar .top-search .search-ico {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

/* 搜索弹层 - 恢复白色背景+深色元素（不受绿色顶栏影响） */
.sys-search-wrap .sys-top-bar,
.index-search-wrap .sys-top-bar {
  background: var(--card-bg, #fff) !important;
  box-shadow: 0 1px 0 var(--border-color, #EBEDF0);
}
.sys-search-wrap .sys-top-bar .btn-hide-search {
  filter: none;
}
.sys-search-wrap .sys-top-bar .search-btn {
  color: var(--primary-color, #019C50) !important;
}
.sys-search-wrap .sys-top-bar .top-search .search-ipt {
  background-color: var(--bg-gray, #F5F6F8) !important;
  color: var(--text-primary, #323233) !important;
}
.sys-search-wrap .sys-top-bar .top-search .search-ipt::placeholder {
  color: var(--text-placeholder, #C8C9CC);
}
.sys-search-wrap .sys-top-bar .top-search .search-ico {
  filter: none;
  opacity: 0.6;
}

/* ---------- 底部导航栏统一样式 ---------- */
.foot-nav {
  background-color: var(--card-bg) !important;
  box-shadow: var(--shadow-top) !important;
  border-top: none !important;
}

.foot-nav .nav-item.active .item-name,
.foot-nav .nav-item.active {
  color: var(--primary-color) !important;
}

/* ---------- 搜索弹出层样式优化 ---------- */
/* 只覆盖颜色和圆角，不覆盖尺寸（尺寸由各页面原有 CSS 的 rem 基准控制） */
.search-pop .word-tag {
  background-color: var(--bg-gray, #F5F6F8) !important;
  border-radius: 999px !important;
  color: var(--text-secondary, #969799) !important;
  transition: all 0.2s ease;
}

.search-pop .word-tag:active {
  background-color: rgba(1, 156, 80, 0.1) !important;
  color: var(--primary-color, #019C50) !important;
}

.search-pop .words-hd {
  font-weight: 600 !important;
  color: var(--text-primary, #323233) !important;
}

/* ---------- 空状态样式 ---------- */
.empty-state {
  text-align: center;
  padding: 2rem 0.5rem;
}

.empty-state img {
  width: 3rem;
  height: auto;
  margin-bottom: 0.3rem;
  opacity: 0.6;
}

.empty-state p {
  font-size: 0.28rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

/* ---------- 分割线 ---------- */
.divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.3rem 0;
}

.divider-thick {
  height: 0.16rem;
  background: var(--bg-color);
}

/* ---------- 统一底部导航栏（.pui-tabbar）---------- */
/* 使用 vw 单位，基于 375px 设计稿：1px ≈ 0.267vw，跨页面自适应 */
.pui-tabbar {
  max-width: 750px;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  background: var(--card-bg, #fff);
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 1.6vw 0 2.13vw;      /* 6/375, 8/375 */
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  z-index: 999;
  border-radius: 3.2vw 3.2vw 0 0; /* 12/375 */
}
.pui-tabbar__item {
  line-height: 1;
  padding: 1.07vw 0;             /* 4/375 */
  flex: 1;
  text-align: center;
  position: relative;
  color: var(--text-secondary, #969799);
}
.pui-tabbar__item p,
.pui-tabbar__label {
  line-height: 1;
  padding-top: 1.07vw;           /* 4/375 */
  font-size: 2.67vw;             /* 10/375 */
  color: var(--text-secondary, #969799);
  margin: 0;
}
.pui-tabbar__item.active p,
.pui-tabbar__item.active .pui-tabbar__label {
  color: var(--primary-color, #019C50);
  font-weight: 500;
}
.pui-tabbar__item .y-icon {
  display: inline-block;
  width: 5.87vw;                 /* 22/375 */
  height: 5.87vw;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  margin: 0 auto;
  filter: brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(0%) brightness(90%);
  transition: all 0.2s ease;
}
.pui-tabbar__item.active .y-icon {
  transform: scale(1.1);
  filter: brightness(0) saturate(100%) invert(60%) sepia(80%) saturate(500%) hue-rotate(120deg) brightness(95%) contrast(90%);
}
/* 图标图片 - 路径相对于 styles/ 目录 */
.y-icon.icon-home   { background-image: url(../images/home.png); }
.y-icon.icon-cate   { background-image: url(../images/cate.png); }
.y-icon.icon-cart   { background-image: url(../images/cart.png); position: relative; }
.y-icon.icon-ucenter{ background-image: url(../images/user.png); }
.y-icon.icon-service{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z'/%3E%3Cpath d='M7 9h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2z'/%3E%3C/svg%3E");
}
.pui-tabbar__item.active .icon-service {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23019C50'%3E%3Cpath d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z'/%3E%3Cpath d='M7 9h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2z'/%3E%3C/svg%3E");
}
.pui-tabbar__item .cart-badge {
  position: absolute;
  top: -1.07vw;                  /* -4/375 */
  right: 50%;
  margin-right: -5.33vw;         /* -20/375 */
  min-width: 3.73vw;             /* 14/375 */
  height: 3.73vw;
  line-height: 3.73vw;
  padding: 0 0.8vw;              /* 3/375 */
  background: var(--accent-color, #FF5556);
  color: #fff;
  font-size: 2.4vw;              /* 9/375 */
  font-family: 'DIN-PRO', sans-serif;
  border-radius: 999px;
  text-align: center;
}
.foot-space {
  padding-top: 13.33vw;          /* 50/375 */
}

/* ---------- 徽章 ---------- */
.badge-count {
  position: absolute;
  top: -0.1rem;
  right: -0.1rem;
  min-width: 0.32rem;
  height: 0.32rem;
  line-height: 0.32rem;
  padding: 0 0.08rem;
  background: var(--accent-color);
  color: var(--text-white);
  font-size: 0.18rem;
  font-family: 'DIN-PRO', sans-serif;
  font-weight: 600;
  border-radius: var(--radius-round);
  text-align: center;
}
