/* PrivatePDF — 私密PDF工具箱 design system */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f0f1f7;
  --border: #e4e6ef;
  --text: #171a26;
  --muted: #616880;
  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --primary-soft: #eef0ff;
  --on-primary: #ffffff;
  --danger: #dc2626;
  --ok: #059669;
  --shadow: 0 1px 2px rgba(23, 26, 38, .05), 0 8px 24px -12px rgba(23, 26, 38, .12);
  --shadow-lg: 0 12px 40px -12px rgba(23, 26, 38, .22);
  --radius: 16px;
  --radius-sm: 10px;
}
html.dark {
  --bg: #0e1016;
  --surface: #161923;
  --surface-2: #1d2130;
  --border: #262b3d;
  --text: #e8eaf2;
  --muted: #9aa1b9;
  --primary: #6d64ff;
  --primary-2: #9a6bff;
  --primary-soft: #1e2140;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .5);
  --shadow-lg: 0 12px 40px -12px rgba(0, 0, 0, .6);
}
* { 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 SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.2px; }
.logo svg { width: 28px; height: 28px; flex: none; }
.logo .logo-sub { font-weight: 600; color: var(--muted); font-size: 12px; margin-left: 2px; display: none; }
@media (min-width: 720px) { .logo .logo-sub { display: inline; } }
.header-spacer { flex: 1; }
.header-nav a { color: var(--muted); font-weight: 500; font-size: 14px; padding: 6px 10px; border-radius: 8px; }
.header-nav a:hover { color: var(--text); background: var(--surface-2); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer; font-size: 15px;
  transition: all .15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--primary); }
.lang-btn { width: auto; padding: 0 12px; font-weight: 600; font-size: 13px; }

/* ---------- layout ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
main.container { padding-top: 28px; padding-bottom: 48px; }

/* ---------- hero (home) ---------- */
.hero { text-align: center; padding: 56px 0 40px; position: relative; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 22px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); border-radius: 999px; padding: 5px 14px;
  font-size: 13px; font-weight: 600;
}
.badge svg { width: 14px; height: 14px; color: var(--ok); }
.hero h1 {
  font-size: clamp(30px, 6vw, 48px); line-height: 1.18; margin: 0 0 16px;
  letter-spacing: -1px; font-weight: 900;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: clamp(15px, 2.2vw, 18px); color: var(--muted); max-width: 640px; margin: 0 auto 28px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; padding: 11px 22px; font-size: 15px; font-weight: 700;
  border: 1px solid transparent; cursor: pointer; transition: all .15s ease;
  line-height: 1.3;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: linear-gradient(100deg, var(--primary), var(--primary-2)); color: var(--on-primary); box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--primary) 55%, transparent); }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none !important; }
.btn-danger { background: var(--danger); color: #fff; }

/* ---------- sections ---------- */
.section { padding: 34px 0 6px; }
.section-title { font-size: 24px; font-weight: 800; letter-spacing: -.4px; margin: 0 0 6px; text-align: center; }
.section-sub { color: var(--muted); text-align: center; margin: 0 0 26px; font-size: 14.5px; }

/* ---------- tools grid ---------- */
.tools-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 14px;
}
.tool-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  transition: all .18s ease; position: relative; overflow: hidden;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.tool-card .tc-icon {
  width: 42px; height: 42px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); margin-bottom: 4px;
}
.tool-card .tc-icon svg { width: 22px; height: 22px; }
.tool-card h3 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.tool-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }

/* ---------- features / compare ---------- */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.feature-card .f-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.feature-card .f-icon svg { width: 20px; height: 20px; }
.feature-card h3 { margin: 0 0 6px; font-size: 15.5px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 13.5px; }

.compare-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.compare-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.compare-table th, .compare-table td { padding: 13px 16px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--border); }
.compare-table th { background: var(--surface-2); font-weight: 700; }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table td:not(:first-child) { text-align: center; }
.compare-table .yes { color: var(--ok); font-weight: 700; }
.compare-table .no { color: var(--danger); font-weight: 700; }
.compare-table .col-us { background: color-mix(in srgb, var(--primary) 6%, transparent); font-weight: 600; }

/* ---------- tool page head ---------- */
.tool-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.tool-head .t-icon {
  width: 52px; height: 52px; border-radius: 14px; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--primary) 70%, transparent);
}
.tool-head .t-icon svg { width: 26px; height: 26px; }
.tool-head h1 { margin: 0; font-size: clamp(22px, 4vw, 30px); font-weight: 900; letter-spacing: -.5px; }
.tool-head .t-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* ---------- cards / dropzone ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.dropzone {
  border: 2px dashed color-mix(in srgb, var(--primary) 40%, var(--border));
  border-radius: var(--radius); background: var(--surface);
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: all .15s ease; position: relative;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}
.dropzone .dz-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.dropzone .dz-icon svg { width: 28px; height: 28px; }
.dropzone .dz-title { font-weight: 800; font-size: 16.5px; margin-bottom: 4px; }
.dropzone .dz-hint { color: var(--muted); font-size: 13.5px; }
.dropzone .dz-privacy { margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ok); font-weight: 600; background: color-mix(in srgb, var(--ok) 10%, transparent); padding: 4px 12px; border-radius: 999px; white-space: nowrap; }

