/* ============================================================
   合同在线生成器 — yicool.com.cn /tools/contract
   主蓝 #136ce9 · 页面背景 #f6f7fa · 白色圆角内容卡 · 左表单右预览
   三端断点：>=992px 桌面 / 768-991px 平板 / <768px 手机
   ============================================================ */

/* 占满整个电脑端屏幕：覆盖全站 .app / .main-content 的宽度限制 */
body.page-contract-full .app { max-width: 100%; }
body.page-contract-full .main-content { max-width: 100%; border-right: 0; }
.ct-page { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }

/* ---------- 标题区 ---------- */
.ct-hero { margin-bottom: 20px; }
.ct-title {
    font-size: 26px; font-weight: 700; color: #1b1f24;
    display: flex; align-items: center; gap: 10px; margin: 0 0 6px;
}
.ct-title::before {
    content: ''; width: 8px; height: 22px; border-radius: 4px;
    background: linear-gradient(180deg, #136ce9, #4d9fff); flex: none;
}
.ct-sub { font-size: 14px; color: #8a93a2; margin: 0; line-height: 1.7; max-width: 860px; }

/* ---------- 主区双栏 ---------- */
.ct-main {
    display: grid; grid-template-columns: 480px minmax(0, 1fr);
    gap: 16px; align-items: start;
}

/* ---------- 面板 ---------- */
.ct-panel {
    background: #fff; border-radius: 10px; padding: 18px 18px 20px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
    margin-bottom: 16px;
}
.ct-panel-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.ct-panel-num {
    flex: none; width: 22px; height: 22px; border-radius: 50%;
    background: #136ce9; color: #fff; font-size: 13px; font-weight: 600;
    display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.ct-panel-title { font-size: 16px; font-weight: 600; color: #1b1f24; }
.ct-panel-sub { font-size: 12px; color: #8a93a2; margin-top: 2px; line-height: 1.5; }

/* ---------- 合同类型选择 ---------- */
.ct-types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ct-type {
    display: flex; flex-direction: column; align-items: flex-start; text-align: left;
    gap: 3px; padding: 12px 14px; border-radius: 10px;
    border: 1.5px solid #e4e8ef; background: #fff; cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
    font-family: inherit;
}
.ct-type:hover { border-color: #136ce9; }
.ct-type.active {
    border-color: #136ce9; background: #eef4ff; box-shadow: 0 0 0 3px rgba(19, 108, 233, .12);
}
.ct-type-icon { font-size: 20px; line-height: 1; }
.ct-type-name { font-size: 14px; font-weight: 600; color: #1b1f24; }
.ct-type-desc { font-size: 11px; color: #8a93a2; line-height: 1.5; }

/* ---------- 表单 ---------- */
.ct-fields { display: flex; flex-wrap: wrap; gap: 12px 14px; }
.ct-field { flex: 1 1 100%; min-width: 0; }
.ct-field-half { flex: 1 1 calc(50% - 7px); }
.ct-field-label { display: block; font-size: 12.5px; color: #5a6472; margin-bottom: 5px; }
.ct-field-label i { color: #d92d20; font-style: normal; }
.ct-input {
    width: 100%; box-sizing: border-box; padding: 9px 12px;
    border: 1.5px solid #e0e4eb; border-radius: 8px; font-size: 14px;
    color: #1b1f24; background: #fff; font-family: inherit; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.ct-input:focus { border-color: #136ce9; box-shadow: 0 0 0 3px rgba(19, 108, 233, .12); }
.ct-input::placeholder { color: #b3bac6; }
textarea.ct-input { resize: vertical; min-height: 72px; line-height: 1.6; }
.ct-input-error { border-color: #d92d20 !important; box-shadow: 0 0 0 3px rgba(217, 45, 32, .12) !important; }

.ct-form-actions { display: flex; gap: 10px; margin-top: 18px; }
.ct-form-tip { font-size: 11.5px; color: #a0a8b5; margin: 12px 0 0; }

/* ---------- 按钮 ---------- */
.ct-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 600;
    border: 1.5px solid transparent; cursor: pointer; font-family: inherit;
    transition: background .15s, border-color .15s, opacity .15s; white-space: nowrap;
}
.ct-btn:disabled { opacity: .55; cursor: not-allowed; }
.ct-btn-primary { background: #136ce9; color: #fff; }
.ct-btn-primary:hover:not(:disabled) { background: #0f5ccb; }
.ct-btn-solid { background: #fff; color: #136ce9; border-color: #136ce9; }
.ct-btn-solid:hover:not(:disabled) { background: #eef4ff; }
.ct-btn-ghost { background: #fff; color: #5a6472; border-color: #e0e4eb; }
.ct-btn-ghost:hover:not(:disabled) { border-color: #136ce9; color: #136ce9; }

/* ---------- 预览列 ---------- */
.ct-preview-col { min-width: 0; }
.ct-preview-tools {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: #fff; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.ct-preview-name { font-size: 14px; font-weight: 600; color: #1b1f24; }
.ct-preview-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 风险提示 ---------- */
.ct-warnings { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ct-warn {
    border-radius: 8px; padding: 10px 14px; font-size: 13px; line-height: 1.6;
    border: 1px solid; display: flex; gap: 8px; align-items: flex-start;
}
.ct-warn-error { background: #fef3f2; border-color: #fecdca; color: #b42318; }
.ct-warn-warn { background: #fffaeb; border-color: #fedf89; color: #b54708; }

/* ---------- A4 纸张预览 ---------- */
.ct-sheet {
    background: #fff; border-radius: 4px; padding: 42px 48px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 8px 24px rgba(16, 24, 40, .06);
    max-height: 70vh; overflow-y: auto; line-height: 1.9;
    color: #1b1f24; font-size: 15px;
}
.ct-sheet-empty {
    color: #a0a8b5; text-align: center; font-size: 14px;
    padding: 90px 20px; line-height: 2;
}
.ct-block-title {
    text-align: center; font-size: 21px; font-weight: 700; letter-spacing: 2px;
    margin: 4px 0 18px; font-family: "SimHei", "Microsoft YaHei", sans-serif;
}
.ct-block-center { text-align: center; margin: 6px 0; }
.ct-block-right { text-align: right; margin: 4px 0; }
.ct-block-bold { font-weight: 700; margin: 14px 0 6px; }
.ct-block-para { text-indent: 2em; margin: 4px 0; }
.ct-block-hr { border: none; border-top: 1px solid #d0d5dd; margin: 12px 0; }
.ct-block-space { height: 12px; }

/* ---------- 法律依据与免责 ---------- */
.ct-lawnote {
    margin-top: 12px; background: #f0f6ff; border-left: 3px solid #136ce9;
    border-radius: 0 8px 8px 0; padding: 10px 14px; font-size: 12.5px;
    color: #34465f; line-height: 1.7;
}
.ct-lawnote .ct-law-mark { margin-right: 4px; }
.ct-disclaimer {
    margin-top: 12px; background: #fffaeb; border: 1px solid #fedf89;
    border-radius: 8px; padding: 12px 14px; font-size: 12.5px; color: #8a6d3b;
    line-height: 1.7;
}

/* ---------- 使用说明 ---------- */
.ct-guide {
    margin-top: 24px; background: #fff; border-radius: 10px; padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.ct-guide h3 { font-size: 15px; color: #1b1f24; margin: 0 0 10px; }
.ct-guide ol { margin: 0; padding-left: 20px; }
.ct-guide li { font-size: 13px; color: #5a6472; line-height: 1.9; }
.ct-guide p { font-size: 13px; color: #8a93a2; margin: 10px 0 0; line-height: 1.7; }

/* ---------- Toast ---------- */
.ct-toast {
    position: fixed; left: 50%; bottom: 48px; transform: translateX(-50%) translateY(20px);
    background: rgba(23, 26, 32, .92); color: #fff; font-size: 13.5px;
    padding: 10px 20px; border-radius: 999px; z-index: 99999; opacity: 0;
    pointer-events: none; transition: opacity .2s, transform .2s; max-width: 82vw;
    text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}
.ct-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 平板 768-991 ---------- */
@media (max-width: 991px) {
    .ct-main { grid-template-columns: 1fr; }
    .ct-sheet { max-height: 60vh; }
}

/* ---------- 手机 <768 ---------- */
@media (max-width: 767px) {
    .ct-page { padding: 16px 12px 40px; }
    .ct-title { font-size: 22px; }
    .ct-types { grid-template-columns: 1fr 1fr; gap: 8px; }
    .ct-type { padding: 10px 12px; }
    .ct-field-half { flex-basis: 100%; }
    .ct-preview-tools { flex-direction: column; align-items: stretch; }
    .ct-preview-btns { display: grid; grid-template-columns: 1fr 1fr; }
    .ct-preview-btns .ct-btn { width: 100%; }
    .ct-sheet { padding: 28px 20px; max-height: none; overflow: visible; font-size: 14px; }
    .ct-form-actions { flex-direction: column; }
    .ct-form-actions .ct-btn { width: 100%; }
    .ct-guide { padding: 14px 16px; }
}

/* ---------- 打印：仅输出合同纸张 ---------- */
@media print {
    body * { visibility: hidden !important; }
    .ct-sheet, .ct-sheet * { visibility: visible !important; }
    .ct-sheet {
        position: absolute; left: 0; top: 0; width: 100%;
        max-height: none; overflow: visible;
        box-shadow: none; padding: 20px 30px;
    }
    .ct-lawnote, .ct-disclaimer, .ct-warnings, .ct-preview-tools { display: none !important; }
}
