/* SDS Design tokens & diagnosis UI.
 * Tailwind CDN provides base utilities; tokens unify colors, radius, shadow, motion.
 */

:root {
  /* Brand (blue) */
  --sds-primary: 37 99 235;       /* blue-600 */
  --sds-primary-hover: 29 78 216; /* blue-700 */
  --sds-primary-soft: 219 234 254; /* blue-100 */
  --sds-primary-border: 191 219 254; /* blue-200 */
  /* Neutrals (slate) */
  --sds-text: 15 23 42;   /* slate-900 */
  --sds-text-secondary: 71 85 105; /* slate-600 */
  --sds-text-muted: 100 116 139;  /* slate-500 */
  --sds-border: 226 232 240;       /* slate-200 */
  --sds-bg-subtle: 248 250 252;    /* slate-50 */
  /* Surfaces */
  --sds-radius-card: 1.5rem;      /* 24px, Tailwind rounded-3xl */
  --sds-radius-btn: 0.75rem;    /* 12px, rounded-xl */
  --sds-shadow-card: 0 10px 40px rgba(12, 25, 56, 0.12);
  --sds-duration: 0.3s;
  --sds-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card shell & card base for GSAP animations
 * 仅两个尺寸：默认 SP，768px 以上 PC */
.sds-card-shell {
  width: 100%;
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
}
.sds-service-card,
.sds-choice-btn {
  min-height: 48px;
}

.sds-card {
  width: 100%;
  border-radius: var(--sds-radius-card);
  background-color: #fff;
  box-shadow: var(--sds-shadow-card);
  overflow: hidden;
}

/* 问题卡叠放：背面只显示一张卡，表示后面还有问题 */
.sds-card-stack {
  position: relative;
  width: 100%;
}

.sds-card-back {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2rem;
  height: 100%;
  border-radius: var(--sds-radius-card);
  background-color: #fff;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  transform: scale(0.96) translateY(10px);
  opacity: 0.65;
  pointer-events: none;
  z-index: 0;
}

.sds-card-question {
  position: relative;
  z-index: 1;
}

.sds-card-history {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}

.sds-card-question-active {
  position: relative;
  z-index: 1;
}

.sds-loading-spinner {
  border-radius: 9999px;
  border-width: 3px;
  border-style: solid;
  border-color: rgb(var(--sds-border) / 0.6);
  border-top-color: rgb(var(--sds-text));
  width: 32px;
  height: 32px;
  animation: sds-spin 0.7s linear infinite;
}

@keyframes sds-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Service hero figure in service card */
.sds-card-hero {
  width: 60%;
  pointer-events: none;
  margin-left: 10%;
}
.sds-card-hero img {
  display: block;
  width: 100%;
  height: auto;
}

/* Avatar image inside bubble */
.sds-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Chat-like speech bubble tail for assistant bubble */
.sds-bubble {
  position: relative;
}

.sds-bubble::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 18px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid rgb(var(--sds-primary-soft));
}

.form-group input,
.form-group textarea {
  border: 1px solid rgb(var(--sds-border));
  border-radius: var(--sds-radius-btn);
  padding: 0.75rem .5rem;
  font-size: 1rem;
}
