/* 共享样式：PDF 工具箱 + 各 PDF 独立 SEO 页 + 去水印页
 * tool-320.html / pdf-merge.html / pdf-split.html / pdf-password.html
 * / image-to-pdf.html / templates/pdf-watermark.html 共用。
 * 引擎 JS 各页自带，样式在此一处维护。 */

:root {
    --primary: #ff5e5b;
    --primary-hover: #ff3b38;
    --primary-soft: #fff0f0;
    --bg: #f7f8fa;
    --surface: #ffffff;
    --border: #e6e8ec;
    --border-light: #f0f2f5;
    --text: #1a1d23;
    --text-secondary: #5a6172;
    --text-muted: #9aa1b1;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.05);
}
body { background: var(--bg); }
.tool-shell { max-width: 1100px; margin: 0 auto; padding: 20px; }
.tool-header { text-align: center; padding: 32px 0 24px; }
.tool-header h1 { font-size: 32px; font-weight: 700; color: var(--text); margin: 0 0 8px; }
.tool-header p { color: var(--text-secondary); font-size: 15px; margin: 0; }
.tool-tabs { display: inline-flex; background: white; border-radius: 999px; padding: 4px; margin-top: 20px; box-shadow: var(--shadow-sm); }
.tool-tab { padding: 10px 24px; border: none; background: transparent; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-secondary); transition: all 0.2s; }
.tool-tab:hover:not(:disabled) { color: var(--text); }
.tool-tab.active { background: var(--primary); color: white; }
.tool-tab:disabled { color: var(--text-muted); cursor: not-allowed; opacity: 0.5; }

/* 主面板：上传状态切换 */
.tool-panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; margin-top: 16px; }
.hero-drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 60px 24px; text-align: center; cursor: pointer; transition: all 0.2s; }
.hero-drop:hover, .hero-drop.dragover { border-color: var(--primary); background: var(--primary-soft); }
.hero-drop-icon { display: inline-flex; align-items: center; justify-content: center; width: 80px; height: 80px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); margin-bottom: 20px; }
.hero-drop-icon svg { width: 40px; height: 40px; }
.hero-drop-title { font-size: 22px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.hero-drop-sub { font-size: 14px; color: var(--text-secondary); }

/* 紧凑模式 (split 拆分展示已加载文件) */
.compact-drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 24px 20px; text-align: center; cursor: pointer; transition: all 0.2s; }
.compact-drop:hover, .compact-drop.dragover { border-color: var(--primary); background: var(--primary-soft); }
.compact-drop .compact-icon { display: inline-flex; vertical-align: middle; margin-right: 8px; color: var(--text-secondary); }
.compact-drop:hover .compact-icon { color: var(--primary); }

