.cv-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cv-fadeIn 0.2s ease;
}

.cv-modal [data-lang="en"] {
  display: none;
}

.cv-modal [data-lang="zh"] {
  display: none;
}

@keyframes cv-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cv-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.cv-modal-content {
  position: relative;
  background: var(--entry, #fff);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border, #e0e0e0);
  max-width: 520px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  animation: cv-slideUp 0.3s ease;
}

@keyframes cv-slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cv-shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-10px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(10px);
  }
}

.cv-modal-content.shake {
  animation: cv-shake 0.5s;
}



@media (prefers-color-scheme: dark) {
  .cv-modal-content {
    background: var(--entry, #1a1a1a);
  }
}

.cv-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: var(--secondary, #666);
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--primary, #333);
  transform: rotate(90deg);
}

.cv-modal-header {
  margin-bottom: 24px;
}

.cv-modal-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--primary, #333);
}

.cv-modal-header h2 span {
  display: inline;
}

.cv-modal-subtitle {
  font-size: 13px;
  color: var(--secondary, #777);
  margin: 0;
  line-height: 1.6;
}

.cv-modal-subtitle span {
  display: inline;
}

.cv-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cv-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cv-form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary, #333);
}

.cv-form-group label span {
  display: inline;
}

.cv-form-group input,
.cv-form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border, #e0e0e0);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--primary, #333);
  background: var(--entry, #fff);
  transition: all 0.2s;
  box-sizing: border-box;
}

.cv-form-group input:focus,
.cv-form-group textarea:focus {
  outline: none;
  border-color: var(--theme, #667eea);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.cv-form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.cv-form-group input::placeholder,
.cv-form-group textarea::placeholder {
  color: var(--secondary, #999);
}

.cv-token-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.cv-token-box {
  width: 50px;
  height: 60px;
  font-size: 32px;
  font-weight: 600;
  text-align: center;
  font-family: 'Courier New', monospace;
  border: 2px solid var(--border, #e0e0e0);
  border-radius: 8px;
  background: var(--entry, #fff);
  color: var(--primary, #333);
  transition: all 0.2s;
  padding: 0;
  text-transform: uppercase;
}

.cv-token-box:focus {
  outline: none;
  border-color: var(--primary, #333);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.cv-token-box.filled {
  background: var(--primary, #333);
  color: #fff;
  border-color: var(--primary, #333);
}

.cv-token-box:not(.filled) {
  background: var(--entry, #fff);
  color: var(--primary, #333);
  border-color: var(--border, #e0e0e0);
}

.cv-form-notice {
  padding: 12px 16px;
  background: var(--code-bg, #f5f5f5);
  border-left: 3px solid var(--primary, #333);
  border-radius: 4px;
  font-size: 12px;
  color: var(--secondary, #666);
  line-height: 1.5;
}

.cv-form-notice span {
  display: inline;
}

.cv-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.cv-btn {
  flex: 1;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cv-btn span {
  display: inline;
}

.cv-btn.loading::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: cv-spin 0.8s linear infinite;
  vertical-align: middle;
}

.cv-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #999 !important;
}

.cv-btn-primary {
  background: var(--primary, #333);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.cv-btn-primary:hover:not(:disabled) {
  background: var(--theme, #000);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.cv-btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.cv-btn-secondary {
  background: transparent;
  color: var(--primary, #333);
  border: 1px solid var(--border, #ddd);
}

.cv-btn-secondary:hover {
  background: var(--theme, #f5f5f5);
  border-color: var(--primary, #333);
}

.cv-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: cv-spin 0.6s linear infinite;
}

@keyframes cv-spin {
  to { transform: rotate(360deg); }
}

.cv-btn-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}



@media (max-width: 600px) {
  .cv-modal-content {
    padding: 24px;
    width: 95%;
  }
  
  .cv-modal-header h2 {
    font-size: 20px;
  }
  
  .cv-form-actions {
    flex-direction: column;
  }
  
  .cv-btn {
    width: 100%;
  }
}

.cv-modal-content::-webkit-scrollbar {
  width: 8px;
}

.cv-modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.cv-modal-content::-webkit-scrollbar-thumb {
  background: var(--border, #ddd);
  border-radius: 4px;
}

.cv-modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--secondary, #bbb);
}
