:root {
  --rose: #C4A5A0;
  --rose-deep: #A9837D;
  --warm: #FAFAF8;
  --ink: #2B2624;
  --ink-soft: #6B615C;
  --line: #E5DCD8;
  --ok: #4E7A51;
  --err: #B0483F;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: var(--warm);
  color: var(--ink);
  min-height: 100vh;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 44px 32px 40px; }

/* ---------- 头部 ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 34px; gap: 16px; flex-wrap: wrap; }
.brand h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 44px; font-weight: 700; letter-spacing: .5px;
}
.brand .arrow { color: var(--rose); margin: 0 6px; }
.sub { color: var(--ink-soft); font-size: 14px; margin-top: 6px; }
.head-right { display: flex; align-items: center; gap: 12px; }
.badge {
  font-size: 12px; font-weight: 600; color: var(--rose-deep);
  border: 1.5px solid var(--rose); border-radius: 999px; padding: 4px 14px;
  white-space: nowrap;
}

/* ---------- 拖放区 ---------- */
.drop {
  border: 2.5px dashed var(--rose);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.drop:hover, .drop.dragover {
  background: #F6EEEC;
  border-color: var(--rose-deep);
  transform: translateY(-1px);
}
.drop-inner { padding: 56px 24px 48px; text-align: center; }
.ico { width: 56px; height: 56px; margin-bottom: 14px; }
.drop-title { font-size: 19px; font-weight: 600; }
.drop-hint { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
.drop.busy { pointer-events: none; opacity: .55; }

/* 样本速选 */
.sample-bar { margin-top: 22px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.sample-label { font-size: 13px; color: var(--ink-soft); }
.chip {
  background: #fff; border: 1.5px solid var(--rose); color: var(--rose-deep);
  font-family: 'Consolas', 'Segoe UI', monospace; font-size: 12.5px; font-weight: 600;
  padding: 5px 14px; border-radius: 999px; cursor: pointer;
  transition: background .15s, color .15s;
}
.chip:hover { background: var(--rose); color: #fff; }

/* ---------- 演示提示条 ---------- */
.notice {
  margin-top: 18px; display: flex; align-items: center; gap: 10px;
  background: #F6EEEC; border: 1px solid #EAD9D6; border-radius: 10px;
  padding: 12px 18px; font-size: 13px; color: var(--ink-soft);
}
.notice b { color: var(--rose-deep); font-weight: 600; }
.notice .dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--rose); }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 18px);
  background: var(--ink); color: #fff;
  font-size: 13.5px; line-height: 1.4;
  padding: 11px 20px; border-radius: 9px;
  max-width: min(760px, 86vw);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 99;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 翻译队列 ---------- */
.files { margin-top: 26px; }
.files-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.files-title { font-size: 15px; font-weight: 600; }
.files-title .count { color: var(--ink-soft); font-weight: 400; font-size: 13px; margin-left: 6px; }
.btn-ghost {
  background: none; border: 1.5px solid var(--rose); color: var(--rose-deep);
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 16px; border-radius: 8px; cursor: pointer;
  transition: background .15s;
}
.btn-ghost:hover { background: #F6EEEC; }

.file-row {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 18px; margin-bottom: 8px;
}
.file-row[data-state="done"] { border-color: #CFE0D0; }
.file-row[data-state="fail"] { border-color: #E5C4C0; background: #FBF3F2; }
.f-name {
  flex: 0 1 300px; min-width: 120px;
  font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  direction: ltr;
}
.f-state { flex: 1; font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row[data-state="done"] .f-state { color: var(--ok); }
.file-row[data-state="fail"] .f-state { color: var(--err); }
.f-state .stage-dots::after { content: '···'; animation: dots 1.2s infinite; letter-spacing: 2px; }
@keyframes dots { 0% { content: '·'; } 50% { content: '··'; } 100% { content: '···'; } }
.f-bar {
  flex: 0 0 140px; height: 8px; background: #EFE7E4;
  border-radius: 5px; overflow: hidden;
}
.f-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--rose), var(--rose-deep));
  border-radius: 5px; transition: width .35s ease;
}
.file-row[data-state="done"] .f-fill { background: var(--ok); }
.file-row[data-state="fail"] .f-fill { background: var(--err); }
.f-acts { display: flex; gap: 8px; }
.btn-mini {
  background: #fff; border: 1.5px solid var(--rose); color: var(--rose-deep);
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  padding: 6px 14px; border-radius: 7px; cursor: pointer;
  transition: background .15s;
}
.btn-mini:hover { background: #F6EEEC; }
.btn-mini-p { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn-mini-p:hover { background: var(--rose-deep); }

/* ---------- 对照预览 ---------- */
.preview-section { margin-top: 26px; }
.preview-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.preview-title { font-size: 15px; font-weight: 600; }
.preview-title .pv-file { font-family: 'Consolas', monospace; color: var(--rose-deep); font-size: 13.5px; margin-left: 8px; }
.pv-ctl { display: flex; align-items: center; gap: 8px; }
.pv-page { font-size: 13px; color: var(--ink-soft); min-width: 64px; text-align: center; }
.pv-zoom { font-size: 12.5px; color: var(--ink-soft); min-width: 44px; text-align: center; }
.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pane {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column;
}
.pane-cap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 16px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
}
.pane-cap .tag-en { color: var(--ink-soft); }
.pane-cap .tag-cn { color: var(--rose-deep); }
.pane-body { overflow: auto; max-height: 760px; padding: 12px; background: #F2EFEC; }
.pane-body img { display: block; width: 100%; height: auto; border: 1px solid #E8E1DD; border-radius: 4px; box-shadow: 0 1px 4px rgba(43,38,36,.08); cursor: zoom-in; }

/* ---------- 术语库抽屉 ---------- */
#drawer-mask {
  position: fixed; inset: 0; background: rgba(43,38,36,.28);
  opacity: 0; pointer-events: none; transition: opacity .22s; z-index: 60;
}
#drawer-mask.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(480px, 94vw);
  background: var(--warm); border-left: 1px solid var(--line);
  transform: translateX(102%); transition: transform .25s ease;
  z-index: 61; display: flex; flex-direction: column;
}
.drawer.show { transform: translateX(0); }
.drawer-head {
  padding: 20px 22px 14px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-title { font-size: 16px; font-weight: 700; }
.drawer-title .count { font-size: 12.5px; color: var(--rose-deep); font-weight: 600; margin-left: 8px; }
.drawer-sub { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.drawer-close {
  background: none; border: none; font-size: 22px; color: var(--ink-soft);
  cursor: pointer; line-height: 1; padding: 4px 8px;
}
.drawer-close:hover { color: var(--ink); }
.drawer-tools { padding: 14px 22px 4px; }
.search-box {
  width: 100%; border: 1.5px solid var(--line); border-radius: 9px;
  padding: 9px 14px; font-size: 13.5px; font-family: inherit;
  outline: none; background: #fff; color: var(--ink);
  transition: border-color .15s;
}
.search-box:focus { border-color: var(--rose); }
.cat-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.cat-chip {
  background: #fff; border: 1px solid var(--line); color: var(--ink-soft);
  font-size: 12px; font-family: inherit; padding: 4px 12px; border-radius: 999px;
  cursor: pointer; transition: all .15s;
}
.cat-chip:hover { border-color: var(--rose); color: var(--rose-deep); }
.cat-chip.on { background: var(--rose); border-color: var(--rose); color: #fff; }
.drawer-list { flex: 1; overflow: auto; padding: 10px 22px 22px; }
.gl-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 9px 2px; border-bottom: 1px dashed var(--line);
}
.gl-en {
  flex: 0 0 42%; font-family: 'Consolas', monospace; font-size: 12.5px;
  color: var(--ink); direction: ltr; overflow-wrap: break-word;
}
.gl-zh {
  flex: 1; font-size: 13px; color: var(--ink);
  outline: none; border-radius: 4px; padding: 1px 4px;
}
.gl-zh:focus { background: #F6EEEC; box-shadow: 0 0 0 1.5px var(--rose); }
.gl-zh.edited { color: var(--rose-deep); font-weight: 600; }
.gl-note { font-size: 11px; color: var(--ink-soft); display: block; margin-top: 2px; }

/* ---------- 页脚 ---------- */
.foot { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 18px; }
.foot p { font-size: 12.5px; color: var(--ink-soft); line-height: 1.7; }
.foot .sep { margin: 0 6px; color: var(--rose); }

.hidden { display: none !important; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .wrap { padding: 28px 16px 32px; }
  .brand h1 { font-size: 32px; }
  .preview-grid { grid-template-columns: 1fr; }
  .file-row { flex-wrap: wrap; row-gap: 10px; }
  .f-name { flex: 1 1 100%; }
  .f-state { flex: 1 1 100%; }
  .pane-body { max-height: 520px; }
}
