body {
  font-family: Graphik, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-y: auto;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: #ccc;
}

.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
}

#dragMask {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 32px;
  text-align: center;
  backdrop-filter: blur(3px);
  pointer-events: none;
}

#dragMask.active {
  display: flex;
}

#guidePage {
  width: 100%;
  margin: 0;
  padding: 72px 0 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.image_title {
  margin: 0 0 18px;
  color: #101018;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.4px;
}

#guidePage > h2 {
  max-width: 760px;
  margin: 0 auto;
  color: #6b6b78;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75;
}

.upload-box {
  position: relative;
  width: 100%;
  margin: 40px auto 0;
  padding: 56px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #d9d9e3;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(17, 17, 26, 0.05);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.upload-box:hover {
  border-color: #b7aefc;
  background: #fcfbff;
  box-shadow: 0 24px 48px rgba(17, 17, 26, 0.08);
}

.upload-box:focus-within {
  border-color: #6558e8;
  box-shadow: 0 0 0 4px rgba(101, 88, 232, 0.12);
}

.upload-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 50%;
  background: #f2efff;
  color: #6558e8;
}

.upload-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-title {
  color: #14141c;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
}

.upload-label {
  width: fit-content;
  min-width: 220px;
  min-height: 56px;
  margin: 20px 0 0;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  background: #6558e8;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(101, 88, 232, 0.22);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.upload-label-plus {
  position: relative;
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.upload-label-plus::before,
.upload-label-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.upload-label-plus::before {
  width: 8px;
  height: 2px;
}

.upload-label-plus::after {
  width: 2px;
  height: 8px;
}

.upload-label:hover {
  background: #5749d6;
  box-shadow: 0 14px 30px rgba(101, 88, 232, 0.28);
  transform: translateY(-2px);
}

.upload-hint {
  margin-top: 16px;
  color: #8b8b98;
  font-size: 14px;
  line-height: 1.6;
}

#inputFiles {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.grid-container {
  width: 100%;
  margin: 56px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.grid-container .grid-item {
  min-width: 0;
  margin: 0;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  border-radius: 20px;
  background: #f7f6ff;
  text-align: left;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.grid-container .grid-item:hover {
  background: #f1eeff;
  box-shadow: 0 16px 36px rgba(101, 88, 232, 0.1);
  transform: translateY(-2px);
}

.grid-item svg {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  padding: 14px;
  border-radius: 50%;
  background: #fff;
  color: #6558e8;
  box-shadow: 0 6px 16px rgba(101, 88, 232, 0.12);
}

.feature-title {
  margin: 0 0 8px;
  color: #101018;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.grid-container .grid-item .feature-desc {
  margin: 0;
  color: #6b6b78;
  font-size: 15px;
  line-height: 1.7;
}

.guide-section {
  width: 100%;
  margin-top: 64px;
  color: #182230;
  line-height: 1.65;
  counter-reset: step-counter;
  text-align: left;
}

.guide-section h3 {
  margin: 0 0 16px;
  color: #101018;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.5px;
}

.guide-section .step {
  position: relative;
  margin-bottom: 12px;
  padding: 22px 22px 22px 68px;
  border: 1px solid #f0f0f5;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(17, 17, 26, 0.03);
}

.guide-section .step::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  position: absolute;
  left: 22px;
  top: 22px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #6558e8;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.guide-section .step h4 {
  margin: 0 0 8px;
  color: #101018;
  font-size: 16px;
  line-height: 1.4;
}

.guide-section .step p {
  margin: 0;
  color: #6b6b78;
  font-size: 14px;
  line-height: 1.7;
}

.faq {
  min-height: 0;
  margin: 16px 0;
  padding: 0;
}

.faq dt {
  position: relative;
  margin-top: 12px;
  padding: 16px 48px 16px 20px;
  border-radius: 14px;
  background: #f7f6ff;
  color: #101018;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.faq dt:hover {
  background: #f1eeff;
}

.faq dt::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 20px;
  color: #6558e8;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  transform: translateY(-50%);
}

.faq dt.active::after {
  content: "−";
}

.faq dd {
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: #6b6b78;
  font-size: 15px;
  line-height: 1.7;
  text-align: left;
  transition: height 0.22s ease;
}

.faq dd > div {
  padding: 12px 20px 14px;
}

#file-list {
  flex: 1;
  width: auto;
  min-width: 0;
  height: calc(100vh - 160px);
  min-height: 360px;
  margin: 24px 0;
  padding: 0;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(17, 17, 26, 0.07);
  list-style: none;
}

