html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: #fafafa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* container 居中且顶部距离不大 */
.container {
  width: 100%;
  max-width: 800px;
  margin: 20px auto;   /* 顶部只留20px间距 */
  background: transparent;
  border-radius: 12px;
  padding: 0 10px;     /* 两侧留点空隙 */
  box-sizing: border-box;
}

/* 按钮行紧凑 */
.button-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  align-items: center;
}

/* 控件统一样式 */
.file-input,
.select-all-btn,
.generate-btn,
.select-dpi input[type="range"]{
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  border: 1px solid #ccc;
  background-color: #fff;
  color: #333;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: transform 0.2s ease, background-color 0.2s ease;
  max-width: 100%;
  box-sizing: border-box;
}


/* 文件输入特有背景 */
.file-input {
  background: #f5f5f5;
  border-color: #bbb;
}

/* 绿色按钮 */
.select-all-btn,
.generate-btn {
  background-color: #28a745;
  color: white;
  border: none;
  box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4);
}
.select-all-btn:hover,
.generate-btn:hover {
  background-color: #218838;
  box-shadow: 0 6px 14px rgba(33, 136, 56, 0.6);
  transform: scale(1.05);
}

/* 分辨率选择悬浮 */
.resolution-select:hover {
  border-color: #28a745;
  transform: scale(1.05);
}

/* 提示信息 */
.loading-message,
.generating-message {
  display: none;
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}


.preview-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 8px;
    text-align: left; /* Align the preview container to the left */
}
.preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.preview label {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.preview canvas {
    border: 1px solid #ccc;
    border-radius: 8px;
    width: 100px;
    height: auto;
    cursor: pointer;
}
.preview .page-number {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
}


/* 统一滑动条背景轨道样式 */
#dpi {
  -webkit-appearance: none;
  appearance: none;
  width: 150px; /* 可以调节长度 */
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  outline: none;
}

/* Chrome / Safari 滑块 */
#dpi::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;            /* 更长 */
  height: 12px;           /* 更扁 */
  background: linear-gradient(to bottom, #28a745, #218838); /* 光泽渐变绿色 */
  border: none;
  border-radius: 6px;     /* 圆角 */
  box-shadow: 0 0 3px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.2s ease;
  margin-top: -3px;       /* 垂直居中调整 */
}

#dpi::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

/* Firefox 滑块 */
#dpi::-moz-range-thumb {
  width: 36px;
  height: 12px;
  background: linear-gradient(to bottom, #28a745, #218838);
  border: none;
  border-radius: 6px;
  box-shadow: 0 0 3px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.2s ease;
}

#dpi::-moz-range-thumb:hover {
  transform: scale(1.1);
}

/* IE / Edge 滑块 */
#dpi::-ms-thumb {
  width: 36px;
  height: 12px;
  background: linear-gradient(to bottom, #28a745, #218838);
  border: none;
  border-radius: 6px;
  box-shadow: 0 0 3px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.2s ease;
}

#dpi::-ms-thumb:hover {
  transform: scale(1.1);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}
.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
}
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}
.caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .buttons {
    flex-direction: column;
  }
  .select-dpi {
    margin-left: 0;
    margin-top: 10px;
  }
}