/* ============================================================
 * contract-builder.css — 旅行社通知文件生成插件（Vue 3 版）独立样式
 * 由 view_marketing_presale.htm 内联样式独立而来
 * 注意：本文件将被页面外链引用（<link>），不能出现裸 </style>
 * 版式定位：旅行社向渠道/客户发送的公文式通知（涨价/优惠告警/赠送截止）
 * ============================================================ */
[v-cloak]{display:none !important;}

/* ===== 整体布局：左右双栏，两栏各自独立滚动 ===== */
html,body{height:100%;}
body{margin:0;}
#ct-app{display:flex;flex-direction:column;height:100vh;min-height:0;background:#f0f2f5;}
.ct-layout{flex:1 1 auto;min-height:0;display:flex;gap:0;}
.ct-left{width:384px;flex:none;border-right:1px solid #eee;padding:14px 18px 26px;
  overflow-y:auto;background:#fff;overscroll-behavior:contain;}
.ct-right{flex:1;min-width:0;padding:26px 36px 60px;overflow-y:auto;background:#f0f2f5;overscroll-behavior:contain;}

/* 细滚动条（桌面端更精致） */
.ct-left::-webkit-scrollbar,.ct-right::-webkit-scrollbar{width:10px;height:10px;}
.ct-left::-webkit-scrollbar-thumb,.ct-right::-webkit-scrollbar-thumb{background:#cfd4da;border-radius:6px;border:2px solid transparent;background-clip:content-box;}
.ct-left::-webkit-scrollbar-track,.ct-right::-webkit-scrollbar-track{background:transparent;}

.ct-field{margin-bottom:13px;}
.ct-field label{display:block;font-size:12px;color:#666;margin-bottom:4px;}
.ct-field input,.ct-field select,.ct-field textarea{
  width:100%;box-sizing:border-box;border:1px solid #ddd;border-radius:6px;
  padding:7px 9px;font-size:13px;font-family:inherit;
}
.ct-field textarea{resize:vertical;min-height:60px;}
.ct-field-row{display:flex;gap:10px;}
.ct-field-row .ct-field{flex:1;}
/* 文号行：输入框 + 「＋公司名 / ＋年份」快捷按钮（引导使用 {short}/{year}，避免手打公司名） */
.ct-field-row.ct-doc-no-row{align-items:center;}
.ct-field-row.ct-doc-no-row input{width:auto;flex:1;min-width:0;}
.ct-mini{flex:none;box-sizing:border-box;border:1px solid #c8161d;background:#fff;color:#c8161d;
  border-radius:6px;padding:7px 10px;font-size:12px;cursor:pointer;white-space:nowrap;}
.ct-mini:hover{background:#c8161d;color:#fff;}
/* 文号写死公司名时的提示行（一键改为 {short} 模板） */
.ct-fix-tip{margin-top:6px;font-size:11.5px;color:#b45309;line-height:1.6;}
.ct-fix-tip a{color:#c8161d;text-decoration:underline;}
/* 范围滑块统一外观（大小/倾斜/排版微调共用） */
.ct-left input[type=range]{-webkit-appearance:none;appearance:none;width:100%;height:4px;margin:6px 0;
  background:#e4e7ec;border:none;border-radius:2px;outline:none;cursor:pointer;padding:0;box-sizing:border-box;}
.ct-left input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:13px;height:13px;
  border-radius:50%;background:#c8161d;border:1px solid #fff;box-shadow:0 0 2px rgba(0,0,0,.3);cursor:pointer;}
.ct-left input[type=range]::-moz-range-thumb{width:13px;height:13px;border-radius:50%;background:#c8161d;
  border:1px solid #fff;box-shadow:0 0 2px rgba(0,0,0,.3);cursor:pointer;}
.ct-sec-title{font-size:13px;font-weight:700;color:#333;margin:16px 0 8px;padding-left:8px;border-left:3px solid #c8161d;}

/* ===== 通知类型选择 ===== */
.tpl-list{display:flex;flex-direction:column;gap:8px;}
.tpl-item{border:1px solid #e5e5e5;border-radius:8px;padding:10px 12px;cursor:pointer;transition:.15s;}
.tpl-item:hover{border-color:#c8161d;}
.tpl-item.active{border-color:#c8161d;background:#fff7ef;}
.tpl-item b{font-size:13px;}

/* ===== 印章面板（圆形公章） ===== */
.seal-panel{border:1px solid #e5e5e5;border-radius:8px;padding:12px;margin-top:14px;background:#fafbff;}
.seal-panel h4{font-size:13px;margin:0 0 10px;color:#333;}
.seal-type-tag{display:inline-block;padding:4px 10px;border:1px solid #c8161d;border-radius:6px;font-size:12px;color:#c8161d;background:#fff7ef;margin-bottom:10px;}
.seal-color{display:flex;gap:6px;align-items:center;margin-bottom:8px;}
.seal-color .sw{width:22px;height:22px;border-radius:50%;cursor:pointer;border:2px solid #fff;box-shadow:0 0 0 1px #ddd;}
.seal-color .sw.active{box-shadow:0 0 0 2px #333;}
.seal-list{margin-top:10px;max-height:160px;overflow:auto;}
.seal-list-item{display:flex;align-items:center;justify-content:space-between;padding:5px 8px;border-bottom:1px solid #eee;font-size:12px;cursor:pointer;border-radius:6px;}
.seal-list-item:hover{background:#f5f6fa;}
.seal-list-item.active{background:#fff7ef;}
.seal-list-item .nm{display:flex;align-items:center;gap:8px;}
.seal-list-item .nm .ic{width:22px;height:22px;border:2px solid #c8161d;border-radius:50%;box-sizing:border-box;}
.seal-list-item .del{color:#999;cursor:pointer;}
.seal-list-item .del:hover{color:#c8161d;}
.seal-tip{font-size:11px;color:#999;margin-top:6px;line-height:1.5;}

/* ===== 印章排版微调面板（滑块实时驱动右侧公章预览） ===== */
.seal-layout-box{margin-top:12px;padding:10px 10px 2px;background:#fff;border:1px solid #efe3d8;border-radius:8px;}
.seal-layout-hd{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;}
.seal-layout-hd b{font-size:12px;color:#8a4b12;}
.seal-layout-hd .rst{font-size:11px;color:#c8161d;border:1px solid #c8161d;background:#fff;border-radius:6px;padding:2px 10px;cursor:pointer;}
.seal-layout-hd .rst:hover{background:#c8161d;color:#fff;}
.seal-layout-box .ct-field{margin-bottom:8px;}
.seal-layout-box .ct-field label i{font-style:normal;color:#b6a99b;font-size:11px;margin-left:4px;}
.seal-layout-box .rg{display:flex;align-items:center;gap:8px;}
.seal-layout-box .rg input[type=range]{flex:1;min-width:0;}
.seal-layout-box .rg .val{min-width:38px;text-align:right;font-size:12px;font-weight:700;color:#c8161d;}
.seal-layout-box .cb-row{display:flex;align-items:flex-start;gap:6px;margin:2px 0 4px;}
.seal-layout-box .cb-row input[type=checkbox]{width:auto;flex:none;height:auto;margin:2px 0 0;padding:0;border:none;border-radius:0;accent-color:#c8161d;}
.seal-layout-box .cb-row label{display:block;margin:0;font-size:11px;line-height:1.5;color:#9a8c7d;cursor:pointer;}

/* ===== 通知纸张 ===== */
.paper-wrap{background:#fff;box-shadow:0 2px 12px rgba(0,0,0,.12);max-width:760px;margin:0 auto;
  padding:52px 58px 64px;font-family:"Songti SC","SimSun",serif;color:#1a1a1a;position:relative;}
.paper-wrap h1.ct-title{text-align:center;font-size:23px;font-weight:700;letter-spacing:1px;margin:0 0 14px;}
.ct-meta{text-align:right;font-size:13px;color:#555;margin:-6px 0 18px;}
.ct-salute{font-size:15px;font-weight:600;margin:0 0 6px;line-height:1.9;}
.ct-para{font-size:15px;line-height:2.05;margin:0 0 10px;text-align:justify;text-indent:2em;}
.ct-extra{margin:14px 0 0;font-size:14px;line-height:1.9;text-indent:2em;color:#333;}
.ct-extra .x{font-weight:700;}

/* ===== 通知页头（标题区）：标题与正文分离；页头风格 = 后台类型库 head_style，预留多风格可继续扩展 =====
   间距规范（三段，解决“标题 / 文号编号行 / 红线 / 正文”挤在一起的问题）：
     标题 ↔ 文号编号行：.ct-title margin-bottom（默认 14px）
     文号编号行 ↔ 红线：各风格的 padding-bottom（默认 18~26px）
     红线 ↔ 正文：各风格的 margin-bottom（默认 26px）
   「文号」默认取自所选通知类型后台设置（可前台临时改）；文号居中、编号居右；二者皆空整行隐藏 */
.ct-hd{position:relative;margin:0 0 26px;}
.ct-hd .ct-title{margin:0 0 14px;transition:all .2s;}
/* 文号(居中) + 编号(居右)：标题下方同一信息行，13px 深灰，超长省略；居中不用 transform 以便 html2canvas/Word 保真 */
/* 文号(居中) + 编号(居右)：三格表格布局（左占位格 / 文号居中 / 编号居右）
   用 table 而非 absolute：浏览器、Word(.doc) 导出、html2canvas 截图表现一致，不再出现编号掉位 */
.ct-hd .ct-meta{display:table;width:100%;table-layout:fixed;min-height:15px;line-height:15px;font-size:13px;color:#555;margin:0;}
.ct-meta-pad{display:table-cell;width:26%;}
.ct-hd .ct-doc-no{display:table-cell;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ct-hd .ct-sn-no{display:table-cell;width:26%;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
/* style1 · 经典公文：居中标题 + 底部红色双头线（保持原版公文观感） */
.ct-hd-style1{text-align:center;padding-bottom:18px;border-bottom:2px solid #c8161d;margin-bottom:26px;}
.ct-hd-style1 .ct-title{text-align:center;}
.ct-hd-style1 .ct-meta{text-align:center;color:#555;}
/* style2 · 左栏简约：标题左对齐，左侧红色竖条，底部淡线 */
.ct-hd-style2{border-left:4px solid #c8161d;padding:2px 0 14px 16px;border-bottom:1px solid #ececec;margin-bottom:24px;}
.ct-hd-style2 .ct-title{text-align:left;}
.ct-hd-style2 .ct-meta{text-align:center;color:#555;}
/* style3 · 红带徽章卡：浅红底 + 顶部粗红条，标题深红 */
.ct-hd-style3{background:#fdf4f4;border-top:3px solid #c8161d;border-bottom:1px solid #f2dcdc;padding:18px 20px 20px;text-align:center;margin-bottom:26px;}
.ct-hd-style3 .ct-title{text-align:center;color:#a30d12;}
.ct-hd-style3 .ct-meta{text-align:center;color:#7a6a6a;}
/* style4 · 红头单实线：居中标题 + 编号，下方一条红色实线（最通用的红头文件版式） */
.ct-hd-style4{text-align:center;padding-bottom:20px;border-bottom:1.5px solid #c8161d;margin-bottom:26px;}
.ct-hd-style4 .ct-title{text-align:center;}
.ct-hd-style4 .ct-meta{text-align:center;color:#555;}
/* style5 · 红头双实线（文武线）：上细下粗两条红线 */
.ct-hd-style5{position:relative;text-align:center;padding-bottom:22px;border-bottom:3px solid #c8161d;margin-bottom:26px;}
.ct-hd-style5::after{content:"";position:absolute;left:0;right:0;bottom:9px;height:1px;background:#c8161d;}
.ct-hd-style5 .ct-title{text-align:center;}
.ct-hd-style5 .ct-meta{text-align:center;color:#555;}
/* style6 · 单实线嵌五角星：红线正中嵌红色五角星（机关公文常见版式） */
.ct-hd-style6{position:relative;text-align:center;padding-bottom:26px;margin-bottom:26px;}
.ct-hd-style6::before{content:"";position:absolute;left:0;right:0;bottom:8px;height:2px;background:#c8161d;}
.ct-hd-style6::after{content:"★";position:absolute;left:50%;bottom:-1px;transform:translateX(-50%);
  background:#fff;padding:0 12px;color:#c8161d;font-size:19px;line-height:1;}
.ct-hd-style6 .ct-title{text-align:center;}
.ct-hd-style6 .ct-meta{text-align:center;color:#555;}

/* ===== 通知主体（后台富文本正文，兼容 UEditor 输出的 p/table/img 等标签排版） ===== */
.ct-body{font-size:15px;line-height:2.05;color:#1a1a1a;text-align:justify;}
.ct-body p{margin:0 0 10px;line-height:2.05;}
.ct-body img{max-width:100%;height:auto;}
.ct-body ul,.ct-body ol{padding-left:2em;margin:0 0 10px;}
.ct-body li{margin:2px 0;}
.ct-body table{max-width:100%;border-collapse:collapse;margin:0 0 10px;}
.ct-body th,.ct-body td{border:1px solid #d8d8d8;padding:5px 9px;font-size:14px;text-align:left;}
.ct-body h1,.ct-body h2,.ct-body h3,.ct-body h4,.ct-body h5{font-weight:700;margin:14px 0 8px;line-height:1.6;}

/* 落款区：签发人（手写体）→ 发布单位 → 日期，右对齐单栏 */
.ct-foot{margin-top:54px;text-align:right;}
.ct-foot p{font-size:14px;line-height:2.1;margin:0;}
.ct-foot .ct-foot-org{font-size:16px;font-weight:700;letter-spacing:1px;}
.ct-foot .ct-foot-date{color:#444;}
.ct-foot-sign{padding-right:26px;}
/* 手写签名字体：优先「Zhi Mang Xing」（开源行书体，由页面 <head> 中 @font-face 定义，
   字体文件位于 skin/assets/fonts/zhi-mang-xing.woff2，绝对地址引入可被导出样式收集）；
   其后为系统行楷/楷体回退，保证任何环境都能以手写风格呈现 */
.handwrite{font-family:"Zhi Mang Xing","STXingkai","华文行楷","KaiTi","楷体","DFKai-SB","TW-Kai","AR PL UKai CN",cursive;
  font-size:36px;font-weight:700;letter-spacing:3px;line-height:1.4;}

/* ===== 印章叠加层 =====
 * 真实印章盖在纸面文字上时是「半透明墨色」：下方文字能透过印泥隐约显现。
 * 透明通道用 .seal-node 内联 opacity(0.82) 实现（HTML → 内联样式对 Word/PNG/JPG/PDF 导出均保留），
 * 因此这里不再用 CSS 强设不透明 opacity；is-active 选中仅加虚线框，不再把印章变全不透明。
 */
.seal-layer{position:absolute;inset:0;pointer-events:none;z-index:5;}
.seal-node{position:absolute;pointer-events:auto;cursor:move;filter:url(#sealInk) url(#sealEdge) drop-shadow(0.6px 1px 0.4px rgba(0,0,0,.18));will-change:transform;touch-action:none;-webkit-user-select:none;user-select:none;}
.seal-node.is-dragging{opacity:.92;cursor:grabbing;transition:none;}
.seal-node.is-active{outline:2px dashed #2b7cff;outline-offset:3px;}
.seal-node > span{display:block;width:100%;height:100%;}
.seal-node svg{display:block;width:100%;height:100%;}
.seal-del{position:absolute;top:-10px;right:-10px;width:20px;height:20px;border-radius:50%;background:#c8161d;color:#fff;border:none;cursor:pointer;font-size:12px;line-height:1;padding:0;}

/* ===== 预览水印（仅实时预览可见，防截图冒用；导出/打印自动去除） ===== */
.wm-layer{position:absolute;top:0;left:0;right:0;bottom:0;z-index:6;overflow:hidden;pointer-events:none;}
.wm-layer svg{display:block;width:100%;height:100%;}
@media print{.wm-layer{display:none!important;}}

/* ===== 打印（导出 PDF）：只输出纸张本体 =====
   隐藏顶部声明条 / 左侧填写面板 / 导出栏 / 提示条 / 收费弹窗 / 公章删除按钮，
   并把纸张还原为整页流式（去掉阴影与最大宽度），页边距交由浏览器打印设置接管。 */
@media print{
  html,body{height:auto;background:#fff;}
  #ct-app{display:block;height:auto;background:#fff;}
  .ct-layout{display:block;}
  .ct-warn,.export-bar,.ct-left,.toast,.dp-mask,.seal-del{display:none!important;}
  .ct-right{padding:0;background:#fff;overflow:visible;}
  .paper-wrap{box-shadow:none;max-width:none;margin:0;padding:0;}
}

/* ===== 顶部免责声明条 ===== */
.ct-warn{display:flex;gap:9px;align-items:flex-start;padding:9px 30px;background:#fff8e1;border-bottom:1px solid #f0d98c;color:#8a6d1a;font-size:13px;line-height:1.75;flex:none;}
.ct-warn b{color:#a36a00;}
.ct-warn p{margin:0;}
@media (max-width:768px){.ct-warn{padding:9px 12px;font-size:12px;line-height:1.7;}}

/* ===== 导出栏 ===== */
.export-bar{display:flex;gap:10px;padding:12px 30px;background:#fff;border-bottom:1px solid #eee;align-items:center;flex:none;}
.export-bar .spacer{flex:1;}
.btn{background:#c8161d;color:#fff;border:none;padding:8px 16px;border-radius:6px;cursor:pointer;font-size:13px;}
.btn.ghost{background:#fff;color:#333;border:1px solid #ddd;}
.btn:hover{opacity:.9;}
.export-sep{width:1px;height:22px;background:#e5e5e5;margin:0 2px;}
.export-options{font-size:12px;color:#666;}

/* ===== 导出下拉菜单（Word / PDF / PNG）+ 按钮价格标签 ===== */
.exp-dd{position:relative;}
.exp-dd .btn{display:inline-flex;align-items:center;gap:6px;}
.exp-dd .caret{display:inline-block;font-size:11px;opacity:.85;transition:transform .18s;}
.exp-dd .caret.up{transform:rotate(180deg);}
.exp-menu{position:absolute;right:0;top:calc(100% + 6px);min-width:212px;background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 12px 28px rgba(15,23,42,.14);padding:6px;z-index:60;}
.exp-item{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:9px 10px;border-radius:6px;font-size:13px;color:#1f2937;cursor:pointer;white-space:nowrap;}
.exp-item:hover{background:#fef2f2;color:#c8161d;}
.exp-item .exp-price{font-size:12px;font-weight:600;color:#c8161d;}
.btn .amt{margin-left:7px;padding:1px 7px;border-radius:999px;font-size:11.5px;font-style:normal;background:rgba(255,255,255,.22);}
.btn.ghost .amt{background:#fef2f2;color:#c8161d;}
.btn.all{background:#1f2d3d;}
.btn.all .amt{background:rgba(255,255,255,.2);}

/* ===== Toast ===== */
.toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);background:#333;color:#fff;padding:9px 18px;border-radius:6px;font-size:13px;z-index:999;opacity:0;transition:.2s;pointer-events:none;}
.toast.show{opacity:1;}

/* ===== 导出收费弹窗（doc_pay.php 按次计费） ===== */
.dp-mask{position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:1000;display:flex;align-items:center;justify-content:center;padding:20px;}
.dp-modal{width:420px;max-width:100%;background:#fff;border-radius:12px;overflow:hidden;box-shadow:0 18px 50px rgba(0,0,0,.18);font-size:14px;}
.dp-hd{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;background:#1f2d3d;color:#fff;font-weight:700;}
.dp-x{cursor:pointer;opacity:.8;padding:2px 6px;}
.dp-x:hover{opacity:1;}
.dp-body{padding:20px 22px 6px;}
.dp-price{text-align:center;margin:2px 0 6px;}
.dp-price b{font-size:30px;color:#c8161d;font-family:Georgia,serif;}
.dp-price span{color:#999;font-size:13px;}
.dp-tip{color:#444;line-height:1.9;margin:6px 0 16px;text-align:center;}
.dp-tip b{color:#1f2d3d;}
.dp-balance{text-align:center;color:#666;margin:2px 0 14px;}
.dp-balance b{color:#1f2d3d;font-size:15px;}
.dp-btn{width:100%;padding:11px;font-size:14px;border-radius:8px;background:#1677ff;}
.dp-btn:disabled{opacity:.6;cursor:not-allowed;}
.dp-poll{margin:12px 0 4px;color:#888;font-size:12.5px;line-height:1.7;text-align:center;}
.dp-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px;background:#f7f8fa;border-top:1px solid #eee;font-size:12px;}
.dp-note{color:#999;line-height:1.7;}
.dp-cancel{color:#c8161d;cursor:pointer;white-space:nowrap;font-weight:600;}
.dp-cancel:hover{text-decoration:underline;}

/* 支付方式列表 */
.dp-methods{display:flex;flex-direction:column;gap:10px;margin:14px 0 18px;}
.dp-method{display:flex;align-items:center;gap:10px;padding:12px 14px;border:1.5px solid #e5e7eb;border-radius:8px;cursor:pointer;background:#fff;transition:.15s;}
.dp-method:hover{border-color:#1677ff;}
.dp-method.active{border-color:#1677ff;background:#f0f7ff;}
.dp-method.disabled{opacity:.55;cursor:not-allowed;background:#f9fafb;}
.dp-method input{width:16px;height:16px;accent-color:#1677ff;flex-shrink:0;}
.dp-m-title{font-weight:700;color:#1f2d3d;flex-shrink:0;}
.dp-m-hint{font-size:12px;color:#888;line-height:1.4;}

/* 微信二维码 */
.dp-qr{text-align:center;margin:10px 0 6px;}
.dp-qr img{width:180px;height:180px;border:1px solid #eee;border-radius:6px;}
.dp-wx-tip{color:#888;font-size:12px;line-height:1.7;text-align:center;margin:8px 0 4px;}

/* ===== 窄屏适配（回退整页滚动，左栏不再固定高度） ===== */
@media (max-width:980px){
  #ct-app{height:auto;min-height:100vh;}
  .ct-layout{flex-direction:column;min-height:0;}
  .ct-left{width:auto;flex:none;border-right:none;border-bottom:1px solid #eee;overflow:visible;}
  .ct-right{padding:18px 12px 40px;overflow:visible;}
  .paper-wrap{padding:28px 18px 44px;}
  .export-bar{flex-wrap:wrap;padding:10px 12px;}
  .export-bar .btn{flex:1 1 auto;text-align:center;justify-content:center;}
  .export-sep{display:none;}
  .exp-dd{width:100%;}
  .exp-dd .btn{width:100%;justify-content:center;}
  .exp-menu{left:0;right:auto;width:100%;}
}
