body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9fb;
    color: #333;
}

.contact-list {
    list-style-type: none;
    padding: 0 20px;
    margin: 20px 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.contact-item {
    width: 100%;
    margin: 0;
    cursor: pointer;
    transition: transform 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    background-color: #fff;
}

.contact-item:hover {
    transform: scale(1.02);
}

.contact-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 15px;
}

.contact-details {
    flex: 1;
    background-color: #f0f0f5;
    padding: 10px;
    border-radius: 8px;
    color: #333;
}

.contact-details strong {
    color: #333;
}

.contact-department {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #e0e0f5;
    padding: 10px;
    border-radius: 8px;
    margin-left: 20px;
    margin-right: 20px;
    text-align: center;
    color: #555;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    z-index: 1000;
    max-width: 90%;
    width: 250px;
    text-align: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.modal.show {
    display: block;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.modal img {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.modal .contact-details {
    margin-top: 15px;
    padding: 15px;
    background: #f9f9fb;
    border-radius: 12px;
}

.modal .name-department {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    justify-content: center;
}

.modal .name-department strong {
    font-size: 18px;
    color: #333;
}

.modal .department-tag {
    background: #7070ff;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.modal .info-row {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.modal #modalStatus {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    min-width: 50px;
    background-color: #e8f5e8;
    color: #2d5a2d;
    border: 1px solid #c3e6c3;
    transition: all 0.3s ease;
}


.modal #modalStatus.status-honorary {
    background-color: #fff8e1;
    color: #f57c00;
    border: 1px solid #ffcc02;
}

.modal .separator {
    margin: 0 8px;
    color: #999;
}

.modal .phone-number {
    display: block;
    color: #7070ff;
    font-size: 20px;
    font-weight: bold;
    margin-top: 5px;
    text-decoration: none;
    cursor: pointer;
}

.modal .phone-number:hover {
    opacity: 0.8;
}

.overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 999;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.overlay.show {
    background-color: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.search-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 15px;
    background-color: #fff;
    margin: 10px 20px;
    border-radius: 20px;
    border: 1px solid #eee;
}

.search-bar input[type="text"] {
    flex: 1;
    padding: 8px;
    border: none;
    background: none;
    font-size: 14px;
    color: #666;
}

.search-bar input[type="text"]::placeholder {
    color: #999;
}

.search-bar button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    padding: 0;
    margin-left: 10px;
    display: flex;
    align-items: center;
}

/* 移除输入框的默认样式 */
.search-bar input[type="text"]:focus {
    outline: none;
}

.department-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    margin: 20px;
}

.department-header, .status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    margin: 10px 20px;
}

.department-header span, .status-header span {
    font-size: 16px;
    font-weight: bold;
}

.view-all, .status-options {
    text-decoration: none;
    color: #666;
    font-size: 14px;
}

.status-options {
    display: flex;
    gap: 15px;
}

.department-list, .status-list {
    display: flex;
    overflow-x: auto;
    padding: 10px 20px;
    margin: 0;
    gap: 15px;
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

/* Chrome, Safari and Opera */
.department-list::-webkit-scrollbar, .status-list::-webkit-scrollbar {
    display: none;
}

.department-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.status-item {
    display: flex;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f0f0f5;
    padding: 5px 10px;
    border-radius: 15px;
    border: 2px solid transparent;
}

.status-item.active {
    background-color: #7070ff7d;
    color: white;
    box-shadow: 0 2px 8px rgba(112, 112, 255, 0.3);
}

.status-count {
    margin-left: 3px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.status-item.active .status-count {
    background-color: rgba(255, 255, 255, 0.3);
}

.department-item:hover, .status-item:hover {
    transform: scale(1.05);
}

.department-item.active .icon, .status-item.active .icon {
    background-color: #dbdbf6;
}

.department-item.active span, .status-item.active span {
    color: #333;
    font-weight: bold;
}

.department-item .icon, .status-item .icon {
    width: 24px;
    height: 24px;
    fill: #666;
    margin-bottom: 5px;
    background-color: #f0f0f5;
    padding: 20px;
    border-radius: 8px;
}

.department-item span, .status-item span {
    font-size: 12px;
    color: #666;
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

.no-result-tip {
    text-align: center;
    padding: 20px;
    color: #666;
    margin-top: 100px;
    animation: float 2s ease-in-out infinite;
}

.status-tag {
    display: inline-block;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 5px;
}



.header {
    position: relative;
    padding: 20px 0;
    margin-bottom: 20px;
    overflow: hidden;
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background-color: #f0f0f5;
    clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%);
    z-index: -1;
}

.header h1 {
    color: #333;
    margin: 0 20px 20px;
    font-size: 24px;
}

.header-controls {

    align-items: center;

    margin: 0 20px 20px;
}


/* 更新搜索框样式以适应新的头部设计 */
.search-bar {
    margin: 10px 20px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 添加一个容器来限制最大宽度 */
.container {
    max-width: 768px;
    margin: 0 auto;
    /* padding: 0 20px; */
}

/* 更新头部、部门列表和状态列表的容器 */
.header,
.department-header,
.department-list,
.status-header,
.status-list {
    max-width: 768px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .contact-list {
        grid-template-columns: 1fr;
    }
}

.password-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f9f9fb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 9999;
    padding-top: 100px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.password-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background-color: #f0f0f5;
    clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%);
    z-index: -1;
}

.password-container {
    width: 90%;
    max-width: 320px;
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.password-title {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #333;
    font-size: 24px;
    margin: 0;
    z-index: 2;
    width: 100%;
    text-align: left;
    padding: 0 20px;
    box-sizing: border-box;
}

.password-container h2 {
    margin-bottom: 30px;
    color: #858585;
}

.password-input {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.password-digit {
    width: 40px;
    height: 40px;
    border: 2px solid #7070ff;
    border-radius: 8px;
    text-align: center;
    font-size: 20px;
    background: #f9f9fb;
    transition: all 0.3s ease;
}

.password-digit:focus {
    outline: none;
    border-color: #7070ff;
    background: white;
}

.error-message {
    color: #ff4444;
    font-size: 14px;
    height: 20px;
    margin: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.show {
    opacity: 1;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.error {
    text-align: center;
    padding: 40px 20px;
    color: #ff4444;
    background: #fff0f0;
    border-radius: 12px;
    margin: 20px;
    animation: shake 0.5s ease;
}

.error button {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 20px;
    background: #7070ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.error button:hover {
    background: #5555ff;
}

/* 分页控件样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    padding: 10px;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background: #f0f0f5;
    border-color: #7070ff;
    color: #7070ff;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    color: #666;
    font-size: 14px;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* 懒加载图片样式 */
.lazy-img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-img.loaded {
    opacity: 1;
}

/* 错误提示样式 */
.error-tip {
    text-align: center;
    padding: 20px;
    color: #ff4444;
    background: #fff0f0;
    border-radius: 8px;
    margin: 20px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

/* 当密码页面隐藏时的样式 */
.password-page[style*="visibility: hidden"] .password-container {
    transform: translateY(20px);
}
