/* PDF 办公处理工具 */
.pdf-tools-page {
  --pdf-green: #1a4d2e;
  --pdf-green-soft: #e8f2eb;
  --pdf-card: #fff;
  --pdf-border: #d4e8d8;
  --pdf-muted: #5a6b5f;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 56px;
  box-sizing: border-box;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #1e2a22;
  background: linear-gradient(180deg, #f0f7f2 0%, #e8f0ea 100%);
  min-height: 100%;
}

.pdf-tools-hero {
  text-align: center;
  margin-bottom: 20px;
}
.pdf-tools-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 4vw, 28px);
  color: var(--pdf-green);
  font-weight: 800;
}
.pdf-tools-hero p {
  margin: 0 auto;
  max-width: 720px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--pdf-muted);
}

.pdf-privacy {
  margin: 14px auto 0;
  max-width: 720px;
  padding: 10px 14px;
  background: rgba(26, 77, 46, 0.08);
  border: 1px solid var(--pdf-border);
  border-radius: 12px;
  font-size: 13px;
  color: var(--pdf-green);
  font-weight: 600;
}

.pdf-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0 16px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--pdf-border);
}
.pdf-tab {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 10px 10px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: #4a6354;
  cursor: pointer;
  white-space: nowrap;
}
.pdf-tab:hover {
  background: rgba(255, 255, 255, 0.6);
}
.pdf-tab.is-active {
  background: var(--pdf-card);
  border-color: var(--pdf-border);
  color: var(--pdf-green);
  box-shadow: 0 -2px 0 #c9962a inset;
}

.pdf-panel {
  display: none;
}
.pdf-panel.is-active {
  display: block;
}

.pdf-card {
  background: var(--pdf-card);
  border-radius: 16px;
  border: 1px solid var(--pdf-border);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 24px rgba(15, 45, 28, 0.06);
}

.pdf-drop {
  border: 2px dashed #9bc4a8;
  border-radius: 14px;
  padding: 28px 16px;
  text-align: center;
  background: var(--pdf-green-soft);
  color: var(--pdf-green);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 14px;
}
.pdf-drop:hover,
.pdf-drop.is-dragover {
  border-color: var(--pdf-green);
  background: #dff0e4;
}
.pdf-drop strong {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
}
.pdf-drop span {
  font-size: 12px;
  opacity: 0.85;
}

.pdf-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.pdf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--pdf-border);
  background: #fff;
  color: var(--pdf-green);
  cursor: pointer;
}
.pdf-btn:hover:not(:disabled) {
  background: var(--pdf-green-soft);
}
.pdf-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pdf-btn-primary {
  background: linear-gradient(135deg, #1a5c38, #1a4d2e);
  color: #fff;
  border-color: #143d28;
}
.pdf-btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
}
.pdf-btn-muted {
  background: #f4f8f5;
  color: #3d5346;
}

.pdf-input,
.pdf-select {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--pdf-border);
  font-size: 14px;
  box-sizing: border-box;
  max-width: 100%;
}
.pdf-input-text {
  width: 100%;
  max-width: 420px;
}

.pdf-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pdf-file-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--pdf-border);
  border-radius: 12px;
  margin-bottom: 8px;
  background: #fafdfb;
  cursor: default;
}
.pdf-file-row[draggable='true'] {
  cursor: grab;
}
.pdf-file-row.is-dragging {
  opacity: 0.55;
}
.pdf-file-grip {
  text-align: center;
  color: #888;
  font-size: 16px;
  user-select: none;
}
.pdf-file-meta {
  font-size: 13px;
  line-height: 1.45;
  min-width: 0;
}
.pdf-file-meta b {
  display: block;
  color: #1a2e22;
  word-break: break-all;
}
.pdf-file-meta small {
  color: var(--pdf-muted);
}
.pdf-file-remove {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid #e0b4b4;
  background: #fff5f5;
  color: #a33;
  cursor: pointer;
}
.pdf-file-remove:hover {
  background: #ffe8e8;
}

.pdf-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
}
.pdf-status--idle {
  background: #f4f8f5;
  color: var(--pdf-muted);
}
.pdf-status--reading,
.pdf-status--waiting {
  background: #fff8e6;
  color: #6b5a1a;
}
.pdf-status--processing {
  background: #e8f4ec;
  color: var(--pdf-green);
}
.pdf-status--done {
  background: #e8f4ec;
  color: #0d5c2e;
  font-weight: 600;
}
.pdf-status--error {
  background: #fdecea;
  color: #a32;
  font-weight: 600;
}

.pdf-progress {
  height: 8px;
  background: #e0ebe3;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 10px;
  display: none;
}
.pdf-progress.is-on {
  display: block;
}
.pdf-progress > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1a4d2e, #2d8a54);
  transition: width 0.12s ease;
}

.pdf-result {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #cfe8d4;
  background: #f7fcfa;
  display: none;
}
.pdf-result.is-on {
  display: block;
}
.pdf-result .pdf-btn {
  margin-right: 8px;
  margin-top: 6px;
}

.pdf-field {
  margin-bottom: 14px;
}
.pdf-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--pdf-green);
  margin-bottom: 6px;
}
.pdf-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: 8px 0 12px;
  font-size: 14px;
}
.pdf-radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
}

.pdf-estimate {
  font-size: 13px;
  color: var(--pdf-green);
  font-weight: 700;
  margin: 8px 0;
}

.pdf-thumb-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.pdf-thumb {
  width: 120px;
  border: 1px solid var(--pdf-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.pdf-thumb img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}
.pdf-thumb figcaption {
  font-size: 11px;
  padding: 6px;
  text-align: center;
  color: var(--pdf-muted);
}

.pdf-coming {
  padding: 20px;
  text-align: center;
  color: var(--pdf-muted);
  font-size: 14px;
  border: 1px dashed var(--pdf-border);
  border-radius: 12px;
  background: #fafdfb;
}

.pdf-history {
  margin-top: 8px;
}
.pdf-history h2 {
  font-size: 16px;
  color: var(--pdf-green);
  margin: 0 0 12px;
}
.pdf-history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.pdf-history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--pdf-border);
  border-radius: 12px;
  margin-bottom: 8px;
  background: #fff;
  font-size: 13px;
}
.pdf-history-item b {
  color: #1a2e22;
  word-break: break-all;
}
.pdf-history-item small {
  display: block;
  color: var(--pdf-muted);
  margin-top: 4px;
}
.pdf-history-empty {
  color: var(--pdf-muted);
  font-size: 13px;
}

#img2CustomDims {
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

@media (max-width: 640px) {
  .pdf-file-row {
    grid-template-columns: 24px 1fr;
  }
  .pdf-file-remove {
    grid-column: 2;
    justify-self: start;
  }
}
