/* ==========================================================================
   图片转PDF在线工具 - 样式表
   专业简洁风格，PC / 移动端响应式适配
   ========================================================================== */

/* ---------- 基础变量与重置 ---------- */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #0ea5e9;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --danger: #dc2626;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --bg: #f5f7fb;
  --card: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 8px 30px rgba(15, 23, 42, .12);
  --header-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

section[id] { scroll-margin-top: calc(var(--header-h) + 12px); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  transition: all .18s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, .4);
  color: #fff;
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  background: #b9c4d6;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-lg { padding: 14px 46px; font-size: 17px; border-radius: 10px; }

.btn-ghost {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
  padding: 7px 16px;
  font-size: 14px;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger-ghost:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}
.logo svg { width: 26px; height: 26px; color: var(--primary); }
.logo:hover { color: var(--primary); }

.main-nav { display: flex; gap: 26px; }
.main-nav a {
  font-size: 15px;
  color: var(--text-light);
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: all .15s;
}
.main-nav a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ---------- 首屏 Hero ---------- */
.hero {
  padding: 56px 0 40px;
  text-align: center;
  background: linear-gradient(160deg, #eff6ff 0%, #f5f7fb 55%, #e0f2fe 100%);
}

.hero h1 {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(120deg, var(--primary-dark), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--primary-dark);
}

.hero-sub {
  max-width: 660px;
  margin: 14px auto 0;
  font-size: 16px;
  color: var(--text-light);
}
.hero-sub strong { color: var(--text); }

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}
.badge {
  padding: 5px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-light);
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
}

/* ---------- 工具卡片 ---------- */
.tool-section { padding: 36px 0 60px; }

.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
}

/* 上传区 */
.dropzone {
  border: 2px dashed #c3cfe0;
  border-radius: var(--radius);
  background: #fafbff;
  padding: 52px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
}
.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.dropzone.compact { padding: 26px 24px; }
.dropzone.compact .dropzone-icon svg { width: 34px; height: 34px; }

.dropzone-icon { color: var(--primary); margin-bottom: 12px; }
.dropzone-icon svg { width: 52px; height: 52px; margin: 0 auto; }

.dropzone-title { font-size: 18px; font-weight: 600; }
.dropzone-title em {
  font-style: normal;
  color: var(--primary);
  border-bottom: 1px dashed var(--primary);
}
.dropzone-hint { margin-top: 8px; font-size: 14px; color: var(--text-light); }
.dropzone-limit { margin-top: 4px; font-size: 12px; color: #9ca3af; }

/* 工具栏 */
.tool-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}
.count-info { font-size: 14px; font-weight: 600; color: var(--primary-dark); }
.toolbar-btns { display: flex; gap: 10px; }

/* 图片列表 */
.image-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.image-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: grab;
  transition: box-shadow .15s, border-color .15s;
}
.image-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.image-item.dragging { opacity: .45; cursor: grabbing; }

.image-item .thumb {
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}
.image-item .thumb img { width: 100%; height: 100%; object-fit: cover; }

.image-item .meta { flex: 1; min-width: 0; }
.image-item .name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.image-item .size { font-size: 12px; color: var(--text-light); }

