/* 弹窗相关样式 */
.popup-overlay {

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

/* 全局样式变量定义 */
:root {
    --primary-color: #165dff;
    --primary-dark: #0040c9;
    --primary-light: rgba(22, 93, 255, 0.1);
    --success-color: #00b42a;
    --success-dark: #00a127;
    --success-light: rgba(0, 180, 42, 0.1);
    --warning-color: #ff7d00;
    --warning-dark: #e06c00;
    --purple-color: #722ed1;
    --purple-dark: #6224c5;
    --gray-light: #f5f5f5;
    --gray: #e5e6eb;
    --gray-dark: #d0d3d9;
    --text-primary: #333;
    --text-secondary: #666;
    --text-tertiary: #999;
    --border-radius: 6px;
    --border-radius-lg: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    --transition: all 0.2s ease;
}

/* 容器样式 */
.container {
    max-width: 1000px;
    margin: 0 auto 20px;
    background-color: white;
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

/* 整体弹窗内容容器 */
.main-content {
    background-color: white;
    border-radius: var(--border-radius-lg);
    width: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

/* 内容区块样式 */
.content-section {
    padding: 20px;
    border-bottom: 1px solid var(--gray);
}

.content-section:last-child {
    border-bottom: none;
}

/* 标题样式 */
.title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.title1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.title::before {
    content: "";
    font-size: 22px;
}

.table-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

.popup-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 按钮样式统一 */
.btn,
.close-btn,
.preview-btn,
.global-confirm-btn,
.open-popup-btn {
    padding: 9px 18px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
    outline: none;
}

.btn:hover,
.close-btn:hover,
.preview-btn:hover,
.global-confirm-btn:hover,
.open-popup-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn:active,
.close-btn:active,
.preview-btn:active,
.global-confirm-btn:active,
.open-popup-btn:active {
    transform: translateY(0);
}

.btn-success,
.global-confirm-btn {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover,
.global-confirm-btn:hover {
    background-color: var(--success-dark);
    box-shadow: 0 2px 8px rgba(0, 180, 42, 0.2);
}

.btn-primary,
.open-popup-btn {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover,
.open-popup-btn:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(22, 93, 255, 0.2);
}

.preview-btn {
    background-color: #6c757d;
    color: white;
}

.preview-btn:hover {
    background-color: #5a6268;
}

.close-btn {
    background: none;
    font-size: 20px;
    color: var(--text-secondary);
    padding: 0 5px;
}

.close-btn:hover {
    color: var(--text-primary);
    background-color: var(--gray-light);
}

/* 布局组件 */
.header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray);
}

.actions {
    display: flex;
    gap: 12px;
}

/* 签署方卡片样式 */
.signers-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.signer-card {
    background-color: white;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--gray);
    padding: 20px;
    transition: var(--transition);
}

.signer-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--gray-dark);
}

.card-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
}

.card-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.card-actions {
    display: flex;
    gap: 16px;
}

/* 选择框样式 */
.type-select {
    padding: 5px 12px;
    border-radius: 20px;
    border: none;
    color: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.type-select:hover {
    transform: scale(1.05);
}

.type-personal {
    background-color: var(--purple-color);
}

.type-personal:hover {
    background-color: var(--purple-dark);
}

.type-company {
    background-color: var(--warning-color);
}

.type-company:hover {
    background-color: var(--warning-dark);
}

.type-copy {
    background-color: var(--primary-color);
}

.type-copy:hover {
    background-color: var(--primary-dark);
}

/* 文本和标签样式 */
.signer-name {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.signer-role {
    font-size: 12px;
    color: var(--text-tertiary);
    padding: 2px 8px;
    background-color: var(--gray-light);
    border-radius: 4px;
    display: none;
}

.action-link {
    font-size: 13px;
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 4px;
}

.action-link:hover {
    color: var(--primary-dark);
    background-color: var(--primary-light);
}

.icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    text-align: center;
}

/* 表单样式 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
}

.form-group {
    width: 100%;
}

.input-field,
.order-input,
.data-table input[type="text"],
.data-table input[type="date"],
.data-table input[type="datetime-local"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-dark);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    color: var(--text-primary);
}

.order-input {
    width: 50px;
    padding: 5px 8px;
    display: none;
}

.input-field:focus,
.order-input:focus,
.data-table input[type="text"]:focus,
.data-table input[type="date"]:focus,
.data-table input[type="datetime-local"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.2);
}

.input-field::placeholder,
.data-table input[type="text"]::placeholder {
    color: #c9c9c9;
}

/* 表格样式 */
.table-container {
    margin-bottom: 30px;
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 600px;
}

.data-table th,
.data-table td {
    border: 1px solid var(--gray);
    padding: 12px 15px;
    text-align: left;
    white-space: nowrap;
    min-width: 120px;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.data-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    border-right: 1px solid var(--gray);
}

.data-table tr td:first-child {
    /* background-color: var(--primary-light); */
    font-weight: 500;
}

.data-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.data-table tr:hover {
    background-color: var(--primary-light);
}

.data-table input[type="text"] {
    max-width: 200px;
}

/* 弹窗样式 */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.popup-inner {
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
}

/* .popup-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
} */
.popup-header{
    padding: 15px 20px;
    border-bottom: 1px solid var(--gray);
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 100;
}
.popup-body {
    flex: 1;
    overflow-y: auto;
}

.popup-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--gray);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: white;
    z-index: 100;
    position: sticky;
    bottom: 0;
}

/* 结果和输出区域 */
.result-area {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--gray-light);
    border-radius: var(--border-radius-lg);
    font-family: monospace;
    overflow-x: auto;
    display: none;
}

.console-output {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    font-family: "Consolas", monospace;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
}

/* 动画效果 */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

.fade-out {
    animation: fadeOut 0.3s forwards;
}

/* 标识样式 */
.input-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.input-marker:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 标识弹窗样式 */
.marker-popup {
    position: absolute;
    z-index: 100;
    max-width: 200px;
    padding: 12px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--gray);
    display: none;
}

.marker-popup::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -6px;
    transform: translateY(-50%);
    border-width: 6px 6px 6px 0;
    border-style: solid;
    border-color: transparent white transparent transparent;
}
select:disabled {
    color: initial; /* 保持文字颜色 */
}