/* public/assets/css/pdf/pdf-sign.css */

.pdf-sign-wrapper { padding: 32px 16px; position: relative; }
.pdf-sign-header { text-align: center; margin-bottom: 32px; }
.pdf-sign-title { font-size: 2.2rem; font-weight: 800; color: var(--text-main); margin-bottom: 12px; }
.pdf-sign-subtitle { font-size: 1.05rem; color: var(--text-muted); max-width: 700px; margin: 0 auto; line-height: 1.6; }

.pdf-sign-workspace { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 380px 1fr; gap: 32px; align-items: start; }

/* ==========================================
   左侧：控制面板区
   ========================================== */
.pdf-sign-controls { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 16px; padding: 24px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); display: flex; flex-direction: column; gap: 24px; }
.control-section h4 { margin: 0 0 16px 0; font-size: 1rem; color: var(--text-main); border-bottom: 2px solid rgba(2, 132, 199, 0.2); padding-bottom: 8px; display: inline-block; }

.file-drop-area { border: 2px dashed #0284c7; border-radius: 12px; padding: 40px 20px; text-align: center; cursor: pointer; transition: 0.3s; background: rgba(2, 132, 199, 0.03); position: relative; overflow: hidden; }
.file-drop-area:hover, .file-drop-area.drag-over { background: rgba(2, 132, 199, 0.08); border-color: #0369a1; }
.drop-text { margin-top: 12px; font-weight: 600; color: var(--text-main); font-size: 0.95rem; word-break: break-all; }
.file-input-hidden { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* ==========================================
   控件升级：颜色拾取器与透明度滑块
   ========================================== */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); }

/* 原生颜色拾取器美化 */
.color-picker { width: 100%; height: 42px; padding: 2px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-body); cursor: pointer; transition: 0.2s; }
.color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker::-webkit-color-swatch { border: none; border-radius: 6px; }
.color-picker:hover { border-color: #0284c7; }

/* 透明度滑块美化 */
.opacity-slider { width: 100%; height: 42px; margin: 0; accent-color: #0284c7; cursor: pointer; }

/* ==========================================
   签名手写板
   ========================================== */
.signature-pad-container { background: #f8fafc; border: 2px solid #cbd5e1; border-radius: 8px; overflow: hidden; margin-bottom: 12px; cursor: crosshair; }
[data-theme="dark"] .signature-pad-container { background: #0f172a; border-color: #334155; }
#sigCanvas { width: 100%; height: 150px; touch-action: none; display: block; }

.pad-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.pdf-btn-secondary { background: var(--bg-body); color: var(--text-main); border: 1px solid var(--border-color); padding: 10px; font-weight: 700; border-radius: 8px; cursor: pointer; transition: 0.2s; }
.pdf-btn-secondary:hover { border-color: #0284c7; color: #0284c7; }
.pdf-btn-success { background: #16a34a; color: #fff; border: none; padding: 10px; font-weight: 700; border-radius: 8px; cursor: pointer; transition: 0.2s; }
.pdf-btn-success:hover { background: #15803d; }

.tips-box { background: rgba(2, 132, 199, 0.05); border: 1px solid rgba(2, 132, 199, 0.15); border-radius: 8px; padding: 12px; font-size: 0.85rem; color: #0369a1; line-height: 1.5; }
[data-theme="dark"] .tips-box { color: #38bdf8; }

.pdf-btn-primary { background: #0284c7; color: #fff; border: none; padding: 14px 20px; font-size: 1.05rem; font-weight: 800; border-radius: 12px; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3); width: 100%; }
.pdf-btn-primary:hover:not(:disabled) { background: #0369a1; transform: translateY(-2px); }
.pdf-btn-primary:disabled { background: #94a3b8; cursor: not-allowed; box-shadow: none; opacity: 0.7; }

/* ==========================================
   右侧：预览与拖拽定位区
   ========================================== */
.pdf-sign-preview { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.status-box { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 12px; padding: 32px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.status-text { font-size: 1.05rem; font-weight: 600; color: var(--text-main); margin-top: 12px; }
.loader-spinner { width: 32px; height: 32px; border: 4px solid var(--border-color); border-top-color: #0284c7; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.pdf-render-box { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); text-align: center; overflow: hidden; }
.render-hint { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; font-weight: 600; }

.pdf-canvas-wrapper { position: relative; display: inline-block; box-shadow: 0 0 10px rgba(0,0,0,0.1); border: 1px solid #cbd5e1; background: #fff; max-width: 100%; }
#pdfCanvas { max-width: 100%; height: auto; display: block; }

/* 拖拽的签名框 */
#dragSig { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border: 2px dashed #ef4444; background: rgba(239, 68, 68, 0.1); cursor: move; max-width: 200px; padding: 4px; box-sizing: border-box; touch-action: none; z-index: 10; }
#dragSig:hover { border: 2px solid #ef4444; background: rgba(239, 68, 68, 0.2); }

/* ==========================================
   🌟 SEO 文章优化卡片样式
   ========================================== */
.tool-seo-article { width: 100%; }
.pdf-info-card { background: var(--bg-surface); padding: 24px 32px; border-radius: 16px; border: 1px solid var(--border-color); box-sizing: border-box; max-width: 1100px; margin: 0 auto; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.pdf-info-card h3 { margin-top: 0; color: var(--text-main); font-size: 1.25rem; margin-bottom: 12px; }
.pdf-desc-text { color: var(--text-muted); font-size: 0.95rem; }

/* 📱 响应式适配 */
@media (max-width: 900px) {
    .pdf-sign-workspace { grid-template-columns: 1fr; }
}