/* 普瑞荷网站版样式
 * 设计令牌沿用 miniprogram/app.wxss，保证与小程序视觉一致
 * 单位策略：rpx → vw（1rpx = 100vw/750），桌面端 max-width 封顶 750px
 */

:root {
  --g: #4CAF6D;
  --g-d: #2E7D4F;
  --g-l: #EFF5F0;
  --gold: #C9A227;
  --gold-l: #E8C56A;
  --warn: #E8833A;
  --danger: #E05A4E;
  --ink: #2B322C;
  --ink2: #5A645C;
  --ink3: #7A857C;
  --muted: #A6AEA8;
  --line: #C5CCC7;
  --bg: #F5F7F5;
  --card: #fff;
  --r: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
               'Microsoft YaHei', 'Helvetica Neue', Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  max-width: 750px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

/* ===== 顶部导航 ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: rgba(245,247,245,.94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(197,204,199,.5);
}
.nav__back {
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06);
  font-size: 18px; line-height: 1; color: var(--ink2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.nav__title { font-size: 17px; font-weight: 600; letter-spacing: .3px; }
.nav__spacer { flex: 1; }

/* ===== 品牌头图 ===== */
.hero {
  padding: 28px 20px 24px;
  background: linear-gradient(160deg, #4CAF6D 0%, #2E7D4F 100%);
  color: #fff;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.hero h1 { font-size: 23px; font-weight: 600; letter-spacing: 1px; margin-bottom: 6px; }
.hero p { font-size: 14px; opacity: .92; line-height: 1.7; max-width: 90%; }
.hero__tag {
  display: inline-block; margin-top: 12px; padding: 4px 12px;
  border: 1px solid rgba(255,255,255,.5); border-radius: 999px;
  font-size: 12px; letter-spacing: .5px;
}

/* ===== 卡片 ===== */
.wrap { padding: 16px; }
.card {
  background: var(--card); border-radius: var(--r);
  padding: 18px; margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(43,50,44,.05);
}
.card--flat { box-shadow: none; border: 1px solid var(--line); }
.card__hd { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.card__title { font-size: 17px; font-weight: 600; }
.card__sub { font-size: 13px; color: var(--ink3); }
.card__more { margin-left: auto; font-size: 13px; color: var(--g); }

.sect-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: var(--ink);
  margin: 20px 0 10px; padding-left: 10px;
  border-left: 3px solid var(--g);
}
.sect-title:first-child { margin-top: 4px; }

/* ===== 周期切换 ===== */
.periods {
  display: flex; gap: 6px; overflow-x: auto; padding: 3px;
  background: #fff; border-radius: 999px;
  box-shadow: 0 1px 3px rgba(43,50,44,.06);
  margin-bottom: 14px; scrollbar-width: none;
}
.periods::-webkit-scrollbar { display: none; }
.periods__item {
  flex: 1 0 auto; padding: 8px 14px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink2);
  font-size: 14px; font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: all .2s;
}
.periods__item.is-on { background: var(--g); color: #fff; font-weight: 500; }

/* ===== 脏腑环/条 ===== */
.zang-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.zang {
  text-align: center; padding: 12px 4px;
  background: var(--g-l); border-radius: 12px;
}
.zang__name { font-size: 15px; font-weight: 600; color: var(--ink); }
.zang__val { font-size: 19px; font-weight: 700; color: var(--g-d); line-height: 1.3; }
.zang__lv { font-size: 11px; color: var(--ink3); }
.zang--high { background: #FDF3E8; }
.zang--high .zang__val { color: var(--warn); }
.zang--low { background: #EAF2F8; }
.zang--low .zang__val { color: #4A7FA5; }

/* 进度条 */
.bar { height: 6px; border-radius: 3px; background: var(--g-l); overflow: hidden; margin-top: 8px; }
.bar__in { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--g), var(--g-d)); transition: width .6s cubic-bezier(.4,0,.2,1); }
.bar__in--high { background: linear-gradient(90deg, var(--gold-l), var(--gold)); }
.bar__in--low { background: linear-gradient(90deg, #7FB3D5, #4A7FA5); }

/* ===== 状态 / 预防 / 养护 三段 ===== */
.seg { border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.seg--state { background: var(--g-l); }
.seg--avoid { background: #FDF1E7; }
.seg--nourish { background: #EFF6F0; border: 1px solid #DCE9DE; }
.seg__hd {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; margin-bottom: 8px;
}
.seg--state .seg__hd { color: var(--g-d); }
.seg--avoid .seg__hd { color: #B85F1F; }
.seg--nourish .seg__hd { color: var(--g-d); }
.seg__body { font-size: 15px; line-height: 1.75; color: var(--ink); }
.seg ul { list-style: none; }
.seg li {
  position: relative; padding-left: 16px; margin-bottom: 6px;
  font-size: 14.5px; line-height: 1.7; color: var(--ink2);
}
.seg li:last-child { margin-bottom: 0; }
.seg li::before {
  content: ''; position: absolute; left: 4px; top: 11px;
  width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .5;
}

/* ===== 标签 ===== */
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; background: var(--g-l); color: var(--g-d);
  border: 1px solid #DCE9DE; margin: 0 6px 6px 0;
}
.tag--warn { background: #FDF1E7; color: var(--warn); border-color: #F6DCC6; }
.tag--gold { background: #FCF6E3; color: #8A6D14; border-color: #F0E2B8; }

/* ===== 列表项 ===== */
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid rgba(197,204,199,.45);
}
.item:last-child { border-bottom: 0; }
.item__icon {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: var(--g-l); display: flex; align-items: center; justify-content: center;
  font-size: 19px;
}
.item__body { flex: 1; min-width: 0; }
.item__title { font-size: 15.5px; font-weight: 500; }
.item__desc { font-size: 13px; color: var(--ink3); margin-top: 2px; }
.item__arrow { color: var(--muted); font-size: 18px; flex: none; }

/* ===== 表单 ===== */
.field { margin-bottom: 18px; }
.field__label { display: block; font-size: 14px; color: var(--ink2); margin-bottom: 8px; font-weight: 500; }
.field__label .req { color: var(--danger); margin-left: 2px; }
.field input[type=date], .field input[type=time], .field select, .field input[type=text] {
  width: 100%; padding: 12px 14px; font-size: 16px; font-family: inherit;
  color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 12px;
  -webkit-appearance: none; appearance: none;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--g); }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237A857C' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.field__hint { font-size: 12.5px; color: var(--ink3); margin-top: 6px; line-height: 1.6; }

.seg-ctl { display: flex; gap: 8px; }
.seg-ctl button {
  flex: 1; padding: 11px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink2); cursor: pointer; transition: all .2s;
}
.seg-ctl button.is-on { background: var(--g); border-color: var(--g); color: #fff; font-weight: 500; }

.btn {
  display: block; width: 100%; padding: 15px;
  font-size: 16.5px; font-family: inherit; font-weight: 500;
  color: #fff; background: linear-gradient(135deg, var(--g), var(--g-d));
  border: 0; border-radius: 14px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(76,175,109,.3);
}
.btn:active { transform: translateY(1px); }
.btn--ghost { background: #fff; color: var(--g-d); border: 1px solid var(--g); box-shadow: none; }

/* ===== 免责声明 ===== */
.notice {
  font-size: 12.5px; line-height: 1.75; color: var(--ink3);
  background: #EFF1EF; border-radius: 10px; padding: 12px 14px; margin-top: 12px;
}
.notice strong { color: var(--ink2); font-weight: 600; }
.footer { padding: 24px 16px 32px; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.8; }
.footer a { color: var(--ink3); text-decoration: none; }

/* ===== 底部 Tab ===== */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 750px; z-index: 60;
  display: flex; background: #fff;
  border-top: 1px solid rgba(197,204,199,.5);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar__item {
  flex: 1; border: 0; background: none; cursor: pointer;
  padding: 8px 0 9px; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: #9AA39C; font-size: 11px;
}
.tabbar__item.is-on { color: var(--g); }
.tabbar__ico { font-size: 20px; line-height: 1; }

/* ===== Toast ===== */
.__toast {
  position: fixed; left: 50%; top: 46%; transform: translate(-50%,-50%) scale(.94);
  background: rgba(43,50,44,.9); color: #fff;
  padding: 12px 22px; border-radius: 12px; font-size: 14.5px;
  opacity: 0; pointer-events: none; transition: all .22s; z-index: 999;
  max-width: 76%; text-align: center;
}
.__toast.is-on { opacity: 1; transform: translate(-50%,-50%) scale(1); }

/* ===== AI 对话 ===== */
.chat { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
/* AI 页底部有输入框 + 快捷条，内容区留出净空 */
body:has(.composer) #view { padding-bottom: 116px; }
.bubble { max-width: 86%; padding: 13px 15px; border-radius: 14px; font-size: 15px; line-height: 1.75; }
.bubble--me { align-self: flex-end; background: var(--g); color: #fff; border-bottom-right-radius: 4px; }
.bubble--ai { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.bubble h4 { font-size: 14px; color: var(--g-d); margin: 10px 0 6px; }
.bubble h4:first-child { margin-top: 0; }
.bubble p { margin-bottom: 7px; }
.bubble p:last-child, .bubble ul:last-child { margin-bottom: 0; }
.bubble ul { list-style: none; }
.bubble li { position: relative; padding-left: 14px; margin-bottom: 5px; color: var(--ink2); }
.bubble li::before { content: '·'; position: absolute; left: 4px; font-weight: 700; color: var(--g); }
.bubble__hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

/* 快捷提问：横向滚动条，固定单行，禁止被压缩成竖排 */
.quick {
  position: fixed;
  bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 750px;
  z-index: 54;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(197, 204, 199, .5);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.quick::-webkit-scrollbar { display: none; }
.quick button {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 8px 14px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink2);
  cursor: pointer;
}
.quick button:active { border-color: var(--g); color: var(--g-d); }

.composer {
  position: fixed; bottom: calc(56px + env(safe-area-inset-bottom, 0px)); left: 50%;
  transform: translateX(-50%); width: 100%; max-width: 750px; z-index: 55;
  display: flex; gap: 8px; padding: 10px 12px;
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 1px solid rgba(197,204,199,.5);
}
.composer input {
  flex: 1; padding: 10px 14px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 999px; -webkit-appearance: none;
}
.composer input:focus { outline: none; border-color: var(--g); }
.composer button {
  padding: 0 20px; font-size: 15px; font-family: inherit;
  background: var(--g); color: #fff; border: 0; border-radius: 999px; cursor: pointer;
}

/* ===== 平面图（趋势） ===== */
.spark { width: 100%; height: 90px; display: block; }
.empty { text-align: center; padding: 48px 20px; color: var(--ink3); }
.empty__ico { font-size: 40px; margin-bottom: 12px; opacity: .5; }

/* ============================================================
   交互高亮：所有可点元素在触摸 / 悬停时必须有明确反馈
   （需求：按钮类交互都要高亮，不能点了没反应）
   ============================================================ */

/* 通用：任何带 data-* 交互标记的元素，触摸时降低亮度并轻微缩放 */
[data-act]:active,
[data-nav]:active,
[data-tab]:active,
[data-period]:active,
[data-plan]:active,
[data-gender]:active,
[data-organ]:active,
[data-board]:active,
[data-day]:active,
[data-module]:active,
[data-scale-ans]:active,
[data-ask]:active,
.gauge__organ:active,
.gtag:active,
.zbtn:active {
  filter: brightness(.93);
}

/* 桌面端悬停高亮（移动端无 hover，不影响） */
@media (hover: hover) {
  .zbtn:hover,
  .item:hover,
  .tabbar__item:hover,
  .subs__item:hover,
  .periods__item:hover,
  .mods__item:hover,
  .bdopt:hover {
    filter: brightness(.97);
  }
  .zbtn:hover { border-color: var(--g); }
  .item:hover { background: #F7FAF8; }
  .tabbar__item:not(.is-on):hover { color: var(--g-d); }
}

/* 键盘可达性：Tab 聚焦也要有焦点环 */
:focus-visible {
  outline: 2px solid var(--g);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 加载态 */
.loading { text-align: center; padding: 60px 20px; color: var(--ink3); font-size: 14px; }
.loading__spin {
  width: 28px; height: 28px; margin: 0 auto 14px;
  border: 3px solid var(--g-l); border-top-color: var(--g);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
/* ============================================================
   隐私协议勾选
   ============================================================ */
/**
 * 隐私协议勾选区。
 *
 * 之前的问题：勾选框离提交按钮只有 4px，在844px 高的屏上
 * 它正好落在首屏最底部，视觉上被按钮压住、很难被发现。
 * 现在给它独立的上边距 + 分隔线 + 浅底色，使其成为一个视觉区块。
 */
.agree {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 16px 0 14px;
  padding: 11px 12px;
  border-radius: 10px;
  background: #F7FAF8;
  border: 1px solid #E4EDE6;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, border-color .15s;
}
.agree:active { background: var(--g-l); border-color: #C2E3CF; }
/* 勾选后整块变绿，一眼看出「已同意」 */
.agree:has(.agree__box:checked) {
  background: var(--g-l);
  border-color: var(--g);
}
.agree__box {
  flex: none;
  width: 19px; height: 19px;
  margin: 1px 0 0;
  accent-color: var(--g);
  cursor: pointer;
}
.agree__tx {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink3);
}
.agree__link {
  color: var(--g-d);
  text-decoration: underline;
  text-underline-offset: 2px;
}
