/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    padding-top: 100px; /* 为固定按钮留出空间 */
    position: relative;
}

.container {
    width: 100%;
    max-width: 500px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px 30px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    text-align: center;
    color: #333;
    font-size: 28px;
    margin-bottom: 30px;
    font-weight: 600;
}

/* 密码显示区 */
.password-display {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#passwordOutput {
    flex: 1;
    padding: 15px;
    background: #f7f7f7;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    color: #333;
    word-break: break-all;
    min-height: 50px;
    display: flex;
    align-items: center;
}

.copy-btn {
    padding: 15px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn.copied {
    background: #48bb78;
}

/* 密码强度指示器 */
.strength-indicator {
    margin-bottom: 25px;
}

.strength-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

#strengthText {
    font-weight: 600;
    color: #333;
}

.strength-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.strength-fill.weak {
    width: 33%;
    background: #f56565;
}

.strength-fill.medium {
    width: 66%;
    background: #ed8936;
}

.strength-fill.strong {
    width: 100%;
    background: #48bb78;
}

/* 选项配置区 */
.options {
    margin-bottom: 25px;
}

.option-group {
    margin-bottom: 20px;
}

.option-label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: 500;
    font-size: 15px;
}

.length-value {
    color: #667eea;
    font-weight: 700;
    font-size: 18px;
}

/* 滑块样式 */
.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    background: #5568d3;
    transform: scale(1.2);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    background: #5568d3;
    transform: scale(1.2);
}

/* 复选框组 */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #333;
    font-size: 15px;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: #667eea;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #667eea;
}

/* 生成按钮 */
.generate-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.generate-btn:active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding-top: 90px; /* 移动端为固定按钮留出空间 */
    }

    .card {
        padding: 30px 20px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    #passwordOutput {
        font-size: 14px;
        padding: 12px;
    }

    .copy-btn {
        padding: 12px 16px;
        font-size: 13px;
    }

    .generate-btn {
        font-size: 16px;
        padding: 14px;
    }
}

@media (max-width: 400px) {
    body {
        padding-top: 85px;
    }

    .password-display {
        flex-direction: column;
    }

    .copy-btn {
        width: 100%;
    }
}