/* =====================================================================
   智影科技 · 拍摄计划打印样式
   ---------------------------------------------------------------------
   仅服务于 /#/plan/print/:id 打印页（window.print / 另存为 PDF）
   屏幕下预览为 A4 比例纸张，打印时只输出单据正文
   ===================================================================== */

/* ---------- 屏幕预览容器 ---------- */
.print-page {
    background: #eef1f5;
    min-height: 100vh;
    padding-bottom: 40px;
}

.print-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 10px 16px;
    box-shadow: var(--sh-1);
}
.print-toolbar .pt-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
}
.print-toolbar .pt-left .van-icon { color: var(--ink-2); cursor: pointer; }
.print-toolbar .pt-left .van-icon:active { opacity: .5; }
.print-toolbar .pt-title { font-size: 15px; font-weight: 600; }

.print-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 16px;
}

/* ---------- A4 纸张 ---------- */
.sheet {
    width: 210mm;
    min-height: 297mm;
    margin: 20px auto;
    padding: 14mm 13mm;
    background: #fff;
    box-shadow: var(--sh-3);
    border-radius: 4px;
    color: #2b3442;
    font-size: 12px;
    line-height: 1.6;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Noto Sans CJK SC', sans-serif;
}

/* 页眉 */
.sheet .hd {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 3px solid var(--brand);
    padding-bottom: 12px;
}
.sheet .hd-l .co {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand);
    letter-spacing: 2px;
}
.sheet .hd-l .sys {
    font-size: 12px;
    color: #8a94a3;
    margin-top: 2px;
}
.sheet .hd-r {
    text-align: right;
    font-size: 11px;
    color: #6b7686;
    line-height: 1.7;
}

/* 标题 */
.sheet .doc-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 8px;
    margin: 22px 0 4px;
    color: #1f2a3a;
}
.sheet .doc-sub {
    text-align: center;
    color: #8a94a3;
    font-size: 11px;
    letter-spacing: 1px;
    margin-bottom: 18px;
}

/* 状态横幅 */
.sheet .banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f8fc;
    border: 1px solid #dbe5f1;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 6px;
}
.sheet .banner .no {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand);
}
.sheet .banner .st {
    color: #fff;
    font-size: 11px;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}
