@import url('square-corners.css');

/* 常见问题页面 */

.page-title {
  margin: 0 0 28px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  padding-bottom: 14px;
  padding-left: 16px;
  border-bottom: 3px solid var(--primary);
  border-left: 4px solid var(--primary);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.faq-list {
  display: flex;
  flex-direction: column;
  counter-reset: faq-num;
  /* 用 margin 做间距，兼容 Edge 等对 flex gap 支持不完整的浏览器 */
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  margin-bottom: 16px;
  transition: box-shadow 0.2s, border-color 0.2s;
  --faq-accent: var(--primary);
  --faq-accent-dark: #0958d9;
  --faq-soft: rgba(24, 144, 255, 0.06);
  border-left: 4px solid var(--faq-accent);
}

.faq-item:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
}

.faq-item:last-child {
  margin-bottom: 0;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.faq-question > span:first-child {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.faq-question > span:first-child::before {
  counter-increment: faq-num;
  content: counter(faq-num);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  min-width: 28px;
  margin-right: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--faq-accent) 0%, var(--faq-accent-dark) 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.faq-question:hover {
  background: var(--faq-soft);
  color: var(--faq-accent);
}

.faq-item.open {
  border-color: var(--faq-accent);
  background: linear-gradient(180deg, var(--faq-soft) 0%, var(--bg-card) 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--faq-soft);
}

.faq-item.open .faq-question {
  color: var(--faq-accent);
}

.faq-question .faq-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-left: 12px;
  position: relative;
}

.faq-question .faq-icon::before,
.faq-question .faq-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: currentColor;
  transition: transform 0.2s;
}

.faq-question .faq-icon::before {
  width: 10px;
  height: 2px;
  margin-left: -5px;
  margin-top: -1px;
}

.faq-question .faq-icon::after {
  width: 2px;
  height: 10px;
  margin-left: -1px;
  margin-top: -5px;
}

.faq-item.open .faq-question .faq-icon::after {
  transform: rotate(90deg);
  opacity: 0;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out;
}

.faq-answer p {
  margin: 0;
  padding: 0 24px 20px 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.faq-item.open .faq-answer {
  max-height: 300px;
  transition: max-height 0.35s ease-in;
}

@media (max-width: 768px) {
  .faq-question {
    padding: 16px 18px;
    font-size: 15px;
  }

  .faq-answer p {
    padding: 0 18px 16px 18px;
    font-size: 13px;
  }
}

/* 常见问题随机主题色 */
.faq-theme-blue { --faq-accent: #1677ff; --faq-accent-dark: #0958d9; --faq-soft: rgba(22, 119, 255, 0.08); }
.faq-theme-green { --faq-accent: #52c41a; --faq-accent-dark: #389e0d; --faq-soft: rgba(82, 196, 26, 0.08); }
.faq-theme-purple { --faq-accent: #722ed1; --faq-accent-dark: #531dab; --faq-soft: rgba(114, 46, 209, 0.08); }
.faq-theme-cyan { --faq-accent: #13c2c2; --faq-accent-dark: #08979c; --faq-soft: rgba(19, 194, 194, 0.08); }
.faq-theme-orange { --faq-accent: #fa8c16; --faq-accent-dark: #d46b08; --faq-soft: rgba(250, 140, 22, 0.1); }
.faq-theme-pink { --faq-accent: #eb2f96; --faq-accent-dark: #c41d7f; --faq-soft: rgba(235, 47, 150, 0.08); }
.faq-theme-gold { --faq-accent: #d4a72c; --faq-accent-dark: #9a7209; --faq-soft: rgba(212, 167, 44, 0.1); }
.faq-theme-indigo { --faq-accent: #597ef7; --faq-accent-dark: #2f54eb; --faq-soft: rgba(89, 126, 247, 0.08); }
