/* 密码生成器样式文件 */

.password-generator-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* 密码显示区域 */
.password-display-section {
    margin-bottom: 2rem;
}

.password-output-container {
    position: relative;
    margin-bottom: 1rem;
}

.password-output {
    width: 100%;
    padding: 1rem;
    padding-right: 70px;
    font-size: 1.2rem;
    font-family: 'Courier New', monospace;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.password-output:focus {
    outline: none;
    border-color: var(--primary-color);
}

.password-actions {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.action-btn:active {
    transform: scale(0.95);
}

/* 密码强度指示器 */
.password-strength-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.strength-indicators {
    flex: 1;
    display: flex;
    gap: 4px;
    height: 8px;
}

.strength-bar {
    flex: 1;
    background: var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.strength-bar.weak {
    background: #ff4d4f;
}

.strength-bar.medium {
    background: #faad14;
}

.strength-bar.good {
    background: #52c41a;
}

.strength-bar.strong {
    background: #1890ff;
}

.strength-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-width: 120px;
}

.strength-text.weak {
    color: #ff4d4f;
}

.strength-text.medium {
    color: #faad14;
}

.strength-text.good {
    color: #52c41a;
}

.strength-text.strong {
    color: #1890ff;
}

/* 密码统计信息 */
.password-stats {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

/* 密码设置区域 */
.password-settings {
    background: var(--secondary-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.password-settings h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.setting-item {
    margin-bottom: 1.5rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.range-input {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.range-input::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.range-input::-moz-range-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

/* 字符类型选择 */
.character-types {
    margin-bottom: 1.5rem;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-primary);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    accent-color: var(--primary-color);
}

/* 高级选项 */
.advanced-options {
    background: var(--input-bg);
    border-radius: 6px;
    padding: 1rem;
}

.advanced-options h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
}

#customSymbols {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

/* 预设模板 */
.preset-templates {
    margin-bottom: 2rem;
}

.preset-templates h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.preset-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* 生成按钮 */
.generate-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.generate-section .btn.large {
    flex: 1;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* 密码安全提示 */
.password-tips {
    background: var(--secondary-bg);
    border-radius: 8px;
    padding: 1.5rem;
}

.password-tips h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.password-tips ul {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.password-tips li {
    margin-bottom: 0.5rem;
}

/* 批量生成模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.batch-settings {
    margin-bottom: 1.5rem;
}

.password-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.password-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.password-item:last-child {
    border-bottom: none;
}

.copy-item-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .password-generator-container {
        padding: 1.5rem;
    }
    
    .password-stats {
        gap: 1rem;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .preset-buttons {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .generate-section {
        flex-direction: column;
    }
    
    .password-strength-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .strength-text {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .password-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .action-btn {
        width: 36px;
        height: 36px;
    }
    
    .password-output {
        padding-right: 60px;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.password-generated {
    animation: pulse 0.5s ease;
}

/* 加载状态 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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