/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    font-weight: 700;
}

.logo {
    display: inline-block;
    margin-right: 10px;
    font-size: 1.2em;
}

.subtitle {
    font-size: 1.2em;
    margin-bottom: 15px;
    opacity: 0.9;
}

.stats {
    font-size: 1em;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
    backdrop-filter: blur(10px);
}

/* 搜索栏样式 */
.search-bar {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

#search-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

#search-input:focus {
    border-color: #667eea;
}

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

.filter-tab {
    padding: 8px 20px;
    border: 2px solid #e1e5e9;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.filter-tab:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-tab.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* 主内容区域 */
.main-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-height: 400px;
}

/* vCard 网格 */
.vcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* vCard 卡片 */
.vcard-item {
    background: white;
    border: 2px solid #f1f3f4;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.vcard-item:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.vcard-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vcard-item:hover::before {
    opacity: 1;
}

.vcard-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.vcard-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    margin-right: 15px;
    object-fit: cover;
    border: 2px solid #f1f3f4;
}

.vcard-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.vcard-category {
    font-size: 12px;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 5px;
    display: inline-block;
}

.vcard-info {
    margin-top: 15px;
}

.vcard-phones {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.vcard-url {
    font-size: 14px;
    color: #667eea;
    text-decoration: none;
}

.vcard-url:hover {
    text-decoration: underline;
}

.phone-item {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 6px;
    margin: 2px 4px 2px 0;
    display: inline-block;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-icon {
    font-size: 3em;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #333;
}

/* 弹框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 30px 30px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f1f3f4;
}

.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    margin-right: 20px;
    object-fit: cover;
    border: 2px solid #f1f3f4;
}

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

.modal-body {
    padding: 20px 30px;
}

.contact-info {
    margin-top: 20px;
}

.contact-info > div {
    margin-bottom: 15px;
}

.contact-info strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.modal-footer {
    padding: 20px 30px 30px;
    text-align: right;
}

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

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

.btn-primary:hover {
    background: #5a6fd8;
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e1e5e9;
}

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

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #999;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close:hover {
    color: #333;
    background: #f8f9fa;
}

/* 页脚 */
.footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2.5em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .vcard-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .search-bar {
        padding: 15px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .filter-tabs {
        gap: 8px;
    }
    
    .filter-tab {
        padding: 6px 15px;
        font-size: 13px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    .modal-header {
        padding-bottom: 15px;
    }
    
    .modal-footer {
        padding-top: 15px;
    }
}

@media (max-width: 480px) {
    .vcard-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .header h1 {
        font-size: 2em;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* 选中文本颜色 */
::selection {
    background: rgba(102, 126, 234, 0.2);
    color: #333;
}

/* 焦点轮廓 */
button:focus,
input:focus {
    outline: 2px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}