/* ===================================================
 * 合同系统 界面与 A4 优雅排版样式规范 (重构版)
 * =================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #f1f5f9;
    color: #1e293b;
    line-height: 1.6;
}

/* 导航与控制台 */
.navbar {
    background-color: #0f172a;
    color: #fff;
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar a {
    color: #cbd5e1;
    text-decoration: none;
    margin-left: 20px;
    font-size: 14px;
}

.navbar a:hover {
    color: #38bdf8;
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05);
    padding: 24px;
    margin-bottom: 24px;
}

/* 按钮规范 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: #d97706; color: #fff; }
.btn-secondary { background: #64748b; color: #fff; }

/* 
 * A4 规范标准合同纸张容器
 * 尺寸: 210mm × 297mm 模拟标准 A4 页面排版
 */
.contract-paper {
    background: #fff;
    width: 210mm;
    min-height: 297mm;
    padding: 25mm 20mm;
    margin: 0 auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    position: relative;
    color: #000;
    font-size: 14px;
    line-height: 1.8;
}

/* 标题与段落样式 */
.contract-main-title {
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 25px;
    color: #000;
}

.contract-section-title {
    font-size: 15px;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #000;
}

.contract-bold-title {
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 8px;
}

.contract-p {
    margin-bottom: 12px;
    text-align: justify;
    text-justify: inter-ideograph;
    font-size: 14px;
    word-break: break-all;
}

.contract-space {
    height: 10px;
}

/* 下划线动态输入框 (高颜值下划线设计) */
.underline-input {
    border: none;
    border-bottom: 1px dashed #334155;
    outline: none;
    padding: 2px 8px;
    font-size: 14px;
    font-family: inherit;
    background: #f8fafc;
    color: #0f172a;
    min-width: 140px;
    display: inline-block;
    transition: all 0.2s ease;
}

.underline-input:focus {
    border-bottom: 2px solid #2563eb;
    background: #eff6ff;
}

/* 合同表格精致设计 */
.table-responsive {
    overflow-x: auto;
    margin: 15px 0;
}

.contract-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
}

.contract-table th, .contract-table td {
    border: 1px solid #000;
    padding: 8px 10px;
    text-align: left;
    vertical-align: middle;
}

.contract-table th {
    background-color: #f1f5f9;
    font-weight: bold;
    color: #000;
}

.table-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    font-family: inherit;
    padding: 2px 4px;
}

.table-input:focus {
    background: #eff6ff;
}

/* 落款、盖章与签名浮层 */
.seal-container {
    position: absolute;
    width: 140px;
    height: 140px;
    pointer-events: none;
    z-index: 10;
}

.seal-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.85;
}

.signature-display {
    max-height: 45px;
    vertical-align: middle;
    margin-left: 8px;
}

/* 骑缝章样式 */
.qifeng-seal {
    position: absolute;
    right: -25px;
    top: 35%;
    width: 60px;
    height: 120px;
    overflow: hidden;
    z-index: 20;
}

/* 打印机 `@media print` 输出控制 (100% 还原正式公文格式) */
@media print {
    body {
        background: #fff;
    }
    .no-print, .navbar, .action-bar, .type-selector {
        display: none !important;
    }
    .contract-paper {
        box-shadow: none;
        padding: 0;
        margin: 0;
        width: 100%;
    }
    .underline-input {
        border-bottom: 1px solid #000 !important;
        background: transparent !important;
        padding: 0 4px !important;
    }
    .table-input {
        border: none !important;
        background: transparent !important;
    }
    .contract-table th {
        background-color: #f8fafc !important;
        -webkit-print-color-adjust: exact;
    }
}
