/* ============ 基础 ============ */
:root {
  --brand: #4f46e5;
  --brand-2: #6366f1;
  --brand-soft: #eef0ff;
  --ink: #1c2333;
  --ink-2: #5b6478;
  --ink-3: #8a93a8;
  --line: #e3e7f0;
  --bg: #f5f7fc;
  --card: #ffffff;
  --ok: #12805c;
  --err: #c0352e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 32, 70, .05), 0 8px 24px -12px rgba(23, 32, 70, .12);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
}
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); font-weight: 400; }
b { font-weight: 600; }
u { text-decoration: underline; text-underline-offset: 3px; }

/* ============ 顶栏 ============ */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; filter: drop-shadow(0 2px 4px rgba(79,70,229,.35)); }
.brand h1 { margin: 0; font-size: 21px; letter-spacing: .5px; line-height: 1.25; }
.tagline { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.langswitch {
  display: inline-flex; background: #eef1f8; border-radius: 9px; padding: 3px; gap: 2px;
}
.langswitch button {
  border: none; background: transparent; color: var(--ink-2);
  font: inherit; font-size: 12.5px; font-weight: 500;
  padding: 4px 10px; border-radius: 7px; cursor: pointer; transition: all .12s;
}
.langswitch button:hover { color: var(--brand); }
.langswitch button.on { background: #fff; color: var(--brand); font-weight: 700; box-shadow: 0 1px 3px rgba(23,32,70,.15); }
.privacy-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--ok);
  background: #e7f6f0; border: 1px solid #bfe6d8;
  padding: 6px 12px; border-radius: 999px; font-weight: 500;
}
.privacy-pill .lock { font-size: 12px; }

/* ============ 介绍与页签 ============ */
.hero {
  background: linear-gradient(180deg, #fff, #f8f9ff);
  border: 1px solid var(--line); border-top: none;
  margin: 0 0 22px; padding: 18px 22px;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 14.5px; color: var(--ink-2);
}
.hero b { color: var(--ink); }

.tooltabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin: 0 0 18px;
}
.tooltab {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; cursor: pointer;
  font: inherit; color: var(--ink); transition: all .15s ease;
  box-shadow: var(--shadow);
}
.tooltab:hover { border-color: #c7cdff; transform: translateY(-1px); }
.tooltab.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.tt-num {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: #e6e9f7; color: var(--ink-2); font-weight: 700; font-size: 14px;
}
.tooltab.on .tt-num { background: var(--brand); color: #fff; }
.tt-body b { display: block; font-size: 15px; line-height: 1.3; }
.tt-body small { color: var(--ink-3); font-size: 12px; line-height: 1.3; display: block; }

/* ============ 面板 ============ */
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px 20px;
  box-shadow: var(--shadow); margin-bottom: 22px;
}
.panel-head h2 { margin: 0 0 4px; font-size: 18px; }
.panel-head p { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; }
.panel-head .hint { color: var(--ink-3); font-size: 13px; margin-top: 6px; }

/* ============ 拖放区 ============ */
.dropzone {
  border: 2px dashed #c9cfe6; border-radius: var(--radius);
  background: #fafbff; padding: 30px 20px; text-align: center;
  cursor: pointer; transition: all .15s ease; user-select: none;
}
.dropzone:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.dropzone.drag { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.005); }
.dz-icon { display: block; margin: 0 auto 6px; opacity: .9; }
.dz-main { font-size: 15px; color: var(--ink); }
.dz-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

