/* public/assets/css/tools/image/handwriting.css */
.hw-tool-wrapper { background: var(--bg-surface); border-radius: 24px; padding: 24px; border: 1px solid var(--border-color); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); }
.hw-header-main { font-size: 1.6rem; font-weight: 800; color: var(--text-main); margin-bottom: 8px; text-align: center; }
.hw-subtitle { color: var(--text-muted); font-size: 0.95rem; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); margin-bottom: 24px; text-align: center; max-width: 800px; margin-left: auto; margin-right: auto; }

.hw-layout-vertical { display: flex; flex-direction: column; gap: 24px; }
.hw-panel { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 16px; padding: 24px; box-sizing: border-box; }

.hw-config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.hw-col-span-full { grid-column: 1 / -1; }

.hw-form-group { display: flex; flex-direction: column; margin-bottom: 10px; }
.hw-label { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.hw-input, .hw-select, .hw-textarea { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-main); font-size: 1rem; outline: none; transition: 0.2s; box-sizing: border-box; }
.hw-textarea { resize: vertical; min-height: 150px; font-family: inherit; line-height: 1.6; }
.hw-input:focus, .hw-select:focus, .hw-textarea:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0,102,204,0.1); }

.hw-range { -webkit-appearance: none; width: 100%; height: 6px; background: #cbd5e1; border-radius: 3px; outline: none; margin: 10px 0; }
.hw-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--primary-color); cursor: pointer; transition: 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.hw-val-badge { background: rgba(0,102,204,0.1); color: var(--primary-color); padding: 2px 8px; border-radius: 12px; font-size: 0.8rem; font-weight: bold; }

.hw-preview-panel { background: #e2e8f0; }
.hw-panel-header { display: flex; justify-content: space-between; align-items: center; width: 100%; padding-bottom: 16px; border-bottom: 1px dashed #cbd5e1; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.hw-panel-title { font-size: 1.1rem; font-weight: 700; color: #334155; margin: 0; }

.hw-btn-group { display: flex; gap: 12px; }
.hw-btn { background: var(--primary-color); color: #fff; border: none; padding: 10px 24px; border-radius: 12px; font-weight: 700; font-size: 0.95rem; cursor: pointer; transition: 0.2s; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,102,204,0.2); }
.hw-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }
.hw-btn-sec { background: var(--bg-surface); color: var(--text-main); border: 1px solid var(--border-color); box-shadow: none; }
.hw-btn-sec:hover { border-color: var(--primary-color); color: var(--primary-color); }

.hw-preview-container { width: 100%; display: flex; justify-content: center; overflow: hidden; padding: 20px 0; box-sizing: border-box; }

.hw-paper-wrapper { width: 100%; max-width: 800px; min-height: 1131px; background-color: #ffffff; box-shadow: 0 20px 40px -10px rgba(0,0,0,0.25); position: relative; box-sizing: border-box; overflow: hidden; transition: background 0.3s ease; }

/* 墨水正片叠底层：赋予灵魂的修改 */
.hw-ink-layer {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    /* 核心属性：正片叠底，让颜色与底图融合 */
    mix-blend-mode: multiply;
    opacity: 0.95;
}

/* 文本映射容器 (正文) */
.hw-text-content {
    padding-left: 100px; 
    padding-right: 60px;
    padding-bottom: 20px;
    width: 100%;
    min-height: 150px;
    box-sizing: border-box;
    white-space: pre-wrap; 
    word-break: break-word;
    overflow-wrap: break-word;
    /* 默认样式 */
    color: #1f2937;
    font-family: 'Zhi Mang Xing', cursive;
}

/* 专属落款容器 (靠右排列) */
.hw-sign-content {
    padding-left: 100px; 
    padding-right: 80px; 
    padding-bottom: 80px;
    width: 100%;
    box-sizing: border-box;
    white-space: pre-wrap; 
    word-break: break-word;
    overflow-wrap: break-word;
    text-align: right; 
    /* 继承外部统一样式 */
    color: inherit;
    font-family: inherit;
}

.hw-paper-wrapper[data-paper="blank"] { background: #ffffff; }
.hw-paper-wrapper[data-paper="old"] { background: #fdf6e3; box-shadow: inset 0 0 100px rgba(139, 69, 19, 0.05), 0 20px 40px -10px rgba(0,0,0,0.25); }
.hw-paper-wrapper[data-paper="kraft"] { background: #dcb881; }
/* 蓝图比较深，撤销叠底模式否则看不见白字 */
.hw-paper-wrapper[data-paper="blueprint"] { background: #1e3a8a; }
.hw-paper-wrapper[data-paper="blueprint"] .hw-ink-layer { mix-blend-mode: normal; opacity: 1; }

.hw-paper-margin-line { position: absolute; left: 80px; top: 0; bottom: 0; width: 2px; background: rgba(239, 68, 68, 0.4); display: none; z-index: 1; pointer-events: none; }
.hw-paper-wrapper[data-paper="line"] .hw-paper-margin-line,
.hw-paper-wrapper[data-paper="grid"] .hw-paper-margin-line { display: block; }

[data-theme="dark"] .hw-tool-wrapper { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .hw-panel { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .hw-preview-panel { background: #020617; border-color: #475569; }
[data-theme="dark"] .hw-panel-header { border-bottom-color: #334155; }
[data-theme="dark"] .hw-panel-title { color: #f8fafc; }
[data-theme="dark"] .hw-input, [data-theme="dark"] .hw-select, [data-theme="dark"] .hw-textarea { background: #1e293b; border-color: #475569; color: #f8fafc; }
[data-theme="dark"] .hw-btn-sec { background: #1e293b; border-color: #475569; color: #f8fafc; }