/* 文件卡片 */
.file-card { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: white; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; transition: all 0.15s; position: relative; }
.file-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.file-card.dragging { opacity: 0.4; }
.file-card.drag-over-top { border-top: 2px solid var(--primary); }
.file-card.drag-over-bottom { border-bottom: 2px solid var(--primary); }
.file-card-thumb { width: 44px; height: 50px; background: var(--primary-soft); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--primary); font-weight: 700; font-size: 11px; flex-shrink: 0; position: relative; }
.file-card-thumb::before { content: ''; position: absolute; top: 0; right: 0; width: 8px; height: 8px; background: white; border-bottom-left-radius: 4px; }
.file-card-info { flex: 1; min-width: 0; }
.file-card-name { font-size: 14px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card-meta { font-size: 12px; color: var(--text-secondary); margin-top: 3px; display: flex; gap: 12px; }
.file-card-pages { font-size: 12px; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 4px 10px; border-radius: 12px; flex-shrink: 0; }
.file-card-handle { color: var(--text-muted); cursor: grab; padding: 0 4px; font-size: 18px; user-select: none; }
.file-card-handle:active { cursor: grabbing; }
.file-card-remove { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: 6px; display: flex; align-items: center; }
.file-card-remove:hover { color: var(--error); background: #fee2e2; }
.file-card-remove svg { width: 18px; height: 18px; }

.add-more-row { display: flex; justify-content: center; padding: 12px 0 0; }
.add-more-btn { background: transparent; border: 1px dashed var(--border); color: var(--text-secondary); padding: 12px 24px; border-radius: var(--radius); cursor: pointer; font-size: 14px; transition: all 0.2s; display: flex; align-items: center; gap: 8px; }
.add-more-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* 分割模式选择器 (segmented control) */
.segmented { display: flex; background: var(--bg); border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.segmented-item { flex: 1; padding: 10px 12px; border: none; background: transparent; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-secondary); transition: all 0.2s; text-align: center; }
.segmented-item:hover { color: var(--text); }
.segmented-item.active { background: white; color: var(--text); box-shadow: var(--shadow-sm); }

/* 设置卡 */
.settings-card { background: var(--bg); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: 14px; color: var(--text); font-weight: 500; }
.settings-control input[type="text"], .settings-control input[type="number"] { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; min-width: 100px; }
.settings-control input:focus { border-color: var(--primary); outline: none; }
.settings-help { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

/* 可视化拆分：缩略图流 + 页间剪刀 */
.split-flow { display: flex; flex-wrap: wrap; align-items: stretch; margin-top: 12px; max-height: 600px; overflow-y: auto; padding: 8px 6px; background: var(--bg); border-radius: 10px; }
.sp-page { position: relative; width: 158px; margin: 8px 0; background: white; border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; overflow: hidden; transition: box-shadow 0.15s; }
.sp-page canvas, .sp-page img { display: block; width: 100%; height: auto; }
.sp-page.loading { min-height: 210px; background: linear-gradient(90deg, #f3f4f7 25%, #e9ebf0 37%, #f3f4f7 63%); background-size: 400% 100%; animation: sp-shimmer 1.3s ease-in-out infinite; }
@keyframes sp-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sp-page .sp-num { position: absolute; left: 5px; bottom: 5px; background: rgba(26,29,35,0.72); color: white; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 8px; }
.sp-page .sp-file { position: absolute; left: 5px; top: 5px; background: var(--primary); color: white; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 8px; display: none; white-space: nowrap; }
.sp-page.seg-start .sp-file { display: block; }
.sp-page.seg-alt { background: #f6f8ff; }
/* 页间剪刀拆分点 */
.sp-cut { width: 30px; margin: 6px 0; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; color: var(--text-muted); flex-shrink: 0; }
.sp-cut svg { width: 17px; height: 17px; opacity: 0.3; transition: all 0.15s; z-index: 1; }
.sp-cut:hover svg { opacity: 1; color: var(--primary); transform: scale(1.15); }
.sp-cut::before { content: ''; position: absolute; top: 6px; bottom: 6px; left: 50%; border-left: 2px dashed transparent; transform: translateX(-50%); transition: border-color 0.15s; }
.sp-cut:hover::before { border-left-color: var(--border); }
.sp-cut.active svg { opacity: 1; color: var(--primary); }
.sp-cut.active::before { border-left-color: var(--primary); }
.split-quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 4px; }
.split-quick button { background: white; border: 1px solid var(--border); color: var(--text-secondary); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; transition: all 0.15s; }
.split-quick button:hover { border-color: var(--primary); color: var(--primary); }
.split-quick .sq-n { display: flex; align-items: center; gap: 6px; margin-left: auto; color: var(--text-secondary); font-size: 13px; }
.split-quick .sq-n input { width: 54px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.split-hint { font-size: 12px; color: var(--text-muted); margin: 6px 2px 0; line-height: 1.5; }

/* 去水印：候选文字列表 */
.wm-list { max-height: 300px; overflow-y: auto; margin: 6px 0; display: flex; flex-direction: column; gap: 4px; }
.wm-list .wm-empty { font-size: 13px; color: var(--text-muted); padding: 14px 4px; text-align: center; }
.wm-structural { font-size: 13px; line-height: 1.6; color: #15803d; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 11px 14px; margin-bottom: 4px; }
.wm-cand { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: white; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: all 0.15s; }
.wm-cand:hover { border-color: var(--primary); }
.wm-cand input { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; cursor: pointer; }
.wm-cand .wm-text { flex: 1; min-width: 0; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-cand .wm-count { flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--text-secondary); background: var(--bg); padding: 3px 9px; border-radius: 10px; }
.wm-cand.suspect .wm-count { color: var(--primary); background: var(--primary-soft); }
.wm-manual { display: flex; gap: 8px; margin-top: 10px; }
.wm-manual input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.wm-manual input:focus { border-color: var(--primary); outline: none; }
.wm-manual button { background: white; border: 1px solid var(--border); color: var(--text-secondary); padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; transition: all 0.15s; }
.wm-manual button:hover { border-color: var(--primary); color: var(--primary); }
.wm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wm-tags .wm-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft); color: var(--primary); font-size: 12px; padding: 4px 6px 4px 10px; border-radius: 14px; }
.wm-tags .wm-tag button { background: transparent; border: none; color: var(--primary); cursor: pointer; display: flex; padding: 0; line-height: 0; }
.wm-tags .wm-tag svg { width: 14px; height: 14px; }

/* 大主按钮 */
.primary-action { width: 100%; padding: 18px; background: var(--primary); color: white; border: none; border-radius: var(--radius); cursor: pointer; font-size: 16px; font-weight: 600; transition: all 0.2s; margin-top: 24px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.primary-action:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.primary-action:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
.primary-action svg { width: 20px; height: 20px; }

/* 次要按钮 */
.secondary-action { width: 100%; padding: 14px; background: white; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-size: 15px; font-weight: 500; margin-top: 10px; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.secondary-action:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.secondary-action:disabled { color: var(--text-muted); cursor: not-allowed; }

/* 状态条 */
.status-bar { padding: 14px 20px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; display: none; align-items: center; gap: 10px; }
.status-bar.show { display: flex; }
.status-bar.info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.status-bar.warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.status-bar.success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.status-bar.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.status-bar .status-icon { width: 20px; height: 20px; flex-shrink: 0; }
.status-bar .spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 结果展示 */
.result-card { background: white; border: 2px solid var(--success); border-radius: var(--radius); padding: 24px; margin-top: 16px; text-align: center; }
.result-icon { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 50%; background: #dcfce7; color: var(--success); margin-bottom: 12px; }
.result-icon svg { width: 32px; height: 32px; }
.result-title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.result-meta { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }

/* 紧凑块 (加载文件后展示) */
.loaded-info { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: var(--primary-soft); border-radius: var(--radius); margin-bottom: 16px; }
.loaded-info-icon { width: 40px; height: 40px; background: white; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--primary); flex-shrink: 0; }
.loaded-info-icon svg { width: 22px; height: 22px; }
.loaded-info-text { flex: 1; min-width: 0; }
.loaded-info-name { font-size: 14px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loaded-info-meta { font-size: 12px; color: var(--text-secondary); }

.hidden { display: none !important; }

/* SEO 落地页版式（各 PDF 独立页共用） */
.lp-intro{font-size:15px;color:var(--text-secondary);margin:8px 0 20px;line-height:1.7;}
.lp-section{margin-top:28px;}
.lp-section h2{font-size:18px;font-weight:600;margin-bottom:12px;}
.lp-steps{padding-left:20px;line-height:1.9;color:var(--text);}
.lp-faq dt{font-weight:600;margin-top:14px;}
.lp-faq dd{margin:6px 0 0;color:var(--text-secondary);line-height:1.7;}
.related-links{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px;margin-top:28px;}
.related-links h2{font-size:16px;font-weight:600;margin-bottom:12px;color:var(--text-secondary);}
.rt-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px;}
.rt-card-item{display:flex;flex-direction:column;gap:4px;padding:14px 16px;background:var(--bg-white);border:1px solid var(--border);border-radius:var(--radius);text-decoration:none;color:var(--text);transition:all .2s;}
.rt-card-item:hover{border-color:var(--primary);box-shadow:0 2px 8px rgba(0,0,0,0.06);}
.rt-card-item .rt-name{font-size:14px;font-weight:700;}
.rt-card-item .rt-desc{font-size:13px;color:var(--text-muted);line-height:1.5;}
.lp-features{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:12px;margin-top:14px;}
.lp-feature{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px 16px;}
.lp-feature h3{font-size:14px;font-weight:600;margin:0 0 6px;display:flex;align-items:center;gap:8px;}
.lp-feature h3 svg{width:18px;height:18px;flex:none;color:var(--primary);}
.lp-feature p{font-size:13px;color:var(--text-secondary);line-height:1.6;margin:0;}
.lp-related-top{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:24px;padding:22px 24px;background:var(--primary-soft);border:1px solid var(--primary);border-radius:var(--radius);}
.lp-related-top .lp-rt-label{flex-basis:100%;font-size:17px;font-weight:700;color:var(--text);margin-bottom:6px;}
.lp-related-top a{display:inline-block;padding:11px 20px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);font-size:15px;font-weight:500;color:var(--text);text-decoration:none;transition:all .2s;}
.lp-related-top a:hover{border-color:var(--primary);color:var(--primary);box-shadow:0 3px 10px rgba(0,0,0,0.10);transform:translateY(-1px);}

@media (max-width: 768px) { .tool-header h1 { font-size: 24px; } .tool-panel { padding: 20px; } .hero-drop { padding: 40px 20px; } .hero-drop-icon { width: 60px; height: 60px; } .hero-drop-icon svg { width: 32px; height: 32px; } .hero-drop-title { font-size: 18px; } }
