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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 页面容器 */
.page {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.page.active {
    display: block;
}

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

/* 透明卡片样式 */
.card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-body {
    padding: 20px;
}

/* 登录页面 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container .card {
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    color: white;
    font-size: 2rem;
    margin-bottom: 10px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.2);
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
}

.btn-success {
    background: linear-gradient(45deg, #43e97b 0%, #38f9d7 100%);
}

.btn-warning {
    background: linear-gradient(45deg, #fa709a 0%, #fee140 100%);
}

.btn-danger {
    background: linear-gradient(45deg, #ff6b6b 0%, #ffa500 100%);
}

.btn-info {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
}

.btn-secondary {
    background: rgba(108, 117, 125, 0.8);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.header h1 {
    color: white;
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 搜索区域 */
.search-section {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-bar {
    display: flex;
    flex: 1;
    min-width: 250px;
}

.search-bar input {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.search-bar button {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 12px 16px;
}

.search-bar button:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.search-bar button:not(:last-child) {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* 清除搜索按钮样式 */
#clearProjectSearchBtn,
#clearMemberSearchBtn {
    min-width: 44px;
    background: rgba(108, 117, 125, 0.8);
    transition: all 0.3s ease;
}

#clearProjectSearchBtn:hover,
#clearMemberSearchBtn:hover {
    background: rgba(220, 53, 69, 0.8);
    transform: scale(1.05);
}

/* 项目操作区域 */
.project-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 分页设置 */
.pagination-settings {
    margin-bottom: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.pagination-settings label {
    color: white;
    font-weight: 500;
}

.pagination-settings select {
    width: auto;
    min-width: 80px;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.pagination-settings select:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
}

/* 项目列表 */
.projects-list,
.members-list {
    margin-bottom: 20px;
}

.project-item,
.member-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-item:hover,
.member-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.project-info,
.member-info {
    flex: 1;
    color: white;
}

.project-name,
.member-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.project-name:hover {
    color: #4facfe;
}

.project-meta,
.member-meta {
    font-size: 0.9rem;
    opacity: 0.8;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.project-actions-btn,
.member-actions-btn {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 14px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination button {
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination button.active {
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
}

/* 模态框 */
.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: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.close {
    color: #666;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

#modalBody {
    padding: 60px 30px 30px;
    color: #333;
}

#modalBody h3 {
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

#modalBody label {
    color: #333 !important;
    font-weight: 500;
}

#modalBody input,
#modalBody select,
#modalBody textarea {
    color: #333 !important;
    -webkit-text-fill-color: #333 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid #ddd !important;
}

#modalBody input::placeholder,
#modalBody textarea::placeholder {
    color: #999 !important;
}

#modalBody small {
    color: #666 !important;
}

/* 成员录入页面样式修复 */
#memberInputPage .card-header h2 {
    color: white;
    text-align: center;
    margin: 0;
}

#memberInputPage .form-group label {
    color: white;
}

#memberInputPage .form-group input {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#memberInputPage .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#memberInputPage .form-group input:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
}

/* QR码样式 */
.qr-container {
    text-align: center;
    padding: 20px;
    color: #333;
}

.qr-container h3 {
    color: #333;
    margin-bottom: 15px;
}

.qr-container p {
    color: #666;
    margin: 10px 0;
}

.qr-container canvas {
    margin: 20px 0;
    border-radius: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .page {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .header h1 {
        font-size: 1.5rem;
        justify-content: center;
    }
    
    .search-section {
        flex-direction: column;
    }
    
    .search-bar {
        min-width: 100%;
    }
    
    .project-actions {
        flex-direction: column;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .project-item,
    .member-item {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .project-actions-btn,
    .member-actions-btn {
        justify-content: center;
    }
    
    .project-meta,
    .member-meta {
        justify-content: center;
        text-align: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .btn-sm {
        width: auto;
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.3rem;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .project-name,
    .member-name {
        font-size: 1.1rem;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .pagination button {
        min-width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.project-item,
.member-item {
    animation: fadeIn 0.5s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* 成功/错误消息 */
.message {
    padding: 15px !important;
    border-radius: 10px !important;
    margin-bottom: 20px !important;
    text-align: center !important;
    font-weight: 500 !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 99999 !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
}

.message.success {
    background: rgba(67, 233, 123, 0.95) !important;
    color: #ffffff !important;
    border: 2px solid rgba(67, 233, 123, 1) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.message.error {
    background: rgba(239, 68, 68, 0.95) !important;
    color: #ffffff !important;
    border: 2px solid rgba(239, 68, 68, 1) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.message.info {
    background: rgba(59, 130, 246, 0.95) !important;
    color: #ffffff !important;
    border: 2px solid rgba(59, 130, 246, 1) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* 表格样式 */
.table-responsive {
    overflow-x: auto;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
}

.table {
    width: 100%;
    border-collapse: collapse;
    color: white;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.table th {
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

.table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* 确保所有页面文字清晰可见 */
.page h1, .page h2, .page h3, .page h4, .page h5, .page h6 {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.card-header h1, .card-header h2, .card-header h3 {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 确保所有输入框在焦点状态下文字清晰 */
input:focus, select:focus, textarea:focus {
    color: white !important;
}

/* 当编辑弹窗打开时，强制输入焦点为深色，避免看不见 */
.pc-edit-open input:focus,
.pc-edit-open textarea:focus,
.pc-edit-open select:focus {
    color: #222 !important;
    -webkit-text-fill-color: #222 !important;
}

/* 模态框内的输入框保持深色文字 */
#modalBody input:focus,
#modalBody select:focus,
#modalBody textarea:focus {
    color: #333 !important;
    -webkit-text-fill-color: #333 !important;
}

/* 确保按钮文字始终可见 */
.btn {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 项目和成员信息文字增强 */
.project-info, .member-info {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 搜索栏输入框文字 */
.search-bar input {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.search-bar input:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
    outline: none;
}

.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 确保在所有情况下文字都清晰可见 */
.search-bar input::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-bar input::-moz-placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-bar input:-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* 搜索状态样式 */
.search-bar input.searching {
    background: rgba(74, 172, 254, 0.2);
    border-color: rgba(74, 172, 254, 0.6);
}

/* 搜索结果高亮 */
.search-highlight {
    background: rgba(255, 255, 0, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

/* 无搜索结果提示 */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.no-results i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 搜索统计信息 */
.search-stats {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
}

.search-stats .highlight {
    color: #4facfe;
    font-weight: bold;
}

/* 排序按钮样式 */
#sortByPointsBtn {
    transition: all 0.3s ease;
}

#sortByPointsBtn:hover {
    transform: translateY(-2px) scale(1.05);
}

#sortByPointsBtn.active {
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
}

/* 二维码容器增强 */
.qr-container {
    max-width: 350px;
    margin: 0 auto;
}

.qr-container #qrcode {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.qr-container #qrcode img,
.qr-container #qrcode canvas {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 二维码模态框按钮组 */
.qr-container .btn {
    min-width: 120px;
    margin: 5px;
}

/* 打印相关样式 */
@media print {
    .modal,
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
}

/* 响应式二维码按钮 */
@media (max-width: 480px) {
    .qr-container .btn {
        width: 100%;
        margin: 5px 0;
    }
}