/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #0066cc;
    --primary-dark: #0052a3;
    --primary-light: #4d94ff;
    --primary-light-2: #e6f2ff;
    --secondary: #6c757d;
    --success: #28a745;
    --success-light: #d4edda;
    --danger: #dc3545;
    --danger-light: #f8d7da;
    --warning: #ffc107;
    --light: #f8f9fa;
    --dark: #343a40;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-md: 0 6px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.2);
    
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    
    --header-height: 60px;
    --nav-height: 60px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: calc(var(--nav-height) + var(--safe-area-bottom));
}

/* 应用头部 */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--white);
}

.logo-icon {
    font-size: 24px;
    margin-right: 10px;
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-add {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-add:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* 搜索区域 */
.search-section {
    background: var(--white);
    padding: 80px 20px 20px;
    position: relative;
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: var(--gray-500);
    font-size: 16px;
}

.search-input {
    width: 100%;
    height: 45px;
    padding: 0 40px 0 40px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    font-size: 16px;
    background: var(--white);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.clear-search {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 14px;
}

.search-btn {
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.search-btn:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
}

/* 筛选区域 */
.filter-toggle {
    text-align: center;
}

.filter-btn {
    background: var(--white);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 8px 16px;
    font-size: 14px;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--white);
    border-radius: var(--radius);
    margin-top: 10px;
    box-shadow: var(--shadow);
}

.filter-panel.show {
    max-height: 500px;
    padding: 20px;
}

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

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
}

.location-select {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.filter-select, .form-select {
    width: 100%;
    height: 40px;
    padding: 0 15px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--gray-700);
    background: var(--white);
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.filter-select:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

/* 确保下拉框选项有深色文字 */
.filter-select option, .form-select option {
    background: var(--white);
    color: var(--gray-800);
    padding: 8px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-block {
    width: 100%;
}

.btn-be-first {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-lg);
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    transition: all 0.3s ease;
}

.btn-be-first:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.4);
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 0 20px 20px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    padding: 15px;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 主要内容区域 */
.app-main {
    padding: 0 20px 20px;
}

.list-header {
    margin-bottom: 20px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 10px;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    background: var(--primary-light-2);
    color: var(--primary-dark);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--primary-light);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 48px;
    color: var(--gray-400);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--gray-700);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--gray-600);
    margin-bottom: 20px;
    font-size: 14px;
}

/* 飞手列表 */
.pilots-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.pilot-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    border: 1px solid transparent;
}

.pilot-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

.pilot-avatar {
    position: relative;
    flex-shrink: 0;
}

.avatar-icon {
    font-size: 50px;
    color: var(--primary-light);
}

.gender-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--white);
}

.gender-badge.male {
    background: var(--primary);
}

.gender-badge.female {
    background: var(--danger);
}

.pilot-info {
    flex: 1;
    min-width: 0;
}

.pilot-header {
    margin-bottom: 8px;
}

.pilot-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pilot-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--gray-600);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-item a {
    color: var(--primary);
    text-decoration: none;
}

.meta-item a:hover {
    text-decoration: underline;
}

.pilot-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.license-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    width: fit-content;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skill-tag {
    background: var(--primary-light-2);
    color: var(--primary-dark);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--primary-light);
}

.license-preview {
    width: 40px;
    height: 40px;
    background: var(--primary-light-2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.license-preview:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-top: 1px solid var(--gray-200);
}

.page-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    color: var(--gray-700);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.page-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.page-info {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
}

/* 底部导航 */
.app-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-area-bottom));
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: var(--safe-area-bottom);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--gray-600);
    padding: 10px;
    transition: all 0.3s ease;
    flex: 1;
    height: 100%;
    border: none;
    background: none;
    cursor: pointer;
    outline: none;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active .nav-icon {
    transform: translateY(-2px);
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.publish-modal {
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--gray-600);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--gray-800);
}

.modal-body {
    padding: 20px;
}

/* 发布表单样式 */
.form-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
    position: relative;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title i {
    color: var(--primary);
}

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

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: var(--primary);
    width: 16px;
}

.form-input, .form-select {
    width: 100%;
    height: 45px;
    padding: 0 15px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 16px;
    color: var(--gray-800);
    background: var(--white);
    transition: all 0.3s ease;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-hint {
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 5px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    flex: 1;
}

.radio-label:hover {
    border-color: var(--primary-light);
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
}

.radio-text {
    font-size: 14px;
    color: var(--gray-700);
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    border-color: var(--primary);
    background: var(--primary-light-2);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.checkbox-text {
    font-size: 14px;
    color: var(--gray-700);
}

.file-preview {
    margin-top: 10px;
}

.preview-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--gray-300);
    display: block;
    margin-bottom: 10px;
}

.remove-preview-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.remove-preview-btn:hover {
    background: #dc3545;
    transform: translateY(-1px);
}

.form-actions {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 文件上传样式 */
input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: var(--primary);
    background: var(--primary-light-2);
}

input[type="file"]::file-selector-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="file"]::file-selector-button:hover {
    background: var(--primary-dark);
}

/* 图片查看模态框 */
.image-modal {
    max-width: 90%;
}

.image-modal .modal-body {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.license-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

/* Toast消息 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    top: 30px;
}

.toast-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.toast-error {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.toast-info {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .search-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-btn {
        width: 100%;
        height: 45px;
    }
    
    .location-select {
        grid-template-columns: 1fr;
    }
    
    .pilot-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .pilot-avatar {
        margin: 0 auto;
    }
    
    .pilot-info {
        text-align: center;
    }
    
    .skills-tags {
        justify-content: center;
    }
    
    .license-preview {
        position: absolute;
        top: 15px;
        right: 15px;
    }
    
    .form-section-title {
        font-size: 15px;
    }
    
    .btn-be-first {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .modal-overlay {
        align-items: center;
    }
    
    .modal-content {
        max-height: 80vh;
    }
    
    .publish-modal {
        max-height: 75vh;
    }
    
    .checkbox-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 触摸反馈 */
@media (hover: hover) {
    .pilot-card:hover {
        transform: translateY(-2px);
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}