/* ===== 图片转换工具专用样式（复用站点变量） ===== */
.converter .app-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.converter .header-icon {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 22px;
  line-height: 1;
}
.converter .header-text {
  min-width: 0;
}
.converter .app-header h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}
.converter .app-header .sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.converter .app-header .badge {
  margin-left: auto;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

/* 拖拽上传区 */
.drop-zone {
  margin-top: 24px;
  padding: 40px 20px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
  cursor: pointer;
  transition:
    border-color 0.18s,
    background-color 0.18s,
    transform 0.18s;
}
.drop-zone:hover {
  border-color: var(--primary);
}
.drop-zone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: scale(1.005);
}
.drop-zone:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.drop-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 26px;
  line-height: 1;
}
.drop-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
}
.drop-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* 工具条 */
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
}
.field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
}
.field select.control {
  width: auto;
  max-width: 120px;
  padding: 7px 10px;
}
.field em {
  color: var(--primary);
  font-style: normal;
  font-weight: 700;
}
.field input[type="range"] {
  width: 130px;
  accent-color: var(--primary);
}
.toolbar .hint {
  color: var(--muted);
  font-size: 0.78rem;
}
.toolbar .spacer {
  flex: 1 1 auto;
}

/* 文件列表 */
.conv-table-wrap {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.conv-table-wrap .empty {
  padding: 40px 20px;
}
.conv-table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.conv-table th {
  padding: 12px 16px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--border);
}
.conv-table td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
  font-size: 0.9rem;
}
.conv-table tbody tr:first-child td {
  border-top: 0;
}
.conv-table tbody tr:hover {
  background: var(--primary-soft);
}
.conv-table th.col-actions,
.conv-table td.col-actions {
  text-align: right;
  white-space: nowrap;
}

.file-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.file-thumb {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}
.file-name {
  display: block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.conv-table select.control {
  width: auto;
  max-width: 110px;
  padding: 6px 10px;
}

/* 按钮 */
.button {
  transition:
    background-color 0.16s,
    border-color 0.16s,
    color 0.16s,
    filter 0.16s;
}
.button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.button-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.button-primary:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  filter: brightness(1.08);
}
.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.icon-btn {
  width: 30px;
  height: 30px;
  margin-left: 8px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover {
  border-color: var(--border);
  background: var(--surface);
  color: var(--accent);
}

/* 底部批量操作 */
.batch-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.batch-bar .count {
  color: var(--muted);
  font-size: 0.875rem;
}
.batch-bar .spacer {
  flex: 1 1 auto;
}
.progress {
  flex: 1 1 160px;
  min-width: 120px;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
}
.progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--primary);
  transition: width 0.18s ease;
}

/* 轻提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 99;
  max-width: min(90vw, 420px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--surface);
  font-size: 0.875rem;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 800px) {
  .tool-main {
    padding: 16px 12px 0;
  }
  .converter {
    padding: 20px 16px 24px !important;
  }
  .drop-zone {
    padding: 30px 16px;
  }
  .toolbar .hint {
    display: none;
  }
  .converter .app-header .badge {
    margin-left: 0;
  }
  .file-name {
    max-width: 150px;
  }
}