.image-item .ops { display: flex; flex-direction: column; gap: 2px; }
.image-item .ops button {
  width: 26px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: var(--text-light);
  transition: all .15s;
}
.image-item .ops button:hover:not(:disabled) { background: var(--primary-light); color: var(--primary); }
.image-item .ops button[data-op="del"]:hover { background: #fef2f2; color: var(--danger); }
.image-item .ops button:disabled { opacity: .3; cursor: not-allowed; }
.image-item .ops svg { width: 15px; height: 15px; }

.list-tip { margin-top: 10px; font-size: 13px; color: var(--text-light); }

/* 设置面板 */
.options { margin-top: 24px; }
.options-title {
  font-size: 17px;
  font-weight: 700;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.option-item { display: flex; flex-direction: column; gap: 6px; }
.option-label { font-size: 13px; font-weight: 600; color: var(--text-light); }

.option-item select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  transition: border-color .15s;
}
.option-item select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.option-item select:disabled { background: #f3f4f6; color: #9ca3af; cursor: not-allowed; }

/* 转换按钮区 */
.convert-area { text-align: center; margin-top: 26px; }
.usage-note { margin-top: 10px; font-size: 13px; color: var(--text-light); }

/* 进度条 */
.progress-wrap { margin-top: 22px; }
.progress-track {
  height: 10px;
  border-radius: 999px;
  background: #e8edf5;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .25s ease;
}
.progress-text { margin-top: 8px; text-align: center; font-size: 13px; color: var(--text-light); }

/* 结果区 */
.result-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding: 18px 20px;
  background: var(--success-bg);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
}
.result-info { display: flex; align-items: center; gap: 10px; color: var(--success); }
.result-info svg { width: 24px; height: 24px; flex: none; }
.result-info p { font-size: 15px; font-weight: 600; color: #15803d; }

/* 隐私提示 */
.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
}
.privacy-note svg { width: 16px; height: 16px; color: var(--success); flex: none; }

/* ---------- 通用 Section ---------- */
.section { padding: 64px 0; }
.section:nth-of-type(even) { background: #fff; }

.section h2 {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
}
.section-sub {
  margin: 10px auto 36px;
  text-align: center;
  color: var(--text-light);
  font-size: 15px;
}

/* 卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #c9d8f5;
}
.card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--text-light); }

.card-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  margin-bottom: 14px;
}
.card-icon svg { width: 24px; height: 24px; }

.features { background: var(--bg); }

.scenario-card { border-left: 4px solid var(--primary); }

/* ---------- 使用步骤 ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  counter-reset: step;
}

.step {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px 24px;
  text-align: center;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 14px;
}
.step h3 { font-size: 17px; margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--text-light); }

.help-extra {
  margin-top: 28px;
  padding: 20px 24px;
  background: var(--primary-light);
  border-radius: var(--radius);
  font-size: 14px;
}
.help-extra h3 { font-size: 15px; margin-bottom: 4px; }
.help-extra p { color: var(--text-light); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 780px; margin: 0 auto; }

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color .15s;
}
.faq-item[open] { border-color: var(--primary); }

.faq-item summary {
  position: relative;
  padding: 16px 46px 16px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  line-height: 20px;
  text-align: center;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
  transition: transform .2s;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p {
  padding: 0 20px 18px;
  font-size: 14px;
  color: var(--text-light);
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: #111827;
  color: #9ca3af;
  padding: 48px 0 0;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 36px;
}

.footer-col h3 {
  color: #fff;
  font-size: 16px;
  margin-bottom: 14px;
}
.footer-about p { line-height: 1.8; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a { color: #9ca3af; }
.footer-col ul a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid #263248;
  padding: 18px 0;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
}

/* ---------- Toast 提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(16px);
  max-width: 90vw;
  padding: 12px 22px;
  background: rgba(17, 24, 39, .92);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 999;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 移动端适配 ---------- */
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: span 2; }
}

@media (max-width: 768px) {
  body { font-size: 15px; }

  .main-nav { gap: 14px; }
  .main-nav a { font-size: 13px; }
  .logo span { font-size: 17px; }

  .hero { padding: 40px 0 28px; }
  .hero h1 { font-size: 28px; }
  .hero-sub { font-size: 14px; }

  .tool-card { padding: 18px; }
  .dropzone { padding: 36px 14px; }
  .dropzone.compact { padding: 20px 14px; }
  .dropzone-title { font-size: 15px; }
  .dropzone-hint { font-size: 12px; }

  .tool-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-btns { justify-content: center; }

  .image-list { grid-template-columns: 1fr; }
  .image-item .ops { flex-direction: row; }
  .image-item .ops button { width: 30px; height: 28px; }

  .options-grid { grid-template-columns: 1fr 1fr; }

  .btn-lg { width: 100%; }

  .result-box { flex-direction: column; text-align: center; }
  .result-box .btn { width: 100%; }

  .section { padding: 46px 0; }
  .section h2 { font-size: 23px; }

  .card-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-about { grid-column: span 1; }
}

@media (max-width: 480px) {
  .main-nav { display: none; }
  .header-inner { justify-content: center; }
  .options-grid { grid-template-columns: 1fr; }
  .hero-badges { gap: 6px; }
  .badge { font-size: 12px; padding: 4px 10px; }
}
