* {
  margin: 0;
  padding: 0;
}

body {
  background: #f1f2f3;
}

.container {
  box-sizing: border-box;
  width: 100%;
  max-width: 1560px;
  min-width: 1240px;
  margin: 20px auto;
  color: #333;
}

.container * {
  box-sizing: border-box;
}

header {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 25px;
}

header h1 {
  font-size: 30px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  margin-bottom: 5px;
}

header p {
  font-size: 16px;
  color: #7f8c8d;
  margin: 0 auto;
}

.main-content {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
}

.image-section {
  flex: 1;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.image-container {
  position: relative;
  flex: 1;
  min-height: 500px;
  background:
    linear-gradient(45deg, #f5f5f5 25%, transparent 25%, transparent 75%, #f5f5f5 75%),
    linear-gradient(45deg, #f5f5f5 25%, transparent 25%, transparent 75%, #f5f5f5 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: crosshair;
}

#picked-image {
  max-width: 100%;
  max-height: 100%;
  display: none;
}

.magnifier {
  position: fixed;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 10;
  display: none;
  overflow: hidden;
}

.magnifier-inner {
  width: 100%;
  height: 100%;
}

.crosshair {
  position: absolute;
  background-image: linear-gradient(90deg, rgba(0, 0, 0, .1) 1px, transparent 0), linear-gradient(180deg, rgba(0, 0, 0, .1) 1px, transparent 0);
  background-size: 10px 10px;
  height: 100%;
  left: 0;
  top: 0;
  width: 100%;
}

.upload-btn {
  background: #3498db;
  color: white;
  padding: 14px 25px;
  width: 100%;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  margin-bottom: 25px;
}
.upload-btn:hover {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.palette-section {
  width: 350px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.palette-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.palette-header h2 {
  font-size: 1.5rem;
  color: #2c3e50;
}

.palette-colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.color-item {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.color-preview {
  height: 60px;
}

.color-info {
  padding: 5px;
  background: white;
}

.color-hex {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.color-rgb {
  font-size: 0.75rem;
  color: #7f8c8d;
}

.color-result {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  padding: 20px;
  margin-bottom: 25px;
  display: flex;
  gap: 25px;
}

.result-item {
  flex: 1;
}

.result-title {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-value {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px 20px;
  font-size: 1.2rem;
  font-family: monospace;
}

.copy-btn {
  margin-left: auto;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.3s;
}

.copy-btn:hover {
  background: #2980b9;
}

.tool-intro {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  padding: 20px;
  margin-bottom: 25px;
}

.tool-intro h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #2c3e50;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 25px;
}

.feature {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
  border: 1px solid #eee;
  transition: transform 0.3s ease;
}

.feature:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.feature h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: #2c3e50;
}

footer {
  text-align: center;
  color: #7f8c8d;
  font-size: 0.9rem;
}

#notice {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 15px 40px;
  border-radius: 30px;
  font-size: 1rem;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.notice-show {
  opacity: 1 !important;
}

.color-history {
  margin-top: 25px;
  padding-top: 25px;
  border-top: 1px solid #eee;
}

.history-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.history-color {
  width: 43px;
  height: 43px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.history-color:hover {
  transform: scale(1.1);
}

.empty-palette {
  text-align: center;
  color: #7f8c8d;
}

.empty-palette .emoji {
  font-size: 2rem;
  margin-bottom: 10px;
}

.empty-palette p{
  font-size: 0.8rem;
}
