/* 医美术前谈话记录 - 黑白打印风格 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SimSun', 'Songti SC', serif;
    font-size: 12px;
    line-height: 1.5;
    background: #f5f5f5;
    color: #000;
}

.page {
    width: 210mm;
    min-height: 297mm;
    max-width: 100%;
    margin: 0 auto;
    padding: 12mm 15mm;
    background: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* 页眉 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #000;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.hospital-name {
    font-size: 16px;
    font-weight: bold;
}

.file-no {
    font-size: 12px;
}

.file-no span {
    margin-right: 4px;
}

/* 标题 */
.title {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin: 12px 0;
    letter-spacing: 4px;
}

/* 基本信息行 */
.info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 6px;
    font-size: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.info-item.full {
    width: 100%;
}

.info-item label {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-right: 6px;
}

.info-item input[type="checkbox"] {
    width: 12px;
    height: 12px;
    margin: 0;
    accent-color: #000;
}

/* 下划线输入框 */
.underline-input {
    border: none;
    border-bottom: 1px solid #000;
    background: transparent;
    font-size: 12px;
    font-family: inherit;
    padding: 2px 4px;
    min-width: 60px;
    outline: none;
}

.underline-input.short {
    width: 100px;
}

.underline-input.tiny {
    width: 40px;
    text-align: center;
}

.underline-input.wide {
    width: 160px;
}

.underline-input.inline {
    width: 80px;
    margin: 0 4px;
}

.underline-input.inline-wide {
    width: 140px;
    margin: 0 4px;
}

.underline-input.flex1 {
    flex: 1;
    min-width: 100px;
}

/* 说明文字 */
.intro {
    font-size: 12px;
    text-indent: 2em;
    margin: 10px 0;
    line-height: 1.6;
}

/* 问诊区域 */
.questions {
    margin: 8px 0;
}

.q-item {
    margin-bottom: 6px;
}

.q-line {
    font-size: 12px;
    margin-bottom: 2px;
}

.a-line {
    font-size: 12px;
    padding-left: 1.5em;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.a-line label {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-right: 8px;
    white-space: nowrap;
}

.a-line input[type="checkbox"] {
    width: 12px;
    height: 12px;
    margin: 0;
}

.a-line.menstrual {
    gap: 2px;
}

/* 承诺书 */
.commitment {
    margin: 12px 0;
    padding-top: 8px;
    border-top: 1px solid #ccc;
}

.commitment-title {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
}

.commitment-text {
    font-size: 12px;
    text-indent: 2em;
    line-height: 1.6;
}

/* 签名区 */
.signature-area {
    margin-top: 16px;
    padding-top: 12px;
}

.signature-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.signature-box {
    width: 200px;
    height: 50px;
    border-bottom: 1px solid #000;
    position: relative;
    cursor: pointer;
}

.signature-box canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.signature-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 11px;
    pointer-events: none;
}

.signature-box.signed .signature-hint {
    display: none;
}

.date-row {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    font-size: 12px;
}

/* 操作栏 */
.action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.action-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid #333;
    background: #fff;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
}

.action-btn.primary {
    background: #333;
    color: #fff;
}

/* 签名弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    width: 100%;
    max-width: 400px;
}

.modal-title {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 12px;
}

.modal-box canvas {
    width: 100%;
    height: 150px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
    touch-action: none;
}

.modal-btns {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.modal-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #333;
    background: #fff;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
}

.modal-btn.primary {
    background: #333;
    color: #fff;
}

/* 响应式 - 手机适配 */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }

    .page {
        width: 100%;
        min-height: auto;
        padding: 12px 16px;
        font-size: 13px;
    }

    .title {
        font-size: 18px;
        letter-spacing: 2px;
    }

    .info-row {
        gap: 6px 12px;
    }

    .q-line,
    .a-line {
        font-size: 13px;
    }

    .a-line {
        flex-wrap: wrap;
    }

    .a-line label {
        margin-bottom: 4px;
    }

    .signature-box {
        width: 160px;
        height: 45px;
    }
}

/* 打印样式 */
@media print {
    body {
        background: #fff;
        padding: 0;
    }

    .page {
        box-shadow: none;
        padding: 10mm;
        min-height: auto;
    }

    .action-bar,
    .modal {
        display: none !important;
    }

    .signature-hint {
        display: none;
    }
}