/* ============ 文件清单（合并用） ============ */
.filelist { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fl-head, .filerow {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 8px;
  padding: 8px 12px; font-size: 13px;
}
.fl-head { background: #f4f6fc; color: var(--ink-3); font-weight: 600; border-bottom: 1px solid var(--line); }
.filerow { border-top: 1px solid #eef1f8; background: #fff; }
.filerow:first-of-type { border-top: none; }
.f-idx { text-align: center; color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 600; }
.f-name { min-width: 0; }
.f-title { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-meta { color: var(--ink-3); font-size: 12px; }
.f-meta .bad { color: var(--err); }
.f-actions { display: flex; gap: 6px; }
.btn-icon {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 14px; line-height: 1; display: grid; place-items: center;
  transition: all .12s ease;
}
.btn-icon:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.btn-icon:disabled { opacity: .35; cursor: default; }
.btn-icon.del:hover { border-color: var(--err); color: var(--err); background: #fdf0ef; }

/* 单文件卡片（水印 / 抽页） */
.filecard {
  margin-top: 14px; display: flex; align-items: center; gap: 10px;
  background: #f6f8fe; border: 1px solid #dfe4f5; border-radius: 10px; padding: 10px 14px;
  font-size: 13.5px;
}
.filecard .fc-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filecard .fc-meta { color: var(--ink-3); flex: none; }

/* ============ 配置区 ============ */
.cfg { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.field label { display: flex; align-items: baseline; justify-content: space-between; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--ink); }
.field .val { color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

input[type="text"], .pages-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 14px; color: var(--ink); background: #fff; transition: border .12s;
}
input[type="text"]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.pages-input:disabled { background: #f6f7fb; color: var(--ink-3); }

.row { display: flex; gap: 8px; align-items: center; }
.row input { flex: 1; }
.row .suffix { color: var(--ink-3); font-size: 14px; flex: none; }

input[type="range"] { width: 100%; accent-color: var(--brand); margin: 4px 0; }

/* 快捷 chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 999px; padding: 4px 12px; font-size: 12.5px; cursor: pointer;
  font: inherit; transition: all .12s;
}
.chip:hover { border-color: var(--brand-2); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }

/* 分段选择 */
.seg { display: inline-flex; flex-wrap: wrap; background: #eef1f8; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  border: none; background: transparent; color: var(--ink-2);
  font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  transition: all .12s; white-space: nowrap;
}
.seg button.on { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(23,32,70,.15); }

/* 水印实时预览 */
.wm-preview { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.wm-preview canvas { display: block; width: 100%; height: auto; }

.hint { font-size: 12.5px; color: var(--ink-3); margin: 6px 0 0; }
.hint.ok { color: var(--ok); }
.hint.err { color: var(--err); }

/* ============ 操作行 ============ */
.actions { margin-top: 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.btn {
  border: none; border-radius: 11px; padding: 12px 26px; font: inherit; font-size: 15.5px; font-weight: 600;
  cursor: pointer; transition: all .14s ease; letter-spacing: 1px;
}
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px rgba(79,70,229,.55); }
.btn.primary:hover:not(:disabled) { background: #4338ca; transform: translateY(-1px); }
.btn.primary:disabled { background: #b9bdd6; cursor: not-allowed; box-shadow: none; }
.btn:active:not(:disabled) { transform: translateY(0); }
.status { margin: 0; font-size: 13px; color: var(--ink-3); }
.status.busy { color: var(--brand); font-weight: 500; }
.status.ok { color: var(--ok); font-weight: 500; }
.status.err { color: var(--err); font-weight: 500; }
.spin {
  display: inline-block; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid #c7cdff; border-top-color: var(--brand);
  animation: rot .7s linear infinite; vertical-align: -2px; margin-right: 6px;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* ============ 隐私 / FAQ ============ */
.notes { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; box-shadow: var(--shadow); margin-bottom: 22px; }
.notes h2 { margin: 0 0 12px; font-size: 17px; }
.notes dl { margin: 0; }
.notes dt { font-weight: 600; margin-top: 14px; font-size: 14.5px; }
.notes dt:first-of-type { margin-top: 0; }
.notes dd { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }

.foot { border-top: 1px solid var(--line); background: var(--card); padding: 18px 0 26px; }
.foot p { margin: 0; text-align: center; color: var(--ink-3); font-size: 12.5px; }

/* ============ Toast ============ */
.toastwrap { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #1f2738; color: #fff; font-size: 13.5px;
  padding: 10px 18px; border-radius: 10px; box-shadow: 0 10px 30px -8px rgba(0,0,0,.35);
  max-width: min(86vw, 560px); animation: toastin .18s ease; text-align: center;
}
.toast.err { background: #7f1d1d; }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.ns { padding: 16px 20px; text-align: center; background: #fff3cd; }

@media (max-width: 720px) {
  .tooltabs { grid-template-columns: 1fr; }
  .privacy-pill { order: 3; }
  .topbar-in { padding: 12px 14px; }
  .panel { padding: 16px 14px; }
}
