* {
  margin: 0;
  padding: 0;
}

body {
  background-color: #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 {
  text-align: center;
  margin-bottom: 25px;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 5px;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.92;
  max-width: 95%;
  margin: 0 auto;
}

.tool-container {
  display: grid;
  grid-template-columns: 1fr 2.5fr;
  gap: 20px;
  margin-bottom: 20px;
}

.panel {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.panel-title {
  width: 100%;
  font-size: 1.3rem;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload-area {
  border: 3px dashed #b8c2cc;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #fafafa;
  margin-bottom: 15px;
  position: relative;
  overflow: hidden;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: #4a6cf7;
  background-color: #edf3ff;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  color: #6a11cb;
  filter: drop-shadow(0 2px 3px rgba(106, 17, 203, 0.2));
}

.upload-text {
  font-size: 1.1rem;
  margin-bottom: 5px;
  color: #555;
  font-weight: 500;
}

.upload-button {
  background: linear-gradient(to right, #6a11cb, #4a6cf7);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 50px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(106, 17, 203, 0.25);
}

.upload-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(106, 17, 203, 0.35);
}

.file-input {
  display: none;
}

.file-list {
  max-height: 350px;
  overflow-y: auto;
  margin-top: 20px;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 15px;
  background: #f9fafc;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
  background: white;
  border-radius: 8px;
  margin-bottom: 10px;
  transition: transform 0.2s ease;
}

.file-item:hover {
  transform: translateX(5px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.file-item:last-child {
  margin-bottom: 0;
}

.file-info {
  flex-grow: 1;
  min-width: 0;
}

.file-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  max-width: 204px;
}

.file-size {
  font-size: 0.8rem;
  color: #777;
}

.file-progress {
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}

.file-progress-bar {
  height: 100%;
  background: linear-gradient(to right, #6a11cb, #4a6cf7);
  width: 0%;
  transition: width 0.3s ease;
}

.file-remove {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #ff6b6b;
  padding: 5px 10px;
  margin-left: 10px;
  transition: transform 0.2s ease;
}

.file-remove:hover {
  transform: scale(1.1);
  color: #ff4757;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.setting-group {
  margin-bottom: 10px;
}

.setting-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: #444;
  display: flex;
  align-items: center;
  gap: 10px;
}

.setting-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d8e0;
  border-radius: 10px;
  font-size: 1.05rem;
  background: #f9fafc;
  transition: all 0.2s ease;
}

.setting-input:focus {
  border-color: #6a11cb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.15);
  background: white;
}

select.setting-input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a11cb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
}

.preview-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.preview-area {
  flex-grow: 1;
  background: repeating-conic-gradient(#f0f0f0 0% 25%, #fafafa 0% 50%) 50% / 20px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  min-height: 400px;
  padding: 15px 0;
  position: relative;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.05);
}

.preview-image {
  max-width: 98%;
  max-height: 95%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  display: none;
  border-radius: 4px;
}

.placeholder {
  text-align: center;
  color: #888;
  padding: 10px;
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  color: #d1d8e0;
  opacity: 0.7;
}

.placeholder-text {
  font-size: 1rem;
  max-width: 450px;
  margin: 0 auto;
}

.actions {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}

.action-button {
  flex: 1;
  padding: 16px;
  border: none;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stitch-btn {
  background: linear-gradient(to right, #6a11cb, #4a6cf7);
  color: white;
}

.stitch-btn:hover {
  background: linear-gradient(to right, #5a0db5, #3a5ce8);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(106, 17, 203, 0.35);
}

.download-btn {
  background: linear-gradient(to right, #00b09b, #38ef7d);
  color: white;
}

.download-btn:hover {
  background: linear-gradient(to right, #009e8a, #28dd6d);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 176, 155, 0.35);
}

.download-btn:disabled {
  background: #cccccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.7;
}

.status-bar {
  margin-top: 15px;
  padding: 10px;
  border-radius: 10px;
  background-color: #e6f7ff;
  border: 1px solid #91d5ff;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
}

.status-icon {
  font-size: 1.2rem;
}

.status-bar .status-text{
  font-size: 0.8rem;
  margin-left: 8px;
}

footer {
  text-align: center;
  margin-top: 10px;
  padding: 25px;
  color: #666;
  font-size: 1rem;
}

.color-preview {
  width: 33px;
  height: 22px;
  border-radius: 6px;
  display: inline-block;
  vertical-align: middle;
  margin-left: 12px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  display: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(106, 17, 203, 0.2);
  border-radius: 50%;
  border-top: 5px solid #6a11cb;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
      transform: rotate(0deg);
  }

  100% {
      transform: rotate(360deg);
  }
}

.file-counter {
  background: #4a6cf7;
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.9rem;
  margin-left: 5px;
}

.setting-group input[type="number"] {
  padding: 10px 12px;
  border: 1px solid #d1d8e0;
  border-radius: 10px;
  font-size: 1.05rem;
  background: #f9fafc;
  transition: all 0.2s ease;
}

.notice-box {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #fff;
  color: #333;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  font-size: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 80%;
  word-wrap: break-word;
}

.notice-box.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.file-item.dragging {
  opacity: 0.5;
}
