.contract-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 40px;
}

@media (max-width: 1200px) {
    .contract-page {
        grid-template-columns: 1fr;
    }
}

.form-section {
    position: sticky;
    top: 40px;
    height: fit-content;
}

.form-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.contract-type-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.type-tab {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.type-tab:hover {
    border-color: #667eea;
    color: #667eea;
}

.type-tab.active {
    border-color: #10b981;
    background: #ecfdf5;
    color: #059669;
}

.form-header {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 24px 0 16px;
    padding-left: 12px;
    border-left: 4px solid #10b981;
}

.form-header:first-of-type {
    margin-top: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 8px;
}

.label-icon {
    font-size: 16px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: #10b981;
    background: white;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input::placeholder {
    color: #94a3b8;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-input[type="date"] {
    cursor: pointer;
}

.form-input[type="number"]::-webkit-inner-spin-button,
.form-input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-input[type="number"] {
    -moz-appearance: textfield;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.btn-primary {
    flex: 1;
    min-width: 120px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    padding: 14px 20px;
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: #10b981;
    color: #10b981;
}

.preview-section {
    display: flex;
    flex-direction: column;
}

.preview-header {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-header::before {
    content: '📄';
    font-size: 20px;
}

.contract-preview {
    background: #f0f0f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-height: 1180px;
    overflow-y: auto;
}

.contract-preview-inner {
    width: 210mm;
    min-height: 297mm;
    background: white;
    border: 1px solid #e0e0e0;
    padding: 25mm 20mm;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.contract-content {
    font-family: 'SimSun', 'Songti SC', serif;
    line-height: 1.8;
    font-size: 16px;
    color: #1e293b;
}

.contract-title {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.contract-info {
    margin-bottom: 20px;
    padding: 16px;
    border-radius: 12px;
}

.contract-info p {
    margin: 8px 0;
    font-size: 15px;
}

.contract-info span {
    font-weight: 500;
    color: #059669;
}

.contract-body {
    margin: 20px 0;
}

.contract-body p {
    margin: 12px 0;
    text-indent: 2em;
}

.contract-body h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: #0f172a;
}

.contract-body ol {
    padding-left: 2em;
    margin: 12px 0;
}

.contract-body li {
    margin: 8px 0;
    text-indent: 0;
}

.contract-body span {
    font-weight: 500;
    color: #059669;
}

.contract-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dashed #cbd5e1;
}

.contract-footer p {
    text-align: center;
    font-size: 14px;
    color: #64748b;
}

.contract-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding: 20px;
}

.signature-party {
    flex: 1;
    text-align: center;
}

.signature-label {
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 12px;
    font-weight: 500;
}

.signature-date {
    font-size: 14px;
    color: #1e293b;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 25mm 20mm 30mm;
        
        @top-left { content: ''; }
        @top-right { content: ''; }
        @bottom-left { content: ''; }
        @bottom-right { content: ''; }
        @bottom-center {
            content: '第 ' counter(page) ' 页';
            font-size: 14px;
            color: #64748b;
            font-family: 'SimSun', 'Songti SC', serif;
        }
    }
    
    .form-section,
    .button-group,
    .preview-header,
    .app-footer,
    .sticker-home,
    .sticker-line,
    .sidebar {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .app-main {
        min-height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .contract-page {
        display: block !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .preview-section {
        display: block !important;
        margin: 0 !important;
    }
    
    .contract-preview {
        background: white !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .contract-preview-inner {
        width: 100% !important;
        min-height: auto !important;
        background: white !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
    }
    
    .contract-content {
        font-family: 'SimSun', 'Songti SC', serif !important;
        line-height: 1.8 !important;
        font-size: 16px !important;
        color: #1e293b !important;
    }
    
    .contract-title {
        text-align: center !important;
        font-size: 24px !important;
        font-weight: bold !important;
        margin-bottom: 30px !important;
        padding-bottom: 20px !important;
        border-bottom: 2px solid #e2e8f0 !important;
    }
    
    .contract-info {
        margin-bottom: 20px !important;
        padding: 16px !important;
        background: #f8fafc !important;
        border-radius: 12px !important;
    }
    
    .contract-info p {
        margin: 8px 0 !important;
        font-size: 15px !important;
    }
    
    .contract-info span {
        font-weight: 500 !important;
        color: #059669 !important;
    }
    
    .contract-body {
        margin: 20px 0 !important;
    }
    
    .contract-body p {
        margin: 12px 0 !important;
        text-indent: 2em !important;
    }
    
    .contract-body h3 {
        font-size: 17px !important;
        font-weight: 600 !important;
        margin: 24px 0 12px !important;
        color: #0f172a !important;
    }
    
    .contract-body ol {
        padding-left: 2em !important;
        margin: 12px 0 !important;
    }
    
    .contract-body li {
        margin: 8px 0 !important;
    }
    
    .contract-body span {
        font-weight: 500 !important;
        color: #059669 !important;
    }
    
    .contract-footer {
        margin-top: 40px !important;
        padding-top: 20px !important;
        border-top: 1px dashed #cbd5e1 !important;
    }
    
    .contract-footer p {
        text-align: center !important;
        font-size: 14px !important;
        color: #64748b !important;
    }
    
    .contract-signatures {
        display: flex !important;
        justify-content: space-between !important;
        margin-top: 60px !important;
        padding: 20px !important;
    }
    
    .signature-party {
        flex: 1 !important;
        text-align: center !important;
    }
    
    .signature-label {
        font-size: 15px !important;
        color: #1e293b !important;
        margin-bottom: 12px !important;
        font-weight: 500 !important;
    }
    
    .signature-date {
        font-size: 14px !important;
        color: #64748b !important;
    }
}