/* ===== 称骨算命：卷轴卡片 ===== */
.face-widget-wrap .fortune-huangli {
  background: repeating-linear-gradient(135deg, #fdf6e3, #fdf6e3 18px, #f7e7b6 20px, #fdf6e3 22px);
  border: 3px solid #c8a45a;
  border-radius: 1rem;
  padding: 2.5rem 2.5rem 3.5rem 2.5rem;
  margin-top: 1.5rem;
  color: #3d2a06;
  font-family: 'FZKai-Z03', 'Kaiti', 'STKaiti', 'KaiTi', '楷体', serif;
  font-size: 1.6rem;
  line-height: 2.2;
  letter-spacing: 0.08em;
  text-align: center;
  max-width: 680px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 12px 40px rgba(180, 120, 40, 0.18), inset 0 0 50px rgba(247, 231, 182, 0.3);
  position: relative;
  box-sizing: border-box;
}
.face-widget-wrap .fortune-huangli::before {
  content: '';
  position: absolute;
  top: 10px; left: 10px; right: 10px; bottom: 10px;
  border: 1px solid #d4a853;
  border-radius: 0.6rem;
  pointer-events: none;
}
.face-widget-wrap .fortune-huangli::after {
  content: '命';
  position: absolute;
  bottom: 22px;
  right: 28px;
  width: 54px;
  height: 54px;
  border: 2.5px solid #c0321a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c0321a;
  font-size: 1.6rem;
  font-weight: bold;
  opacity: 0.65;
  line-height: 54px;
  font-family: 'STKaiti', 'KaiTi', '楷体', serif;
}
.face-widget-wrap .fortune-huangli .weight {
  color: #c0321a;
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 1.2rem;
  border-bottom: 2px dashed #d4a853;
  padding-bottom: 1rem;
  letter-spacing: 0.2em;
  text-shadow: 0 1px 2px rgba(192,50,26,0.15);
}
.face-widget-wrap .fortune-huangli .fortune {
  font-size: 1.6rem;
  line-height: 2.4;
  letter-spacing: 0.12em;
  color: #3d2a06;
}

/* ===== 外层容器 ===== */
.face-widget-wrap {
  background: #f5f6fa;
  font-family: 'Segoe UI', 'PingFang SC', 'Hiragino Sans', Arial, sans-serif;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.face-widget-wrap .container {
  padding: 1.5rem 1rem 2rem 1rem;
  border-radius: 1rem;
  max-width: 1200px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
}
.face-widget-wrap h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #222;
  text-align: center;
}
.face-widget-wrap .desc {
  color: #666;
  font-size: 1rem;
  margin-bottom: 1rem;
  text-align: left;
  line-height: 1.5;
  max-width: 900px;
  width: 100%;
  background: #f9f9f9;
  padding: 10px;
  border-radius: 5px;
  box-sizing: border-box;
}

/* ===== 称骨算命表单 ===== */
.face-widget-wrap #fortune-form {
  width: 100%;
  max-width: 800px;
  margin-bottom: 0.5rem;
}
.face-widget-wrap .form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  width: 100%;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.face-widget-wrap label {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-right: 0.5rem;
  align-self: center;
}
.face-widget-wrap .unit-label {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-right: 0.5rem;
  align-self: center;
}
.face-widget-wrap select,
.face-widget-wrap button {
  font-size: 1rem;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #ccc;
  outline: none;
  background: #fff;
  transition: all 0.2s;
}
.face-widget-wrap select:focus,
.face-widget-wrap button:focus {
  border-color: #4f8cff;
  box-shadow: 0 0 5px rgba(79, 140, 255, 0.2);
}
.face-widget-wrap button {
  background: #4f8cff;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  margin-top: 1rem;
  width: 100%;
  padding: 1rem 0;
  font-size: 1.2rem;
  letter-spacing: 0.2em;
  transition: background 0.2s, transform 0.15s;
}
.face-widget-wrap button:hover:not(:disabled) {
  background: #357ae8;
  transform: translateY(-2px);
}
.face-widget-wrap button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.face-widget-wrap .result {
  margin-top: 1rem;
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* ===== AI 相面：分隔线 ===== */
.face-widget-wrap .ai-divider {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 800px;
  margin: 2rem 0 1.5rem;
  gap: 1rem;
}
.face-widget-wrap .ai-divider::before,
.face-widget-wrap .ai-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, #c8a45a, transparent);
}
.face-widget-wrap .ai-divider span {
  color: #8b6914;
  font-size: 1.6rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.15em;
}

