/* 现代移动端UI样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

/* 头部样式 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: #21a4f4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.header .back-btn {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header .back-btn:before {
    content: '';
    width: 12px;
    height: 12px;
    border-left: 2px solid white;
    border-top: 2px solid white;
    transform: rotate(-45deg);
}

/* 内容区域 */
.content {
    padding-top: 72px;
    padding-bottom: 20px;
    min-height: 100vh;
}

/* 导航按钮样式 */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 0 16px;
    margin-bottom: 24px;
}

.nav-item {
    background: white;
    border-radius: 12px;
    padding: 20px 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-item:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.nav-item a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    margin: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    color: #21a4f4;
}

/* 联系人列表样式 */
.contact-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 0 16px;
}

.contact-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.contact-item:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.contact-name {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.contact-number {
    font-size: 15px;
    color: #666;
}

.contact-item a {
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-item a:after {
    content: '呼叫';
    font-size: 14px;
    color: #21a4f4;
    padding: 6px 12px;
    background-color: rgba(33, 164, 244, 0.1);
    border-radius: 16px;
}

/* 搜索栏 */
.search-bar {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: white;
    padding: 12px 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 999;
}

.search-input {
    width: 100%;
    height: 36px;
    padding: 0 16px;
    border: 1px solid #ddd;
    border-radius: 18px;
    font-size: 15px;
    outline: none;
}

.search-input:focus {
    border-color: #21a4f4;
}

/* 返回按钮 */
.back-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 0 16px;
}

.back-button {
    flex: 1;
    background: #21a4f4;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 2px 4px rgba(33, 164, 244, 0.3);
    transition: all 0.3s ease;
}

.back-button:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(33, 164, 244, 0.3);
}

.back-button a {
    color: white;
    text-decoration: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .contact-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .contact-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-item a:after {
        content: '';
        width: 24px;
        height: 24px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2321a4f4' viewBox='0 0 24 24'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        padding: 0;
    }
}

@media (max-width: 360px) {
    .contact-list {
        grid-template-columns: 1fr;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #21a4f4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state img {
    width: 80px;
    height: 80px;
    opacity: 0.5;
    margin-bottom: 16px;
}

/* 字母索引 */
.letter-index {
    position: fixed;
    top: 150px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #999;
    z-index: 998;
}

.letter-index-item {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.letter-index-item:active {
    background-color: #21a4f4;
    color: white;
}

/* 部门标题 */
.department-title {
    font-size: 18px;
    font-weight: 600;
    margin: 16px 16px 12px;
    color: #21a4f4;
    padding-left: 8px;
    border-left: 4px solid #21a4f4;
}

/* 底部版权信息 */
.footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
}

/* 搜索结果高亮 */
.highlight {
    background-color: #fff9c4;
    padding: 0 2px;
    border-radius: 2px;
}