/* 全局样式 */
:root {
  --primary-color: #4a6baf;
  --secondary-color: #6ac045;
  --accent-color: #ff9a3c;
  --background-color: #f8f9fa;
  --text-color: #333;
  --border-radius: 8px;
  --box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

body {
  font-family: 'Comic Sans MS', 'Marker Felt', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

/* 标题样式 */
h1, h2, h3 {
  color: var(--primary-color);
  text-align: center;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 0.8rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 0.6rem;
}

/* 导航样式 */
.nav-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 30px 0;
}

.nav-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1.2rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: transform 0.3s, background-color 0.3s;
  box-shadow: var(--box-shadow);
}

.nav-button:hover {
  background-color: #3a5a9f;
  transform: translateY(-3px);
}

/* 卡片样式 */
.card {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--box-shadow);
}

.card-title {
  color: var(--primary-color);
  font-size: 1.3rem;
  margin-top: 0;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 10px;
}

/* 转换器样式 */
.converter {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.converter-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.converter input {
  padding: 10px;
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  width: 150px;
}

.converter select {
  padding: 10px;
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  background-color: white;
}

.converter button {
  background-color: var(--secondary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 1.1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background-color 0.3s;
}

.converter button:hover {
  background-color: #589e35;
}

/* 结果显示 */
.result-box {
  background-color: #f0f8ff;
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  padding: 15px;
  margin-top: 15px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.result-value {
  color: var(--primary-color);
  font-weight: bold;
}

.result-unit {
  color: var(--secondary-color);
  font-weight: bold;
}

/* 知识块样式 */
.knowledge-box {
  background-color: #fff8e1;
  border-left: 5px solid var(--accent-color);
  padding: 15px;
  margin: 20px 0;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.knowledge-title {
  color: var(--accent-color);
  font-size: 1.2rem;
  margin-top: 0;
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

th, td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: center;
}

th {
  background-color: var(--primary-color);
  color: white;
}

tr:nth-child(even) {
  background-color: #f2f2f2;
}

/* 练习题样式 */
.exercise {
  background-color: #e3f2fd;
  border-radius: var(--border-radius);
  padding: 20px;
  margin: 20px 0;
}

.exercise h3 {
  color: var(--primary-color);
  margin-top: 0;
}

.exercise p {
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.exercise input {
  padding: 8px;
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  width: 100px;
}

.exercise button {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 8px 16px;
  font-size: 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  margin-left: 10px;
  transition: background-color 0.3s;
}

.exercise button:hover {
  background-color: #ff8a2c;
}

/* 答案反馈 */
.correct-answer {
  color: #4caf50;
  font-weight: bold;
  animation: pulse 0.5s;
}

.wrong-answer {
  color: #f44336;
  font-weight: bold;
}

/* 图片样式 */
.image-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.image-container img {
  max-width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

/* 动画效果 */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .nav-buttons {
    flex-direction: column;
    gap: 10px;
  }
  
  .converter-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .converter input, .converter select {
    width: 100%;
  }
}

/* 页脚样式 */
footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px;
  background-color: var(--primary-color);
  color: white;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* 特殊效果 */
.highlight {
  background-color: #ffff99;
  padding: 2px 5px;
  border-radius: 3px;
}

.number {
  color: var(--primary-color);
  font-weight: bold;
}

.unit {
  color: var(--secondary-color);
  font-weight: bold;
}