#file-list li {
  min-height: 52px;
  padding: 12px 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #f0f0f5;
  color: #33333f;
  font-size: 14px;
  line-height: 1.55;
}

#file-list .file-list-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 52px;
  padding-top: 0;
  padding-bottom: 0;
  background: #fafaff;
  color: #6b6b78;
  font-weight: 600;
}

#file-list .col {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#file-list .output-name {
  color: #6558e8;
}

#file-list .file-list-header .output-name {
  color: #6b6b78;
}

.setting {
  flex: 0 0 320px;
  align-self: flex-start;
  width: 320px;
  min-width: 0;
  min-height: 45px;
  margin: 24px 0 24px 20px;
  padding: 20px;
  gap: 14px;
  flex-direction: column;
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(17, 17, 26, 0.07);
}

#settingBox {
  min-width: 0;
  margin: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid #e9e9f0;
  border-radius: 16px;
  font-size: 14px;
}

.settingTitle {
  padding: 0 8px;
  color: #182230;
  font-size: 18px;
  font-weight: 700;
}

#addFiles {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#addFiles > span > span {
  color: #6558e8;
  font-weight: 700;
}

#addFiles button {
  width: auto;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #eeecff;
  color: #5749d6;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.extension-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.optional {
  color: #182230;
  font-weight: 600;
}

#ext-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #dedeea;
  border-radius: 10px;
  background: #fff;
  color: #182230;
  font: inherit;
  outline: none;
}

#ext-input:focus {
  border-color: #6558e8;
  box-shadow: 0 0 0 3px rgba(101, 88, 232, 0.12);
}

.extension-field small {
  color: #8b8b98;
  font-size: 12px;
  line-height: 1.6;
}

#confirm_button {
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: #6558e8;
  color: #fff;
  box-shadow: 0 8px 20px rgba(101, 88, 232, 0.2);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

#confirm_button:hover:not(:disabled) {
  background: #5749d6;
  transform: translateY(-1px);
}

#confirm_button:disabled {
  background: #aaa;
  box-shadow: none;
  cursor: not-allowed;
}

.outputBox {
  margin: 0;
  padding: 12px;
  display: none;
  border: 1px solid #e9e9f0;
  border-radius: 12px;
  background: #fafaff;
  font-size: 14px;
}

.outputBox > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#output_name {
  min-width: 0;
  overflow: hidden;
  color: #40369c;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#downloadButton {
  flex: none;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #6558e8;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

@media screen and (max-width: 768px) {
  .container {
    padding: 0 16px;
    flex-direction: column;
  }

  #guidePage {
    padding: 50px 0 64px;
  }

  .image_title {
    margin-bottom: 15px;
    font-size: 30px;
    letter-spacing: -1px;
  }

  #guidePage > h2 {
    font-size: 14px;
    line-height: 1.7;
  }

  #dragMask {
    font-size: 22px;
  }

  .upload-box {
    margin-top: 32px;
    padding: 40px 16px;
    border-radius: 20px;
  }

  .upload-title {
    font-size: 15px;
  }

  .upload-label {
    width: 100%;
    max-width: 280px;
    min-width: 0;
    min-height: 52px;
    margin-top: 18px;
  }

  .grid-container {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 36px;
  }

  .grid-container .grid-item {
    padding: 22px 20px;
    gap: 14px;
  }

  .grid-item svg {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    padding: 12px;
  }

  .feature-title {
    font-size: 16px;
  }

  .grid-container .grid-item .feature-desc {
    font-size: 14px;
  }

  .guide-section {
    margin-top: 40px;
  }

  .guide-section h3 {
    font-size: 20px;
  }

  .guide-section .step {
    padding: 20px 16px 20px 54px;
  }

  .guide-section .step::before {
    left: 14px;
    top: 18px;
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .faq dt {
    padding: 14px 44px 14px 16px;
    font-size: 15px;
  }

  .faq dt::after {
    right: 16px;
  }

  .faq dd > div {
    padding: 10px 16px 12px;
  }

  #file-list {
    flex: none;
    width: 100%;
    height: min(56vh, 520px);
    min-height: 280px;
    margin: 16px 0 0;
    border-radius: 16px;
  }

  #file-list li {
    padding: 12px;
    gap: 10px;
    font-size: 12px;
  }

  .setting {
    flex: none;
    width: 100%;
    height: auto;
    margin: 12px 0 24px;
    padding: 16px;
    border-radius: 16px;
  }
}

@media (hover: none) {
  .grid-container .grid-item:hover,
  .upload-label:hover,
  #confirm_button:hover:not(:disabled) {
    transform: none;
  }
}
