/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f0f2f5;
    font-family: "Microsoft YaHei", sans-serif;
    padding: 20px;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
}

/* ========== 头部样式 ========== */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
}

.header .btn {
    background: #fff;
    color: #764ba2;
    padding: 10px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.header .btn:hover {
    transform: scale(1.05);
}

/* ========== 筛选栏样式 ========== */
.filter-box {
    background: #fff;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.filter-box .group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-box label {
    font-size: 13px;
    color: #666;
    font-weight: bold;
}

.filter-box input,
.filter-box select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 130px;
}

.filter-box input:focus,
.filter-box select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-box .btn-search {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 8px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
    height: 38px;
}

.filter-box .btn-search:hover {
    background: #5a67d8;
}

.filter-box .btn-reset {
    background: #e2e8f0;
    color: #333;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    height: 38px;
    text-decoration: none;
    line-height: 22px;
}

.filter-box .btn-reset:hover {
    background: #cbd5e0;
}

.filter-box select.auto-submit {
    cursor: pointer;
}

.auto-refresh-hint {
    font-size: 12px;
    color: #999;
    margin-left: 10px;
}

/* ========== 统计样式 ========== */
.stats {
    background: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #555;
    font-size: 14px;
    border-left: 4px solid #667eea;
}

.stats strong {
    color: #333;
    font-size: 18px;
}

/* ========== 表格样式 ========== */
.table-wrap {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
    padding: 0 0 10px 0;
    position: relative;
    min-height: 200px;
}

.table-wrap.loading {
    opacity: 0.6;
    pointer-events: none;
}

.table-wrap.loading::after {
    content: "⏳ 加载中...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px 40px;
    border-radius: 12px;
    font-size: 18px;
    color: #667eea;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 1400px;
}

th {
    background: #f7f8fc;
    color: #333;
    font-weight: bold;
    padding: 14px 10px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}

tr:hover {
    background: #fafbff;
}

/* ========== 标签/徽章样式 ========== */
.badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.badge-male {
    background: #dbeafe;
    color: #1e40af;
}

.badge-female {
    background: #fce4ec;
    color: #c62828;
}

.house-car-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    background: #ebf8ff;
    color: #2b6cb0;
}

.detail-link {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}

.detail-link:hover {
    text-decoration: underline;
}

/* ========== 按钮样式 ========== */
.btn-add {
    background: #48bb78;
    color: #fff;
    padding: 6px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    transition: 0.3s;
}

.btn-add:hover {
    background: #38a169;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
}

.no-data span {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

/* ========== 照片相关样式 ========== */
.photo-view-btn {
    display: inline-block;
    background: #667eea;
    color: #fff !important;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 12px;
    text-decoration: none;
    transition: 0.3s;
    cursor: pointer;
}

.photo-view-btn:hover {
    background: #5a67d8;
    transform: scale(1.05);
}

.no-photo {
    color: #e53e3e;
    font-size: 18px;
    font-weight: bold;
}

/* ========== 弹窗/模态框样式 ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 15px;
}

.modal-header h2 {
    color: #333;
}

.modal-close-btn {
    background: #e2e8f0;
    padding: 4px 18px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    color: #333;
    font-size: 14px;
}

.modal-close-btn:hover {
    background: #cbd5e0;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 30px;
    font-size: 14px;
    line-height: 2;
}

.detail-grid .full-width {
    grid-column: 1/3;
}

.detail-grid .highlight {
    background: #fef3c7;
    padding: 12px;
    border-radius: 8px;
    margin-top: 5px;
}

/* ========== 照片灯箱样式 ========== */
.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    z-index: 3001;
    backdrop-filter: blur(8px);
}

.photo-modal-inner {
    max-width: 80%;
    max-height: 85vh;
    position: relative;
}

.photo-modal-inner img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.photo-modal-name {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 15px;
    border-radius: 20px;
}

.photo-modal-close {
    position: absolute;
    top: -50px;
    right: -50px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #fff;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-modal-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}

/* ========== 响应式 ========== */
@media (max-width: 700px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .detail-grid .full-width {
        grid-column: 1;
    }
    .filter-box .group {
        width: 100%;
    }
    .filter-box input,
    .filter-box select {
        width: 100%;
    }
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* ========== 匹配模态框样式 ========== */
.match-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    align-items: flex-start;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
    padding: 30px 20px;
    overflow-y: auto;
}

.match-modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 1400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px 35px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    margin: auto;
}

.match-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 15px;
    /*position: sticky;*/
    top: 0;
    background: #fff;
    z-index: 10;
}

.match-modal-header h2 {
    color: #333;
    font-size: 22px;
}

.match-modal-header h2 span {
    color: #f59e0b;
}

.match-modal-close {
    background: #e2e8f0;
    padding: 6px 20px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    transition: 0.3s;
}

.match-modal-close:hover {
    background: #cbd5e0;
}

/* 模态框内的会员信息卡片 */
.match-member-info {
    background: #f7f8fc;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px 20px;
    font-size: 14px;
    color: #333;
    border-left: 4px solid #667eea;
}

.match-member-info .label {
    color: #888;
    font-weight: normal;
}

.match-member-info .value {
    font-weight: bold;
    color: #333;
}

/* 模态框内的筛选栏 */
.match-filter-box {
    background: #fff;
    padding: 15px 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 15px;
    align-items: flex-end;
}

.match-filter-box .group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.match-filter-box label {
    font-size: 12px;
    color: #666;
    font-weight: bold;
}

.match-filter-box input,
.match-filter-box select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    width: 110px;
}

.match-filter-box input:focus,
.match-filter-box select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.match-filter-box .btn-match-search {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 6px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    height: 34px;
    transition: 0.3s;
}

.match-filter-box .btn-match-search:hover {
    background: #5a67d8;
}

.match-filter-box .btn-match-reset {
    background: #e2e8f0;
    color: #333;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    height: 34px;
    font-size: 13px;
    transition: 0.3s;
}

.match-filter-box .btn-match-reset:hover {
    background: #cbd5e0;
}

.match-filter-box .gender-display {
    font-size: 14px;
    font-weight: bold;
    color: #667eea;
    padding: 6px 0;
    line-height: 34px;
}

/* 模态框内的统计 */
.match-stats {
    background: #f8fafc;
    padding: 10px 18px;
    border-radius: 8px;
    margin-bottom: 15px;
    color: #555;
    font-size: 14px;
    border-left: 4px solid #f59e0b;
}

.match-stats strong {
    color: #333;
    font-size: 18px;
}

/* 模态框内的表格 */
.match-table-wrap {
    background: #fff;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid #edf2f7;
}

.match-table-wrap table {
    min-width: 1200px;
    font-size: 13px;
}

.match-table-wrap th {
    background: #f7f8fc;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}

.match-table-wrap td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}

.match-table-wrap tr:hover {
    background: #fafbff;
}

.match-table-wrap .no-data {
    text-align: center;
    padding: 40px;
    color: #999;
}

.match-table-wrap .no-data span {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

/* 模态框加载状态 */
.match-loading-overlay {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.match-loading-overlay .spinner {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 匹配度标签 */
.match-score-tag {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 12px;
    color: #fff;
}

.match-score-tag.high {
    background: #48bb78;
}

.match-score-tag.medium {
    background: #f6ad55;
}

.match-score-tag.low {
    background: #fc8181;
}