* {
  margin: 0;
  padding: 0;

}

body {
  background-color: #f1f2f3;
}

.container {
    box-sizing: border-box;
  max-width: 1560px;
  min-width: 1240px;
  width: 100%;
  margin: 20px auto;
    color: #333;
}
.container *{
    box-sizing: border-box;
}
header {
  text-align: center;
  margin-bottom: 25px;
}

h1 {
  font-size: 2.1rem;
  margin-bottom: 10px;
  color: #2c3e50;
}

.subtitle {
  font-size: 1.1rem;
  color: #7f8c8d;
  max-width: 90%;
  margin: 0 auto;
  line-height: 1.6;
}

.main-content {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.panel {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  padding: 20px;
  transition: all 0.3s ease;
}

.panel-title {
  font-size: 1.3rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f1f2f3;
  color: #2c3e50;
  display: flex;
  align-items: center;
}

.panel-title span {
  margin-right: 10px;
  font-size: 1.4rem;
}

.control-group {
  margin-bottom: 22px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #34495e;
}

select,
input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  transition: border 0.3s;
}

select:focus,
input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.btn {
  flex: 1;
  padding: 14px 0;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn span {
  margin-right: 8px;
  font-size: 1.2rem;
}

.btn-primary {
  background: #3498db;
  color: white;
}

.btn-primary:hover {
  background: #2980b9;
}

.btn-success {
  background: #2ecc71;
  color: white;
}

.btn-success:hover {
  background: #27ae60;
}

.btn-warning {
  background: #f39c12;
  color: white;
}

.btn-warning:hover {
  background: #d35400;
}

.btn-danger {
  background: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
}

.file-upload-area {
  border: 2px dashed #bdc3c7;
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 25px;
  position: relative;
}

.file-upload-area:hover {
  border-color: #3498db;
  background: #f0f7ff;
}

.file-upload-area .icon {
  font-size: 3.5rem;
  margin-bottom: 15px;
  color: #7f8c8d;
}

.file-upload-area h3 {
  margin-bottom: 10px;
  color: #2c3e50;
}

.file-upload-area p {
  color: #7f8c8d;
  font-size: 0.95rem;
}

.file-upload-area input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.image-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.image-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  /* 添加背景色 */
}

.image-item.dragging {
  opacity: 0.5;
  transform: scale(0.95);
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.image-item:hover {
  transform: translateY(-5px);
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* 保持原始比例，不裁剪 */
  transition: transform 0.3s ease;
  will-change: transform;
  backface-visibility: hidden;
  background-color: white;
}

.rotation-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.8rem;
}

.image-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  padding: 10px;
  justify-content: space-around;
}

.action-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}


.instructions {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  padding: 25px;
  margin-top: 30px;
}

.instructions h2 {
  font-size: 1.6rem;
  margin-bottom: 20px;
  color: #2c3e50;
  display: flex;
  align-items: center;
}

.instructions h2 span {
  margin-right: 10px;
}

footer {
  text-align: center;
  padding: 10px 0;
  color: #7f8c8d;
}

.image-counter {
  background: #3498db;
  color: white;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.9rem !important;
  margin-left: 10px;
}

/* 保持图片填充容器 */
.image-item.processing {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

.image-item.processing::after {
  content: '处理中...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.9rem;
}
