/* ppt.tuptup.top — 自包含样式，零外部字体/图标依赖 */
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #1c2434;
  --muted: #6b7688;
  --line: #e3e8f0;
  --brand: #4f6bed;
  --brand-2: #7b5cf0;
  --ok: #16a34a;
  --err: #dc2626;
  --shadow: 0 12px 40px rgba(28, 36, 52, .09);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, a { font-family: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }

a { color: var(--brand); text-decoration: none; }

/* ---------- 首页 ---------- */
.wrap { min-height: 100%; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(18px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.82);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 800;
}
.topbar small { color: var(--muted); font-size: 12px; }

.hero {
  width: min(760px, 100%); margin: 0 auto; padding: 46px 18px 64px;
  flex: 1;
}
.intro { text-align: center; margin-bottom: 30px; }
.intro h1 { font-size: clamp(26px, 5vw, 38px); letter-spacing: -.5px; }
.intro p { color: var(--muted); margin-top: 10px; line-height: 1.7; font-size: 15px; }
.badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.badge {
  font-size: 12px; padding: 5px 12px; border-radius: 999px;
  background: #eef1ff; color: var(--brand); border: 1px solid #dfe5ff;
}

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); padding: 26px;
}

.drop-zone {
  border: 2px dashed #cfd7e6; border-radius: 14px; background: #fafbff;
  padding: 38px 20px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop-zone:hover { border-color: var(--brand); background: #f4f6ff; }
.dz-icon {
  width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px;
  background: linear-gradient(135deg, #e8edff, #f1eaff); color: var(--brand);
  display: grid; place-items: center; font-size: 26px; font-weight: 700;
}
.drop-zone .title { font-size: 16px; font-weight: 600; }
.drop-zone .hint { color: var(--muted); font-size: 13px; margin: 8px 0 18px; }

.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(79,107,237,.16); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; }
.btn.block { width: 100%; margin-top: 16px; padding: 13px; font-size: 15px; }
.btn.small { padding: 7px 12px; font-size: 13px; }

.file-card {
  display: flex; align-items: center; gap: 12px; margin-top: 16px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafbff;
}
.file-card .fname { font-weight: 600; font-size: 14px; word-break: break-all; }
.file-card .fmeta { color: var(--muted); font-size: 12px; margin-top: 3px; }

.progress-wrap { margin-top: 16px; }
.progress-track { height: 8px; border-radius: 999px; background: #edf0f7; overflow: hidden; }
#progress-bar { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .2s; }
#progress-text { font-size: 12px; color: var(--muted); margin-top: 7px; }

.result {
  margin-top: 20px; padding: 18px; border-radius: 12px;
  background: #f0fdf4; border: 1px solid #bbf7d0;
}
.result h3 { font-size: 15px; color: #166534; margin-bottom: 10px; }
.result .row { display: flex; gap: 8px; flex-wrap: wrap; }
.result input {
  flex: 1; min-width: 220px; padding: 10px 12px; font-size: 13px;
  border: 1px solid #bbf7d0; border-radius: 9px; background: #fff; color: var(--ink);
}
.result .links { margin-top: 12px; display: flex; gap: 14px; font-size: 13px; flex-wrap: wrap; }

.notes { margin-top: 26px; color: var(--muted); font-size: 13px; line-height: 1.9; }
.notes h3 { color: var(--ink); font-size: 14px; margin-bottom: 8px; }
.notes li { margin-left: 18px; }

.advanced { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.advanced > button {
  background: none; border: 0; color: var(--muted); font-size: 13px; padding: 0;
}
.advanced .body { display: none; margin-top: 12px; }
.advanced.open .body { display: block; }
.advanced .body p { font-size: 12px; color: var(--muted); line-height: 1.7; margin-bottom: 8px; }
.advanced input[type=password] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px;
}

/* ---------- 查看器 ---------- */
.viewer { height: 100%; display: flex; flex-direction: column; background: #eef1f7; }

.viewer-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line);
  min-height: 58px;
}
.doc-info { min-width: 0; }
.doc-info .name { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48vw; }
.doc-info small { color: var(--muted); font-size: 12px; }
.viewer-bar .actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.stage {
  flex: 1; min-height: 0; overflow: auto; padding: 16px;
  display: flex; align-items: flex-start; justify-content: center;
}
.stage > * { box-shadow: 0 8px 30px rgba(28,36,52,.16); background: #fff; flex-shrink: 0; }
.page-canvas { display: block; max-width: none; }
.ppt-slide { position: relative; overflow: hidden; }
.ppt-box { position: absolute; display: flex; align-items: center; overflow: hidden; }
.ppt-box img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ppt-text { width: 100%; white-space: pre-wrap; word-break: break-word; line-height: 1.35; }

.flip-next { animation: slideNext .26s ease-out; }
.flip-prev { animation: slidePrev .26s ease-out; }
@keyframes slideNext { from { transform: translateX(34px); opacity: .25; } to { transform: none; opacity: 1; } }
@keyframes slidePrev { from { transform: translateX(-34px); opacity: .25; } to { transform: none; opacity: 1; } }

.thumb-panel {
  display: none; background: #fff; border-top: 1px solid var(--line);
  padding: 10px 12px; max-height: 168px; overflow-x: auto; overflow-y: hidden;
}
.thumb-panel.open { display: block; }
.thumb-list { display: flex; gap: 10px; }
.thumb {
  flex: 0 0 auto; width: 100px; border: 2px solid transparent; border-radius: 9px;
  background: #f3f5fa; padding: 4px; text-align: center; color: var(--muted);
}
.thumb.active { border-color: var(--brand); background: #eef1ff; color: var(--brand); }
.thumb-body { display: block; height: 66px; overflow: hidden; background: #fff; border-radius: 5px; }
.thumb-body > * { max-width: 100%; height: auto; display: block; border: 0; }
.thumb-num { display: block; font-size: 11px; margin-top: 3px; }

.viewer-controls {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 14px; background: #fff; border-top: 1px solid var(--line); flex-wrap: wrap;
}
.viewer-controls .pager { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.viewer-controls input[type=number] {
  width: 58px; padding: 6px 8px; text-align: center; border: 1px solid var(--line); border-radius: 8px;
}
.viewer-controls .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
#zoom-label { font-size: 12px; color: var(--muted); min-width: 42px; text-align: center; }

/* ---------- 通用状态层 ---------- */
.overlay {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  background: var(--bg); text-align: center; padding: 24px; z-index: 20;
}
.spinner {
  width: 34px; height: 34px; border: 3px solid #dfe5f2; border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay h2 { font-size: 18px; }
.overlay p { color: var(--muted); font-size: 14px; max-width: 460px; line-height: 1.7; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: #1c2434; color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: 86vw; z-index: 40; box-shadow: 0 10px 28px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--err); }

/* ---------- 商业风格增强：更明亮、更有转化感（覆盖上面的基础值） ---------- */
:root {
  --brand: #4f6bed;
  --brand-2: #8b5cf0;
  --shadow: 0 18px 48px rgba(35, 45, 80, .12);
}
body {
  background:
    radial-gradient(900px 420px at 6% -10%, #e7ecff 0%, rgba(231,236,255,0) 70%),
    radial-gradient(760px 380px at 98% 0%, #fff0e4 0%, rgba(255,240,228,0) 70%),
    var(--bg);
}
.topbar { background: rgba(255,255,255,.9); backdrop-filter: blur(12px); }
.topbar small { font-weight: 500; }
.brand-mark { box-shadow: 0 6px 16px rgba(79,107,237,.32); }

.hero { width: min(820px, 100%); }
.intro { margin-bottom: 32px; }
.intro .eyebrow {
  display: inline-block; margin-bottom: 14px; padding: 5px 14px;
  border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 1px;
  color: #7c4bd8; background: #fff; border: 1px solid #e6dcff;
  box-shadow: 0 4px 14px rgba(124,75,216,.1);
}
.intro h1 {
  font-size: clamp(28px, 5.2vw, 42px); font-weight: 800; line-height: 1.26; letter-spacing: -.8px;
  background: linear-gradient(100deg, #3a4fd8, #8b5cf0 55%, #df5a8c);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.intro p { max-width: 640px; margin: 14px auto 0; font-size: 15.5px; color: #53617c; }
.badges { margin-top: 20px; }
.badge {
  background: #fff; color: #4257c7; border: 1px solid #dde4ff;
  font-weight: 600; box-shadow: 0 3px 10px rgba(60,80,180,.06);
}

.card { border-radius: 22px; padding: 28px; border-color: #e6eaf6; }
.drop-zone { background: linear-gradient(160deg, #f8faff, #fdf7ff); border-color: #cbd5f5; padding: 40px 20px; }
.drop-zone:hover { border-color: #8b5cf0; background: linear-gradient(160deg, #f1f5ff, #fbf2ff); }
.dz-icon { background: linear-gradient(135deg, #4f6bed, #a855f7); color: #fff; box-shadow: 0 10px 24px rgba(110,90,235,.28); }
.drop-zone .title { font-size: 17px; font-weight: 700; }
.drop-zone .hint { color: #64708a; }

.btn.primary {
  background: linear-gradient(100deg, #4f6bed, #8b5cf0 58%, #a855f7);
  box-shadow: 0 10px 24px rgba(96,80,230,.26);
}
.btn.primary:hover:not(:disabled) { box-shadow: 0 14px 30px rgba(96,80,230,.36); }
.btn.block { padding: 15px; font-size: 16px; font-weight: 700; letter-spacing: .3px; }

.result { background: linear-gradient(135deg, #f0fdf4, #eff6ff); border-color: #c7ecd8; }
.result h3 { font-size: 16px; }

.notes {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 22px 26px; box-shadow: 0 8px 28px rgba(35,45,80,.05);
  font-size: 13.5px; color: #53617c;
}
.notes h3 { font-size: 16px; margin-bottom: 12px; color: var(--ink); }
.notes ul { list-style: none; }
.notes li { margin: 0 0 8px; padding-left: 24px; position: relative; }
.notes li::before { content: "✓"; position: absolute; left: 0; top: 0; color: #16a34a; font-weight: 800; }

/* 旧的手工凭证面板已下线；缓存的旧页面里也不再显示 */
.advanced { display: none; }

@media (max-width: 600px) {
  .hero { padding: 28px 14px 48px; }
  .card { padding: 18px; }
  .viewer-bar .actions .btn.small { padding: 6px 9px; font-size: 12px; }
  .doc-info .name { max-width: 40vw; }
  .viewer-controls { gap: 6px; }
}
