:root {
  --page-bg: #e9e9e9;
  --white: #ffffff;
  --text: #232323;
  --toolbar: #3d3d3d;
  --toolbar-2: #2f2f2f;
  --viewer: #303030;
  --blue: #1677ff;
  --blue-dark: #0067e6;
  --shadow: 0 10px 28px rgba(0, 0, 0, .26);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; background: var(--page-bg); color: var(--text); }
button { font: inherit; border: 0; background: none; cursor: pointer; }

.app-shell {
  width: min(100%, 430px);
  height: 100vh;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pdf-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--viewer);
}
.pdf-toolbar {
  height: 47px;
  flex: 0 0 auto;
  background: linear-gradient(#424242, #343434);
  color: #f1f1f1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid rgba(0,0,0,.35);
}
.tool-left, .tool-right { display: flex; align-items: center; gap: 17px; }
.mini-icon { width: 18px; height: 18px; display: inline-block; opacity: .9; position: relative; }
.split { border: 2px solid #ddd; border-radius: 2px; }
.split::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 2px solid #ddd; }
.toolbar-search {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  color: rgba(242,242,242,.86);
  opacity: .96;
}
.toolbar-search svg {
  width: 22px;
  height: 22px;
  display: block;
  overflow: visible;
}
.toolbar-search circle,
.toolbar-search path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}.page-box { min-width: 84px; height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 16px; color: #eee; }
.page-box b { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); min-width: 44px; height: 32px; display: grid; place-items: center; border-radius: 4px; font-weight: 400; }
.zoom-btn { color: #f5f5f5; font-size: 25px; line-height: 1; padding: 2px 0; }
.toolbar-close {
  width: 35px;
  height: 35px;
  padding: 0;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.88);
  opacity: .96;
  transition: transform .15s ease, opacity .15s ease;
}
.toolbar-close:active { transform: scale(.94); opacity: .78; }
.toolbar-close svg { width: 35px; height: 35px; display: block; }
.toolbar-close circle { fill: rgba(255,255,255,.07); stroke: rgba(255,255,255,.68); stroke-width: 1.8; }
.toolbar-close path { fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; }

.viewer-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background:
    radial-gradient(circle at 20% 8%, rgba(255,255,255,.04), transparent 22%),
    linear-gradient(90deg, #303030, #343434 48%, #303030);
  padding: 13px 15px 26px;
  scroll-behavior: smooth;
}
.pdf-pages { display: grid; gap: 18px; justify-items: center; }
.pdf-page {
  width: calc(100% * var(--page-zoom, 1));
  max-width: 360px;
  background: #fff;
  box-shadow: var(--shadow);
  border-radius: 1px;
  overflow: hidden;
}
.pdf-page img { display: block; width: 100%; height: auto; }
.loading { color: rgba(255,255,255,.82); text-align: center; padding: 38px 10px; font-size: 14px; }

.bottom-actions {
  height: calc(84px + env(safe-area-inset-bottom));
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  background: var(--white);
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 12px;
  align-items: center;
  border-top: 1px solid rgba(0,0,0,.05);
}
.plain-action, .primary-action {
  height: 52px;
  border-radius: 2px;
  font-size: 18px;
  font-weight: 520;
}
.plain-action { color: #1d65c1; background: #fff; }
.primary-action { color: #fff; background: var(--blue); }
.primary-action:active { background: var(--blue-dark); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(102px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  background: rgba(0,0,0,.78);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 20;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 700px) {
  body { background: #e9e9e9; }
  .app-shell { box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 18px 80px rgba(0,0,0,.16); }
  .pdf-page { max-width: 365px; }
}

@media (max-width: 360px) {
  .viewer-wrap { padding-left: 10px; padding-right: 10px; }
  .bottom-actions { grid-template-columns: .9fr 1.45fr; }
  .plain-action, .primary-action { font-size: 16px; }
  .tool-left, .tool-right { gap: 12px; }
}