/* ===== AI 相面：输入区 ===== */
.face-widget-wrap #ai-face-section {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px;
}
.face-widget-wrap .ai-face-upload-box {
  width: 100%;
  border: 2px dashed #c8a45a;
  border-radius: 0.8rem;
  background: #fffdf5;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.face-widget-wrap .ai-face-upload-box:hover,
.face-widget-wrap .ai-face-upload-box.drag-over {
  border-color: #8b6914;
  background: #fef9ec;
}
/* 标准 file 铺满上传区；勿加 capture，以便移动端一次弹出系统「图库/拍照/文件」 */
.face-widget-wrap .ai-face-upload-box input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
  z-index: 2;
}
.face-widget-wrap .upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 2rem 1.5rem;
  pointer-events: none;
  position: relative;
  z-index: 1;
}
.face-widget-wrap .upload-icon {
  font-size: 2.8rem;
  opacity: 0.5;
}
.face-widget-wrap .upload-placeholder p {
  margin: 0;
  color: #8b6914;
  font-size: 1rem;
  text-align: center;
}
.face-widget-wrap .upload-placeholder small {
  color: #aaa;
  font-size: 0.875rem;
}
.face-widget-wrap #ai-face-preview {
  display: none;
  max-height: 280px;
  max-width: 100%;
  border-radius: 0.5rem;
  object-fit: contain;
  padding: 0.5rem;
  position: relative;
  z-index: 1;
}
.face-widget-wrap #ai-face-filename {
  display: none;
  font-size: 0.875rem;
  color: #888;
  margin-top: 0.3rem;
  text-align: center;
}
.face-widget-wrap #ai-error-msg {
  display: none;
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  background: #fff2f0;
  border: 1px solid #ffccc7;
  color: #c0321a;
  font-size: 0.95rem;
  margin-top: 0.6rem;
  box-sizing: border-box;
}
.face-widget-wrap #ai-face-btn {
  background: linear-gradient(135deg, #8b6914, #c8a45a);
  margin-top: 1rem;
}
.face-widget-wrap #ai-face-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #6d5110, #a8843a);
}

/* ===== AI 相面：加载动画（旋转铜钱） ===== */
.face-widget-wrap .ai-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  width: 100%;
}
.face-widget-wrap .coin-spinner {
  width: 56px;
  height: 56px;
  border: 3px solid #f7e7b6;
  border-top: 3px solid #c8a45a;
  border-radius: 50%;
  animation: coin-spin 0.9s linear infinite;
  position: relative;
}
.face-widget-wrap .coin-spinner::after {
  content: '命';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c8a45a;
  font-size: 1.2rem;
  font-family: 'STKaiti', '楷体', serif;
  animation: coin-spin-reverse 0.9s linear infinite;
}
@keyframes coin-spin {
  to { transform: rotate(360deg); }
}
@keyframes coin-spin-reverse {
  to { transform: rotate(-360deg); }
}
.face-widget-wrap .ai-loading p {
  color: #8b6914;
  font-size: 1rem;
  letter-spacing: 0.1em;
}

/* ===== AI 相面：结果卡片 ===== */
.face-widget-wrap #ai-face-result {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 1.2rem;
  margin-top: 0.5rem;
}
.face-widget-wrap .ai-result-card {
  width: 100%;
  max-width: 760px;
  box-sizing: border-box;
  background: linear-gradient(160deg, #fdf8ee 0%, #fef5dc 100%);
  border: 2px solid #d4a853;
  border-radius: 0.8rem;
  padding: 1.4rem 1.8rem 1.6rem;
  position: relative;
  box-shadow: 0 4px 18px rgba(180, 120, 40, 0.12);
  font-family: 'FZKai-Z03', 'Kaiti', 'STKaiti', 'KaiTi', '楷体', serif;
  color: #3d2a06;
  line-height: 1.9;
}
.face-widget-wrap .ai-result-card::before {
  content: '';
  position: absolute;
  top: 6px; left: 6px; right: 6px; bottom: 6px;
  border: 1px solid rgba(212, 168, 83, 0.35);
  border-radius: 0.5rem;
  pointer-events: none;
}
.face-widget-wrap .ai-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #8b3a0f;
  border-bottom: 1px dashed #d4a853;
  padding-bottom: 0.5rem;
  margin-bottom: 0.9rem;
  letter-spacing: 0.15em;
}
.face-widget-wrap .ai-card-body {
  font-size: 1.2rem;
  white-space: pre-wrap;
  letter-spacing: 0.04em;
}
.face-widget-wrap .ai-result-header {
  font-size: 1.3rem;
  color: #8b6914;
  font-weight: 600;
  letter-spacing: 0.12em;
  margin-bottom: 0.8rem;
  text-align: center;
  width: 100%;
  max-width: 760px;
}

/* ===== 响应式 ===== */
@media (max-width: 800px) {
  .face-widget-wrap .container {
    padding: 1.2rem 0.5rem 1rem 0.5rem;
    border-radius: 0.5rem;
  }
  .face-widget-wrap h1 {
    font-size: 1.5rem;
  }
  .face-widget-wrap .desc {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }
  .face-widget-wrap .fortune-huangli {
    font-size: 1.3rem;
    padding: 2rem 1.5rem 3rem 1.5rem;
  }
  .face-widget-wrap .fortune-huangli .weight {
    font-size: 1.6rem;
  }
  .face-widget-wrap .fortune-huangli .fortune {
    font-size: 1.3rem;
  }
  .face-widget-wrap .ai-result-card {
    padding: 1rem 1.1rem 1.2rem;
  }
}