.sheet .banner .banner-title { color: #6b7686; }

/* 章节标题 */
.sheet h2 {
    font-size: 15px;
    color: #1f2a3a;
    margin: 22px 0 10px;
    padding-left: 9px;
    border-left: 4px solid var(--brand);
    letter-spacing: 1px;
}
.sheet h2 .cnt {
    font-size: 11px;
    color: #8a94a3;
    font-weight: 400;
    margin-left: 8px;
    letter-spacing: 0;
}

/* 基本信息表 */
.sheet table.info {
    width: 100%;
    border-collapse: collapse;
}
.sheet table.info td {
    border: 1px solid #dfe6ee;
    padding: 7px 10px;
    font-size: 12px;
}
.sheet table.info td.k {
    background: #f5f8fc;
    color: #5b6675;
    width: 13%;
    white-space: nowrap;
}

/* 服装 / 模特卡片 */
.sheet .c-card {
    display: flex;
    border: 1px solid #dfe6ee;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
    page-break-inside: avoid;
    break-inside: avoid;
}
.sheet .c-img {
    width: 56mm;
    min-height: 50mm;
    background: #f2f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-right: 1px solid #eef2f7;
    overflow: hidden;
}
.sheet .c-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sheet .ph {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #b9c3cf;
    font-size: 11px;
}
.sheet .c-info { flex: 1; padding: 12px 14px; min-width: 0; }
.sheet .c-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sheet .idx {
    display: inline-flex;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sheet .tag {
    font-size: 10px;
    padding: 2px 9px;
    border-radius: 12px;
    font-weight: 400;
}
.sheet .tag.t-blue   { background: var(--brand-100); color: var(--brand); }
.sheet .tag.t-green  { background: #eef7f0; color: #0a8f4a; }
.sheet .tag.t-purple { background: #f4effc; color: var(--purple); }

.sheet table.kv { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sheet table.kv td {
    border: 1px solid #edf1f6;
    padding: 5px 8px;
    font-size: 11.5px;
    word-break: break-all;
}
.sheet table.kv td:nth-child(odd) {
    background: #f8fafc;
    color: #5b6675;
    width: 15%;
    white-space: nowrap;
    word-break: keep-all;
}
.sheet table.kv td:nth-child(even) { width: 35%; }
.sheet td.money { color: #d83931; font-weight: 700; }

/* 合计条 */
.sheet .total-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    background: #fdf6f5;
    border: 1px solid #f3d9d6;
    border-radius: 8px;
    padding: 10px 16px;
    margin-top: 4px;
}
.sheet .total-bar .lab { color: #8a544e; }
.sheet .total-bar .num { font-size: 18px; font-weight: 700; color: #d83931; }

/* 日志表 */
.sheet table.log { width: 100%; border-collapse: collapse; }
.sheet table.log th {
    background: #f5f8fc;
    color: #5b6675;
    border: 1px solid #dfe6ee;
    padding: 7px 8px;
    font-size: 11.5px;
    text-align: left;
    font-weight: 600;
}
.sheet table.log td {
    border: 1px solid #e7edf4;
    padding: 6px 8px;
    font-size: 11.5px;
}
.sheet .empty-cell { text-align: center; color: #999; }

/* 签署与页脚 */
.sheet .sign {
    margin-top: 34px;
    display: flex;
    justify-content: space-between;
    color: #2b3442;
    font-size: 12px;
}
.sheet .foot {
    margin-top: 26px;
    display: flex;
    justify-content: space-between;
    color: #8a94a3;
    font-size: 10.5px;
    border-top: 1px solid #e7edf4;
    padding-top: 10px;
}

/* ---------- 窄屏：纸张等比缩放预览 ---------- */
@media screen and (max-width: 820px) {
    .sheet {
        width: 100%;
        min-height: 0;
        margin: 12px 0;
        padding: 18px 14px;
        border-radius: 0;
        box-shadow: none;
    }
    .sheet .c-card { flex-direction: column; }
    .sheet .c-img {
        width: 100%;
        min-height: 140px;
        border-right: 0;
        border-bottom: 1px solid #eef2f7;
    }
    .sheet .doc-title { font-size: 20px; letter-spacing: 4px; }
    .print-toolbar { position: sticky; }
}

/* ---------- 打印：只输出单据 ---------- */
@page {
    size: A4;
    margin: 12mm 10mm;
}

@media print {
    html, body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    /* 隐藏应用外壳：侧边栏 / 顶栏 / 底部导航 */
    .app-side,
    .app-top,
    .van-tabbar,
    .van-nav-bar,
    .van-toast,
    .van-overlay { display: none !important; }
    .app-main.with-side,
    .app-main.with-top { margin: 0 !important; padding: 0 !important; width: 100% !important; }
    .app-root, .app-main, .app-body { background: #fff !important; padding: 0 !important; margin: 0 !important; }

    /* 打印页自身 */
    .print-page { background: #fff !important; padding: 0 !important; min-height: 0 !important; }
    .no-print { display: none !important; }

    .sheet {
        width: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        font-size: 11pt;
    }
    .sheet table.kv td,
    .sheet table.info td,
    .sheet table.log td,
    .sheet table.log th { font-size: 10pt; }

    /* 分页控制 */
    .sheet h2 { page-break-after: avoid; break-after: avoid; }
    .sheet .c-card,
    .sheet table.log tr,
    .sheet .total-bar { page-break-inside: avoid; break-inside: avoid; }
    .sheet .sign { page-break-inside: avoid; break-inside: avoid; }

    /* 避免图片区域被切成两页 */
    .sheet .c-img { min-height: 42mm; }
    .sheet a { text-decoration: none; color: inherit; }
}
