:root {
  --text: #1f2937;
  --sub: #667085;
  --line: #dbe1f5;
  --panel: #ffffff;
  --brand: #4b5ad9;
  --brand-2: #764ba2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 22px 14px 44px;
}

.title {
  margin: 0 0 8px;
  font-size: 30px;
  text-align: center;
  color: #fff;
}

.subtitle {
  margin: 0 0 18px;
  color: #ecebff;
  text-align: center;
}

.panel {
  background: var(--panel);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  background: #fff;
  color: #263247;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(75, 90, 217, 0.15); }
.btn.primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  border-color: transparent;
  color: #fff;
}
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }

label.btn input {
  margin-left: 6px;
  border: 1px solid #ccd4ee;
  border-radius: 8px;
  padding: 4px 6px;
  background: #f8faff;
}

.dropzone {
  border: 2px dashed #97a7ff;
  background: #f7f9ff;
  border-radius: 14px;
  padding: 28px 14px;
  text-align: center;
  color: #5e6f98;
  margin-bottom: 14px;
}
.dropzone.drag {
  border-color: #4b5ad9;
  background: #eef2ff;
}

.small {
  color: #667085;
  font-size: 13px;
}

.log {
  margin-top: 14px;
  background: #0b1020;
  color: #d1d5db;
  border-radius: 12px;
  padding: 12px;
  min-height: 96px;
  max-height: 280px;
  overflow: auto;
  font-family: Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.card {
  background: #fff;
  border: 1px solid #e8ecfb;
  border-radius: 14px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: .2s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: #cfd8ff;
  box-shadow: 0 12px 28px rgba(75, 90, 217, .15);
}
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--sub); font-size: 14px; line-height: 1.4; }

select {
  width: 100%;
  margin: 12px 0;
  border: 1px solid #dce3f8;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

@media (max-width: 930px) {
  .container { padding: 16px 10px 28px; }
  .title { font-size: 24px; }
  .subtitle { font-size: 14px; margin-bottom: 12px; }
  .panel { border-radius: 14px; padding: 14px; }
}

/* PDF 工具统一左侧导航（与主站工具页保持一致） */
.pdf-layout {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-areas: "sidebar main";
  gap: 18px;
  align-items: start;
  padding: 16px 10px 36px;
}

.pdf-sidebar {
  grid-area: sidebar;
  padding: 16px;
  position: sticky;
  top: 16px;
}

.pdf-main {
  grid-area: main;
  min-width: 0;
}

.pdf-sidebar .brand {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #4b5ad9;
}
.pdf-sidebar .desc {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 14px;
}
.pdf-sidebar .jump-home {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  background: #4b5ad9;
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
  margin-bottom: 14px;
}
.pdf-sidebar .group-title {
  font-size: 13px;
  color: #666;
  margin: 12px 0 8px;
}
.tool-nav {
  list-style: none;
  display: grid;
  gap: 8px;
}
.tool-link {
  display: block;
  border: 1px solid #ececf2;
  border-radius: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
}
.tool-link .nav-short { display: none; }
.tool-link.active {
  border-color: #4b5ad9;
  background: #eef1ff;
  color: #3747c7;
  font-weight: 600;
}

.mobile-topbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 40;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.mobile-topbar .nav-back {
  flex: 0 0 auto;
  text-decoration: none;
  color: #4b5ad9;
  font-weight: 600;
  font-size: 14px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #eef1ff;
}
.mobile-topbar .nav-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-topbar .nav-more {
  flex: 0 0 auto;
  border: 1px solid #d6daf5;
  background: #fff;
  color: #4b5ad9;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.nav-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
}
.nav-sheet.open { display: flex; }
.nav-sheet-panel {
  width: 100%;
  max-height: min(72vh, 520px);
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  overflow: auto;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
}
.nav-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
  font-weight: 700;
  color: #333;
}
.nav-sheet-close {
  border: none;
  background: #f3f4f6;
  color: #333;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 930px) {
  body { padding-top: calc(56px + env(safe-area-inset-top, 0px)); }
  .mobile-topbar { display: flex; }
  .pdf-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
    padding: 6px 4px 22px;
  }
  .pdf-sidebar { display: none; }
}
