:root {
  --bg: #0c0a16; --panel: #16132a; --panel-2: #1d1938; --line: rgba(255,255,255,.08);
  --text: #ece9f8; --muted: #9a95b8; --accent: #6366f1; --accent-2: #ec4899;
  --grad: linear-gradient(135deg,#6366f1,#ec4899);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 -apple-system, "PingFang SC", system-ui, sans-serif;
  word-break: keep-all;
}
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px; background: rgba(12,10,22,.92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.bar .logo { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); }
.bar .spacer { flex: 1; }
.field { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.field select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; }
.ghost { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px; cursor: pointer; font-size: 13px; }
.ghost:hover { background: var(--panel-2); border-color: var(--accent); }
.status { font-size: 13px; color: var(--muted); white-space: nowrap; }

.drop { padding: 60px 22px; display: flex; justify-content: center; }
.drop.hidden { display: none; }
.drop-inner {
  border: 2px dashed var(--line); border-radius: 18px; padding: 54px 70px;
  text-align: center; color: var(--muted); max-width: 560px;
}
.drop.over .drop-inner { border-color: var(--accent); background: rgba(99,102,241,.06); }
.drop-icon { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 14px; background: var(--grad); opacity: .9; }
.drop .link { color: var(--accent-2); cursor: pointer; text-decoration: underline; }
.drop small { display: block; margin-top: 10px; font-size: 12px; opacity: .8; }

.pages { padding: 24px; display: flex; flex-direction: column; gap: 26px; align-items: center; }
.page-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  width: 100%; max-width: 1500px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; align-items: start;
}
.page-canvas-wrap { position: relative; }
.page-row canvas { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.4); background: #fff; }
.page-num { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.trans-col { display: flex; flex-direction: column; gap: 12px; }
.tblock {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  text-wrap: pretty; line-height: 1.75;
}
.tblock .tt { font-size: 15px; }
.tblock .to { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: none; }
.tblock.show-orig .to { display: block; }
.tblock .tt.loading { color: var(--muted); font-style: italic; }
.trans-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.trans-head .toggle-orig { font-size: 12px; color: var(--accent); cursor: pointer; }
.err { color: #f87171; }
.num { white-space: nowrap; }
