/* ============================================================
   旅行社ERP · 页面专属样式（登录 / 仪表盘 / 各业务页微调）
   ============================================================ */

/* ---------- 登录页 ---------- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background:
    radial-gradient(900px 520px at 15% 8%, rgba(107, 45, 179, .13), transparent 55%),
    radial-gradient(820px 520px at 92% 92%, rgba(198, 34, 131, .10), transparent 55%),
    radial-gradient(600px 380px at 85% 12%, rgba(255, 204, 0, .10), transparent 60%),
    linear-gradient(160deg, #f7f4fc 0%, #f2edf8 55%, #faf6ee 100%);
}

.login-wrap { width: 100%; max-width: 400px; }

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  text-align: center;
}
.login-brand .brand-text { color: var(--brand-purple-dark); font-size: var(--fs-lg); }
.login-brand .brand-sub { color: var(--text-muted); font-size: var(--fs-sm); }
.login-logo {
  width: 132px;
  height: 132px;
  object-fit: contain;
  margin-bottom: var(--space-2);
  /* logo-login.png 本身带 alpha 通道（真透明），不需要再靠混合模式糊白底 */
}
.login-brand h1 { font-size: var(--fs-lg); margin-bottom: 2px; }

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
}

.login-field { margin-bottom: var(--space-4); }
.login-field label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }

