/* 组件样式 - Components Styles */

/* 卡片组件 */
.card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4a5568;
    margin: 0;
}

.card-body {
    color: #666;
    line-height: 1.6;
}

/* 结果显示组件 */
.result-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.result-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #4a5568;
    max-width: 100%;
    word-wrap: break-word;
}

.result-meta {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    color: #718096;
}

/* 选择器组件 */
.selector-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.selector-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.selector-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

/* 图片组件 */
.image-container {
    text-align: center;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.image-container:hover img {
    transform: scale(1.02);
}

.image-placeholder {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    color: #718096;
    font-size: 1.1rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
}

.image-placeholder .icon {
    font-size: 3rem;
    opacity: 0.5;
}

/* 加载动画组件 */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.loading-dots::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    animation: loading-dots 1.4s infinite;
}

.loading-dots::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    animation: loading-dots 1.4s infinite 0.2s;
    margin-right: 4px;
}

@keyframes loading-dots {
    0%, 80%, 100% {
        opacity: 0;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 通知组件 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.notification.error {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

.notification.warning {
    background: linear-gradient(135deg, #d69e2e 0%, #b7791f 100%);
}

.notification.info {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
}

/* 模态框组件 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #4a5568;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #718096;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f7fafc;
    color: #4a5568;
}

.modal-body {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

/* 标签组件 */
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 2px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.tag.primary {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-color: rgba(102, 126, 234, 0.2);
}

.tag.success {
    background: rgba(56, 161, 105, 0.1);
    color: #38a169;
    border-color: rgba(56, 161, 105, 0.2);
}

.tag.warning {
    background: rgba(214, 158, 46, 0.1);
    color: #d69e2e;
    border-color: rgba(214, 158, 46, 0.2);
}

.tag.error {
    background: rgba(229, 62, 62, 0.1);
    color: #e53e3e;
    border-color: rgba(229, 62, 62, 0.2);
}

/* 进度条组件 */
.progress {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar.animated {
    background-size: 20px 20px;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    animation: progress-animation 1s linear infinite;
}

@keyframes progress-animation {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 0;
    }
}

/* 响应式组件调整 */
@media (max-width: 768px) {
    .card {
        padding: 15px;
        margin: 10px 0;
    }
    
    .result-container {
        padding: 20px;
        min-height: 150px;
    }
    
    .selector-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 12px;
    }
    
    .result-container {
        padding: 15px;
        min-height: 120px;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
}