/* 微生物菌种识别平台 - iOS风格样式 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 20px;
}


.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-brand {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.nav-brand i {
    margin-right: 8px;
    color: #007AFF;
    font-size: 1.4rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-points {
    background: #007AFF;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.username {
    font-weight: 500;
    color: #333;
}

/* 按钮样式 */
.btn-primary, .btn-secondary, .btn-upload {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: #007AFF;
    color: white;
}

.btn-primary:hover {
    background: #0056CC;
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.2);
}

.btn-upload {
    background: #34C759;
    color: white;
    font-size: 1rem;
    padding: 15px 30px;
}

.btn-upload:hover {
    background: #28A745;
    transform: translateY(-2px);
}

/* 主要内容 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 欢迎区域 */
.hero-section {
    text-align: center;
    padding: 30px 20px;
    color: white;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 15px auto;
}

/* 确保菌种列表完全居中 */
.hero-content .species-list-container {
    width: 100%;
    text-align: center !important;
    justify-content: center;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* 强制所有子元素居中 */
.hero-content p {
    text-align: center !important;
}

/* 常见菌种区域 */
.common-species-section {
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
}

.species-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    align-items: center;
}

.species-tag {
    background: linear-gradient(135deg, #007AFF, #0056CC);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 122, 255, 0.3);
}

.species-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 122, 255, 0.4);
}

.species-tag:active {
    transform: translateY(0);
}

.separator {
    color: #666;
    font-size: 1.2rem;
    margin: 0 5px;
}

/* 菌种详情模态框 */
.species-detail-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.species-detail-image {
    text-align: center;
}

.species-detail-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.species-detail-description h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.species-detail-description p {
    color: #666;
    line-height: 1.6;
}

/* 加载指示器 */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #007AFF;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 上传区域 */
.upload-section {
    margin: 40px 0;
}

.upload-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.upload-area {
    border: 3px dashed #007AFF;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #0056CC;
    background: rgba(0, 122, 255, 0.05);
}

.upload-area.dragover {
    border-color: #34C759;
    background: rgba(52, 199, 89, 0.1);
}

.upload-icon {
    font-size: 4rem;
    color: #007AFF;
    margin-bottom: 20px;
}

.upload-text h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-text p {
    color: #666;
    margin-bottom: 30px;
}

/* 结果区域 */
.results-section {
    margin: 40px 0;
}

.results-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.result-header h2 {
    color: #333;
    font-size: 1.8rem;
}

.result-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
}

.uploaded-image {
    text-align: center;
}

.uploaded-image h3 {
    margin-bottom: 20px;
    color: #333;
}

.uploaded-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.species-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.species-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.species-item:hover {
    transform: translateY(-2px);
}

.species-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.species-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

.similarity-badge {
    background: #34C759;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.similarity-progress {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.similarity-bar {
    height: 100%;
    background: linear-gradient(90deg, #34C759, #30D158);
    transition: width 0.5s ease;
}

.species-content {
    display: flex;
    gap: 20px;
}

.species-image {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    margin-right: 15px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.species-image:hover {
    transform: scale(1.05);
}

.species-description {
    flex: 1;
    color: #666;
    line-height: 1.6;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h2 {
    color: #333;
    font-size: 1.3rem;
}

.close {
    color: #999;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

/* 表单样式 */
form {
    padding: 20px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
}

.forgot-password {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.forgot-password a {
    color: #007AFF;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password a:hover {
    color: #0056CC;
    text-decoration: underline;
}

.password-requirements {
    margin-top: 5px;
}

.password-requirements small {
    color: #666;
    font-size: 0.8rem;
    line-height: 1.4;
    display: block;
}

/* 个人中心 */
.user-center-content {
    padding: 20px;
}

.user-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.user-info h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 1.2rem;
}

.user-info p {
    margin-bottom: 5px;
    color: #666;
    font-size: 0.95rem;
}

.user-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.change-password-form, .user-history {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.history-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-species {
    font-weight: 500;
    color: #333;
}

.history-time {
    color: #666;
    font-size: 0.9rem;
}

.history-details {
    color: #666;
    font-size: 0.9rem;
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #007AFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 4000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.toast.success .toast-content {
    background: #34C759;
}

.toast.error .toast-content {
    background: #FF3B30;
}

.toast.warning .toast-content {
    background: #FF9500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-menu {
        flex-direction: row;
        gap: 10px;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
    
    .nav-item {
        flex-direction: row;
        gap: 8px;
        align-items: center;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .upload-container, .results-container {
        padding: 20px;
        margin: 20px 10px;
    }
    
    .result-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .result-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .user-actions {
        flex-direction: column;
    }
    
    .species-content {
        flex-direction: column;
    }
    
    .species-image {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .nav-brand {
        font-size: 1.1rem;
    }
    
    .nav-menu {
        gap: 8px;
    }
    
    .nav-item {
        gap: 6px;
    }
    
    .nav-item button {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .user-points {
        font-size: 0.85rem;
    }
    
    .username {
        font-size: 0.9rem;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .upload-text h3 {
        font-size: 1.2rem;
    }
    
    .btn-upload {
        padding: 12px 25px;
        font-size: 0.9rem;
    }
}

/* 充值记录样式 */
.recharge-history {
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.recharge-history::-webkit-scrollbar {
    width: 6px;
}

.recharge-history::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.recharge-history::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.recharge-history::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.recharge-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.recharge-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.recharge-info h4 {
    color: #28a745;
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.recharge-info p {
    margin: 5px 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.recharge-info .status {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.recharge-info .status.completed {
    background: #d4edda;
    color: #155724;
}

.recharge-info .status.pending {
    background: #fff3cd;
    color: #856404;
}

.recharge-info .status.failed {
    background: #f8d7da;
    color: #721c24;
}

.no-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}