.login-foot {
  margin-top: var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

/* ---------- 仪表盘：销售排行徽章 ---------- */
.rank { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: var(--radius-full); font-weight: 700; font-size: var(--fs-xs); background: var(--surface-soft); color: var(--text-muted); border: 1px solid var(--border); }
.rank.top1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(245, 158, 11, .4); }
.rank.top2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; border-color: transparent; }
.rank.top3 { background: linear-gradient(135deg, #fcd34d, #b45309); color: #fff; border-color: transparent; }

/* ---------- 表格内联编辑：窄屏保持可读 ---------- */
@media (max-width: 767px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-form { grid-template-columns: 1fr; }
  .topbar-date { display: none; }
}

/* ---------- 团期成本明细行 ---------- */
.cost-row .wide { grid-column: 1 / -1; }

/* ---------- 订单块内小表 ---------- */
.tour-table td .btn, .tour-table td button { padding: 4px 10px; font-size: var(--fs-xs); }

/* ---------- 确认件（对客确认书打印页，2026-09-29 正式版式） ---------- */
.confirm-sheet { position: relative; max-width: 800px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 40px 30px; box-shadow: var(--shadow); color: #111; }
.confirm-sheet .ce { outline: none; }
.confirm-sheet .ce:hover, .confirm-sheet .ce:focus { background: var(--brand-purple-fade-5); border-radius: 2px; box-shadow: 0 0 0 1px var(--border-strong); }
/* 页眉：2026-10-14 起为整幅抬头图（白底：logo/公司名/英文/飞机/彩带） */
.cs-head { text-align: center; }
.cs-head-img { display: block; width: 100%; max-width: 780px; margin: 0 auto; }
.cs-title { text-align: center; font-size: 26px; font-weight: 800; letter-spacing: 8px; margin: 10px 0 14px; }
.cs-table { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
.cs-table th, .cs-table td { border: 1px solid #333; padding: 5px 7px; vertical-align: middle; text-align: left; word-wrap: break-word; }
.cs-table th { background: #eee9f5; text-align: center; font-weight: 700; }
.cs-table .num { text-align: right; }
.cs-table .ctr { text-align: center; }
.cs-blue { color: #3949ab; }
.cs-red { color: #d32f2f; }
.cs-fill { min-height: 2.6em; }
.cs-detail-bar { font-weight: 700; font-size: 13px; margin: 14px 0 5px; }
.cs-bill th { background: #efefef; }
.cs-orderno { text-align: center !important; font-weight: 600; }
.cs-total { text-align: right; color: #d32f2f; font-weight: 700; }
.cs-payline { text-align: right; font-size: 12.5px; }
.cs-green { color: #137a3f; }
.cs-unpaid { color: #c62828; }
.cs-bank-tip { font-size: 12.5px; margin: 12px 0 5px; }
.cs-vert { line-height: 1.9; letter-spacing: 2px; }
.cs-notice { margin-top: 10px; }
.cs-notice-body { font-size: 12px; line-height: 1.9; }
.cs-red-b { color: #d32f2f; }
.cs-notes { font-size: 12px; line-height: 1.9; margin-top: 10px; }
.cs-sign { display: flex; justify-content: space-between; font-size: 13.5px; line-height: 2.4; margin-top: 22px; }
.cs-sign > div { width: 45%; }
/* 自定义版式工具条（2026-10-14）：选中文字后调字号/颜色 + 保存/恢复 */
/* sticky：跟着页面滑动，不用回到顶部再调格式；独立页让出站点顶栏高度，弹窗(iframe)贴顶 */
.cs-toolbar { position: sticky; top: var(--topbar-h, 60px); z-index: 30; background: var(--surface); padding: 8px 12px; border-radius: var(--radius); box-shadow: 0 2px 14px rgba(17, 17, 17, .10); }
.modal-page .cs-toolbar { top: 0; }
.cs-fmt-bar { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-soft); font-size: var(--fs-sm); }
.cs-fmt-tip { color: var(--text-secondary); }
.cs-fmt-btn { width: 28px; height: 26px; border: 1px solid var(--border-strong); border-radius: 4px; background: #fff; font-weight: 800; cursor: pointer; }
.cs-fmt-btn:hover { background: var(--brand-purple-fade-5); }
.cs-fmt-underline { text-decoration: underline; font-style: normal; }
.cs-fmt-sel { width: auto; padding: 3px 6px; border: 1px solid var(--border-strong); border-radius: 4px; font-size: var(--fs-sm); }
/* 常用颜色快捷色块（免得每次开调色盘） */
.cs-swatches { display: inline-flex; gap: 4px; padding: 0 2px; }
.cs-swatch { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgba(0, 0, 0, .18); cursor: pointer; padding: 0; transition: transform .12s; }
.cs-swatch:hover { transform: scale(1.18); border-color: rgba(0, 0, 0, .4); }
.cs-fmt-color { width: 30px; height: 26px; padding: 0; border: 1px solid var(--border-strong); border-radius: 4px; background: #fff; cursor: pointer; }
.cs-override-tip { font-size: var(--fs-xs); color: var(--status-warn); border: 1px dashed var(--status-warn); border-radius: var(--radius); padding: 3px 8px; }
.cs-block-del { max-width: 800px; margin: 8px auto 0; text-align: right; }
.cs-block-del .btn { color: var(--status-warn); border-color: var(--status-warn); }
.cs-send-tip { flex: 1 1 100%; text-align: left; font-size: var(--fs-xs); color: var(--text-secondary); background: var(--surface-soft); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 5px 10px; }
.cs-send-tip b { color: var(--brand-purple); }
/* 印章：可拖动 / 可缩放 / 可 360° 旋转（详见 assets/js/seal-drag.js）
   位置尺寸一律用百分比、角度用度，屏幕 / 打印 / 导出图片三处比例一致 */
.seal-drag {
  position: absolute;
  left: 80%; top: 80%; width: 18%;
  transform: rotate(var(--seal-rot, -8deg));
  transform-origin: center center;
  opacity: .88;
  cursor: move;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  z-index: 3;
}
.seal-drag:hover, .seal-drag.is-active { outline: 1.5px dashed rgba(124, 58, 237, .55); outline-offset: 5px; }
.seal-drag.is-dragging { opacity: .96; cursor: grabbing; }
.seal-drag.is-rotating { cursor: grabbing; }
.seal-art { display: block; width: 100%; height: auto; pointer-events: none; }
/* 右下角：缩放手柄 */
.seal-handle {
  position: absolute; right: -9px; bottom: -9px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 2px solid #7c3aed; box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  cursor: nwse-resize; opacity: 0; transition: opacity .15s; touch-action: none;
}
/* 正上方：360° 旋转手柄（伸出一根小杆示意） */
.seal-rot-handle {
  position: absolute; left: 50%; top: -30px;
  width: 16px; height: 16px; margin-left: -8px; border-radius: 50%;
  background: #fff; border: 2px solid #7c3aed; box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  cursor: grab; opacity: 0; transition: opacity .15s; touch-action: none;
  z-index: 4;
}
.seal-rot-handle::after {
  content: ""; position: absolute; left: 50%; top: 14px;
  width: 2px; height: 16px; margin-left: -1px;
  background: rgba(124, 58, 237, .55); border-radius: 1px;
}
.seal-drag:hover .seal-handle,
.seal-drag.is-active .seal-handle,
.seal-drag.is-dragging .seal-handle,
.seal-drag:hover .seal-rot-handle,
.seal-drag.is-active .seal-rot-handle,
.seal-drag.is-dragging .seal-rot-handle { opacity: 1; }

/* ---------- 付款申请单：一比一复刻纸质表格 ---------- */
.pr-bar { max-width: 760px; margin: 0 auto var(--space-4); display: flex; gap: var(--space-2); justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.pr-seal-pick { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); }
.pr-seal-pick select { width: auto; }
.pr-sheet { position: relative; max-width: 760px; margin: 0 auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 30px 26px; box-shadow: var(--shadow); color: #111; }
.pr-title { font-family: SimSun, "Songti SC", "STSong", serif; font-size: 25px; font-weight: 700; text-align: center; letter-spacing: 2px; margin: 2px 0 20px; }
.pr-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.pr-table td { border: 1px solid #000; padding: 6px 8px; vertical-align: middle; line-height: 1.6; }
.pr-table td.pr-mid { text-align: center; }
.pr-in { width: 100%; border: none; outline: none; background: transparent; padding: 1px 0; font: inherit; color: inherit; border-radius: 2px; }
.pr-in:hover, .pr-in:focus { background: var(--brand-purple-fade-5); }
.pr-in.pr-mid { text-align: center; font: inherit; }
.pr-yen { float: left; line-height: 1.6; margin-right: 2px; }
.pr-in-amt { width: calc(100% - 15px); }
.pr-cell-flex { display: flex; align-items: center; gap: 2px; }
.pr-cell-flex > span { flex: 0 0 auto; white-space: nowrap; }
.pr-cell-flex > .pr-in { flex: 1 1 auto; min-width: 0; }
.pr-remark > span { white-space: nowrap; }
.pr-remark .pr-in { display: inline-block; width: auto; min-width: 55%; vertical-align: baseline; }

/* ---------- 打印友好 ---------- */
@media print {
  .sidebar, .topbar, .row-actions form, .pager, .no-print, .row-actions, .notice-toast { display: none !important; }
  .app-shell { display: block; }
  .content { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  @page { size: A4; margin: 12mm; }
  .confirm-sheet { box-shadow: none; border: none; padding: 0; max-width: none; border-radius: 0; }
  .confirm-sheet .ce:hover, .confirm-sheet .ce:focus { background: transparent; box-shadow: none; }
  .pr-sheet { box-shadow: none; border: none; padding: 0; max-width: none; border-radius: 0; }
  .pr-bar { display: none !important; }
  .pr-in:hover, .pr-in:focus { background: transparent; }
  /* 印章照常打印，但拖拽框与缩放手柄不能出现在纸上 */
  .seal-drag { outline: none !important; opacity: .88 !important; }
  .seal-handle, .seal-rot-handle { display: none !important; }
}