/* ---------- file list ---------- */
.file-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.file-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; cursor: grab;
  transition: box-shadow .15s ease, opacity .15s ease;
}
.file-item.dragging { opacity: .45; }
.file-item .fi-thumb {
  width: 44px; height: 56px; flex: none; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; color: var(--muted);
}
.file-item .fi-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-item .fi-thumb svg { width: 20px; height: 20px; }
.file-item .fi-meta { flex: 1; min-width: 0; }
.file-item .fi-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .fi-sub { color: var(--muted); font-size: 12.5px; }
.file-item .fi-actions { display: flex; gap: 6px; align-items: center; }
.fi-drag { color: var(--muted); cursor: grab; display: flex; }
.fi-drag svg { width: 16px; height: 16px; }
.mini-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
  transition: all .12s ease;
}
.mini-btn:hover { color: var(--text); border-color: var(--primary); }
.mini-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.mini-btn svg { width: 15px; height: 15px; }

/* page grid (organize / split-select) */
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 16px; }
.page-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 10px;
  padding: 8px; position: relative; cursor: grab; text-align: center;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.page-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.page-card .pg-thumb { background: var(--surface-2); border-radius: 6px; overflow: hidden; aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center; position: relative; }
.page-card .pg-thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform .15s ease; }
.page-card .pg-thumb img.rot90 { transform: rotate(90deg); }
.page-card .pg-thumb img.rot180 { transform: rotate(180deg); }
.page-card .pg-thumb img.rot270 { transform: rotate(-90deg); }
.page-card .pg-num { font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.page-card .pg-rot-badge { position: absolute; top: 4px; right: 4px; background: var(--primary); color: #fff; font-size: 10px; border-radius: 6px; padding: 1px 5px; font-weight: 700; }
.page-card .pg-tools { position: absolute; top: 4px; left: 4px; display: flex; gap: 4px; opacity: 0; transition: opacity .12s ease; }
.page-card:hover .pg-tools { opacity: 1; }
.page-card .pg-tools button {
  width: 24px; height: 24px; border-radius: 7px; border: none; cursor: pointer;
  background: rgba(20, 22, 34, .75); color: #fff; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.page-card .pg-tools button:hover { background: var(--danger); }

/* ---------- options ---------- */
.options { margin-top: 18px; display: flex; flex-direction: column; gap: 16px; }
.opt-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.opt-group { display: flex; flex-direction: column; gap: 6px; min-width: 180px; flex: 1; }
.opt-group > label { font-size: 13px; font-weight: 700; color: var(--muted); }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button {
  flex: 1; min-width: 60px; border: none; background: transparent; color: var(--muted);
  border-radius: 8px; padding: 7px 10px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: all .12s ease;
}
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
html.dark .seg button.active { background: var(--primary); color: #fff; }
input[type="text"], input[type="number"], select, textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
  padding: 10px 12px; font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .12s ease;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { min-height: 130px; resize: vertical; line-height: 1.7; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.range-val { font-size: 13px; color: var(--primary); font-weight: 700; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.hint { font-size: 12.5px; color: var(--muted); }

/* ---------- actions / progress ---------- */
.action-bar { margin-top: 20px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.progress-wrap { margin-top: 18px; display: none; }
.progress-wrap.show { display: block; }
.progress-track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width .2s ease; }
.progress-label { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---------- result ---------- */
.result-box { margin-top: 18px; display: none; }
.result-box.show { display: block; }
.result-inner {
  background: color-mix(in srgb, var(--ok) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--border));
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.result-inner .r-icon { color: var(--ok); }
.result-inner .r-icon svg { width: 26px; height: 26px; }
.result-inner .r-text { flex: 1; min-width: 180px; }
.result-inner .r-text b { display: block; font-size: 15px; }
.result-inner .r-text span { font-size: 13px; color: var(--muted); }

/* ---------- how / faq ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; position: relative; }
.step::before {
  counter-increment: step; content: counter(step);
  width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.step h3 { margin: 0 0 6px; font-size: 15.5px; }
.step p { margin: 0; color: var(--muted); font-size: 13.5px; }

.faq-list { display: flex; flex-direction: column; gap: 10px; max-width: 760px; margin: 0 auto; }
details.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 18px; }
details.faq-item summary { cursor: pointer; font-weight: 700; font-size: 14.5px; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after { content: "+"; color: var(--muted); font-size: 18px; font-weight: 600; }
details.faq-item[open] summary::after { content: "−"; }
details.faq-item .faq-a { color: var(--muted); font-size: 14px; padding: 0 0 16px; }

/* ---------- privacy strip (tool pages) ---------- */
.privacy-strip {
  display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 4px;
}
.privacy-strip .ps-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 13px;
}
.privacy-strip .ps-item svg { width: 13px; height: 13px; color: var(--ok); }

/* ---------- ads ---------- */
.ad-slot { display: none; margin: 22px auto; text-align: center; min-height: 0; }
html.ads-on .ad-slot { display: block; min-height: 90px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 40px; }
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 28px 20px; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.footer-brand { max-width: 300px; }
.footer-brand .logo { margin-bottom: 8px; }
.footer-brand p { color: var(--muted); font-size: 13px; margin: 0; }
.footer-cols { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col h4 { margin: 0 0 10px; font-size: 13.5px; }
.footer-col a { display: block; color: var(--muted); font-size: 13.5px; padding: 3px 0; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); text-align: center; color: var(--muted); font-size: 12.5px; padding: 16px 20px; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #23273a; color: #fff; border-radius: 12px; padding: 11px 20px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease; max-width: 90vw;
}
.toast.err { background: #b91c1c; }
.toast.ok { background: #047857; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- misc ---------- */
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.count-pill { background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; }

@media (max-width: 640px) {
  .hero { padding: 36px 0 24px; }
  .card-pad { padding: 16px; }
  .dropzone { padding: 28px 14px; }
  .footer-cols { gap: 24px; }
  .page-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}
