/*
 * 枢爻验证码 SDK 样式
 * 主色调 #4ECDC4（青绿色）
 */

/* ===== CSS 变量 ===== */
:root {
  --shuyao-primary: #4ECDC4;
  --shuyao-primary-dark: #3db8b0;
  --shuyao-primary-light: rgba(78, 205, 196, 0.15);
  --shuyao-success: #2ecc71;
  --shuyao-error: #e74c3c;
  --shuyao-text: #2c3e50;
  --shuyao-text-secondary: #7f8c8d;
  --shuyao-bg: #ffffff;
  --shuyao-bg-secondary: #f8f9fa;
  --shuyao-border: #e9ecef;
  --shuyao-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.1);
  --shuyao-radius: 16px;
  --shuyao-modal-width: 440px;
}

/* ===== 遮罩层 ===== */
.shuyao-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.shuyao-overlay.shuyao-visible {
  opacity: 1;
}

/* ===== 弹窗容器 ===== */
.shuyao-modal {
  width: var(--shuyao-modal-width);
  max-width: 95vw;
  background: var(--shuyao-bg);
  border-radius: var(--shuyao-radius);
  box-shadow: var(--shuyao-shadow);
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.shuyao-overlay.shuyao-visible .shuyao-modal {
  transform: translateY(0) scale(1);
}

/* ===== 头部 ===== */
.shuyao-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--shuyao-border);
  background: var(--shuyao-bg);
}

.shuyao-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--shuyao-text);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.shuyao-title::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 22px;
  background: url('../img/SHUYAO128.png') center/contain no-repeat;
  flex-shrink: 0;
}

.shuyao-close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--shuyao-text-secondary);
  font-size: 20px;
  transition: all 0.2s ease;
  line-height: 1;
}

.shuyao-close-btn:hover {
  background: var(--shuyao-bg-secondary);
  color: var(--shuyao-text);
}

/* ===== Canvas 容器 ===== */
.shuyao-canvas-container {
  padding: 16px 20px;
  display: flex;
  justify-content: center;
  background: var(--shuyao-bg);
  position: relative;
  min-height: 200px;
}

.shuyao-canvas-container canvas {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  cursor: pointer;
}

/* ===== 底部操作栏 ===== */
.shuyao-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--shuyao-border);
  background: var(--shuyao-bg-secondary);
}

.shuyao-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shuyao-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shuyao-status-text {
  font-size: 13px;
  color: var(--shuyao-text-secondary);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.shuyao-refresh-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--shuyao-border);
  background: var(--shuyao-bg);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--shuyao-text-secondary);
  font-size: 16px;
  transition: all 0.2s ease;
}

.shuyao-refresh-btn:hover {
  border-color: var(--shuyao-primary);
  color: var(--shuyao-primary);
  background: var(--shuyao-primary-light);
}

.shuyao-refresh-btn:active {
  transform: scale(0.92);
}

.shuyao-refresh-btn svg {
  width: 16px;
  height: 16px;
}

.shuyao-submit-btn {
  padding: 8px 24px;
  border: none;
  background: linear-gradient(135deg, #4ECDC4, #45B7D1);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.shuyao-submit-btn:hover {
  box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
  transform: translateY(-1px);
}

.shuyao-submit-btn:active {
  transform: translateY(0) scale(0.97);
}

.shuyao-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===== 加载状态 ===== */
.shuyao-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  z-index: 10;
  gap: 12px;
}

.shuyao-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--shuyao-border);
  border-top-color: var(--shuyao-primary);
  border-radius: 50%;
  animation: shuyao-spin 0.8s linear infinite;
}

@keyframes shuyao-spin {
  to { transform: rotate(360deg); }
}

.shuyao-loading-text {
  font-size: 14px;
  color: var(--shuyao-text-secondary);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

/* ===== 成功状态 ===== */
.shuyao-result {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  gap: 8px;
  animation: shuyao-fade-in 0.3s ease;
}

.shuyao-success {
  background: rgba(255, 255, 255, 0.95);
}

.shuyao-error {
  background: rgba(255, 255, 255, 0.95);
}

.shuyao-result-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  animation: shuyao-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.shuyao-success .shuyao-result-icon {
  background: rgba(46, 204, 113, 0.15);
  color: var(--shuyao-success);
}

.shuyao-error .shuyao-result-icon {
  background: rgba(231, 76, 60, 0.15);
  color: var(--shuyao-error);
}

.shuyao-result-text {
  font-size: 15px;
  font-weight: 500;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.shuyao-success .shuyao-result-text {
  color: var(--shuyao-success);
}

.shuyao-error .shuyao-result-text {
  color: var(--shuyao-error);
}

@keyframes shuyao-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shuyao-pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* ===== 暗色主题 ===== */
.shuyao-dark {
  --shuyao-text: #ecf0f1;
  --shuyao-text-secondary: #95a5a6;
  --shuyao-bg: #1e272e;
  --shuyao-bg-secondary: #2c3e50;
  --shuyao-border: #34495e;
  --shuyao-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 8px 20px rgba(0, 0, 0, 0.3);
}

.shuyao-dark .shuyao-overlay {
  background: rgba(0, 0, 0, 0.6);
}

.shuyao-dark .shuyao-loading {
  background: rgba(30, 39, 46, 0.9);
}

.shuyao-dark .shuyao-success,
.shuyao-dark .shuyao-error {
  background: rgba(30, 39, 46, 0.95);
}

.shuyao-dark .shuyao-spinner {
  border-color: var(--shuyao-border);
  border-top-color: var(--shuyao-primary);
}

/* ===== 品牌水印 ===== */
.shuyao-brand {
  text-align: center;
  padding: 6px 0 10px;
  font-size: 11px;
  color: var(--shuyao-text-secondary);
  opacity: 0.6;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  letter-spacing: 1px;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
  .shuyao-modal {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }

  .shuyao-canvas-container {
    flex: 1;
    padding: 12px;
  }

  .shuyao-header {
    padding: 14px 16px;
  }

  .shuyao-footer {
    padding: 10px 16px;
  }
}
