* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
    min-height: 44px;
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    background-color: white;
}

.form-group select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23667eea" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px 12px;
    padding-right: 32px;
    cursor: pointer;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f0f2f5;
    border: 1px solid #e1e5eb;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    min-height: 36px;
}

.checkbox-item:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.checkbox-item input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-item:has(input:checked) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.form-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f2f5;
    color: #555;
}

.btn-secondary:hover {
    background: #e1e5eb;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-block {
    width: 100%;
}

.navbar {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.navbar-nav {
    display: flex;
    gap: 20px;
    list-style: none;
}

.navbar-nav a {
    color: #555;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    background: #667eea;
    color: white;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: #f0f2f5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #e1e5eb;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.hidden {
    display: none !important;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th,
table td {
    padding: 12px 16px;
    border: 1px solid #e1e5eb;
    text-align: left;
}

table th {
    background: #f0f2f5;
    font-weight: 600;
}

table tr:hover {
    background: #f8f9fa;
}

.match-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    display: flex;
    gap: 20px;
    align-items: center;
    transition: transform 0.3s;
}

.match-card:hover {
    transform: translateY(-3px);
}

.match-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #667eea;
}

.match-info {
    flex: 1;
}

.match-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.match-meta {
    color: #888;
    font-size: 14px;
    margin-top: 5px;
}

.match-score {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.match-reasons {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f2f5;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
}

.photo-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #e1e5eb;
    cursor: pointer;
    font-size: 24px;
    color: #888;
}

.photo-upload:hover {
    border-color: #667eea;
    color: #667eea;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f2f5;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: #667eea;
    color: white;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #333;
}

.pagination {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 16px;
    background: white;
    border: 1px solid #e1e5eb;
    border-radius: 6px;
    cursor: pointer;
}

.pagination button:hover,
.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
}

.search-box button {
    padding: 10px 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    color: #888;
    margin-top: 5px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.message-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.message-content {
    flex: 1;
}

.message-time {
    color: #888;
    font-size: 12px;
}

.unread-badge {
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.activity-card {
    background: white;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 18px;
}

.activity-title {
    font-size: 20px;
    font-weight: 600;
    color: #2d3436;
    line-height: 1.4;
}

.activity-meta {
    color: #5a6268;
    font-size: 15px;
    margin-top: 12px;
    line-height: 1.6;
}

.activity-description {
    margin-top: 16px;
    color: #495057;
    font-size: 15px;
    line-height: 1.7;
}

.activity-footer {
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #636e72;
    font-size: 14px;
}

/* 照片预览模态框 */
.photo-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
}

.photo-preview-modal .close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10001;
}

.photo-preview-modal .img-container {
    max-width: 90vw;
    max-height: 90vh;
    cursor: default;
}

.photo-preview-modal img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.photo-preview-modal .hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* 可点击放大的照片样式 */
.photo-clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.photo-clickable:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 照片网格大图显示 */
.photo-grid-large {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.photo-grid-large .photo-item {
    width: 200px;
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f2f5;
}

.photo-grid-large .photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f0f2f5;
    border-radius: 6px;
    cursor: pointer;
}

.checkbox-item input {
    width: 18px;
    height: 18px;
}

.checkbox-item.selected {
    background: #667eea;
    color: white;
}

.range-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.range-input input {
    width: 80px;
}

.range-input span {
    color: #888;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .form-row,
    .form-row-3,
    .stat-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-row-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 14px;
        font-size: 15px;
        min-height: 44px;
    }
    
    .checkbox-item {
        padding: 6px 10px;
        font-size: 13px;
        min-height: 34px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .checkbox-group {
        gap: 8px;
    }
    
    .checkbox-item {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .checkbox-item input {
        width: 20px;
        height: 20px;
    }
    
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    #photoGrid img {
        width: calc(33.33% - 7px);
        aspect-ratio: 1;
        object-fit: cover;
        border-radius: 8px;
    }
    
    .card-header {
        font-size: 15px;
        padding: 12px 10px;
    }
    
    .btn-save {
        position: sticky;
        bottom: 10px;
        z-index: 100;
    }
    
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 5px;
        padding-bottom: 10px;
        margin-bottom: 15px;
    }
    
    .tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        flex-shrink: 0;
        padding: 10px 14px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .navbar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .navbar-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    
    .navbar-nav li {
        margin: 2px 0;
    }
    
    .navbar-nav a {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .match-card {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .match-avatar {
        width: 80px;
        height: 80px;
        margin: 0 auto 10px;
    }
    
    .match-info {
        margin: 10px 0;
    }
    
    .match-score-container {
        margin: 10px 0;
    }
    
    .bidirectional-scores {
        justify-content: center;
    }
    
    .match-actions {
        flex-direction: row;
        justify-content: center;
        width: 100%;
    }
    
    .match-actions .btn {
        flex: 1;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 15px;
        min-height: 44px;
    }
    
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px;
        padding: 14px 16px;
        min-height: 48px;
        border-radius: 10px;
        border: 2px solid #e1e5eb;
        transition: border-color 0.2s;
    }
    
    input:focus,
    select:focus,
    textarea:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }
    
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .form-group label {
        font-weight: 600;
        color: #333;
    }
    
    .btn {
        padding: 14px 20px;
        font-size: 16px;
        min-height: 48px;
        border-radius: 10px;
        font-weight: 600;
    }
    
    .btn-primary {
        background: linear-gradient(135deg, #667eea, #764ba2);
        color: white;
        border: none;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    
    .btn-primary:active {
        transform: scale(0.98);
    }
    
    .btn-secondary {
        background: #f0f2f5;
        color: #333;
        border: none;
    }
    
    .card {
        padding: 15px;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }
    
    .card-header {
        padding: 12px 0;
        margin-bottom: 15px;
        border-bottom: 2px solid #667eea;
        font-size: 16px;
        font-weight: 600;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 10px 8px;
        word-break: break-word;
    }
    
    .badge {
        padding: 4px 10px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 500;
    }
    
    .photo-grid img {
        aspect-ratio: 1;
        object-fit: cover;
    }
    
    .tab-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .card {
        padding: 15px;
        margin: 10px 0;
    }
    
    .card-header {
        font-size: 18px;
        padding: 12px;
    }
    
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        padding: 15px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .print-table {
        font-size: 12px;
    }
    
    .print-table th,
    .print-table td {
        padding: 5px;
    }
    
    .chat-messages {
        height: 50vh;
    }
    
    #chatInput {
        font-size: 16px;
    }
}