﻿/* ==========================================================
   别慌!糖尿病并没有那么难治
   样式来源：原站 dhyeys.css（对话/交互核心）+ 原页 head 内联样式
   已剔除：jichu.css（24KB 框架样式，本页几乎未使用且含外链图片）
            page 层无用的 .tabu / ._nav / #web 等选择器
   ========================================================== */

/* ---------- 基础重置 ---------- */
body,
p {
  margin: 0;
}

* {
  box-sizing: border-box;
}

img,
a {
  display: block;
}

a,
a:hover,
a:link {
  text-decoration: none;
}

/* ---------- 页面骨架 ---------- */
body {
  max-width: 640px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  background: #fff;
}

#main-content {
  padding: 10px 5px 30px;
}

/* #main-content 闭合后的正文是 #js_article 的直接子元素，
   自身没有左右留白，统一补上，避免文字贴屏幕边缘 */
.text-block {
  padding: 0 15px;
  line-height: 1.8;
  text-align: justify;
}

/* ---------- 底部悬浮栏（60 秒后出现） ---------- */
#xidi {
  width: 100%;
  max-width: 640px;
  height: auto;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999998;
  padding: 15px 0;
  text-align: center;
  overflow: hidden;
  display: none;
  background-color: #ffa800;
  background-image: -webkit-linear-gradient(135deg, orange, #fc1);
  background-image: linear-gradient(135deg, orange, #fc1);
}

#xidi a {
  width: 100%;
  height: 100%;
  margin: 0 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  color: red;
  cursor: pointer;
  animation: btnChange2 1.5s ease-in-out infinite;
}

/* ---------- 对话容器 ---------- */
.chatContainer {
  width: 100%;
  max-width: 640px;
  height: 100vh;
  overflow: hidden;
  margin: auto;
  background-color: rgb(238, 238, 238);
  display: none;
  position: relative;
  z-index: 9999;
}

.chat {
  width: 100%;
  height: calc(100% - 100px);
  overflow-y: auto;
  padding: 10px 10px 100px;
}

/* ---------- 气泡 ---------- */
.chatItem {
  display: flex;
  align-items: flex-start;
  margin-top: 20px;
}

.leftItem {
  justify-content: flex-start;
}

.rightItem {
  justify-content: flex-end;
}

.headImg {
  width: 40px;
  height: 40px;
}

.leftItem .headImg {
  margin-right: 15px;
}

.rightItem .headImg {
  margin-left: 15px;
}

.chatDiv {
  max-width: calc(80% - 55px);
  background-color: #fff;
  color: #000;
  padding: 10px;
  border-radius: 6px;
  position: relative;
  font-size: 16px;
  line-height: 1.3;
}

.chatDiv::before {
  content: '';
  position: absolute;
  top: 18px;
  border-top: 6px solid transparent;
  border-right: 8px solid #fff;
  border-bottom: 6px solid transparent;
}

.leftItem .chatDiv::before {
  left: -8px;
}

.rightItem .chatDiv {
  background-color: #a0e75a;
}

.rightItem .chatDiv::before {
  right: -8px;
  border-left: 8px solid #a0e75a;
  border-right: none;
}

/* ---------- 连线中动画 ---------- */
.animated {
  height: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.loader {
  width: fit-content;
  font-weight: bold;
  font-family: monospace;
  font-size: 24px;
  clip-path: inset(0 3ch 0 0);
  animation: l4 1s steps(4) infinite;
}

.loader::before {
  content: "连线中...";
}

@keyframes l4 {
  to {
    clip-path: inset(0 -1ch 0 0);
  }
}

/* ---------- 问答流程显隐 ---------- */
/* .faq = 未到该步骤，隐藏；JS 只负责移除这个 class */
.faq {
  display: none;
}

.choise {
  width: 100%;
  max-width: 640px;
  position: fixed;
  z-index: 999;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  transition: opacity .2s linear, visibility .2s linear;
}

.choiseItem {
  width: 45%;
  margin: 1% 1% 6px;
  padding: 5px 0;
  background-color: #e6322e;
  color: #fff;
  font-size: 18px;
  text-align: center;
  border-radius: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.choiseItem:active {
  transform: scale(.97);
}

/* 三组选项默认隐藏，JS 按流程显示 */
#choise1,
#choise2,
#choise3 {
  visibility: hidden;
  opacity: 0;
}

/* ---------- 添加微信按钮 ---------- */
.getBtn {
  width: 100%;
  max-width: 640px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  visibility: hidden;
}

.getBtn a {
  width: 88%;
  text-align: center;
  padding: 10px 0;
  border-radius: 50px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  background-image: linear-gradient(45deg, #2b61ce, #2bd315);
  animation: btnChange 3s infinite;
}

@keyframes btnChange {
  0% { transform: scale(1); }
  33% { transform: scale(.95); }
  66% { transform: scale(1); }
  100% { transform: scale(1); }
}

@keyframes btnChange2 {
  25% { transform: scale(1.2); }
  50% { transform: scale(1); }
  75% { transform: scale(1.2); }
}

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30%;
  transform: translateX(-50%);
  max-width: 80%;
  padding: 10px 16px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .8);
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  text-align: center;
  z-index: 1000000;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

.toast.is-show {
  opacity: 1;
  visibility: visible;
}
