/* 颜色工具页面样式 */

/* 颜色选择器样式 */
.color-picker-section {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  align-items: start;
}

.picker-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.color-input {
  width: 100px;
  height: 50px;
  border: none;
  /* border-radius: 50%; */
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s;
}

.color-input:hover {
  transform: scale(1.05);
}

.color-preview {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  border: 3px solid white;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
}

.color-codes {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.code-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.code-item label {
  font-weight: bold;
  min-width: 50px;
  color: #667eea;
}

.code-item input {
  flex: 1;
  padding: 0.8rem;
  border: 2px solid #e0e0e0;
  border-radius: 5px;
  background: #f8f9fa;
  font-family: monospace;
}

/* 颜色转换器样式 */
.convert-result {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 2rem;
  margin-top: 2rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 10px;
}

.converted-codes {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.converted-codes .code-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem;
  background: white;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.converted-codes .code-item span {
  font-family: monospace;
  font-weight: bold;
  color: #333;
}

.error-message {
  color: #e74c3c;
  background: #fdf2f2;
  padding: 1rem;
  border-radius: 5px;
  border-left: 4px solid #e74c3c;
  margin-top: 1rem;
}

/* 调色板样式 */
.palette-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.palette-btn {
  padding: 0.6rem 1.2rem;
  background: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9rem;
}

.palette-btn:hover {
  background: #e9ecef;
  border-color: #667eea;
}

.palette-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.palette-color {
  height: 120px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 0.5rem;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.palette-color:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.color-code {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.3rem 0.6rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-family: monospace;
  opacity: 0;
  transition: opacity 0.3s;
}

.palette-color:hover .color-code {
  opacity: 1;
}

/* 常用颜色 */
.common-colors {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.common-color {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.common-color:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 使用技巧 */
.tips-content p {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

/* 相关工具 */
.related-tools {
  list-style: none;
}

.related-tools li {
  margin-bottom: 0.8rem;
}

.related-tools a {
  display: block;
  padding: 0.8rem;
  background: #f8f9fa;
  color: #667eea;
  text-decoration: none;
  border-radius: 5px;
  transition: all 0.3s;
}

.related-tools a:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .tool-container {
    grid-template-columns: 1fr;
  }

  .color-picker-section {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .convert-result {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .palette-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .palette-types {
    justify-content: center;
  }

  .common-colors {
    grid-template-columns: repeat(4, 1fr);
  }
}