:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #a5b4fc;
  --secondary: #6b7280;
  --secondary-light: #9ca3af;
  --light-bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --border-focus: #c7d2fe;
  --text: #334155;
  --text-light: #64748b;
  --success: #22c55e;
  --success-light: #dcfce7;
  --success-border: #bbf7d0;
  --error: #ef4444;
  --error-light: #fef2f2;
  --error-border: #fecaca;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --info: #3b82f6;
  --info-light: #dbeafe;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

* {
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: center;
  border: none;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  box-shadow: 0 8px 25px 0 rgba(79, 70, 229, 0.5);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.3);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: #4b5563;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* 卡片样式 */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.3), transparent);
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-xl);
  border-color: var(--border-focus);
}

/* 输入框样式 */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  background: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}

.input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), var(--shadow-md);
  outline: none;
  transform: translateY(-1px);
}

.input:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
textarea:hover {
  border-color: var(--border-focus);
}

/* 内联输入框 */
.inline-input {
  display: inline-block;
  width: auto;
  min-width: 35px;
  margin: 0 4px;
  padding: 4px 6px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border: 2px solid var(--border);
  font-weight: 600;
}

.inline-input:focus {
  min-width: 60px;
  background: white;
}

/* 短输入框，适用于填空题 */
.fill-input {
  width: auto;
  max-width: 150px;
  margin: 0 4px;
  padding: 8px 12px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: white;
  border: 2px solid var(--border);
  font-weight: 500;
  display: inline-block;
}

.fill-input:focus {
  max-width: 180px;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}

/* 反馈信息样式 */
.feedback {
  border-radius: var(--radius-md);
  padding: 16px 16px 16px 28px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 12px;
  position: relative;
  box-shadow: var(--shadow-sm);
  animation: slideInUp 0.3s ease-out;
  display: block !important;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  border-radius: 2px;
}

.feedback.correct {
  background: var(--success-light);
  border: 1px solid var(--success-border);
  color: var(--success);
}

.feedback.correct::before {
  background: var(--success);
}

.feedback.incorrect {
  background: var(--error-light);
  border: 1px solid var(--error-border);
  color: var(--error);
}

.feedback.incorrect::before {
  background: var(--error);
}

.feedback.warning {
  background: var(--warning-light);
  border: 1px solid #fde68a;
  color: var(--warning);
}

.feedback.warning::before {
  background: var(--warning);
}

.feedback.info {
  background: var(--info-light);
  border: 1px solid #bfdbfe;
  color: var(--info);
}

.feedback.info::before {
  background: var(--info);
}

/* 练习项目样式 */
.exercise-item {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.exercise-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.exercise-item h3 {
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

/* 问题容器样式 */
.question-container {
  background: linear-gradient(145deg, #f8fafc, #ffffff);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.question-container:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.question-number {
  font-weight: 700;
  color: var(--primary);
  font-size: 16px;
  margin-bottom: 8px;
}

/* 标签样式 */
.label {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  font-size: 14px;
}

/* 说明文字样式 */
.instruction-text {
  background: linear-gradient(135deg, var(--info-light), #e0f2fe);
  border-left: 4px solid var(--info);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
}

/* 提示词样式 */
.hint-words {
  background: linear-gradient(135deg, var(--warning-light), #fef3c7);
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--warning);
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

/* 只读输入框 */
input[readonly] {
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0) !important;
  cursor: not-allowed;
  color: var(--text-light);
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content {
  background: white;
  margin: 10% auto;
  padding: 0;
  border: none;
  width: 90%;
  max-width: 600px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modalSlideIn 0.3s ease-out;
  overflow: hidden;
}

.modal-header {
  padding: 24px 32px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: white;
  position: relative;
}

.modal-header-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.modal-header-error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.modal-header-info {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.modal-body {
  padding: 24px 32px;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.6;
}

.modal-footer {
  padding: 16px 32px 24px;
  text-align: center;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.modal-close:hover {
  color: white;
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .btn {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .exercise-item {
    padding: 16px;
    margin-bottom: 16px;
  }
  
  .question-container {
    padding: 16px;
  }
  
  .inline-input {
    min-width: 50px;
    padding: 5px 7px;
  }

  .modal-content {
    margin: 15% auto;
    width: 95%;
    max-width: none;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
} 